Skip to content

Commit

Permalink
feat(staking): modify package.json for publishing (#1964)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvankhademi authored Sep 25, 2024
1 parent c987d49 commit 81b80c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions governance/pyth_staking_sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{
"name": "@pythnetwork/staking-sdk",
"version": "0.0.1",
"version": "0.0.2",
"description": "Pyth staking SDK",
"main": "src/index.ts",
"types": "src/index.d.ts",
"files": [
"dist/**/*"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc && node scripts/update-package-json.mjs",
"build": "tsc",
"test": "pnpm run test:format && pnpm run test:lint && pnpm run test:integration && pnpm run test:types",
"fix": "pnpm fix:lint && pnpm fix:format",
"fix:format": "prettier --write .",
"fix:lint": "eslint --fix .",
"test:format": "prettier --check .",
"test:lint": "jest --selectProjects lint",
"test:types": "tsc",
"test:integration": "echo disabled # jest --selectProjects integration"
"test:integration": "echo disabled # jest --selectProjects integration",
"prepublishOnly": "node scripts/update-package-json.mjs"
},
"devDependencies": {
"@cprussin/eslint-config": "^3.0.0",
Expand Down
5 changes: 3 additions & 2 deletions governance/pyth_staking_sdk/scripts/update-package-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { fileURLToPath } from "url";

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

const distPackageJsonPath = path.join(__dirname, "..", "dist", "package.json");
const distPackageJsonPath = path.join(__dirname, "..", "package.json");

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

packageJson.main = "src/index.js";
packageJson.main = "dist/src/index.js";
packageJson.types = "dist/src/index.d.ts";

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

0 comments on commit 81b80c7

Please sign in to comment.