From 63aad0867fbcf4994019adae121d40d5cdeada25 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 27 Jun 2024 14:33:39 +0800 Subject: [PATCH 01/15] refactor: Use tsup instead of turbo --- .eslintrc.json | 1 + package.json | 24 +- pnpm-lock.yaml | 654 +++++++++++++++++++++++++++++++++----------- tsconfig.json | 62 +++++ tsup-base.config.ts | 13 + turbo.json | 32 --- 6 files changed, 580 insertions(+), 206 deletions(-) create mode 100644 tsconfig.json create mode 100644 tsup-base.config.ts delete mode 100644 turbo.json diff --git a/.eslintrc.json b/.eslintrc.json index bdddae2e..abceb5e9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,7 @@ "browser": true, "es2021": true }, + "ignorePatterns": ["dist/"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended" diff --git a/package.json b/package.json index 032b8b44..ba448065 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,13 @@ ], "scripts": { "prepare": "husky", - "build": "turbo run build", - "test:packages": "turbo run test --filter=./packages/*", - "build:packages": "turbo run build --filter=./packages/*", - "dev:service": "turbo run dev --filter=./apps/service", - "lint:fix": "turbo run lint:fix", - "lint:packages": "turbo run lint --filter=./{packages,examples,tests}/*", + "build": "pnpm run --r --filter \"./{packages,apps,examples,tests}/**\" build", + "test:packages": "pnpm run --r --filter \"./packages/**\" test", + "build:packages": "pnpm run --r --filter \"./packages/**\" build", + "dev:service": "pnpm run --r --filter=./apps/service dev", + "lint": "eslint {packages,apps,examples,tests}/**/*.ts && prettier --check '{packages,apps,examples,tests}/**/*.ts'", + "lint:fix": "eslint --fix {packages,apps,examples,tests}/**/*.ts", "format": "prettier --write '{packages,apps,examples,tests}/**/*.{js,jsx,ts,tsx}'", - "clean": "turbo run clean", - "clean:packages": "turbo run clean --filter=./packages/*", "clean:dependencies": "pnpm clean:sub-dependencies && rimraf node_modules", "clean:sub-dependencies": "rimraf packages/**/node_modules apps/**/node_modules", "release:packages": "pnpm run build:packages && changeset publish" @@ -25,19 +23,21 @@ "@changesets/types": "^6.0.0", "@typescript-eslint/eslint-plugin": "^7.8.0", "@typescript-eslint/parser": "^7.8.0", + "@types/lodash": "^4.17.0", "eslint": "^8.56.0", "husky": "^9.0.11", "lint-staged": "^15.2.2", "prettier": "^3.2.5", - "rimraf": "^5.0.5", "ts-node": "^10.9.2", - "turbo": "^1.13.0", + "tsup": "^7.2.0", + "vite": "5.2.12", + "vitest": "1.6.0", "typescript": "^5.4.3" }, "lint-staged": { "{packages,apps,examples,tests}/**/*.{js,jsx,ts,tsx}": [ - "eslint --fix", - "prettier --ignore-unknown --write" + "pnpm run lint:fix", + "pnpm run format" ] }, "packageManager": "pnpm@8.15.8+sha512.d1a029e1a447ad90bc96cd58b0fad486d2993d531856396f7babf2d83eb1823bb83c5a3d0fc18f675b2d10321d49eb161fece36fe8134aa5823ecd215feed392", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e533e502..c01527d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@changesets/types': specifier: ^6.0.0 version: 6.0.0 + '@types/lodash': + specifier: ^4.17.0 + version: 4.17.7 '@typescript-eslint/eslint-plugin': specifier: ^7.8.0 version: 7.16.1(@typescript-eslint/parser@7.16.1)(eslint@8.57.0)(typescript@5.5.3) @@ -35,18 +38,21 @@ importers: prettier: specifier: ^3.2.5 version: 3.3.3 - rimraf: - specifier: ^5.0.5 - version: 5.0.9 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@20.14.11)(typescript@5.5.3) - turbo: - specifier: ^1.13.0 - version: 1.13.4 + tsup: + specifier: ^7.2.0 + version: 7.3.0(ts-node@10.9.2)(typescript@5.5.3) typescript: specifier: ^5.4.3 version: 5.5.3 + vite: + specifier: 5.2.12 + version: 5.2.12(@types/node@20.14.11) + vitest: + specifier: 1.6.0 + version: 1.6.0(@types/node@20.14.11) apps/service: dependencies: @@ -83,7 +89,7 @@ importers: devDependencies: '@nestjs/cli': specifier: ^10.0.0 - version: 10.4.2 + version: 10.4.2(esbuild@0.19.12) '@nestjs/schematics': specifier: ^10.0.0 version: 10.1.2(typescript@5.5.3) @@ -107,7 +113,7 @@ importers: version: 6.3.4 ts-jest: specifier: ^29.1.0 - version: 29.2.3(@babel/core@7.24.9)(jest@29.7.0)(typescript@5.5.3) + version: 29.2.3(@babel/core@7.24.9)(esbuild@0.19.12)(jest@29.7.0)(typescript@5.5.3) ts-loader: specifier: ^9.4.3 version: 9.5.1(typescript@5.5.3)(webpack@5.93.0) @@ -1148,8 +1154,8 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@esbuild/aix-ppc64@0.21.5: - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + /@esbuild/aix-ppc64@0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} engines: {node: '>=12'} cpu: [ppc64] os: [aix] @@ -1157,8 +1163,26 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.21.5: - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + /@esbuild/aix-ppc64@0.20.2: + resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.20.2: + resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1166,8 +1190,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.21.5: - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + /@esbuild/android-arm@0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1175,8 +1199,17 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.21.5: - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + /@esbuild/android-arm@0.20.2: + resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1184,8 +1217,17 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.21.5: - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + /@esbuild/android-x64@0.20.2: + resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1193,8 +1235,26 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.21.5: - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + /@esbuild/darwin-arm64@0.20.2: + resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.20.2: + resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1202,8 +1262,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.21.5: - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + /@esbuild/freebsd-arm64@0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1211,8 +1271,17 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.21.5: - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + /@esbuild/freebsd-arm64@0.20.2: + resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1220,8 +1289,26 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.21.5: - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + /@esbuild/freebsd-x64@0.20.2: + resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.20.2: + resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1229,8 +1316,17 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.21.5: - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + /@esbuild/linux-arm@0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.20.2: + resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1238,8 +1334,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.21.5: - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + /@esbuild/linux-ia32@0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1247,8 +1343,17 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.21.5: - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + /@esbuild/linux-ia32@0.20.2: + resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -1256,8 +1361,26 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.21.5: - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + /@esbuild/linux-loong64@0.20.2: + resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.20.2: + resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1265,8 +1388,17 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.21.5: - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + /@esbuild/linux-ppc64@0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.20.2: + resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1274,8 +1406,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.21.5: - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + /@esbuild/linux-riscv64@0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1283,8 +1415,17 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.21.5: - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + /@esbuild/linux-riscv64@0.20.2: + resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1292,8 +1433,17 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.21.5: - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + /@esbuild/linux-s390x@0.20.2: + resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1301,8 +1451,17 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.21.5: - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + /@esbuild/linux-x64@0.20.2: + resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1310,8 +1469,17 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.21.5: - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + /@esbuild/netbsd-x64@0.20.2: + resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1319,8 +1487,26 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.21.5: - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + /@esbuild/openbsd-x64@0.20.2: + resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.20.2: + resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1328,8 +1514,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.21.5: - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + /@esbuild/win32-arm64@0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1337,8 +1523,26 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.21.5: - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + /@esbuild/win32-arm64@0.20.2: + resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.20.2: + resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1346,8 +1550,17 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.21.5: - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + /@esbuild/win32-x64@0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.20.2: + resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1818,7 +2031,7 @@ packages: resolution: {integrity: sha512-mD5mOCGa1JertKZekHSUVYwFPW27VJ0/MdwblWvEEK7pNIU6az+dLiIxgvl4TxR+j+7/GqmXNH1U59CM92y/wg==} dev: false - /@nestjs/cli@10.4.2: + /@nestjs/cli@10.4.2(esbuild@0.19.12): resolution: {integrity: sha512-fQexIfLHfp6GUgX+CO4fOg+AEwV5ox/LHotQhyZi9wXUQDyIqS0NTTbumr//62EcX35qV4nU0359nYnuEdzG+A==} engines: {node: '>= 16.14'} hasBin: true @@ -1848,7 +2061,7 @@ packages: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.92.1 + webpack: 5.92.1(esbuild@0.19.12) webpack-node-externals: 3.0.0 transitivePeerDependencies: - esbuild @@ -2880,6 +3093,10 @@ packages: engines: {node: '>=12'} dev: true + /any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + dev: true + /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -3217,6 +3434,16 @@ packages: ieee754: 1.2.1 dev: false + /bundle-require@4.2.1(esbuild@0.19.12): + resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.17' + dependencies: + esbuild: 0.19.12 + load-tsconfig: 0.2.5 + dev: true + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -3806,35 +4033,66 @@ packages: resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} dev: true - /esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + /esbuild@0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 + dev: true + + /esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} 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 + '@esbuild/aix-ppc64': 0.20.2 + '@esbuild/android-arm': 0.20.2 + '@esbuild/android-arm64': 0.20.2 + '@esbuild/android-x64': 0.20.2 + '@esbuild/darwin-arm64': 0.20.2 + '@esbuild/darwin-x64': 0.20.2 + '@esbuild/freebsd-arm64': 0.20.2 + '@esbuild/freebsd-x64': 0.20.2 + '@esbuild/linux-arm': 0.20.2 + '@esbuild/linux-arm64': 0.20.2 + '@esbuild/linux-ia32': 0.20.2 + '@esbuild/linux-loong64': 0.20.2 + '@esbuild/linux-mips64el': 0.20.2 + '@esbuild/linux-ppc64': 0.20.2 + '@esbuild/linux-riscv64': 0.20.2 + '@esbuild/linux-s390x': 0.20.2 + '@esbuild/linux-x64': 0.20.2 + '@esbuild/netbsd-x64': 0.20.2 + '@esbuild/openbsd-x64': 0.20.2 + '@esbuild/sunos-x64': 0.20.2 + '@esbuild/win32-arm64': 0.20.2 + '@esbuild/win32-ia32': 0.20.2 + '@esbuild/win32-x64': 0.20.2 dev: true /escalade@3.1.2: @@ -4257,7 +4515,7 @@ packages: semver: 7.6.3 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.92.1 + webpack: 5.92.1(esbuild@0.19.12) dev: true /form-data@4.0.0: @@ -5267,6 +5525,11 @@ packages: - ts-node dev: true + /joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + dev: true + /js-sha256@0.11.0: resolution: {integrity: sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==} dev: false @@ -5441,6 +5704,11 @@ packages: wrap-ansi: 9.0.0 dev: true + /load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /load-yaml-file@0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} @@ -5506,6 +5774,10 @@ packages: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} dev: false + /lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + dev: true + /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true @@ -5727,6 +5999,14 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true + /mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + dev: true + /nanoassert@2.0.0: resolution: {integrity: sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==} dev: false @@ -5803,6 +6083,11 @@ packages: path-key: 4.0.0 dev: true + /object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + /object-inspect@1.13.2: resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} engines: {node: '>= 0.4'} @@ -6075,6 +6360,23 @@ packages: engines: {node: '>=4'} dev: true + /postcss-load-config@4.0.2(ts-node@10.9.2): + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 3.1.2 + ts-node: 10.9.2(@types/node@20.14.11)(typescript@5.5.3) + yaml: 2.4.5 + dev: true + /postcss@8.4.39: resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} engines: {node: ^10 || ^12 || >=14} @@ -6356,14 +6658,6 @@ packages: glob: 7.2.3 dev: true - /rimraf@5.0.9: - resolution: {integrity: sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==} - engines: {node: 14 >=14.20 || 16 >=16.20 || >=18} - hasBin: true - dependencies: - glob: 10.4.5 - dev: true - /ripemd160@2.0.2: resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} dependencies: @@ -6606,6 +6900,13 @@ packages: engines: {node: '>= 8'} dev: true + /source-map@0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + dependencies: + whatwg-url: 7.1.0 + dev: true + /spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} dependencies: @@ -6727,6 +7028,20 @@ packages: js-tokens: 9.0.0 dev: true + /sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + commander: 4.1.1 + glob: 10.4.5 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.6 + ts-interface-checker: 0.1.13 + dev: true + /superagent@8.1.2: resolution: {integrity: sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==} engines: {node: '>=6.4.0 <13 || >=14'} @@ -6796,7 +7111,7 @@ packages: engines: {node: '>=8'} dev: true - /terser-webpack-plugin@5.3.10(webpack@5.92.1): + /terser-webpack-plugin@5.3.10(esbuild@0.19.12)(webpack@5.92.1): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -6813,14 +7128,15 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.25 + esbuild: 0.19.12 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.3 - webpack: 5.92.1 + webpack: 5.92.1(esbuild@0.19.12) dev: true - /terser-webpack-plugin@5.3.10(webpack@5.93.0): + /terser-webpack-plugin@5.3.10(esbuild@0.19.12)(webpack@5.93.0): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -6837,11 +7153,12 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.25 + esbuild: 0.19.12 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.3 - webpack: 5.93.0 + webpack: 5.93.0(esbuild@0.19.12) dev: true /terser@5.31.3: @@ -6868,6 +7185,19 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true + /thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + dependencies: + thenify: 3.3.1 + dev: true + + /thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + dependencies: + any-promise: 1.3.0 + dev: true + /thread-stream@3.1.0: resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} dependencies: @@ -6923,6 +7253,12 @@ packages: /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + /tr46@1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + dependencies: + punycode: 2.3.1 + dev: true + /tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true @@ -6937,7 +7273,11 @@ packages: typescript: 5.5.3 dev: true - /ts-jest@29.2.3(@babel/core@7.24.9)(jest@29.7.0)(typescript@5.5.3): + /ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + dev: true + + /ts-jest@29.2.3(@babel/core@7.24.9)(esbuild@0.19.12)(jest@29.7.0)(typescript@5.5.3): resolution: {integrity: sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -6964,6 +7304,7 @@ packages: '@babel/core': 7.24.9 bs-logger: 0.2.6 ejs: 3.1.10 + esbuild: 0.19.12 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@20.14.11)(ts-node@10.9.2) jest-util: 29.7.0 @@ -6988,7 +7329,7 @@ packages: semver: 7.6.3 source-map: 0.7.4 typescript: 5.5.3 - webpack: 5.93.0 + webpack: 5.93.0(esbuild@0.19.12) dev: true /ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.3): @@ -7047,64 +7388,41 @@ packages: /tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - /turbo-darwin-64@1.13.4: - resolution: {integrity: sha512-A0eKd73R7CGnRinTiS7txkMElg+R5rKFp9HV7baDiEL4xTG1FIg/56Vm7A5RVgg8UNgG2qNnrfatJtb+dRmNdw==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /turbo-darwin-arm64@1.13.4: - resolution: {integrity: sha512-eG769Q0NF6/Vyjsr3mKCnkG/eW6dKMBZk6dxWOdrHfrg6QgfkBUk0WUUujzdtVPiUIvsh4l46vQrNVd9EOtbyA==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-64@1.13.4: - resolution: {integrity: sha512-Bq0JphDeNw3XEi+Xb/e4xoKhs1DHN7OoLVUbTIQz+gazYjigVZvtwCvgrZI7eW9Xo1eOXM2zw2u1DGLLUfmGkQ==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-arm64@1.13.4: - resolution: {integrity: sha512-BJcXw1DDiHO/okYbaNdcWN6szjXyHWx9d460v6fCHY65G8CyqGU3y2uUTPK89o8lq/b2C8NK0yZD+Vp0f9VoIg==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-64@1.13.4: - resolution: {integrity: sha512-OFFhXHOFLN7A78vD/dlVuuSSVEB3s9ZBj18Tm1hk3aW1HTWTuAw0ReN6ZNlVObZUHvGy8d57OAGGxf2bT3etQw==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-arm64@1.13.4: - resolution: {integrity: sha512-u5A+VOKHswJJmJ8o8rcilBfU5U3Y1TTAfP9wX8bFh8teYF1ghP0EhtMRLjhtp6RPa+XCxHHVA2CiC3gbh5eg5g==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo@1.13.4: - resolution: {integrity: sha512-1q7+9UJABuBAHrcC4Sxp5lOqYS5mvxRrwa33wpIyM18hlOCpRD/fTJNxZ0vhbMcJmz15o9kkVm743mPn7p6jpQ==} + /tsup@7.3.0(ts-node@10.9.2)(typescript@5.5.3): + resolution: {integrity: sha512-Ja1eaSRrE+QarmATlNO5fse2aOACYMBX+IZRKy1T+gpyH+jXgRrl5l4nHIQJQ1DoDgEjHDTw8cpE085UdBZuWQ==} + engines: {node: '>=18'} + deprecated: Breaking node 16 hasBin: true - optionalDependencies: - turbo-darwin-64: 1.13.4 - turbo-darwin-arm64: 1.13.4 - turbo-linux-64: 1.13.4 - turbo-linux-arm64: 1.13.4 - turbo-windows-64: 1.13.4 - turbo-windows-arm64: 1.13.4 + peerDependencies: + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 4.2.1(esbuild@0.19.12) + cac: 6.7.14 + chokidar: 3.6.0 + debug: 4.3.5 + esbuild: 0.19.12 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 4.0.2(ts-node@10.9.2) + resolve-from: 5.0.0 + rollup: 4.19.0 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tree-kill: 1.2.2 + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + - ts-node dev: true /type-check@0.4.0: @@ -7226,7 +7544,7 @@ packages: debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.3.4(@types/node@20.14.11) + vite: 5.2.12(@types/node@20.14.11) transitivePeerDependencies: - '@types/node' - less @@ -7238,8 +7556,8 @@ packages: - terser dev: true - /vite@5.3.4(@types/node@20.14.11): - resolution: {integrity: sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==} + /vite@5.2.12(@types/node@20.14.11): + resolution: {integrity: sha512-/gC8GxzxMK5ntBwb48pR32GGhENnjtY30G4A0jemunsBkiEZFw60s8InGpN8gkhHEkjnRK1aSAxeQgwvFhUHAA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -7267,7 +7585,7 @@ packages: optional: true dependencies: '@types/node': 20.14.11 - esbuild: 0.21.5 + esbuild: 0.20.2 postcss: 8.4.39 rollup: 4.19.0 optionalDependencies: @@ -7317,7 +7635,7 @@ packages: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.3.4(@types/node@20.14.11) + vite: 5.2.12(@types/node@20.14.11) vite-node: 1.6.0(@types/node@20.14.11) why-is-node-running: 2.3.0 transitivePeerDependencies: @@ -7353,6 +7671,10 @@ packages: /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + /webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + dev: true + /webpack-node-externals@3.0.0: resolution: {integrity: sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==} engines: {node: '>=6'} @@ -7363,7 +7685,7 @@ packages: engines: {node: '>=10.13.0'} dev: true - /webpack@5.92.1: + /webpack@5.92.1(esbuild@0.19.12): resolution: {integrity: sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==} engines: {node: '>=10.13.0'} hasBin: true @@ -7394,7 +7716,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.92.1) + terser-webpack-plugin: 5.3.10(esbuild@0.19.12)(webpack@5.92.1) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -7403,7 +7725,7 @@ packages: - uglify-js dev: true - /webpack@5.93.0: + /webpack@5.93.0(esbuild@0.19.12): resolution: {integrity: sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==} engines: {node: '>=10.13.0'} hasBin: true @@ -7434,7 +7756,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.93.0) + terser-webpack-plugin: 5.3.10(esbuild@0.19.12)(webpack@5.93.0) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -7449,6 +7771,14 @@ packages: tr46: 0.0.3 webidl-conversions: 3.0.1 + /whatwg-url@7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + dev: true + /which-pm@2.2.0: resolution: {integrity: sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==} engines: {node: '>=8.15'} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..a03de788 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,62 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "jsx": "react-jsx", + "lib": [ + "es2021", + "dom" + ], + "module": "esnext", + "moduleResolution": "node", + "target": "es2021", + "composite": false, + "allowJs": true, + "resolveJsonModule": true, + "strictNullChecks": true, + "noEmit": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "inlineSources": false, + "isolatedModules": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "skipLibCheck": true, + "downlevelIteration": true, + "strict": true, + "paths": { + "@rgbpp-sdk/btc": [ + "./packages/btc/src" + ], + "@rgbpp-sdk/btc/*": [ + "packages/btc/src/*" + ], + "@rgbpp-sdk/ckb": [ + "./packages/ckb/src" + ], + "@rgbpp-sdk/ckb/*": [ + "packages/ckb/src/*" + ], + "@rgbpp-sdk/service": [ + "./packages/service/src" + ], + "@rgbpp-sdk/service/*": [ + "packages/service/src/*" + ], + } + }, + "exclude": [ + "**/node_modules/**", + "**/dist/**" + ], + "include": [ + "packages/**/*", + "examples/**/*", + "apps/**/*", + "tests/**/*", + "tsup-base.config.ts", + "vitest.config.mts", + ] +} diff --git a/tsup-base.config.ts b/tsup-base.config.ts new file mode 100644 index 00000000..1eefad32 --- /dev/null +++ b/tsup-base.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'tsup' + +export default defineConfig({ + splitting: true, + clean: true, + bundle: true, + dts: true, + sourcemap: true, + target: 'es2021', + format: ['esm', 'cjs'], + entry: ['src/index.ts'], + platform: 'browser', +}) diff --git a/turbo.json b/turbo.json deleted file mode 100644 index 1a5ff8f9..00000000 --- a/turbo.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "https://turbo.build/schema.json", - "globalDependencies": ["**/.env.*local"], - "pipeline": { - "dev": { - "cache": false, - "persistent": true, - "dependsOn": ["clean", "^build"] - }, - "build": { - "outputs": ["lib/**", "dist/**", ".next/**", "!.next/cache/**"], - "dependsOn": ["clean", "^build"], - "cache": false - }, - "test": { - "outputs": ["coverage/**"], - "dependsOn": ["build"], - "cache": false - }, - "lint": { - "cache": false, - "dependsOn": ["^lint"] - }, - "lint:fix": { - "cache": false, - "dependsOn": ["^lint:fix"] - }, - "clean": { - "cache": false - } - } -} From b1fcedb871688cc03cf7ab3fa6a85ad6f09f78c3 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 27 Jun 2024 14:34:32 +0800 Subject: [PATCH 02/15] refactor: Export cjs and esm for rgbpp sdk --- apps/service/package.json | 2 +- examples/rgbpp/tsconfig.json | 2 +- examples/xudt-on-ckb/package.json | 4 +- examples/xudt-on-ckb/tsconfig.json | 3 +- packages/btc/package.json | 32 ++++++---- packages/btc/tsconfig.build.json | 10 --- packages/btc/tsconfig.json | 20 ------ packages/btc/tsup.config.ts | 13 ++++ packages/btc/vitest.config.mts | 10 --- packages/ckb/package.json | 33 ++++++---- packages/ckb/tsconfig.build.json | 10 --- packages/ckb/tsconfig.json | 34 ---------- packages/ckb/tsup.config.ts | 13 ++++ packages/rgbpp/package.json | 64 +++++++++++++------ packages/rgbpp/tsconfig.build.json | 9 --- packages/rgbpp/tsconfig.json | 27 -------- packages/rgbpp/tsup.config.ts | 13 ++++ packages/service/package.json | 32 ++++++---- packages/service/tsconfig.build.json | 10 --- packages/service/tsconfig.json | 20 ------ packages/service/tsup.config.ts | 13 ++++ packages/service/vitest.config.mts | 10 --- tests/rgbpp/package.json | 2 - tests/rgbpp/tsconfig.json | 6 +- .../vitest.config.mts => vitest.config.mts | 2 +- 25 files changed, 166 insertions(+), 228 deletions(-) delete mode 100644 packages/btc/tsconfig.build.json delete mode 100644 packages/btc/tsconfig.json create mode 100644 packages/btc/tsup.config.ts delete mode 100644 packages/btc/vitest.config.mts delete mode 100644 packages/ckb/tsconfig.build.json delete mode 100644 packages/ckb/tsconfig.json create mode 100644 packages/ckb/tsup.config.ts delete mode 100644 packages/rgbpp/tsconfig.build.json delete mode 100644 packages/rgbpp/tsconfig.json create mode 100644 packages/rgbpp/tsup.config.ts delete mode 100644 packages/service/tsconfig.build.json delete mode 100644 packages/service/tsconfig.json create mode 100644 packages/service/tsup.config.ts delete mode 100644 packages/service/vitest.config.mts rename packages/ckb/vitest.config.mts => vitest.config.mts (78%) diff --git a/apps/service/package.json b/apps/service/package.json index be49801c..7bd043a0 100644 --- a/apps/service/package.json +++ b/apps/service/package.json @@ -28,7 +28,7 @@ "convert-keys": "^1.3.4", "json-rpc-2.0": "^1.7.0", "reflect-metadata": "^0.2.0", - "rgbpp": "workspace:*", + "rgbpp": "^0.4.0", "rxjs": "^7.8.1", "zod": "^3.23.8" }, diff --git a/examples/rgbpp/tsconfig.json b/examples/rgbpp/tsconfig.json index 9134ad42..1ba8f320 100644 --- a/examples/rgbpp/tsconfig.json +++ b/examples/rgbpp/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ES2015", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": ["esnext"], "module": "NodeNext", "composite": false, "resolveJsonModule": true, diff --git a/examples/xudt-on-ckb/package.json b/examples/xudt-on-ckb/package.json index 0cd37c16..a0ac8293 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.1", - "rgbpp": "^0.3.0" + "@nervosnetwork/ckb-sdk-utils": "^0.109.1", + "rgbpp": "^0.4.0" }, "devDependencies": { "dotenv": "^16.4.5", diff --git a/examples/xudt-on-ckb/tsconfig.json b/examples/xudt-on-ckb/tsconfig.json index 4cc7c200..20b7ecf0 100644 --- a/examples/xudt-on-ckb/tsconfig.json +++ b/examples/xudt-on-ckb/tsconfig.json @@ -1,8 +1,7 @@ { - "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ES2015", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": ["dom", "esnext"], "module": "NodeNext", "composite": false, "resolveJsonModule": true, diff --git a/packages/btc/package.json b/packages/btc/package.json index 79856a97..0b988588 100644 --- a/packages/btc/package.json +++ b/packages/btc/package.json @@ -3,18 +3,30 @@ "version": "0.5.0", "scripts": { "test": "vitest", - "build": "tsc -p tsconfig.build.json", + "build": "tsup", "lint": "tsc && eslint '{src,tests}/**/*.{js,ts}' && prettier --check '{src,tests}/**/*.{js,ts}'", - "lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'", - "clean": "pnpm run clean:cache & pnpm run clean:build", - "clean:build": "rimraf lib && pnpm run clean:buildinfo", - "clean:buildinfo": "rimraf tsconfig.*tsbuildinfo", - "clean:cache": "rimraf .turbo" + "lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'" }, - "main": "lib", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ - "lib" + "src", + "dist" ], + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@ckb-lumos/codec": "0.22.2", @@ -27,10 +39,6 @@ "lodash": "^4.17.21", "p-limit": "^3.1.0" }, - "devDependencies": { - "@types/lodash": "^4.17.0", - "vitest": "^1.4.0" - }, "publishConfig": { "access": "public" } diff --git a/packages/btc/tsconfig.build.json b/packages/btc/tsconfig.build.json deleted file mode 100644 index 5902f288..00000000 --- a/packages/btc/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "rootDir": "src", - "outDir": "lib", - "noEmit": false - }, - "exclude": ["tests", "lib"] -} diff --git a/packages/btc/tsconfig.json b/packages/btc/tsconfig.json deleted file mode 100644 index 35666b8a..00000000 --- a/packages/btc/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "Node", - "module": "ESNext", - "target": "ESNext", - "lib": ["ESNext", "DOM"], - "strict": true, - "noEmit": true, - "allowJs": true, - "sourceMap": true, - "composite": true, - "skipLibCheck": true, - "esModuleInterop": true, - "strictNullChecks": true, - "resolveJsonModule": true, - "isolatedModules": true - }, - "include": ["src"], - "exclude": ["node_modules", "lib"] -} diff --git a/packages/btc/tsup.config.ts b/packages/btc/tsup.config.ts new file mode 100644 index 00000000..15fe4639 --- /dev/null +++ b/packages/btc/tsup.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'tsup'; + +import { dependencies, name } from './package.json'; + +import config from '../../tsup-base.config'; + +export default defineConfig({ + ...config, + name, + entry: ['src/index.ts'], + external: Object.keys(dependencies), + platform: 'browser', +}); diff --git a/packages/btc/vitest.config.mts b/packages/btc/vitest.config.mts deleted file mode 100644 index 84efc13c..00000000 --- a/packages/btc/vitest.config.mts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - watch: false, - testTimeout: 60000, - reporters: ['verbose'], - exclude: ['lib', 'node_modules'], - }, -}); diff --git a/packages/ckb/package.json b/packages/ckb/package.json index 461ee1f6..01b33f9a 100644 --- a/packages/ckb/package.json +++ b/packages/ckb/package.json @@ -3,20 +3,31 @@ "version": "0.5.0", "scripts": { "test": "vitest", - "build": "tsc -p tsconfig.build.json", + "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", - "clean": "pnpm run clean:cache & pnpm run clean:build", - "clean:build": "rimraf lib && pnpm run clean:buildinfo", - "clean:buildinfo": "rimraf tsconfig.*tsbuildinfo", - "clean:cache": "rimraf .turbo" + "splitCells": "npx ts-node example/paymaster.ts" }, - "main": "lib", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ - "lib" + "src", + "dist" ], - "types": "./lib/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, "dependencies": { "@ckb-lumos/base": "^0.22.2", "@ckb-lumos/codec": "^0.22.2", @@ -31,9 +42,7 @@ "js-sha256": "^0.11.0" }, "devDependencies": { - "@ckb-lumos/molecule": "^0.22.2", - "@types/lodash": "^4.17.0", - "vitest": "^1.4.0" + "@ckb-lumos/molecule": "^0.22.2" }, "publishConfig": { "access": "public" diff --git a/packages/ckb/tsconfig.build.json b/packages/ckb/tsconfig.build.json deleted file mode 100644 index 0bb37b24..00000000 --- a/packages/ckb/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "rootDir": "src", - "outDir": "lib", - "noEmit": false - }, - "exclude": ["example"] -} diff --git a/packages/ckb/tsconfig.json b/packages/ckb/tsconfig.json deleted file mode 100644 index d3e68f6a..00000000 --- a/packages/ckb/tsconfig.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "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" - } - }, - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "target": "ES2015", - "lib": ["dom", "dom.iterable", "esnext"], - "module": "ES2020", - "outDir": "./lib", - "composite": false, - "resolveJsonModule": true, - "strictNullChecks": true, - "noEmit": true, - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "inlineSources": false, - "isolatedModules": true, - "moduleResolution": "node", - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "skipLibCheck": true, - "strict": true - }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules", "**/*.spec.ts", "example"] -} diff --git a/packages/ckb/tsup.config.ts b/packages/ckb/tsup.config.ts new file mode 100644 index 00000000..15fe4639 --- /dev/null +++ b/packages/ckb/tsup.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'tsup'; + +import { dependencies, name } from './package.json'; + +import config from '../../tsup-base.config'; + +export default defineConfig({ + ...config, + name, + entry: ['src/index.ts'], + external: Object.keys(dependencies), + platform: 'browser', +}); diff --git a/packages/rgbpp/package.json b/packages/rgbpp/package.json index 51cb5661..d7d041c1 100644 --- a/packages/rgbpp/package.json +++ b/packages/rgbpp/package.json @@ -2,37 +2,61 @@ "name": "rgbpp", "version": "0.5.0", "scripts": { - "build": "tsc -p tsconfig.build.json", + "build": "tsup", "lint": "tsc && eslint --ext .ts src/* && prettier --check 'src/*.ts'", - "lint:fix": "tsc && eslint --fix --ext .ts src/* && prettier --write 'src/*.ts'", - "clean": "pnpm run clean:cache & pnpm run clean:build", - "clean:build": "rimraf lib && pnpm run clean:buildinfo", - "clean:buildinfo": "rimraf tsconfig.*tsbuildinfo", - "clean:cache": "rimraf .turbo" + "lint:fix": "tsc && eslint --fix --ext .ts src/* && prettier --write 'src/*.ts'" }, - "main": "lib", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "src", + "dist" + ], "exports": { ".": { - "types": "./lib/index.d.ts", - "default": "./lib/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./btc": { - "types": "./lib/btc.d.ts", - "default": "./lib/btc.js" + "import": { + "types": "./dist/btc.d.ts", + "default": "./dist/btc.js" + }, + "require": { + "types": "./dist/btc.d.cts", + "default": "./dist/btc.cjs" + } }, "./ckb": { - "types": "./lib/ckb.d.ts", - "default": "./lib/ckb.js" + "import": { + "types": "./dist/ckb.d.ts", + "default": "./dist/ckb.js" + }, + "require": { + "types": "./dist/ckb.d.cts", + "default": "./dist/ckb.cjs" + } }, "./service": { - "types": "./lib/service.d.ts", - "default": "./lib/service.js" - } + "import": { + "types": "./dist/service.d.ts", + "default": "./dist/service.js" + }, + "require": { + "types": "./dist/service.d.cts", + "default": "./dist/service.cjs" + } + }, + "./dist/*": "./dist/*", + "./package.json": "./package.json" }, - "files": [ - "lib" - ], - "types": "./lib/index.d.ts", "dependencies": { "@rgbpp-sdk/btc": "workspace:*", "@rgbpp-sdk/ckb": "workspace:*", diff --git a/packages/rgbpp/tsconfig.build.json b/packages/rgbpp/tsconfig.build.json deleted file mode 100644 index f800f1bf..00000000 --- a/packages/rgbpp/tsconfig.build.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "rootDir": "src", - "outDir": "lib", - "noEmit": false - } -} diff --git a/packages/rgbpp/tsconfig.json b/packages/rgbpp/tsconfig.json deleted file mode 100644 index cf4cb2bf..00000000 --- a/packages/rgbpp/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "target": "ES2015", - "lib": ["dom", "dom.iterable", "esnext"], - "module": "ES2020", - "outDir": "./lib", - "composite": false, - "resolveJsonModule": true, - "strictNullChecks": true, - "noEmit": true, - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "inlineSources": false, - "isolatedModules": true, - "moduleResolution": "node", - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "skipLibCheck": true, - "strict": true - }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules"] -} diff --git a/packages/rgbpp/tsup.config.ts b/packages/rgbpp/tsup.config.ts new file mode 100644 index 00000000..fab3200a --- /dev/null +++ b/packages/rgbpp/tsup.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'tsup'; + +import { dependencies, name } from './package.json'; + +import config from '../../tsup-base.config'; + +export default defineConfig({ + ...config, + name, + entry: ['src/index.ts', 'src/btc.ts', 'src/ckb.ts', 'src/service.ts'], + external: Object.keys(dependencies), + platform: 'browser', +}); diff --git a/packages/service/package.json b/packages/service/package.json index 56e84c4d..4171ef16 100644 --- a/packages/service/package.json +++ b/packages/service/package.json @@ -3,28 +3,36 @@ "version": "0.5.0", "scripts": { "test": "vitest", - "build": "tsc -p tsconfig.build.json", + "build": "tsup", "lint": "tsc && eslint '{src,tests}/**/*.{js,ts}' && prettier --check '{src,tests}/**/*.{js,ts}'", - "lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'", - "clean": "pnpm run clean:cache & pnpm run clean:build", - "clean:build": "rimraf lib && pnpm run clean:buildinfo", - "clean:buildinfo": "rimraf tsconfig.*tsbuildinfo", - "clean:cache": "rimraf .turbo" + "lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'" }, - "main": "lib", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ - "lib" + "src", + "dist" ], + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, "dependencies": { "@ckb-lumos/codec": "0.22.2", "@ckb-lumos/base": "0.22.2", "@nervosnetwork/ckb-types": "0.109.1", "lodash": "^4.17.21" }, - "devDependencies": { - "@types/lodash": "^4.17.0", - "vitest": "^1.4.0" - }, "publishConfig": { "access": "public" } diff --git a/packages/service/tsconfig.build.json b/packages/service/tsconfig.build.json deleted file mode 100644 index 5902f288..00000000 --- a/packages/service/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "rootDir": "src", - "outDir": "lib", - "noEmit": false - }, - "exclude": ["tests", "lib"] -} diff --git a/packages/service/tsconfig.json b/packages/service/tsconfig.json deleted file mode 100644 index 35666b8a..00000000 --- a/packages/service/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "Node", - "module": "ESNext", - "target": "ESNext", - "lib": ["ESNext", "DOM"], - "strict": true, - "noEmit": true, - "allowJs": true, - "sourceMap": true, - "composite": true, - "skipLibCheck": true, - "esModuleInterop": true, - "strictNullChecks": true, - "resolveJsonModule": true, - "isolatedModules": true - }, - "include": ["src"], - "exclude": ["node_modules", "lib"] -} diff --git a/packages/service/tsup.config.ts b/packages/service/tsup.config.ts new file mode 100644 index 00000000..15fe4639 --- /dev/null +++ b/packages/service/tsup.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'tsup'; + +import { dependencies, name } from './package.json'; + +import config from '../../tsup-base.config'; + +export default defineConfig({ + ...config, + name, + entry: ['src/index.ts'], + external: Object.keys(dependencies), + platform: 'browser', +}); diff --git a/packages/service/vitest.config.mts b/packages/service/vitest.config.mts deleted file mode 100644 index 69b2c0b4..00000000 --- a/packages/service/vitest.config.mts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - watch: false, - testTimeout: 20000, - reporters: ['verbose'], - exclude: ['lib', 'node_modules'], - }, -}); diff --git a/tests/rgbpp/package.json b/tests/rgbpp/package.json index 9373bd73..fb7e5443 100644 --- a/tests/rgbpp/package.json +++ b/tests/rgbpp/package.json @@ -17,8 +17,6 @@ "zx": "^8.0.2" }, "devDependencies": { - "@types/node": "^20.11.28", - "typescript": "^5.4.2", "dotenv": "^16.4.5", "@types/dotenv": "^8.2.0" } diff --git a/tests/rgbpp/tsconfig.json b/tests/rgbpp/tsconfig.json index b5f09128..3eae7fab 100644 --- a/tests/rgbpp/tsconfig.json +++ b/tests/rgbpp/tsconfig.json @@ -1,8 +1,7 @@ { - "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ES2015", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": ["dom", "esnext"], "module": "NodeNext", "composite": false, "resolveJsonModule": true, @@ -14,12 +13,13 @@ "forceConsistentCasingInFileNames": true, "inlineSources": false, "isolatedModules": true, - "moduleResolution": "NodeNext", + "moduleResolution": "Node16", "noUnusedLocals": false, "noUnusedParameters": false, "preserveWatchOutput": true, "skipLibCheck": true, "strict": true }, + "include": ["spore", "xudt", "shared"], "exclude": ["node_modules"] } diff --git a/packages/ckb/vitest.config.mts b/vitest.config.mts similarity index 78% rename from packages/ckb/vitest.config.mts rename to vitest.config.mts index b2275022..da33d8ce 100644 --- a/packages/ckb/vitest.config.mts +++ b/vitest.config.mts @@ -4,6 +4,6 @@ export default defineConfig({ test: { watch: false, reporters: ['verbose'], - exclude: ['lib', 'node_modules'], + exclude: ['dist', 'node_modules'], }, }); From 6bf7ea21d0f3b579bccf6a843f5b88b50ca8bf1e Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 27 Jun 2024 14:35:14 +0800 Subject: [PATCH 03/15] refactor: Update github action test --- .github/workflows/test.yaml | 2 +- tests/rgbpp/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 62c7d695..38cf17bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -47,7 +47,7 @@ jobs: run: pnpm run build:packages - name: Lint packages - run: pnpm run lint:packages + run: pnpm run lint - name: Run tests for packages run: pnpm run test:packages diff --git a/tests/rgbpp/tsconfig.json b/tests/rgbpp/tsconfig.json index 3eae7fab..403bbe62 100644 --- a/tests/rgbpp/tsconfig.json +++ b/tests/rgbpp/tsconfig.json @@ -13,7 +13,7 @@ "forceConsistentCasingInFileNames": true, "inlineSources": false, "isolatedModules": true, - "moduleResolution": "Node16", + "moduleResolution": "NodeNext", "noUnusedLocals": false, "noUnusedParameters": false, "preserveWatchOutput": true, From 3fe3210538941fccd17ea7600618adda0eded26a Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Tue, 2 Jul 2024 19:26:38 +0800 Subject: [PATCH 04/15] chore: Update lint staged commands --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ba448065..0a261266 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ }, "lint-staged": { "{packages,apps,examples,tests}/**/*.{js,jsx,ts,tsx}": [ - "pnpm run lint:fix", - "pnpm run format" + "eslint --fix", + "prettier --ignore-unknown --write" ] }, "packageManager": "pnpm@8.15.8+sha512.d1a029e1a447ad90bc96cd58b0fad486d2993d531856396f7babf2d83eb1823bb83c5a3d0fc18f675b2d10321d49eb161fece36fe8134aa5823ecd215feed392", From a2722c535efa04c9a9a8147228c82957fe33143d Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Tue, 2 Jul 2024 19:33:11 +0800 Subject: [PATCH 05/15] chore: Add changeset --- .changeset/old-poems-guess.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/old-poems-guess.md diff --git a/.changeset/old-poems-guess.md b/.changeset/old-poems-guess.md new file mode 100644 index 00000000..00f3479d --- /dev/null +++ b/.changeset/old-poems-guess.md @@ -0,0 +1,8 @@ +--- +"@rgbpp-sdk/service": minor +"rgbpp": minor +"@rgbpp-sdk/btc": minor +"@rgbpp-sdk/ckb": minor +--- + +feat: Export ESM packages From fbac90a99df706990ffc1afce5a126b6aac75ee8 Mon Sep 17 00:00:00 2001 From: Shook Date: Thu, 4 Jul 2024 19:50:48 +0800 Subject: [PATCH 06/15] refactor: revert tsconfig.json, remove "type" in package.json, and tune tsup config --- package.json | 9 +- packages/btc/package.json | 18 +- packages/btc/src/bitcoin.ts | 2 +- packages/btc/tsconfig.json | 19 ++ packages/btc/tsup.config.ts | 13 +- packages/ckb/package.json | 18 +- packages/ckb/tsconfig.json | 27 ++ packages/ckb/tsup.config.ts | 13 +- packages/rgbpp/package.json | 42 ++-- packages/rgbpp/tsconfig.json | 20 ++ packages/rgbpp/tsup.config.ts | 13 +- packages/service/package.json | 18 +- packages/service/tsconfig.json | 19 ++ packages/service/tsup.config.ts | 13 +- pnpm-lock.yaml | 433 ++++++++++++++++---------------- tsconfig.json | 62 ----- tsup-base.config.ts | 13 - vitest.config.mts | 1 - 18 files changed, 373 insertions(+), 380 deletions(-) create mode 100644 packages/btc/tsconfig.json create mode 100644 packages/ckb/tsconfig.json create mode 100644 packages/rgbpp/tsconfig.json create mode 100644 packages/service/tsconfig.json delete mode 100644 tsconfig.json delete mode 100644 tsup-base.config.ts diff --git a/package.json b/package.json index 0a261266..d4bf6066 100644 --- a/package.json +++ b/package.json @@ -21,18 +21,17 @@ "@changesets/cli": "^2.27.1", "@changesets/get-github-info": "^0.6.0", "@changesets/types": "^6.0.0", + "@types/lodash": "^4.17.0", "@typescript-eslint/eslint-plugin": "^7.8.0", "@typescript-eslint/parser": "^7.8.0", - "@types/lodash": "^4.17.0", "eslint": "^8.56.0", "husky": "^9.0.11", "lint-staged": "^15.2.2", "prettier": "^3.2.5", "ts-node": "^10.9.2", - "tsup": "^7.2.0", - "vite": "5.2.12", - "vitest": "1.6.0", - "typescript": "^5.4.3" + "tsup": "^8.1.0", + "typescript": "^5.4.3", + "vitest": "1.6.0" }, "lint-staged": { "{packages,apps,examples,tests}/**/*.{js,jsx,ts,tsx}": [ diff --git a/packages/btc/package.json b/packages/btc/package.json index 0b988588..761bb40b 100644 --- a/packages/btc/package.json +++ b/packages/btc/package.json @@ -7,26 +7,26 @@ "lint": "tsc && eslint '{src,tests}/**/*.{js,ts}' && prettier --check '{src,tests}/**/*.{js,ts}'", "lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'" }, - "type": "module", + "sideEffects": false, "main": "./dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "src", - "dist" - ], "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" + "types": "./dist/index.d.js", + "default": "./dist/index.js" } }, "./package.json": "./package.json" }, + "files": [ + "src", + "dist" + ], "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@ckb-lumos/codec": "0.22.2", diff --git a/packages/btc/src/bitcoin.ts b/packages/btc/src/bitcoin.ts index a208e7f4..ced37f03 100644 --- a/packages/btc/src/bitcoin.ts +++ b/packages/btc/src/bitcoin.ts @@ -1,6 +1,6 @@ -import ECPairFactory, { ECPairInterface } from 'ecpair'; import ecc from '@bitcoinerlab/secp256k1'; import * as bitcoin from 'bitcoinjs-lib'; +import { ECPairFactory, ECPairInterface } from 'ecpair'; import { isTaprootInput } from 'bitcoinjs-lib/src/psbt/bip371'; import { isP2TR, isP2WPKH, isP2PKH } from 'bitcoinjs-lib/src/psbt/psbtutils'; diff --git a/packages/btc/tsconfig.json b/packages/btc/tsconfig.json new file mode 100644 index 00000000..dcda4566 --- /dev/null +++ b/packages/btc/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "lib": ["ESNext", "DOM"], + "strict": true, + "noEmit": true, + "allowJs": true, + "sourceMap": true, + "skipLibCheck": true, + "esModuleInterop": true, + "strictNullChecks": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/btc/tsup.config.ts b/packages/btc/tsup.config.ts index 15fe4639..de041bd8 100644 --- a/packages/btc/tsup.config.ts +++ b/packages/btc/tsup.config.ts @@ -1,13 +1,10 @@ import { defineConfig } from 'tsup'; -import { dependencies, name } from './package.json'; - -import config from '../../tsup-base.config'; - export default defineConfig({ - ...config, - name, + name: '@rgbpp-sdk/btc', + dts: true, + clean: true, + sourcemap: true, + format: ['esm', 'cjs'], entry: ['src/index.ts'], - external: Object.keys(dependencies), - platform: 'browser', }); diff --git a/packages/ckb/package.json b/packages/ckb/package.json index 01b33f9a..c3db67dc 100644 --- a/packages/ckb/package.json +++ b/packages/ckb/package.json @@ -8,26 +8,26 @@ "lint:fix": "tsc && eslint --fix --ext .ts {src,example}/* && prettier --write '{src,example}/**/*.{js,ts}'", "splitCells": "npx ts-node example/paymaster.ts" }, - "type": "module", + "sideEffects": false, "main": "./dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "src", - "dist" - ], "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" } }, "./package.json": "./package.json" }, + "files": [ + "src", + "dist" + ], "dependencies": { "@ckb-lumos/base": "^0.22.2", "@ckb-lumos/codec": "^0.22.2", diff --git a/packages/ckb/tsconfig.json b/packages/ckb/tsconfig.json new file mode 100644 index 00000000..22045fbf --- /dev/null +++ b/packages/ckb/tsconfig.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "lib": ["ESNext", "DOM"], + "strict": true, + "noEmit": true, + "allowJs": true, + "sourceMap": true, + "skipLibCheck": true, + "esModuleInterop": true, + "strictNullChecks": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "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/packages/ckb/tsup.config.ts b/packages/ckb/tsup.config.ts index 15fe4639..e2255fa2 100644 --- a/packages/ckb/tsup.config.ts +++ b/packages/ckb/tsup.config.ts @@ -1,13 +1,10 @@ import { defineConfig } from 'tsup'; -import { dependencies, name } from './package.json'; - -import config from '../../tsup-base.config'; - export default defineConfig({ - ...config, - name, + name: '@rgbpp-sdk/ckb', + dts: true, + clean: true, + sourcemap: true, + format: ['esm', 'cjs'], entry: ['src/index.ts'], - external: Object.keys(dependencies), - platform: 'browser', }); diff --git a/packages/rgbpp/package.json b/packages/rgbpp/package.json index d7d041c1..9b504caf 100644 --- a/packages/rgbpp/package.json +++ b/packages/rgbpp/package.json @@ -6,57 +6,57 @@ "lint": "tsc && eslint --ext .ts src/* && prettier --check 'src/*.ts'", "lint:fix": "tsc && eslint --fix --ext .ts src/* && prettier --write 'src/*.ts'" }, - "type": "module", + "sideEffects": false, "main": "./dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "src", - "dist" - ], "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" } }, "./btc": { "import": { - "types": "./dist/btc.d.ts", - "default": "./dist/btc.js" + "types": "./dist/btc.d.mts", + "default": "./dist/btc.mjs" }, "require": { - "types": "./dist/btc.d.cts", - "default": "./dist/btc.cjs" + "types": "./dist/btc.d.ts", + "default": "./dist/btc.js" } }, "./ckb": { "import": { - "types": "./dist/ckb.d.ts", - "default": "./dist/ckb.js" + "types": "./dist/ckb.d.mts", + "default": "./dist/ckb.mjs" }, "require": { - "types": "./dist/ckb.d.cts", - "default": "./dist/ckb.cjs" + "types": "./dist/ckb.d.ts", + "default": "./dist/ckb.js" } }, "./service": { "import": { - "types": "./dist/service.d.ts", - "default": "./dist/service.js" + "types": "./dist/service.d.mts", + "default": "./dist/service.mjs" }, "require": { - "types": "./dist/service.d.cts", - "default": "./dist/service.cjs" + "types": "./dist/service.d.ts", + "default": "./dist/service.js" } }, "./dist/*": "./dist/*", "./package.json": "./package.json" }, + "files": [ + "src", + "dist" + ], "dependencies": { "@rgbpp-sdk/btc": "workspace:*", "@rgbpp-sdk/ckb": "workspace:*", diff --git a/packages/rgbpp/tsconfig.json b/packages/rgbpp/tsconfig.json new file mode 100644 index 00000000..70033a91 --- /dev/null +++ b/packages/rgbpp/tsconfig.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "lib": ["ESNext", "DOM"], + "strict": true, + "noEmit": true, + "allowJs": true, + "sourceMap": true, + "skipLibCheck": true, + "esModuleInterop": true, + "strictNullChecks": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/rgbpp/tsup.config.ts b/packages/rgbpp/tsup.config.ts index fab3200a..8376c1d0 100644 --- a/packages/rgbpp/tsup.config.ts +++ b/packages/rgbpp/tsup.config.ts @@ -1,13 +1,10 @@ import { defineConfig } from 'tsup'; -import { dependencies, name } from './package.json'; - -import config from '../../tsup-base.config'; - export default defineConfig({ - ...config, - name, + name: 'rgbpp', + dts: true, + clean: true, + sourcemap: true, + format: ['esm', 'cjs'], entry: ['src/index.ts', 'src/btc.ts', 'src/ckb.ts', 'src/service.ts'], - external: Object.keys(dependencies), - platform: 'browser', }); diff --git a/packages/service/package.json b/packages/service/package.json index 4171ef16..54494e08 100644 --- a/packages/service/package.json +++ b/packages/service/package.json @@ -7,26 +7,26 @@ "lint": "tsc && eslint '{src,tests}/**/*.{js,ts}' && prettier --check '{src,tests}/**/*.{js,ts}'", "lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'" }, - "type": "module", + "sideEffects": false, "main": "./dist/index.js", "types": "./dist/index.d.ts", - "files": [ - "src", - "dist" - ], "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" } }, "./package.json": "./package.json" }, + "files": [ + "src", + "dist" + ], "dependencies": { "@ckb-lumos/codec": "0.22.2", "@ckb-lumos/base": "0.22.2", diff --git a/packages/service/tsconfig.json b/packages/service/tsconfig.json new file mode 100644 index 00000000..dcda4566 --- /dev/null +++ b/packages/service/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "lib": ["ESNext", "DOM"], + "strict": true, + "noEmit": true, + "allowJs": true, + "sourceMap": true, + "skipLibCheck": true, + "esModuleInterop": true, + "strictNullChecks": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/service/tsup.config.ts b/packages/service/tsup.config.ts index 15fe4639..74f88ce9 100644 --- a/packages/service/tsup.config.ts +++ b/packages/service/tsup.config.ts @@ -1,13 +1,10 @@ import { defineConfig } from 'tsup'; -import { dependencies, name } from './package.json'; - -import config from '../../tsup-base.config'; - export default defineConfig({ - ...config, - name, + name: '@rgbpp-sdk/service', + dts: true, + clean: true, + sourcemap: true, + format: ['esm', 'cjs'], entry: ['src/index.ts'], - external: Object.keys(dependencies), - platform: 'browser', }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c01527d3..a2b56c88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,14 +42,11 @@ importers: specifier: ^10.9.2 version: 10.9.2(@types/node@20.14.11)(typescript@5.5.3) tsup: - specifier: ^7.2.0 - version: 7.3.0(ts-node@10.9.2)(typescript@5.5.3) + specifier: ^8.1.0 + version: 8.2.3(typescript@5.5.3) typescript: specifier: ^5.4.3 version: 5.5.3 - vite: - specifier: 5.2.12 - version: 5.2.12(@types/node@20.14.11) vitest: specifier: 1.6.0 version: 1.6.0(@types/node@20.14.11) @@ -78,8 +75,8 @@ importers: specifier: ^0.2.0 version: 0.2.2 rgbpp: - specifier: workspace:* - version: link:../../packages/rgbpp + specifier: ^0.4.0 + version: 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) rxjs: specifier: ^7.8.1 version: 7.8.1 @@ -89,7 +86,7 @@ importers: devDependencies: '@nestjs/cli': specifier: ^10.0.0 - version: 10.4.2(esbuild@0.19.12) + version: 10.4.2(esbuild@0.23.0) '@nestjs/schematics': specifier: ^10.0.0 version: 10.1.2(typescript@5.5.3) @@ -113,7 +110,7 @@ importers: version: 6.3.4 ts-jest: specifier: ^29.1.0 - version: 29.2.3(@babel/core@7.24.9)(esbuild@0.19.12)(jest@29.7.0)(typescript@5.5.3) + version: 29.2.3(@babel/core@7.24.9)(esbuild@0.23.0)(jest@29.7.0)(typescript@5.5.3) ts-loader: specifier: ^9.4.3 version: 9.5.1(typescript@5.5.3)(webpack@5.93.0) @@ -152,11 +149,11 @@ importers: examples/xudt-on-ckb: dependencies: '@nervosnetwork/ckb-sdk-utils': - specifier: 0.109.1 + specifier: ^0.109.1 version: 0.109.1 rgbpp: - specifier: ^0.3.0 - version: 0.3.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) + specifier: ^0.4.0 + version: 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) devDependencies: '@types/dotenv': specifier: ^8.2.0 @@ -197,13 +194,6 @@ importers: p-limit: specifier: ^3.1.0 version: 3.1.0 - devDependencies: - '@types/lodash': - specifier: ^4.17.0 - version: 4.17.7 - vitest: - specifier: ^1.4.0 - version: 1.6.0(@types/node@20.14.11) packages/ckb: dependencies: @@ -244,12 +234,6 @@ importers: '@ckb-lumos/molecule': specifier: ^0.22.2 version: 0.22.2 - '@types/lodash': - specifier: ^4.17.0 - version: 4.17.7 - vitest: - specifier: ^1.4.0 - version: 1.6.0(@types/node@20.14.11) packages/rgbpp: dependencies: @@ -280,13 +264,6 @@ importers: lodash: specifier: ^4.17.21 version: 4.17.21 - devDependencies: - '@types/lodash': - specifier: ^4.17.0 - version: 4.17.7 - vitest: - specifier: ^1.4.0 - version: 1.6.0(@types/node@20.14.11) tests/rgbpp: dependencies: @@ -303,15 +280,9 @@ 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 packages: @@ -1154,15 +1125,6 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@esbuild/aix-ppc64@0.19.12: - resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - requiresBuild: true - dev: true - optional: true - /@esbuild/aix-ppc64@0.20.2: resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} engines: {node: '>=12'} @@ -1172,11 +1134,11 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.19.12: - resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] + /@esbuild/aix-ppc64@0.23.0: + resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] requiresBuild: true dev: true optional: true @@ -1190,10 +1152,10 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.19.12: - resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} - engines: {node: '>=12'} - cpu: [arm] + /@esbuild/android-arm64@0.23.0: + resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} + engines: {node: '>=18'} + cpu: [arm64] os: [android] requiresBuild: true dev: true @@ -1208,10 +1170,10 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.19.12: - resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} - engines: {node: '>=12'} - cpu: [x64] + /@esbuild/android-arm@0.23.0: + resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} + engines: {node: '>=18'} + cpu: [arm] os: [android] requiresBuild: true dev: true @@ -1226,11 +1188,11 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.19.12: - resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] + /@esbuild/android-x64@0.23.0: + resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] requiresBuild: true dev: true optional: true @@ -1244,10 +1206,10 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.19.12: - resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} - engines: {node: '>=12'} - cpu: [x64] + /@esbuild/darwin-arm64@0.23.0: + resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} + engines: {node: '>=18'} + cpu: [arm64] os: [darwin] requiresBuild: true dev: true @@ -1262,11 +1224,11 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.19.12: - resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] + /@esbuild/darwin-x64@0.23.0: + resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] requiresBuild: true dev: true optional: true @@ -1280,10 +1242,10 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.19.12: - resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} - engines: {node: '>=12'} - cpu: [x64] + /@esbuild/freebsd-arm64@0.23.0: + resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} + engines: {node: '>=18'} + cpu: [arm64] os: [freebsd] requiresBuild: true dev: true @@ -1298,11 +1260,11 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.19.12: - resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] + /@esbuild/freebsd-x64@0.23.0: + resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] requiresBuild: true dev: true optional: true @@ -1316,10 +1278,10 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.19.12: - resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} - engines: {node: '>=12'} - cpu: [arm] + /@esbuild/linux-arm64@0.23.0: + resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} + engines: {node: '>=18'} + cpu: [arm64] os: [linux] requiresBuild: true dev: true @@ -1334,10 +1296,10 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.19.12: - resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} - engines: {node: '>=12'} - cpu: [ia32] + /@esbuild/linux-arm@0.23.0: + resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} + engines: {node: '>=18'} + cpu: [arm] os: [linux] requiresBuild: true dev: true @@ -1352,10 +1314,10 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.19.12: - resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} - engines: {node: '>=12'} - cpu: [loong64] + /@esbuild/linux-ia32@0.23.0: + resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} + engines: {node: '>=18'} + cpu: [ia32] os: [linux] requiresBuild: true dev: true @@ -1370,10 +1332,10 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.19.12: - resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} - engines: {node: '>=12'} - cpu: [mips64el] + /@esbuild/linux-loong64@0.23.0: + resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} + engines: {node: '>=18'} + cpu: [loong64] os: [linux] requiresBuild: true dev: true @@ -1388,10 +1350,10 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.19.12: - resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} - engines: {node: '>=12'} - cpu: [ppc64] + /@esbuild/linux-mips64el@0.23.0: + resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} + engines: {node: '>=18'} + cpu: [mips64el] os: [linux] requiresBuild: true dev: true @@ -1406,10 +1368,10 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.19.12: - resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} - engines: {node: '>=12'} - cpu: [riscv64] + /@esbuild/linux-ppc64@0.23.0: + resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} + engines: {node: '>=18'} + cpu: [ppc64] os: [linux] requiresBuild: true dev: true @@ -1424,10 +1386,10 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.19.12: - resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} - engines: {node: '>=12'} - cpu: [s390x] + /@esbuild/linux-riscv64@0.23.0: + resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} + engines: {node: '>=18'} + cpu: [riscv64] os: [linux] requiresBuild: true dev: true @@ -1442,10 +1404,10 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.19.12: - resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} - engines: {node: '>=12'} - cpu: [x64] + /@esbuild/linux-s390x@0.23.0: + resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} + engines: {node: '>=18'} + cpu: [s390x] os: [linux] requiresBuild: true dev: true @@ -1460,11 +1422,11 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.19.12: - resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} - engines: {node: '>=12'} + /@esbuild/linux-x64@0.23.0: + resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} + engines: {node: '>=18'} cpu: [x64] - os: [netbsd] + os: [linux] requiresBuild: true dev: true optional: true @@ -1478,10 +1440,19 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.19.12: - resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} - engines: {node: '>=12'} + /@esbuild/netbsd-x64@0.23.0: + resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} + engines: {node: '>=18'} cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-arm64@0.23.0: + resolution: {integrity: sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==} + engines: {node: '>=18'} + cpu: [arm64] os: [openbsd] requiresBuild: true dev: true @@ -1496,11 +1467,11 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.19.12: - resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} - engines: {node: '>=12'} + /@esbuild/openbsd-x64@0.23.0: + resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} + engines: {node: '>=18'} cpu: [x64] - os: [sunos] + os: [openbsd] requiresBuild: true dev: true optional: true @@ -1514,11 +1485,11 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.19.12: - resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] + /@esbuild/sunos-x64@0.23.0: + resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] requiresBuild: true dev: true optional: true @@ -1532,10 +1503,10 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.19.12: - resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} - engines: {node: '>=12'} - cpu: [ia32] + /@esbuild/win32-arm64@0.23.0: + resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} + engines: {node: '>=18'} + cpu: [arm64] os: [win32] requiresBuild: true dev: true @@ -1550,10 +1521,10 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.19.12: - resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} - engines: {node: '>=12'} - cpu: [x64] + /@esbuild/win32-ia32@0.23.0: + resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} + engines: {node: '>=18'} + cpu: [ia32] os: [win32] requiresBuild: true dev: true @@ -1568,6 +1539,15 @@ packages: dev: true optional: true + /@esbuild/win32-x64@0.23.0: + resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2031,7 +2011,7 @@ packages: resolution: {integrity: sha512-mD5mOCGa1JertKZekHSUVYwFPW27VJ0/MdwblWvEEK7pNIU6az+dLiIxgvl4TxR+j+7/GqmXNH1U59CM92y/wg==} dev: false - /@nestjs/cli@10.4.2(esbuild@0.19.12): + /@nestjs/cli@10.4.2(esbuild@0.23.0): resolution: {integrity: sha512-fQexIfLHfp6GUgX+CO4fOg+AEwV5ox/LHotQhyZi9wXUQDyIqS0NTTbumr//62EcX35qV4nU0359nYnuEdzG+A==} engines: {node: '>= 16.14'} hasBin: true @@ -2061,7 +2041,7 @@ packages: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.92.1(esbuild@0.19.12) + webpack: 5.92.1(esbuild@0.23.0) webpack-node-externals: 3.0.0 transitivePeerDependencies: - esbuild @@ -2251,14 +2231,14 @@ packages: dev: true optional: true - /@rgbpp-sdk/btc@0.3.0(@ckb-lumos/lumos@0.22.0-next.5): - resolution: {integrity: sha512-0KLVRAlYxA/m2K1FTrrtAHezfaEg0MXfEmlHjMIK1oOUjUuis5UAJPSyB83Ql5RjVRFFolxdyPoW2Xe7MhAp4A==} + /@rgbpp-sdk/btc@0.4.0(@ckb-lumos/lumos@0.22.0-next.5): + resolution: {integrity: sha512-4Fx/UsN2T1CyhyasK565ChofxRFA1JyCSnUuAPh0fpQ2AAcPzrbKGZS65hpOPa/2qClkzzszdXz1sgkbXUCaPg==} dependencies: '@bitcoinerlab/secp256k1': 1.1.1 '@ckb-lumos/codec': 0.22.2 '@nervosnetwork/ckb-types': 0.109.1 - '@rgbpp-sdk/ckb': 0.3.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) - '@rgbpp-sdk/service': 0.3.0 + '@rgbpp-sdk/ckb': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) + '@rgbpp-sdk/service': 0.4.0 bip32: 4.0.0 bitcoinjs-lib: 6.1.6 ecpair: 2.1.0 @@ -2269,8 +2249,8 @@ packages: - debug dev: false - /@rgbpp-sdk/ckb@0.3.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21): - resolution: {integrity: sha512-Qf6Yhgakz8UhkZ+PulIHdrMVSDbZPW7+GDTA8KLrfVB/EEMoXA5L5LVanJKrYKTgBkGXYwEXW8Tti0Lr76SBmA==} + /@rgbpp-sdk/ckb@0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21): + resolution: {integrity: sha512-mqwWL+mnuyzLoGBR58eeNPRITp0fVqf0smU8BiR0Ey4cVpF206mBMscgex8EHwgAMU6cUjBLBDej0HYugpshZw==} dependencies: '@ckb-lumos/base': 0.22.2 '@ckb-lumos/codec': 0.22.2 @@ -2278,7 +2258,7 @@ packages: '@nervosnetwork/ckb-sdk-core': 0.109.1 '@nervosnetwork/ckb-sdk-utils': 0.109.1 '@nervosnetwork/ckb-types': 0.109.1 - '@rgbpp-sdk/service': 0.3.0 + '@rgbpp-sdk/service': 0.4.0 '@spore-sdk/core': 0.2.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) axios: 1.7.2 camelcase-keys: 7.0.2 @@ -2289,8 +2269,8 @@ packages: - lodash dev: false - /@rgbpp-sdk/service@0.3.0: - resolution: {integrity: sha512-MvVBVWbdYQVnjnCf3xYH6HXqHaUmL7DjUVucTYMjbB0cMeBqVjEAkX1RIVUqqcCpgSeYnK1nFEQHXB51rx8bMw==} + /@rgbpp-sdk/service@0.4.0: + resolution: {integrity: sha512-OvSNcSAmI7RDbf2bzySmHL0UO/S4dn5LAWrfJ41B2WXZiKAAtZ5IG4ajW6RKz6bxf0t7EcjRtXimdGieoubzyw==} dependencies: '@ckb-lumos/base': 0.22.2 '@ckb-lumos/codec': 0.22.2 @@ -3434,13 +3414,13 @@ packages: ieee754: 1.2.1 dev: false - /bundle-require@4.2.1(esbuild@0.19.12): - resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} + /bundle-require@5.0.0(esbuild@0.23.0): + resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: - esbuild: '>=0.17' + esbuild: '>=0.18' dependencies: - esbuild: 0.19.12 + esbuild: 0.23.0 load-tsconfig: 0.2.5 dev: true @@ -3711,6 +3691,11 @@ packages: /consola@2.15.3: resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} + /consola@3.2.3: + resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} + engines: {node: ^14.18.0 || >=16.10.0} + dev: true + /convert-keys@1.3.4: resolution: {integrity: sha512-+ltki+EUagotW/x7r+15nuHyk4nzcSkBk1lZpmbHjscF2E9ZmNErgV7K18LNshB0qglECcsnwy29ODlJ0pI0KA==} dependencies: @@ -4033,37 +4018,6 @@ packages: resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} dev: true - /esbuild@0.19.12: - resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/aix-ppc64': 0.19.12 - '@esbuild/android-arm': 0.19.12 - '@esbuild/android-arm64': 0.19.12 - '@esbuild/android-x64': 0.19.12 - '@esbuild/darwin-arm64': 0.19.12 - '@esbuild/darwin-x64': 0.19.12 - '@esbuild/freebsd-arm64': 0.19.12 - '@esbuild/freebsd-x64': 0.19.12 - '@esbuild/linux-arm': 0.19.12 - '@esbuild/linux-arm64': 0.19.12 - '@esbuild/linux-ia32': 0.19.12 - '@esbuild/linux-loong64': 0.19.12 - '@esbuild/linux-mips64el': 0.19.12 - '@esbuild/linux-ppc64': 0.19.12 - '@esbuild/linux-riscv64': 0.19.12 - '@esbuild/linux-s390x': 0.19.12 - '@esbuild/linux-x64': 0.19.12 - '@esbuild/netbsd-x64': 0.19.12 - '@esbuild/openbsd-x64': 0.19.12 - '@esbuild/sunos-x64': 0.19.12 - '@esbuild/win32-arm64': 0.19.12 - '@esbuild/win32-ia32': 0.19.12 - '@esbuild/win32-x64': 0.19.12 - dev: true - /esbuild@0.20.2: resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} @@ -4095,6 +4049,38 @@ packages: '@esbuild/win32-x64': 0.20.2 dev: true + /esbuild@0.23.0: + resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} + engines: {node: '>=18'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.0 + '@esbuild/android-arm': 0.23.0 + '@esbuild/android-arm64': 0.23.0 + '@esbuild/android-x64': 0.23.0 + '@esbuild/darwin-arm64': 0.23.0 + '@esbuild/darwin-x64': 0.23.0 + '@esbuild/freebsd-arm64': 0.23.0 + '@esbuild/freebsd-x64': 0.23.0 + '@esbuild/linux-arm': 0.23.0 + '@esbuild/linux-arm64': 0.23.0 + '@esbuild/linux-ia32': 0.23.0 + '@esbuild/linux-loong64': 0.23.0 + '@esbuild/linux-mips64el': 0.23.0 + '@esbuild/linux-ppc64': 0.23.0 + '@esbuild/linux-riscv64': 0.23.0 + '@esbuild/linux-s390x': 0.23.0 + '@esbuild/linux-x64': 0.23.0 + '@esbuild/netbsd-x64': 0.23.0 + '@esbuild/openbsd-arm64': 0.23.0 + '@esbuild/openbsd-x64': 0.23.0 + '@esbuild/sunos-x64': 0.23.0 + '@esbuild/win32-arm64': 0.23.0 + '@esbuild/win32-ia32': 0.23.0 + '@esbuild/win32-x64': 0.23.0 + dev: true + /escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} @@ -4515,7 +4501,7 @@ packages: semver: 7.6.3 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.92.1(esbuild@0.19.12) + webpack: 5.92.1(esbuild@0.23.0) dev: true /form-data@4.0.0: @@ -6360,21 +6346,25 @@ packages: engines: {node: '>=4'} dev: true - /postcss-load-config@4.0.2(ts-node@10.9.2): - resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} - engines: {node: '>= 14'} + /postcss-load-config@6.0.1: + resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} + engines: {node: '>= 18'} peerDependencies: + jiti: '>=1.21.0' postcss: '>=8.0.9' - ts-node: '>=9.0.0' + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: + jiti: + optional: true postcss: optional: true - ts-node: + tsx: + optional: true + yaml: optional: true dependencies: lilconfig: 3.1.2 - ts-node: 10.9.2(@types/node@20.14.11)(typescript@5.5.3) - yaml: 2.4.5 dev: true /postcss@8.4.39: @@ -6638,12 +6628,13 @@ packages: /rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - /rgbpp@0.3.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21): - resolution: {integrity: sha512-SvvQsTwcTpxedKhzKY+fJQCavfnO2wtyAgO6zkuXBxveLKQQrsvCNumhwzfLOkZW8PhEDz4qAks3WhYnyOR2Vw==} + /rgbpp@0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21): + resolution: {integrity: sha512-V8a5NV/bjKGYYN8gM7b/ed27hVAhIhZK0MJnpFalaasctZjhjtt8BjK9XWGS2mabSR+feHK/5/ROBEVLNOeFhg==} dependencies: - '@rgbpp-sdk/btc': 0.3.0(@ckb-lumos/lumos@0.22.0-next.5) - '@rgbpp-sdk/ckb': 0.3.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) - '@rgbpp-sdk/service': 0.3.0 + '@nervosnetwork/ckb-sdk-utils': 0.109.1 + '@rgbpp-sdk/btc': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5) + '@rgbpp-sdk/ckb': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) + '@rgbpp-sdk/service': 0.4.0 transitivePeerDependencies: - '@ckb-lumos/lumos' - debug @@ -7111,7 +7102,7 @@ packages: engines: {node: '>=8'} dev: true - /terser-webpack-plugin@5.3.10(esbuild@0.19.12)(webpack@5.92.1): + /terser-webpack-plugin@5.3.10(esbuild@0.23.0)(webpack@5.92.1): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -7128,15 +7119,15 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.25 - esbuild: 0.19.12 + esbuild: 0.23.0 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.3 - webpack: 5.92.1(esbuild@0.19.12) + webpack: 5.92.1(esbuild@0.23.0) dev: true - /terser-webpack-plugin@5.3.10(esbuild@0.19.12)(webpack@5.93.0): + /terser-webpack-plugin@5.3.10(esbuild@0.23.0)(webpack@5.93.0): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -7153,12 +7144,12 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.25 - esbuild: 0.19.12 + esbuild: 0.23.0 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.3 - webpack: 5.93.0(esbuild@0.19.12) + webpack: 5.93.0(esbuild@0.23.0) dev: true /terser@5.31.3: @@ -7277,7 +7268,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest@29.2.3(@babel/core@7.24.9)(esbuild@0.19.12)(jest@29.7.0)(typescript@5.5.3): + /ts-jest@29.2.3(@babel/core@7.24.9)(esbuild@0.23.0)(jest@29.7.0)(typescript@5.5.3): resolution: {integrity: sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -7304,7 +7295,7 @@ packages: '@babel/core': 7.24.9 bs-logger: 0.2.6 ejs: 3.1.10 - esbuild: 0.19.12 + esbuild: 0.23.0 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@20.14.11)(ts-node@10.9.2) jest-util: 29.7.0 @@ -7329,7 +7320,7 @@ packages: semver: 7.6.3 source-map: 0.7.4 typescript: 5.5.3 - webpack: 5.93.0(esbuild@0.19.12) + webpack: 5.93.0(esbuild@0.23.0) dev: true /ts-node@10.9.2(@types/node@20.14.11)(typescript@5.5.3): @@ -7388,16 +7379,18 @@ packages: /tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - /tsup@7.3.0(ts-node@10.9.2)(typescript@5.5.3): - resolution: {integrity: sha512-Ja1eaSRrE+QarmATlNO5fse2aOACYMBX+IZRKy1T+gpyH+jXgRrl5l4nHIQJQ1DoDgEjHDTw8cpE085UdBZuWQ==} + /tsup@8.2.3(typescript@5.5.3): + resolution: {integrity: sha512-6YNT44oUfXRbZuSMNmN36GzwPPIlD2wBccY7looM2fkTcxkf2NEmwr3OZuDZoySklnrIG4hoEtzy8yUXYOqNcg==} engines: {node: '>=18'} - deprecated: Breaking node 16 hasBin: true peerDependencies: + '@microsoft/api-extractor': ^7.36.0 '@swc/core': ^1 postcss: ^8.4.12 typescript: '>=4.5.0' peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true '@swc/core': optional: true postcss: @@ -7405,15 +7398,17 @@ packages: typescript: optional: true dependencies: - bundle-require: 4.2.1(esbuild@0.19.12) + bundle-require: 5.0.0(esbuild@0.23.0) cac: 6.7.14 chokidar: 3.6.0 + consola: 3.2.3 debug: 4.3.5 - esbuild: 0.19.12 + esbuild: 0.23.0 execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 4.0.2(ts-node@10.9.2) + picocolors: 1.0.1 + postcss-load-config: 6.0.1 resolve-from: 5.0.0 rollup: 4.19.0 source-map: 0.8.0-beta.0 @@ -7421,8 +7416,10 @@ packages: tree-kill: 1.2.2 typescript: 5.5.3 transitivePeerDependencies: + - jiti - supports-color - - ts-node + - tsx + - yaml dev: true /type-check@0.4.0: @@ -7685,7 +7682,7 @@ packages: engines: {node: '>=10.13.0'} dev: true - /webpack@5.92.1(esbuild@0.19.12): + /webpack@5.92.1(esbuild@0.23.0): resolution: {integrity: sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==} engines: {node: '>=10.13.0'} hasBin: true @@ -7716,7 +7713,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(esbuild@0.19.12)(webpack@5.92.1) + terser-webpack-plugin: 5.3.10(esbuild@0.23.0)(webpack@5.92.1) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -7725,7 +7722,7 @@ packages: - uglify-js dev: true - /webpack@5.93.0(esbuild@0.19.12): + /webpack@5.93.0(esbuild@0.23.0): resolution: {integrity: sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==} engines: {node: '>=10.13.0'} hasBin: true @@ -7756,7 +7753,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(esbuild@0.19.12)(webpack@5.93.0) + terser-webpack-plugin: 5.3.10(esbuild@0.23.0)(webpack@5.93.0) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index a03de788..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "jsx": "react-jsx", - "lib": [ - "es2021", - "dom" - ], - "module": "esnext", - "moduleResolution": "node", - "target": "es2021", - "composite": false, - "allowJs": true, - "resolveJsonModule": true, - "strictNullChecks": true, - "noEmit": true, - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "inlineSources": false, - "isolatedModules": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "skipLibCheck": true, - "downlevelIteration": true, - "strict": true, - "paths": { - "@rgbpp-sdk/btc": [ - "./packages/btc/src" - ], - "@rgbpp-sdk/btc/*": [ - "packages/btc/src/*" - ], - "@rgbpp-sdk/ckb": [ - "./packages/ckb/src" - ], - "@rgbpp-sdk/ckb/*": [ - "packages/ckb/src/*" - ], - "@rgbpp-sdk/service": [ - "./packages/service/src" - ], - "@rgbpp-sdk/service/*": [ - "packages/service/src/*" - ], - } - }, - "exclude": [ - "**/node_modules/**", - "**/dist/**" - ], - "include": [ - "packages/**/*", - "examples/**/*", - "apps/**/*", - "tests/**/*", - "tsup-base.config.ts", - "vitest.config.mts", - ] -} diff --git a/tsup-base.config.ts b/tsup-base.config.ts deleted file mode 100644 index 1eefad32..00000000 --- a/tsup-base.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup' - -export default defineConfig({ - splitting: true, - clean: true, - bundle: true, - dts: true, - sourcemap: true, - target: 'es2021', - format: ['esm', 'cjs'], - entry: ['src/index.ts'], - platform: 'browser', -}) diff --git a/vitest.config.mts b/vitest.config.mts index da33d8ce..40f03cee 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -4,6 +4,5 @@ export default defineConfig({ test: { watch: false, reporters: ['verbose'], - exclude: ['dist', 'node_modules'], }, }); From d1f081aad90994ab5eaddfb66d37d8ec284e3ea5 Mon Sep 17 00:00:00 2001 From: Shook Date: Fri, 5 Jul 2024 02:37:23 +0800 Subject: [PATCH 07/15] refactor: add file extension (.js) to non-index package imports in the packages --- packages/btc/src/bitcoin.ts | 4 ++-- packages/btc/src/preset/config.ts | 2 +- packages/btc/src/transaction/build.ts | 18 +++++++++--------- packages/btc/src/transaction/fee.ts | 3 +-- packages/btc/src/transaction/utxo.ts | 2 +- packages/ckb/src/rgbpp/btc-time.ts | 2 +- packages/ckb/src/rgbpp/btc-transfer.ts | 2 +- packages/ckb/src/rgbpp/ckb-builder.ts | 4 ++-- packages/ckb/src/spore/spore.ts | 2 +- packages/ckb/src/utils/spore.ts | 2 +- packages/service/src/service/base.ts | 2 +- 11 files changed, 21 insertions(+), 22 deletions(-) diff --git a/packages/btc/src/bitcoin.ts b/packages/btc/src/bitcoin.ts index ced37f03..ad711523 100644 --- a/packages/btc/src/bitcoin.ts +++ b/packages/btc/src/bitcoin.ts @@ -1,8 +1,8 @@ import ecc from '@bitcoinerlab/secp256k1'; import * as bitcoin from 'bitcoinjs-lib'; import { ECPairFactory, ECPairInterface } from 'ecpair'; -import { isTaprootInput } from 'bitcoinjs-lib/src/psbt/bip371'; -import { isP2TR, isP2WPKH, isP2PKH } from 'bitcoinjs-lib/src/psbt/psbtutils'; +import { isTaprootInput } from 'bitcoinjs-lib/src/psbt/bip371.js'; +import { isP2TR, isP2WPKH, isP2PKH } from 'bitcoinjs-lib/src/psbt/psbtutils.js'; bitcoin.initEccLib(ecc); diff --git a/packages/btc/src/preset/config.ts b/packages/btc/src/preset/config.ts index 2156b63f..b06d6171 100644 --- a/packages/btc/src/preset/config.ts +++ b/packages/btc/src/preset/config.ts @@ -1,4 +1,4 @@ -import cloneDeep from 'lodash/cloneDeep'; +import cloneDeep from 'lodash/cloneDeep.js'; import { bitcoin } from '../bitcoin'; import { ErrorCodes, TxBuildError } from '../error'; import { NetworkType, RgbppBtcConfig } from './types'; diff --git a/packages/btc/src/transaction/build.ts b/packages/btc/src/transaction/build.ts index 7407fb59..d5f0f63d 100644 --- a/packages/btc/src/transaction/build.ts +++ b/packages/btc/src/transaction/build.ts @@ -1,4 +1,4 @@ -import clone from 'lodash/cloneDeep'; +import cloneDeep from 'lodash/cloneDeep.js'; import { bitcoin } from '../bitcoin'; import { DataSource } from '../query/source'; import { ErrorCodes, TxBuildError } from '../error'; @@ -76,7 +76,7 @@ export class TxBuilder { throw TxBuildError.withComment(ErrorCodes.DUPLICATED_UTXO, `hash: ${utxo.txid}, index: ${utxo.vout}`); } - utxo = clone(utxo); + utxo = cloneDeep(utxo); this.inputs.push(utxoToInput(utxo)); } @@ -115,7 +115,7 @@ export class TxBuilder { }; } if ('address' in output || 'script' in output) { - result = clone(output); + result = cloneDeep(output); } if (!result) { throw new TxBuildError(ErrorCodes.UNSUPPORTED_OUTPUT); @@ -149,8 +149,8 @@ export class TxBuilder { changeIndex: number; }> { const { address, publicKey, feeRate, changeAddress, deductFromOutputs, excludeUtxos } = props; - const originalInputs = clone(this.inputs); - const originalOutputs = clone(this.outputs); + const originalInputs = cloneDeep(this.inputs); + const originalOutputs = cloneDeep(this.outputs); // Create a cache key to enable the internal caching, prevent querying the Utxo[] too often // TODO: consider provide an option to disable the cache @@ -174,8 +174,8 @@ export class TxBuilder { while (!isFeeExpected) { if (isLoopedOnce) { previousFee = currentFee; - this.inputs = clone(originalInputs); - this.outputs = clone(originalOutputs); + this.inputs = cloneDeep(originalInputs); + this.outputs = cloneDeep(originalOutputs); } const { needCollect, needReturn, inputsTotal } = this.summary(); @@ -527,8 +527,8 @@ export class TxBuilder { minUtxoSatoshi: this.minUtxoSatoshi, }); - tx.inputs = clone(this.inputs); - tx.outputs = clone(this.outputs); + tx.inputs = cloneDeep(this.inputs); + tx.outputs = cloneDeep(this.outputs); return tx; } diff --git a/packages/btc/src/transaction/fee.ts b/packages/btc/src/transaction/fee.ts index 3653ef85..74b9fe1b 100644 --- a/packages/btc/src/transaction/fee.ts +++ b/packages/btc/src/transaction/fee.ts @@ -1,10 +1,9 @@ -import { ECPairInterface } from 'ecpair'; import { AddressType } from '../address'; import { NetworkType } from '../preset/types'; import { toXOnly, tweakSigner } from '../utils'; import { networkTypeToNetwork } from '../preset/network'; import { isP2trScript, isP2wpkhScript } from '../script'; -import { bitcoin, ECPair, isTaprootInput } from '../bitcoin'; +import { ECPairInterface, bitcoin, ECPair, isTaprootInput } from '../bitcoin'; import { Utxo } from './utxo'; interface FeeEstimateAccount { diff --git a/packages/btc/src/transaction/utxo.ts b/packages/btc/src/transaction/utxo.ts index 7efae0f0..68958589 100644 --- a/packages/btc/src/transaction/utxo.ts +++ b/packages/btc/src/transaction/utxo.ts @@ -1,4 +1,4 @@ -import cloneDeep from 'lodash/cloneDeep'; +import cloneDeep from 'lodash/cloneDeep.js'; import { ErrorCodes, TxBuildError } from '../error'; import { DataSource } from '../query/source'; import { AddressType, AddressToPubkeyMap } from '../address'; diff --git a/packages/ckb/src/rgbpp/btc-time.ts b/packages/ckb/src/rgbpp/btc-time.ts index dcac2bfd..aaa6b8b8 100644 --- a/packages/ckb/src/rgbpp/btc-time.ts +++ b/packages/ckb/src/rgbpp/btc-time.ts @@ -27,7 +27,7 @@ import { } from '../utils'; import { buildSpvClientCellDep } from '../utils'; import { blockchain } from '@ckb-lumos/base'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; export const buildBtcTimeUnlockWitness = (btcTxProof: Hex): Hex => { const btcTimeUnlock = BTCTimeUnlock.pack({ btcTxProof: blockchain.Bytes.pack(btcTxProof) }); diff --git a/packages/ckb/src/rgbpp/btc-transfer.ts b/packages/ckb/src/rgbpp/btc-transfer.ts index ff47d488..9efe9233 100644 --- a/packages/ckb/src/rgbpp/btc-transfer.ts +++ b/packages/ckb/src/rgbpp/btc-transfer.ts @@ -44,7 +44,7 @@ import { scriptToHash, serializeWitnessArgs, } from '@nervosnetwork/ckb-sdk-utils'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; /** * Generate the virtual ckb transaction for the btc transfer tx diff --git a/packages/ckb/src/rgbpp/ckb-builder.ts b/packages/ckb/src/rgbpp/ckb-builder.ts index fe293511..4b5cd73d 100644 --- a/packages/ckb/src/rgbpp/ckb-builder.ts +++ b/packages/ckb/src/rgbpp/ckb-builder.ts @@ -22,10 +22,10 @@ import { u8ToHex, } from '../utils'; import { InputsCapacityNotEnoughError } from '../error'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; import { buildSpvClientCellDep } from '../utils'; import { RGBPPUnlock, Uint16 } from '../schemas/generated/rgbpp'; -import { Bytes } from '@ckb-lumos/base/lib/blockchain'; +import { Bytes } from '@ckb-lumos/base/lib/blockchain.js'; export const buildRgbppUnlockWitness = ( btcTxBytes: Hex, diff --git a/packages/ckb/src/spore/spore.ts b/packages/ckb/src/spore/spore.ts index 44ac2c53..1a9fa0f1 100644 --- a/packages/ckb/src/spore/spore.ts +++ b/packages/ckb/src/spore/spore.ts @@ -49,7 +49,7 @@ import { scriptToHash, serializeWitnessArgs, } from '@nervosnetwork/ckb-sdk-utils'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; /** * Generate the virtual ckb transaction for creating spores diff --git a/packages/ckb/src/utils/spore.ts b/packages/ckb/src/utils/spore.ts index 471f73e7..2e918522 100644 --- a/packages/ckb/src/utils/spore.ts +++ b/packages/ckb/src/utils/spore.ts @@ -8,7 +8,7 @@ import { assembleCreateClusterAction, assembleCreateSporeAction, assembleTransferClusterAction, -} from '@spore-sdk/core/lib/cobuild'; +} from '@spore-sdk/core/lib/cobuild/index.js'; import { u64ToLe } from './hex'; import { Hex, IndexerCell, SporesCreateCobuildParams } from '../types'; import { NoRgbppLiveCellError, RgbppSporeTypeMismatchError, RgbppUtxoBindMultiTypeAssetsError } from '../error'; diff --git a/packages/service/src/service/base.ts b/packages/service/src/service/base.ts index 5abf1453..4b60f392 100644 --- a/packages/service/src/service/base.ts +++ b/packages/service/src/service/base.ts @@ -1,4 +1,4 @@ -import pickBy from 'lodash/pickBy'; +import pickBy from 'lodash/pickBy.js'; import { isDomain } from '../utils'; import { BtcAssetsApiError, ErrorCodes } from '../error'; import { BaseApis, BaseApiRequestOptions, BtcAssetsApiToken, BtcAssetsApiContext, Json } from '../types'; From 5baf1f878495347d12d69b171276eb76cec1b528 Mon Sep 17 00:00:00 2001 From: Shook Date: Fri, 5 Jul 2024 10:57:47 +0800 Subject: [PATCH 08/15] refactor: bypass named importing from @nervosnetwork/ckb-sdk-utils directly --- packages/ckb/src/index.ts | 3 ++- packages/ckb/src/paymaster/index.ts | 4 +++- packages/ckb/src/rgbpp/btc-jump-ckb.ts | 4 +++- packages/ckb/src/rgbpp/btc-time.ts | 20 +++++++++++--------- packages/ckb/src/rgbpp/btc-transfer.ts | 10 +++------- packages/ckb/src/rgbpp/ckb-builder.ts | 10 +++------- packages/ckb/src/rgbpp/ckb-jump-btc.ts | 4 +++- packages/ckb/src/rgbpp/launch.ts | 4 +++- packages/ckb/src/spore/cluster.ts | 4 +++- packages/ckb/src/spore/leap.ts | 9 +++------ packages/ckb/src/spore/spore.ts | 12 ++++-------- packages/ckb/src/utils/hex.ts | 4 +++- packages/ckb/src/utils/rgbpp.ts | 10 +++------- packages/ckb/src/utils/spore.ts | 4 +++- packages/rgbpp/src/rgbpp/xudt.ts | 3 +-- 15 files changed, 51 insertions(+), 54 deletions(-) diff --git a/packages/ckb/src/index.ts b/packages/ckb/src/index.ts index 9c954cdd..cd2ea23c 100644 --- a/packages/ckb/src/index.ts +++ b/packages/ckb/src/index.ts @@ -1,4 +1,5 @@ -export { serializeScript } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; +export const serializeScript = ckbUtils.serializeScript; export * from './schemas/generated/blockchain'; export * from './schemas/generated/rgbpp'; diff --git a/packages/ckb/src/paymaster/index.ts b/packages/ckb/src/paymaster/index.ts index 63a970de..f5fe7ea0 100644 --- a/packages/ckb/src/paymaster/index.ts +++ b/packages/ckb/src/paymaster/index.ts @@ -1,9 +1,11 @@ -import { AddressPrefix, addressToScript, getTransactionSize, privateKeyToAddress } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { ConstructPaymasterParams } from '../types/rgbpp'; import { NoLiveCellError } from '../error'; import { CKB_UNIT, MAX_FEE, SECP256K1_WITNESS_LOCK_SIZE, getSecp256k1CellDep } from '../constants'; import { append0x, calculateTransactionFee } from '../utils'; +const { AddressPrefix, addressToScript, getTransactionSize, privateKeyToAddress } = ckbUtils; + const SECP256K1_MIN_CAPACITY = BigInt(61) * CKB_UNIT; export const splitMultiCellsWithSecp256k1 = async ({ diff --git a/packages/ckb/src/rgbpp/btc-jump-ckb.ts b/packages/ckb/src/rgbpp/btc-jump-ckb.ts index ad4c40bc..b238367a 100644 --- a/packages/ckb/src/rgbpp/btc-jump-ckb.ts +++ b/packages/ckb/src/rgbpp/btc-jump-ckb.ts @@ -25,7 +25,9 @@ import { } from '../utils/rgbpp'; import { Hex, IndexerCell } from '../types'; import { RGBPP_WITNESS_PLACEHOLDER, getSecp256k1CellDep } from '../constants'; -import { addressToScript, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; + +const { addressToScript, getTransactionSize } = ckbUtils; /** * Generate the virtual ckb transaction for the jumping tx from BTC to CKB diff --git a/packages/ckb/src/rgbpp/btc-time.ts b/packages/ckb/src/rgbpp/btc-time.ts index aaa6b8b8..79af8b08 100644 --- a/packages/ckb/src/rgbpp/btc-time.ts +++ b/packages/ckb/src/rgbpp/btc-time.ts @@ -1,12 +1,4 @@ -import { - addressToScript, - bytesToHex, - getTransactionSize, - rawTransactionToHash, - scriptToHash, - serializeOutPoint, - serializeWitnessArgs, -} from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { BTC_JUMP_CONFIRMATION_BLOCKS, SECP256K1_WITNESS_LOCK_SIZE, @@ -29,6 +21,16 @@ import { buildSpvClientCellDep } from '../utils'; import { blockchain } from '@ckb-lumos/base'; import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; +const { + addressToScript, + bytesToHex, + getTransactionSize, + rawTransactionToHash, + scriptToHash, + serializeOutPoint, + serializeWitnessArgs, +} = ckbUtils; + export const buildBtcTimeUnlockWitness = (btcTxProof: Hex): Hex => { const btcTimeUnlock = BTCTimeUnlock.pack({ btcTxProof: blockchain.Bytes.pack(btcTxProof) }); return append0x(bytesToHex(btcTimeUnlock)); diff --git a/packages/ckb/src/rgbpp/btc-transfer.ts b/packages/ckb/src/rgbpp/btc-transfer.ts index 9efe9233..6d052f03 100644 --- a/packages/ckb/src/rgbpp/btc-transfer.ts +++ b/packages/ckb/src/rgbpp/btc-transfer.ts @@ -37,15 +37,11 @@ import { getRgbppLockScript, getSecp256k1CellDep, } from '../constants'; -import { - addressToScript, - getTransactionSize, - rawTransactionToHash, - scriptToHash, - serializeWitnessArgs, -} from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; +const { addressToScript, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } = ckbUtils; + /** * Generate the virtual ckb transaction for the btc transfer tx * @param collector The collector that collects CKB live cells and transactions diff --git a/packages/ckb/src/rgbpp/ckb-builder.ts b/packages/ckb/src/rgbpp/ckb-builder.ts index 4b5cd73d..cc2725c8 100644 --- a/packages/ckb/src/rgbpp/ckb-builder.ts +++ b/packages/ckb/src/rgbpp/ckb-builder.ts @@ -1,10 +1,4 @@ -import { - bytesToHex, - getTransactionSize, - rawTransactionToHash, - scriptToHash, - serializeWitnessArgs, -} from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { UpdateCkbTxWithRealBtcTxIdParams, AppendPaymasterCellAndSignTxParams, @@ -27,6 +21,8 @@ import { buildSpvClientCellDep } from '../utils'; import { RGBPPUnlock, Uint16 } from '../schemas/generated/rgbpp'; import { Bytes } from '@ckb-lumos/base/lib/blockchain.js'; +const { bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } = ckbUtils; + export const buildRgbppUnlockWitness = ( btcTxBytes: Hex, btcTxProof: Hex, diff --git a/packages/ckb/src/rgbpp/ckb-jump-btc.ts b/packages/ckb/src/rgbpp/ckb-jump-btc.ts index 36ecc4c3..00b81350 100644 --- a/packages/ckb/src/rgbpp/ckb-jump-btc.ts +++ b/packages/ckb/src/rgbpp/ckb-jump-btc.ts @@ -12,7 +12,9 @@ import { } from '../utils'; import { genRgbppLockScript } from '../utils/rgbpp'; import { MAX_FEE, MIN_CAPACITY, RGBPP_TX_WITNESS_MAX_SIZE } from '../constants'; -import { addressToScript, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; + +const { addressToScript, getTransactionSize } = ckbUtils; /** * Generate the virtual ckb transaction for the jumping tx from CKB to BTC diff --git a/packages/ckb/src/rgbpp/launch.ts b/packages/ckb/src/rgbpp/launch.ts index 8542b5a6..3be9cfe1 100644 --- a/packages/ckb/src/rgbpp/launch.ts +++ b/packages/ckb/src/rgbpp/launch.ts @@ -24,7 +24,9 @@ import { getUniqueTypeScript, UNLOCKABLE_LOCK_SCRIPT, } from '../constants'; -import { getTransactionSize, scriptToHash } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; + +const { getTransactionSize, scriptToHash } = ckbUtils; /** * Generate the virtual ckb transaction for the btc transfer tx diff --git a/packages/ckb/src/spore/cluster.ts b/packages/ckb/src/spore/cluster.ts index 95571424..174a2340 100644 --- a/packages/ckb/src/spore/cluster.ts +++ b/packages/ckb/src/spore/cluster.ts @@ -11,7 +11,9 @@ import { } from '../constants'; import { generateClusterCreateCoBuild, generateClusterId } from '../utils/spore'; import { NoRgbppLiveCellError } from '../error'; -import { bytesToHex, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; + +const { bytesToHex, getTransactionSize } = ckbUtils; /** * Generate the virtual ckb transaction for creating cluster diff --git a/packages/ckb/src/spore/leap.ts b/packages/ckb/src/spore/leap.ts index ac36d8d6..91a10382 100644 --- a/packages/ckb/src/spore/leap.ts +++ b/packages/ckb/src/spore/leap.ts @@ -23,15 +23,12 @@ import { } from '../constants'; import { generateSporeTransferCoBuild, throwErrorWhenSporeCellsInvalid } from '../utils/spore'; import { NoRgbppLiveCellError } from '../error'; -import { - addressToScript, - getTransactionSize, - serializeOutPoint, - serializeWitnessArgs, -} from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { blockchain } from '@ckb-lumos/base'; import { buildBtcTimeUnlockWitness } from '../rgbpp'; +const { addressToScript, getTransactionSize, serializeOutPoint, serializeWitnessArgs } = ckbUtils; + /** * Generate the virtual ckb transaction for leaping spore from BTC to CKB * @param collector The collector that collects CKB live cells and transactions diff --git a/packages/ckb/src/spore/spore.ts b/packages/ckb/src/spore/spore.ts index 1a9fa0f1..ff410de7 100644 --- a/packages/ckb/src/spore/spore.ts +++ b/packages/ckb/src/spore/spore.ts @@ -41,16 +41,12 @@ import { RgbppUtxoBindMultiTypeAssetsError, TypeAssetNotSupportedError, } from '../error'; -import { - addressToScript, - bytesToHex, - getTransactionSize, - rawTransactionToHash, - scriptToHash, - serializeWitnessArgs, -} from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; +const { addressToScript, bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } = + ckbUtils; + /** * Generate the virtual ckb transaction for creating spores * @param collector The collector that collects CKB live cells and transactions diff --git a/packages/ckb/src/utils/hex.ts b/packages/ckb/src/utils/hex.ts index a41f4a13..81065926 100644 --- a/packages/ckb/src/utils/hex.ts +++ b/packages/ckb/src/utils/hex.ts @@ -1,6 +1,8 @@ -import { hexToBytes, bytesToHex } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { Hex } from '../types'; +const { hexToBytes, bytesToHex } = ckbUtils; + export const remove0x = (hex: string): string => { if (hex.startsWith('0x')) { return hex.substring(2); diff --git a/packages/ckb/src/utils/rgbpp.ts b/packages/ckb/src/utils/rgbpp.ts index 768a114e..b8cd14e3 100644 --- a/packages/ckb/src/utils/rgbpp.ts +++ b/packages/ckb/src/utils/rgbpp.ts @@ -9,13 +9,7 @@ import { getBtcTimeLockScript, getRgbppLockScript, } from '../constants'; -import { - bytesToHex, - hexToBytes, - serializeOutPoint, - serializeOutput, - serializeScript, -} from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { BTCTimeLock } from '../schemas/generated/rgbpp'; import { Script } from '../schemas/generated/blockchain'; import { blockchain } from '@ckb-lumos/base'; @@ -30,6 +24,8 @@ import { } from '../error'; import { calculateRgbppCellCapacity, isScriptEqual, isUDTTypeSupported } from './ckb-tx'; +const { bytesToHex, hexToBytes, serializeOutPoint, serializeOutput, serializeScript } = ckbUtils; + export const genRgbppLockScript = (rgbppLockArgs: Hex, isMainnet: boolean, btcTestnetType?: BTCTestnetType) => { return { ...getRgbppLockScript(isMainnet, btcTestnetType), diff --git a/packages/ckb/src/utils/spore.ts b/packages/ckb/src/utils/spore.ts index 2e918522..1737f987 100644 --- a/packages/ckb/src/utils/spore.ts +++ b/packages/ckb/src/utils/spore.ts @@ -1,4 +1,4 @@ -import { PERSONAL, blake2b, hexToBytes, serializeInput } from '@nervosnetwork/ckb-sdk-utils'; +import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { Cell as LumosCell } from '@ckb-lumos/base'; import { UnpackResult } from '@ckb-lumos/codec'; import { @@ -14,6 +14,8 @@ import { Hex, IndexerCell, SporesCreateCobuildParams } from '../types'; import { NoRgbppLiveCellError, RgbppSporeTypeMismatchError, RgbppUtxoBindMultiTypeAssetsError } from '../error'; import { isScriptEqual, isSporeTypeSupported } from './ckb-tx'; +const { PERSONAL, blake2b, hexToBytes, serializeInput } = ckbUtils; + // Generate type id for cluster id export const generateClusterId = (firstInput: CKBComponents.CellInput, firstOutputIndex: number) => { const input = hexToBytes(serializeInput(firstInput)); diff --git a/packages/rgbpp/src/rgbpp/xudt.ts b/packages/rgbpp/src/rgbpp/xudt.ts index acdf14a7..f6e97c14 100644 --- a/packages/rgbpp/src/rgbpp/xudt.ts +++ b/packages/rgbpp/src/rgbpp/xudt.ts @@ -1,5 +1,4 @@ -import { genBtcTransferCkbVirtualTx, getXudtTypeScript } from '@rgbpp-sdk/ckb'; -import { serializeScript } from '@nervosnetwork/ckb-sdk-utils'; +import { genBtcTransferCkbVirtualTx, getXudtTypeScript, serializeScript } from '@rgbpp-sdk/ckb'; import { sendRgbppUtxos } from '@rgbpp-sdk/btc'; import { RgbppTransferTxParams, RgbppTransferTxResult } from './types'; From 4831fa1097907c5ed1942acb6df342c41f0657e3 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Fri, 5 Jul 2024 18:09:23 +0800 Subject: [PATCH 09/15] refactor: Clean ckb lib import packages --- packages/ckb/src/collector/index.ts | 3 +-- packages/ckb/src/index.ts | 3 --- packages/ckb/src/paymaster/index.ts | 12 ++++++++---- packages/ckb/src/rgbpp/btc-jump-ckb.ts | 10 +++------- packages/ckb/src/rgbpp/btc-time.ts | 16 +++------------- packages/ckb/src/rgbpp/btc-transfer.ts | 12 ++++-------- packages/ckb/src/rgbpp/ckb-builder.ts | 12 +++++------- packages/ckb/src/rgbpp/ckb-jump-btc.ts | 8 +++----- packages/ckb/src/rgbpp/launch.ts | 8 ++------ packages/ckb/src/spore/cluster.ts | 19 ++++++++++++------- packages/ckb/src/spore/leap.ts | 15 ++++++++------- packages/ckb/src/spore/spore.ts | 21 +++++++++------------ packages/ckb/src/utils/hex.ts | 4 +--- packages/ckb/src/utils/rgbpp.ts | 14 ++++++++------ packages/ckb/src/utils/spore.ts | 4 +--- 15 files changed, 68 insertions(+), 93 deletions(-) diff --git a/packages/ckb/src/collector/index.ts b/packages/ckb/src/collector/index.ts index aca6d505..e8d433c0 100644 --- a/packages/ckb/src/collector/index.ts +++ b/packages/ckb/src/collector/index.ts @@ -1,10 +1,9 @@ import axios from 'axios'; import CKB from '@nervosnetwork/ckb-sdk-core'; -import { toCamelcase } from '../utils/case-parser'; import { CollectConfig, CollectResult, CollectUdtResult, IndexerCell } from '../types/collector'; import { MIN_CAPACITY } from '../constants'; import { CapacityNotEnoughError, IndexerError, UdtAmountNotEnoughError } from '../error'; -import { isRgbppLockCellIgnoreChain, leToU128, remove0x } from '../utils'; +import { isRgbppLockCellIgnoreChain, leToU128, remove0x, toCamelcase } from '../utils'; import { Hex } from '../types'; interface IndexerScript { diff --git a/packages/ckb/src/index.ts b/packages/ckb/src/index.ts index cd2ea23c..2a40bc10 100644 --- a/packages/ckb/src/index.ts +++ b/packages/ckb/src/index.ts @@ -1,6 +1,3 @@ -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; -export const serializeScript = ckbUtils.serializeScript; - export * from './schemas/generated/blockchain'; export * from './schemas/generated/rgbpp'; export * from './collector'; diff --git a/packages/ckb/src/paymaster/index.ts b/packages/ckb/src/paymaster/index.ts index f5fe7ea0..4cedb69d 100644 --- a/packages/ckb/src/paymaster/index.ts +++ b/packages/ckb/src/paymaster/index.ts @@ -1,10 +1,14 @@ -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { ConstructPaymasterParams } from '../types/rgbpp'; import { NoLiveCellError } from '../error'; import { CKB_UNIT, MAX_FEE, SECP256K1_WITNESS_LOCK_SIZE, getSecp256k1CellDep } from '../constants'; -import { append0x, calculateTransactionFee } from '../utils'; - -const { AddressPrefix, addressToScript, getTransactionSize, privateKeyToAddress } = ckbUtils; +import { + append0x, + calculateTransactionFee, + AddressPrefix, + addressToScript, + getTransactionSize, + privateKeyToAddress, +} from '../utils'; const SECP256K1_MIN_CAPACITY = BigInt(61) * CKB_UNIT; diff --git a/packages/ckb/src/rgbpp/btc-jump-ckb.ts b/packages/ckb/src/rgbpp/btc-jump-ckb.ts index b238367a..31c5b3e8 100644 --- a/packages/ckb/src/rgbpp/btc-jump-ckb.ts +++ b/packages/ckb/src/rgbpp/btc-jump-ckb.ts @@ -1,5 +1,4 @@ import { RgbppCkbVirtualTx, BtcJumpCkbVirtualTxParams, BtcJumpCkbVirtualTxResult } from '../types/rgbpp'; -import { blockchain } from '@ckb-lumos/base'; import { TypeAssetNotSupportedError } from '../error'; import { append0x, @@ -11,8 +10,6 @@ import { isScriptEqual, isUDTTypeSupported, u128ToLe, -} from '../utils'; -import { buildPreLockArgs, calculateCommitment, throwErrorWhenTxInputsExceeded, @@ -22,12 +19,11 @@ import { genRgbppLockScript, throwErrorWhenRgbppCellsInvalid, isRgbppCapacitySufficientForChange, -} from '../utils/rgbpp'; +} from '../utils'; import { Hex, IndexerCell } from '../types'; import { RGBPP_WITNESS_PLACEHOLDER, getSecp256k1CellDep } from '../constants'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; - -const { addressToScript, getTransactionSize } = ckbUtils; +import { blockchain } from '@ckb-lumos/base'; +import { addressToScript, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for the jumping tx from BTC to CKB diff --git a/packages/ckb/src/rgbpp/btc-time.ts b/packages/ckb/src/rgbpp/btc-time.ts index 79af8b08..d2ef6825 100644 --- a/packages/ckb/src/rgbpp/btc-time.ts +++ b/packages/ckb/src/rgbpp/btc-time.ts @@ -1,4 +1,4 @@ -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; +import { addressToScript, bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeOutPoint, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; import { BTC_JUMP_CONFIRMATION_BLOCKS, SECP256K1_WITNESS_LOCK_SIZE, @@ -16,20 +16,10 @@ import { genBtcTimeLockArgs, lockScriptFromBtcTimeLockArgs, transformSpvProof, + buildSpvClientCellDep, } from '../utils'; -import { buildSpvClientCellDep } from '../utils'; import { blockchain } from '@ckb-lumos/base'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; - -const { - addressToScript, - bytesToHex, - getTransactionSize, - rawTransactionToHash, - scriptToHash, - serializeOutPoint, - serializeWitnessArgs, -} = ckbUtils; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; export const buildBtcTimeUnlockWitness = (btcTxProof: Hex): Hex => { const btcTimeUnlock = BTCTimeUnlock.pack({ btcTxProof: blockchain.Bytes.pack(btcTxProof) }); diff --git a/packages/ckb/src/rgbpp/btc-transfer.ts b/packages/ckb/src/rgbpp/btc-transfer.ts index 6d052f03..dfda328c 100644 --- a/packages/ckb/src/rgbpp/btc-transfer.ts +++ b/packages/ckb/src/rgbpp/btc-transfer.ts @@ -6,7 +6,6 @@ import { BtcTransferVirtualTxResult, RgbppCkbVirtualTx, } from '../types/rgbpp'; -import { blockchain } from '@ckb-lumos/base'; import { NoLiveCellError, NoRgbppLiveCellError, TypeAssetNotSupportedError } from '../error'; import { append0x, @@ -17,8 +16,6 @@ import { isScriptEqual, isUDTTypeSupported, u128ToLe, -} from '../utils'; -import { buildPreLockArgs, calculateCommitment, compareInputs, @@ -27,7 +24,7 @@ import { isRgbppCapacitySufficientForChange, throwErrorWhenRgbppCellsInvalid, throwErrorWhenTxInputsExceeded, -} from '../utils/rgbpp'; +} from '../utils'; import { Hex, IndexerCell } from '../types'; import { MAX_FEE, @@ -37,10 +34,9 @@ import { getRgbppLockScript, getSecp256k1CellDep, } from '../constants'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; - -const { addressToScript, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } = ckbUtils; +import { blockchain } from '@ckb-lumos/base'; +import { addressToScript, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; /** * Generate the virtual ckb transaction for the btc transfer tx diff --git a/packages/ckb/src/rgbpp/ckb-builder.ts b/packages/ckb/src/rgbpp/ckb-builder.ts index cc2725c8..0b65b00d 100644 --- a/packages/ckb/src/rgbpp/ckb-builder.ts +++ b/packages/ckb/src/rgbpp/ckb-builder.ts @@ -1,4 +1,3 @@ -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { UpdateCkbTxWithRealBtcTxIdParams, AppendPaymasterCellAndSignTxParams, @@ -16,12 +15,11 @@ import { u8ToHex, } from '../utils'; import { InputsCapacityNotEnoughError } from '../error'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; import { buildSpvClientCellDep } from '../utils'; import { RGBPPUnlock, Uint16 } from '../schemas/generated/rgbpp'; -import { Bytes } from '@ckb-lumos/base/lib/blockchain.js'; - -const { bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } = ckbUtils; +import { blockchain } from '@ckb-lumos/base'; +import { bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; export const buildRgbppUnlockWitness = ( btcTxBytes: Hex, @@ -32,14 +30,14 @@ export const buildRgbppUnlockWitness = ( const inputLen = append0x(u8ToHex(inputsLen)); const outputLen = append0x(u8ToHex(outputsLen)); - const btcTx = Bytes.pack(append0x(btcTxBytes)); + const btcTx = blockchain.Bytes.pack(append0x(btcTxBytes)); const version = Uint16.pack([0, 0]); const rgbppUnlock = RGBPPUnlock.pack({ version, extraData: { inputLen, outputLen }, btcTx, - btcTxProof: bytesToHex(Bytes.pack(append0x(btcTxProof))), + btcTxProof: bytesToHex(blockchain.Bytes.pack(append0x(btcTxProof))), }); return append0x(bytesToHex(rgbppUnlock)); }; diff --git a/packages/ckb/src/rgbpp/ckb-jump-btc.ts b/packages/ckb/src/rgbpp/ckb-jump-btc.ts index 00b81350..87bcf16e 100644 --- a/packages/ckb/src/rgbpp/ckb-jump-btc.ts +++ b/packages/ckb/src/rgbpp/ckb-jump-btc.ts @@ -1,5 +1,4 @@ import { CkbBatchJumpBtcVirtualTxParams, CkbJumpBtcVirtualTxParams } from '../types/rgbpp'; -import { blockchain } from '@ckb-lumos/base'; import { NoLiveCellError, NoXudtLiveCellError, TypeAssetNotSupportedError } from '../error'; import { append0x, @@ -9,12 +8,11 @@ import { fetchTypeIdCellDeps, isTypeAssetSupported, u128ToLe, + genRgbppLockScript, } from '../utils'; -import { genRgbppLockScript } from '../utils/rgbpp'; import { MAX_FEE, MIN_CAPACITY, RGBPP_TX_WITNESS_MAX_SIZE } from '../constants'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; - -const { addressToScript, getTransactionSize } = ckbUtils; +import { blockchain } from '@ckb-lumos/base'; +import { addressToScript, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for the jumping tx from CKB to BTC diff --git a/packages/ckb/src/rgbpp/launch.ts b/packages/ckb/src/rgbpp/launch.ts index 3be9cfe1..7313ef8c 100644 --- a/packages/ckb/src/rgbpp/launch.ts +++ b/packages/ckb/src/rgbpp/launch.ts @@ -7,14 +7,12 @@ import { fetchTypeIdCellDeps, generateUniqueTypeArgs, u128ToLe, -} from '../utils'; -import { buildPreLockArgs, calculateCommitment, encodeRgbppTokenInfo, genBtcTimeLockScript, genRgbppLockScript, -} from '../utils/rgbpp'; +} from '../utils'; import { Hex } from '../types'; import { MAX_FEE, @@ -24,9 +22,7 @@ import { getUniqueTypeScript, UNLOCKABLE_LOCK_SCRIPT, } from '../constants'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; - -const { getTransactionSize, scriptToHash } = ckbUtils; +import { getTransactionSize, scriptToHash } from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for the btc transfer tx diff --git a/packages/ckb/src/spore/cluster.ts b/packages/ckb/src/spore/cluster.ts index 174a2340..c793113b 100644 --- a/packages/ckb/src/spore/cluster.ts +++ b/packages/ckb/src/spore/cluster.ts @@ -1,7 +1,15 @@ -import { RgbppCkbVirtualTx } from '../types/rgbpp'; import { packRawClusterData } from '@spore-sdk/core'; -import { append0x, calculateTransactionFee, fetchTypeIdCellDeps } from '../utils'; -import { buildPreLockArgs, calculateCommitment, genRgbppLockScript } from '../utils/rgbpp'; +import { RgbppCkbVirtualTx } from '../types/rgbpp'; +import { + append0x, + calculateTransactionFee, + fetchTypeIdCellDeps, + buildPreLockArgs, + calculateCommitment, + genRgbppLockScript, + generateClusterCreateCoBuild, + generateClusterId, +} from '../utils'; import { CreateClusterCkbVirtualTxParams, Hex, SporeVirtualTxResult } from '../types'; import { RGBPP_TX_WITNESS_MAX_SIZE, @@ -9,11 +17,8 @@ import { getClusterTypeDep, getClusterTypeScript, } from '../constants'; -import { generateClusterCreateCoBuild, generateClusterId } from '../utils/spore'; import { NoRgbppLiveCellError } from '../error'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; - -const { bytesToHex, getTransactionSize } = ckbUtils; +import { bytesToHex, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for creating cluster diff --git a/packages/ckb/src/spore/leap.ts b/packages/ckb/src/spore/leap.ts index 91a10382..ca2f719f 100644 --- a/packages/ckb/src/spore/leap.ts +++ b/packages/ckb/src/spore/leap.ts @@ -1,5 +1,4 @@ import { BtcTimeCellsParams, RgbppCkbVirtualTx } from '../types/rgbpp'; -import { append0x, calculateTransactionFee, fetchTypeIdCellDeps } from '../utils'; import { btcTxIdAndAfterFromBtcTimeLockArgs, buildSpvClientCellDep, @@ -8,7 +7,12 @@ import { genBtcTimeLockScript, lockScriptFromBtcTimeLockArgs, transformSpvProof, -} from '../utils/rgbpp'; + generateSporeTransferCoBuild, + throwErrorWhenSporeCellsInvalid, + append0x, + fetchTypeIdCellDeps, + calculateTransactionFee, +} from '../utils'; import { Hex, LeapSporeFromBtcToCkbVirtualTxParams, @@ -21,13 +25,10 @@ import { getRgbppLockScript, getSporeTypeDep, } from '../constants'; -import { generateSporeTransferCoBuild, throwErrorWhenSporeCellsInvalid } from '../utils/spore'; import { NoRgbppLiveCellError } from '../error'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; -import { blockchain } from '@ckb-lumos/base'; import { buildBtcTimeUnlockWitness } from '../rgbpp'; - -const { addressToScript, getTransactionSize, serializeOutPoint, serializeWitnessArgs } = ckbUtils; +import { addressToScript, getTransactionSize, serializeOutPoint, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; +import { blockchain } from '@ckb-lumos/base'; /** * Generate the virtual ckb transaction for leaping spore from BTC to CKB diff --git a/packages/ckb/src/spore/spore.ts b/packages/ckb/src/spore/spore.ts index ff410de7..91646339 100644 --- a/packages/ckb/src/spore/spore.ts +++ b/packages/ckb/src/spore/spore.ts @@ -6,8 +6,14 @@ import { calculateTransactionFee, fetchTypeIdCellDeps, isClusterSporeTypeSupported, + buildPreLockArgs, + calculateCommitment, + genRgbppLockScript, + generateSporeCreateCoBuild, + generateSporeId, + generateSporeTransferCoBuild, + throwErrorWhenSporeCellsInvalid, } from '../utils'; -import { buildPreLockArgs, calculateCommitment, genRgbppLockScript } from '../utils/rgbpp'; import { AppendIssuerCellToSporeCreate, BuildAppendingIssuerCellTxParams, @@ -29,23 +35,14 @@ import { getSporeTypeDep, getSporeTypeScript, } from '../constants'; -import { - generateSporeCreateCoBuild, - generateSporeId, - generateSporeTransferCoBuild, - throwErrorWhenSporeCellsInvalid, -} from '../utils/spore'; import { NoLiveCellError, NoRgbppLiveCellError, RgbppUtxoBindMultiTypeAssetsError, TypeAssetNotSupportedError, } from '../error'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; -import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses.js'; - -const { addressToScript, bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } = - ckbUtils; +import { addressToScript, bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; +import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; /** * Generate the virtual ckb transaction for creating spores diff --git a/packages/ckb/src/utils/hex.ts b/packages/ckb/src/utils/hex.ts index 81065926..ab19e116 100644 --- a/packages/ckb/src/utils/hex.ts +++ b/packages/ckb/src/utils/hex.ts @@ -1,8 +1,6 @@ -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; +import { hexToBytes, bytesToHex } from './ckb-tx'; import { Hex } from '../types'; -const { hexToBytes, bytesToHex } = ckbUtils; - export const remove0x = (hex: string): string => { if (hex.startsWith('0x')) { return hex.substring(2); diff --git a/packages/ckb/src/utils/rgbpp.ts b/packages/ckb/src/utils/rgbpp.ts index b8cd14e3..fb8b447a 100644 --- a/packages/ckb/src/utils/rgbpp.ts +++ b/packages/ckb/src/utils/rgbpp.ts @@ -1,4 +1,5 @@ import { sha256 } from 'js-sha256'; +import { RgbppApiSpvProof } from '@rgbpp-sdk/service'; import { BTCTestnetType, Hex, IndexerCell, RgbppCkbVirtualTx, RgbppTokenInfo, SpvClientCellTxProof } from '../types'; import { append0x, remove0x, reverseHex, u32ToLe, u8ToHex, utf8ToHex } from './hex'; import { @@ -9,12 +10,9 @@ import { getBtcTimeLockScript, getRgbppLockScript, } from '../constants'; -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { BTCTimeLock } from '../schemas/generated/rgbpp'; import { Script } from '../schemas/generated/blockchain'; -import { blockchain } from '@ckb-lumos/base'; import { bytes } from '@ckb-lumos/codec'; -import { RgbppApiSpvProof } from '@rgbpp-sdk/service'; import { toCamelcase } from './case-parser'; import { InputsOrOutputsLenError, @@ -22,9 +20,13 @@ import { RgbppCkbTxInputsExceededError, RgbppUtxoBindMultiTypeAssetsError, } from '../error'; -import { calculateRgbppCellCapacity, isScriptEqual, isUDTTypeSupported } from './ckb-tx'; - -const { bytesToHex, hexToBytes, serializeOutPoint, serializeOutput, serializeScript } = ckbUtils; +import { + calculateRgbppCellCapacity, + isScriptEqual, + isUDTTypeSupported, +} from './ckb-tx'; +import { bytesToHex, hexToBytes, serializeOutPoint, serializeOutput, serializeScript } from '@nervosnetwork/ckb-sdk-utils'; +import { blockchain } from '@ckb-lumos/base'; export const genRgbppLockScript = (rgbppLockArgs: Hex, isMainnet: boolean, btcTestnetType?: BTCTestnetType) => { return { diff --git a/packages/ckb/src/utils/spore.ts b/packages/ckb/src/utils/spore.ts index 1737f987..9ea6c480 100644 --- a/packages/ckb/src/utils/spore.ts +++ b/packages/ckb/src/utils/spore.ts @@ -1,4 +1,3 @@ -import * as ckbUtils from '@nervosnetwork/ckb-sdk-utils'; import { Cell as LumosCell } from '@ckb-lumos/base'; import { UnpackResult } from '@ckb-lumos/codec'; import { @@ -13,8 +12,7 @@ import { u64ToLe } from './hex'; import { Hex, IndexerCell, SporesCreateCobuildParams } from '../types'; import { NoRgbppLiveCellError, RgbppSporeTypeMismatchError, RgbppUtxoBindMultiTypeAssetsError } from '../error'; import { isScriptEqual, isSporeTypeSupported } from './ckb-tx'; - -const { PERSONAL, blake2b, hexToBytes, serializeInput } = ckbUtils; +import { blake2b, hexToBytes, PERSONAL, serializeInput } from '@nervosnetwork/ckb-sdk-utils'; // Generate type id for cluster id export const generateClusterId = (firstInput: CKBComponents.CellInput, firstOutputIndex: number) => { From 3b8817c2cb13fec67f1a3826bbca1b28b71aaf88 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 18 Jul 2024 23:45:17 +0800 Subject: [PATCH 10/15] chore: Upgrade ckb-sdk-js --- .github/workflows/snapshot.yml | 1 + examples/rgbpp/package.json | 2 +- examples/xudt-on-ckb/package.json | 2 +- packages/btc/package.json | 2 +- packages/ckb/package.json | 6 +- packages/ckb/src/collector/index.ts | 1 - packages/ckb/src/paymaster/index.ts | 10 +-- packages/ckb/src/rgbpp/btc-time.ts | 10 ++- packages/ckb/src/rgbpp/btc-transfer.ts | 8 ++- packages/ckb/src/rgbpp/ckb-builder.ts | 8 ++- packages/ckb/src/spore/leap.ts | 7 +- packages/ckb/src/spore/spore.ts | 9 ++- packages/ckb/src/utils/ckb-tx.ts | 8 ++- packages/ckb/src/utils/hex.ts | 2 +- packages/ckb/src/utils/rgbpp.ts | 8 ++- packages/rgbpp/package.json | 2 +- packages/service/package.json | 2 +- pnpm-lock.yaml | 90 +++++++++++++++++--------- tests/rgbpp/package.json | 2 +- 19 files changed, 123 insertions(+), 57 deletions(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 8b9ee900..a6bfbe1c 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -7,6 +7,7 @@ on: push: branches: - develop + - ref/support-esm concurrency: ${{ github.workflow }}-${{ github.ref }} diff --git a/examples/rgbpp/package.json b/examples/rgbpp/package.json index aa756e8c..55ed09c3 100644 --- a/examples/rgbpp/package.json +++ b/examples/rgbpp/package.json @@ -10,7 +10,7 @@ "lint:fix": "tsc && eslint --fix --ext .js,.ts . && prettier --write '**/*.{js,ts}'" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.109.1", + "@nervosnetwork/ckb-sdk-utils": "0.109.2", "rgbpp": "workspace:*" }, "devDependencies": { diff --git a/examples/xudt-on-ckb/package.json b/examples/xudt-on-ckb/package.json index a0ac8293..b495d5db 100644 --- a/examples/xudt-on-ckb/package.json +++ b/examples/xudt-on-ckb/package.json @@ -10,7 +10,7 @@ "lint:fix": "tsc && eslint --fix --ext .ts . && prettier --write '**/*.ts'" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "^0.109.1", + "@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1", "rgbpp": "^0.4.0" }, "devDependencies": { diff --git a/packages/btc/package.json b/packages/btc/package.json index 761bb40b..d3f130e7 100644 --- a/packages/btc/package.json +++ b/packages/btc/package.json @@ -30,7 +30,7 @@ "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@ckb-lumos/codec": "0.22.2", - "@nervosnetwork/ckb-types": "0.109.1", + "@nervosnetwork/ckb-types": "0.109.2", "@rgbpp-sdk/ckb": "workspace:^", "@rgbpp-sdk/service": "workspace:^", "bip32": "^4.0.0", diff --git a/packages/ckb/package.json b/packages/ckb/package.json index c3db67dc..efe842f2 100644 --- a/packages/ckb/package.json +++ b/packages/ckb/package.json @@ -32,9 +32,9 @@ "@ckb-lumos/base": "^0.22.2", "@ckb-lumos/codec": "^0.22.2", "@spore-sdk/core": "^0.2.0-beta.6", - "@nervosnetwork/ckb-sdk-core": "0.109.1", - "@nervosnetwork/ckb-sdk-utils": "0.109.1", - "@nervosnetwork/ckb-types": "0.109.1", + "@nervosnetwork/ckb-sdk-core": "0.109.2", + "@nervosnetwork/ckb-sdk-utils": "0.109.2", + "@nervosnetwork/ckb-types": "0.109.2", "@rgbpp-sdk/service": "workspace:^", "@exact-realty/multipart-parser": "^1.0.13", "axios": "^1.6.8", diff --git a/packages/ckb/src/collector/index.ts b/packages/ckb/src/collector/index.ts index e8d433c0..c1eca05b 100644 --- a/packages/ckb/src/collector/index.ts +++ b/packages/ckb/src/collector/index.ts @@ -168,7 +168,6 @@ export class Collector { async getLiveCells(outPoints: CKBComponents.OutPoint[], withData = false): Promise { const ckb = new CKB(this.ckbNodeUrl); - /* @ts-expect-error The parameters data types of batch request don't support boolean */ const batch = ckb.rpc.createBatchRequest(outPoints.map((outPoint) => ['getLiveCell', outPoint, withData])); return batch.exec().then((liveCells) => liveCells.map((liveCell) => liveCell.cell)); } diff --git a/packages/ckb/src/paymaster/index.ts b/packages/ckb/src/paymaster/index.ts index 4cedb69d..5c63a506 100644 --- a/packages/ckb/src/paymaster/index.ts +++ b/packages/ckb/src/paymaster/index.ts @@ -1,14 +1,8 @@ import { ConstructPaymasterParams } from '../types/rgbpp'; import { NoLiveCellError } from '../error'; import { CKB_UNIT, MAX_FEE, SECP256K1_WITNESS_LOCK_SIZE, getSecp256k1CellDep } from '../constants'; -import { - append0x, - calculateTransactionFee, - AddressPrefix, - addressToScript, - getTransactionSize, - privateKeyToAddress, -} from '../utils'; +import { append0x, calculateTransactionFee } from '../utils'; +import { AddressPrefix, addressToScript, getTransactionSize, privateKeyToAddress } from '@nervosnetwork/ckb-sdk-utils'; const SECP256K1_MIN_CAPACITY = BigInt(61) * CKB_UNIT; diff --git a/packages/ckb/src/rgbpp/btc-time.ts b/packages/ckb/src/rgbpp/btc-time.ts index d2ef6825..8eceebae 100644 --- a/packages/ckb/src/rgbpp/btc-time.ts +++ b/packages/ckb/src/rgbpp/btc-time.ts @@ -1,4 +1,12 @@ -import { addressToScript, bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeOutPoint, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; +import { + addressToScript, + bytesToHex, + getTransactionSize, + rawTransactionToHash, + scriptToHash, + serializeOutPoint, + serializeWitnessArgs, +} from '@nervosnetwork/ckb-sdk-utils'; import { BTC_JUMP_CONFIRMATION_BLOCKS, SECP256K1_WITNESS_LOCK_SIZE, diff --git a/packages/ckb/src/rgbpp/btc-transfer.ts b/packages/ckb/src/rgbpp/btc-transfer.ts index dfda328c..3ea79690 100644 --- a/packages/ckb/src/rgbpp/btc-transfer.ts +++ b/packages/ckb/src/rgbpp/btc-transfer.ts @@ -35,8 +35,14 @@ import { getSecp256k1CellDep, } from '../constants'; import { blockchain } from '@ckb-lumos/base'; -import { addressToScript, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import { + addressToScript, + getTransactionSize, + rawTransactionToHash, + scriptToHash, + serializeWitnessArgs, +} from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for the btc transfer tx diff --git a/packages/ckb/src/rgbpp/ckb-builder.ts b/packages/ckb/src/rgbpp/ckb-builder.ts index 0b65b00d..08e470c1 100644 --- a/packages/ckb/src/rgbpp/ckb-builder.ts +++ b/packages/ckb/src/rgbpp/ckb-builder.ts @@ -18,8 +18,14 @@ import { InputsCapacityNotEnoughError } from '../error'; import { buildSpvClientCellDep } from '../utils'; import { RGBPPUnlock, Uint16 } from '../schemas/generated/rgbpp'; import { blockchain } from '@ckb-lumos/base'; -import { bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import { + bytesToHex, + getTransactionSize, + rawTransactionToHash, + scriptToHash, + serializeWitnessArgs, +} from '@nervosnetwork/ckb-sdk-utils'; export const buildRgbppUnlockWitness = ( btcTxBytes: Hex, diff --git a/packages/ckb/src/spore/leap.ts b/packages/ckb/src/spore/leap.ts index ca2f719f..81644fbb 100644 --- a/packages/ckb/src/spore/leap.ts +++ b/packages/ckb/src/spore/leap.ts @@ -27,8 +27,13 @@ import { } from '../constants'; import { NoRgbppLiveCellError } from '../error'; import { buildBtcTimeUnlockWitness } from '../rgbpp'; -import { addressToScript, getTransactionSize, serializeOutPoint, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; import { blockchain } from '@ckb-lumos/base'; +import { + addressToScript, + getTransactionSize, + serializeOutPoint, + serializeWitnessArgs, +} from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for leaping spore from BTC to CKB diff --git a/packages/ckb/src/spore/spore.ts b/packages/ckb/src/spore/spore.ts index 91646339..f2f34644 100644 --- a/packages/ckb/src/spore/spore.ts +++ b/packages/ckb/src/spore/spore.ts @@ -41,8 +41,15 @@ import { RgbppUtxoBindMultiTypeAssetsError, TypeAssetNotSupportedError, } from '../error'; -import { addressToScript, bytesToHex, getTransactionSize, rawTransactionToHash, scriptToHash, serializeWitnessArgs } from '@nervosnetwork/ckb-sdk-utils'; import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'; +import { + addressToScript, + bytesToHex, + getTransactionSize, + rawTransactionToHash, + scriptToHash, + serializeWitnessArgs, +} from '@nervosnetwork/ckb-sdk-utils'; /** * Generate the virtual ckb transaction for creating spores diff --git a/packages/ckb/src/utils/ckb-tx.ts b/packages/ckb/src/utils/ckb-tx.ts index ed5b17ec..c6bd196c 100644 --- a/packages/ckb/src/utils/ckb-tx.ts +++ b/packages/ckb/src/utils/ckb-tx.ts @@ -1,3 +1,10 @@ +import { + PERSONAL, + blake2b, + hexToBytes, + serializeInput, + serializeScript, +} from '@nervosnetwork/ckb-sdk-utils'; import { RawClusterData, packRawClusterData, SporeDataProps, packRawSporeData } from '@spore-sdk/core'; import { remove0x, u64ToLe } from './hex'; import { @@ -8,7 +15,6 @@ import { getXudtTypeScript, } from '../constants'; import { Hex, IndexerCell, RgbppTokenInfo } from '../types'; -import { PERSONAL, blake2b, hexToBytes, serializeInput, serializeScript } from '@nervosnetwork/ckb-sdk-utils'; import { encodeRgbppTokenInfo, genBtcTimeLockScript } from './rgbpp'; import { Collector } from '../collector'; import { NoLiveCellError } from '../error'; diff --git a/packages/ckb/src/utils/hex.ts b/packages/ckb/src/utils/hex.ts index ab19e116..a41f4a13 100644 --- a/packages/ckb/src/utils/hex.ts +++ b/packages/ckb/src/utils/hex.ts @@ -1,4 +1,4 @@ -import { hexToBytes, bytesToHex } from './ckb-tx'; +import { hexToBytes, bytesToHex } from '@nervosnetwork/ckb-sdk-utils'; import { Hex } from '../types'; export const remove0x = (hex: string): string => { diff --git a/packages/ckb/src/utils/rgbpp.ts b/packages/ckb/src/utils/rgbpp.ts index fb8b447a..dd5c3634 100644 --- a/packages/ckb/src/utils/rgbpp.ts +++ b/packages/ckb/src/utils/rgbpp.ts @@ -25,8 +25,14 @@ import { isScriptEqual, isUDTTypeSupported, } from './ckb-tx'; -import { bytesToHex, hexToBytes, serializeOutPoint, serializeOutput, serializeScript } from '@nervosnetwork/ckb-sdk-utils'; import { blockchain } from '@ckb-lumos/base'; +import { + bytesToHex, + hexToBytes, + serializeOutPoint, + serializeOutput, + serializeScript, +} from '@nervosnetwork/ckb-sdk-utils'; export const genRgbppLockScript = (rgbppLockArgs: Hex, isMainnet: boolean, btcTestnetType?: BTCTestnetType) => { return { diff --git a/packages/rgbpp/package.json b/packages/rgbpp/package.json index 9b504caf..a1a96439 100644 --- a/packages/rgbpp/package.json +++ b/packages/rgbpp/package.json @@ -61,7 +61,7 @@ "@rgbpp-sdk/btc": "workspace:*", "@rgbpp-sdk/ckb": "workspace:*", "@rgbpp-sdk/service": "workspace:*", - "@nervosnetwork/ckb-sdk-utils": "0.109.1" + "@nervosnetwork/ckb-sdk-utils": "0.109.2" }, "publishConfig": { "access": "public" diff --git a/packages/service/package.json b/packages/service/package.json index 54494e08..29c49351 100644 --- a/packages/service/package.json +++ b/packages/service/package.json @@ -30,7 +30,7 @@ "dependencies": { "@ckb-lumos/codec": "0.22.2", "@ckb-lumos/base": "0.22.2", - "@nervosnetwork/ckb-types": "0.109.1", + "@nervosnetwork/ckb-types": "0.109.2", "lodash": "^4.17.21" }, "publishConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a2b56c88..20ee5c64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,8 +127,8 @@ importers: examples/rgbpp: dependencies: '@nervosnetwork/ckb-sdk-utils': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 rgbpp: specifier: workspace:* version: link:../../packages/rgbpp @@ -149,8 +149,8 @@ importers: examples/xudt-on-ckb: dependencies: '@nervosnetwork/ckb-sdk-utils': - specifier: ^0.109.1 - version: 0.109.1 + specifier: 0.109.2-alpha.1 + version: 0.109.2-alpha.1 rgbpp: specifier: ^0.4.0 version: 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) @@ -171,8 +171,8 @@ importers: specifier: 0.22.2 version: 0.22.2 '@nervosnetwork/ckb-types': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 '@rgbpp-sdk/ckb': specifier: workspace:^ version: link:../ckb @@ -207,14 +207,14 @@ importers: specifier: ^1.0.13 version: 1.0.14 '@nervosnetwork/ckb-sdk-core': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 '@nervosnetwork/ckb-sdk-utils': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 '@nervosnetwork/ckb-types': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 '@rgbpp-sdk/service': specifier: workspace:^ version: link:../service @@ -238,8 +238,8 @@ importers: packages/rgbpp: dependencies: '@nervosnetwork/ckb-sdk-utils': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 '@rgbpp-sdk/btc': specifier: workspace:* version: link:../btc @@ -259,8 +259,8 @@ importers: specifier: 0.22.2 version: 0.22.2 '@nervosnetwork/ckb-types': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 lodash: specifier: ^4.17.21 version: 4.17.21 @@ -268,8 +268,8 @@ importers: tests/rgbpp: dependencies: '@nervosnetwork/ckb-sdk-utils': - specifier: 0.109.1 - version: 0.109.1 + specifier: 0.109.2 + version: 0.109.2 rgbpp: specifier: workspace:* version: link:../../packages/rgbpp @@ -1976,21 +1976,21 @@ packages: read-yaml-file: 1.1.0 dev: true - /@nervosnetwork/ckb-sdk-core@0.109.1: - resolution: {integrity: sha512-YU3yJZvz69WU6Bw//vRxzxLGcIj74CwGffdp6GYZbQpZwFaACT6FCojvOMjHIyJ8Rw32r114LhMKHvyBwagWjw==} + /@nervosnetwork/ckb-sdk-core@0.109.2: + resolution: {integrity: sha512-56oOneHQCM0IEyNQswCIF8Xs1PXj4TGuBQA6iKfRKvHyXQiEGeVJ1q4FJzVk8dz5tRLguoMYWs6HuXy02bKIVg==} dependencies: - '@nervosnetwork/ckb-sdk-rpc': 0.109.1 - '@nervosnetwork/ckb-sdk-utils': 0.109.1 - '@nervosnetwork/ckb-types': 0.109.1 + '@nervosnetwork/ckb-sdk-rpc': 0.109.2 + '@nervosnetwork/ckb-sdk-utils': 0.109.2 + '@nervosnetwork/ckb-types': 0.109.2 tslib: 2.3.1 transitivePeerDependencies: - debug dev: false - /@nervosnetwork/ckb-sdk-rpc@0.109.1: - resolution: {integrity: sha512-RoUhXmaOm1g7ga1G3guNTzSDit79k7nqj3rYbk2jSlULRo34g9L06juU24hmwwuFZfiCaARI9mgACu0ScW9itw==} + /@nervosnetwork/ckb-sdk-rpc@0.109.2: + resolution: {integrity: sha512-6RHLMXIzyV8XKkV19SnYvnRqCs3B3BVHwVFHk6G0Eq71bmKwLjgEoc8pYnXoQK1P4v31ZCvIhdjynSvjh0Jv1w==} dependencies: - '@nervosnetwork/ckb-sdk-utils': 0.109.1 + '@nervosnetwork/ckb-sdk-utils': 0.109.2 axios: 1.6.7 tslib: 2.3.1 transitivePeerDependencies: @@ -2007,10 +2007,38 @@ packages: tslib: 2.3.1 dev: false + /@nervosnetwork/ckb-sdk-utils@0.109.2: + resolution: {integrity: sha512-pXgQvQQA2TuXiAmKGvL9kWjXdCsX+qP8HqHSLt6kwrjFe846d4dZxZ5AunpP+xsQNst+L5V7xcvunaBOkTdD6g==} + dependencies: + '@nervosnetwork/ckb-types': 0.109.2 + bech32: 2.0.0 + elliptic: 6.5.4 + jsbi: 3.1.3 + 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 + /@nervosnetwork/ckb-types@0.109.2: + 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'} @@ -2236,7 +2264,7 @@ packages: dependencies: '@bitcoinerlab/secp256k1': 1.1.1 '@ckb-lumos/codec': 0.22.2 - '@nervosnetwork/ckb-types': 0.109.1 + '@nervosnetwork/ckb-types': 0.109.2 '@rgbpp-sdk/ckb': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) '@rgbpp-sdk/service': 0.4.0 bip32: 4.0.0 @@ -2255,9 +2283,9 @@ packages: '@ckb-lumos/base': 0.22.2 '@ckb-lumos/codec': 0.22.2 '@exact-realty/multipart-parser': 1.0.14 - '@nervosnetwork/ckb-sdk-core': 0.109.1 - '@nervosnetwork/ckb-sdk-utils': 0.109.1 - '@nervosnetwork/ckb-types': 0.109.1 + '@nervosnetwork/ckb-sdk-core': 0.109.2 + '@nervosnetwork/ckb-sdk-utils': 0.109.2 + '@nervosnetwork/ckb-types': 0.109.2 '@rgbpp-sdk/service': 0.4.0 '@spore-sdk/core': 0.2.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) axios: 1.7.2 @@ -2274,7 +2302,7 @@ packages: dependencies: '@ckb-lumos/base': 0.22.2 '@ckb-lumos/codec': 0.22.2 - '@nervosnetwork/ckb-types': 0.109.1 + '@nervosnetwork/ckb-types': 0.109.2 lodash: 4.17.21 dev: false diff --git a/tests/rgbpp/package.json b/tests/rgbpp/package.json index fb7e5443..a7ca218a 100644 --- a/tests/rgbpp/package.json +++ b/tests/rgbpp/package.json @@ -12,7 +12,7 @@ "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" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.109.1", + "@nervosnetwork/ckb-sdk-utils": "0.109.2", "rgbpp": "workspace:*", "zx": "^8.0.2" }, From 119dfb8d1c99be7551c0e3774bd8a59896374fc1 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Wed, 31 Jul 2024 19:52:55 +0800 Subject: [PATCH 11/15] chore: Format code --- apps/service/src/json-rpc/json-rpc.server.ts | 2 +- packages/ckb/src/utils/ckb-tx.ts | 8 +------- packages/ckb/src/utils/rgbpp.ts | 6 +----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/apps/service/src/json-rpc/json-rpc.server.ts b/apps/service/src/json-rpc/json-rpc.server.ts index f556f6d5..6234d39e 100644 --- a/apps/service/src/json-rpc/json-rpc.server.ts +++ b/apps/service/src/json-rpc/json-rpc.server.ts @@ -50,7 +50,7 @@ export class JsonRpcServer { } const name = metadata.name ? `${metadata.name}.${methodMetadata.name ?? methodName}` - : methodMetadata.name ?? methodName; + : (methodMetadata.name ?? methodName); const handler = (params: unknown) => { const instanceRef = this.moduleRef.get(instance.constructor, { strict: false }); return instanceRef[methodName](params); diff --git a/packages/ckb/src/utils/ckb-tx.ts b/packages/ckb/src/utils/ckb-tx.ts index c6bd196c..9c8bfc2d 100644 --- a/packages/ckb/src/utils/ckb-tx.ts +++ b/packages/ckb/src/utils/ckb-tx.ts @@ -1,10 +1,4 @@ -import { - PERSONAL, - blake2b, - hexToBytes, - serializeInput, - serializeScript, -} from '@nervosnetwork/ckb-sdk-utils'; +import { PERSONAL, blake2b, hexToBytes, serializeInput, serializeScript } from '@nervosnetwork/ckb-sdk-utils'; import { RawClusterData, packRawClusterData, SporeDataProps, packRawSporeData } from '@spore-sdk/core'; import { remove0x, u64ToLe } from './hex'; import { diff --git a/packages/ckb/src/utils/rgbpp.ts b/packages/ckb/src/utils/rgbpp.ts index dd5c3634..c94d0a81 100644 --- a/packages/ckb/src/utils/rgbpp.ts +++ b/packages/ckb/src/utils/rgbpp.ts @@ -20,11 +20,7 @@ import { RgbppCkbTxInputsExceededError, RgbppUtxoBindMultiTypeAssetsError, } from '../error'; -import { - calculateRgbppCellCapacity, - isScriptEqual, - isUDTTypeSupported, -} from './ckb-tx'; +import { calculateRgbppCellCapacity, isScriptEqual, isUDTTypeSupported } from './ckb-tx'; import { blockchain } from '@ckb-lumos/base'; import { bytesToHex, From 80a9bd3ab623698410d15b7761be93d7c7256401 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Wed, 31 Jul 2024 20:46:02 +0800 Subject: [PATCH 12/15] 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, From 1caaa50a1f78d9bf1539b1dfab68acbe87cafc6c Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 1 Aug 2024 10:43:00 +0800 Subject: [PATCH 13/15] chore: Remove snapshot release for support-esm --- .github/workflows/snapshot.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index a6bfbe1c..8b9ee900 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -7,7 +7,6 @@ on: push: branches: - develop - - ref/support-esm concurrency: ${{ github.workflow }}-${{ github.ref }} From ccd11bba5aebfd16eacdb16fbe82b5787e882ab4 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 1 Aug 2024 14:40:49 +0800 Subject: [PATCH 14/15] Update apps/service/package.json Co-authored-by: Flouse <1297478+Flouse@users.noreply.github.com> --- apps/service/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/service/package.json b/apps/service/package.json index 7bd043a0..79b86423 100644 --- a/apps/service/package.json +++ b/apps/service/package.json @@ -28,7 +28,7 @@ "convert-keys": "^1.3.4", "json-rpc-2.0": "^1.7.0", "reflect-metadata": "^0.2.0", - "rgbpp": "^0.4.0", + "rgbpp": "^0.5.0", "rxjs": "^7.8.1", "zod": "^3.23.8" }, From a70fee457a71cb2e15762ca11c515c0b709eaf35 Mon Sep 17 00:00:00 2001 From: Dylan Duan Date: Thu, 1 Aug 2024 14:43:11 +0800 Subject: [PATCH 15/15] fix: Update pnpm-lock.yaml --- pnpm-lock.yaml | 78 ++------------------------------------------------ 1 file changed, 2 insertions(+), 76 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1f9e0ee..bcf70575 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: specifier: ^0.2.0 version: 0.2.2 rgbpp: - specifier: ^0.4.0 - version: 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) + specifier: ^0.5.0 + version: link:../../packages/rgbpp rxjs: specifier: ^7.8.1 version: 7.8.1 @@ -2198,16 +2198,6 @@ packages: - debug dev: false - /@nervosnetwork/ckb-sdk-utils@0.109.1: - resolution: {integrity: sha512-KK8w+JZGPt/Gq/Y0b87AuQp8mGR46fBSkqnjwASdBAi2rts9tJ6srEaZ3FVVa9LtjTlThQ120hex+mcyastrkQ==} - dependencies: - '@nervosnetwork/ckb-types': 0.109.1 - bech32: 2.0.0 - elliptic: 6.5.4 - jsbi: 3.1.3 - tslib: 2.3.1 - dev: false - /@nervosnetwork/ckb-sdk-utils@0.109.2: resolution: {integrity: sha512-pXgQvQQA2TuXiAmKGvL9kWjXdCsX+qP8HqHSLt6kwrjFe846d4dZxZ5AunpP+xsQNst+L5V7xcvunaBOkTdD6g==} dependencies: @@ -2218,10 +2208,6 @@ packages: tslib: 2.3.1 dev: false - /@nervosnetwork/ckb-types@0.109.1: - resolution: {integrity: sha512-mD5mOCGa1JertKZekHSUVYwFPW27VJ0/MdwblWvEEK7pNIU6az+dLiIxgvl4TxR+j+7/GqmXNH1U59CM92y/wg==} - dev: false - /@nervosnetwork/ckb-types@0.109.2: resolution: {integrity: sha512-NAQbUi+j6tWlUYijvHqWIUwrbawIeAeSlxUQm0wkqSKbtAEoiR4L6RZS7cgn7uH+SMsp78mciXP8gixrfH3rEQ==} dev: false @@ -2446,53 +2432,6 @@ packages: dev: true optional: true - /@rgbpp-sdk/btc@0.4.0(@ckb-lumos/lumos@0.22.0-next.5): - resolution: {integrity: sha512-4Fx/UsN2T1CyhyasK565ChofxRFA1JyCSnUuAPh0fpQ2AAcPzrbKGZS65hpOPa/2qClkzzszdXz1sgkbXUCaPg==} - dependencies: - '@bitcoinerlab/secp256k1': 1.1.1 - '@ckb-lumos/codec': 0.22.2 - '@nervosnetwork/ckb-types': 0.109.2 - '@rgbpp-sdk/ckb': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) - '@rgbpp-sdk/service': 0.4.0 - bip32: 4.0.0 - bitcoinjs-lib: 6.1.6 - ecpair: 2.1.0 - lodash: 4.17.21 - p-limit: 3.1.0 - transitivePeerDependencies: - - '@ckb-lumos/lumos' - - debug - dev: false - - /@rgbpp-sdk/ckb@0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21): - resolution: {integrity: sha512-mqwWL+mnuyzLoGBR58eeNPRITp0fVqf0smU8BiR0Ey4cVpF206mBMscgex8EHwgAMU6cUjBLBDej0HYugpshZw==} - dependencies: - '@ckb-lumos/base': 0.22.2 - '@ckb-lumos/codec': 0.22.2 - '@exact-realty/multipart-parser': 1.0.14 - '@nervosnetwork/ckb-sdk-core': 0.109.2 - '@nervosnetwork/ckb-sdk-utils': 0.109.2 - '@nervosnetwork/ckb-types': 0.109.2 - '@rgbpp-sdk/service': 0.4.0 - '@spore-sdk/core': 0.2.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) - axios: 1.7.2 - camelcase-keys: 7.0.2 - js-sha256: 0.11.0 - transitivePeerDependencies: - - '@ckb-lumos/lumos' - - debug - - lodash - dev: false - - /@rgbpp-sdk/service@0.4.0: - resolution: {integrity: sha512-OvSNcSAmI7RDbf2bzySmHL0UO/S4dn5LAWrfJ41B2WXZiKAAtZ5IG4ajW6RKz6bxf0t7EcjRtXimdGieoubzyw==} - dependencies: - '@ckb-lumos/base': 0.22.2 - '@ckb-lumos/codec': 0.22.2 - '@nervosnetwork/ckb-types': 0.109.2 - lodash: 4.17.21 - dev: false - /@rollup/rollup-android-arm-eabi@4.19.0: resolution: {integrity: sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w==} cpu: [arm] @@ -6885,19 +6824,6 @@ packages: /rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - /rgbpp@0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21): - resolution: {integrity: sha512-V8a5NV/bjKGYYN8gM7b/ed27hVAhIhZK0MJnpFalaasctZjhjtt8BjK9XWGS2mabSR+feHK/5/ROBEVLNOeFhg==} - dependencies: - '@nervosnetwork/ckb-sdk-utils': 0.109.1 - '@rgbpp-sdk/btc': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5) - '@rgbpp-sdk/ckb': 0.4.0(@ckb-lumos/lumos@0.22.0-next.5)(lodash@4.17.21) - '@rgbpp-sdk/service': 0.4.0 - transitivePeerDependencies: - - '@ckb-lumos/lumos' - - debug - - lodash - dev: false - /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} deprecated: Rimraf versions prior to v4 are no longer supported