From bde4d4d9a5ab2e553009b1480b6317124deaf558 Mon Sep 17 00:00:00 2001 From: Pavel Strakhov Date: Wed, 30 Jul 2025 12:05:11 +0100 Subject: [PATCH] fix(lazer): include .d.ts files in solana sdk js package --- lazer/sdk/js-solana/package.json | 9 +++++---- lazer/sdk/js-solana/tsconfig.build.json | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 lazer/sdk/js-solana/tsconfig.build.json diff --git a/lazer/sdk/js-solana/package.json b/lazer/sdk/js-solana/package.json index 9aaa4b9a5b..6cba60f43d 100644 --- a/lazer/sdk/js-solana/package.json +++ b/lazer/sdk/js-solana/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-lazer-solana-sdk", - "version": "0.1.0", + "version": "0.1.1", "description": "Pyth Lazer Solana SDK", "publishConfig": { "access": "public" @@ -9,14 +9,14 @@ "dist/**/*" ], "main": "./dist/cjs/index.js", - "types": "./dist/cjs/index.d.ts", + "types": "./dist/types/index.d.ts", "exports": { "import": { - "types": "./dist/esm/index.d.ts", + "types": "./dist/types/index.d.ts", "default": "./dist/esm/index.js" }, "require": { - "types": "./dist/cjs/index.d.ts", + "types": "./dist/types/index.d.ts", "default": "./dist/cjs/index.js" } }, @@ -24,6 +24,7 @@ "update-idl": "cd ../../contracts/solana && RUSTUP_TOOLCHAIN=nightly-2025-04-15 anchor build && cp target/types/pyth_lazer_solana_contract.ts ../../sdk/js-solana/src/idl/pyth-lazer-solana-contract.ts && cp target/idl/pyth_lazer_solana_contract.json ../../sdk/js-solana/src/idl/pyth-lazer-solana-contract.json", "build:cjs": "swc src -d dist/cjs --strip-leading-paths --copy-files -C module.type=commonjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json", "build:esm": "swc src -d dist/esm --strip-leading-paths --copy-files -C jsc.experimental.keepImportAttributes=true && echo '{\"type\":\"module\"}' > dist/esm/package.json", + "build:types": "tsc --project tsconfig.build.json", "fix:lint": "eslint --fix . --max-warnings 0", "test:lint": "eslint . --max-warnings 0", "test:types": "tsc", diff --git a/lazer/sdk/js-solana/tsconfig.build.json b/lazer/sdk/js-solana/tsconfig.build.json new file mode 100644 index 0000000000..6dde3856a2 --- /dev/null +++ b/lazer/sdk/js-solana/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "emitDeclarationOnly": true, + "incremental": false, + "declaration": true, + "outDir": "./dist/types" + }, + "exclude": ["node_modules", "dist"] +}