Skip to content

Commit

Permalink
resolve swr internal imports as external (#2225)
Browse files Browse the repository at this point in the history
* resolve swr imports as external

* build subpackage by order

* fix type path

* bump bunchee for type path fixing
  • Loading branch information
huozhi authored Nov 10, 2022
1 parent 69105b4 commit 822a619
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion _internal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/_internal/index.d.ts",
"types": "./dist/index.d.ts",
"exports": "./dist/index.mjs",
"private": true,
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"csb:build": "pnpm install && pnpm build",
"clean": "pnpm -r run clean",
"watch": "pnpm -r run watch",
"build": "pnpm -r run build",
"build": "pnpm build-package _internal && pnpm build-package core && pnpm build-package infinite && pnpm build-package immutable && pnpm build-package mutation",
"build-package": "bunchee index.ts --cwd",
"types:check": "pnpm -r run types:check",
"prepublishOnly": "pnpm clean && pnpm build",
"publish-beta": "pnpm publish --tag beta",
Expand Down Expand Up @@ -98,7 +99,7 @@
"@types/use-sync-external-store": "^0.0.3",
"@typescript-eslint/eslint-plugin": "5.36.1",
"@typescript-eslint/parser": "5.36.1",
"bunchee": "2.1.5",
"bunchee": "2.1.6",
"eslint": "8.15.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest-dom": "4.0.1",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"compilerOptions": {
"strict": false
},
"include": [".", "./jest-setup.ts"],
"include": [".", "./jest-setup.ts"],
"exclude": ["./type"]
}
2 changes: 1 addition & 1 deletion test/type/mutator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
Mutator,
MutatorWrapper,
Arguments
} from '../../_internal/types'
} from 'swr/_internal'
import { expectType } from './utils'

type Case1<Data = any> = MutatorFn<Data>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"swr/_internal": ["./_internal/index.ts"]
},
"incremental": true
},
},
"exclude": ["./**/dist", "examples"],
"watchOptions": {
"watchFile": "useFsEvents",
Expand Down

0 comments on commit 822a619

Please sign in to comment.