Skip to content

Commit

Permalink
Update mcr.microsoft.com/playwright Docker tag to v1.28.1 (#43)
Browse files Browse the repository at this point in the history
* Update mcr.microsoft.com/playwright Docker tag to v1.28.1

* Bump dependencies

* Fix pnpm-lock

* Stop esbuild in watch mode

* Update TS output to account for bug

microsoft/TypeScript#51626

* Hack

* Ignore server.close errors

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: John Gozde <john@gozde.ca>
  • Loading branch information
renovate[bot] and jgoz committed Nov 26, 2022
1 parent da2eadc commit 8d2c94d
Show file tree
Hide file tree
Showing 13 changed files with 775 additions and 601 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.27.1-focal
FROM mcr.microsoft.com/playwright:v1.28.1-focal

RUN apt-get update && \
# Install node18
Expand Down
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -25,22 +25,22 @@
"devDependencies": {
"@awesome-code-style/eslint-config": "^4.1.0",
"@awesome-code-style/prettier-config": "^4.0.0",
"@changesets/cli": "^2.25.0",
"@changesets/cli": "^2.25.2",
"@tsconfig/node16": "^1.0.3",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"esbuild": "^0.15.12",
"eslint": "^8.26.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"esbuild": "^0.15.15",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"execa": "^5.0.0",
"prettier": "^2.7.1",
"tslib": "^2.4.0",
"prettier": "^2.8.0",
"tslib": "^2.4.1",
"typedoc": "~0.22.0",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"pnpm": {
"overrides": {
Expand Down
22 changes: 11 additions & 11 deletions packages/esbd/package.json
Expand Up @@ -27,34 +27,34 @@
"esbuild": ">= 0.14.51"
},
"devDependencies": {
"@playwright/test": "^1.27.1",
"@playwright/test": "^1.28.1",
"@types/mkdirp": "^1.0.2",
"@types/pretty-time": "^1.1.2",
"@types/serve-static": "^1.15.0",
"@types/wait-on": "^5.3.1",
"chokidar": "^3.5.3",
"cleye": "^1.2.1",
"esbuild": "^0.15.12",
"cleye": "^1.3.1",
"esbuild": "^0.15.15",
"esbuild-node-externals": "^1.5.0",
"execa": "^5.0.0",
"get-port": "^5.0.0",
"io-spin": "^0.4.1",
"memfs": "^3.4.8",
"memfs": "^3.4.12",
"mkdirp": "^1.0.4",
"node-graceful": "^3.1.0",
"parse5": "^7.1.1",
"parse5": "^7.1.2",
"picocolors": "^1.0.0",
"playwright": "^1.27.1",
"prettier": "^2.7.1",
"playwright": "^1.28.1",
"prettier": "^2.8.0",
"pretty-bytes": "^5.6.0",
"pretty-time": "^1.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"serve-static": "^1.15.0",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"vite": "^3.2.1",
"vitest": "^0.25.0",
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"vite": "^3.2.4",
"vitest": "^0.25.3",
"wait-on": "^6.0.1"
},
"scripts": {
Expand Down
11 changes: 9 additions & 2 deletions packages/esbd/src/esbd-serve.ts
Expand Up @@ -223,8 +223,15 @@ export default async function esbdServe(
async function shutdown(exitCode = 0) {
logger.info('Shutting down…');

await promisify(server.close)();
if (lrserver) await promisify(lrserver.close)();
const shutdownPromises: Promise<void>[] = [];
if (server) shutdownPromises.push(promisify(server.close)());
if (lrserver) shutdownPromises.push(promisify(lrserver.close)());
try {
await Promise.all(shutdownPromises);
} catch {
// ignore errors on 'close'
}

if (build) build.stop?.();
if (build) build.rebuild.dispose();
clients.forEach(res => {
Expand Down
12 changes: 6 additions & 6 deletions packages/esbuild-overlay/package.json
Expand Up @@ -29,14 +29,14 @@
},
"devDependencies": {
"@tsconfig/svelte": "^3.0.0",
"esbuild": "^0.15.12",
"esbuild-svelte": "^0.7.1",
"prettier": "^2.7.1",
"svelte": "^3.52.0",
"esbuild": "^0.15.15",
"esbuild-svelte": "^0.7.3",
"prettier": "^2.8.0",
"svelte": "^3.53.1",
"svelte-check": "^2.9.2",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
"typescript": "^4.8.4"
"tslib": "^2.4.1",
"typescript": "^4.9.3"
},
"scripts": {
"docs": "../../scripts/markdown-interpolate.mjs README.md && prettier --write README.md",
Expand Down
14 changes: 7 additions & 7 deletions packages/esbuild-plugin-html/package.json
Expand Up @@ -27,14 +27,14 @@
"esbuild": ">= 0.13.0"
},
"devDependencies": {
"@types/node": "^16.18.2",
"esbuild": "^0.15.12",
"@types/node": "^16.18.3",
"esbuild": "^0.15.15",
"esbuild-node-externals": "^1.5.0",
"parse5": "^7.1.1",
"prettier": "^2.7.1",
"typescript": "^4.8.4",
"vite": "^3.2.1",
"vitest": "^0.25.0"
"parse5": "^7.1.2",
"prettier": "^2.8.0",
"typescript": "^4.9.3",
"vite": "^3.2.4",
"vitest": "^0.25.3"
},
"scripts": {
"docs": "../../scripts/markdown-interpolate.mjs README.md && prettier --write README.md",
Expand Down
18 changes: 9 additions & 9 deletions packages/esbuild-plugin-livereload/package.json
Expand Up @@ -28,20 +28,20 @@
},
"devDependencies": {
"@jgoz/esbuild-overlay": "workspace:*",
"@playwright/test": "^1.27.1",
"@types/node": "^16.18.2",
"esbuild": "^0.15.12",
"@playwright/test": "^1.28.1",
"@types/node": "^16.18.3",
"esbuild": "^0.15.15",
"esbuild-node-externals": "^1.5.0",
"esbuild-svelte": "^0.7.1",
"esbuild-svelte": "^0.7.3",
"get-port": "^5.0.0",
"open-editor": "^3.0.0",
"playwright": "^1.27.1",
"prettier": "^2.7.1",
"svelte": "^3.52.0",
"playwright": "^1.28.1",
"prettier": "^2.8.0",
"svelte": "^3.53.1",
"svelte-check": "^2.9.2",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
"typescript": "^4.8.4"
"tslib": "^2.4.1",
"typescript": "^4.9.3"
},
"scripts": {
"docs": "../../scripts/markdown-interpolate.mjs README.md && prettier --write README.md",
Expand Down
18 changes: 9 additions & 9 deletions packages/esbuild-plugin-sass/package.json
Expand Up @@ -37,16 +37,16 @@
"@types/node-sass": "^4.11.3",
"@types/sass": "^1.43.1",
"autoprefixer": "^10.4.13",
"enhanced-resolve": "^5.10.0",
"esbuild": "^0.15.12",
"enhanced-resolve": "^5.12.0",
"esbuild": "^0.15.15",
"esbuild-node-externals": "^1.5.0",
"postcss": "^8.4.18",
"postcss-preset-env": "^7.8.2",
"prettier": "^2.7.1",
"sass": "^1.55.0",
"typescript": "^4.8.4",
"vite": "^3.2.1",
"vitest": "^0.25.0"
"postcss": "^8.4.19",
"postcss-preset-env": "^7.8.3",
"prettier": "^2.8.0",
"sass": "^1.56.1",
"typescript": "^4.9.3",
"vite": "^3.2.4",
"vitest": "^0.25.3"
},
"scripts": {
"docs": "../../scripts/markdown-interpolate.mjs README.md && prettier --write README.md",
Expand Down
16 changes: 8 additions & 8 deletions packages/esbuild-plugin-typecheck/package.json
Expand Up @@ -36,18 +36,18 @@
},
"devDependencies": {
"@jgoz/esbuild-plugin-livereload": "workspace:*",
"@types/node": "^16.18.2",
"esbuild": "^0.15.12",
"@types/node": "^16.18.3",
"esbuild": "^0.15.15",
"esbuild-node-externals": "^1.5.0",
"execa": "^5.0.0",
"memfs": "^3.4.8",
"memfs": "^3.4.12",
"picocolors": "^1.0.0",
"prettier": "^2.7.1",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"prettier": "^2.8.0",
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"unionfs": "^4.4.0",
"vite": "^3.2.1",
"vitest": "^0.25.0"
"vite": "^3.2.4",
"vitest": "^0.25.3"
},
"scripts": {
"docs": "../../scripts/markdown-interpolate.mjs README.md && prettier --write README.md",
Expand Down
Expand Up @@ -245,7 +245,18 @@ describe('eslint-plugin-typecheck', () => {

it('produces no output by default', async () => {
const { output } = await build.run('pkg-three/build.js', [], { watch: true });
expect(output).toEqual(['✔ Typecheck passed', 'ℹ Typecheck finished in TIME']);

try {
expect(output).toEqual(['✔ Typecheck passed', 'ℹ Typecheck finished in TIME']);
} catch {
// TODO: remove after https://github.com/microsoft/TypeScript/pull/51626 is released
expect(output).toEqual([
'✔ Typecheck passed',
'ℹ Typecheck finished in TIME',
'✔ Typecheck passed',
'ℹ Typecheck finished in TIME',
]);
}

await expect(build.findTSOutput()).resolves.toEqual([]);
});
Expand All @@ -269,6 +280,13 @@ describe('eslint-plugin-typecheck', () => {
"../pkg-one/one.ts(7,33): error TS2504: Type 'AsyncIterator<string, any, undefined>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.",
'✖ Typecheck failed with 1 error',
'ℹ Typecheck finished in TIME',

// TODO: remove after https://github.com/microsoft/TypeScript/pull/51626 is released
"../pkg-one/one.ts(7,33): error TS2504: Type 'AsyncIterator<string, any, undefined>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.",
'✖ Typecheck failed with 1 error',
'ℹ Typecheck finished in TIME',
// /TODO

// two-error
"../pkg-two/two.ts(8,33): error TS2504: Type 'AsyncIterator<string, any, undefined>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.",
"../pkg-one/one.ts(7,33): error TS2504: Type 'AsyncIterator<string, any, undefined>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.",
Expand All @@ -281,6 +299,11 @@ describe('eslint-plugin-typecheck', () => {
// two
'✔ Typecheck passed',
'ℹ Typecheck finished in TIME',

// TODO: remove after https://github.com/microsoft/TypeScript/pull/51626 is released
'✔ Typecheck passed',
'ℹ Typecheck finished in TIME',
// /TODO
]);

await expect(build.findTSOutput()).resolves.toEqual([
Expand All @@ -302,7 +325,17 @@ describe('eslint-plugin-typecheck', () => {
watch: true,
});

expect(output).toEqual(['✔ Typecheck passed', 'ℹ Typecheck finished in TIME']);
try {
expect(output).toEqual(['✔ Typecheck passed', 'ℹ Typecheck finished in TIME']);
} catch {
// TODO: remove after https://github.com/microsoft/TypeScript/pull/51626 is released
expect(output).toEqual([
'✔ Typecheck passed',
'ℹ Typecheck finished in TIME',
'✔ Typecheck passed',
'ℹ Typecheck finished in TIME',
]);
}

await expect(build.findTSOutput()).resolves.toEqual([
'pkg-one/build/one.js',
Expand Down
Expand Up @@ -2,20 +2,30 @@

const { typecheckPlugin } = require('../../../lib');
const { build } = require('esbuild');
const path = require('path');

build({
absWorkingDir: __dirname,
entryPoints: ['./three.ts'],
bundle: true,
format: 'esm',
outdir: './dist',
platform: 'node',
plugins: [
typecheckPlugin({
buildMode: process.env.BUILD_MODE,
}),
],
watch: !!process.env.WATCH,
write: false,
}).catch(() => process.exit(1));
async function main() {
try {
const result = await build({
absWorkingDir: __dirname,
entryPoints: ['./three.ts'],
bundle: true,
format: 'esm',
outdir: './dist',
platform: 'node',
plugins: [
typecheckPlugin({
buildMode: process.env.BUILD_MODE,
}),
],
watch: !!process.env.WATCH,
write: false,
});
process.on('SIGTERM', () => {
result.stop();
});
} catch (error) {
process.exit(1);
}
}

main();
34 changes: 22 additions & 12 deletions packages/esbuild-plugin-typecheck/test/fixture/compile/build.js
Expand Up @@ -2,16 +2,26 @@

const { typecheckPlugin } = require('../../lib');
const { build } = require('esbuild');
const path = require('path');

build({
absWorkingDir: __dirname,
entryPoints: ['./src/index.ts'],
bundle: true,
format: 'esm',
outdir: './dist',
platform: 'node',
plugins: [typecheckPlugin()],
watch: !!process.env.WATCH,
write: false,
}).catch(() => process.exit(1));
async function main() {
try {
const result = await build({
absWorkingDir: __dirname,
entryPoints: ['./src/index.ts'],
bundle: true,
format: 'esm',
outdir: './dist',
platform: 'node',
plugins: [typecheckPlugin()],
watch: !!process.env.WATCH,
write: false,
});
process.on('SIGTERM', () => {
result.stop();
});
} catch (error) {
process.exit(1);
}
}

main();

0 comments on commit 8d2c94d

Please sign in to comment.