The page's script is TypeScript in web/src, built and minified with swc
- web/src/*.ts: the script that was inline in index.html and login.html, split along its existing sections. Still one scope, concatenated in order, not modules. - web/build.mjs strips the types, puts the script in the page and minifies it with swc; build.rs runs it into OUT_DIR and web.rs include_str!s the result. 137 KB -> 106 KB. - npx tsc -p . type-checks web/src, loosely; the handful of annotations it needed change no behaviour. - The Docker build installs node and swc (npm ci --omit=dev). - Two list requests racing no longer let the older one win, and switching tabs clears the selection it closes, which made a browser test flaky. Closes #23, #24. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
17
package.json
17
package.json
@@ -1,13 +1,20 @@
|
||||
{
|
||||
"name": "ipx-ui-tests",
|
||||
"name": "ipx-web",
|
||||
"private": true,
|
||||
"description": "Browser tests for the ipx web UI. The Rust tests cover the server; these cover the page.",
|
||||
"description": "Builds the ipx web pages from web/src (web/build.mjs, run by build.rs) and tests them. The Rust tests cover the server.",
|
||||
"scripts": {
|
||||
"build": "node web/build.mjs",
|
||||
"typecheck": "tsc -p .",
|
||||
"smoke": "node tests/page-smoke.js",
|
||||
"test": "playwright test",
|
||||
"test:headed": "playwright test --headed",
|
||||
"smoke": "node tests/page-smoke.js"
|
||||
"test:headed": "playwright test --headed"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.56.0"
|
||||
"@playwright/test": "^1.56.0",
|
||||
"typescript": "^7.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@swc/core": "^1.16.2",
|
||||
"@swc/html": "^1.16.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user