package.json and theme.json. This guide explains the version management system.
Semantic Versioning
FreshJuice DEV follows SemVer (Semantic Versioning) with the format:- MAJOR: Breaking changes or major feature releases
- MINOR: New features, backward-compatible
- PATCH: Bug fixes and minor updates
Version Bump Scripts
FreshJuice DEV includes automated version management scripts that:- Bump version in
package.json - Sync version to
theme/theme.json - Maintain consistency across the project
Available Commands
Bumping Versions
Choose the appropriate version bump
Decide which version component to increment:Patch (3.0.0 → 3.0.1):
- Bug fixes
- Minor style tweaks
- Documentation updates
- New features
- New modules or templates
- Backward-compatible enhancements
- Breaking changes
- Major redesign
- Incompatible API changes
Run the version bump command
Execute the appropriate script:This runs
./scripts/bump-theme-version.sh patchHow the Version Script Works
Thebump-theme-version.sh script automates the version bump process:
Script Breakdown
Bump package.json version
Uses npm’s built-in version command:The
--no-git-tag-version flag prevents automatic git tagging.Version Management Workflow
Complete Release Process
Version Consistency
Files Managed by Scripts
The version management system keeps these files synchronized:-
package.json:
-
theme/theme.json:
-
Distribution ZIP filename:
Manual Version Updates
If you must manually update versions:- Update
package.json - Update
theme/theme.json - Verify both files have the same version number
- Run
npm run buildto verify the ZIP filename is correct
Best Practices
When to bump versions
When to bump versions
- Bump before building for release
- Never bump during active development
- Bump after merging feature branches
- Create a git tag after version bumps
Version bump guidelines
Version bump guidelines
- Patch: Small fixes, no new features
- Minor: New features, maintains compatibility
- Major: Breaking changes, major updates
- Follow conventional commits for clarity
Git workflow integration
Git workflow integration
Hotfix workflow
Hotfix workflow
For urgent bug fixes:
Troubleshooting
Script fails with “jq is not installed”:- Install jq using your package manager (see script breakdown above)
- Verify installation:
jq --version
- Run the version script again to resynchronize
- Check both
package.jsonandtheme/theme.json - Manually fix if necessary, then run
npm run build
- Resolve conflicts in
package.jsonandtheme/theme.json - Run version script again after resolving
- Ensure only one version bump happens per release
- Verify
package.jsonversion is correct - Run
npm run buildagain to regenerate ZIP - Check
./_dist/directory for the updated file
Next Steps
Building the Theme
Build production-ready packages with version numbers
HubSpot CLI Guide
Deploy versioned themes to HubSpot