From 1d8110900d1aee3747199bfb377b149b7ff6848e Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 13 Nov 2023 10:53:01 +0800 Subject: [PATCH] Update bundler (#2830) --- .github/workflows/test-canary.yml | 4 +- .github/workflows/test-release.yml | 2 +- .github/workflows/trigger-release.yml | 2 +- _internal/package.json | 1 + package.json | 2 +- pnpm-lock.yaml | 427 ++++++++++++-------------- test/type/mutation.ts | 3 +- tsconfig.json | 9 - 8 files changed, 201 insertions(+), 249 deletions(-) diff --git a/.github/workflows/test-canary.yml b/.github/workflows/test-canary.yml index 9dece1c13..46fdc7226 100644 --- a/.github/workflows/test-canary.yml +++ b/.github/workflows/test-canary.yml @@ -1,7 +1,7 @@ name: Test React Canary on: - workflow_dispatch: + workflow_dispatch: schedule: - cron: '0 0 * * *' @@ -20,7 +20,7 @@ jobs: - name: Lint and test run: | - pnpm run-all-checks pnpm clean pnpm build + pnpm run-all-checks pnpm test:build diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 6a8f68e09..c4d760ad8 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -20,9 +20,9 @@ jobs: - name: Lint and test run: | - pnpm run-all-checks pnpm clean pnpm build + pnpm run-all-checks pnpm attw pnpm test:build e2e: diff --git a/.github/workflows/trigger-release.yml b/.github/workflows/trigger-release.yml index daa982ec8..6efdb045b 100644 --- a/.github/workflows/trigger-release.yml +++ b/.github/workflows/trigger-release.yml @@ -65,9 +65,9 @@ jobs: - run: pnpm install - run: | - pnpm run-all-checks pnpm clean pnpm build + pnpm run-all-checks pnpm test:build - name: Configure git diff --git a/_internal/package.json b/_internal/package.json index 5f296295d..adbbf94f0 100644 --- a/_internal/package.json +++ b/_internal/package.json @@ -16,6 +16,7 @@ "clean": "rimraf dist" }, "peerDependencies": { + "swr": "*", "react": "*" } } diff --git a/package.json b/package.json index f59cf7681..d1d8a5cea 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "@types/use-sync-external-store": "^0.0.3", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.59.8", - "bunchee": "3.6.0", + "bunchee": "3.9.2", "eslint": "8.42.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-jest-dom": "5.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7824b2c95..b3d08ff49 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,10 +19,10 @@ importers: version: 1.34.3 '@swc/core': specifier: ^1.3.62 - version: 1.3.62 + version: 1.3.93(@swc/helpers@0.5.1) '@swc/jest': specifier: 0.2.26 - version: 0.2.26(@swc/core@1.3.62) + version: 0.2.26(@swc/core@1.3.93) '@testing-library/jest-dom': specifier: ^5.16.5 version: 5.16.5 @@ -51,8 +51,8 @@ importers: specifier: 5.59.8 version: 5.59.8(eslint@8.42.0)(typescript@5.1.3) bunchee: - specifier: 3.6.0 - version: 3.6.0(typescript@5.1.3) + specifier: 3.9.2 + version: 3.9.2(typescript@5.1.3) eslint: specifier: 8.42.0 version: 8.42.0 @@ -180,6 +180,16 @@ packages: '@babel/highlight': 7.18.6 dev: true + /@babel/code-frame@7.22.13: + resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + engines: {node: '>=6.9.0'} + requiresBuild: true + dependencies: + '@babel/highlight': 7.22.20 + chalk: 2.4.2 + dev: true + optional: true + /@babel/compat-data@7.18.8: resolution: {integrity: sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ==} engines: {node: '>=6.9.0'} @@ -297,6 +307,12 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + optional: true + /@babel/helper-validator-option@7.18.6: resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} engines: {node: '>=6.9.0'} @@ -322,6 +338,16 @@ packages: js-tokens: 4.0.0 dev: true + /@babel/highlight@7.22.20: + resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + optional: true + /@babel/parser@7.18.9: resolution: {integrity: sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg==} engines: {node: '>=6.0.0'} @@ -813,10 +839,10 @@ packages: resolution: {integrity: sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@types/istanbul-lib-coverage': 2.0.4 - '@types/istanbul-reports': 3.0.1 + '@types/istanbul-lib-coverage': 2.0.5 + '@types/istanbul-reports': 3.0.3 '@types/node': 20.2.5 - '@types/yargs': 16.0.4 + '@types/yargs': 16.0.7 chalk: 4.1.2 dev: true @@ -863,6 +889,10 @@ packages: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + /@jridgewell/trace-mapping@0.3.17: resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} dependencies: @@ -1130,25 +1160,25 @@ packages: fsevents: 2.3.2 dev: true - /@rollup/plugin-commonjs@24.0.1(rollup@3.20.2): - resolution: {integrity: sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==} + /@rollup/plugin-commonjs@25.0.7(rollup@3.29.4): + resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^2.68.0||^3.0.0 + rollup: ^2.68.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.5(rollup@3.29.4) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 - magic-string: 0.27.0 - rollup: 3.20.2 + magic-string: 0.30.5 + rollup: 3.29.4 dev: true - /@rollup/plugin-json@6.0.0(rollup@3.20.2): + /@rollup/plugin-json@6.0.0(rollup@3.29.4): resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1157,29 +1187,29 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - rollup: 3.20.2 + '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + rollup: 3.29.4 dev: true - /@rollup/plugin-node-resolve@15.0.2(rollup@3.20.2): - resolution: {integrity: sha512-Y35fRGUjC3FaurG722uhUuG8YHOJRJQbI6/CkbRkdPotSpDj9NtIN85z1zrcyDcCQIW4qp5mgG72U+gJ0TAFEg==} + /@rollup/plugin-node-resolve@15.2.3(rollup@3.29.4): + resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^2.78.0||^3.0.0 + rollup: ^2.78.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.5(rollup@3.29.4) '@types/resolve': 1.20.2 deepmerge: 4.2.2 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.1 - rollup: 3.20.2 + rollup: 3.29.4 dev: true - /@rollup/plugin-replace@5.0.2(rollup@3.20.2): + /@rollup/plugin-replace@5.0.2(rollup@3.29.4): resolution: {integrity: sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1188,12 +1218,12 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.5(rollup@3.29.4) magic-string: 0.27.0 - rollup: 3.20.2 + rollup: 3.29.4 dev: true - /@rollup/plugin-wasm@6.1.3(rollup@3.20.2): + /@rollup/plugin-wasm@6.1.3(rollup@3.29.4): resolution: {integrity: sha512-7ItTTeyauE6lwdDtQWceEHZ9+txbi4RRy0mYPFn9BW7rD7YdgBDu7HTHsLtHrRzJc313RM/1m6GKgV3np/aEaw==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1202,22 +1232,14 @@ packages: rollup: optional: true dependencies: - rollup: 3.20.2 - dev: true - - /@rollup/pluginutils@4.2.1: - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 + rollup: 3.29.4 dev: true - /@rollup/pluginutils@5.0.2(rollup@3.20.2): - resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + /@rollup/pluginutils@5.0.5(rollup@3.29.4): + resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true @@ -1225,7 +1247,7 @@ packages: '@types/estree': 1.0.0 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.20.2 + rollup: 3.29.4 dev: true /@sinclair/typebox@0.25.21: @@ -1244,17 +1266,8 @@ packages: '@sinonjs/commons': 2.0.0 dev: true - /@swc/core-darwin-arm64@1.3.62: - resolution: {integrity: sha512-MmGilibITz68LEje6vJlKzc2gUUSgzvB3wGLSjEORikTNeM7P8jXVxE4A8fgZqDeudJUm9HVWrxCV+pHDSwXhA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@swc/core-darwin-arm64@1.3.70: - resolution: {integrity: sha512-31+mcl0dgdRHvZRjhLOK9V6B+qJ7nxDZYINr9pBlqGWxknz37Vld5KK19Kpr79r0dXUZvaaelLjCnJk9dA2PcQ==} + /@swc/core-darwin-arm64@1.3.93: + resolution: {integrity: sha512-gEKgk7FVIgltnIfDO6GntyuQBBlAYg5imHpRgLxB1zSI27ijVVkksc6QwISzFZAhKYaBWIsFSVeL9AYSziAF7A==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -1262,8 +1275,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.62: - resolution: {integrity: sha512-Xl93MMB3sCWVlYWuQIB+v6EQgzoiuQYK5tNt9lsHoIEVu2zLdkQjae+5FUHZb1VYqCXIiWcULFfVz0R4Sjb7JQ==} + /@swc/core-darwin-x64@1.3.93: + resolution: {integrity: sha512-ZQPxm/fXdDQtn3yrYSL/gFfA8OfZ5jTi33yFQq6vcg/Y8talpZ+MgdSlYM0FkLrZdMTYYTNFiuBQuuvkA+av+Q==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -1271,26 +1284,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.70: - resolution: {integrity: sha512-GMFJ65E18zQC80t0os+TZvI+8lbRuitncWVge/RXmXbVLPRcdykP4EJ87cqzcG5Ah0z18/E0T+ixD6jHRisrYQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm-gnueabihf@1.3.62: - resolution: {integrity: sha512-nJsp6O7kCtAjTTMcIjVB0g5y1JNiYAa5q630eiwrnaHUusEFoANDdORI3Z9vXeikMkng+6yIv9/V8Rb093xLjQ==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm-gnueabihf@1.3.70: - resolution: {integrity: sha512-wjhCwS8LCiAq2VedF1b4Bryyw68xZnfMED4pLRazAl8BaUlDFANfRBORNunxlfHQj4V3x39IaiLgCZRHMdzXBg==} + /@swc/core-linux-arm-gnueabihf@1.3.93: + resolution: {integrity: sha512-OYFMMI2yV+aNe3wMgYhODxHdqUB/jrK0SEMHHS44GZpk8MuBXEF+Mcz4qjkY5Q1EH7KVQqXb/gVWwdgTHpjM2A==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -1298,26 +1293,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.62: - resolution: {integrity: sha512-XGsV93vpUAopDt5y6vPwbK1Nc/MlL55L77bAZUPIiosWD1cWWPHNtNSpriE6+I+JiMHe0pqtfS/SSTk6ZkFQVw==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm64-gnu@1.3.70: - resolution: {integrity: sha512-9D/Rx67cAOnMiexvCqARxvhj7coRajTp5HlJHuf+rfwMqI2hLhpO9/pBMQxBUAWxODO/ksQ/OF+GJRjmtWw/2A==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm64-musl@1.3.62: - resolution: {integrity: sha512-ESUmJjSlTTkoBy9dMG49opcNn8BmviqStMhwyeD1G8XRnmRVCZZgoBOKdvCXmJhw8bQXDhZumeaTUB+OFUKVXg==} + /@swc/core-linux-arm64-gnu@1.3.93: + resolution: {integrity: sha512-BT4dT78odKnJMNiq5HdjBsv29CiIdcCcImAPxeFqAeFw1LL6gh9nzI8E96oWc+0lVT5lfhoesCk4Qm7J6bty8w==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1325,8 +1302,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.70: - resolution: {integrity: sha512-gkjxBio7XD+1GlQVVyPP/qeFkLu83VhRHXaUrkNYpr5UZG9zZurBERT9nkS6Y+ouYh+Q9xmw57aIyd2KvD2zqQ==} + /@swc/core-linux-arm64-musl@1.3.93: + resolution: {integrity: sha512-yH5fWEl1bktouC0mhh0Chuxp7HEO4uCtS/ly1Vmf18gs6wZ8DOOkgAEVv2dNKIryy+Na++ljx4Ym7C8tSJTrLw==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1334,26 +1311,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.62: - resolution: {integrity: sha512-wnHJkt3ZBrax3SFnUHDcncG6mrSg9ZZjMhQV9Mc3JL1x1s1Gy9rGZCoBNnV/BUZWTemxIBcQbANRSDut/WO+9A==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-x64-gnu@1.3.70: - resolution: {integrity: sha512-/nCly+V4xfMVwfEUoLLAukxUSot/RcSzsf6GdsGTjFcrp5sZIntAjokYRytm3VT1c2TK321AfBorsi9R5w8Y7Q==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-x64-musl@1.3.62: - resolution: {integrity: sha512-9oRbuTC/VshB66Rgwi3pTq3sPxSTIb8k9L1vJjES+dDMKa29DAjPtWCXG/pyZ00ufpFZgkGEuAHH5uqUcr1JQg==} + /@swc/core-linux-x64-gnu@1.3.93: + resolution: {integrity: sha512-OFUdx64qvrGJhXKEyxosHxgoUVgba2ztYh7BnMiU5hP8lbI8G13W40J0SN3CmFQwPP30+3oEbW7LWzhKEaYjlg==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1361,8 +1320,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.70: - resolution: {integrity: sha512-HoOsPJbt361KGKaivAK0qIiYARkhzlxeAfvF5NlnKxkIMOZpQ46Lwj3tR0VWohKbrhS+cYKFlVuDi5XnDkx0XA==} + /@swc/core-linux-x64-musl@1.3.93: + resolution: {integrity: sha512-4B8lSRwEq1XYm6xhxHhvHmKAS7pUp1Q7E33NQ2TlmFhfKvCOh86qvThcjAOo57x8DRwmpvEVrqvpXtYagMN6Ig==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1370,17 +1329,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.62: - resolution: {integrity: sha512-zv14vlF2VRrxS061XkfzGjCYnOrEo5glKJjLK5PwUKysIoVrx/L8nAbFxjkX5cObdlyoqo+ekelyBPAO+4bS0w==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-arm64-msvc@1.3.70: - resolution: {integrity: sha512-hm4IBK/IaRil+aj1cWU6f0GyAdHpw/Jr5nyFYLM2c/tt7w2t5hgb8NjzM2iM84lOClrig1fG6edj2vCF1dFzNQ==} + /@swc/core-win32-arm64-msvc@1.3.93: + resolution: {integrity: sha512-BHShlxtkven8ZjjvZ5QR6sC5fZCJ9bMujEkiha6W4cBUTY7ce7qGFyHmQd+iPC85d9kD/0cCiX/Xez8u0BhO7w==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -1388,17 +1338,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.62: - resolution: {integrity: sha512-8MC/PZQSsOP2iA/81tAfNRqMWyEqTS/8zKUI67vPuLvpx6NAjRn3E9qBv7iFqH79iqZNzqSMo3awnLrKZyFbcw==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-ia32-msvc@1.3.70: - resolution: {integrity: sha512-5cgKUKIT/9Fp5fCA+zIjYCQ4dSvjFYOeWGZR3QiTXGkC4bGa1Ji9SEPyeIAX0iruUnKjYaZB9RvHK2tNn7RLrQ==} + /@swc/core-win32-ia32-msvc@1.3.93: + resolution: {integrity: sha512-nEwNWnz4JzYAK6asVvb92yeylfxMYih7eMQOnT7ZVlZN5ba9WF29xJ6kcQKs9HRH6MvWhz9+wRgv3FcjlU6HYA==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -1406,17 +1347,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.62: - resolution: {integrity: sha512-GJSmUJ95HKHZXAxiuPUmrcm/S3ivQvEzXhOZaIqYBIwUsm02vFZkClsV7eIKzWjso1t0+I/8MjrnUNaSWqh1rQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-x64-msvc@1.3.70: - resolution: {integrity: sha512-LE8lW46+TQBzVkn2mHBlk8DIElPIZ2dO5P8AbJiARNBAnlqQWu67l9gWM89UiZ2l33J2cI37pHzON3tKnT8f9g==} + /@swc/core-win32-x64-msvc@1.3.93: + resolution: {integrity: sha512-jibQ0zUr4kwJaQVwgmH+svS04bYTPnPw/ZkNInzxS+wFAtzINBYcU8s2PMWbDb2NGYiRSEeoSGyAvS9H+24JFA==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -1424,30 +1356,8 @@ packages: dev: true optional: true - /@swc/core@1.3.62: - resolution: {integrity: sha512-J58hWY+/G8vOr4J6ZH9hLg0lMSijZtqIIf4HofZezGog/pVX6sJyBJ40dZ1ploFkDIlWTWvJyqtpesBKS73gkQ==} - engines: {node: '>=10'} - requiresBuild: true - peerDependencies: - '@swc/helpers': ^0.5.0 - peerDependenciesMeta: - '@swc/helpers': - optional: true - optionalDependencies: - '@swc/core-darwin-arm64': 1.3.62 - '@swc/core-darwin-x64': 1.3.62 - '@swc/core-linux-arm-gnueabihf': 1.3.62 - '@swc/core-linux-arm64-gnu': 1.3.62 - '@swc/core-linux-arm64-musl': 1.3.62 - '@swc/core-linux-x64-gnu': 1.3.62 - '@swc/core-linux-x64-musl': 1.3.62 - '@swc/core-win32-arm64-msvc': 1.3.62 - '@swc/core-win32-ia32-msvc': 1.3.62 - '@swc/core-win32-x64-msvc': 1.3.62 - dev: true - - /@swc/core@1.3.70(@swc/helpers@0.5.1): - resolution: {integrity: sha512-LWVWlEDLlOD25PvA2NEz41UzdwXnlDyBiZbe69s3zM0DfCPwZXLUm79uSqH9ItsOjTrXSL5/1+XUL6C/BZwChA==} + /@swc/core@1.3.93(@swc/helpers@0.5.1): + resolution: {integrity: sha512-690GRr1wUGmGYZHk7fUduX/JUwViMF2o74mnZYIWEcJaCcd9MQfkhsxPBtjeg6tF+h266/Cf3RPYhsFBzzxXcA==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -1456,18 +1366,24 @@ packages: '@swc/helpers': optional: true dependencies: + '@swc/counter': 0.1.2 '@swc/helpers': 0.5.1 + '@swc/types': 0.1.5 optionalDependencies: - '@swc/core-darwin-arm64': 1.3.70 - '@swc/core-darwin-x64': 1.3.70 - '@swc/core-linux-arm-gnueabihf': 1.3.70 - '@swc/core-linux-arm64-gnu': 1.3.70 - '@swc/core-linux-arm64-musl': 1.3.70 - '@swc/core-linux-x64-gnu': 1.3.70 - '@swc/core-linux-x64-musl': 1.3.70 - '@swc/core-win32-arm64-msvc': 1.3.70 - '@swc/core-win32-ia32-msvc': 1.3.70 - '@swc/core-win32-x64-msvc': 1.3.70 + '@swc/core-darwin-arm64': 1.3.93 + '@swc/core-darwin-x64': 1.3.93 + '@swc/core-linux-arm-gnueabihf': 1.3.93 + '@swc/core-linux-arm64-gnu': 1.3.93 + '@swc/core-linux-arm64-musl': 1.3.93 + '@swc/core-linux-x64-gnu': 1.3.93 + '@swc/core-linux-x64-musl': 1.3.93 + '@swc/core-win32-arm64-msvc': 1.3.93 + '@swc/core-win32-ia32-msvc': 1.3.93 + '@swc/core-win32-x64-msvc': 1.3.93 + dev: true + + /@swc/counter@0.1.2: + resolution: {integrity: sha512-9F4ys4C74eSTEUNndnER3VJ15oru2NumfQxS8geE+f3eB5xvfxpWyqE5XlVnxb/R14uoXi6SLbBwwiDSkv+XEw==} dev: true /@swc/helpers@0.5.1: @@ -1476,17 +1392,21 @@ packages: tslib: 2.5.0 dev: true - /@swc/jest@0.2.26(@swc/core@1.3.62): + /@swc/jest@0.2.26(@swc/core@1.3.93): resolution: {integrity: sha512-7lAi7q7ShTO3E5Gt1Xqf3pIhRbERxR1DUxvtVa9WKzIB+HGQ7wZP5sYx86zqnaEoKKGhmOoZ7gyW0IRu8Br5+A==} engines: {npm: '>= 7.0.0'} peerDependencies: '@swc/core': '*' dependencies: '@jest/create-cache-key-function': 27.5.1 - '@swc/core': 1.3.62 + '@swc/core': 1.3.93(@swc/helpers@0.5.1) jsonc-parser: 3.2.0 dev: true + /@swc/types@0.1.5: + resolution: {integrity: sha512-myfUej5naTBWnqOCc/MdVOLVjXUXtIA+NpDrDBKJtLLg2shUjBu3cZmB/85RyitKc55+lUUyl7oRfLOvkr2hsw==} + dev: true + /@testing-library/dom@9.2.0: resolution: {integrity: sha512-xTEnpUKiV/bMyEsE5bT4oYA0x0Z/colMtxzUY8bKyPXBNLn/e0V4ZjBZkEhms0xE4pv9QsPfSRu9AWS4y5wGvA==} engines: {node: '>=14'} @@ -1586,18 +1506,34 @@ packages: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} dev: true + /@types/istanbul-lib-coverage@2.0.5: + resolution: {integrity: sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==} + dev: true + /@types/istanbul-lib-report@3.0.0: resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==} dependencies: '@types/istanbul-lib-coverage': 2.0.4 dev: true + /@types/istanbul-lib-report@3.0.2: + resolution: {integrity: sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.5 + dev: true + /@types/istanbul-reports@3.0.1: resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==} dependencies: '@types/istanbul-lib-report': 3.0.0 dev: true + /@types/istanbul-reports@3.0.3: + resolution: {integrity: sha512-1nESsePMBlf0RPRffLZi5ujYh7IH1BWL4y9pr+Bn3cJBdxz+RTP8bUFljLz9HvzhhOSWKdyBZ4DIivdL6rvgZg==} + dependencies: + '@types/istanbul-lib-report': 3.0.2 + dev: true + /@types/jest@29.5.2: resolution: {integrity: sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg==} dependencies: @@ -1677,10 +1613,14 @@ packages: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true - /@types/yargs@16.0.4: - resolution: {integrity: sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==} + /@types/yargs-parser@21.0.2: + resolution: {integrity: sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==} + dev: true + + /@types/yargs@16.0.7: + resolution: {integrity: sha512-lQcYmxWuOfJq4IncK88/nwud9rwr1F04CFc5xzk0k4oKVyz/AI35TfsXmhjf6t8zp8mpCOi17BfvuNWx+zrYkg==} dependencies: - '@types/yargs-parser': 21.0.0 + '@types/yargs-parser': 21.0.2 dev: true /@types/yargs@17.0.10: @@ -1985,6 +1925,11 @@ packages: engines: {node: '>=12'} dev: true + /ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + dev: true + /ansicolors@0.3.2: resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} dev: true @@ -2189,8 +2134,8 @@ packages: semver: 7.5.4 dev: true - /bunchee@3.6.0(typescript@5.1.3): - resolution: {integrity: sha512-aK8HjzNJ8UMopQArKgwmcfwuGQ5UAMEt786H1CQGXRaXcwlVDIwuibUc8OwFpchTkJK3Nrr3jOw/tb0ZJRBoMA==} + /bunchee@3.9.2(typescript@5.1.3): + resolution: {integrity: sha512-JTp5ko5oFE2m8jdbBEjkowj8jLDg8bShvly6ScDFDSqAMCDHEd8pEAF92OMt8IQPquaU0DOEBkpM0lqnv/vbyw==} engines: {node: '>= 16'} hasBin: true peerDependencies: @@ -2201,20 +2146,21 @@ packages: typescript: optional: true dependencies: - '@rollup/plugin-commonjs': 24.0.1(rollup@3.20.2) - '@rollup/plugin-json': 6.0.0(rollup@3.20.2) - '@rollup/plugin-node-resolve': 15.0.2(rollup@3.20.2) - '@rollup/plugin-replace': 5.0.2(rollup@3.20.2) - '@rollup/plugin-wasm': 6.1.3(rollup@3.20.2) - '@swc/core': 1.3.70(@swc/helpers@0.5.1) + '@rollup/plugin-commonjs': 25.0.7(rollup@3.29.4) + '@rollup/plugin-json': 6.0.0(rollup@3.29.4) + '@rollup/plugin-node-resolve': 15.2.3(rollup@3.29.4) + '@rollup/plugin-replace': 5.0.2(rollup@3.29.4) + '@rollup/plugin-wasm': 6.1.3(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@swc/core': 1.3.93(@swc/helpers@0.5.1) '@swc/helpers': 0.5.1 arg: 5.0.2 pretty-bytes: 5.6.0 - publint: 0.1.11 - rollup: 3.20.2 - rollup-plugin-dts: 5.3.0(rollup@3.20.2)(typescript@5.1.3) - rollup-plugin-swc3: 0.8.1(@swc/core@1.3.70)(rollup@3.20.2) - rollup-swc-preserve-directives: 0.3.1(@swc/core@1.3.70)(rollup@3.20.2) + publint: 0.2.5 + rollup: 3.29.4 + rollup-plugin-dts: 6.1.0(rollup@3.29.4)(typescript@5.1.3) + rollup-plugin-swc3: 0.10.3(@swc/core@1.3.93)(rollup@3.29.4) + rollup-swc-preserve-directives: 0.5.0(@swc/core@1.3.93)(rollup@3.29.4) tslib: 2.5.0 typescript: 5.1.3 dev: true @@ -2999,6 +2945,14 @@ packages: dev: true optional: true + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true @@ -3053,8 +3007,10 @@ packages: get-intrinsic: 1.1.3 dev: true - /get-tsconfig@4.2.0: - resolution: {integrity: sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==} + /get-tsconfig@4.7.2: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} + dependencies: + resolve-pkg-maps: 1.0.0 dev: true /glob-parent@5.1.2: @@ -3696,7 +3652,7 @@ packages: micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /jest-leak-detector@29.5.0: @@ -4172,14 +4128,14 @@ packages: resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} engines: {node: '>=12'} dependencies: - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /magic-string@0.30.0: - resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} + /magic-string@0.30.5: + resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} engines: {node: '>=12'} dependencies: - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /make-dir@3.1.0: @@ -4725,8 +4681,8 @@ packages: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true - /publint@0.1.11: - resolution: {integrity: sha512-sD0rtIEadks83MkpomJswBO/YHExJLkta1TyqUhb0/aVV+o3ZlVnwsDPjCAow8tpfxmLGutCSLWq32yfhPB98w==} + /publint@0.2.5: + resolution: {integrity: sha512-eoQiP0WXkxkpth1fMLoS1I/6BQoxKNZxTAAnFjPgURFrJulC5D5Uifk49a9kfNCYmcza9E/ZkbFhQQdjkmKAbg==} engines: {node: '>=16'} hasBin: true dependencies: @@ -4847,6 +4803,10 @@ packages: engines: {node: '>=8'} dev: true + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /resolve.exports@2.0.0: resolution: {integrity: sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg==} engines: {node: '>=10'} @@ -4902,51 +4862,52 @@ packages: glob: 10.2.6 dev: true - /rollup-plugin-dts@5.3.0(rollup@3.20.2)(typescript@5.1.3): - resolution: {integrity: sha512-8FXp0ZkyZj1iU5klkIJYLjIq/YZSwBoERu33QBDxm/1yw5UU4txrEtcmMkrq+ZiKu3Q4qvPCNqc3ovX6rjqzbQ==} - engines: {node: '>=v14'} + /rollup-plugin-dts@6.1.0(rollup@3.29.4)(typescript@5.1.3): + resolution: {integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==} + engines: {node: '>=16'} peerDependencies: - rollup: ^3.0.0 - typescript: ^4.1 || ^5.0 + rollup: ^3.29.4 || ^4 + typescript: ^4.5 || ^5.0 dependencies: - magic-string: 0.30.0 - rollup: 3.20.2 + magic-string: 0.30.5 + rollup: 3.29.4 typescript: 5.1.3 optionalDependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.22.13 dev: true - /rollup-plugin-swc3@0.8.1(@swc/core@1.3.70)(rollup@3.20.2): - resolution: {integrity: sha512-xoHRmrGamXrz4rNfmXiTNf/6pAYY2daFOJavVsrG/HvBgsoa8lx9rtas9XiqOl5DqD04tGn8MiUwarITOPyh8A==} + /rollup-plugin-swc3@0.10.3(@swc/core@1.3.93)(rollup@3.29.4): + resolution: {integrity: sha512-GWoMkm3ATumN8EPHBKLrpCufcRNn7SfLyvMKWUfCVLidPuPjlQZfNBeQXP6OEiHBguZzriCssX43EnV3+Y54bA==} engines: {node: '>=12'} peerDependencies: '@swc/core': '>=1.2.165' - rollup: ^2.0.0 || ^3.0.0 + rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 dependencies: '@fastify/deepmerge': 1.3.0 - '@rollup/pluginutils': 4.2.1 - '@swc/core': 1.3.70(@swc/helpers@0.5.1) - get-tsconfig: 4.2.0 - rollup: 3.20.2 + '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@swc/core': 1.3.93(@swc/helpers@0.5.1) + get-tsconfig: 4.7.2 + rollup: 3.29.4 + rollup-swc-preserve-directives: 0.5.0(@swc/core@1.3.93)(rollup@3.29.4) dev: true - /rollup-swc-preserve-directives@0.3.1(@swc/core@1.3.70)(rollup@3.20.2): - resolution: {integrity: sha512-bQvf3ROvWSQr8nj+6sz5Dix2BOBYrGfy9GXz6BFsP701GwmYEc2MKi6IFA5/7+4GLTSYWEfh1jE67VJmZ5842w==} + /rollup-swc-preserve-directives@0.5.0(@swc/core@1.3.93)(rollup@3.29.4): + resolution: {integrity: sha512-6lnPZn2laSsdYcdCSE28z4Dwg2mCN5loF+/wBjybh25GJmONjHTf3orWa5j1zjEWY3RcGRjJ8K/52ePqtfy6dw==} peerDependencies: - '@swc/core': '>=1.2.165' + '@swc/core': '>=1.3.79' rollup: ^2.0.0 || ^3.0.0 dependencies: '@napi-rs/magic-string': 0.3.4 - '@swc/core': 1.3.70(@swc/helpers@0.5.1) - rollup: 3.20.2 + '@swc/core': 1.3.93(@swc/helpers@0.5.1) + rollup: 3.29.4 dev: true - /rollup@3.20.2: - resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==} + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /run-parallel@1.2.0: @@ -5539,7 +5500,7 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} dependencies: - ansi-styles: 6.1.0 + ansi-styles: 6.2.1 string-width: 5.1.2 strip-ansi: 7.0.1 dev: true diff --git a/test/type/mutation.ts b/test/type/mutation.ts index 59590efe4..3ced723aa 100644 --- a/test/type/mutation.ts +++ b/test/type/mutation.ts @@ -1,6 +1,5 @@ -import useSWRMutation from 'swr/mutation' +import useSWRMutation, { type TriggerWithoutArgs } from 'swr/mutation' import { expectType } from './utils' -import type { TriggerWithoutArgs } from '../../mutation/src/types' export function useConfigMutation() { const { trigger } = useSWRMutation('key', k => k) diff --git a/tsconfig.json b/tsconfig.json index 08c535630..0ff84f26c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,17 +15,8 @@ "rootDir": "./", "strict": true, "target": "ES2018", - "baseUrl": ".", "noEmitOnError": true, "downlevelIteration": true, - "paths": { - "swr": ["./core/src/index.ts"], - "swr/infinite": ["./infinite/src/index.ts"], - "swr/immutable": ["./immutable/src/index.ts"], - "swr/mutation": ["./mutation/src/index.ts"], - "swr/_internal": ["./_internal/src/index.ts"], - "swr/subscription": ["subscription/src/index.ts"], - }, "incremental": true }, "exclude": ["./**/dist", "examples"],