Skip to content

Commit d358ee6

Browse files
committed
Build at the highest target possible, and use ESM in tests
1 parent 64539a0 commit d358ee6

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

template/clients/js/clients/js/test/_setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

2828
type Client = {
2929
rpc: Rpc<SolanaRpcApi>;

template/clients/js/clients/js/test/create.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import {
44
Counter,
55
fetchCounterFromSeeds,
66
getCreateInstructionAsync,
7-
} from '../src';
7+
} from '../src/index.js';
88
import {
99
createDefaultSolanaClient,
1010
createDefaultTransaction,
1111
generateKeyPairSignerWithSol,
1212
signAndSendTransaction,
13-
} from './_setup';
13+
} from './_setup.js';
1414

1515
test('it creates a new counter account', async (t) => {
1616
// Given an authority key pair with some SOL.

template/clients/js/clients/js/test/increment.test.ts.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {
55
findCounterPda,
66
getIncrementInstruction,
77
getIncrementInstructionAsync,
8-
} from '../src';
8+
} from '../src/index.js';
99
import {
1010
createCounterForAuthority,
1111
createDefaultSolanaClient,
1212
createDefaultTransaction,
1313
generateKeyPairSignerWithSol,
1414
getBalance,
1515
signAndSendTransaction,
16-
} from './_setup';
16+
} from './_setup.js';
1717

1818
test('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.

template/clients/js/clients/js/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"forceConsistentCasingInFileNames": true,
99
"inlineSources": false,
1010
"isolatedModules": true,
11-
"module": "commonjs",
11+
"module": "ESNext",
1212
"moduleResolution": "node",
1313
"noFallthroughCasesInSwitch": true,
1414
"noUnusedLocals": true,

template/clients/js/clients/js/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
]);

0 commit comments

Comments
 (0)