diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1514abf0..56deb9b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,14 +29,13 @@ jobs: cache: npm - name: Install dependencies run: npm ci - - name: Compile Stylus - run: npm run build:css - name: Run lint run: npm run lint - - name: Run unit tests - run: npm run test:jest - name: Build + # Also compiles the Stylus that the unit tests import. run: npm run build + - name: Run unit tests + run: npm run test:jest e2e: name: End-to-end tests diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c11dd7ca..ad4b7209 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -97,11 +97,6 @@ jobs: package-manager-cache: false - name: Install dependencies run: npm ci - - name: Compile Stylus - # Must run before the Vite build: the components import the - # generated CSS, and `npm run build` orders build:app before - # build:css. - run: npm run build:css - name: Build run: npm run build diff --git a/AGENTS.md b/AGENTS.md index 00b9a7dd..09c2ca59 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,7 +87,7 @@ npm test # lint -> test:jest -> test:playwright npm run build:app # vite build npm run build:version.json # writes build/version.json; must run after build:app, needs git on PATH -npm run size # source-map-explorer on build/assets/index-*.js (needs a prior build) +npm run size # source-map-explorer on build/assets/index-*.js (rebuilds build/ with source maps first) ``` Run one Vitest file: `npx vitest run src/tests/jest/Dashboard.test.jsx`. Run one Playwright spec: `npx playwright test contact.spec.js`. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e59a4c60..4a084407 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ how to work in the code, not what the code is. npm run build:app # vite build; confirmed working, no flags needed npm run build:version.json # writes build/version.json; must run after build:app, needs git on PATH - npm run size # source-map-explorer on build/assets/index-*.js (needs a prior build) + npm run size # source-map-explorer on build/assets/index-*.js (rebuilds build/ with source maps first) npm run test:playwright # every Playwright project; starts the dev server itself if # one isn't already running on :3000 npm run test:playwright:recorded # specs on the recording (CI's required check) diff --git a/package.json b/package.json index 0bdb64f3..ae5b0b51 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "npm-run-all --parallel watch:css watch:app", "watch:css": "stylus --watch --sourcemap src/components/views/styl/* --out ./src/components/views/css/", "watch:app": "vite", - "build": "npm-run-all build:*", + "build": "run-s build:css build:app build:version.json", "build:css": "stylus --sourcemap ./src/components/views/styl/* --out ./src/components/views/css/", "build:app": "vite build", "build:version.json": "node scripts/generateVersionJSON", @@ -22,7 +22,7 @@ "test:playwright:recorded": "playwright test --project=chromium --project=chromium-no-js", "test:playwright:live": "playwright test --project=live-data", "posttest": "npm audit || true", - "size": "source-map-explorer build/assets/index-*.js --no-border-checks", + "size": "npm run build:css && vite build --sourcemap && source-map-explorer build/assets/index-*.js --no-border-checks", "record:fixtures": "node scripts/recordPlaywrightFixtures.js" }, "dependencies": { diff --git a/public/img/ogimage.xcf b/public/img/ogimage.xcf deleted file mode 100644 index e50993e5..00000000 Binary files a/public/img/ogimage.xcf and /dev/null differ diff --git a/vite.config.mjs b/vite.config.mjs index 35f802e2..3572a17d 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -9,9 +9,6 @@ export default defineConfig({ }, build: { outDir: 'build', - // Needed for `npm run size` (source-map-explorer) to inspect the - // production bundle's composition. - sourcemap: true, }, test: { // Scope to the unit tests only - Vitest's default glob also matches