Upgrading¶
An app has two parts from roux, and they upgrade differently.
- roux's packages,
github.com/jwcarman/rouxand@jwcarman/roux-web: raise the versions and fix what no longer compiles. A breaking change fails loudly (a compile error, a type error, a test), and the changelog says what to do for each. - The files the template gave the app (the Makefile,
scripts/dev.sh,vite.config.ts...): they became the app's own when it was made, and an upgrade never changes them. Each release below lists the ones it changed, to bring over by hand.
Upgrade one release at a time, oldest first: each section assumes the one before it.
How¶
- The packages, in the app's directory:
go get github.com/jwcarman/roux@v0.5.0 && go mod tidy
(cd frontend && npm install @jwcarman/roux-web@0.5.0)
- The release's template, to copy from: a fresh app at that version, under the app's own name, outside the app:
mkdir -p /tmp/roux-0.5.0 && cd /tmp/roux-0.5.0
npm create @jwcarman/roux-app@0.5.0 team-planner -- --name "Team Planner"
Its files carry the app's name where the template does (the Makefile's bin/team-planner), so
a file the app never edited is copied whole; one it changed is merged.
-
The steps for the release, below.
-
The gates:
make check, and infrontend/npm run lint,npm run coverageandnpm run build(which type-checks). Thenmake dev, and sign in.
0.4.0 to 0.5.0¶
The packages.
historyQueryisactivityQuery(@jwcarman/roux-web/activity), with the same arguments: rename the import and the calls. The type check names each one.- A user's history (
GET /api/roux/users/{id}/activities) shows only roux'suser.*kinds. An app whose own kinds are nameduser.*renames them (a newType(); old rows keep the old code). - The organization's context has a
weekStart. A test fixture that builds the context by hand addsweekStart: 0(testOrganization()has it).
The template's files. make dev became the live loop (the server under air, Vite at
http://localhost:5173), and the lint is pinned:
| File | What to do |
|---|---|
.air.toml, scripts/dev.sh |
Copy (new files). |
go.mod |
go get -tool github.com/air-verse/air@v1.67.4 (air is a go tool), then go mod tidy. |
Makefile |
Merge: dev runs scripts/dev.sh after its frontend/node_modules prerequisite; lint builds the pinned golangci-lint (GOLANGCI_LINT_VERSION, the $(GOLANGCI_LINT) rule); the new frontend/node_modules/.package-lock.json and frontend/dist/index.html rules. |
e2e/run.sh |
The front-end line is make --no-print-directory frontend/dist/index.html. |
frontend/vite.config.ts |
Copy, or merge the serverShell() plugin and server.port: 5173 with strictPort. |
frontend/index.html |
The theme script is <script nonce="__CSP_NONCE__">. |
.gitignore, .dockerignore |
Add /tmp/ and tmp (air's build). |