This guide outlines the steps to create and publish a new release.
Replace <VERSION>
with the actual version number (e.g., 1.0.1
).
main
or a dedicated release preparation branch).git status
shows no uncommitted changes beyond what’s intended for the release).git checkout main
).git pull origin <branch-name>
(e.g., git pull origin main
).This step uses the dev-bump-build-test.sh
script. It will:
1. Update package.json
to <VERSION>
.
2. Update package-lock.json
. (npm install --package-lock-only)
3. Run tools/updateVersion.js
to generate src/version.js
.
4. Run npm run build:esm-only
(as per the script).
5. Run npm test -- tests/SquibView.test.js
(as per the script).
sh dev-bump-build-test.sh <VERSION>
sh dev-bump-build-test.sh 1.0.1
The dev-bump-build-test.sh
script runs build:esm-only
. If your full production build is different (e.g., npm run build
which might build multiple formats):
npm run build
Ensure all tests pass before proceeding.
npm run test:all
IMPORTANT: Update the CDN examples to use the new version number.
Update these files:
examples/example_esm_cdn.html
examples/example_umd_cdn.html
Replace the version in the CDN URLs:
// ESM CDN exampleimportSquibViewfrom'https://cdn.jsdelivr.net/npm/squibview@<VERSION>/dist/squibview.esm.min.js';
// UMD CDN example<scriptsrc="https://unpkg.com/squibview@<VERSION>/dist/squibview.umd.min.js"></script>
Commit the version changes made to package.json
, package-lock.json
, src/version.js
, and CDN examples.
git add package.json package-lock.json src/version.js examples/example_*_cdn.html
git commit -m "Release v<VERSION>"
git commit -m "Release v1.0.1"
Push the release commit to the remote repository (if you haven’t already as part of feature merging).
git push origin <branch-name>
git push origin main
Tag the release commit. Ensure you are on the correct commit before tagging.
git tag -a v<VERSION> -m "Version <VERSION>"
git tag -a v1.0.1 -m "Version 1.0.1"
git push origin v<VERSION>
git push origin v1.0.1
Use the GitHub CLI to create the release on GitHub. This will use the tag you just pushed.
gh release create v<VERSION> --title "Version <VERSION>" --generate-notes --latest
gh release create v<VERSION> --title "Version <VERSION>" --notes "Your detailed release notes here." --latest
Always do a dry run first! This shows you what files will be published without actually publishing.
npm publish --dry-run
Review the output carefully. Check the file list and package version.
If the dry run is satisfactory:
npm publish
main
(if not already done) and then into any active long-term development branches.git checkout main && git pull && git checkout <develop-branch> && git pull && git merge main