opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Publish sdk src files to npm, fix sdk resolution in development

Open remorses opened this issue 3 months ago • 4 comments

Fix https://github.com/sst/opencode/issues/1579 Fix https://github.com/sst/opencode-sdk-js/issues/25

@opencode-ai/sdk package only has dist folder in package.json files, so bun install only copies dist folder and not src. So development imports fail. bun i only copies files in dist into node_modules

remorses avatar Sep 12 '25 17:09 remorses

can you not do bun run dev or bun run --conditions=development ....?

Screenshot 2025-09-13 at 12 09 55 AM

rekram1-node avatar Sep 13 '25 05:09 rekram1-node

it makes no difference, it seems like your version of bun copies the src folder while mine does not.

remorses avatar Sep 13 '25 07:09 remorses

it's good practice anyway to keep src files on npm to make things like sourcemaps and declaration maps work

remorses avatar Sep 13 '25 07:09 remorses

Currently the sdk package can't be used with vite-node because it uses the development condition, which is missing from the npm package

please merge

remorses avatar Sep 23 '25 15:09 remorses