Skip to content

Commit 0315cb4

Browse files
authored
Install serve explicitly to ensure we don't have an npx timeout when npm just gives up (#34932)
* Explicitly install serve * Add ignore to knip * lint
1 parent f9265a6 commit 0315cb4

7 files changed

Lines changed: 253 additions & 3 deletions

File tree

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
"postcss-simple-vars": "7.0.1",
202202
"process": "^0.11.10",
203203
"semver": "^7.5.2",
204+
"serve": "catalog:",
204205
"shared-types": "workspace:*",
205206
"source-map-loader": "^5.0.0",
206207
"stylelint": "^17.0.0",

apps/web/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default defineConfig<{}, WorkerOptions>({
9191
trace: "on-first-retry",
9292
},
9393
webServer: {
94-
command: process.env.CI ? "npx serve -p 8080 -L ./webapp" : "nx --outputStyle stream start",
94+
command: process.env.CI ? "pnpm exec serve -p 8080 -L ./webapp" : "nx --outputStyle stream start",
9595
url: `${baseURL}/config.json`,
9696
reuseExistingServer: true,
9797
timeout: (process.env.CI ? 30 : 120) * 1000,

knip.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export default {
8484
// `@vitest/browser/matchers` to resolve under pnpm's strict node_modules.
8585
// See apps/web/tsconfig.browser-test.json.
8686
"@vitest/browser",
87+
88+
// Used by Playwright to serve the built web app.
89+
"serve",
8790
],
8891
},
8992
"apps/desktop": {
@@ -104,6 +107,10 @@ export default {
104107
},
105108
"modules": {
106109
project: ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx,pcss}!", "!playwright/**!"],
110+
ignoreDependencies: [
111+
// Used by Playwright to serve the built web app.
112+
"serve",
113+
],
107114
},
108115
"modules/*": {
109116
entry: ["src/index.ts{x,}!"],

modules/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"test:playwright:screenshots": "nx test:playwright:screenshots --"
1010
},
1111
"devDependencies": {
12-
"@element-hq/element-web-playwright-common": "workspace:*"
12+
"@element-hq/element-web-playwright-common": "workspace:*",
13+
"serve": "catalog:"
1314
},
1415
"private": true
1516
}

modules/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default defineConfig<Options>({
8585
},
8686
webServer: {
8787
command: process.env.WEBAPP_PATH
88-
? `npx serve -p 8080 -L ${process.env.WEBAPP_PATH}`
88+
? `pnpm exec serve -p 8080 -L ${process.env.WEBAPP_PATH}`
8989
: "docker run --rm -p 8080:80 ghcr.io/element-hq/element-web:develop",
9090
url: `${baseURL}/config.json`,
9191
reuseExistingServer: true,

0 commit comments

Comments
 (0)