22
33Deep Code uses three scripts to manage version releases in the monorepo:
44
5- | Script | Command | Purpose |
6- | --------| ---------| ---------|
7- | ` scripts/version.js ` | ` npm run release:version ` | Bump all workspace package versions + regenerate lockfile |
8- | ` scripts/prepare-package.js ` | ` npm run prepare:package ` | Build CLI + quality checks + publish to npm + git commit & tag |
9- | ` scripts/prepare-vscode.js ` | ` npm run prepare:vscode ` | Build VSCode extension + quality checks + publish to VS Code Marketplace + git commit & tag |
5+ | Script | Command | Purpose |
6+ | ---------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
7+ | ` scripts/version.js ` | ` npm run release:version ` | Sync root and workspace package versions + update lockfile |
8+ | ` scripts/prepare-package.js ` | ` npm run prepare:package ` | Build CLI + quality checks + publish to npm + git commit & tag |
9+ | ` scripts/prepare-vscode.js ` | ` npm run prepare:vscode ` | Build VSCode extension + quality checks + publish to VS Code Marketplace + git commit & tag |
1010
1111Release flow: bump version first, then publish CLI and VSCode extension separately.
1212
@@ -26,16 +26,16 @@ npm run release:version -- <bump-type | version> [options]
2626
2727### Supported Bump Types
2828
29- | Type | Current | Result | Description |
30- | ------| ---------| --------| -------------|
31- | ` patch ` | ` 0.1.31 ` | ` 0.1.32 ` | Patch version +1 |
32- | ` minor ` | ` 0.1.31 ` | ` 0.2.0 ` | Minor version +1, patch reset |
33- | ` major ` | ` 0.1.31 ` | ` 1.0.0 ` | Major version +1, minor/patch reset |
34- | ` prepatch ` | ` 0.1.31 ` | ` 0.1.32-0 ` | Pre-release patch |
35- | ` preminor ` | ` 0.1.31 ` | ` 0.2.0-0 ` | Pre-release minor |
36- | ` premajor ` | ` 0.1.31 ` | ` 1.0.0-0 ` | Pre-release major |
37- | ` prerelease ` | ` 0.1.31 ` | ` 0.1.32-0 ` | Increment pre-release number |
38- | ` from-git ` | — | Read from latest git tag | For cases where tag exists but package.json not updated |
29+ | Type | Current | Result | Description |
30+ | ------------ | -------- | ------------------------ | ------------------------------------------------------- |
31+ | ` patch ` | ` 0.1.31 ` | ` 0.1.32 ` | Patch version +1 |
32+ | ` minor ` | ` 0.1.31 ` | ` 0.2.0 ` | Minor version +1, patch reset |
33+ | ` major ` | ` 0.1.31 ` | ` 1.0.0 ` | Major version +1, minor/patch reset |
34+ | ` prepatch ` | ` 0.1.31 ` | ` 0.1.32-0 ` | Pre-release patch |
35+ | ` preminor ` | ` 0.1.31 ` | ` 0.2.0-0 ` | Pre-release minor |
36+ | ` premajor ` | ` 0.1.31 ` | ` 1.0.0-0 ` | Pre-release major |
37+ | ` prerelease ` | ` 0.1.31 ` | ` 0.1.32-0 ` | Increment pre-release number |
38+ | ` from-git ` | — | Read from latest git tag | For cases where tag exists but package.json not updated |
3939
4040You can also specify an exact version:
4141
@@ -71,8 +71,8 @@ npm run release:version -- premajor --preid alpha
7171
72721 . Reads current version from ` packages/core/package.json `
73732 . Calculates target version based on bump type
74- 3 . Updates ` version ` field in ** all** ` packages/*/package.json ` (core, cli, vscode-ide-companion)
75- 4 . Deletes old ` package-lock.json ` and regenerates via ` npm install -- package-lock-only `
74+ 3 . Updates the root ` package.json ` and ** all** ` packages/*/package.json ` version fields (core, cli, vscode-ide-companion)
75+ 4 . Updates the root and workspace package version entries in ` package-lock.json `
7676
7777### Examples
7878
@@ -116,25 +116,25 @@ npm run prepare:package -- <version> [options]
116116
117117### Arguments
118118
119- | Argument | Description |
120- | ----------| -------------|
121- | ` <version> ` | ** Required** . Semver version to publish |
122- | ` --tag <dist-tag> ` | npm dist-tag, default ` "latest" ` , commonly ` beta ` or ` next ` |
123- | ` --dry-run ` | Preview mode, no actual writes |
124- | ` --force ` | Skip main branch check, allow publishing from other branches |
119+ | Argument | Description |
120+ | ------------------ | ------------------------------------------------------------ |
121+ | ` <version> ` | ** Required** . Semver version to publish |
122+ | ` --tag <dist-tag> ` | npm dist-tag, default ` "latest" ` , commonly ` beta ` or ` next ` |
123+ | ` --dry-run ` | Preview mode, no actual writes |
124+ | ` --force ` | Skip main branch check, allow publishing from other branches |
125125
126126### Execution Flow (8 Steps)
127127
128- | Step | Action | Description |
129- | ------ | --------| -------------|
130- | 1 | Git check | Working tree must be clean, must be on main branch (` --force ` skips branch check) |
131- | 2 | npm auth | Checks ` npm whoami ` , aborts if not logged in |
132- | 3 | Update versions | Updates ` packages/core ` and ` packages/cli ` version fields |
133- | 4 | Quality checks | ` npm run check ` (typecheck + eslint + prettier) |
134- | 5 | Tests | ` npm run test --workspaces ` |
135- | 6 | Build | ` npm run build ` (core tsc + esbuild inlines core and all deps into ` dist/cli.js ` ) |
136- | 7 | Publish CLI | Writes ` dist/package.json ` with ` dependencies: {} ` , runs ` npm publish ` from ` dist/ ` |
137- | 8 | Git commit & tag | ` chore(release): v<version> ` + ` git tag v<version> ` |
128+ | Step | Action | Description |
129+ | ---- | -- -------------- | ----------------------------------------------------------------------------------- |
130+ | 1 | Git check | Working tree must be clean, must be on main branch (` --force ` skips branch check) |
131+ | 2 | npm auth | Checks ` npm whoami ` , aborts if not logged in |
132+ | 3 | Update versions | Updates ` packages/core ` and ` packages/cli ` version fields |
133+ | 4 | Quality checks | ` npm run check ` (typecheck + eslint + prettier) |
134+ | 5 | Tests | ` npm run test --workspaces ` |
135+ | 6 | Build | ` npm run build ` (core tsc + esbuild inlines core and all deps into ` dist/cli.js ` ) |
136+ | 7 | Publish CLI | Writes ` dist/package.json ` with ` dependencies: {} ` , runs ` npm publish ` from ` dist/ ` |
137+ | 8 | Git commit & tag | ` chore(release): v<version> ` + ` git tag v<version> ` |
138138
139139### Examples
140140
@@ -192,23 +192,23 @@ VSCE_PAT=<token> npm run prepare:vscode -- <version> [options]
192192
193193### Arguments
194194
195- | Argument | Description |
196- | ----------| -------------|
197- | ` <version> ` | ** Required** . Semver version to publish |
198- | ` --dry-run ` | Preview mode, no actual writes |
199- | ` --force ` | Skip main branch check, allow publishing from other branches |
195+ | Argument | Description |
196+ | ----------- | ------------------------------------------------------------ |
197+ | ` <version> ` | ** Required** . Semver version to publish |
198+ | ` --dry-run ` | Preview mode, no actual writes |
199+ | ` --force ` | Skip main branch check, allow publishing from other branches |
200200
201201### Execution Flow (7 Steps)
202202
203- | Step | Action | Description |
204- | ------ | --------| -------------|
205- | 1 | Git check | Working tree must be clean, must be on main branch |
206- | 2 | VSCE_PAT check | Environment variable must be set |
207- | 3 | Update versions | Updates ` packages/core ` , ` packages/cli ` , and ` packages/vscode-ide-companion ` version fields |
208- | 4 | Quality checks | ` npm run check ` (typecheck + eslint + prettier) |
209- | 5 | Tests | ` npm run test --workspaces ` |
210- | 6 | Build | ` npm run build:vscode ` (core tsc + esbuild bundle extension + copy templates + vsce package) |
211- | 7 | Publish | ` vsce publish <version> --no-dependencies ` to VS Code Marketplace |
203+ | Step | Action | Description |
204+ | ---- | -- ------------- | -------------------------------------------------------------------------------------------- |
205+ | 1 | Git check | Working tree must be clean, must be on main branch |
206+ | 2 | VSCE_PAT check | Environment variable must be set |
207+ | 3 | Update versions | Updates ` packages/core ` , ` packages/cli ` , and ` packages/vscode-ide-companion ` version fields |
208+ | 4 | Quality checks | ` npm run check ` (typecheck + eslint + prettier) |
209+ | 5 | Tests | ` npm run test --workspaces ` |
210+ | 6 | Build | ` npm run build:vscode ` (core tsc + esbuild bundle extension + copy templates + vsce package) |
211+ | 7 | Publish | ` vsce publish <version> --no-dependencies ` to VS Code Marketplace |
212212
213213### Examples
214214
0 commit comments