Skip to content

refactor(sdk): build @vercel/sandbox with tsdown dual outputs#84

Open
Schniz wants to merge 1 commit intomainfrom
schniz/vercel-sandbox-tsdown-dual-output
Open

refactor(sdk): build @vercel/sandbox with tsdown dual outputs#84
Schniz wants to merge 1 commit intomainfrom
schniz/vercel-sandbox-tsdown-dual-output

Conversation

@Schniz
Copy link
Collaborator

@Schniz Schniz commented Mar 10, 2026

Summary

  • migrate @vercel/sandbox from custom TypeScript dual-build scripts to tsdown with unbundled esm + cjs outputs
  • add explicit export-map conditions for root and deep ./dist/*.js paths so import resolves .js and require resolves .cjs
  • add package export resolution tests to verify Node import and require behavior, and include a changeset for the SDK package

Validation

  • pnpm build (in packages/vercel-sandbox)
  • pnpm typecheck (in packages/vercel-sandbox)
  • pnpm test src/package-exports.test.ts (in packages/vercel-sandbox)

@vercel
Copy link

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sandbox-cli Ready Ready Preview, Comment Mar 10, 2026 5:47pm
sandbox-sdk Ready Ready Preview, Comment Mar 10, 2026 5:47pm
sandbox-sdk-ai-example Ready Ready Preview, Comment Mar 10, 2026 5:47pm

Request Review

Copy link
Member

@TooTallNate TooTallNate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Wanted to point out though that the tsdown configuration in the sandbox package is different (outputs .mjs files). Might want to make that consistent, but up to you.

outExtensions: ({ format }) => ({
js: format === "cjs" ? ".cjs" : ".js",
}),
unbundle: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were already not bundling before due to tsc, but I'm not sure why we're still not bundling here, especially if we ship source maps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants