File tree Expand file tree Collapse file tree
template/clients/js/clients/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " create-solana-program " : patch
3+ ---
4+
5+ Generated clients can now be imported into ESM projects
Original file line number Diff line number Diff line change 66 "module": "./dist/src/index.mjs",
77 "main": "./dist/src/index.js",
88 "types": "./dist/types/src/index.d.ts",
9+ "type": "module",
910 "exports": {
1011 ".": {
1112 "types": "./dist/types/src/index.d.ts",
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import {
2323 setTransactionLifetimeUsingBlockhash ,
2424 signTransactionWithSigners ,
2525} from '@solana/web3.js' ;
26- import { findCounterPda , getCreateInstructionAsync } from '../src' ;
26+ import { findCounterPda , getCreateInstructionAsync } from '../src/index.js ' ;
2727
2828type Client = {
2929 rpc : Rpc < SolanaRpcApi > ;
Original file line number Diff line number Diff line change @@ -4,13 +4,13 @@ import {
44 Counter ,
55 fetchCounterFromSeeds ,
66 getCreateInstructionAsync ,
7- } from '../src' ;
7+ } from '../src/index.js ' ;
88import {
99 createDefaultSolanaClient ,
1010 createDefaultTransaction ,
1111 generateKeyPairSignerWithSol ,
1212 signAndSendTransaction ,
13- } from './_setup' ;
13+ } from './_setup.js ' ;
1414
1515test ( 'it creates a new counter account' , async ( t ) => {
1616 // Given an authority key pair with some SOL.
Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ import {
55 findCounterPda,
66 getIncrementInstruction,
77 getIncrementInstructionAsync,
8- } from '../src';
8+ } from '../src/index.js ';
99import {
1010 createCounterForAuthority,
1111 createDefaultSolanaClient,
1212 createDefaultTransaction,
1313 generateKeyPairSignerWithSol,
1414 getBalance,
1515 signAndSendTransaction,
16- } from './_setup';
16+ } from './_setup.js ';
1717
1818test('it increments an existing counter by 1 by default', async (t) => {
1919 // Given an authority key pair with an associated counter account of value 0.
Original file line number Diff line number Diff line change 88 "forceConsistentCasingInFileNames" : true ,
99 "inlineSources" : false ,
1010 "isolatedModules" : true ,
11- "module" : " commonjs " ,
11+ "module" : " ESNext " ,
1212 "moduleResolution" : " node" ,
1313 "noFallthroughCasesInSwitch" : true ,
1414 "noUnusedLocals" : true ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default defineConfig(() => [
2121 ...SHARED_OPTIONS ,
2222 bundle : false ,
2323 entry : [ './test/*.ts' ] ,
24- format : 'cjs ' ,
24+ format : 'esm ' ,
2525 outDir : './dist/test' ,
2626 } ,
2727] ) ;
You can’t perform that action at this time.
0 commit comments