Skip to content

Commit cf9fdc6

Browse files
MajorTalclaude
andcommitted
fix: bundle @run402/sdk dist into run402 and run402-mcp tarballs
v1.40.1 shipped broken — both run402-mcp and run402 imported the SDK via a monorepo-relative path (`../sdk/dist/node/index.js` and `../../sdk/dist/node/index.js`) that points outside the tarball after npm install. Every command threw ERR_MODULE_NOT_FOUND before running. Fix by including the already-built SDK inside each tarball, mirroring the existing core/dist bundling pattern: - Root package.json: add sdk/dist and sdk/core-dist to the MCP files allowlist. Source import path `../sdk/dist/node/index.js` from dist/sdk.js now resolves self-contained. - cli/package.json: add sdk/ to files, extend prepack to copy ../sdk/dist and ../sdk/core-dist. - cli/lib/sdk.mjs: rewrite import from ../../sdk/dist to ../sdk/dist so it resolves inside the package root. - Root build script: also populate cli/sdk/dist and cli/sdk/core-dist so dev and e2e tests match the tarball layout. - .gitignore: cli/sdk/ is build output. Bump all three to 1.40.2 to keep the monorepo invariant (SDK tarball content is unchanged from 1.40.1). Verified by `npm pack` + extract + install + import on both tarballs before publishing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4f77ffb commit cf9fdc6

6 files changed

Lines changed: 13 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
dist/
33
cli/core-dist/
4+
cli/sdk/
45
sdk/core-dist/
56
*.tgz
67
.claude/worktrees/

cli/lib/sdk.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* RUN402_API_BASE between runs.
88
*/
99

10-
import { run402 } from "../../sdk/dist/node/index.js";
10+
import { run402 } from "../sdk/dist/node/index.js";
1111

1212
export function getSdk() {
1313
return run402();

cli/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
22
"name": "run402",
3-
"version": "1.40.1",
3+
"version": "1.40.2",
44
"description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 and MPP micropayments.",
55
"type": "module",
66
"bin": {
77
"run402": "cli.mjs"
88
},
99
"scripts": {
10-
"prepack": "mkdir -p core-dist && cp ../core/dist/*.js core-dist/"
10+
"prepack": "mkdir -p core-dist sdk/dist sdk/core-dist && cp ../core/dist/*.js core-dist/ && cp -R ../sdk/dist/. sdk/dist/ && cp ../sdk/core-dist/*.js sdk/core-dist/"
1111
},
1212
"files": [
1313
"cli.mjs",
1414
"lib/",
15-
"core-dist/"
15+
"core-dist/",
16+
"sdk/"
1617
],
1718
"dependencies": {
1819
"@noble/curves": "^2.0.1",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "run402-mcp",
3-
"version": "1.40.1",
3+
"version": "1.40.2",
44
"description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
55
"type": "module",
66
"main": "dist/index.js",
@@ -11,12 +11,14 @@
1111
"files": [
1212
"dist",
1313
"core/dist",
14+
"sdk/dist",
15+
"sdk/core-dist",
1416
"README.md"
1517
],
1618
"scripts": {
1719
"build:core": "tsc -p core/tsconfig.json",
1820
"build:sdk": "mkdir -p sdk/core-dist && cp core/dist/*.js sdk/core-dist/ && cp core/dist/*.d.ts sdk/core-dist/ && tsc -p sdk/tsconfig.json",
19-
"build": "npm run build:core && npm run build:sdk && tsc && mkdir -p cli/core-dist && cp core/dist/*.js cli/core-dist/",
21+
"build": "npm run build:core && npm run build:sdk && tsc && mkdir -p cli/core-dist cli/sdk/dist cli/sdk/core-dist && cp core/dist/*.js cli/core-dist/ && cp -R sdk/dist/. cli/sdk/dist/ && cp sdk/core-dist/*.js cli/sdk/core-dist/",
2022
"start": "node dist/index.js",
2123
"test:skill": "node --test --import tsx SKILL.test.ts",
2224
"test:sync": "node --test --import tsx sync.test.ts",

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@run402/sdk",
3-
"version": "1.40.1",
3+
"version": "1.40.2",
44
"description": "Typed TypeScript client for the Run402 API. Kernel shared by the run402-mcp server, the run402 CLI, and user-deployed run402 functions.",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)