Release builds and build artefacts
The bundles
The monorepo build outputs list the files: MAPP builds the npm package into apps/mapp/dist and copies mapp.js, its source map and mapp.css into public; MAPP.UI writes ui.js and ui.css into public directly.
The MAPP build ends with scripts/copyPublic.mjs, which copies the bundle from dist into public.[1] The UI build writes to public/js/lib without emptying it, so each build keeps the other's bundle.[2]
pnpm build # all packages
pnpm build --filter=@geolytix/mapp --filter=@geolytix/mapp-ui--filter=@geolytix/mapp alone does not build MAPP.UI. The XYZ views load both from public.
Gitignored on development branches
The public bundles are gitignored, so they are not tracked on patch, minor and major and changes to apps/mapp and apps/ui never conflict in build output.[3] Only main and the release tags carry them. A checkout of either, or a source archive, is deployable without a build; anything else must be built before it is deployed or run.
The release workflow runs on every push to main. For an untagged version it tests, builds the bundles with --force, commits them in a Build <tag> commit, pushes main and the tag atomically, creates the GitHub release from release-notes/<tag>.md, and merges main into patch without the bundles. A run which created the release then publishes the knowledge portal from the tag. A push to main without the bundles, eg. a squash merge, is rebuilt even when the tag exists.[4] The step-by-step release procedure is in RELEASING.md.
Turborepo cache
The build outputs of apps/mapp/turbo.json and apps/ui/turbo.json list the public files and dist, so Turborepo restores them from its cache when the sources are unchanged.[5] Deleting public/js/lib and building again is safe. Add --force to skip the cache, eg. for a stale frontend.
Debug and stamped builds
NODE_ENV=DEVELOPMENT pnpm build --filter=@geolytix/mapp --filter=@geolytix/mapp-ui
node utils/version.jsNODE_ENV=DEVELOPMENT turns off minification for browser debugging; do not deploy such a bundle. utils/version.js writes the current commit SHA as hash into apps/mapp/lib/mapp.mjs and runs pnpm build, so a deployment shows which framework commit it runs.[6] It edits a tracked source file; do not commit that change by accident.
Pre-cached workspace
pnpm workspace:cache resolves the workspace through Varlock and inlines every src response into one JSON, so a deployment does not fetch remote templates on a cold start. It writes apps/xyz/workspace.generated.json, the default --output relative to apps/xyz; run node ./utils/cache-workspace.js --help from apps/xyz for --workspace and --output.[7] Point WORKSPACE at the file and make sure it ships. Module templates keep their src and are read at runtime, since their render functions cannot be serialised.
CI workflows
| Workflow | Trigger | Purpose |
|---|---|---|
biome.yml | push, PR | biome ci ., and a check that apps/mapp does not reference MAPP.UI |
unit_tests.yml | push, PR on main, major, minor, patch | pnpm test |
build.yml | push on those branches, any PR | coverage and SonarQube, skipped for fork PRs |
knowledge-check.yml | push, PR on those branches | knowledge:test, knowledge:check, knowledge:examples, knowledge:site:build |
knowledge-freshness.yml | PR into major, minor, patch, and label changes | knowledge:changed, with --warn-only for the knowledge-unaffected label, see knowledge checks |
mapp_package.yml | push on those branches, PRs touching the package | packs and tests @geolytix/mapp, see MAPP package |
publish_mapp.yml | manual | publishes @geolytix/mapp to npm |
deploy-docs.yml | called by release.yml with the tag, manual with a release line, an existing tag or a commit on a release line | the knowledge portal to GitHub Pages, see documentation publishing |
release.yml | push to main | builds, tags and releases, see above |
No workflow deploys the app. DEPLOYMENT.md listed build.yml PRs as limited to the release branches, and omitted the knowledge and MAPP package workflows.
apps/mapp/scripts/copyPublic.mjs. ↩︎
apps/ui/vite.config.mjs
emptyOutDir: false. ↩︎DEPLOYMENT.md "Build artefacts" and "CI". ↩︎
.github/workflows/release.yml. ↩︎
apps/mapp/turbo.json and apps/ui/turbo.json; the root turbo.json lists no outputs. ↩︎
utils/version.js. ↩︎
apps/xyz/utils/cache-workspace.js. ↩︎