diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 292808a..dcb4154 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,4 +1,4 @@ -name: Deploy Editor to GitHub Pages +name: Publish Editor to GitHub Pages on: push: @@ -36,17 +36,13 @@ jobs: - name: Build editor working-directory: ./test-harness - run: pnpm exec vite build --base=/backgammon-board/ - - - name: Add root redirect to editor - run: | - echo '' > test-harness/dist/index.html + run: pnpm run build:inline - uses: actions/configure-pages@v4 - uses: actions/upload-pages-artifact@v3 with: - path: test-harness/dist + path: test-harness/dist-inline - id: deployment uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index d2e686d..0724148 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules /test-harness/test-results/ /test-harness/playwright-report/ /test-harness/dist/ +/test-harness/dist-inline/ /blob-report/ /playwright/.cache/ /dist/ diff --git a/test-harness/editor/Editor.tsx b/test-harness/editor/Editor.tsx index 77f8667..db51382 100644 --- a/test-harness/editor/Editor.tsx +++ b/test-harness/editor/Editor.tsx @@ -454,7 +454,7 @@ const THEME_LABELS: [ThemeKey, string][] = [ ["doublingCubeColor", "Doubling Cube"], ]; -const DOUBLING_VALUES: DoublingCube["value"][] = [2, 4, 8, 16, 32]; +const DOUBLING_VALUES: DoublingCube["value"][] = [2, 4, 8, 16, 32, 64]; // ── Shared UI primitives ──────────────────────────────────────────────────── diff --git a/test-harness/package.json b/test-harness/package.json index de66208..17b606b 100644 --- a/test-harness/package.json +++ b/test-harness/package.json @@ -3,12 +3,14 @@ "type": "module", "scripts": { "dev": "vite --host", + "build:inline": "vite build --config vite.config.inline.ts", "e2e": "playwright test", "e2e:update": "playwright test --update-snapshots" }, "dependencies": { "@fontsource/open-sans": "^5.1.1", "@playwright/test": "^1.49.1", - "vite": "^5.4.10" + "vite": "^5.4.10", + "vite-plugin-singlefile": "^2.1.0" } } diff --git a/test-harness/pnpm-lock.yaml b/test-harness/pnpm-lock.yaml index c02f982..6483bc3 100644 --- a/test-harness/pnpm-lock.yaml +++ b/test-harness/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: vite: specifier: ^5.4.10 version: 5.4.11 + vite-plugin-singlefile: + specifier: ^2.1.0 + version: 2.3.2(rollup@4.30.1)(vite@5.4.11) packages: @@ -200,51 +203,61 @@ packages: resolution: {integrity: sha512-PaMRNBSqCx7K3Wc9QZkFx5+CX27WFpAMxJNiYGAXfmMIKC7jstlr32UhTgK6T07OtqR+wYlWm9IxzennjnvdJg==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.30.1': resolution: {integrity: sha512-B8Rcyj9AV7ZlEFqvB5BubG5iO6ANDsRKlhIxySXcF1axXYUyqwBok+XZPgIYGBgs7LDXfWfifxhw0Ik57T0Yug==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.30.1': resolution: {integrity: sha512-hqVyueGxAj3cBKrAI4aFHLV+h0Lv5VgWZs9CUGqr1z0fZtlADVV1YPOij6AhcK5An33EXaxnDLmJdQikcn5NEw==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.30.1': resolution: {integrity: sha512-i4Ab2vnvS1AE1PyOIGp2kXni69gU2DAUVt6FSXeIqUCPIR3ZlheMW3oP2JkukDfu3PsexYRbOiJrY+yVNSk9oA==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.30.1': resolution: {integrity: sha512-fARcF5g296snX0oLGkVxPmysetwUk2zmHcca+e9ObOovBR++9ZPOhqFUM61UUZ2EYpXVPN1redgqVoBB34nTpQ==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.30.1': resolution: {integrity: sha512-GLrZraoO3wVT4uFXh67ElpwQY0DIygxdv0BNW9Hkm3X34wu+BkqrDrkcsIapAY+N2ATEbvak0XQ9gxZtCIA5Rw==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.30.1': resolution: {integrity: sha512-0WKLaAUUHKBtll0wvOmh6yh3S0wSU9+yas923JIChfxOaaBarmb/lBKPF0w/+jTVozFnOXJeRGZ8NvOxvk/jcw==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.30.1': resolution: {integrity: sha512-GWFs97Ruxo5Bt+cvVTQkOJ6TIx0xJDD/bMAOXWJg8TCSTEK8RnFeOeiFTxKniTc4vMIaWvCplMAFBt9miGxgkA==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.30.1': resolution: {integrity: sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.30.1': resolution: {integrity: sha512-V9U8Ey2UqmQsBT+xTOeMzPzwDzyXmnAoO4edZhL7INkwQcaW1Ckv3WJX3qrrp/VHaDkEWIBWhRwP47r8cdrOow==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.30.1': resolution: {integrity: sha512-WabtHWiPaFF47W3PkHnjbmWawnX/aE57K47ZDT1BXTS5GgrBUEpvOzq0FI0V/UYzQJgdb8XlhVNH8/fwV8xDjw==} @@ -264,11 +277,19 @@ packages: '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} hasBin: true + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -279,6 +300,14 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + nanoid@3.3.8: resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -287,6 +316,10 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + playwright-core@1.49.1: resolution: {integrity: sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==} engines: {node: '>=18'} @@ -310,6 +343,17 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + vite-plugin-singlefile@2.3.2: + resolution: {integrity: sha512-b8SxCi/gG7K298oJDcKOuZeU6gf6wIcCJAaEqUmmZXdjfuONlkyNyWZC3tEbN6QockRCNUd3it9eGTtpHGoYmg==} + engines: {node: '>18.0.0'} + peerDependencies: + rollup: ^4.59.0 + vite: ^5.4.11 || ^6.0.0 || ^7.0.0 || ^8.0.0 + vite@5.4.11: resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -477,6 +521,10 @@ snapshots: '@types/estree@1.0.6': {} + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -503,16 +551,29 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + fsevents@2.3.2: optional: true fsevents@2.3.3: optional: true + is-number@7.0.0: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + nanoid@3.3.8: {} picocolors@1.1.1: {} + picomatch@2.3.2: {} + playwright-core@1.49.1: {} playwright@1.49.1: @@ -554,6 +615,16 @@ snapshots: source-map-js@1.2.1: {} + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + vite-plugin-singlefile@2.3.2(rollup@4.30.1)(vite@5.4.11): + dependencies: + micromatch: 4.0.8 + rollup: 4.30.1 + vite: 5.4.11 + vite@5.4.11: dependencies: esbuild: 0.21.5 diff --git a/test-harness/vite.config.inline.ts b/test-harness/vite.config.inline.ts new file mode 100644 index 0000000..c165c8b --- /dev/null +++ b/test-harness/vite.config.inline.ts @@ -0,0 +1,13 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; +import { viteSingleFile } from "vite-plugin-singlefile"; + +// Builds the editor as a single self-contained HTML file with all JS/CSS inlined +export default defineConfig({ + root: "editor", + plugins: [react(), viteSingleFile()], + build: { + outDir: "../dist-inline", + emptyOutDir: true, + }, +});