fix: fix bun install bug (#62)

* fix: fix bun install bug

* refactor: consolidate executable check into assertExecutable helper

- Add assertExecutable() to cli-shared that checks and attempts chmod
- Simplify CLI and SDK spawn code to use the shared helper
- Fix cli-shared package.json exports (.js not .mjs)
- Add global install instructions to SDK error message

* chore(release): update version to 0.1.6-rc.1

* fix: add cli-shared package to Dockerfiles

* chore(release): update version to 0.1.6-rc.1

* fix: add cli-shared publishing to release workflow

* chore(release): update version to 0.1.6-rc.1

* fix: handle already-exists error during crate publish

* chore(release): update version to 0.1.6-rc.1
This commit is contained in:
Nathan Flurry 2026-02-02 21:12:41 -08:00 committed by GitHub
parent 24de9e686c
commit 02bb992b11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 467 additions and 44 deletions

View file

@ -116,12 +116,21 @@ export async function publishCrates(opts: ReleaseOpts) {
try {
await $({
stdio: "inherit",
stdout: "pipe",
stderr: "pipe",
cwd: cratePath,
})`cargo publish --allow-dirty --no-verify`;
console.log(`✅ Published ${crateName}@${opts.version}`);
} catch (err) {
} catch (err: any) {
// Check if error is because crate already exists (from a previous partial run)
if (err.stderr?.includes("already exists")) {
console.log(
`Version ${opts.version} of ${crateName} already exists on crates.io. Skipping...`,
);
continue;
}
console.error(`❌ Failed to publish ${crateName}`);
console.error(err.stderr || err.message);
throw err;
}
@ -133,6 +142,43 @@ export async function publishCrates(opts: ReleaseOpts) {
console.log("✅ All crates published");
}
export async function publishNpmCliShared(opts: ReleaseOpts) {
const cliSharedPath = join(opts.root, "sdks/cli-shared");
const packageJsonPath = join(cliSharedPath, "package.json");
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
const name = packageJson.name;
// Check if version already exists
const versionExists = await npmVersionExists(name, opts.version);
if (versionExists) {
console.log(
`Version ${opts.version} of ${name} already exists. Skipping...`,
);
return;
}
// Build cli-shared
console.log(`==> Building @sandbox-agent/cli-shared`);
await $({
stdio: "inherit",
cwd: opts.root,
})`pnpm --filter @sandbox-agent/cli-shared build`;
// Publish
console.log(`==> Publishing to NPM: ${name}@${opts.version}`);
// Add --tag flag for release candidates
const isReleaseCandidate = opts.version.includes("-rc.");
const tag = isReleaseCandidate ? "rc" : "latest";
await $({
stdio: "inherit",
cwd: cliSharedPath,
})`pnpm publish --access public --tag ${tag} --no-git-checks`;
console.log(`✅ Published ${name}@${opts.version}`);
}
export async function publishNpmSdk(opts: ReleaseOpts) {
const sdkPath = join(opts.root, "sdks/typescript");
const packageJsonPath = join(sdkPath, "package.json");
@ -148,7 +194,7 @@ export async function publishNpmSdk(opts: ReleaseOpts) {
return;
}
// Build the SDK
// Build the SDK (cli-shared should already be built by publishNpmCliShared)
console.log(`==> Building TypeScript SDK`);
await $({
stdio: "inherit",