A folder of components and configuration that is shared between RSV website repos via git submodules.
Warning
Submodules are tricky!
Put the rsv-shared repo and all website repos in a local rsv-landingages folder.
The scripts will rely on this structure.
/Development/rsv-landingages/rsv-shared– Repo with shared code that we access via git submodules/Development/rsv-landingages/rsv-rs8- the/sharedfolder hold the code of thersv-sharedrepo as a git submodule/Development/rsv-landingages/rsv-frm7- dito
- Submodules are only updated when pulled (from inside the website repo).
- The commit that the Submodule represents is checked in via a commit in the website repo.
- In order to update a Submodule, you need to pull it and also commit this pull in the website repo.
- We never work on the rsv-shared repo directly.
- Instead we work on the website repo, then check in changes to the submodule from within that repo.
- Afterwards we have to sync those changes to the other repos.
Before we start the dev server, we ensure that our submodule is clean (everything is comitted) and fetch the latest submodule code.
See pre-dev.ts, triggered by npm run predev
Before we push the website project, we ensure that our submodule is clean (everythign is committed) and pushed.
See pre-push.ts, triggered by Husky's pre-push
After we changed something, we should update all other projects.
(TODO) We have a helper scripts that will traverse the rsv-landingages folders.
git submodule add https://github.com/FixMyBerlin/rsv-shared.git shared
To create a new sibling repo (e.g. rsv-rs8) from an existing one, run the
bootstrap script from inside any existing website repo:
bun ./shared/scripts/new-project.ts \
--slug rs8 \
--cms-name RS8 \
--display-name "Radschnellweg 8" \
--url https://rs8.example.deThe script copies the current repo into a sibling rsv-<slug> folder and rewrites
project-specific values (config/config.ts, README.md, .env*, package.json).
It does not run git or npm — in the new folder run git init, add the
rsv-shared submodule at shared/, create
the GitHub repo, npm install, then commit and push. See
shared/docs/NEW-PROJECT.md section 0 for the exact commands.
After the script finishes, work through
shared/docs/NEW-PROJECT.md for the manual
follow-ups (Keystatic GitHub App, Netlify, DNS, brand colors, favicons).
See shared/scripts/new-project.ts for the full
list of flags (run with --help).