Skip to content

Release builds and build artefacts ​

Guide draft deployment build release turbo ci

Where the MAPP and MAPP.UI bundles are built and committed, how Turborepo caches them, debug and version-stamped builds, the pre-cached workspace and the CI workflows; use before deploying a branch or changing the build.

Resource and sources

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]

bash
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 ​

bash
NODE_ENV=DEVELOPMENT pnpm build --filter=@geolytix/mapp --filter=@geolytix/mapp-ui
node utils/version.js

NODE_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 ​

WorkflowTriggerPurpose
biome.ymlpush, PRbiome ci ., and a check that apps/mapp does not reference MAPP.UI
unit_tests.ymlpush, PR on main, major, minor, patchpnpm test
build.ymlpush on those branches, any PRcoverage and SonarQube, skipped for fork PRs
knowledge-check.ymlpush, PR on those branchesknowledge:test, knowledge:check, knowledge:examples, knowledge:site:build
knowledge-freshness.ymlPR into major, minor, patch, and label changesknowledge:changed, with --warn-only for the knowledge-unaffected label, see knowledge checks
mapp_package.ymlpush on those branches, PRs touching the packagepacks and tests @geolytix/mapp, see MAPP package
publish_mapp.ymlmanualpublishes @geolytix/mapp to npm
deploy-docs.ymlcalled by release.yml with the tag, manual with a release line, an existing tag or a commit on a release linethe knowledge portal to GitHub Pages, see documentation publishing
release.ymlpush to mainbuilds, 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.


  1. apps/mapp/scripts/copyPublic.mjs. ↩︎

  2. apps/ui/vite.config.mjs emptyOutDir: false. ↩︎

  3. DEPLOYMENT.md "Build artefacts" and "CI". ↩︎

  4. .github/workflows/release.yml. ↩︎

  5. apps/mapp/turbo.json and apps/ui/turbo.json; the root turbo.json lists no outputs. ↩︎

  6. utils/version.js. ↩︎

  7. apps/xyz/utils/cache-workspace.js. ↩︎

XYZ v5.1.0. Generated from knowledge/ at dd7a6fa27736502733499c1bf485f15659b10338. Concepts marked draft are not reviewed.