Skip to content

Commit cc05acd

Browse files
cyphercodesantfu
andauthored
fix: declare optional peer types (#606)
* fix: declare bundler type imports as optional peers * fix: satisfy optional peer dependency checks --------- Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com> Co-authored-by: Anthony Fu <github@antfu.me>
1 parent de9a2ef commit cc05acd

4 files changed

Lines changed: 54 additions & 13 deletions

File tree

package.json

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,46 @@
4646
"test": "nr test:build && vitest run",
4747
"test:build": "jiti scripts/buildFixtures.ts"
4848
},
49+
"peerDependencies": {
50+
"@farmfe/core": "*",
51+
"@rspack/core": "*",
52+
"bun-types-no-globals": "*",
53+
"esbuild": "*",
54+
"rolldown": "*",
55+
"rollup": "*",
56+
"unloader": "*",
57+
"vite": "*",
58+
"webpack": "*"
59+
},
60+
"peerDependenciesMeta": {
61+
"@farmfe/core": {
62+
"optional": true
63+
},
64+
"@rspack/core": {
65+
"optional": true
66+
},
67+
"bun-types-no-globals": {
68+
"optional": true
69+
},
70+
"esbuild": {
71+
"optional": true
72+
},
73+
"rolldown": {
74+
"optional": true
75+
},
76+
"rollup": {
77+
"optional": true
78+
},
79+
"unloader": {
80+
"optional": true
81+
},
82+
"vite": {
83+
"optional": true
84+
},
85+
"webpack": {
86+
"optional": true
87+
}
88+
},
4989
"dependencies": {
5090
"@jridgewell/remapping": "catalog:prod",
5191
"picomatch": "catalog:prod",
@@ -64,8 +104,8 @@
64104
"@typescript/native-preview": "catalog:dev",
65105
"ansis": "catalog:dev",
66106
"bumpp": "catalog:dev",
67-
"bun-types-no-globals": "catalog:dev",
68-
"esbuild": "catalog:dev",
107+
"bun-types-no-globals": "catalog:peer",
108+
"esbuild": "catalog:peer",
69109
"eslint": "catalog:dev",
70110
"eslint-plugin-format": "catalog:dev",
71111
"jiti": "catalog:dev",
@@ -86,7 +126,7 @@
86126
"webpack-cli": "catalog:test"
87127
},
88128
"resolutions": {
89-
"esbuild": "catalog:dev"
129+
"esbuild": "catalog:peer"
90130
},
91131
"simple-git-hooks": {
92132
"pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && pnpm exec lint-staged"

pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ catalogs:
2020
'@typescript/native-preview': 7.0.0-dev.20260508.1
2121
ansis: ^4.3.1
2222
bumpp: ^11.1.0
23-
bun-types-no-globals: ^1.3.11
24-
esbuild: ^0.28.1
2523
eslint: ^10.5.0
2624
eslint-plugin-format: ^2.0.1
2725
jiti: ^2.7.0
@@ -52,6 +50,8 @@ catalogs:
5250
peer:
5351
'@farmfe/core': ^1.7.11
5452
'@rspack/core': ^2.0.8
53+
bun-types-no-globals: ^1.3.11
54+
esbuild: ^0.28.1
5555
rolldown: ^1.1.2
5656
rollup: ^4.62.2
5757
unloader: ^0.9.0

tsdown.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default defineConfig({
2121
},
2222
unused: {
2323
level: 'error',
24+
ignore: ['bun-types-no-globals'],
2425
},
2526
exports: true,
2627
publint: 'ci-only',

0 commit comments

Comments
 (0)