diff --git a/.changeset/grumpy-onions-rush.md b/.changeset/grumpy-onions-rush.md new file mode 100644 index 0000000..557cfac --- /dev/null +++ b/.changeset/grumpy-onions-rush.md @@ -0,0 +1,5 @@ +--- +"@solana/web3-compat": patch +--- + +Fix types export path so TypeScript can resolve the module diff --git a/packages/web3-compat/tsconfig.declarations.json b/packages/web3-compat/tsconfig.declarations.json index f35f91c..4f5f043 100644 --- a/packages/web3-compat/tsconfig.declarations.json +++ b/packages/web3-compat/tsconfig.declarations.json @@ -3,7 +3,10 @@ "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "outDir": "./dist/types" + "outDir": "./dist/types", + "paths": { + "@solana/client": ["../client/dist/types/index.d.ts"] + } }, "extends": "./tsconfig.json", "include": ["../build-scripts/build-time-constants.d.ts", "src/index.ts"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea27e90..161c77b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -500,6 +500,9 @@ importers: '@solana/react-hooks': specifier: workspace:* version: link:../../packages/react-hooks + '@solana/web3-compat': + specifier: workspace:* + version: link:../../packages/web3-compat react: specifier: catalog:react version: 19.2.3 diff --git a/tests/types-smoke/package.json b/tests/types-smoke/package.json index f8f19f4..c2696fb 100644 --- a/tests/types-smoke/package.json +++ b/tests/types-smoke/package.json @@ -5,12 +5,13 @@ "type": "module", "scripts": { "test": "pnpm typecheck", - "pretypecheck": "pnpm --filter @solana/client build && pnpm --filter @solana/react-hooks build", + "pretypecheck": "pnpm --filter @solana/client build && pnpm --filter @solana/react-hooks build && pnpm --filter @solana/web3-compat build", "typecheck": "tsc -p tsconfig.json" }, "dependencies": { "@solana/client": "workspace:*", "@solana/react-hooks": "workspace:*", + "@solana/web3-compat": "workspace:*", "react": "catalog:react" }, "devDependencies": { diff --git a/tests/types-smoke/src/index.ts b/tests/types-smoke/src/index.ts index 213d871..c7ced90 100644 --- a/tests/types-smoke/src/index.ts +++ b/tests/types-smoke/src/index.ts @@ -12,4 +12,13 @@ type ProviderComponent = typeof import('@solana/react-hooks')['SolanaClientProvi type ProviderProps = Parameters[0]; const providerProps: ProviderProps = { client, children: null as unknown as ReactNode }; -export const _smokeTest: [ClientInstance, UseAccountResult, ProviderProps] = [client, hookResult, providerProps]; +type ConnectionClass = typeof import('@solana/web3-compat')['Connection']; +type ConnectionInstance = InstanceType; +const connection = null as unknown as ConnectionInstance; + +export const _smokeTest: [ClientInstance, UseAccountResult, ProviderProps, ConnectionInstance] = [ + client, + hookResult, + providerProps, + connection, +];