Skip to content

Commit 75781f8

Browse files
feat(staking): make sdk ready for release (#1933)
* feat(staking): make sdk ready for release * fix * fix
1 parent ee3249d commit 75781f8

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

governance/pyth_staking_sdk/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
"exports": {
77
".": "./src/index.ts"
88
},
9-
"private": true,
9+
"publishConfig": {
10+
"access": "public"
11+
},
1012
"scripts": {
11-
"build": "tsc",
13+
"build": "tsc && node scripts/update-package-json.js",
1214
"test": "pnpm run test:format && pnpm run test:lint && pnpm run test:integration && pnpm run test:types",
1315
"fix": "pnpm fix:lint && pnpm fix:format",
1416
"fix:format": "prettier --write .",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import fs from "fs";
2+
import path from "path";
3+
import { fileURLToPath } from "url";
4+
5+
/**
6+
* This script updates the package.json file in the dist directory after the TypeScript build.
7+
*
8+
* This ensures that the published package correctly references the compiled JavaScript
9+
* instead of the TypeScript source files.
10+
*/
11+
12+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
13+
14+
const distPackageJsonPath = path.join(__dirname, "..", "dist", "package.json");
15+
16+
const packageJson = JSON.parse(fs.readFileSync(distPackageJsonPath, "utf8"));
17+
18+
packageJson.exports = {
19+
".": "./src/index.js",
20+
};
21+
22+
fs.writeFileSync(distPackageJsonPath, JSON.stringify(packageJson, null, 2));

0 commit comments

Comments
 (0)