diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..228f5676 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,4 @@ +- Never commit and/or push before the user has tested your changes! +- You do not need to manually build the web project, the user has npm run dev running in a separate terminal +- Never screenshot via puppeteer. always query the DOM to see what's what. +- NEVER EVER USE SETTIMEOUT FOR ANYTHING IN THE FRONTEND UNLESS EXPLICITELY PERMITTED \ No newline at end of file diff --git a/web/package-lock.json b/web/package-lock.json index 0a93298b..9080f356 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@xterm/addon-fit": "^0.10.0", "@xterm/addon-web-links": "^0.11.0", + "@xterm/headless": "^5.5.0", "@xterm/xterm": "^5.5.0", "asciinema-player": "^3.7.0", "express": "^4.18.2", @@ -2671,6 +2672,12 @@ "@xterm/xterm": "^5.0.0" } }, + "node_modules/@xterm/headless": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.5.0.tgz", + "integrity": "sha512-5xXB7kdQlFBP82ViMJTwwEc3gKCLGKR/eoxQm4zge7GPBl86tCdI0IdPJjoKd8mUSFXz5V7i/25sfsEkP4j46g==", + "license": "MIT" + }, "node_modules/@xterm/xterm": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz", diff --git a/web/package.json b/web/package.json index ec7e36eb..db93d917 100644 --- a/web/package.json +++ b/web/package.json @@ -15,7 +15,7 @@ "bundle": "npm run bundle:client && npm run bundle:renderer && npm run bundle:test", "bundle:client": "esbuild src/client/app-entry.ts --bundle --outfile=public/bundle/client-bundle.js --format=esm --sourcemap --external:@xterm/xterm/css/xterm.css", "bundle:renderer": "esbuild src/client/renderer-entry.ts --bundle --outfile=public/bundle/renderer.js --format=esm --sourcemap", - "bundle:test": "esbuild src/client/components/mobile-terminal.ts --bundle --outfile=public/bundle/mobile-terminal.js --format=esm --sourcemap", + "bundle:test": "esbuild src/client/test-terminals-entry.ts --bundle --outfile=public/bundle/terminal.js --format=esm --sourcemap", "bundle:watch": "concurrently \"npm run bundle:client -- --watch\" \"npm run bundle:renderer -- --watch\" \"npm run bundle:test -- --watch\"", "start": "node dist/server.js", "test": "jest", @@ -31,6 +31,7 @@ "dependencies": { "@xterm/addon-fit": "^0.10.0", "@xterm/addon-web-links": "^0.11.0", + "@xterm/headless": "^5.5.0", "@xterm/xterm": "^5.5.0", "asciinema-player": "^3.7.0", "express": "^4.18.2", diff --git a/web/public/tests/dom-terminal-test.html b/web/public/tests/dom-terminal-test.html new file mode 100644 index 00000000..8ebd23c2 --- /dev/null +++ b/web/public/tests/dom-terminal-test.html @@ -0,0 +1,197 @@ + + +
+ + +