SquibView Release Workflow (to npm)

This guide outlines the steps to create and publish a new release. Replace <VERSION> with the actual version number (e.g., 1.0.1).

0. Prerequisites

1. Set Version, Update Files, Initial Build & Test

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>

2. Full Production Build (If different from script’s build)

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

3. Run All Tests

Ensure all tests pass before proceeding.

npm run test:all

4. Update CDN Example Versions

IMPORTANT: Update the CDN examples to use the new version number.

Update these files:

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>

5. Commit Version Update Changes

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>"

6. Push Release Commit

Push the release commit to the remote repository (if you haven’t already as part of feature merging).

git push origin <branch-name>

7. Create Git Tag

Tag the release commit. Ensure you are on the correct commit before tagging.

git tag -a v<VERSION> -m "Version <VERSION>"

8. Push Tag to Remote

git push origin v<VERSION>

9. Create GitHub Release

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

10. Publish to npm

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

11. Post-Release (Optional Considerations)