Part of #6.
The download subline on the homepage is built from a committed JSON file that the release command writes but never commits, so the site advertises whatever version somebody last remembered to commit by hand. Today that is older than the version package.json says is being built, and nothing anywhere fails to say so.
What is there today
package.json#L4is"0.1.1", bumped in7f4d3cd. The only published release isv0.1.0, which is also the only tag in the repository.resources/data/release.json#L2is still"0.1.0". It was committed once, in 4667358, and no commit has touched it since.- The homepage imports that file at
resources/views/index.stx#L47, builds the download subline from it atresources/views/index.stx#L50(Version ${release.version}, macOS ${release.minimumMacOS} or later, ...), and renders it under the download button atresources/views/index.stx#L326. The page therefore says version 0.1.0. app/Uplink/service.ts#L56hardcodes<key>CFBundleShortVersionString</key><string>0.1.0</string>in theInfo.plistthatbuildBundlewrites atapp/Uplink/service.ts#L98.infoPlist()atapp/Uplink/service.ts#L46takes no arguments, so no caller can pass a version in. That is the from-source bundle, sobuddy uplink:installon a tree at 0.1.1 installs a bundle reporting 0.1.0.- Two places already do it correctly.
app/Desktop/launcher.ts#L46callsstartDesktopAgent({ version: pkg.version })from the import atapp/Desktop/launcher.ts#L18, andapp/Commands/Uplink.ts#L191reads the version out ofpackage.jsonand passes it to the DMG build asDESKTOP_APP_VERSIONatapp/Commands/Uplink.ts#L212. - The seam is the release path.
app/Commands/Uplink.ts#L223writesresources/data/release.jsonafter the build and beforegh release createatapp/Commands/Uplink.ts#L229, and never commits it. The comment above it atapp/Commands/Uplink.ts#L222says to commit it, which is a note to the maintainer, not something the command does. The tagged commit never contains its own release metadata, and becauserelease.jsonis a build input the homepage only changes after a follow up commit and the deploy that CI triggers for main (.github/workflows/deploy.yml#L11). - A grep for
0.1.0across the repository finds exactly two live copies,app/Uplink/service.ts#L56andresources/data/release.json#L2, both current on main whilepackage.jsonsays 0.1.1.
Proposal
- In
app/Uplink/service.ts, importpackage.jsonthe wayapp/Desktop/launcher.ts#L18does and interpolatepkg.versionintoCFBundleShortVersionStringatapp/Uplink/service.ts#L56.infoPlist()keeps its empty signature, soapp/Uplink/service.ts#L98is unchanged. - In
app/Commands/Uplink.ts, stage and commitresources/data/release.jsonimmediately after writing it at line 223, beforegh release createat line 229.ghcreates the tag from the remote tip, so the commit has to land and be pushed first for the tag to point at a commit whoserelease.jsonmatches the DMG being uploaded. - Add a check script that reads
package.jsonandresources/data/release.jsonand exits non zero when the two versions differ. Wire it as apackage.jsonscript and run it as a step in thelintjob of.github/workflows/ci.yml, which already installs dependencies at.github/workflows/ci.yml#L45and runsbun buddy lintat.github/workflows/ci.yml#L50.
Requirements
package.json#L4becomes the only version literal in the repository.resources/data/release.jsonstays committed, because the homepage imports it at build time (resources/views/index.stx#L47), but itsversionfield is generated by the release command and never typed by hand.- The bump and the release travel in one commit. The check makes it impossible to bump
package.jsonahead of a release without regeneratingrelease.json, which is exactly the state that produced today's disagreement. If a bump has to land before the release, the same commit updatesrelease.json. - Do not touch the source bundle's identity.
app/Uplink/service.ts#L21keepscom.stacksjs.uplink.sourcedeliberately distinct from the downloadable app's bundle id, for the Full Disk Access reason documented in the comment above it. OnlyCFBundleShortVersionStringchanges. - The check compares versions only.
bytesatapp/Commands/Uplink.ts#L225is the size of the built DMG and cannot be verified in CI without building one, so leave it out of the assertion. - The check script is a new file in a directory that does not exist yet.
package.json#L76andpackage.json#L82already invoke.github/scripts/check-declarations-fresh.tsand.github/scripts/check-lockfile-version.ts, but.github/scripts/is absent from this repository, so the script cannot assume it is there.
Acceptance
- A grep for the current version string across
app/,resources/andconfig/findspackage.jsononly. buddy uplink:installon a tree at 0.1.1 producesstorage/uplink/Uplink.app/Contents/Info.plistwithCFBundleShortVersionString0.1.1.- Editing
resources/data/release.jsonto a version other than the one inpackage.jsonfails CI in thelintjob, with a message naming both values. - After a
buddy uplink:releaserun, the tag it created points at a commit that already contains the matchingresources/data/release.json, and the homepage shows the new version on the next deploy with no extra commit.