Create a file transifex.auth in the root folder of the Rapid project.
This file should contain your API bearer token, for example:
{ "token": "1/f306870b35f5182b5c2ef80aa4fd797196819cb132409" }See: https://developers.transifex.com/reference/api-authentication for information on generating an API bearer token.
(This file is .gitignored)
The main branch includes all the code, but we don't check in the built assets to git.
(Many of the files in /dist are in .gitignore)
# Make sure your main branch is up to date and all tests pass
git checkout main
git pull origin
npm run test
# Pick a version, see https://semver.org/ - for example: 'A.B.C' or 'A.B.C-pre.D'
# - We do this step first because the files in `/dist` will include this version in their metadata
# - Update `CHANGELOG.md`
# - Set release version number in `modules/core/context.js` and `package.json`
# Store in environment variable for later (replace below with the actual version)
export VERSION=rapid-A.B.C-pre.D
npm run build
git add . && git commit -m "$VERSION"
# Update imagery
rm -rf package-lock.json node_modules/editor-layer-index/
npm install
npm run imagery
npm run build
git add . && git commit -m 'npm run imagery'
# Update translations
npm run translations
npm run build
git add . && git commit -m 'npm run translations'
# Update main branch
git push origin main
The release branch checks in the contents of /dist too, this makes it suitable for deployment.
It's basically a copy of main but with one additional commit appended to it.
This will also be the commit that we tag and publish.
(We use -f to force check-in all the files in /dist)
git checkout release
git reset --hard main
npm run all
git add -f dist
git commit -m 'Check in build'
git push origin -f release- At this point, our GitHub deploy action should notice that a commit was pushed to the release branch.
- You can check the status of the action to see where the release got deployed: https://github.com/facebook/Rapid/actions/workflows/deploy.yml
- There will be a URL like https://rapideditor.org/rapid/release-3549c3c/index.html
- Test it!
- If something looks wrong, you can still go back to
mainand push more commits, then remake thereleasebranch as above.
Confirm that publish will work, and that it won't be >150 MB. If it is too large, the JSDelivr CDN will not serve it. See Rapid#1561
npm publish --dry-runTypically you should see something like this:
npm notice package size: 24.5 MB
npm notice unpacked size: 94.8 MB
(someday: can we automate this check?)
The point of no return, tag and publish:
git tag "$VERSION"
git push origin "$VERSION"
npm publishSet as latest release on GitHub:
- Open https://github.com/facebook/Rapid/blob/main/CHANGELOG.md and copy the URL to the new release
- Open https://github.com/facebook/Rapid/tags and pick the new tag you just pushed
- There should be a link like "create a release from the tag", click that, and paste in the link to the changelog.
Rapid is set up to do deploys automatically from a GitHub Action (see above).
(We use AWS web console to promote a release to rapideditor.org/rapid or other URLs.)
You can also manually deploy Rapid someplace just by copying the /dist folder, for example:
git checkout release
aws s3 cp dist <destination>curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid/dist/rapid.css'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid/dist/rapid.js'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid/dist/rapid.min.js'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid@2.5/dist/rapid.css'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid@2.5/dist/rapid.js'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid@2.5/dist/rapid.min.js'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.css'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.js'
curl 'https://purge.jsdelivr.net/npm/@rapideditor/rapid@2/dist/rapid.min.js'See https://github.com/rapideditor/rapid-standalone After publishing a new version of Rapid, you should also refresh and publish a new version of that project too.
Notify anyone who uses Rapid that there is a new release. This section is to keep track of those.
- Discourse: https://community.openstreetmap.org/
- Diaries: https://openstreetmap.org/diary
- OSM-US Slack: https://osmus.slack.com/
- Discord: https://discord.gg/openstreetmap
https://github.com/maproulette/maproulette3
https://github.com/hotosm/tasking-manager