bincode-cli 1.0.1 โ 1.0.2
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.
- package/package.json +20 -24
- package/script/publish.ts +101 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"name": "bincode-cli",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"build": "bun run script/build.ts",
|
|
11
11
|
"dev": "bun run --conditions=browser ./src/index.ts",
|
|
12
12
|
"publish:cli": "bun run script/publish.ts",
|
|
13
|
+
"prepublishOnly": "echo 'Preparing to publish...'",
|
|
13
14
|
"random": "echo 'Random script updated at $(date)' && echo 'Change queued successfully' && echo 'Another change made' && echo 'Yet another change' && echo 'One more change' && echo 'Final change' && echo 'Another final change' && echo 'Yet another final change'",
|
|
14
15
|
"clean": "echo 'Cleaning up...' && rm -rf node_modules dist",
|
|
15
16
|
"lint": "echo 'Running lint checks...' && bun test --coverage",
|
|
@@ -45,17 +46,16 @@
|
|
|
45
46
|
"@parcel/watcher-linux-x64-musl": "2.5.1",
|
|
46
47
|
"@parcel/watcher-win32-x64": "2.5.1",
|
|
47
48
|
"@standard-schema/spec": "1.0.0",
|
|
48
|
-
"@tsconfig/bun": "
|
|
49
|
+
"@tsconfig/bun": "1.0.9",
|
|
49
50
|
"@types/babel__core": "7.20.5",
|
|
50
|
-
"@types/bun": "
|
|
51
|
+
"@types/bun": "1.3.4",
|
|
51
52
|
"@types/turndown": "5.0.5",
|
|
52
53
|
"@types/yargs": "17.0.33",
|
|
53
|
-
"typescript": "
|
|
54
|
-
"@typescript/native-preview": "
|
|
54
|
+
"typescript": "5.8.2",
|
|
55
|
+
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
55
56
|
"vscode-languageserver-types": "3.17.5",
|
|
56
57
|
"why-is-node-running": "3.2.2",
|
|
57
|
-
"zod-to-json-schema": "3.24.5"
|
|
58
|
-
"@bincode-ai/script": "workspace:*"
|
|
58
|
+
"zod-to-json-schema": "3.24.5"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@actions/core": "1.11.1",
|
|
@@ -73,52 +73,48 @@
|
|
|
73
73
|
"@ai-sdk/provider": "2.0.0",
|
|
74
74
|
"@ai-sdk/provider-utils": "3.0.18",
|
|
75
75
|
"@ai-sdk/xai": "2.0.42",
|
|
76
|
-
"@bincode-ai/plugin": "workspace:*",
|
|
77
|
-
"@bincode-ai/script": "workspace:*",
|
|
78
|
-
"@bincode-ai/sdk": "workspace:*",
|
|
79
|
-
"@bincode-ai/util": "workspace:*",
|
|
80
76
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
81
77
|
"@hono/standard-validator": "0.1.5",
|
|
82
|
-
"@hono/zod-validator": "
|
|
78
|
+
"@hono/zod-validator": "0.4.2",
|
|
83
79
|
"@modelcontextprotocol/sdk": "1.15.1",
|
|
84
80
|
"@octokit/graphql": "9.0.2",
|
|
85
|
-
"@octokit/rest": "
|
|
86
|
-
"@openauthjs/openauth": "
|
|
81
|
+
"@octokit/rest": "22.0.0",
|
|
82
|
+
"@openauthjs/openauth": "0.0.0-20250322224806",
|
|
87
83
|
"@openrouter/ai-sdk-provider": "1.5.2",
|
|
88
84
|
"@opentui/core": "0.1.63",
|
|
89
85
|
"@opentui/solid": "0.1.63",
|
|
90
86
|
"@parcel/watcher": "2.5.1",
|
|
91
|
-
"@pierre/diffs": "
|
|
87
|
+
"@pierre/diffs": "1.0.2",
|
|
92
88
|
"@solid-primitives/event-bus": "1.1.2",
|
|
93
89
|
"@standard-schema/spec": "1.0.0",
|
|
94
90
|
"@zip.js/zip.js": "2.7.62",
|
|
95
|
-
"ai": "
|
|
91
|
+
"ai": "5.0.97",
|
|
96
92
|
"bun-pty": "0.4.2",
|
|
97
93
|
"chokidar": "4.0.3",
|
|
98
94
|
"clipboardy": "4.0.0",
|
|
99
95
|
"decimal.js": "10.5.0",
|
|
100
|
-
"diff": "
|
|
96
|
+
"diff": "8.0.2",
|
|
101
97
|
"fuzzysort": "3.1.0",
|
|
102
98
|
"gray-matter": "4.0.3",
|
|
103
|
-
"hono": "
|
|
104
|
-
"hono-openapi": "
|
|
99
|
+
"hono": "4.10.7",
|
|
100
|
+
"hono-openapi": "1.1.2",
|
|
105
101
|
"ignore": "7.0.5",
|
|
106
102
|
"jsonc-parser": "3.3.1",
|
|
107
103
|
"minimatch": "10.0.3",
|
|
108
104
|
"open": "10.1.2",
|
|
109
105
|
"opentui-spinner": "0.0.6",
|
|
110
106
|
"partial-json": "0.1.7",
|
|
111
|
-
"remeda": "
|
|
112
|
-
"solid-js": "
|
|
107
|
+
"remeda": "2.26.0",
|
|
108
|
+
"solid-js": "1.9.10",
|
|
113
109
|
"strip-ansi": "7.1.2",
|
|
114
110
|
"tree-sitter-bash": "0.25.0",
|
|
115
111
|
"turndown": "7.2.0",
|
|
116
|
-
"ulid": "
|
|
112
|
+
"ulid": "3.0.1",
|
|
117
113
|
"vscode-jsonrpc": "8.2.1",
|
|
118
114
|
"web-tree-sitter": "0.25.10",
|
|
119
115
|
"xdg-basedir": "5.1.0",
|
|
120
116
|
"yargs": "18.0.0",
|
|
121
|
-
"zod": "
|
|
117
|
+
"zod": "4.1.8",
|
|
122
118
|
"zod-to-json-schema": "3.24.5"
|
|
123
119
|
}
|
|
124
|
-
}
|
|
120
|
+
}
|
package/script/publish.ts
CHANGED
|
@@ -29,6 +29,94 @@ const pkg = await Bun.file("package.json").json()
|
|
|
29
29
|
console.log(`๐ฆ Package: ${pkg.name}`)
|
|
30
30
|
console.log(`๐ Current version: ${pkg.version}\n`)
|
|
31
31
|
|
|
32
|
+
// Step 2.5: Remove workspace dependencies and replace catalog: with actual versions
|
|
33
|
+
console.log("๐งน Cleaning up dependencies for publishing...")
|
|
34
|
+
const originalPkg = JSON.parse(JSON.stringify(pkg)) // Deep copy
|
|
35
|
+
|
|
36
|
+
// Read root package.json to get catalog versions
|
|
37
|
+
const rootPkgPath = path.join(dir, "..", "..", "package.json")
|
|
38
|
+
let catalog = {}
|
|
39
|
+
if (existsSync(rootPkgPath)) {
|
|
40
|
+
try {
|
|
41
|
+
const rootPkg = await Bun.file(rootPkgPath).json()
|
|
42
|
+
if (rootPkg.workspaces?.catalog) {
|
|
43
|
+
catalog = rootPkg.workspaces.catalog
|
|
44
|
+
console.log(" Found catalog with versions")
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.log(" Warning: Could not read root package.json catalog")
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Ensure package.json is restored on exit
|
|
52
|
+
const restorePackageJson = async () => {
|
|
53
|
+
try {
|
|
54
|
+
await Bun.write("package.json", JSON.stringify(originalPkg, null, 2))
|
|
55
|
+
} catch (e) {
|
|
56
|
+
// Ignore errors during cleanup
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
process.on("exit", () => restorePackageJson())
|
|
61
|
+
process.on("SIGINT", async () => {
|
|
62
|
+
await restorePackageJson()
|
|
63
|
+
process.exit(1)
|
|
64
|
+
})
|
|
65
|
+
process.on("SIGTERM", async () => {
|
|
66
|
+
await restorePackageJson()
|
|
67
|
+
process.exit(1)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// Remove workspace dependencies from dependencies
|
|
71
|
+
if (pkg.dependencies) {
|
|
72
|
+
Object.keys(pkg.dependencies).forEach((key) => {
|
|
73
|
+
if (pkg.dependencies[key] === "workspace:*") {
|
|
74
|
+
delete pkg.dependencies[key]
|
|
75
|
+
console.log(` Removed: ${key}`)
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Remove workspace dependencies from devDependencies
|
|
81
|
+
if (pkg.devDependencies) {
|
|
82
|
+
Object.keys(pkg.devDependencies).forEach((key) => {
|
|
83
|
+
if (pkg.devDependencies[key] === "workspace:*") {
|
|
84
|
+
delete pkg.devDependencies[key]
|
|
85
|
+
console.log(` Removed (dev): ${key}`)
|
|
86
|
+
} else if (pkg.devDependencies[key] === "catalog:") {
|
|
87
|
+
if (catalog[key]) {
|
|
88
|
+
pkg.devDependencies[key] = catalog[key]
|
|
89
|
+
console.log(` Replaced catalog (dev): ${key} -> ${catalog[key]}`)
|
|
90
|
+
} else {
|
|
91
|
+
delete pkg.devDependencies[key]
|
|
92
|
+
console.log(` Removed (dev, no catalog): ${key}`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Replace catalog: in dependencies
|
|
99
|
+
if (pkg.dependencies) {
|
|
100
|
+
Object.keys(pkg.dependencies).forEach((key) => {
|
|
101
|
+
if (pkg.dependencies[key] === "workspace:*") {
|
|
102
|
+
delete pkg.dependencies[key]
|
|
103
|
+
console.log(` Removed: ${key}`)
|
|
104
|
+
} else if (pkg.dependencies[key] === "catalog:") {
|
|
105
|
+
if (catalog[key]) {
|
|
106
|
+
pkg.dependencies[key] = catalog[key]
|
|
107
|
+
console.log(` Replaced catalog: ${key} -> ${catalog[key]}`)
|
|
108
|
+
} else {
|
|
109
|
+
delete pkg.dependencies[key]
|
|
110
|
+
console.log(` Removed (no catalog): ${key}`)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Write modified package.json
|
|
117
|
+
await Bun.write("package.json", JSON.stringify(pkg, null, 2))
|
|
118
|
+
console.log("โ
Dependencies cleaned up\n")
|
|
119
|
+
|
|
32
120
|
// Step 3: Build binaries
|
|
33
121
|
console.log("๐จ Building binaries for all platforms...")
|
|
34
122
|
console.log(" This may take a few minutes...\n")
|
|
@@ -36,6 +124,7 @@ const buildResult = await $`bun run build`.quiet()
|
|
|
36
124
|
if (buildResult.exitCode !== 0) {
|
|
37
125
|
console.error("โ Build failed!")
|
|
38
126
|
console.error(await buildResult.text())
|
|
127
|
+
await restorePackageJson()
|
|
39
128
|
process.exit(1)
|
|
40
129
|
}
|
|
41
130
|
console.log("โ
Build completed!\n")
|
|
@@ -45,6 +134,7 @@ const distPath = path.join(dir, "dist")
|
|
|
45
134
|
if (!existsSync(distPath)) {
|
|
46
135
|
console.error("โ Error: dist folder not found after build!")
|
|
47
136
|
console.error(` Expected path: ${distPath}`)
|
|
137
|
+
await restorePackageJson()
|
|
48
138
|
process.exit(1)
|
|
49
139
|
}
|
|
50
140
|
|
|
@@ -52,6 +142,7 @@ if (!existsSync(distPath)) {
|
|
|
52
142
|
const distContents = await $`ls -1 ${distPath}`.quiet()
|
|
53
143
|
if (distContents.exitCode !== 0 || !(await distContents.text()).trim()) {
|
|
54
144
|
console.error("โ Error: dist folder is empty!")
|
|
145
|
+
await restorePackageJson()
|
|
55
146
|
process.exit(1)
|
|
56
147
|
}
|
|
57
148
|
console.log("โ
Dist folder found with binaries\n")
|
|
@@ -62,6 +153,7 @@ const dryRunResult = await $`npm publish --dry-run`.quiet()
|
|
|
62
153
|
if (dryRunResult.exitCode !== 0) {
|
|
63
154
|
console.error("โ Dry run failed!")
|
|
64
155
|
console.error(await dryRunResult.text())
|
|
156
|
+
await restorePackageJson()
|
|
65
157
|
process.exit(1)
|
|
66
158
|
}
|
|
67
159
|
console.log(await dryRunResult.text())
|
|
@@ -86,12 +178,19 @@ if (process.argv.includes("--yes") || process.argv.includes("-y")) {
|
|
|
86
178
|
// Step 7: Publish
|
|
87
179
|
console.log("๐ค Publishing to npm...\n")
|
|
88
180
|
const publishResult = await $`npm publish`
|
|
89
|
-
|
|
181
|
+
const publishSuccess = publishResult.exitCode === 0
|
|
182
|
+
|
|
183
|
+
// Step 8: Restore original package.json
|
|
184
|
+
console.log("\n๐ Restoring original package.json...")
|
|
185
|
+
await Bun.write("package.json", JSON.stringify(originalPkg, null, 2))
|
|
186
|
+
console.log("โ
Original package.json restored\n")
|
|
187
|
+
|
|
188
|
+
if (!publishSuccess) {
|
|
90
189
|
console.error("โ Publish failed!")
|
|
91
190
|
process.exit(1)
|
|
92
191
|
}
|
|
93
192
|
|
|
94
|
-
console.log("
|
|
193
|
+
console.log("โ
Successfully published!")
|
|
95
194
|
console.log(`\n๐ฅ Users can now install with:`)
|
|
96
195
|
console.log(` npm install -g ${pkg.name}`)
|
|
97
196
|
console.log(` bun install -g ${pkg.name}`)
|