@fugood/bricks-project 2.24.0-beta.26 → 2.24.0-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/tools/deploy.ts +27 -2
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.24.0-beta.26",
3
+ "version": "2.24.0-beta.27",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "typecheck": "tsc --noEmit",
7
7
  "build": "bun scripts/build.js"
8
8
  },
9
9
  "dependencies": {
10
- "@fugood/bricks-cli": "^2.24.0-beta.26",
10
+ "@fugood/bricks-cli": "^2.24.0-beta.27",
11
11
  "@huggingface/gguf": "^0.3.2",
12
12
  "@iarna/toml": "^3.0.0",
13
13
  "@modelcontextprotocol/sdk": "^1.15.0",
@@ -24,5 +24,5 @@
24
24
  "peerDependencies": {
25
25
  "oxfmt": "^0.36.0"
26
26
  },
27
- "gitHead": "e64d47dd9bb23cf01ebac0e088188728dfee0c05"
27
+ "gitHead": "350125f32a6f2eb620c76ba22ea084fd7359e9d7"
28
28
  }
package/tools/deploy.ts CHANGED
@@ -8,6 +8,8 @@ const {
8
8
  changelogs: changelogsArg,
9
9
  'changelogs-file': changelogsFile,
10
10
  'auto-commit': autoCommit,
11
+ 'auto-version': autoVersion,
12
+ version: versionArg,
11
13
  yes,
12
14
  help,
13
15
  },
@@ -17,6 +19,8 @@ const {
17
19
  changelogs: { type: 'string' },
18
20
  'changelogs-file': { type: 'string' },
19
21
  'auto-commit': { type: 'boolean' },
22
+ 'auto-version': { type: 'boolean' },
23
+ version: { type: 'string' },
20
24
  yes: { type: 'boolean', short: 'y' },
21
25
  help: { type: 'boolean', short: 'h' },
22
26
  },
@@ -28,6 +32,8 @@ if (help) {
28
32
  --changelogs <text> Changelogs text for the release
29
33
  --changelogs-file <path> Read changelogs from a file
30
34
  --auto-commit Auto-commit unstaged changes before deploying
35
+ --auto-version Auto-bump patch version before deploying
36
+ --version <version> Set explicit version for the release
31
37
  -y, --yes Skip all prompts
32
38
  -h, --help Show this help message`)
33
39
  process.exit(0)
@@ -46,9 +52,28 @@ if (!isGitRepo && !yes) {
46
52
  const app = await Bun.file(`${cwd}/application.json`).json()
47
53
  const config = await Bun.file(`${cwd}/.bricks/build/application-config.json`).json()
48
54
 
49
- // Get version from project's package.json
55
+ // Resolve version: explicit flag > auto-bump > package.json
50
56
  const pkgFile = Bun.file(`${cwd}/package.json`)
51
- const version = (await pkgFile.exists()) ? (await pkgFile.json()).version : undefined
57
+ const pkgExists = await pkgFile.exists()
58
+ let version: string | undefined
59
+
60
+ if (versionArg) {
61
+ version = versionArg
62
+ if (pkgExists) {
63
+ const pkg = await pkgFile.json()
64
+ pkg.version = version
65
+ await Bun.write(`${cwd}/package.json`, JSON.stringify(pkg, null, 2) + '\n')
66
+ }
67
+ } else if (autoVersion && pkgExists) {
68
+ const pkg = await pkgFile.json()
69
+ const parts = (pkg.version || '0.0.0').split('.')
70
+ parts[2] = String(Number(parts[2] || 0) + 1)
71
+ version = parts.join('.')
72
+ pkg.version = version
73
+ await Bun.write(`${cwd}/package.json`, JSON.stringify(pkg, null, 2) + '\n')
74
+ } else {
75
+ version = pkgExists ? (await pkgFile.json()).version : undefined
76
+ }
52
77
 
53
78
  // Get changelog from flag or file
54
79
  let changelogs = ''