-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(staking): make sdk ready for release (#1933)
* feat(staking): make sdk ready for release * fix * fix
- Loading branch information
1 parent
ee3249d
commit 75781f8
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
governance/pyth_staking_sdk/scripts/update-package-json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
/** | ||
* This script updates the package.json file in the dist directory after the TypeScript build. | ||
* | ||
* This ensures that the published package correctly references the compiled JavaScript | ||
* instead of the TypeScript source files. | ||
*/ | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
||
const distPackageJsonPath = path.join(__dirname, "..", "dist", "package.json"); | ||
|
||
const packageJson = JSON.parse(fs.readFileSync(distPackageJsonPath, "utf8")); | ||
|
||
packageJson.exports = { | ||
".": "./src/index.js", | ||
}; | ||
|
||
fs.writeFileSync(distPackageJsonPath, JSON.stringify(packageJson, null, 2)); |