Skip to content

Commit

Permalink
chore: update TypeScript to v5.7 (#33994)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Dec 13, 2024
1 parent dd36de7 commit 65688d6
Show file tree
Hide file tree
Showing 16 changed files with 151 additions and 145 deletions.
251 changes: 133 additions & 118 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@types/codemirror": "^5.60.7",
"@types/formidable": "^2.0.4",
"@types/immutable": "^3.8.7",
"@types/node": "^18.19.39",
"@types/node": "^18.19.68",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"@types/ws": "^8.5.3",
Expand Down Expand Up @@ -99,7 +99,7 @@
"react": "^18.1.0",
"react-dom": "^18.1.0",
"ssim.js": "^3.5.0",
"typescript": "^5.5.3",
"typescript": "^5.7.2",
"vite": "^5.4.6",
"ws": "^8.17.1",
"xml2js": "^0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/html-reporter/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import type { HTMLReport } from './types';
import type zip from '@zip.js/zip.js';
import type * as zip from '@zip.js/zip.js';
// @ts-ignore
import * as zipImport from '@zip.js/zip.js/lib/zip-no-worker-inflate.js';
import * as React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/client/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class ElectronApplication extends ChannelOwner<channels.ElectronApplicati

async firstWindow(options?: { timeout?: number }): Promise<Page> {
if (this._windows.size)
return this._windows.values().next().value;
return this._windows.values().next().value!;
return await this.waitForEvent('window', options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,6 @@ class CRAXNode implements accessibility.AXNode {
for (const childId of node._payload.childIds || [])
node._children.push(nodeById.get(childId)!);
}
return nodeById.values().next().value;
return nodeById.values().next().value!;
}
}
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/webkit/wkPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ export class WKPage implements PageDelegate {
this.validateScreenshotDimension(rect.height, omitDeviceScaleFactor);
const result = await this._session.send('Page.snapshotRect', { ...rect, coordinateSystem: documentRect ? 'Page' : 'Viewport', omitDeviceScaleFactor });
const prefix = 'data:image/png;base64,';
let buffer = Buffer.from(result.dataURL.substr(prefix.length), 'base64');
let buffer: Buffer = Buffer.from(result.dataURL.substr(prefix.length), 'base64');
if (format === 'jpeg')
buffer = jpegjs.encode(PNG.sync.read(buffer), quality).data;
return buffer;
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright/src/common/testLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function loadTestFile(file: string, rootDir: string, testErrors?: T
suite.allTests().map(t => files.add(t.location.file));
if (files.size === 1) {
// All tests point to one file.
const mappedFile = files.values().next().value;
const mappedFile = files.values().next().value!;
if (suite.location.file !== mappedFile) {
// The file is different, check for a likely source map case.
if (path.extname(mappedFile) !== path.extname(suite.location.file))
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright/src/reporters/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class HtmlBuilder {

let singleTestId: string | undefined;
if (htmlReport.stats.total === 1) {
const testFile: TestFile = data.values().next().value.testFile;
const testFile: TestFile = data.values().next().value!.testFile;
singleTestId = testFile.tests[0].testId;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/playwright/src/runner/testServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ type StdioPayload = {
};

function chunkToPayload(type: 'stdout' | 'stderr', chunk: Buffer | string): StdioPayload {
if (chunk instanceof Buffer)
if (chunk instanceof Uint8Array)
return { type, buffer: chunk.toString('base64') };
return { type, text: chunk };
}
Expand Down
2 changes: 1 addition & 1 deletion packages/trace-viewer/src/sw/lruCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class LRUCache<K, V> {
const result = compute();

while (this._map.size && this._size + result.size > this._maxSize) {
const [firstKey, firstValue] = this._map.entries().next().value;
const [firstKey, firstValue] = this._map.entries().next().value!;
this._size -= firstValue.size;
this._map.delete(firstKey);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/trace-viewer/src/ui/networkResourceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const ResponseTab: React.FunctionComponent<{
const BodyTab: React.FunctionComponent<{
resource: ResourceSnapshot;
}> = ({ resource }) => {
const [responseBody, setResponseBody] = React.useState<{ dataUrl?: string, text?: string, mimeType?: string, font?: BinaryData } | null>(null);
const [responseBody, setResponseBody] = React.useState<{ dataUrl?: string, text?: string, mimeType?: string, font?: BufferSource } | null>(null);

React.useEffect(() => {
const readResources = async () => {
Expand Down Expand Up @@ -158,7 +158,7 @@ const BodyTab: React.FunctionComponent<{
};

const FontPreview: React.FunctionComponent<{
font: BinaryData;
font: BufferSource;
}> = ({ font }) => {
const [isError, setIsError] = React.useState(false);

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/treeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function TreeView<T extends TreeItem>({
const itemData = treeItems.get(child as T);
return itemData && <TreeItemHeader
key={child.id}
item={child}
item={child as T}
treeItems={treeItems}
selectedItem={selectedItem}
onSelected={onSelected}
Expand Down
6 changes: 3 additions & 3 deletions tests/components/ct-vue-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"dependencies": {
"core-js": "^3.8.3",
"vue": "3.2.36",
"vue-router": "^4.1.5"
"vue": "^3.2.36",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@babel/core": "^7.23.2",
Expand All @@ -20,7 +20,7 @@
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/tsconfig": "^0.1.3",
"@vue/tsconfig": "^0.7.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/components/ct-vue-cli/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["src/**/*", "src/**/*.vue"],
"exclude": ["src/**/*.spec.*/*"],
"compilerOptions": {
Expand Down
2 changes: 1 addition & 1 deletion tests/components/ct-vue-cli/tsconfig.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@vue/tsconfig/tsconfig.node.json",
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["playwright.config.*"],
"compilerOptions": {
"composite": true,
Expand Down
9 changes: 0 additions & 9 deletions tests/components/ct-vue-vite/tsconfig.node.json

This file was deleted.

0 comments on commit 65688d6

Please sign in to comment.