From 80a9bd3ab623698410d15b7761be93d7c7256401 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Wed, 31 Jul 2024 20:46:02 +0800 Subject: [PATCH] refactor: Use tsx instead of ts-node --- examples/rgbpp/README.md | 28 +-- examples/rgbpp/package.json | 2 - examples/rgbpp/tsconfig.json | 4 +- examples/xudt-on-ckb/README.md | 4 +- examples/xudt-on-ckb/package.json | 4 +- examples/xudt-on-ckb/tsconfig.json | 4 +- package.json | 2 +- packages/ckb/package.json | 2 +- packages/ckb/src/utils/ckb-tx.ts | 2 + packages/ckb/tsconfig.json | 7 - pnpm-lock.yaml | 318 +++++++++++++++++++++++++---- tests/rgbpp/package.json | 4 +- tests/rgbpp/tsconfig.json | 4 +- 13 files changed, 308 insertions(+), 77 deletions(-) diff --git a/examples/rgbpp/README.md b/examples/rgbpp/README.md index e3f4847c..3de3d193 100644 --- a/examples/rgbpp/README.md +++ b/examples/rgbpp/README.md @@ -79,7 +79,7 @@ VITE_BTC_SERVICE_ORIGIN=https://btc-test.app ```shell # Create a CKB empty rgbpp lock cell to launch RGB++ xUDT assets later -npx ts-node xudt/launch/1-prepare-launch.ts +npx tsx xudt/launch/1-prepare-launch.ts ``` #### 2. Launch RGB++ xUDT on BTC @@ -87,7 +87,7 @@ npx ts-node xudt/launch/1-prepare-launch.ts > Please make sure the `1-prepare-launch.ts` has been run and the corresponding CKB transaction has been committed. ```shell -npx ts-node xudt/launch/2-launch-rgbpp.ts +npx tsx xudt/launch/2-launch-rgbpp.ts ``` When the command is executed successfully, the **RGB++ Asset type script args** will appear in the output log @@ -99,7 +99,7 @@ When the command is executed successfully, the **RGB++ Asset type script args** > The **RGB++ Asset type script args** in the above should be set to the `xudtTypeArgs`. ```shell -npx ts-node xudt/launch/3-distribute-rgbpp.ts +npx tsx xudt/launch/3-distribute-rgbpp.ts ``` ### RGB++ xUDT Transfer and Leap @@ -107,19 +107,19 @@ npx ts-node xudt/launch/3-distribute-rgbpp.ts #### 1. Leap xUDT from CKB to BTC ```shell -npx ts-node xudt/1-ckb-leap-btc.ts +npx tsx xudt/1-ckb-leap-btc.ts ``` #### 2. Transfer RGB++ xUDT on BTC with Queue Service ```shell -npx ts-node xudt/2-btc-transfer.ts +npx tsx xudt/2-btc-transfer.ts ``` #### 3. Leap RGB++ xUDT from BTC to CKB with Queue Service ```shell -npx ts-node xudt/3-btc-leap-ckb.ts +npx tsx xudt/3-btc-leap-ckb.ts ``` #### 4. Unlock xUDT BTC time cells on CKB @@ -131,7 +131,7 @@ However, you can still manually unlock the spore BTC time cell through the follo Warning: Wait at least 6 BTC confirmation blocks to unlock the BTC time cells after 3-btc-leap-ckb.ts ```shell -npx ts-node xudt/4-unlock-btc-time.ts +npx tsx xudt/4-unlock-btc-time.ts ``` ## RGB++ Spore Examples @@ -146,10 +146,10 @@ npx ts-node xudt/4-unlock-btc-time.ts ```shell # Create a CKB empty rgbpp lock cell to create cluster later -npx ts-node spore/launch/1-prepare-cluster.ts +npx tsx spore/launch/1-prepare-cluster.ts # Create a cluster cell with rgbpp lock -npx ts-node spore/launch/2-create-cluster.ts +npx tsx spore/launch/2-create-cluster.ts ``` When the commands are executed successfully, the **clusterId** and **cluster rgbpp lock args** will appear in the output log @@ -161,7 +161,7 @@ When the commands are executed successfully, the **clusterId** and **cluster rgb > The **clusterId** in the above should be set to the `clusterId` and the **cluster rgbpp lock args** should be set to the `clusterRgbppLockArgs`. ```shell -npx ts-node spore/launch/3-create-spores.ts +npx tsx spore/launch/3-create-spores.ts ``` ### Transfer and Leap Spore @@ -169,13 +169,13 @@ npx ts-node spore/launch/3-create-spores.ts #### 1. Transfer RGB++ Spore on BTC with Queue Service ```shell -npx ts-node spore/4-transfer-spore.ts +npx tsx spore/4-transfer-spore.ts ``` #### 2. Leap RGB++ Spore from BTC to CKB ```shell -npx ts-node spore/5-leap-spore-to-ckb.ts +npx tsx spore/5-leap-spore-to-ckb.ts ``` #### 3. Unlock Spore BTC time cells on CKB @@ -187,13 +187,13 @@ However, you can still manually unlock the spore BTC time cell through the follo **Warning: Wait at least 6 BTC confirmation blocks to unlock the BTC time cells after 5-leap-spore-to-ckb.ts** ```shell -npx ts-node spore/6-unlock-btc-time-cell.ts +npx tsx spore/6-unlock-btc-time-cell.ts ``` #### 4. Leap Spore from CKB to BTC ```shell -npx ts-node spore/7-leap-spore-to-btc.ts +npx tsx spore/7-leap-spore-to-btc.ts ``` ## FAQ diff --git a/examples/rgbpp/package.json b/examples/rgbpp/package.json index 55ed09c3..2469e8ee 100644 --- a/examples/rgbpp/package.json +++ b/examples/rgbpp/package.json @@ -14,8 +14,6 @@ "rgbpp": "workspace:*" }, "devDependencies": { - "@types/node": "^20.11.28", - "typescript": "^5.4.2", "dotenv": "^16.4.5", "@types/dotenv": "^8.2.0" } diff --git a/examples/rgbpp/tsconfig.json b/examples/rgbpp/tsconfig.json index 1ba8f320..f633c1e6 100644 --- a/examples/rgbpp/tsconfig.json +++ b/examples/rgbpp/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "target": "ES2015", "lib": ["esnext"], - "module": "NodeNext", + "module": "ES2015", "composite": false, "resolveJsonModule": true, "strictNullChecks": true, @@ -14,7 +14,7 @@ "forceConsistentCasingInFileNames": true, "inlineSources": false, "isolatedModules": true, - "moduleResolution": "NodeNext", + "moduleResolution": "Bundler", "noUnusedLocals": false, "noUnusedParameters": false, "preserveWatchOutput": true, diff --git a/examples/xudt-on-ckb/README.md b/examples/xudt-on-ckb/README.md index c0362fda..2281b9f7 100644 --- a/examples/xudt-on-ckb/README.md +++ b/examples/xudt-on-ckb/README.md @@ -30,7 +30,7 @@ CKB_INDEXER_URL=https://testnet.ckb.dev/indexer ### Issue xUDT on CKB ```shell -npx ts-node 1-issue-xudt.ts +npx tsx 1-issue-xudt.ts ``` ### Mint/Transfer xUDT on CKB @@ -38,5 +38,5 @@ npx ts-node 1-issue-xudt.ts You can use this command to mint or transfer xUDT assets ```shell -npx ts-node 2-transfer-xudt.ts +npx tsx 2-transfer-xudt.ts ``` diff --git a/examples/xudt-on-ckb/package.json b/examples/xudt-on-ckb/package.json index b495d5db..804a8214 100644 --- a/examples/xudt-on-ckb/package.json +++ b/examples/xudt-on-ckb/package.json @@ -10,8 +10,8 @@ "lint:fix": "tsc && eslint --fix --ext .ts . && prettier --write '**/*.ts'" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1", - "rgbpp": "^0.4.0" + "@nervosnetwork/ckb-sdk-utils": "0.109.2", + "rgbpp": "workspace:*" }, "devDependencies": { "dotenv": "^16.4.5", diff --git a/examples/xudt-on-ckb/tsconfig.json b/examples/xudt-on-ckb/tsconfig.json index 20b7ecf0..4f6769c9 100644 --- a/examples/xudt-on-ckb/tsconfig.json +++ b/examples/xudt-on-ckb/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2015", "lib": ["dom", "esnext"], - "module": "NodeNext", + "module": "ES2015", "composite": false, "resolveJsonModule": true, "strictNullChecks": true, @@ -13,7 +13,7 @@ "forceConsistentCasingInFileNames": true, "inlineSources": false, "isolatedModules": true, - "moduleResolution": "NodeNext", + "moduleResolution": "Bundler", "noUnusedLocals": false, "noUnusedParameters": false, "preserveWatchOutput": true, diff --git a/package.json b/package.json index d4bf6066..6cc74c5d 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "husky": "^9.0.11", "lint-staged": "^15.2.2", "prettier": "^3.2.5", - "ts-node": "^10.9.2", + "tsx": "4.16.3", "tsup": "^8.1.0", "typescript": "^5.4.3", "vitest": "1.6.0" diff --git a/packages/ckb/package.json b/packages/ckb/package.json index efe842f2..6c5a6fa8 100644 --- a/packages/ckb/package.json +++ b/packages/ckb/package.json @@ -6,7 +6,7 @@ "build": "tsup", "lint": "tsc && eslint --ext .ts {src,example}/* && prettier --check '{src,example}/**/*.{js,ts}'", "lint:fix": "tsc && eslint --fix --ext .ts {src,example}/* && prettier --write '{src,example}/**/*.{js,ts}'", - "splitCells": "npx ts-node example/paymaster.ts" + "splitCells": "npx tsx example/paymaster.ts" }, "sideEffects": false, "main": "./dist/index.js", diff --git a/packages/ckb/src/utils/ckb-tx.ts b/packages/ckb/src/utils/ckb-tx.ts index 9c8bfc2d..812f1765 100644 --- a/packages/ckb/src/utils/ckb-tx.ts +++ b/packages/ckb/src/utils/ckb-tx.ts @@ -13,6 +13,8 @@ import { encodeRgbppTokenInfo, genBtcTimeLockScript } from './rgbpp'; import { Collector } from '../collector'; import { NoLiveCellError } from '../error'; +export { serializeScript }; + export const calculateTransactionFee = (txSize: number, feeRate?: bigint): bigint => { const rate = feeRate ?? BigInt(1100); const ratio = BigInt(1000); diff --git a/packages/ckb/tsconfig.json b/packages/ckb/tsconfig.json index 22045fbf..880c941b 100644 --- a/packages/ckb/tsconfig.json +++ b/packages/ckb/tsconfig.json @@ -17,11 +17,4 @@ }, "include": ["src"], "exclude": ["node_modules", "dist", "**/*.spec.ts", "example"], - "ts-node": { - // these options are overrides used only by ts-node - // same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable - "compilerOptions": { - "module": "CommonJS" - } - } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20ee5c64..b1f9e0ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,18 +38,18 @@ importers: prettier: specifier: ^3.2.5 version: 3.3.3 - ts-node: - specifier: ^10.9.2 - version: 10.9.2(@types/node@20.14.11)(typescript@5.5.3) tsup: specifier: ^8.1.0 - version: 8.2.3(typescript@5.5.3) + version: 8.2.3(tsx@4.16.3)(typescript@5.5.3) + tsx: + specifier: 4.16.3 + version: 4.16.3 typescript: specifier: ^5.4.3 version: 5.5.3 vitest: specifier: 1.6.0 - version: 1.6.0(@types/node@20.14.11) + version: 1.6.0 apps/service: dependencies: @@ -136,24 +136,18 @@ importers: '@types/dotenv': specifier: ^8.2.0 version: 8.2.0 - '@types/node': - specifier: ^20.11.28 - version: 20.14.11 dotenv: specifier: ^16.4.5 version: 16.4.5 - typescript: - specifier: ^5.4.2 - version: 5.5.3 examples/xudt-on-ckb: dependencies: '@nervosnetwork/ckb-sdk-utils': - specifier: 0.109.2-alpha.1 - version: 0.109.2-alpha.1 + specifier: 0.109.2 + version: 0.109.2 rgbpp: - specifier: ^0.4.0 - version: 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) + specifier: workspace:* + version: link:../../packages/rgbpp devDependencies: '@types/dotenv': specifier: ^8.2.0 @@ -1134,6 +1128,15 @@ packages: dev: true optional: true + /@esbuild/aix-ppc64@0.21.5: + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + /@esbuild/aix-ppc64@0.23.0: resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} engines: {node: '>=18'} @@ -1152,6 +1155,15 @@ packages: dev: true optional: true + /@esbuild/android-arm64@0.21.5: + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm64@0.23.0: resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} engines: {node: '>=18'} @@ -1170,6 +1182,15 @@ packages: dev: true optional: true + /@esbuild/android-arm@0.21.5: + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm@0.23.0: resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} engines: {node: '>=18'} @@ -1188,6 +1209,15 @@ packages: dev: true optional: true + /@esbuild/android-x64@0.21.5: + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-x64@0.23.0: resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} engines: {node: '>=18'} @@ -1206,6 +1236,15 @@ packages: dev: true optional: true + /@esbuild/darwin-arm64@0.21.5: + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-arm64@0.23.0: resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} engines: {node: '>=18'} @@ -1224,6 +1263,15 @@ packages: dev: true optional: true + /@esbuild/darwin-x64@0.21.5: + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-x64@0.23.0: resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} engines: {node: '>=18'} @@ -1242,6 +1290,15 @@ packages: dev: true optional: true + /@esbuild/freebsd-arm64@0.21.5: + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-arm64@0.23.0: resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} engines: {node: '>=18'} @@ -1260,6 +1317,15 @@ packages: dev: true optional: true + /@esbuild/freebsd-x64@0.21.5: + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-x64@0.23.0: resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} engines: {node: '>=18'} @@ -1278,6 +1344,15 @@ packages: dev: true optional: true + /@esbuild/linux-arm64@0.21.5: + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm64@0.23.0: resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} engines: {node: '>=18'} @@ -1296,6 +1371,15 @@ packages: dev: true optional: true + /@esbuild/linux-arm@0.21.5: + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm@0.23.0: resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} engines: {node: '>=18'} @@ -1314,6 +1398,15 @@ packages: dev: true optional: true + /@esbuild/linux-ia32@0.21.5: + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ia32@0.23.0: resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} engines: {node: '>=18'} @@ -1332,6 +1425,15 @@ packages: dev: true optional: true + /@esbuild/linux-loong64@0.21.5: + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-loong64@0.23.0: resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} engines: {node: '>=18'} @@ -1350,6 +1452,15 @@ packages: dev: true optional: true + /@esbuild/linux-mips64el@0.21.5: + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-mips64el@0.23.0: resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} engines: {node: '>=18'} @@ -1368,6 +1479,15 @@ packages: dev: true optional: true + /@esbuild/linux-ppc64@0.21.5: + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ppc64@0.23.0: resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} engines: {node: '>=18'} @@ -1386,6 +1506,15 @@ packages: dev: true optional: true + /@esbuild/linux-riscv64@0.21.5: + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-riscv64@0.23.0: resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} engines: {node: '>=18'} @@ -1404,6 +1533,15 @@ packages: dev: true optional: true + /@esbuild/linux-s390x@0.21.5: + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-s390x@0.23.0: resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} engines: {node: '>=18'} @@ -1422,6 +1560,15 @@ packages: dev: true optional: true + /@esbuild/linux-x64@0.21.5: + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-x64@0.23.0: resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} engines: {node: '>=18'} @@ -1440,6 +1587,15 @@ packages: dev: true optional: true + /@esbuild/netbsd-x64@0.21.5: + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/netbsd-x64@0.23.0: resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} engines: {node: '>=18'} @@ -1467,6 +1623,15 @@ packages: dev: true optional: true + /@esbuild/openbsd-x64@0.21.5: + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/openbsd-x64@0.23.0: resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} engines: {node: '>=18'} @@ -1485,6 +1650,15 @@ packages: dev: true optional: true + /@esbuild/sunos-x64@0.21.5: + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + /@esbuild/sunos-x64@0.23.0: resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} engines: {node: '>=18'} @@ -1503,6 +1677,15 @@ packages: dev: true optional: true + /@esbuild/win32-arm64@0.21.5: + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-arm64@0.23.0: resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} engines: {node: '>=18'} @@ -1521,6 +1704,15 @@ packages: dev: true optional: true + /@esbuild/win32-ia32@0.21.5: + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-ia32@0.23.0: resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} engines: {node: '>=18'} @@ -1539,6 +1731,15 @@ packages: dev: true optional: true + /@esbuild/win32-x64@0.21.5: + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-x64@0.23.0: resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} engines: {node: '>=18'} @@ -2017,16 +2218,6 @@ packages: tslib: 2.3.1 dev: false - /@nervosnetwork/ckb-sdk-utils@0.109.2-alpha.1: - resolution: {integrity: sha512-a3dT8SExjJNMftVOeuI9/qISvlKeGFoLzHECbgrh3qO2nT6+1zTMoFE+u5aDQG21iP1ZlFXR2s0cDIm1naoR0w==} - dependencies: - '@nervosnetwork/ckb-types': 0.109.2-alpha.1 - bech32: 2.0.0 - elliptic: 6.5.4 - jsbi: 3.1.3 - tslib: 2.3.1 - dev: false - /@nervosnetwork/ckb-types@0.109.1: resolution: {integrity: sha512-mD5mOCGa1JertKZekHSUVYwFPW27VJ0/MdwblWvEEK7pNIU6az+dLiIxgvl4TxR+j+7/GqmXNH1U59CM92y/wg==} dev: false @@ -2035,10 +2226,6 @@ packages: resolution: {integrity: sha512-NAQbUi+j6tWlUYijvHqWIUwrbawIeAeSlxUQm0wkqSKbtAEoiR4L6RZS7cgn7uH+SMsp78mciXP8gixrfH3rEQ==} dev: false - /@nervosnetwork/ckb-types@0.109.2-alpha.1: - resolution: {integrity: sha512-O4rhLuGTpkatdNzYRAOO3nzjyvSMFM4If3TQtDXZ5AM7YXxJRnj7IJBs1Jl/mSZbQn6vCqccqZ/nRM5IMu3etA==} - dev: false - /@nestjs/cli@10.4.2(esbuild@0.23.0): resolution: {integrity: sha512-fQexIfLHfp6GUgX+CO4fOg+AEwV5ox/LHotQhyZi9wXUQDyIqS0NTTbumr//62EcX35qV4nU0359nYnuEdzG+A==} engines: {node: '>= 16.14'} @@ -4077,6 +4264,37 @@ packages: '@esbuild/win32-x64': 0.20.2 dev: true + /esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + dev: true + /esbuild@0.23.0: resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} engines: {node: '>=18'} @@ -4646,6 +4864,12 @@ packages: engines: {node: '>=16'} dev: true + /get-tsconfig@4.7.6: + resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -6374,7 +6598,7 @@ packages: engines: {node: '>=4'} dev: true - /postcss-load-config@6.0.1: + /postcss-load-config@6.0.1(tsx@4.16.3): resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} engines: {node: '>= 18'} peerDependencies: @@ -6393,6 +6617,7 @@ packages: optional: true dependencies: lilconfig: 3.1.2 + tsx: 4.16.3 dev: true /postcss@8.4.39: @@ -6609,6 +6834,10 @@ packages: engines: {node: '>=8'} dev: true + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} @@ -7407,7 +7636,7 @@ packages: /tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - /tsup@8.2.3(typescript@5.5.3): + /tsup@8.2.3(tsx@4.16.3)(typescript@5.5.3): resolution: {integrity: sha512-6YNT44oUfXRbZuSMNmN36GzwPPIlD2wBccY7looM2fkTcxkf2NEmwr3OZuDZoySklnrIG4hoEtzy8yUXYOqNcg==} engines: {node: '>=18'} hasBin: true @@ -7436,7 +7665,7 @@ packages: globby: 11.1.0 joycon: 3.1.1 picocolors: 1.0.1 - postcss-load-config: 6.0.1 + postcss-load-config: 6.0.1(tsx@4.16.3) resolve-from: 5.0.0 rollup: 4.19.0 source-map: 0.8.0-beta.0 @@ -7450,6 +7679,17 @@ packages: - yaml dev: true + /tsx@4.16.3: + resolution: {integrity: sha512-MP8AEUxVnboD2rCC6kDLxnpDBNWN9k3BSVU/0/nNxgm70bPBnfn+yCKcnOsIVPQwdkbKYoFOlKjjWZWJ2XCXUg==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.21.5 + get-tsconfig: 4.7.6 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -7560,7 +7800,7 @@ packages: safe-buffer: 5.2.1 dev: false - /vite-node@1.6.0(@types/node@20.14.11): + /vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -7569,7 +7809,7 @@ packages: debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.2.12(@types/node@20.14.11) + vite: 5.2.12 transitivePeerDependencies: - '@types/node' - less @@ -7581,7 +7821,7 @@ packages: - terser dev: true - /vite@5.2.12(@types/node@20.14.11): + /vite@5.2.12: resolution: {integrity: sha512-/gC8GxzxMK5ntBwb48pR32GGhENnjtY30G4A0jemunsBkiEZFw60s8InGpN8gkhHEkjnRK1aSAxeQgwvFhUHAA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -7609,7 +7849,6 @@ packages: terser: optional: true dependencies: - '@types/node': 20.14.11 esbuild: 0.20.2 postcss: 8.4.39 rollup: 4.19.0 @@ -7617,7 +7856,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.6.0(@types/node@20.14.11): + /vitest@1.6.0: resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -7642,7 +7881,6 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.14.11 '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 '@vitest/snapshot': 1.6.0 @@ -7660,8 +7898,8 @@ packages: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.2.12(@types/node@20.14.11) - vite-node: 1.6.0(@types/node@20.14.11) + vite: 5.2.12 + vite-node: 1.6.0 why-is-node-running: 2.3.0 transitivePeerDependencies: - less diff --git a/tests/rgbpp/package.json b/tests/rgbpp/package.json index a7ca218a..ed976f10 100644 --- a/tests/rgbpp/package.json +++ b/tests/rgbpp/package.json @@ -8,8 +8,8 @@ "format": "prettier --write '**/*.{js,ts}'", "lint": "tsc && eslint . && prettier --check '**/*.{js,ts}'", "lint:fix": "tsc && eslint --fix --ext .js,.ts . && prettier --write '**/*.{js,ts}'", - "integration:xudt": "npx ts-node shared/prepare-utxo.ts && npx ts-node xudt/xudt-on-ckb/1-issue-xudt.ts && npx ts-node xudt/xudt-on-ckb/2-transfer-xudt.ts && npx ts-node xudt/1-ckb-leap-btc.ts && npx ts-node xudt/2-btc-transfer.ts && npx ts-node xudt/3-btc-leap-ckb.ts", - "integration:spore": "npx ts-node shared/prepare-utxo.ts && npx ts-node spore/launch/1-prepare-cluster.ts && npx ts-node spore/launch/2-create-cluster.ts && npx ts-node spore/launch/3-create-spores.ts && npx ts-node spore/4-transfer-spore.ts && npx ts-node spore/5-leap-spore-to-ckb.ts" + "integration:xudt": "npx tsx shared/prepare-utxo.ts && npx tsx xudt/xudt-on-ckb/1-issue-xudt.ts && npx tsx xudt/xudt-on-ckb/2-transfer-xudt.ts && npx tsx xudt/1-ckb-leap-btc.ts && npx tsx xudt/2-btc-transfer.ts && npx tsx xudt/3-btc-leap-ckb.ts", + "integration:spore": "npx tsx shared/prepare-utxo.ts && npx tsx spore/launch/1-prepare-cluster.ts && npx tsx spore/launch/2-create-cluster.ts && npx tsx spore/launch/3-create-spores.ts && npx tsx spore/4-transfer-spore.ts && npx tsx spore/5-leap-spore-to-ckb.ts" }, "dependencies": { "@nervosnetwork/ckb-sdk-utils": "0.109.2", diff --git a/tests/rgbpp/tsconfig.json b/tests/rgbpp/tsconfig.json index 403bbe62..802873a1 100644 --- a/tests/rgbpp/tsconfig.json +++ b/tests/rgbpp/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2015", "lib": ["dom", "esnext"], - "module": "NodeNext", + "module": "ES2015", "composite": false, "resolveJsonModule": true, "strictNullChecks": true, @@ -13,7 +13,7 @@ "forceConsistentCasingInFileNames": true, "inlineSources": false, "isolatedModules": true, - "moduleResolution": "NodeNext", + "moduleResolution": "Bundler", "noUnusedLocals": false, "noUnusedParameters": false, "preserveWatchOutput": true,