Skip to content

Commit a907197

Browse files
fix(sdk): ship native shim and assert package layout
1 parent 92c6f7c commit a907197

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

‎sdk/native/package.json‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codex-native/sdk",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "Native NAPI-based Codex SDK - complete standalone implementation.",
55
"main": "dist/index.cjs",
66
"module": "dist/index.mjs",
@@ -18,6 +18,8 @@
1818
"files": [
1919
"dist",
2020
"README.md",
21+
"index.js",
22+
"index.d.ts",
2123
"npm",
2224
"*.node"
2325
],
@@ -58,6 +60,7 @@
5860
"release:major": "npm version major && npm run release",
5961
"publish:platforms": "npm run create-npm-dirs && napi artifacts --output-dir . --npm-dir npm && node scripts/ensure-trailing-newline.mjs package.json && node scripts/publish-platform-packages.mjs",
6062
"release": "npm run build && npm run test && npm run publish:platforms && node scripts/publish-sdk.mjs",
63+
"release:notest": "npm run build && npm run publish:platforms && node scripts/publish-sdk.mjs",
6164
"release:dry": "npm run build && npm run test && npm publish --dry-run"
6265
},
6366
"napi": {
@@ -74,14 +77,14 @@
7477
]
7578
},
7679
"optionalDependencies": {
77-
"@codex-native/sdk-darwin-arm64": "workspace:*",
78-
"@codex-native/sdk-darwin-x64": "workspace:*",
79-
"@codex-native/sdk-linux-arm64-gnu": "workspace:*",
80-
"@codex-native/sdk-linux-x64-gnu": "workspace:*",
81-
"@codex-native/sdk-linux-arm64-musl": "workspace:*",
82-
"@codex-native/sdk-linux-x64-musl": "workspace:*",
83-
"@codex-native/sdk-win32-arm64-msvc": "workspace:*",
84-
"@codex-native/sdk-win32-x64-msvc": "workspace:*"
80+
"@codex-native/sdk-darwin-arm64": "0.0.7",
81+
"@codex-native/sdk-darwin-x64": "0.0.7",
82+
"@codex-native/sdk-linux-arm64-gnu": "0.0.7",
83+
"@codex-native/sdk-linux-x64-gnu": "0.0.7",
84+
"@codex-native/sdk-linux-arm64-musl": "0.0.7",
85+
"@codex-native/sdk-linux-x64-musl": "0.0.7",
86+
"@codex-native/sdk-win32-arm64-msvc": "0.0.7",
87+
"@codex-native/sdk-win32-x64-msvc": "0.0.7"
8588
},
8689
"engines": {
8790
"node": ">=18"

‎sdk/native/tests/module-formats.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
import { describe, it, expect } from "@jest/globals";
2+
import fs from "node:fs";
23
import { createRequire } from "node:module";
34
import { fileURLToPath, pathToFileURL } from "node:url";
45
import path from "node:path";
56

67
const requireFn = createRequire(import.meta.url);
78
const distDir = path.join(process.cwd(), "dist");
9+
const rootIndex = path.join(process.cwd(), "index.js");
810

911
describe("module format exports", () => {
12+
it("ships the native binding shim at the package root", () => {
13+
expect(fs.existsSync(rootIndex)).toBe(true);
14+
const contents = fs.readFileSync(rootIndex, "utf8");
15+
expect(contents).toContain("codex_native");
16+
});
17+
1018
it("loads the CommonJS bundle via require", () => {
1119
const cjsModule = requireFn(path.join(distDir, "index.cjs"));
1220
expect(cjsModule).toBeDefined();

0 commit comments

Comments
 (0)