mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-09 18:10:13 -06:00
- brand.toml is the only place the product name lives; every crate and app
reads it through dac-brand (env vars with legacy fallback, settings folder
with copy-only migration, default library, preset extensions, i18n {app})
- cargo xtask brand check|test, run|install|package, docs, rename-crates,
deny and immich; packaging files are templates rendered from brand.toml
- icons regenerated from brand/icon.svg; upstream branding removed
- MIT licence (segment and fetch stay Apache-2.0); cargo deny licence policy
- clean-room rules in AGENTS.md/CLAUDE.md; docs/upstream-merge.md
- plan/ rebuilt and committed; parity tracker reopens Classic rows, adds
PLAN.md section 2 rows and the IMM Immich section; plan/immich.md and a
pinned Immich test server
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3.8 KiB
3.8 KiB
Merging upstream (LightCraft)
This repository is a fork of LightCraft. The fork point is tagged fork-base, so
git log --oneline fork-base..upstream/main
always lists what upstream has done since. Merge it in weekly at first (more often while the code bases are still close, since small merges are cheap and big ones are not).
Remotes (one-time)
git remote -v # upstream = the LightCraft repository, origin = this fork
git remote add upstream ../lightcraft # only if it is missing
The routine
- Fetch.
git fetch upstream git log --oneline fork-base..upstream/main | wc -l # how much is new - Merge on a branch named for the day:
Git's rename detection maps upstream's
git switch -c merge/upstream-$(date +%Y%m%d) main git merge --no-ff upstream/mainapps/lightcraft,apps/lightcraft-cliandapps/lightcraft-webontoapps/app,apps/cliandapps/web. Resolve content conflicts as usual, but never by hand-editing names (step 3 does that). - Map upstream crate names to ours. Upstream calls its crates
lightcraft-*(pathslightcraft_*); ours use the internal prefix (dac-*). Rewrite every incoming reference in the files the merge touched:Only names of crates this workspace has are rewritten (cargo xtask rename-crates --upstream # files changed since fork-base, plus conflicted files cargo xtask rename-crates --upstream --since HEAD~1 # narrower: only what this merge broughtlightcraft-raw→dac-raw,lightcraft_engine::→dac_engine::,-p lightcraft→-p dac-app). A crate upstream added is not known yet: rename its package todac-<name>in itsCargo.toml, register it inxtask/src/layers.rs, and run the command again. - Remove upstream's product name everywhere else. Upstream writes "LightCraft",
lightcraft,LIGHTCRAFT_*and its app id into code, docs and packaging; here every name comes frombrand.toml:lists eachcargo xtask brand checkfile:line. Fix them with the brand constants (dac_brand::DISPLAY_NAME,dac_brand::env("LOG"),dac_brand::fill("… {app} …")),{{app}}/{{binary}}placeholders in*.md.indocs andpackaging/**/*.intemplates, or neutral wording ("the app"). New legacy handling (code that must name an old identity to migrate from it) goes inLEGACY_FILESinxtask/src/brand.rs, and the old values in[legacy]ofbrand.toml. - Regenerate and verify.
cargo xtask docs # re-render *.md.in after upstream doc changes cargo xtask ci # fmt, brand check, docs --check, clippy, tests, parity, layers, assets, deny, wasm cargo xtask brand test # optional locally; CI runs it: the throw-away brand shows nowhere else - Commit, review, merge. Commit the merge (one commit for the merge itself, separate commits for the
rename and brand fixes keep the history readable), open a PR from
merge/upstream-YYYYMMDD, and merge it intomainonce CI is green.
Notes
- Upstream renames are resolved by the brand tooling (
rename-crates --upstream,brand check), never by hand-editing names; if a pattern keeps coming back, teach the tooling instead. - Licence: upstream code arrives under MIT OR Apache-2.0; we use it under MIT and keep upstream's copyright lines in
LICENSE/NOTICE.crates/segmentandcrates/fetchstay Apache-2.0.cargo deny check licenses(part ofcargo xtask ci) catches a dependency upstream adds under a licencedeny.tomldoes not allow. - To change our own crate prefix (an internal codename users never see), run
cargo xtask rename-crates <prefix>in a commit of its own, then re-check that--upstreamstill maps cleanly.