Spaces:
Sleeping
Sleeping
File size: 2,802 Bytes
d97b8f9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | # Version Management
This document explains how versioning works in the Synthesys PM Tool application.
## Version Format
We follow a modified semantic versioning format: `MAJOR.MINOR.PATCH`
- **MAJOR**: Incremented for incompatible API changes or significant new features that change the application structure
- **MINOR**: Incremented for new features that maintain backward compatibility
- **PATCH**: Incremented for bug fixes and minor changes
## Special Rule
We use a special rule for transitioning between version ranges:
- When `MINOR` reaches 10, we increment `MAJOR` and reset `MINOR` to 0
- Example: 2.10.0 → 3.0.0
## Current Version
The current version is defined in `src/lib/version.ts` and is displayed in:
1. The sidebar footer
2. The landing page footer
3. Package.json
## How to Update the Version
### Automatic Updates During Build
The patch version is automatically incremented every time you run:
- `npm run build`
- `npm run build:dev`
This happens through a pre-build script that increases the patch number by 1 before each build.
> **Note:** The increment script uses ES modules format (`.mjs` extension) since the project has `"type": "module"` in `package.json`.
If you need to build without incrementing the version (e.g., for rebuilding the same version after a small fix), use:
```bash
npm run build:no-version-bump
```
### Using the Version Update Script
For manual version updates (especially for minor and major versions), we've provided a script:
```bash
# Install ts-node if not already installed
npm install -g ts-node
# Update the patch version (for bug fixes)
npx ts-node src/scripts/update-version.ts patch
# Update the minor version (for new features)
npx ts-node src/scripts/update-version.ts minor
# Update the major version (for breaking changes)
npx ts-node src/scripts/update-version.ts major
```
The script will automatically:
- Update the version in `src/lib/version.ts`
- Update the version in `package.json`
### Manual Update
If you need to manually update the version:
1. Update the `APP_VERSION` object in `src/lib/version.ts`
2. Update the `version` field in `package.json`
## Version History
- 2.3.0: Current version
- [Earlier version history not available]
## Best Practices
- Remember that builds automatically increment the patch version
- For significant changes, manually update the minor or major version before building
- Use patch versions for bug fixes and minor improvements
- Use minor versions for new features
- Use major versions for significant changes or redesigns
- Remember the rule: 2.10.0 → 3.0.0 (not 2.10.0 → 2.11.0)
- If you want to build without incrementing the version, use `npm run build:no-version-bump` |