Forráskód Böngészése

Update with latest create-solana-program changes

Loris Leiva 1 éve
szülő
commit
2ff22d935f

+ 2 - 2
Cargo.lock

@@ -673,9 +673,9 @@ dependencies = [
 
 [[package]]
 name = "bytemuck"
-version = "1.14.3"
+version = "1.15.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f"
+checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15"
 dependencies = [
  "bytemuck_derive",
 ]

+ 2 - 1
clients/js/package.json

@@ -1,11 +1,12 @@
 {
   "name": "@solana-program/system",
-  "version": "0.1.1",
+  "version": "0.1.2",
   "description": "JavaScript client for the System program",
   "sideEffects": false,
   "module": "./dist/src/index.mjs",
   "main": "./dist/src/index.js",
   "types": "./dist/types/src/index.d.ts",
+  "type": "module",
   "exports": {
     ".": {
       "types": "./dist/types/src/index.d.ts",

+ 1 - 1
clients/js/test/_setup.ts

@@ -27,7 +27,7 @@ import {
   getCreateAccountInstruction,
   getInitializeNonceAccountInstruction,
   getNonceSize,
-} from '../src';
+} from '../src/index.js';
 
 type Client = {
   rpc: Rpc<SolanaRpcApi>;

+ 2 - 2
clients/js/test/advanceNonceAccount.test.ts

@@ -4,14 +4,14 @@ import {
   pipe,
 } from '@solana/web3.js';
 import test from 'ava';
-import { fetchNonce, getAdvanceNonceAccountInstruction } from '../src';
+import { fetchNonce, getAdvanceNonceAccountInstruction } from '../src/index.js';
 import {
   createDefaultSolanaClient,
   createDefaultTransaction,
   createNonceAccount,
   generateKeyPairSignerWithSol,
   signAndSendTransaction,
-} from './_setup';
+} from './_setup.js';
 
 test('it advances the nonce account', async (t) => {
   // Given an existing nonce account.

+ 5 - 2
clients/js/test/createAccount.test.ts

@@ -5,13 +5,16 @@ import {
   pipe,
 } from '@solana/web3.js';
 import test from 'ava';
-import { SYSTEM_PROGRAM_ADDRESS, getCreateAccountInstruction } from '../src';
+import {
+  SYSTEM_PROGRAM_ADDRESS,
+  getCreateAccountInstruction,
+} from '../src/index.js';
 import {
   createDefaultSolanaClient,
   createDefaultTransaction,
   generateKeyPairSignerWithSol,
   signAndSendTransaction,
-} from './_setup';
+} from './_setup.js';
 
 test('it creates a new empty account', async (t) => {
   // Given we have a newly generated account keypair to create with 42 bytes of space.

+ 2 - 2
clients/js/test/initializeNonceAccount.test.ts

@@ -13,13 +13,13 @@ import {
   getCreateAccountInstruction,
   getInitializeNonceAccountInstruction,
   getNonceSize,
-} from '../src';
+} from '../src/index.js';
 import {
   createDefaultSolanaClient,
   createDefaultTransaction,
   generateKeyPairSignerWithSol,
   signAndSendTransaction,
-} from './_setup';
+} from './_setup.js';
 
 test('it creates and initialize a durable nonce account', async (t) => {
   // Given some brand now payer, authority, and nonce KeyPairSigners.

+ 5 - 2
clients/js/test/transferSol.test.ts

@@ -7,14 +7,17 @@ import {
   pipe,
 } from '@solana/web3.js';
 import test from 'ava';
-import { getTransferSolInstruction, parseTransferSolInstruction } from '../src';
+import {
+  getTransferSolInstruction,
+  parseTransferSolInstruction,
+} from '../src/index.js';
 import {
   createDefaultSolanaClient,
   createDefaultTransaction,
   generateKeyPairSignerWithSol,
   getBalance,
   signAndSendTransaction,
-} from './_setup';
+} from './_setup.js';
 
 test('it transfers SOL from one account to another', async (t) => {
   // Given a source account with 3 SOL and a destination account with no SOL.

+ 1 - 1
clients/js/tsconfig.json

@@ -8,7 +8,7 @@
       "forceConsistentCasingInFileNames": true,
       "inlineSources": false,
       "isolatedModules": true,
-      "module": "commonjs",
+      "module": "ESNext",
       "moduleResolution": "node",
       "noFallthroughCasesInSwitch": true,
       "noUnusedLocals": true,

+ 1 - 1
clients/js/tsup.config.ts

@@ -21,7 +21,7 @@ export default defineConfig(() => [
     ...SHARED_OPTIONS,
     bundle: false,
     entry: ['./test/*.ts'],
-    format: 'cjs',
+    format: 'esm',
     outDir: './dist/test',
   },
 ]);

+ 3 - 3
pnpm-lock.yaml

@@ -10,7 +10,7 @@ devDependencies:
     version: 2.2.5
   '@metaplex-foundation/kinobi':
     specifier: ^0.17.8
-    version: 0.17.8(fastestsmallesttextencoderdecoder@1.0.22)
+    version: 0.17.9(fastestsmallesttextencoderdecoder@1.0.22)
   '@metaplex-foundation/shank-js':
     specifier: ^0.1.7
     version: 0.1.7
@@ -27,8 +27,8 @@ packages:
     resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
     dev: true
 
-  /@metaplex-foundation/kinobi@0.17.8(fastestsmallesttextencoderdecoder@1.0.22):
-    resolution: {integrity: sha512-MPtUzxox+asyD3ut6hXyLJkcW/XbFCVFzWGyY9IH/ghdfUGwbFZcHXHRXiqOssKS5y1+tw6+5byCCCiswYoVlw==}
+  /@metaplex-foundation/kinobi@0.17.9(fastestsmallesttextencoderdecoder@1.0.22):
+    resolution: {integrity: sha512-vvv/LJ/ZDdFIF9tD9yCbLtqeZ4z/ANfnFqlOfNBsddFD1iQrLPOZ8+OokDDkIpRcz4kiyEWLUgFeC5dR17bFRg==}
     dependencies:
       '@noble/hashes': 1.3.3
       '@solana/codecs-strings': 2.0.0-experimental.a157265(fastestsmallesttextencoderdecoder@1.0.22)