From 781913c9640fcf0a8fa3e235280777d572323b8c Mon Sep 17 00:00:00 2001 From: geobelsky Date: Wed, 3 Jun 2026 09:19:45 +0000 Subject: [PATCH] fix(ci): mark @cursor/sdk external in standalone-binary bundle step The standalone-binary build does a second esbuild pass on top of dist/cli.mjs to produce a single-file bundle per platform. @cursor/sdk was added as an optionalDependency in v0.6.0 (PR #129, Cursor IDE support), and its TypeScript declarations re-export internal workspace paths (`@anysphere/cursor-sdk-local-runtime/*`, `./messages.js`, `./platform.js`, etc.) that esbuild cannot resolve in this pass. Mark @cursor/sdk external. The package stays in optionalDependencies so `npm ci` keeps installing it (npm publish still ships a working package); the AgentSdk factory's dynamic import falls back to the Claude wrapper when the standalone binary is loaded without the SDK present, exactly as for the plugin bundle (build.mjs:74 does the same externalization for the same reason). Repairs the v0.6.0 release-binary failure on tag v0.6.0. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release-binary.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 59b2914..e54cab4 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -57,10 +57,20 @@ jobs: - name: Create standalone bundle run: | mkdir -p release - # Bundle everything into a single file with node shebang + # Bundle everything into a single file with node shebang. + # @cursor/sdk is marked external because its TypeScript declarations + # re-export internal workspace paths (`@anysphere/cursor-sdk-local-runtime/*`, + # `./messages.js`, `./platform.js`, etc.) that esbuild cannot resolve + # in this second-pass bundle step. The SDK is in optionalDependencies + # and the AgentSdk factory falls back to the Claude wrapper via a + # MODULE_NOT_FOUND-tolerant dynamic import — standalone-binary users + # are not on Cursor (Cursor users get the .vsix), so the runtime + # fallback is correct. build.mjs's plugin variant already marks the + # same package external for the same reason (see build.mjs:74). npx esbuild dist/cli.mjs --bundle --platform=node --target=node20 \ --outfile=release/axme-code-${{ matrix.target }} \ - --banner:js='#!/usr/bin/env node' + --banner:js='#!/usr/bin/env node' \ + --external:@cursor/sdk chmod +x release/axme-code-${{ matrix.target }} - name: Upload artifact