Repository navigation
fix(frontend-vite): generate routes before build and add a clean-clone CI build (D-0536) - #213
Merged
Merged
Conversation
…e CI build (D-0536) routes.generated.tsx is gitignored and had no generator, so vite build failed from a clean clone. Add scripts/generate-routes.mjs (reads each page's F-NCHAT-VITE-ROUTE header), run it as pre-dev/build/type-check/test, and add a frontend-vite workflow that checks out the sibling packages repo, builds the linked @nself/* dist and builds + tests the app.
PR Checks Summary
✅ All checks passed! Ready for review. |
Security Scan Results: PASSED
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
D-0536 (fixed)
frontend-vite/src/routes.generated.tsxis gitignored (*.generated.*) and nothing produced it, sovite buildfailed from a clean clone.scripts/generate-routes.mjs(+ pureroutes-lib.mjs) builds the table from theF-NCHAT-VITE-ROUTEheader everysrc/pages/*Page.tsxalready carries. Output carries aGENERATED BY ... DO NOT HAND EDITmarker. It runs aspredev,prebuild,pretype-check,pretest.scripts/routes-lib.test.mjs(6 tests): every page declares a unique route,/exists, the public allowlist has no stale entry, rendered table is marked and split correctly, bad/duplicate headers are rejected..github/workflows/frontend-vite.yml: checks outnself-org/packagesat the same pinned sha as the desktop workflows into the sibling path, installs both lockfiles, builds the five linked@nself/*packages (dist + d.ts), thenpnpm --filter @nchat/frontend-vite buildandtest.tscerrors from the row come fromtscfalling throughtsconfigpaths (../../packages/@nself/*/dist/index.d.ts) into the sibling's rawsrcand applying this app'snoUnusedLocalsto it (3 at the pinned sha). Building the packages' dist first removes them, which is why the job has that step. No change to the app's strictness.Left open from the row (a decision, not code): whether
@nself/i18nshould share the app's i18next. Finding recorded in the README: the app imports only@nself/i18n(noi18next/react-i18nextimport insrc), so there is one i18n context today. The declaredreact-i18nextdep in frontend-vite is unused; removing it touches the lockfile, so I left it.Before/after (scratch clean layout
<tmp>/nchat+<tmp>/packages@8a5cc53, packages dist built):npx vite build->Could not load .../src/routes.generated (imported by src/App.tsx)pnpm build-> tsc clean,vite buildbuilt 107 lazy page chunks;pnpm test-> 6/6 passedactionlint .github/workflows/frontend-vite.ymlcleanD-0535 (no change: already resolved)
gh api repos/nself-org/nchat/dependabot/alerts?state=openreturns 0. #473/#485 i18next-http-backend fixed (frontend ^4.0.2, locked 4.0.4), #482 postcss-selector-parser fixed (only 7.1.6 locked), #476-#481 otel instrumentations fixed (fe0db64 floors;@sentry/nextjsand@sentry/nodeare 11.9.0 in the lockfile), #474/#475 stream-json dismissed tolerable_risk with reason (detox -> bunyamin needs 1.x; re-entry D-1080), #484 sprintf-js withdrawn by GitHub (410).D-0011 (no change: blocked)
Needs the owner's call (relicense AGPL, replace
@signalapp/libsignal-client/ffmpeg-static, or accept and document).LICENSEis still plain MIT and both deps are still infrontend/package.json. Not touched, per the row.