Skip to content

Commit 81b80c7

Browse files
feat(staking): modify package.json for publishing (#1964)
1 parent c987d49 commit 81b80c7

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

governance/pyth_staking_sdk/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
{
22
"name": "@pythnetwork/staking-sdk",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Pyth staking SDK",
55
"main": "src/index.ts",
66
"types": "src/index.d.ts",
7+
"files": [
8+
"dist/**/*"
9+
],
710
"publishConfig": {
811
"access": "public"
912
},
1013
"scripts": {
11-
"build": "tsc && node scripts/update-package-json.mjs",
14+
"build": "tsc",
1215
"test": "pnpm run test:format && pnpm run test:lint && pnpm run test:integration && pnpm run test:types",
1316
"fix": "pnpm fix:lint && pnpm fix:format",
1417
"fix:format": "prettier --write .",
1518
"fix:lint": "eslint --fix .",
1619
"test:format": "prettier --check .",
1720
"test:lint": "jest --selectProjects lint",
1821
"test:types": "tsc",
19-
"test:integration": "echo disabled # jest --selectProjects integration"
22+
"test:integration": "echo disabled # jest --selectProjects integration",
23+
"prepublishOnly": "node scripts/update-package-json.mjs"
2024
},
2125
"devDependencies": {
2226
"@cprussin/eslint-config": "^3.0.0",

governance/pyth_staking_sdk/scripts/update-package-json.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import { fileURLToPath } from "url";
1111

1212
const __dirname = path.dirname(fileURLToPath(import.meta.url));
1313

14-
const distPackageJsonPath = path.join(__dirname, "..", "dist", "package.json");
14+
const distPackageJsonPath = path.join(__dirname, "..", "package.json");
1515

1616
const packageJson = JSON.parse(fs.readFileSync(distPackageJsonPath, "utf8"));
1717

18-
packageJson.main = "src/index.js";
18+
packageJson.main = "dist/src/index.js";
19+
packageJson.types = "dist/src/index.d.ts";
1920

2021
fs.writeFileSync(distPackageJsonPath, JSON.stringify(packageJson, null, 2));

0 commit comments

Comments
 (0)