From 720781e186fdb11e103b836b1c95a2c1334a7343 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 03:19:52 +0100 Subject: [PATCH 01/14] build: use new bundle convention --- _internal/package.json | 24 +- _internal/tsconfig.json | 7 - core/package.json | 1 - core/src/serialize.ts | 4 - core/tsconfig.json | 8 - core/src/env.d.ts => env.d.ts | 0 immutable/package.json | 23 +- immutable/tsconfig.json | 7 - infinite/package.json | 12 +- infinite/tsconfig.json | 7 - mutation/package.json | 23 +- mutation/tsconfig.json | 7 - package.json | 137 +++-- package.json.bak | 162 ++++++ pnpm-lock.yaml | 532 +++++++++++------- {_internal/src => src/_internal}/constants.ts | 0 {_internal/src => src/_internal}/events.ts | 0 .../_internal}/index.react-server.ts | 0 {_internal/src => src/_internal}/index.ts | 0 {_internal/src => src/_internal}/types.ts | 0 .../src => src/_internal}/utils/cache.ts | 0 .../_internal}/utils/config-context.ts | 0 .../src => src/_internal}/utils/config.ts | 0 .../src => src/_internal}/utils/devtools.ts | 0 {_internal/src => src/_internal}/utils/env.ts | 0 .../_internal}/utils/global-state.ts | 0 .../src => src/_internal}/utils/hash.ts | 0 .../src => src/_internal}/utils/helper.ts | 0 .../_internal}/utils/merge-config.ts | 0 .../_internal}/utils/middleware-preset.ts | 0 .../src => src/_internal}/utils/mutate.ts | 0 .../_internal}/utils/normalize-args.ts | 0 .../src => src/_internal}/utils/preload.ts | 0 .../_internal}/utils/resolve-args.ts | 0 .../src => src/_internal}/utils/serialize.ts | 0 .../src => src/_internal}/utils/shared.ts | 0 .../_internal}/utils/subscribe-key.ts | 0 .../src => src/_internal}/utils/timestamp.ts | 0 .../_internal}/utils/use-swr-config.ts | 0 .../src => src/_internal}/utils/web-preset.ts | 0 .../_internal}/utils/with-middleware.ts | 0 {core/src => src/core}/index.react-server.ts | 0 {core/src => src/core}/index.ts | 0 src/core/serialize.ts | 4 + {core/src => src/core}/use-swr.ts | 0 {immutable/src => src/immutable}/index.ts | 6 +- src/index.ts | 2 + .../infinite}/index.react-server.ts | 0 {infinite/src => src/infinite}/index.ts | 4 +- {infinite/src => src/infinite}/serialize.ts | 0 {infinite/src => src/infinite}/types.ts | 0 {mutation/src => src/mutation}/index.ts | 2 +- {mutation/src => src/mutation}/state.ts | 0 {mutation/src => src/mutation}/types.ts | 2 +- .../src => src/subscription}/index.ts | 4 +- .../src => src/subscription}/types.ts | 2 +- subscription/package.json | 23 +- subscription/tsconfig.json | 9 - tsconfig.json | 6 +- 59 files changed, 607 insertions(+), 411 deletions(-) delete mode 100644 _internal/tsconfig.json delete mode 100644 core/src/serialize.ts delete mode 100644 core/tsconfig.json rename core/src/env.d.ts => env.d.ts (100%) delete mode 100644 immutable/tsconfig.json delete mode 100644 infinite/tsconfig.json delete mode 100644 mutation/tsconfig.json create mode 100644 package.json.bak rename {_internal/src => src/_internal}/constants.ts (100%) rename {_internal/src => src/_internal}/events.ts (100%) rename {_internal/src => src/_internal}/index.react-server.ts (100%) rename {_internal/src => src/_internal}/index.ts (100%) rename {_internal/src => src/_internal}/types.ts (100%) rename {_internal/src => src/_internal}/utils/cache.ts (100%) rename {_internal/src => src/_internal}/utils/config-context.ts (100%) rename {_internal/src => src/_internal}/utils/config.ts (100%) rename {_internal/src => src/_internal}/utils/devtools.ts (100%) rename {_internal/src => src/_internal}/utils/env.ts (100%) rename {_internal/src => src/_internal}/utils/global-state.ts (100%) rename {_internal/src => src/_internal}/utils/hash.ts (100%) rename {_internal/src => src/_internal}/utils/helper.ts (100%) rename {_internal/src => src/_internal}/utils/merge-config.ts (100%) rename {_internal/src => src/_internal}/utils/middleware-preset.ts (100%) rename {_internal/src => src/_internal}/utils/mutate.ts (100%) rename {_internal/src => src/_internal}/utils/normalize-args.ts (100%) rename {_internal/src => src/_internal}/utils/preload.ts (100%) rename {_internal/src => src/_internal}/utils/resolve-args.ts (100%) rename {_internal/src => src/_internal}/utils/serialize.ts (100%) rename {_internal/src => src/_internal}/utils/shared.ts (100%) rename {_internal/src => src/_internal}/utils/subscribe-key.ts (100%) rename {_internal/src => src/_internal}/utils/timestamp.ts (100%) rename {_internal/src => src/_internal}/utils/use-swr-config.ts (100%) rename {_internal/src => src/_internal}/utils/web-preset.ts (100%) rename {_internal/src => src/_internal}/utils/with-middleware.ts (100%) rename {core/src => src/core}/index.react-server.ts (100%) rename {core/src => src/core}/index.ts (100%) create mode 100644 src/core/serialize.ts rename {core/src => src/core}/use-swr.ts (100%) rename {immutable/src => src/immutable}/index.ts (75%) create mode 100644 src/index.ts rename {infinite/src => src/infinite}/index.react-server.ts (100%) rename {infinite/src => src/infinite}/index.ts (99%) rename {infinite/src => src/infinite}/serialize.ts (100%) rename {infinite/src => src/infinite}/types.ts (100%) rename {mutation/src => src/mutation}/index.ts (99%) rename {mutation/src => src/mutation}/state.ts (100%) rename {mutation/src => src/mutation}/types.ts (99%) rename {subscription/src => src/subscription}/index.ts (98%) rename {subscription/src => src/subscription}/types.ts (92%) delete mode 100644 subscription/tsconfig.json diff --git a/_internal/package.json b/_internal/package.json index adbbf94f0..701e9f74d 100644 --- a/_internal/package.json +++ b/_internal/package.json @@ -1,22 +1,6 @@ { - "main": "./dist/index.js", - "module": "./dist/index.esm.js", - "types": "./dist/index.d.ts", - "exports": { - "react-server": "./dist/react-server.mjs", - "import": "./dist/index.mjs", - "module": "./dist/index.esm.js", - "require": "./dist/index.js" - }, - "private": true, - "scripts": { - "watch": "bunchee -w", - "build": "bunchee", - "types:check": "tsc --noEmit", - "clean": "rimraf dist" - }, - "peerDependencies": { - "swr": "*", - "react": "*" - } + "main": "../dist/_internal/index.js", + "module": "../dist/_internal/index.esm.js", + "types": "../dist/_internal/index.d.ts", + "private": true } diff --git a/_internal/tsconfig.json b/_internal/tsconfig.json deleted file mode 100644 index 51ed51cbe..000000000 --- a/_internal/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "./dist" - }, - "include": ["./src"] -} \ No newline at end of file diff --git a/core/package.json b/core/package.json index 568577875..e26f203e4 100644 --- a/core/package.json +++ b/core/package.json @@ -3,7 +3,6 @@ "module": "./dist/index.esm.js", "types": "./dist/index.d.ts", "exports": { - "react-server": "./dist/react-server.mjs", "import": "./dist/index.mjs", "module": "./dist/index.esm.js", "require": "./dist/index.js" diff --git a/core/src/serialize.ts b/core/src/serialize.ts deleted file mode 100644 index 98e0d86d7..000000000 --- a/core/src/serialize.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Key } from 'swr/_internal' -import { serialize } from 'swr/_internal' - -export const unstable_serialize = (key: Key) => serialize(key)[0] diff --git a/core/tsconfig.json b/core/tsconfig.json deleted file mode 100644 index 83c08aa30..000000000 --- a/core/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "rootDir": "..", - "outDir": "./dist" - }, - "include": ["./**/*.ts"] -} \ No newline at end of file diff --git a/core/src/env.d.ts b/env.d.ts similarity index 100% rename from core/src/env.d.ts rename to env.d.ts diff --git a/immutable/package.json b/immutable/package.json index 67883a9e9..f135ab3eb 100644 --- a/immutable/package.json +++ b/immutable/package.json @@ -1,21 +1,6 @@ { - "main": "./dist/index.js", - "module": "./dist/index.esm.js", - "types": "./dist/index.d.ts", - "exports": { - "import": "./dist/index.mjs", - "module": "./dist/index.esm.js", - "require": "./dist/index.js" - }, - "private": true, - "scripts": { - "watch": "bunchee -w", - "build": "bunchee", - "types:check": "tsc --noEmit", - "clean": "rimraf dist" - }, - "peerDependencies": { - "swr": "*", - "react": "*" - } + "main": "../dist/immutable/index.js", + "module": "../dist/immutable/index.esm.js", + "types": "../dist/immutable/index.d.ts", + "private": true } diff --git a/immutable/tsconfig.json b/immutable/tsconfig.json deleted file mode 100644 index 51ed51cbe..000000000 --- a/immutable/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "./dist" - }, - "include": ["./src"] -} \ No newline at end of file diff --git a/infinite/package.json b/infinite/package.json index 86a7c70c3..87a004cba 100644 --- a/infinite/package.json +++ b/infinite/package.json @@ -1,13 +1,7 @@ { - "main": "./dist/index.js", - "module": "./dist/index.esm.js", - "types": "./dist/index.d.ts", - "exports": { - "react-server": "./dist/react-server.mjs", - "import": "./dist/index.mjs", - "module": "./dist/index.esm.js", - "require": "./dist/index.js" - }, + "main": "../dist/infinite/index.js", + "module": "../dist/infinite/index.esm.js", + "types": "../dist/infinite/index.d.ts", "private": true, "scripts": { "watch": "bunchee -w", diff --git a/infinite/tsconfig.json b/infinite/tsconfig.json deleted file mode 100644 index 51ed51cbe..000000000 --- a/infinite/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "./dist" - }, - "include": ["./src"] -} \ No newline at end of file diff --git a/mutation/package.json b/mutation/package.json index 67883a9e9..8d59d1a41 100644 --- a/mutation/package.json +++ b/mutation/package.json @@ -1,21 +1,6 @@ { - "main": "./dist/index.js", - "module": "./dist/index.esm.js", - "types": "./dist/index.d.ts", - "exports": { - "import": "./dist/index.mjs", - "module": "./dist/index.esm.js", - "require": "./dist/index.js" - }, - "private": true, - "scripts": { - "watch": "bunchee -w", - "build": "bunchee", - "types:check": "tsc --noEmit", - "clean": "rimraf dist" - }, - "peerDependencies": { - "swr": "*", - "react": "*" - } + "main": "../dist/mutation/index.js", + "module": "../dist/mutation/index.esm.js", + "types": "../dist/mutation/index.d.ts", + "private": true } diff --git a/mutation/tsconfig.json b/mutation/tsconfig.json deleted file mode 100644 index 1f5b2f697..000000000 --- a/mutation/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "./dist" - }, - "include": ["./src"] -} diff --git a/package.json b/package.json index d1d8a5cea..39196cc9b 100644 --- a/package.json +++ b/package.json @@ -11,74 +11,103 @@ "fetch" ], "packageManager": "pnpm@8.4.0", - "main": "./core/dist/index.js", - "module": "./core/dist/index.esm.js", - "types": "./core/dist/index.d.ts", - "typesVersions": { - "*": { - "infinite": [ - "./infinite/dist/index.d.ts" - ], - "immutable": [ - "./immutable/dist/index.d.ts" - ], - "mutation": [ - "./mutation/dist/index.d.ts" - ], - "subscription": [ - "./subscription/dist/index.d.ts" - ] - } - }, + "main": "./dist/core/index.js", + "module": "./dist/core/index.esm.js", + "types": "./dist/core/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "react-server": "./core/dist/react-server.mjs", - "import": "./core/dist/index.mjs", - "module": "./core/dist/index.esm.js", - "require": "./core/dist/index.js" + "import": { + "types": "./dist/core/index.d.mts", + "default": "./dist/core/index.mjs" + }, + "module": { + "types": "./dist/core/index.d.mts", + "default": "./dist/core/index.esm.js" + }, + "require": { + "types": "./dist/core/index.d.ts", + "default": "./dist/core/index.js" + } }, "./infinite": { - "react-server": "./infinite/dist/react-server.mjs", - "import": "./infinite/dist/index.mjs", - "module": "./infinite/dist/index.esm.js", - "require": "./infinite/dist/index.js" + "import": { + "types": "./dist/infinite/index.d.mts", + "default": "./dist/infinite/index.mjs" + }, + "module": { + "types": "./dist/infinite/index.d.mts", + "default": "./dist/infinite/index.esm.js" + }, + "require": { + "types": "./dist/infinite/index.d.ts", + "default": "./dist/infinite/index.js" + } }, "./immutable": { - "import": "./immutable/dist/index.mjs", - "module": "./immutable/dist/index.esm.js", - "require": "./immutable/dist/index.js" + "import": { + "types": "./dist/immutable/index.d.mts", + "default": "./dist/immutable/index.mjs" + }, + "module": { + "types": "./dist/immutable/index.d.mts", + "default": "./dist/immutable/index.esm.js" + }, + "require": { + "types": "./dist/immutable/index.d.ts", + "default": "./dist/immutable/index.js" + } }, "./subscription": { - "import": "./subscription/dist/index.mjs", - "module": "./subscription/dist/index.esm.js", - "require": "./subscription/dist/index.js" + "import": { + "types": "./dist/subscription/index.d.mts", + "default": "./dist/subscription/index.mjs" + }, + "module": { + "types": "./dist/subscription/index.d.mts", + "default": "./dist/subscription/index.esm.js" + }, + "require": { + "types": "./dist/subscription/index.d.ts", + "default": "./dist/subscription/index.js" + } }, "./mutation": { - "import": "./mutation/dist/index.mjs", - "module": "./mutation/dist/index.esm.js", - "require": "./mutation/dist/index.js" + "import": { + "types": "./dist/mutation/index.d.mts", + "default": "./dist/mutation/index.mjs" + }, + "module": { + "types": "./dist/mutation/index.d.mts", + "default": "./dist/mutation/index.esm.js" + }, + "require": { + "types": "./dist/mutation/index.d.ts", + "default": "./dist/mutation/index.js" + } }, "./_internal": { - "react-server": "./_internal/dist/react-server.mjs", - "import": "./_internal/dist/index.mjs", - "module": "./_internal/dist/index.esm.js", - "require": "./_internal/dist/index.js" + "import": { + "types": "./dist/_internal/index.d.mts", + "default": "./dist/_internal/index.mjs" + }, + "module": { + "types": "./dist/_internal/index.d.mts", + "default": "./dist/_internal/index.esm.js" + }, + "require": { + "types": "./dist/_internal/index.d.ts", + "default": "./dist/_internal/index.js" + } } }, "files": [ - "core/dist/**/*.{js,d.ts,mjs,d.mts}", - "infinite/dist/**/*.{js,d.ts,mjs,d.mts}", - "immutable/dist/**/*.{js,d.ts,mjs,d.mts}", - "mutation/dist/**/*.{js,d.ts,mjs,d.mts}", - "_internal/dist/**/*.{js,d.ts,mjs,d.mts}", - "subscription/dist/*.{js,d.ts,mjs,d.mts}", - "core/package.json", - "infinite/package.json", - "immutable/package.json", - "mutation/package.json", - "_internal/package.json", - "subscription/package.json" + "dist", + "infinite", + "immutable", + "subscription", + "mutation", + "_internal" ], "repository": "github:vercel/swr", "homepage": "https://swr.vercel.app", @@ -89,7 +118,7 @@ "csb:build": "pnpm build", "clean": "pnpm -r run clean && rimraf playwright-report test-result", "watch": "pnpm -r run watch", - "build": "pnpm build-package _internal && pnpm build-package core && pnpm build-package infinite && pnpm build-package immutable && pnpm build-package mutation && pnpm build-package subscription", + "build": "bunchee", "build:e2e": "pnpm next build e2e/site", "build-package": "bunchee --cwd", "attw": "attw --pack", @@ -126,7 +155,7 @@ "@types/use-sync-external-store": "^0.0.3", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.59.8", - "bunchee": "3.9.2", + "bunchee": "4.2.9", "eslint": "8.42.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-jest-dom": "5.0.1", diff --git a/package.json.bak b/package.json.bak new file mode 100644 index 000000000..327d5ec1f --- /dev/null +++ b/package.json.bak @@ -0,0 +1,162 @@ +{ + "name": "swr", + "version": "2.2.4", + "description": "React Hooks library for remote data fetching", + "keywords": [ + "swr", + "react", + "hooks", + "request", + "cache", + "fetch" + ], + "packageManager": "pnpm@8.4.0", + "main": "./core/dist/index.js", + "module": "./core/dist/index.esm.js", + "types": "./core/dist/index.d.ts", + "typesVersions": { + "*": { + "infinite": [ + "./infinite/dist/index.d.ts" + ], + "immutable": [ + "./immutable/dist/index.d.ts" + ], + "mutation": [ + "./mutation/dist/index.d.ts" + ], + "subscription": [ + "./subscription/dist/index.d.ts" + ] + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": "./core/dist/index.mjs", + "module": "./core/dist/index.esm.js", + "require": "./core/dist/index.js" + }, + "./infinite": { + "import": "./infinite/dist/index.mjs", + "module": "./infinite/dist/index.esm.js", + "require": "./infinite/dist/index.js" + }, + "./immutable": { + "import": "./immutable/dist/index.mjs", + "module": "./immutable/dist/index.esm.js", + "require": "./immutable/dist/index.js" + }, + "./subscription": { + "import": "./subscription/dist/index.mjs", + "module": "./subscription/dist/index.esm.js", + "require": "./subscription/dist/index.js" + }, + "./mutation": { + "import": "./mutation/dist/index.mjs", + "module": "./mutation/dist/index.esm.js", + "require": "./mutation/dist/index.js" + }, + "./_internal": { + "import": "./_internal/dist/index.mjs", + "module": "./_internal/dist/index.esm.js", + "require": "./_internal/dist/index.js" + } + }, + "files": [ + "core/dist/**/*.{js,d.ts,mjs,d.mts}", + "infinite/dist/**/*.{js,d.ts,mjs,d.mts}", + "immutable/dist/**/*.{js,d.ts,mjs,d.mts}", + "mutation/dist/**/*.{js,d.ts,mjs,d.mts}", + "_internal/dist/**/*.{js,d.ts,mjs,d.mts}", + "subscription/dist/*.{js,d.ts,mjs,d.mts}", + "core/package.json", + "infinite/package.json", + "immutable/package.json", + "mutation/package.json", + "_internal/package.json", + "subscription/package.json" + ], + "repository": "github:vercel/swr", + "homepage": "https://swr.vercel.app", + "license": "MIT", + "scripts": { + "prepare": "husky install", + "csb:install": "corepack enable && corepack pnpm i", + "csb:build": "pnpm build", + "clean": "pnpm -r run clean && rimraf playwright-report test-result", + "watch": "pnpm -r run watch", + "build": "pnpm build-package _internal && pnpm build-package core && pnpm build-package infinite && pnpm build-package immutable && pnpm build-package mutation && pnpm build-package subscription", + "build:e2e": "pnpm next build e2e/site", + "build-package": "bunchee --cwd", + "attw": "attw --pack", + "types:check": "pnpm -r run types:check", + "prepublishOnly": "pnpm clean && pnpm build", + "publish-beta": "pnpm publish --tag beta", + "format": "prettier --write ./**/*.{ts,tsx}", + "lint": "eslint . --ext .ts,.tsx --cache", + "lint:fix": "pnpm lint --fix", + "coverage": "jest --coverage", + "test-typing": "tsc --noEmit -p test/type/tsconfig.json && tsc --noEmit -p test/tsconfig.json", + "test": "jest", + "test:build": "jest --config jest.config.build.js", + "test:e2e": "playwright test", + "run-all-checks": "pnpm types:check && pnpm lint && pnpm test-typing" + }, + "lint-staged": { + "*.{ts,tsx}": [ + "eslint --fix --cache", + "prettier --write" + ] + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.7.0", + "@playwright/test": "^1.34.3", + "@swc/core": "^1.3.62", + "@swc/jest": "0.2.26", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^14.0.0", + "@type-challenges/utils": "0.1.1", + "@types/jest": "^29.5.2", + "@types/node": "^20.2.5", + "@types/react": "^18.2.8", + "@types/use-sync-external-store": "^0.0.3", + "@typescript-eslint/eslint-plugin": "5.59.8", + "@typescript-eslint/parser": "5.59.8", + "bunchee": "4.2.9", + "eslint": "8.42.0", + "eslint-config-prettier": "8.8.0", + "eslint-plugin-jest-dom": "5.0.1", + "eslint-plugin-react": "7.32.2", + "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-testing-library": "5.11.0", + "husky": "8.0.3", + "jest": "29.5.0", + "jest-environment-jsdom": "29.5.0", + "lint-staged": "13.2.2", + "next": "^13.4.4", + "prettier": "2.8.8", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-error-boundary": "^4.0.9", + "rimraf": "5.0.1", + "semver": "^7.5.1", + "swr": "workspace:*", + "typescript": "5.1.3" + }, + "peerDependencies": { + "react": "^16.11.0 || ^17.0.0 || ^18.0.0" + }, + "prettier": { + "tabWidth": 2, + "semi": false, + "useTabs": false, + "singleQuote": true, + "arrowParens": "avoid", + "trailingComma": "none" + }, + "dependencies": { + "client-only": "^0.0.1", + "use-sync-external-store": "^1.2.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3d08ff49..934cbfaac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,7 +19,7 @@ importers: version: 1.34.3 '@swc/core': specifier: ^1.3.62 - version: 1.3.93(@swc/helpers@0.5.1) + version: 1.3.93 '@swc/jest': specifier: 0.2.26 version: 0.2.26(@swc/core@1.3.93) @@ -51,8 +51,8 @@ importers: specifier: 5.59.8 version: 5.59.8(eslint@8.42.0)(typescript@5.1.3) bunchee: - specifier: 3.9.2 - version: 3.9.2(typescript@5.1.3) + specifier: 4.2.9 + version: 4.2.9(typescript@5.1.3) eslint: specifier: 8.42.0 version: 8.42.0 @@ -900,142 +900,6 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@napi-rs/magic-string-android-arm-eabi@0.3.4: - resolution: {integrity: sha512-sszAYxqtzzJ4FDerDNHcqL9NhqPhj8W4DNiOanXYy50mA5oojlRtaAFPiB5ZMrWDBM32v5Q30LrmxQ4eTtu2Dg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-android-arm64@0.3.4: - resolution: {integrity: sha512-jdQ6HuO0X5rkX4MauTcWR4HWdgjakTOmmzqXg8L26+jOHVVG1LZE+Su5qvV4bP8vMb2h+vPE+JsnwqSmWymu3Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-darwin-arm64@0.3.4: - resolution: {integrity: sha512-6NmMtvURce9/oq09XBZmuIeI6lPLGtEJ2ZPO/QzL3nLZa6wygiCnO/sFACKYNg5/73ET5HMMTeuogE1JI+r2Lw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-darwin-x64@0.3.4: - resolution: {integrity: sha512-f9LmfMiUAKDOtl0meOuLYeVb6OERrgGzrTg1Tn3R3fTAShM2kxRbfAuPE9ljuXxIFzOv/uqRNLSl/LqCJwpREA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-freebsd-x64@0.3.4: - resolution: {integrity: sha512-rqduQ4odiDK4QdM45xHWRTU4wtFIfpp8g8QGpz+3qqg7ivldDqbbNOrBaf6Oeu77uuEvWggnkyuChotfKgJdJQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-linux-arm-gnueabihf@0.3.4: - resolution: {integrity: sha512-pVaJEdEpiPqIfq3M4+yMAATS7Z9muDcWYn8H7GFH1ygh8GwgLgKfy/n/lG2M6zp18Mwd0x7E2E/qg9GgCyUzoQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-linux-arm64-gnu@0.3.4: - resolution: {integrity: sha512-9FwoAih/0tzEZx0BjYYIxWkSRMjonIn91RFM3q3MBs/evmThXUYXUqLNa1PPIkK1JoksswtDi48qWWLt8nGflQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-linux-arm64-musl@0.3.4: - resolution: {integrity: sha512-wCR7R+WPOcAKmVQc1s6h6HwfwW1vL9pM8BjUY9Ljkdb8wt1LmZEmV2Sgfc1SfbRQzbyl+pKeufP6adRRQVzYDA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-linux-x64-gnu@0.3.4: - resolution: {integrity: sha512-sbxFDpYnt5WFbxQ1xozwOvh5A7IftqSI0WnE9O7KsQIOi0ej2dvFbfOW4tmFkvH/YP8KJELo5AhP2+kEq1DpYA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-linux-x64-musl@0.3.4: - resolution: {integrity: sha512-jN4h/7e2Ul8v3UK5IZu38NXLMdzVWhY4uEDlnwuUAhwRh26wBQ1/pLD97Uy/Z3dFNBQPcsv60XS9fOM1YDNT6w==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-win32-arm64-msvc@0.3.4: - resolution: {integrity: sha512-gMUyTRHLWpzX2ntJFCbW2Gnla9Y/WUmbkZuW5SBAo/Jo8QojHn76Y4PNgnoXdzcsV9b/45RBxurYKAfFg9WTyg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-win32-ia32-msvc@0.3.4: - resolution: {integrity: sha512-QIMauMOvEHgL00K9np/c9CT/CRtLOz3mRTQqcZ9XGzSoAMrpxH71KSpDJrKl7h7Ro6TZ+hJ0C3T+JVuTCZNv4A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string-win32-x64-msvc@0.3.4: - resolution: {integrity: sha512-V8FMSf828MzOI3P6/765MR7zHU6CUZqiyPhmAnwYoKFNxfv7oCviN/G6NcENeCdcYOvNgh5fYzaNLB96ndId5A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@napi-rs/magic-string@0.3.4: - resolution: {integrity: sha512-DEWl/B99RQsyMT3F9bvrXuhL01/eIQp/dtNSE3G1jQ4mTGRcP4iHWxoPZ577WrbjUinrNgvRA5+08g8fkPgimQ==} - engines: {node: '>= 10'} - optionalDependencies: - '@napi-rs/magic-string-android-arm-eabi': 0.3.4 - '@napi-rs/magic-string-android-arm64': 0.3.4 - '@napi-rs/magic-string-darwin-arm64': 0.3.4 - '@napi-rs/magic-string-darwin-x64': 0.3.4 - '@napi-rs/magic-string-freebsd-x64': 0.3.4 - '@napi-rs/magic-string-linux-arm-gnueabihf': 0.3.4 - '@napi-rs/magic-string-linux-arm64-gnu': 0.3.4 - '@napi-rs/magic-string-linux-arm64-musl': 0.3.4 - '@napi-rs/magic-string-linux-x64-gnu': 0.3.4 - '@napi-rs/magic-string-linux-x64-musl': 0.3.4 - '@napi-rs/magic-string-win32-arm64-msvc': 0.3.4 - '@napi-rs/magic-string-win32-ia32-msvc': 0.3.4 - '@napi-rs/magic-string-win32-x64-msvc': 0.3.4 - dev: true - /@next/env@13.4.4: resolution: {integrity: sha512-q/y7VZj/9YpgzDe64Zi6rY1xPizx80JjlU2BTevlajtaE3w1LqweH1gGgxou2N7hdFosXHjGrI4OUvtFXXhGLg==} dev: true @@ -1160,7 +1024,7 @@ packages: fsevents: 2.3.2 dev: true - /@rollup/plugin-commonjs@25.0.7(rollup@3.29.4): + /@rollup/plugin-commonjs@25.0.7(rollup@4.9.1): resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1169,29 +1033,42 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 magic-string: 0.30.5 - rollup: 3.29.4 + rollup: 4.9.1 dev: true - /@rollup/plugin-json@6.0.0(rollup@3.29.4): - resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} + /@rollup/plugin-esm-shim@0.1.5(rollup@4.9.1): + resolution: {integrity: sha512-xnIjDm/0EbqAw0/rR1UE7eAo9db0ftGPqT8RUCFtkFxtCuspbbmj+wutoyxm32jBytyO3SgkxSG17OR893fV7A==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 + rollup: ^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) - rollup: 3.29.4 + magic-string: 0.30.5 + rollup: 4.9.1 dev: true - /@rollup/plugin-node-resolve@15.2.3(rollup@3.29.4): + /@rollup/plugin-json@6.1.0(rollup@4.9.1): + resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + rollup: 4.9.1 + dev: true + + /@rollup/plugin-node-resolve@15.2.3(rollup@4.9.1): resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1200,43 +1077,44 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) '@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.29.4 + rollup: 4.9.1 dev: true - /@rollup/plugin-replace@5.0.2(rollup@3.29.4): - resolution: {integrity: sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==} + /@rollup/plugin-replace@5.0.5(rollup@4.9.1): + resolution: {integrity: sha512-rYO4fOi8lMaTg/z5Jb+hKnrHHVn8j2lwkqwyS4kTRhKyWOLf2wST2sWXr4WzWiTcoHTp2sTjqUbqIj2E39slKQ==} 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 dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) - magic-string: 0.27.0 - rollup: 3.29.4 + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + magic-string: 0.30.5 + rollup: 4.9.1 dev: true - /@rollup/plugin-wasm@6.1.3(rollup@3.29.4): - resolution: {integrity: sha512-7ItTTeyauE6lwdDtQWceEHZ9+txbi4RRy0mYPFn9BW7rD7YdgBDu7HTHsLtHrRzJc313RM/1m6GKgV3np/aEaw==} + /@rollup/plugin-wasm@6.2.2(rollup@4.9.1): + resolution: {integrity: sha512-gpC4R1G9Ni92ZIRTexqbhX7U+9estZrbhP+9SRb0DW9xpB9g7j34r+J2hqrcW/lRI7dJaU84MxZM0Rt82tqYPQ==} 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 dependencies: - rollup: 3.29.4 + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + rollup: 4.9.1 dev: true - /@rollup/pluginutils@5.0.5(rollup@3.29.4): - resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} + /@rollup/pluginutils@5.1.0(rollup@4.9.1): + resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -1247,8 +1125,112 @@ packages: '@types/estree': 1.0.0 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.29.4 + rollup: 4.9.1 + dev: true + + /@rollup/rollup-android-arm-eabi@4.9.1: + resolution: {integrity: sha512-6vMdBZqtq1dVQ4CWdhFwhKZL6E4L1dV6jUjuBvsavvNJSppzi6dLBbuV+3+IyUREaj9ZFvQefnQm28v4OCXlig==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64@4.9.1: + resolution: {integrity: sha512-Jto9Fl3YQ9OLsTDWtLFPtaIMSL2kwGyGoVCmPC8Gxvym9TCZm4Sie+cVeblPO66YZsYH8MhBKDMGZ2NDxuk/XQ==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64@4.9.1: + resolution: {integrity: sha512-LtYcLNM+bhsaKAIGwVkh5IOWhaZhjTfNOkGzGqdHvhiCUVuJDalvDxEdSnhFzAn+g23wgsycmZk1vbnaibZwwA==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64@4.9.1: + resolution: {integrity: sha512-KyP/byeXu9V+etKO6Lw3E4tW4QdcnzDG/ake031mg42lob5tN+5qfr+lkcT/SGZaH2PdW4Z1NX9GHEkZ8xV7og==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.9.1: + resolution: {integrity: sha512-Yqz/Doumf3QTKplwGNrCHe/B2p9xqDghBZSlAY0/hU6ikuDVQuOUIpDP/YcmoT+447tsZTmirmjgG3znvSCR0Q==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.9.1: + resolution: {integrity: sha512-u3XkZVvxcvlAOlQJ3UsD1rFvLWqu4Ef/Ggl40WAVCuogf4S1nJPHh5RTgqYFpCOvuGJ7H5yGHabjFKEZGExk5Q==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl@4.9.1: + resolution: {integrity: sha512-0XSYN/rfWShW+i+qjZ0phc6vZ7UWI8XWNz4E/l+6edFt+FxoEghrJHjX1EY/kcUGCnZzYYRCl31SNdfOi450Aw==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu@4.9.1: + resolution: {integrity: sha512-LmYIO65oZVfFt9t6cpYkbC4d5lKHLYv5B4CSHRpnANq0VZUQXGcCPXHzbCXCz4RQnx7jvlYB1ISVNCE/omz5cw==} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.9.1: + resolution: {integrity: sha512-kr8rEPQ6ns/Lmr/hiw8sEVj9aa07gh1/tQF2Y5HrNCCEPiCBGnBUt9tVusrcBBiJfIt1yNaXN6r1CCmpbFEDpg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.9.1: + resolution: {integrity: sha512-t4QSR7gN+OEZLG0MiCgPqMWZGwmeHhsM4AkegJ0Kiy6TnJ9vZ8dEIwHw1LcZKhbHxTY32hp9eVCMdR3/I8MGRw==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.9.1: + resolution: {integrity: sha512-7XI4ZCBN34cb+BH557FJPmh0kmNz2c25SCQeT9OiFWEgf8+dL6ZwJ8f9RnUIit+j01u07Yvrsuu1rZGxJCc51g==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.9.1: + resolution: {integrity: sha512-yE5c2j1lSWOH5jp+Q0qNL3Mdhr8WuqCNVjc6BxbVfS5cAS6zRmdiw7ktb8GNpDCEUJphILY6KACoFoRtKoqNQg==} + cpu: [ia32] + os: [win32] + requiresBuild: true dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.9.1: + resolution: {integrity: sha512-PyJsSsafjmIhVgaI1Zdj7m8BB8mMckFah/xbpplObyHfiXzKcI5UOUXRyOdHW7nz4DpMCuzLnF7v5IWHenCwYA==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true /@sinclair/typebox@0.25.21: resolution: {integrity: sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g==} @@ -1266,6 +1248,15 @@ packages: '@sinonjs/commons': 2.0.0 dev: true + /@swc/core-darwin-arm64@1.3.101: + resolution: {integrity: sha512-mNFK+uHNPRXSnfTOG34zJOeMl2waM4hF4a2NY7dkMXrPqw9CoJn4MwTXJcyMiSz1/BnNjjTCHF3Yhj0jPxmkzQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@swc/core-darwin-arm64@1.3.93: resolution: {integrity: sha512-gEKgk7FVIgltnIfDO6GntyuQBBlAYg5imHpRgLxB1zSI27ijVVkksc6QwISzFZAhKYaBWIsFSVeL9AYSziAF7A==} engines: {node: '>=10'} @@ -1275,6 +1266,15 @@ packages: dev: true optional: true + /@swc/core-darwin-x64@1.3.101: + resolution: {integrity: sha512-B085j8XOx73Fg15KsHvzYWG262bRweGr3JooO1aW5ec5pYbz5Ew9VS5JKYS03w2UBSxf2maWdbPz2UFAxg0whw==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@swc/core-darwin-x64@1.3.93: resolution: {integrity: sha512-ZQPxm/fXdDQtn3yrYSL/gFfA8OfZ5jTi33yFQq6vcg/Y8talpZ+MgdSlYM0FkLrZdMTYYTNFiuBQuuvkA+av+Q==} engines: {node: '>=10'} @@ -1284,6 +1284,15 @@ packages: dev: true optional: true + /@swc/core-linux-arm-gnueabihf@1.3.101: + resolution: {integrity: sha512-9xLKRb6zSzRGPqdz52Hy5GuB1lSjmLqa0lST6MTFads3apmx4Vgs8Y5NuGhx/h2I8QM4jXdLbpqQlifpzTlSSw==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-arm-gnueabihf@1.3.93: resolution: {integrity: sha512-OYFMMI2yV+aNe3wMgYhODxHdqUB/jrK0SEMHHS44GZpk8MuBXEF+Mcz4qjkY5Q1EH7KVQqXb/gVWwdgTHpjM2A==} engines: {node: '>=10'} @@ -1293,6 +1302,15 @@ packages: dev: true optional: true + /@swc/core-linux-arm64-gnu@1.3.101: + resolution: {integrity: sha512-oE+r1lo7g/vs96Weh2R5l971dt+ZLuhaUX+n3BfDdPxNHfObXgKMjO7E+QS5RbGjv/AwiPCxQmbdCp/xN5ICJA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-arm64-gnu@1.3.93: resolution: {integrity: sha512-BT4dT78odKnJMNiq5HdjBsv29CiIdcCcImAPxeFqAeFw1LL6gh9nzI8E96oWc+0lVT5lfhoesCk4Qm7J6bty8w==} engines: {node: '>=10'} @@ -1302,6 +1320,15 @@ packages: dev: true optional: true + /@swc/core-linux-arm64-musl@1.3.101: + resolution: {integrity: sha512-OGjYG3H4BMOTnJWJyBIovCez6KiHF30zMIu4+lGJTCrxRI2fAjGLml3PEXj8tC3FMcud7U2WUn6TdG0/te2k6g==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-arm64-musl@1.3.93: resolution: {integrity: sha512-yH5fWEl1bktouC0mhh0Chuxp7HEO4uCtS/ly1Vmf18gs6wZ8DOOkgAEVv2dNKIryy+Na++ljx4Ym7C8tSJTrLw==} engines: {node: '>=10'} @@ -1311,6 +1338,15 @@ packages: dev: true optional: true + /@swc/core-linux-x64-gnu@1.3.101: + resolution: {integrity: sha512-/kBMcoF12PRO/lwa8Z7w4YyiKDcXQEiLvM+S3G9EvkoKYGgkkz4Q6PSNhF5rwg/E3+Hq5/9D2R+6nrkF287ihg==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-x64-gnu@1.3.93: resolution: {integrity: sha512-OFUdx64qvrGJhXKEyxosHxgoUVgba2ztYh7BnMiU5hP8lbI8G13W40J0SN3CmFQwPP30+3oEbW7LWzhKEaYjlg==} engines: {node: '>=10'} @@ -1320,6 +1356,15 @@ packages: dev: true optional: true + /@swc/core-linux-x64-musl@1.3.101: + resolution: {integrity: sha512-kDN8lm4Eew0u1p+h1l3JzoeGgZPQ05qDE0czngnjmfpsH2sOZxVj1hdiCwS5lArpy7ktaLu5JdRnx70MkUzhXw==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-x64-musl@1.3.93: resolution: {integrity: sha512-4B8lSRwEq1XYm6xhxHhvHmKAS7pUp1Q7E33NQ2TlmFhfKvCOh86qvThcjAOo57x8DRwmpvEVrqvpXtYagMN6Ig==} engines: {node: '>=10'} @@ -1329,6 +1374,15 @@ packages: dev: true optional: true + /@swc/core-win32-arm64-msvc@1.3.101: + resolution: {integrity: sha512-9Wn8TTLWwJKw63K/S+jjrZb9yoJfJwCE2RV5vPCCWmlMf3U1AXj5XuWOLUX+Rp2sGKau7wZKsvywhheWm+qndQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@swc/core-win32-arm64-msvc@1.3.93: resolution: {integrity: sha512-BHShlxtkven8ZjjvZ5QR6sC5fZCJ9bMujEkiha6W4cBUTY7ce7qGFyHmQd+iPC85d9kD/0cCiX/Xez8u0BhO7w==} engines: {node: '>=10'} @@ -1338,6 +1392,15 @@ packages: dev: true optional: true + /@swc/core-win32-ia32-msvc@1.3.101: + resolution: {integrity: sha512-onO5KvICRVlu2xmr4//V2je9O2XgS1SGKpbX206KmmjcJhXN5EYLSxW9qgg+kgV5mip+sKTHTAu7IkzkAtElYA==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@swc/core-win32-ia32-msvc@1.3.93: resolution: {integrity: sha512-nEwNWnz4JzYAK6asVvb92yeylfxMYih7eMQOnT7ZVlZN5ba9WF29xJ6kcQKs9HRH6MvWhz9+wRgv3FcjlU6HYA==} engines: {node: '>=10'} @@ -1347,6 +1410,15 @@ packages: dev: true optional: true + /@swc/core-win32-x64-msvc@1.3.101: + resolution: {integrity: sha512-T3GeJtNQV00YmiVw/88/nxJ/H43CJvFnpvBHCVn17xbahiVUOPOduh3rc9LgAkKiNt/aV8vU3OJR+6PhfMR7UQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@swc/core-win32-x64-msvc@1.3.93: resolution: {integrity: sha512-jibQ0zUr4kwJaQVwgmH+svS04bYTPnPw/ZkNInzxS+wFAtzINBYcU8s2PMWbDb2NGYiRSEeoSGyAvS9H+24JFA==} engines: {node: '>=10'} @@ -1356,7 +1428,33 @@ packages: dev: true optional: true - /@swc/core@1.3.93(@swc/helpers@0.5.1): + /@swc/core@1.3.101(@swc/helpers@0.5.3): + resolution: {integrity: sha512-w5aQ9qYsd/IYmXADAnkXPGDMTqkQalIi+kfFf/MHRKTpaOL7DHjMXwPp/n8hJ0qNjRvchzmPtOqtPBiER50d8A==} + engines: {node: '>=10'} + requiresBuild: true + peerDependencies: + '@swc/helpers': ^0.5.0 + peerDependenciesMeta: + '@swc/helpers': + optional: true + dependencies: + '@swc/counter': 0.1.2 + '@swc/helpers': 0.5.3 + '@swc/types': 0.1.5 + optionalDependencies: + '@swc/core-darwin-arm64': 1.3.101 + '@swc/core-darwin-x64': 1.3.101 + '@swc/core-linux-arm-gnueabihf': 1.3.101 + '@swc/core-linux-arm64-gnu': 1.3.101 + '@swc/core-linux-arm64-musl': 1.3.101 + '@swc/core-linux-x64-gnu': 1.3.101 + '@swc/core-linux-x64-musl': 1.3.101 + '@swc/core-win32-arm64-msvc': 1.3.101 + '@swc/core-win32-ia32-msvc': 1.3.101 + '@swc/core-win32-x64-msvc': 1.3.101 + dev: true + + /@swc/core@1.3.93: resolution: {integrity: sha512-690GRr1wUGmGYZHk7fUduX/JUwViMF2o74mnZYIWEcJaCcd9MQfkhsxPBtjeg6tF+h266/Cf3RPYhsFBzzxXcA==} engines: {node: '>=10'} requiresBuild: true @@ -1367,7 +1465,6 @@ packages: 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.93 @@ -1392,6 +1489,12 @@ packages: tslib: 2.5.0 dev: true + /@swc/helpers@0.5.3: + resolution: {integrity: sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==} + dependencies: + tslib: 2.6.2 + dev: true + /@swc/jest@0.2.26(@swc/core@1.3.93): resolution: {integrity: sha512-7lAi7q7ShTO3E5Gt1Xqf3pIhRbERxR1DUxvtVa9WKzIB+HGQ7wZP5sYx86zqnaEoKKGhmOoZ7gyW0IRu8Br5+A==} engines: {npm: '>= 7.0.0'} @@ -1399,7 +1502,7 @@ packages: '@swc/core': '*' dependencies: '@jest/create-cache-key-function': 27.5.1 - '@swc/core': 1.3.93(@swc/helpers@0.5.1) + '@swc/core': 1.3.93 jsonc-parser: 3.2.0 dev: true @@ -2134,9 +2237,9 @@ packages: semver: 7.5.4 dev: true - /bunchee@3.9.2(typescript@5.1.3): - resolution: {integrity: sha512-JTp5ko5oFE2m8jdbBEjkowj8jLDg8bShvly6ScDFDSqAMCDHEd8pEAF92OMt8IQPquaU0DOEBkpM0lqnv/vbyw==} - engines: {node: '>= 16'} + /bunchee@4.2.9(typescript@5.1.3): + resolution: {integrity: sha512-/pjmelJLmyJxFzpsYGHz/BFB4yLzfMzmiCJnabLEk92Al3EDuJkWu60GDyDCdxm9BkpjHDE0sLFkKovAe8wvvQ==} + engines: {node: '>= 18.0.0'} hasBin: true peerDependencies: typescript: ^4.1 || ^5.0 @@ -2146,22 +2249,23 @@ packages: typescript: optional: true dependencies: - '@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 + '@rollup/plugin-commonjs': 25.0.7(rollup@4.9.1) + '@rollup/plugin-esm-shim': 0.1.5(rollup@4.9.1) + '@rollup/plugin-json': 6.1.0(rollup@4.9.1) + '@rollup/plugin-node-resolve': 15.2.3(rollup@4.9.1) + '@rollup/plugin-replace': 5.0.5(rollup@4.9.1) + '@rollup/plugin-wasm': 6.2.2(rollup@4.9.1) + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + '@swc/core': 1.3.101(@swc/helpers@0.5.3) + '@swc/helpers': 0.5.3 arg: 5.0.2 pretty-bytes: 5.6.0 - 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 + publint: 0.2.7 + rollup: 4.9.1 + rollup-plugin-dts: 6.1.0(rollup@4.9.1)(typescript@5.1.3) + rollup-plugin-swc3: 0.11.0(@swc/core@1.3.101)(rollup@4.9.1) + rollup-preserve-directives: 1.1.1(rollup@4.9.1) + tslib: 2.6.2 typescript: 5.1.3 dev: true @@ -4124,13 +4228,6 @@ packages: hasBin: true dev: true - /magic-string@0.27.0: - resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /magic-string@0.30.5: resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} engines: {node: '>=12'} @@ -4681,8 +4778,8 @@ packages: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true - /publint@0.2.5: - resolution: {integrity: sha512-eoQiP0WXkxkpth1fMLoS1I/6BQoxKNZxTAAnFjPgURFrJulC5D5Uifk49a9kfNCYmcza9E/ZkbFhQQdjkmKAbg==} + /publint@0.2.7: + resolution: {integrity: sha512-tLU4ee3110BxWfAmCZggJmCUnYWgPTr0QLnx08sqpLYa8JHRiOudd+CgzdpfU5x5eOaW2WMkpmOrFshRFYK7Mw==} engines: {node: '>=16'} hasBin: true dependencies: @@ -4862,7 +4959,7 @@ packages: glob: 10.2.6 dev: true - /rollup-plugin-dts@6.1.0(rollup@3.29.4)(typescript@5.1.3): + /rollup-plugin-dts@6.1.0(rollup@4.9.1)(typescript@5.1.3): resolution: {integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==} engines: {node: '>=16'} peerDependencies: @@ -4870,43 +4967,54 @@ packages: typescript: ^4.5 || ^5.0 dependencies: magic-string: 0.30.5 - rollup: 3.29.4 + rollup: 4.9.1 typescript: 5.1.3 optionalDependencies: '@babel/code-frame': 7.22.13 dev: true - /rollup-plugin-swc3@0.10.3(@swc/core@1.3.93)(rollup@3.29.4): - resolution: {integrity: sha512-GWoMkm3ATumN8EPHBKLrpCufcRNn7SfLyvMKWUfCVLidPuPjlQZfNBeQXP6OEiHBguZzriCssX43EnV3+Y54bA==} + /rollup-plugin-swc3@0.11.0(@swc/core@1.3.101)(rollup@4.9.1): + resolution: {integrity: sha512-luB9Ngb1YieWPpJttKvkmjN3lG5l28SmASLbf2CoScUB2+EImU0bE8wX4EYKEqv5clVulhWRQHQvE+H33X/03g==} engines: {node: '>=12'} peerDependencies: '@swc/core': '>=1.2.165' rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 dependencies: '@fastify/deepmerge': 1.3.0 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) - '@swc/core': 1.3.93(@swc/helpers@0.5.1) + '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + '@swc/core': 1.3.101(@swc/helpers@0.5.3) 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) + rollup: 4.9.1 + rollup-preserve-directives: 1.1.1(rollup@4.9.1) dev: true - /rollup-swc-preserve-directives@0.5.0(@swc/core@1.3.93)(rollup@3.29.4): - resolution: {integrity: sha512-6lnPZn2laSsdYcdCSE28z4Dwg2mCN5loF+/wBjybh25GJmONjHTf3orWa5j1zjEWY3RcGRjJ8K/52ePqtfy6dw==} + /rollup-preserve-directives@1.1.1(rollup@4.9.1): + resolution: {integrity: sha512-+eQafbuEfDPfxQ9hQPlwaROfin4yiVRxap8hnrvvvcSGoukv1tTiYpAW9mvm3uR8J+fe4xd8FdVd5rz9q7jZ+Q==} peerDependencies: - '@swc/core': '>=1.3.79' - rollup: ^2.0.0 || ^3.0.0 + rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 dependencies: - '@napi-rs/magic-string': 0.3.4 - '@swc/core': 1.3.93(@swc/helpers@0.5.1) - rollup: 3.29.4 + magic-string: 0.30.5 + rollup: 4.9.1 dev: true - /rollup@3.29.4: - resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} + /rollup@4.9.1: + resolution: {integrity: sha512-pgPO9DWzLoW/vIhlSoDByCzcpX92bKEorbgXuZrqxByte3JFk2xSW2JEeAcyLc9Ru9pqcNNW+Ob7ntsk2oT/Xw==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.9.1 + '@rollup/rollup-android-arm64': 4.9.1 + '@rollup/rollup-darwin-arm64': 4.9.1 + '@rollup/rollup-darwin-x64': 4.9.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.9.1 + '@rollup/rollup-linux-arm64-gnu': 4.9.1 + '@rollup/rollup-linux-arm64-musl': 4.9.1 + '@rollup/rollup-linux-riscv64-gnu': 4.9.1 + '@rollup/rollup-linux-x64-gnu': 4.9.1 + '@rollup/rollup-linux-x64-musl': 4.9.1 + '@rollup/rollup-win32-arm64-msvc': 4.9.1 + '@rollup/rollup-win32-ia32-msvc': 4.9.1 + '@rollup/rollup-win32-x64-msvc': 4.9.1 fsevents: 2.3.3 dev: true @@ -5294,6 +5402,10 @@ packages: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} dev: true + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: true + /tsutils@3.21.0(typescript@5.1.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} diff --git a/_internal/src/constants.ts b/src/_internal/constants.ts similarity index 100% rename from _internal/src/constants.ts rename to src/_internal/constants.ts diff --git a/_internal/src/events.ts b/src/_internal/events.ts similarity index 100% rename from _internal/src/events.ts rename to src/_internal/events.ts diff --git a/_internal/src/index.react-server.ts b/src/_internal/index.react-server.ts similarity index 100% rename from _internal/src/index.react-server.ts rename to src/_internal/index.react-server.ts diff --git a/_internal/src/index.ts b/src/_internal/index.ts similarity index 100% rename from _internal/src/index.ts rename to src/_internal/index.ts diff --git a/_internal/src/types.ts b/src/_internal/types.ts similarity index 100% rename from _internal/src/types.ts rename to src/_internal/types.ts diff --git a/_internal/src/utils/cache.ts b/src/_internal/utils/cache.ts similarity index 100% rename from _internal/src/utils/cache.ts rename to src/_internal/utils/cache.ts diff --git a/_internal/src/utils/config-context.ts b/src/_internal/utils/config-context.ts similarity index 100% rename from _internal/src/utils/config-context.ts rename to src/_internal/utils/config-context.ts diff --git a/_internal/src/utils/config.ts b/src/_internal/utils/config.ts similarity index 100% rename from _internal/src/utils/config.ts rename to src/_internal/utils/config.ts diff --git a/_internal/src/utils/devtools.ts b/src/_internal/utils/devtools.ts similarity index 100% rename from _internal/src/utils/devtools.ts rename to src/_internal/utils/devtools.ts diff --git a/_internal/src/utils/env.ts b/src/_internal/utils/env.ts similarity index 100% rename from _internal/src/utils/env.ts rename to src/_internal/utils/env.ts diff --git a/_internal/src/utils/global-state.ts b/src/_internal/utils/global-state.ts similarity index 100% rename from _internal/src/utils/global-state.ts rename to src/_internal/utils/global-state.ts diff --git a/_internal/src/utils/hash.ts b/src/_internal/utils/hash.ts similarity index 100% rename from _internal/src/utils/hash.ts rename to src/_internal/utils/hash.ts diff --git a/_internal/src/utils/helper.ts b/src/_internal/utils/helper.ts similarity index 100% rename from _internal/src/utils/helper.ts rename to src/_internal/utils/helper.ts diff --git a/_internal/src/utils/merge-config.ts b/src/_internal/utils/merge-config.ts similarity index 100% rename from _internal/src/utils/merge-config.ts rename to src/_internal/utils/merge-config.ts diff --git a/_internal/src/utils/middleware-preset.ts b/src/_internal/utils/middleware-preset.ts similarity index 100% rename from _internal/src/utils/middleware-preset.ts rename to src/_internal/utils/middleware-preset.ts diff --git a/_internal/src/utils/mutate.ts b/src/_internal/utils/mutate.ts similarity index 100% rename from _internal/src/utils/mutate.ts rename to src/_internal/utils/mutate.ts diff --git a/_internal/src/utils/normalize-args.ts b/src/_internal/utils/normalize-args.ts similarity index 100% rename from _internal/src/utils/normalize-args.ts rename to src/_internal/utils/normalize-args.ts diff --git a/_internal/src/utils/preload.ts b/src/_internal/utils/preload.ts similarity index 100% rename from _internal/src/utils/preload.ts rename to src/_internal/utils/preload.ts diff --git a/_internal/src/utils/resolve-args.ts b/src/_internal/utils/resolve-args.ts similarity index 100% rename from _internal/src/utils/resolve-args.ts rename to src/_internal/utils/resolve-args.ts diff --git a/_internal/src/utils/serialize.ts b/src/_internal/utils/serialize.ts similarity index 100% rename from _internal/src/utils/serialize.ts rename to src/_internal/utils/serialize.ts diff --git a/_internal/src/utils/shared.ts b/src/_internal/utils/shared.ts similarity index 100% rename from _internal/src/utils/shared.ts rename to src/_internal/utils/shared.ts diff --git a/_internal/src/utils/subscribe-key.ts b/src/_internal/utils/subscribe-key.ts similarity index 100% rename from _internal/src/utils/subscribe-key.ts rename to src/_internal/utils/subscribe-key.ts diff --git a/_internal/src/utils/timestamp.ts b/src/_internal/utils/timestamp.ts similarity index 100% rename from _internal/src/utils/timestamp.ts rename to src/_internal/utils/timestamp.ts diff --git a/_internal/src/utils/use-swr-config.ts b/src/_internal/utils/use-swr-config.ts similarity index 100% rename from _internal/src/utils/use-swr-config.ts rename to src/_internal/utils/use-swr-config.ts diff --git a/_internal/src/utils/web-preset.ts b/src/_internal/utils/web-preset.ts similarity index 100% rename from _internal/src/utils/web-preset.ts rename to src/_internal/utils/web-preset.ts diff --git a/_internal/src/utils/with-middleware.ts b/src/_internal/utils/with-middleware.ts similarity index 100% rename from _internal/src/utils/with-middleware.ts rename to src/_internal/utils/with-middleware.ts diff --git a/core/src/index.react-server.ts b/src/core/index.react-server.ts similarity index 100% rename from core/src/index.react-server.ts rename to src/core/index.react-server.ts diff --git a/core/src/index.ts b/src/core/index.ts similarity index 100% rename from core/src/index.ts rename to src/core/index.ts diff --git a/src/core/serialize.ts b/src/core/serialize.ts new file mode 100644 index 000000000..523e264f3 --- /dev/null +++ b/src/core/serialize.ts @@ -0,0 +1,4 @@ +import type { Key } from '../_internal' +import { serialize } from '../_internal' + +export const unstable_serialize = (key: Key) => serialize(key)[0] diff --git a/core/src/use-swr.ts b/src/core/use-swr.ts similarity index 100% rename from core/src/use-swr.ts rename to src/core/use-swr.ts diff --git a/immutable/src/index.ts b/src/immutable/index.ts similarity index 75% rename from immutable/src/index.ts rename to src/immutable/index.ts index d39e8d6ba..6d1ad7d12 100644 --- a/immutable/src/index.ts +++ b/src/immutable/index.ts @@ -1,6 +1,6 @@ -import type { Middleware } from 'swr' -import useSWR from 'swr' -import { withMiddleware } from 'swr/_internal' +import type { Middleware } from '../core' +import useSWR from '../core' +import { withMiddleware } from '../_internal' export const immutable: Middleware = useSWRNext => (key, fetcher, config) => { // Always override all revalidate options. diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 000000000..9b59ec528 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,2 @@ +export * from './core' +export { default } from './core' diff --git a/infinite/src/index.react-server.ts b/src/infinite/index.react-server.ts similarity index 100% rename from infinite/src/index.react-server.ts rename to src/infinite/index.react-server.ts diff --git a/infinite/src/index.ts b/src/infinite/index.ts similarity index 99% rename from infinite/src/index.ts rename to src/infinite/index.ts index d51b8eaa4..b23fc45eb 100644 --- a/infinite/src/index.ts +++ b/src/infinite/index.ts @@ -2,8 +2,8 @@ // hook where `key` and return type are not like the normal `useSWR` types. import { useRef, useCallback } from 'react' -import type { SWRConfig } from 'swr' -import useSWR from 'swr' +import type { SWRConfig } from '..' +import useSWR from '..' import { isUndefined, isFunction, diff --git a/infinite/src/serialize.ts b/src/infinite/serialize.ts similarity index 100% rename from infinite/src/serialize.ts rename to src/infinite/serialize.ts diff --git a/infinite/src/types.ts b/src/infinite/types.ts similarity index 100% rename from infinite/src/types.ts rename to src/infinite/types.ts diff --git a/mutation/src/index.ts b/src/mutation/index.ts similarity index 99% rename from mutation/src/index.ts rename to src/mutation/index.ts index 48cb1d0da..82fcbf1fe 100644 --- a/mutation/src/index.ts +++ b/src/mutation/index.ts @@ -1,5 +1,5 @@ import { useCallback, useRef } from 'react' -import useSWR, { useSWRConfig } from 'swr' +import useSWR, { useSWRConfig } from '..' import type { Middleware, Key } from 'swr/_internal' import { useStateWithDeps, startTransition } from './state' import { diff --git a/mutation/src/state.ts b/src/mutation/state.ts similarity index 100% rename from mutation/src/state.ts rename to src/mutation/state.ts diff --git a/mutation/src/types.ts b/src/mutation/types.ts similarity index 99% rename from mutation/src/types.ts rename to src/mutation/types.ts index 654ad4d4c..af01fd1ea 100644 --- a/mutation/src/types.ts +++ b/src/mutation/types.ts @@ -1,4 +1,4 @@ -import type { SWRResponse, Key } from 'swr' +import type { SWRResponse, Key } from '..' type FetcherResponse = Data | Promise diff --git a/subscription/src/index.ts b/src/subscription/index.ts similarity index 98% rename from subscription/src/index.ts rename to src/subscription/index.ts index 3cf77bb6d..c7bba9472 100644 --- a/subscription/src/index.ts +++ b/src/subscription/index.ts @@ -1,11 +1,11 @@ -import type { Key, SWRHook, Middleware, SWRConfiguration, SWRConfig } from 'swr' +import type { Key, SWRHook, Middleware, SWRConfiguration, SWRConfig } from '..' import type { SWRSubscriptionOptions, SWRSubscription, SWRSubscriptionResponse, SWRSubscriptionHook } from './types' -import useSWR from 'swr' +import useSWR from '..' import { withMiddleware, serialize, diff --git a/subscription/src/types.ts b/src/subscription/types.ts similarity index 92% rename from subscription/src/types.ts rename to src/subscription/types.ts index 6cda5e0d1..3cb7de206 100644 --- a/subscription/src/types.ts +++ b/src/subscription/types.ts @@ -1,4 +1,4 @@ -import type { Key, SWRConfiguration, MutatorCallback } from 'swr' +import type { Key, SWRConfiguration, MutatorCallback } from '..' export type SWRSubscriptionOptions = { next: (err?: Error | null, data?: Data | MutatorCallback) => void diff --git a/subscription/package.json b/subscription/package.json index 67883a9e9..db2206fd2 100644 --- a/subscription/package.json +++ b/subscription/package.json @@ -1,21 +1,6 @@ { - "main": "./dist/index.js", - "module": "./dist/index.esm.js", - "types": "./dist/index.d.ts", - "exports": { - "import": "./dist/index.mjs", - "module": "./dist/index.esm.js", - "require": "./dist/index.js" - }, - "private": true, - "scripts": { - "watch": "bunchee -w", - "build": "bunchee", - "types:check": "tsc --noEmit", - "clean": "rimraf dist" - }, - "peerDependencies": { - "swr": "*", - "react": "*" - } + "main": "../dist/subscription/index.js", + "module": "../dist/subscription/index.esm.js", + "types": "../dist/subscription/index.d.ts", + "private": true } diff --git a/subscription/tsconfig.json b/subscription/tsconfig.json deleted file mode 100644 index bd4e55bac..000000000 --- a/subscription/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "..", - }, - "include": ["./src"], - "exclude": ["./dist"] -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 0ff84f26c..20eda7e97 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,8 +17,12 @@ "target": "ES2018", "noEmitOnError": true, "downlevelIteration": true, - "incremental": true + "incremental": true, + "paths": { + "swr/*": ["./src/*"] + } }, + "include": ["./src/**/*", "env.d.ts"], "exclude": ["./**/dist", "examples"], "watchOptions": { "watchFile": "useFsEvents", From d6b4cef2b17eacce316f2c8cfbfc4f2e15c4f9c0 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 03:22:53 +0100 Subject: [PATCH 02/14] fix test alias --- jest.config.js | 12 ++-- package.json.bak | 162 ----------------------------------------------- 2 files changed, 6 insertions(+), 168 deletions(-) delete mode 100644 package.json.bak diff --git a/jest.config.js b/jest.config.js index b543a605d..87c1ca0e9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,12 +5,12 @@ module.exports = { modulePathIgnorePatterns: ['/examples/'], setupFilesAfterEnv: ['/test/jest-setup.ts'], moduleNameMapper: { - '^swr$': '/core/src/index.ts', - '^swr/infinite$': '/infinite/src/index.ts', - '^swr/immutable$': '/immutable/src/index.ts', - '^swr/subscription$': '/subscription/src/index.ts', - '^swr/mutation$': '/mutation/src/index.ts', - '^swr/_internal$': '/_internal/src/index.ts' + '^swr$': '/src/index.ts', + '^swr/infinite$': '/src/infinite/index.ts', + '^swr/immutable$': '/src/immutable/index.ts', + '^swr/subscription$': '/src/subscription/index.ts', + '^swr/mutation$': '/src/mutation/index.ts', + '^swr/_internal$': '/src/_internal/index.ts' }, transform: { '^.+\\.(t|j)sx?$': ['@swc/jest'] diff --git a/package.json.bak b/package.json.bak deleted file mode 100644 index 327d5ec1f..000000000 --- a/package.json.bak +++ /dev/null @@ -1,162 +0,0 @@ -{ - "name": "swr", - "version": "2.2.4", - "description": "React Hooks library for remote data fetching", - "keywords": [ - "swr", - "react", - "hooks", - "request", - "cache", - "fetch" - ], - "packageManager": "pnpm@8.4.0", - "main": "./core/dist/index.js", - "module": "./core/dist/index.esm.js", - "types": "./core/dist/index.d.ts", - "typesVersions": { - "*": { - "infinite": [ - "./infinite/dist/index.d.ts" - ], - "immutable": [ - "./immutable/dist/index.d.ts" - ], - "mutation": [ - "./mutation/dist/index.d.ts" - ], - "subscription": [ - "./subscription/dist/index.d.ts" - ] - } - }, - "exports": { - "./package.json": "./package.json", - ".": { - "import": "./core/dist/index.mjs", - "module": "./core/dist/index.esm.js", - "require": "./core/dist/index.js" - }, - "./infinite": { - "import": "./infinite/dist/index.mjs", - "module": "./infinite/dist/index.esm.js", - "require": "./infinite/dist/index.js" - }, - "./immutable": { - "import": "./immutable/dist/index.mjs", - "module": "./immutable/dist/index.esm.js", - "require": "./immutable/dist/index.js" - }, - "./subscription": { - "import": "./subscription/dist/index.mjs", - "module": "./subscription/dist/index.esm.js", - "require": "./subscription/dist/index.js" - }, - "./mutation": { - "import": "./mutation/dist/index.mjs", - "module": "./mutation/dist/index.esm.js", - "require": "./mutation/dist/index.js" - }, - "./_internal": { - "import": "./_internal/dist/index.mjs", - "module": "./_internal/dist/index.esm.js", - "require": "./_internal/dist/index.js" - } - }, - "files": [ - "core/dist/**/*.{js,d.ts,mjs,d.mts}", - "infinite/dist/**/*.{js,d.ts,mjs,d.mts}", - "immutable/dist/**/*.{js,d.ts,mjs,d.mts}", - "mutation/dist/**/*.{js,d.ts,mjs,d.mts}", - "_internal/dist/**/*.{js,d.ts,mjs,d.mts}", - "subscription/dist/*.{js,d.ts,mjs,d.mts}", - "core/package.json", - "infinite/package.json", - "immutable/package.json", - "mutation/package.json", - "_internal/package.json", - "subscription/package.json" - ], - "repository": "github:vercel/swr", - "homepage": "https://swr.vercel.app", - "license": "MIT", - "scripts": { - "prepare": "husky install", - "csb:install": "corepack enable && corepack pnpm i", - "csb:build": "pnpm build", - "clean": "pnpm -r run clean && rimraf playwright-report test-result", - "watch": "pnpm -r run watch", - "build": "pnpm build-package _internal && pnpm build-package core && pnpm build-package infinite && pnpm build-package immutable && pnpm build-package mutation && pnpm build-package subscription", - "build:e2e": "pnpm next build e2e/site", - "build-package": "bunchee --cwd", - "attw": "attw --pack", - "types:check": "pnpm -r run types:check", - "prepublishOnly": "pnpm clean && pnpm build", - "publish-beta": "pnpm publish --tag beta", - "format": "prettier --write ./**/*.{ts,tsx}", - "lint": "eslint . --ext .ts,.tsx --cache", - "lint:fix": "pnpm lint --fix", - "coverage": "jest --coverage", - "test-typing": "tsc --noEmit -p test/type/tsconfig.json && tsc --noEmit -p test/tsconfig.json", - "test": "jest", - "test:build": "jest --config jest.config.build.js", - "test:e2e": "playwright test", - "run-all-checks": "pnpm types:check && pnpm lint && pnpm test-typing" - }, - "lint-staged": { - "*.{ts,tsx}": [ - "eslint --fix --cache", - "prettier --write" - ] - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.7.0", - "@playwright/test": "^1.34.3", - "@swc/core": "^1.3.62", - "@swc/jest": "0.2.26", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", - "@type-challenges/utils": "0.1.1", - "@types/jest": "^29.5.2", - "@types/node": "^20.2.5", - "@types/react": "^18.2.8", - "@types/use-sync-external-store": "^0.0.3", - "@typescript-eslint/eslint-plugin": "5.59.8", - "@typescript-eslint/parser": "5.59.8", - "bunchee": "4.2.9", - "eslint": "8.42.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-jest-dom": "5.0.1", - "eslint-plugin-react": "7.32.2", - "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-testing-library": "5.11.0", - "husky": "8.0.3", - "jest": "29.5.0", - "jest-environment-jsdom": "29.5.0", - "lint-staged": "13.2.2", - "next": "^13.4.4", - "prettier": "2.8.8", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-error-boundary": "^4.0.9", - "rimraf": "5.0.1", - "semver": "^7.5.1", - "swr": "workspace:*", - "typescript": "5.1.3" - }, - "peerDependencies": { - "react": "^16.11.0 || ^17.0.0 || ^18.0.0" - }, - "prettier": { - "tabWidth": 2, - "semi": false, - "useTabs": false, - "singleQuote": true, - "arrowParens": "avoid", - "trailingComma": "none" - }, - "dependencies": { - "client-only": "^0.0.1", - "use-sync-external-store": "^1.2.0" - } -} From 9c7205602fff3f8bfeb293dbb3e3167954a39d8a Mon Sep 17 00:00:00 2001 From: Yixuan Xu Date: Fri, 29 Dec 2023 11:48:59 +0800 Subject: [PATCH 03/14] chore: fix lint error --- e2e/test/tsconfig.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 e2e/test/tsconfig.json diff --git a/e2e/test/tsconfig.json b/e2e/test/tsconfig.json new file mode 100644 index 000000000..bac5664e8 --- /dev/null +++ b/e2e/test/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.json", + "include": [ + ".", + ], +} \ No newline at end of file From 8126255a0adaad63d70bfaf6f4daf343dd036e7a Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 15:34:18 +0100 Subject: [PATCH 04/14] update bundler and pkg exports --- package.json | 35 ++++++++++------------------------- pnpm-lock.yaml | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 39196cc9b..7ffb8a111 100644 --- a/package.json +++ b/package.json @@ -17,28 +17,24 @@ "exports": { "./package.json": "./package.json", ".": { + "react-server": "./dist/core/react-server.mjs", "import": { "types": "./dist/core/index.d.mts", "default": "./dist/core/index.mjs" }, - "module": { - "types": "./dist/core/index.d.mts", - "default": "./dist/core/index.esm.js" - }, + "module": "./dist/core/index.esm.js", "require": { "types": "./dist/core/index.d.ts", "default": "./dist/core/index.js" } }, "./infinite": { + "react-server": "./dist/infinite/react-server.mjs", "import": { "types": "./dist/infinite/index.d.mts", "default": "./dist/infinite/index.mjs" }, - "module": { - "types": "./dist/infinite/index.d.mts", - "default": "./dist/infinite/index.esm.js" - }, + "module": "./dist/infinite/index.esm.js", "require": { "types": "./dist/infinite/index.d.ts", "default": "./dist/infinite/index.js" @@ -49,10 +45,7 @@ "types": "./dist/immutable/index.d.mts", "default": "./dist/immutable/index.mjs" }, - "module": { - "types": "./dist/immutable/index.d.mts", - "default": "./dist/immutable/index.esm.js" - }, + "module": "./dist/immutable/index.esm.js", "require": { "types": "./dist/immutable/index.d.ts", "default": "./dist/immutable/index.js" @@ -63,10 +56,7 @@ "types": "./dist/subscription/index.d.mts", "default": "./dist/subscription/index.mjs" }, - "module": { - "types": "./dist/subscription/index.d.mts", - "default": "./dist/subscription/index.esm.js" - }, + "module": "./dist/subscription/index.esm.js", "require": { "types": "./dist/subscription/index.d.ts", "default": "./dist/subscription/index.js" @@ -77,24 +67,19 @@ "types": "./dist/mutation/index.d.mts", "default": "./dist/mutation/index.mjs" }, - "module": { - "types": "./dist/mutation/index.d.mts", - "default": "./dist/mutation/index.esm.js" - }, + "module": "./dist/mutation/index.esm.js", "require": { "types": "./dist/mutation/index.d.ts", "default": "./dist/mutation/index.js" } }, "./_internal": { + "react-server": "./dist/_internal/react-server.mjs", "import": { "types": "./dist/_internal/index.d.mts", "default": "./dist/_internal/index.mjs" }, - "module": { - "types": "./dist/_internal/index.d.mts", - "default": "./dist/_internal/index.esm.js" - }, + "module": "./dist/_internal/index.esm.js", "require": { "types": "./dist/_internal/index.d.ts", "default": "./dist/_internal/index.js" @@ -155,7 +140,7 @@ "@types/use-sync-external-store": "^0.0.3", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.59.8", - "bunchee": "4.2.9", + "bunchee": "^4.2.10", "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 934cbfaac..03d3693e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: 5.59.8 version: 5.59.8(eslint@8.42.0)(typescript@5.1.3) bunchee: - specifier: 4.2.9 - version: 4.2.9(typescript@5.1.3) + specifier: ^4.2.10 + version: 4.2.10(typescript@5.1.3) eslint: specifier: 8.42.0 version: 8.42.0 @@ -180,12 +180,12 @@ packages: '@babel/highlight': 7.18.6 dev: true - /@babel/code-frame@7.22.13: - resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} requiresBuild: true dependencies: - '@babel/highlight': 7.22.20 + '@babel/highlight': 7.23.4 chalk: 2.4.2 dev: true optional: true @@ -338,8 +338,8 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/highlight@7.22.20: - resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.22.20 @@ -1122,7 +1122,7 @@ packages: rollup: optional: true dependencies: - '@types/estree': 1.0.0 + '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 rollup: 4.9.1 @@ -1595,8 +1595,8 @@ packages: '@babel/types': 7.18.9 dev: true - /@types/estree@1.0.0: - resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} + /@types/estree@1.0.5: + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true /@types/graceful-fs@4.1.5: @@ -2237,8 +2237,8 @@ packages: semver: 7.5.4 dev: true - /bunchee@4.2.9(typescript@5.1.3): - resolution: {integrity: sha512-/pjmelJLmyJxFzpsYGHz/BFB4yLzfMzmiCJnabLEk92Al3EDuJkWu60GDyDCdxm9BkpjHDE0sLFkKovAe8wvvQ==} + /bunchee@4.2.10(typescript@5.1.3): + resolution: {integrity: sha512-f1ut+3JbsZxv0sf7kHRNm/r9fiEY8tWVUZm0h3PNOCbfmkxgCYeXCDO4ls5mHEisr0fufs/9ACVkYBXU/rv1iw==} engines: {node: '>= 18.0.0'} hasBin: true peerDependencies: @@ -3463,7 +3463,7 @@ packages: /is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: - '@types/estree': 1.0.0 + '@types/estree': 1.0.5 dev: true /is-regex@1.1.4: @@ -4970,7 +4970,7 @@ packages: rollup: 4.9.1 typescript: 5.1.3 optionalDependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 dev: true /rollup-plugin-swc3@0.11.0(@swc/core@1.3.101)(rollup@4.9.1): From a9a9a2d5eb980db5568af000191cc7fcbcf5a3b8 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 16:28:28 +0100 Subject: [PATCH 05/14] import from core --- src/infinite/index.ts | 4 ++-- src/mutation/index.ts | 2 +- src/mutation/types.ts | 2 +- src/subscription/index.ts | 10 ++++++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/infinite/index.ts b/src/infinite/index.ts index b23fc45eb..4d4218d2f 100644 --- a/src/infinite/index.ts +++ b/src/infinite/index.ts @@ -2,8 +2,8 @@ // hook where `key` and return type are not like the normal `useSWR` types. import { useRef, useCallback } from 'react' -import type { SWRConfig } from '..' -import useSWR from '..' +import type { SWRConfig } from '../core' +import useSWR from '../core' import { isUndefined, isFunction, diff --git a/src/mutation/index.ts b/src/mutation/index.ts index 82fcbf1fe..79c9d3293 100644 --- a/src/mutation/index.ts +++ b/src/mutation/index.ts @@ -1,5 +1,5 @@ import { useCallback, useRef } from 'react' -import useSWR, { useSWRConfig } from '..' +import useSWR, { useSWRConfig } from '../core' import type { Middleware, Key } from 'swr/_internal' import { useStateWithDeps, startTransition } from './state' import { diff --git a/src/mutation/types.ts b/src/mutation/types.ts index af01fd1ea..30320bc2a 100644 --- a/src/mutation/types.ts +++ b/src/mutation/types.ts @@ -1,4 +1,4 @@ -import type { SWRResponse, Key } from '..' +import type { SWRResponse, Key } from '../core' type FetcherResponse = Data | Promise diff --git a/src/subscription/index.ts b/src/subscription/index.ts index c7bba9472..66c04a430 100644 --- a/src/subscription/index.ts +++ b/src/subscription/index.ts @@ -1,11 +1,17 @@ -import type { Key, SWRHook, Middleware, SWRConfiguration, SWRConfig } from '..' +import type { + Key, + SWRHook, + Middleware, + SWRConfiguration, + SWRConfig +} from '../core' import type { SWRSubscriptionOptions, SWRSubscription, SWRSubscriptionResponse, SWRSubscriptionHook } from './types' -import useSWR from '..' +import useSWR from '../core' import { withMiddleware, serialize, From edcfa80a81e21c375b0f2974439c7b75ee956b41 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 16:32:30 +0100 Subject: [PATCH 06/14] react-server alias --- src/core/index.react-server.ts | 1 - src/index.react-server.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 src/core/index.react-server.ts create mode 100644 src/index.react-server.ts diff --git a/src/core/index.react-server.ts b/src/core/index.react-server.ts deleted file mode 100644 index 0945e0af8..000000000 --- a/src/core/index.react-server.ts +++ /dev/null @@ -1 +0,0 @@ -export { unstable_serialize } from './serialize' diff --git a/src/index.react-server.ts b/src/index.react-server.ts new file mode 100644 index 000000000..fe4a7552e --- /dev/null +++ b/src/index.react-server.ts @@ -0,0 +1 @@ +export { unstable_serialize } from './core/serialize' From 1bf5d92e810cf1305ecb8304630dd64517a2207a Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 18:11:18 +0100 Subject: [PATCH 07/14] Update alias --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/index.react-server.ts | 1 - src/index.ts | 2 -- src/index/index.react-server.ts | 1 + src/index/index.ts | 2 ++ src/subscription/types.ts | 2 +- tsconfig.json | 3 --- 8 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 src/index.react-server.ts delete mode 100644 src/index.ts create mode 100644 src/index/index.react-server.ts create mode 100644 src/index/index.ts diff --git a/package.json b/package.json index 7ffb8a111..0fbae6c56 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "@types/use-sync-external-store": "^0.0.3", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.59.8", - "bunchee": "^4.2.10", + "bunchee": "^4.2.11", "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 03d3693e5..975cd26f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: 5.59.8 version: 5.59.8(eslint@8.42.0)(typescript@5.1.3) bunchee: - specifier: ^4.2.10 - version: 4.2.10(typescript@5.1.3) + specifier: ^4.2.11 + version: 4.2.11(typescript@5.1.3) eslint: specifier: 8.42.0 version: 8.42.0 @@ -2237,8 +2237,8 @@ packages: semver: 7.5.4 dev: true - /bunchee@4.2.10(typescript@5.1.3): - resolution: {integrity: sha512-f1ut+3JbsZxv0sf7kHRNm/r9fiEY8tWVUZm0h3PNOCbfmkxgCYeXCDO4ls5mHEisr0fufs/9ACVkYBXU/rv1iw==} + /bunchee@4.2.11(typescript@5.1.3): + resolution: {integrity: sha512-hd4M7s3F8rXgN+sRBblDuSpb+3mXvOL9oY4Tmj84kn9D9euVQbnlkiX0BCvK2dQckohdgs9JA1JquqZavRrD9A==} engines: {node: '>= 18.0.0'} hasBin: true peerDependencies: diff --git a/src/index.react-server.ts b/src/index.react-server.ts deleted file mode 100644 index fe4a7552e..000000000 --- a/src/index.react-server.ts +++ /dev/null @@ -1 +0,0 @@ -export { unstable_serialize } from './core/serialize' diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 9b59ec528..000000000 --- a/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './core' -export { default } from './core' diff --git a/src/index/index.react-server.ts b/src/index/index.react-server.ts new file mode 100644 index 000000000..51bd6fc1e --- /dev/null +++ b/src/index/index.react-server.ts @@ -0,0 +1 @@ +export { unstable_serialize } from '../core/serialize' diff --git a/src/index/index.ts b/src/index/index.ts new file mode 100644 index 000000000..fb309c069 --- /dev/null +++ b/src/index/index.ts @@ -0,0 +1,2 @@ +export * from '../core' +export { default } from '../core' diff --git a/src/subscription/types.ts b/src/subscription/types.ts index 3cb7de206..34f2ae081 100644 --- a/src/subscription/types.ts +++ b/src/subscription/types.ts @@ -1,4 +1,4 @@ -import type { Key, SWRConfiguration, MutatorCallback } from '..' +import type { Key, SWRConfiguration, MutatorCallback } from '../core' export type SWRSubscriptionOptions = { next: (err?: Error | null, data?: Data | MutatorCallback) => void diff --git a/tsconfig.json b/tsconfig.json index 20eda7e97..76f1eb0de 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,9 +18,6 @@ "noEmitOnError": true, "downlevelIteration": true, "incremental": true, - "paths": { - "swr/*": ["./src/*"] - } }, "include": ["./src/**/*", "env.d.ts"], "exclude": ["./**/dist", "examples"], From 7c998631ffbef5998ce210f57aac1e5a8126f8ed Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 18:12:34 +0100 Subject: [PATCH 08/14] simplify script --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 0fbae6c56..73d0db428 100644 --- a/package.json +++ b/package.json @@ -101,11 +101,10 @@ "prepare": "husky install", "csb:install": "corepack enable && corepack pnpm i", "csb:build": "pnpm build", - "clean": "pnpm -r run clean && rimraf playwright-report test-result", + "clean": "rimraf ./dist && rimraf playwright-report test-result", "watch": "pnpm -r run watch", "build": "bunchee", "build:e2e": "pnpm next build e2e/site", - "build-package": "bunchee --cwd", "attw": "attw --pack", "types:check": "pnpm -r run types:check", "prepublishOnly": "pnpm clean && pnpm build", From 8aa0340c48969e95b654c4af5a7b7933d201fe78 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 18:17:37 +0100 Subject: [PATCH 09/14] change internal import path --- src/core/index.ts | 8 ++++---- src/core/use-swr.ts | 4 ++-- src/infinite/index.ts | 4 ++-- src/subscription/index.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/index.ts b/src/core/index.ts index c121fb34c..afc1c9569 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -6,9 +6,9 @@ export default useSWR // Core APIs export { SWRConfig } from './use-swr' export { unstable_serialize } from './serialize' -export { useSWRConfig } from 'swr/_internal' -export { mutate } from 'swr/_internal' -export { preload } from 'swr/_internal' +export { useSWRConfig } from '../_internal' +export { mutate } from '../_internal' +export { preload } from '../_internal' // Types export type { @@ -28,4 +28,4 @@ export type { Middleware, Arguments, State -} from 'swr/_internal' +} from '../_internal' diff --git a/src/core/use-swr.ts b/src/core/use-swr.ts index 8480ea805..4a78df756 100644 --- a/src/core/use-swr.ts +++ b/src/core/use-swr.ts @@ -27,7 +27,7 @@ import { internalMutate, revalidateEvents, mergeObjects -} from 'swr/_internal' +} from '../_internal' import type { State, Fetcher, @@ -41,7 +41,7 @@ import type { StateDependencies, GlobalState, ReactUsePromise -} from 'swr/_internal' +} from '../_internal' const use = ReactExports.use || diff --git a/src/infinite/index.ts b/src/infinite/index.ts index 4d4218d2f..a99172138 100644 --- a/src/infinite/index.ts +++ b/src/infinite/index.ts @@ -15,7 +15,7 @@ import { INFINITE_PREFIX, SWRGlobalState, cache as defaultCache -} from 'swr/_internal' +} from '../_internal' import type { BareFetcher, SWRHook, @@ -23,7 +23,7 @@ import type { Middleware, MutatorOptions, GlobalState -} from 'swr/_internal' +} from '../_internal' import type { SWRInfiniteConfiguration, SWRInfiniteResponse, diff --git a/src/subscription/index.ts b/src/subscription/index.ts index 66c04a430..1ecfb1ab0 100644 --- a/src/subscription/index.ts +++ b/src/subscription/index.ts @@ -17,7 +17,7 @@ import { serialize, useIsomorphicLayoutEffect, createCacheHelper -} from 'swr/_internal' +} from '../_internal' // [subscription count, disposer] type SubscriptionStates = [Map, Map void>] From 1b7c920dbccd91a1819d0cf32f9c7dc8dfa97a8e Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 18:18:07 +0100 Subject: [PATCH 10/14] rm duplicated script --- infinite/package.json | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/infinite/package.json b/infinite/package.json index 87a004cba..fcede2f5c 100644 --- a/infinite/package.json +++ b/infinite/package.json @@ -2,16 +2,5 @@ "main": "../dist/infinite/index.js", "module": "../dist/infinite/index.esm.js", "types": "../dist/infinite/index.d.ts", - "private": true, - "scripts": { - "watch": "bunchee -w", - "build": "bunchee", - "types:check": "tsc --noEmit", - "clean": "rimraf dist" - }, - "peerDependencies": { - "swr": "*", - "react": "*", - "use-sync-external-store": "*" - } + "private": true } From cd870e1a13797eacbf40d4f2c1faaaabd3ec90de Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 29 Dec 2023 18:19:47 +0100 Subject: [PATCH 11/14] fix imports --- src/infinite/serialize.ts | 2 +- src/infinite/types.ts | 2 +- src/mutation/index.ts | 4 ++-- src/mutation/state.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/infinite/serialize.ts b/src/infinite/serialize.ts index 7f2e0c9d8..96f6631af 100644 --- a/src/infinite/serialize.ts +++ b/src/infinite/serialize.ts @@ -1,5 +1,5 @@ import type { SWRInfiniteKeyLoader } from './types' -import { serialize, INFINITE_PREFIX } from 'swr/_internal' +import { serialize, INFINITE_PREFIX } from '../_internal' export const getFirstPageKey = (getKey: SWRInfiniteKeyLoader) => { return serialize(getKey ? getKey(0, null) : null)[0] diff --git a/src/infinite/types.ts b/src/infinite/types.ts index 0ecd996f5..5e9f3d255 100644 --- a/src/infinite/types.ts +++ b/src/infinite/types.ts @@ -5,7 +5,7 @@ import type { BareFetcher, State, StrictTupleKey -} from 'swr/_internal' +} from '../_internal' type FetcherResponse = Data | Promise diff --git a/src/mutation/index.ts b/src/mutation/index.ts index 79c9d3293..e15468596 100644 --- a/src/mutation/index.ts +++ b/src/mutation/index.ts @@ -1,6 +1,6 @@ import { useCallback, useRef } from 'react' import useSWR, { useSWRConfig } from '../core' -import type { Middleware, Key } from 'swr/_internal' +import type { Middleware, Key } from '../_internal' import { useStateWithDeps, startTransition } from './state' import { serialize, @@ -9,7 +9,7 @@ import { UNDEFINED, getTimestamp, mergeObjects -} from 'swr/_internal' +} from '../_internal' import type { SWRMutationConfiguration, SWRMutationResponse, diff --git a/src/mutation/state.ts b/src/mutation/state.ts index 27b736001..5a3fb7795 100644 --- a/src/mutation/state.ts +++ b/src/mutation/state.ts @@ -1,6 +1,6 @@ import type { MutableRefObject, TransitionFunction } from 'react' import React, { useRef, useCallback, useState } from 'react' -import { useIsomorphicLayoutEffect, IS_REACT_LEGACY } from 'swr/_internal' +import { useIsomorphicLayoutEffect, IS_REACT_LEGACY } from '../_internal' export const startTransition: (scope: TransitionFunction) => void = IS_REACT_LEGACY From 5b9c0fc247f668db41eeecff5297cc4a076132fa Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 1 Jan 2024 22:50:41 +0100 Subject: [PATCH 12/14] rm unused --- core/package.json | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 core/package.json diff --git a/core/package.json b/core/package.json deleted file mode 100644 index e26f203e4..000000000 --- a/core/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "main": "./dist/index.js", - "module": "./dist/index.esm.js", - "types": "./dist/index.d.ts", - "exports": { - "import": "./dist/index.mjs", - "module": "./dist/index.esm.js", - "require": "./dist/index.js" - }, - "private": true, - "scripts": { - "watch": "bunchee -w", - "build": "bunchee", - "types:check": "tsc --noEmit", - "clean": "rimraf dist" - }, - "peerDependencies": { - "client-only": "*", - "swr": "*", - "react": "*", - "use-sync-external-store": "*" - } -} From 7014e52a2994f3a42789d7952be8eebe77c1d45b Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sat, 13 Jan 2024 14:01:21 +0100 Subject: [PATCH 13/14] upgrade bunchee and fix export --- jest.config.js | 2 +- package.json | 2 +- pnpm-lock.yaml | 254 ++++++++++++++++++++++++------------------------- tsconfig.json | 2 +- 4 files changed, 129 insertions(+), 131 deletions(-) diff --git a/jest.config.js b/jest.config.js index 87c1ca0e9..0c2a62314 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,7 +5,7 @@ module.exports = { modulePathIgnorePatterns: ['/examples/'], setupFilesAfterEnv: ['/test/jest-setup.ts'], moduleNameMapper: { - '^swr$': '/src/index.ts', + '^swr$': '/index/index.ts', '^swr/infinite$': '/src/infinite/index.ts', '^swr/immutable$': '/src/immutable/index.ts', '^swr/subscription$': '/src/subscription/index.ts', diff --git a/package.json b/package.json index 73d0db428..abcaa79e0 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "@types/use-sync-external-store": "^0.0.3", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.59.8", - "bunchee": "^4.2.11", + "bunchee": "^4.3.4", "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 975cd26f3..a39206f7e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: 5.59.8 version: 5.59.8(eslint@8.42.0)(typescript@5.1.3) bunchee: - specifier: ^4.2.11 - version: 4.2.11(typescript@5.1.3) + specifier: ^4.3.4 + version: 4.3.4(typescript@5.1.3) eslint: specifier: 8.42.0 version: 8.42.0 @@ -183,12 +183,10 @@ packages: /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} - requiresBuild: true dependencies: '@babel/highlight': 7.23.4 chalk: 2.4.2 dev: true - optional: true /@babel/compat-data@7.18.8: resolution: {integrity: sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ==} @@ -200,7 +198,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.18.9 '@babel/helper-compilation-targets': 7.18.9(@babel/core@7.18.9) '@babel/helper-module-transforms': 7.18.9 @@ -311,7 +309,6 @@ packages: 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==} @@ -346,7 +343,6 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 dev: true - optional: true /@babel/parser@7.18.9: resolution: {integrity: sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg==} @@ -496,7 +492,7 @@ packages: resolution: {integrity: sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.23.5 '@babel/parser': 7.18.9 '@babel/types': 7.18.9 dev: true @@ -505,7 +501,7 @@ packages: resolution: {integrity: sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.18.9 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.18.9 @@ -863,7 +859,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@jridgewell/gen-mapping@0.3.2: @@ -871,7 +867,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/trace-mapping': 0.3.17 dev: true @@ -1024,7 +1020,7 @@ packages: fsevents: 2.3.2 dev: true - /@rollup/plugin-commonjs@25.0.7(rollup@4.9.1): + /@rollup/plugin-commonjs@25.0.7(rollup@4.9.5): resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1033,16 +1029,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 magic-string: 0.30.5 - rollup: 4.9.1 + rollup: 4.9.5 dev: true - /@rollup/plugin-esm-shim@0.1.5(rollup@4.9.1): + /@rollup/plugin-esm-shim@0.1.5(rollup@4.9.5): resolution: {integrity: sha512-xnIjDm/0EbqAw0/rR1UE7eAo9db0ftGPqT8RUCFtkFxtCuspbbmj+wutoyxm32jBytyO3SgkxSG17OR893fV7A==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1052,10 +1048,10 @@ packages: optional: true dependencies: magic-string: 0.30.5 - rollup: 4.9.1 + rollup: 4.9.5 dev: true - /@rollup/plugin-json@6.1.0(rollup@4.9.1): + /@rollup/plugin-json@6.1.0(rollup@4.9.5): resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1064,11 +1060,11 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) - rollup: 4.9.1 + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) + rollup: 4.9.5 dev: true - /@rollup/plugin-node-resolve@15.2.3(rollup@4.9.1): + /@rollup/plugin-node-resolve@15.2.3(rollup@4.9.5): resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1077,16 +1073,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) '@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: 4.9.1 + rollup: 4.9.5 dev: true - /@rollup/plugin-replace@5.0.5(rollup@4.9.1): + /@rollup/plugin-replace@5.0.5(rollup@4.9.5): resolution: {integrity: sha512-rYO4fOi8lMaTg/z5Jb+hKnrHHVn8j2lwkqwyS4kTRhKyWOLf2wST2sWXr4WzWiTcoHTp2sTjqUbqIj2E39slKQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1095,12 +1091,12 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) magic-string: 0.30.5 - rollup: 4.9.1 + rollup: 4.9.5 dev: true - /@rollup/plugin-wasm@6.2.2(rollup@4.9.1): + /@rollup/plugin-wasm@6.2.2(rollup@4.9.5): resolution: {integrity: sha512-gpC4R1G9Ni92ZIRTexqbhX7U+9estZrbhP+9SRb0DW9xpB9g7j34r+J2hqrcW/lRI7dJaU84MxZM0Rt82tqYPQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1109,11 +1105,11 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) - rollup: 4.9.1 + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) + rollup: 4.9.5 dev: true - /@rollup/pluginutils@5.1.0(rollup@4.9.1): + /@rollup/pluginutils@5.1.0(rollup@4.9.5): resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1125,107 +1121,107 @@ packages: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 4.9.1 + rollup: 4.9.5 dev: true - /@rollup/rollup-android-arm-eabi@4.9.1: - resolution: {integrity: sha512-6vMdBZqtq1dVQ4CWdhFwhKZL6E4L1dV6jUjuBvsavvNJSppzi6dLBbuV+3+IyUREaj9ZFvQefnQm28v4OCXlig==} + /@rollup/rollup-android-arm-eabi@4.9.5: + resolution: {integrity: sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.9.1: - resolution: {integrity: sha512-Jto9Fl3YQ9OLsTDWtLFPtaIMSL2kwGyGoVCmPC8Gxvym9TCZm4Sie+cVeblPO66YZsYH8MhBKDMGZ2NDxuk/XQ==} + /@rollup/rollup-android-arm64@4.9.5: + resolution: {integrity: sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.9.1: - resolution: {integrity: sha512-LtYcLNM+bhsaKAIGwVkh5IOWhaZhjTfNOkGzGqdHvhiCUVuJDalvDxEdSnhFzAn+g23wgsycmZk1vbnaibZwwA==} + /@rollup/rollup-darwin-arm64@4.9.5: + resolution: {integrity: sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.9.1: - resolution: {integrity: sha512-KyP/byeXu9V+etKO6Lw3E4tW4QdcnzDG/ake031mg42lob5tN+5qfr+lkcT/SGZaH2PdW4Z1NX9GHEkZ8xV7og==} + /@rollup/rollup-darwin-x64@4.9.5: + resolution: {integrity: sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.1: - resolution: {integrity: sha512-Yqz/Doumf3QTKplwGNrCHe/B2p9xqDghBZSlAY0/hU6ikuDVQuOUIpDP/YcmoT+447tsZTmirmjgG3znvSCR0Q==} + /@rollup/rollup-linux-arm-gnueabihf@4.9.5: + resolution: {integrity: sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.1: - resolution: {integrity: sha512-u3XkZVvxcvlAOlQJ3UsD1rFvLWqu4Ef/Ggl40WAVCuogf4S1nJPHh5RTgqYFpCOvuGJ7H5yGHabjFKEZGExk5Q==} + /@rollup/rollup-linux-arm64-gnu@4.9.5: + resolution: {integrity: sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.9.1: - resolution: {integrity: sha512-0XSYN/rfWShW+i+qjZ0phc6vZ7UWI8XWNz4E/l+6edFt+FxoEghrJHjX1EY/kcUGCnZzYYRCl31SNdfOi450Aw==} + /@rollup/rollup-linux-arm64-musl@4.9.5: + resolution: {integrity: sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.1: - resolution: {integrity: sha512-LmYIO65oZVfFt9t6cpYkbC4d5lKHLYv5B4CSHRpnANq0VZUQXGcCPXHzbCXCz4RQnx7jvlYB1ISVNCE/omz5cw==} + /@rollup/rollup-linux-riscv64-gnu@4.9.5: + resolution: {integrity: sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.9.1: - resolution: {integrity: sha512-kr8rEPQ6ns/Lmr/hiw8sEVj9aa07gh1/tQF2Y5HrNCCEPiCBGnBUt9tVusrcBBiJfIt1yNaXN6r1CCmpbFEDpg==} + /@rollup/rollup-linux-x64-gnu@4.9.5: + resolution: {integrity: sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.9.1: - resolution: {integrity: sha512-t4QSR7gN+OEZLG0MiCgPqMWZGwmeHhsM4AkegJ0Kiy6TnJ9vZ8dEIwHw1LcZKhbHxTY32hp9eVCMdR3/I8MGRw==} + /@rollup/rollup-linux-x64-musl@4.9.5: + resolution: {integrity: sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.9.1: - resolution: {integrity: sha512-7XI4ZCBN34cb+BH557FJPmh0kmNz2c25SCQeT9OiFWEgf8+dL6ZwJ8f9RnUIit+j01u07Yvrsuu1rZGxJCc51g==} + /@rollup/rollup-win32-arm64-msvc@4.9.5: + resolution: {integrity: sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.1: - resolution: {integrity: sha512-yE5c2j1lSWOH5jp+Q0qNL3Mdhr8WuqCNVjc6BxbVfS5cAS6zRmdiw7ktb8GNpDCEUJphILY6KACoFoRtKoqNQg==} + /@rollup/rollup-win32-ia32-msvc@4.9.5: + resolution: {integrity: sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.9.1: - resolution: {integrity: sha512-PyJsSsafjmIhVgaI1Zdj7m8BB8mMckFah/xbpplObyHfiXzKcI5UOUXRyOdHW7nz4DpMCuzLnF7v5IWHenCwYA==} + /@rollup/rollup-win32-x64-msvc@4.9.5: + resolution: {integrity: sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ==} cpu: [x64] os: [win32] requiresBuild: true @@ -1248,8 +1244,8 @@ packages: '@sinonjs/commons': 2.0.0 dev: true - /@swc/core-darwin-arm64@1.3.101: - resolution: {integrity: sha512-mNFK+uHNPRXSnfTOG34zJOeMl2waM4hF4a2NY7dkMXrPqw9CoJn4MwTXJcyMiSz1/BnNjjTCHF3Yhj0jPxmkzQ==} + /@swc/core-darwin-arm64@1.3.102: + resolution: {integrity: sha512-CJDxA5Wd2cUMULj3bjx4GEoiYyyiyL8oIOu4Nhrs9X+tlg8DnkCm4nI57RJGP8Mf6BaXPIJkHX8yjcefK2RlDA==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -1266,8 +1262,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.101: - resolution: {integrity: sha512-B085j8XOx73Fg15KsHvzYWG262bRweGr3JooO1aW5ec5pYbz5Ew9VS5JKYS03w2UBSxf2maWdbPz2UFAxg0whw==} + /@swc/core-darwin-x64@1.3.102: + resolution: {integrity: sha512-X5akDkHwk6oAer49oER0qZMjNMkLH3IOZaV1m98uXIasAGyjo5WH1MKPeMLY1sY6V6TrufzwiSwD4ds571ytcg==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -1284,8 +1280,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm-gnueabihf@1.3.101: - resolution: {integrity: sha512-9xLKRb6zSzRGPqdz52Hy5GuB1lSjmLqa0lST6MTFads3apmx4Vgs8Y5NuGhx/h2I8QM4jXdLbpqQlifpzTlSSw==} + /@swc/core-linux-arm-gnueabihf@1.3.102: + resolution: {integrity: sha512-kJH3XtZP9YQdjq/wYVBeFuiVQl4HaC4WwRrIxAHwe2OyvrwUI43dpW3LpxSggBnxXcVCXYWf36sTnv8S75o2Gw==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -1302,8 +1298,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.101: - resolution: {integrity: sha512-oE+r1lo7g/vs96Weh2R5l971dt+ZLuhaUX+n3BfDdPxNHfObXgKMjO7E+QS5RbGjv/AwiPCxQmbdCp/xN5ICJA==} + /@swc/core-linux-arm64-gnu@1.3.102: + resolution: {integrity: sha512-flQP2WDyCgO24WmKA1wjjTx+xfCmavUete2Kp6yrM+631IHLGnr17eu7rYJ/d4EnDBId/ytMyrnWbTVkaVrpbQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1320,8 +1316,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.101: - resolution: {integrity: sha512-OGjYG3H4BMOTnJWJyBIovCez6KiHF30zMIu4+lGJTCrxRI2fAjGLml3PEXj8tC3FMcud7U2WUn6TdG0/te2k6g==} + /@swc/core-linux-arm64-musl@1.3.102: + resolution: {integrity: sha512-bQEQSnC44DyoIGLw1+fNXKVGoCHi7eJOHr8BdH0y1ooy9ArskMjwobBFae3GX4T1AfnrTaejyr0FvLYIb0Zkog==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1338,8 +1334,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.101: - resolution: {integrity: sha512-/kBMcoF12PRO/lwa8Z7w4YyiKDcXQEiLvM+S3G9EvkoKYGgkkz4Q6PSNhF5rwg/E3+Hq5/9D2R+6nrkF287ihg==} + /@swc/core-linux-x64-gnu@1.3.102: + resolution: {integrity: sha512-dFvnhpI478svQSxqISMt00MKTDS0e4YtIr+ioZDG/uJ/q+RpcNy3QI2KMm05Fsc8Y0d4krVtvCKWgfUMsJZXAg==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1356,8 +1352,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.101: - resolution: {integrity: sha512-kDN8lm4Eew0u1p+h1l3JzoeGgZPQ05qDE0czngnjmfpsH2sOZxVj1hdiCwS5lArpy7ktaLu5JdRnx70MkUzhXw==} + /@swc/core-linux-x64-musl@1.3.102: + resolution: {integrity: sha512-+a0M3CvjeIRNA/jTCzWEDh2V+mhKGvLreHOL7J97oULZy5yg4gf7h8lQX9J8t9QLbf6fsk+0F8bVH1Ie/PbXjA==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1374,8 +1370,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.101: - resolution: {integrity: sha512-9Wn8TTLWwJKw63K/S+jjrZb9yoJfJwCE2RV5vPCCWmlMf3U1AXj5XuWOLUX+Rp2sGKau7wZKsvywhheWm+qndQ==} + /@swc/core-win32-arm64-msvc@1.3.102: + resolution: {integrity: sha512-w76JWLjkZNOfkB25nqdWUNCbt0zJ41CnWrJPZ+LxEai3zAnb2YtgB/cCIrwxDebRuMgE9EJXRj7gDDaTEAMOOQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -1392,8 +1388,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.101: - resolution: {integrity: sha512-onO5KvICRVlu2xmr4//V2je9O2XgS1SGKpbX206KmmjcJhXN5EYLSxW9qgg+kgV5mip+sKTHTAu7IkzkAtElYA==} + /@swc/core-win32-ia32-msvc@1.3.102: + resolution: {integrity: sha512-vlDb09HiGqKwz+2cxDS9T5/461ipUQBplvuhW+cCbzzGuPq8lll2xeyZU0N1E4Sz3MVdSPx1tJREuRvlQjrwNg==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -1410,8 +1406,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.101: - resolution: {integrity: sha512-T3GeJtNQV00YmiVw/88/nxJ/H43CJvFnpvBHCVn17xbahiVUOPOduh3rc9LgAkKiNt/aV8vU3OJR+6PhfMR7UQ==} + /@swc/core-win32-x64-msvc@1.3.102: + resolution: {integrity: sha512-E/jfSD7sShllxBwwgDPeXp1UxvIqehj/ShSUqq1pjR/IDRXngcRSXKJK92mJkNFY7suH6BcCWwzrxZgkO7sWmw==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -1428,8 +1424,8 @@ packages: dev: true optional: true - /@swc/core@1.3.101(@swc/helpers@0.5.3): - resolution: {integrity: sha512-w5aQ9qYsd/IYmXADAnkXPGDMTqkQalIi+kfFf/MHRKTpaOL7DHjMXwPp/n8hJ0qNjRvchzmPtOqtPBiER50d8A==} + /@swc/core@1.3.102(@swc/helpers@0.5.3): + resolution: {integrity: sha512-OAjNLY/f6QWKSDzaM3bk31A+OYHu6cPa9P/rFIx8X5d24tHXUpRiiq6/PYI6SQRjUPlB72GjsjoEU8F+ALadHg==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -1442,16 +1438,16 @@ packages: '@swc/helpers': 0.5.3 '@swc/types': 0.1.5 optionalDependencies: - '@swc/core-darwin-arm64': 1.3.101 - '@swc/core-darwin-x64': 1.3.101 - '@swc/core-linux-arm-gnueabihf': 1.3.101 - '@swc/core-linux-arm64-gnu': 1.3.101 - '@swc/core-linux-arm64-musl': 1.3.101 - '@swc/core-linux-x64-gnu': 1.3.101 - '@swc/core-linux-x64-musl': 1.3.101 - '@swc/core-win32-arm64-msvc': 1.3.101 - '@swc/core-win32-ia32-msvc': 1.3.101 - '@swc/core-win32-x64-msvc': 1.3.101 + '@swc/core-darwin-arm64': 1.3.102 + '@swc/core-darwin-x64': 1.3.102 + '@swc/core-linux-arm-gnueabihf': 1.3.102 + '@swc/core-linux-arm64-gnu': 1.3.102 + '@swc/core-linux-arm64-musl': 1.3.102 + '@swc/core-linux-x64-gnu': 1.3.102 + '@swc/core-linux-x64-musl': 1.3.102 + '@swc/core-win32-arm64-msvc': 1.3.102 + '@swc/core-win32-ia32-msvc': 1.3.102 + '@swc/core-win32-x64-msvc': 1.3.102 dev: true /@swc/core@1.3.93: @@ -2237,8 +2233,8 @@ packages: semver: 7.5.4 dev: true - /bunchee@4.2.11(typescript@5.1.3): - resolution: {integrity: sha512-hd4M7s3F8rXgN+sRBblDuSpb+3mXvOL9oY4Tmj84kn9D9euVQbnlkiX0BCvK2dQckohdgs9JA1JquqZavRrD9A==} + /bunchee@4.3.4(typescript@5.1.3): + resolution: {integrity: sha512-AP1sBrBPLD6jJGl+uTFoCmfs5GX1seWJt9Q/1oU0v45tV5Gxf7ikwgi59EreFTQ+NkmW0WP9rBiVCeyDKyZcRw==} engines: {node: '>= 18.0.0'} hasBin: true peerDependencies: @@ -2249,22 +2245,22 @@ packages: typescript: optional: true dependencies: - '@rollup/plugin-commonjs': 25.0.7(rollup@4.9.1) - '@rollup/plugin-esm-shim': 0.1.5(rollup@4.9.1) - '@rollup/plugin-json': 6.1.0(rollup@4.9.1) - '@rollup/plugin-node-resolve': 15.2.3(rollup@4.9.1) - '@rollup/plugin-replace': 5.0.5(rollup@4.9.1) - '@rollup/plugin-wasm': 6.2.2(rollup@4.9.1) - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) - '@swc/core': 1.3.101(@swc/helpers@0.5.3) + '@rollup/plugin-commonjs': 25.0.7(rollup@4.9.5) + '@rollup/plugin-esm-shim': 0.1.5(rollup@4.9.5) + '@rollup/plugin-json': 6.1.0(rollup@4.9.5) + '@rollup/plugin-node-resolve': 15.2.3(rollup@4.9.5) + '@rollup/plugin-replace': 5.0.5(rollup@4.9.5) + '@rollup/plugin-wasm': 6.2.2(rollup@4.9.5) + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) + '@swc/core': 1.3.102(@swc/helpers@0.5.3) '@swc/helpers': 0.5.3 arg: 5.0.2 pretty-bytes: 5.6.0 publint: 0.2.7 - rollup: 4.9.1 - rollup-plugin-dts: 6.1.0(rollup@4.9.1)(typescript@5.1.3) - rollup-plugin-swc3: 0.11.0(@swc/core@1.3.101)(rollup@4.9.1) - rollup-preserve-directives: 1.1.1(rollup@4.9.1) + rollup: 4.9.5 + rollup-plugin-dts: 6.1.0(rollup@4.9.5)(typescript@5.1.3) + rollup-plugin-swc3: 0.11.0(@swc/core@1.3.102)(rollup@4.9.5) + rollup-preserve-directives: 1.1.1(rollup@4.9.5) tslib: 2.6.2 typescript: 5.1.3 dev: true @@ -4628,7 +4624,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.23.5 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -4959,7 +4955,7 @@ packages: glob: 10.2.6 dev: true - /rollup-plugin-dts@6.1.0(rollup@4.9.1)(typescript@5.1.3): + /rollup-plugin-dts@6.1.0(rollup@4.9.5)(typescript@5.1.3): resolution: {integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==} engines: {node: '>=16'} peerDependencies: @@ -4967,13 +4963,13 @@ packages: typescript: ^4.5 || ^5.0 dependencies: magic-string: 0.30.5 - rollup: 4.9.1 + rollup: 4.9.5 typescript: 5.1.3 optionalDependencies: '@babel/code-frame': 7.23.5 dev: true - /rollup-plugin-swc3@0.11.0(@swc/core@1.3.101)(rollup@4.9.1): + /rollup-plugin-swc3@0.11.0(@swc/core@1.3.102)(rollup@4.9.5): resolution: {integrity: sha512-luB9Ngb1YieWPpJttKvkmjN3lG5l28SmASLbf2CoScUB2+EImU0bE8wX4EYKEqv5clVulhWRQHQvE+H33X/03g==} engines: {node: '>=12'} peerDependencies: @@ -4981,40 +4977,42 @@ packages: rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 dependencies: '@fastify/deepmerge': 1.3.0 - '@rollup/pluginutils': 5.1.0(rollup@4.9.1) - '@swc/core': 1.3.101(@swc/helpers@0.5.3) + '@rollup/pluginutils': 5.1.0(rollup@4.9.5) + '@swc/core': 1.3.102(@swc/helpers@0.5.3) get-tsconfig: 4.7.2 - rollup: 4.9.1 - rollup-preserve-directives: 1.1.1(rollup@4.9.1) + rollup: 4.9.5 + rollup-preserve-directives: 1.1.1(rollup@4.9.5) dev: true - /rollup-preserve-directives@1.1.1(rollup@4.9.1): + /rollup-preserve-directives@1.1.1(rollup@4.9.5): resolution: {integrity: sha512-+eQafbuEfDPfxQ9hQPlwaROfin4yiVRxap8hnrvvvcSGoukv1tTiYpAW9mvm3uR8J+fe4xd8FdVd5rz9q7jZ+Q==} peerDependencies: rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 dependencies: magic-string: 0.30.5 - rollup: 4.9.1 + rollup: 4.9.5 dev: true - /rollup@4.9.1: - resolution: {integrity: sha512-pgPO9DWzLoW/vIhlSoDByCzcpX92bKEorbgXuZrqxByte3JFk2xSW2JEeAcyLc9Ru9pqcNNW+Ob7ntsk2oT/Xw==} + /rollup@4.9.5: + resolution: {integrity: sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + dependencies: + '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.9.1 - '@rollup/rollup-android-arm64': 4.9.1 - '@rollup/rollup-darwin-arm64': 4.9.1 - '@rollup/rollup-darwin-x64': 4.9.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.9.1 - '@rollup/rollup-linux-arm64-gnu': 4.9.1 - '@rollup/rollup-linux-arm64-musl': 4.9.1 - '@rollup/rollup-linux-riscv64-gnu': 4.9.1 - '@rollup/rollup-linux-x64-gnu': 4.9.1 - '@rollup/rollup-linux-x64-musl': 4.9.1 - '@rollup/rollup-win32-arm64-msvc': 4.9.1 - '@rollup/rollup-win32-ia32-msvc': 4.9.1 - '@rollup/rollup-win32-x64-msvc': 4.9.1 + '@rollup/rollup-android-arm-eabi': 4.9.5 + '@rollup/rollup-android-arm64': 4.9.5 + '@rollup/rollup-darwin-arm64': 4.9.5 + '@rollup/rollup-darwin-x64': 4.9.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.9.5 + '@rollup/rollup-linux-arm64-gnu': 4.9.5 + '@rollup/rollup-linux-arm64-musl': 4.9.5 + '@rollup/rollup-linux-riscv64-gnu': 4.9.5 + '@rollup/rollup-linux-x64-gnu': 4.9.5 + '@rollup/rollup-linux-x64-musl': 4.9.5 + '@rollup/rollup-win32-arm64-msvc': 4.9.5 + '@rollup/rollup-win32-ia32-msvc': 4.9.5 + '@rollup/rollup-win32-x64-msvc': 4.9.5 fsevents: 2.3.3 dev: true @@ -5027,7 +5025,7 @@ packages: /rxjs@7.8.0: resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==} dependencies: - tslib: 2.5.0 + tslib: 2.6.2 dev: true /sade@1.8.1: diff --git a/tsconfig.json b/tsconfig.json index 76f1eb0de..5f61882ad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,7 @@ "target": "ES2018", "noEmitOnError": true, "downlevelIteration": true, - "incremental": true, + "incremental": true }, "include": ["./src/**/*", "env.d.ts"], "exclude": ["./**/dist", "examples"], From 330a1b97816f748c7b217a36dd041f74d9b18a34 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sun, 14 Jan 2024 14:51:51 +0100 Subject: [PATCH 14/14] fix alias --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 0c2a62314..2ddc733d2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,7 +5,7 @@ module.exports = { modulePathIgnorePatterns: ['/examples/'], setupFilesAfterEnv: ['/test/jest-setup.ts'], moduleNameMapper: { - '^swr$': '/index/index.ts', + '^swr$': '/src/index/index.ts', '^swr/infinite$': '/src/infinite/index.ts', '^swr/immutable$': '/src/immutable/index.ts', '^swr/subscription$': '/src/subscription/index.ts',