Generate Brief /.well-known/brief.json from env (single source of truth) - #34
Merged
Conversation
Stop treating the checked-in public/.well-known/brief.json as source of truth. Add scripts/generate-brief-config.js (BRIEF_CLIENT_CONFIG or BRIEF_*/FIREBASE_*/VUE_APP_* compose, optional fetch) and wire it into prebuild, preserve, and deploy.js so every gh-pages publish refreshes the brochure from env in sync with mvtt-server client-config. Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
Document BRIEF_FETCH_CONFIG=1 + BRIEF_CONFIG_URL as the preferred cmutt deploy path so Pages copies client-config from the API (server .env is the only human edit). Discrete BRIEF_* remain for offline CI. When fetch is enabled, the generator tries the remote URL first. Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
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.
Summary
Stops treating the checked-in
public/.well-known/brief.jsonas source of truth. Build/deploy generates that file from env / the live API so it cannot drift from mvtt-server.Production SSOT (preferred for cmutt)
Humans edit brochure values only on the server (e.g.
.env.cmu-tt). Pages copies the live API at deploy:Put these in the production deploy
.env/.env.local. WhenBRIEF_FETCH_CONFIG=1,scripts/generate-brief-config.jsfetches first (compose / blob / stub are fallbacks).Other paths
BRIEF_*in.env.test(no network)BRIEF_CLIENT_CONFIGJSON blobChanges
prebuild/preserve/deploy.jswiringexample.envdocument Option C as preferred production pathLive Pages
cmutt.app/.well-known/brief.jsonupdates only vianpm run deploywith Brief fetch (or compose) env set. CI build does not publish to gh-pages.Test plan
.env.testwrites expected JSONnpm run buildsucceeds;dist/.well-known/brief.jsonpresentBRIEF_FETCH_CONFIG=1copies API client-config to Pages