Skip to content

Commit c7b7833

Browse files
Generate cli/package.json from root during build
- Remove cli/package.json from git (now generated) - Add description and license to root package.json - cli:build now generates cli/package.json with jq - Single source of truth for version
1 parent 026d2c2 commit c7b7833

4 files changed

Lines changed: 18 additions & 49 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dist-ssr
3131
.vibora/
3232

3333
# CLI build artifacts (generated by mise run cli:build)
34+
cli/package.json
3435
cli/server/
3536
cli/dist/
3637
cli/drizzle/

cli/package.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

mise.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,6 @@ run = "bun run drizzle-kit generate"
7979
description = "Apply migrations"
8080
run = "bun run drizzle-kit migrate"
8181

82-
[tasks.version]
83-
description = "Bump version in both package.json files"
84-
usage = '''
85-
arg "<bump>" help="Version bump type: major, minor, or patch"
86-
'''
87-
run = """
88-
set -e
89-
npm version ${usage_bump} --no-git-tag-version
90-
cd cli && npm version ${usage_bump} --no-git-tag-version
91-
VERSION=$(jq -r .version package.json)
92-
cd ..
93-
echo "Bumped to $VERSION"
94-
echo "Run: git add package.json cli/package.json && git commit -m 'Bump version to $VERSION' && git push"
95-
"""
96-
9782
# CLI tasks
9883
[tasks."cli"]
9984
description = "Run CLI command"
@@ -115,6 +100,21 @@ depends = ["build"]
115100
run = """
116101
set -e
117102
103+
# Generate cli/package.json from root package.json
104+
echo "Generating cli/package.json..." >&2
105+
jq '{
106+
name,
107+
version,
108+
description,
109+
license,
110+
repository: {type: "git", url: "https://github.com/knowsuchagency/vibora"},
111+
homepage: "https://github.com/knowsuchagency/vibora",
112+
type: "module",
113+
bin: {vibora: "bin/vibora.js"},
114+
files: ["bin/", "server/", "lib/", "dist/", "drizzle/", "README.md", "LICENSE"],
115+
engines: {bun: ">=1.0.0"}
116+
}' package.json > cli/package.json
117+
118118
# Bundle server
119119
echo "Bundling server..." >&2
120120
bun build server/index.ts --target=bun --outfile=cli/server/index.js

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"name": "vibora",
33
"private": true,
44
"version": "1.12.0",
5+
"description": "The Vibe Engineer's Cockpit",
6+
"license": "PolyForm-Shield-1.0.0",
57
"type": "module",
68
"scripts": {
79
"dev": "vite --host",

0 commit comments

Comments
 (0)