Skip to content

Commit 8c96607

Browse files
authored
chore: inline certain dependencies to reduce size (#5691)
1 parent 2c19d35 commit 8c96607

File tree

7 files changed

+225
-28
lines changed

7 files changed

+225
-28
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
"@sinonjs/[email protected]": "patches/@[email protected]",
8686
8787
"@types/[email protected]": "patches/@[email protected]",
88-
88+
89+
8990
}
9091
},
9192
"simple-git-hooks": {

packages/vitest/LICENSE.md

+172
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,35 @@ Repository: https://github.com/sinonjs/fake-timers.git
196196
197197
---------------------------------------
198198

199+
## acorn-walk
200+
License: MIT
201+
By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine
202+
Repository: https://github.com/acornjs/acorn.git
203+
204+
> MIT License
205+
>
206+
> Copyright (C) 2012-2020 by various contributors (see AUTHORS)
207+
>
208+
> Permission is hereby granted, free of charge, to any person obtaining a copy
209+
> of this software and associated documentation files (the "Software"), to deal
210+
> in the Software without restriction, including without limitation the rights
211+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
212+
> copies of the Software, and to permit persons to whom the Software is
213+
> furnished to do so, subject to the following conditions:
214+
>
215+
> The above copyright notice and this permission notice shall be included in
216+
> all copies or substantial portions of the Software.
217+
>
218+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
219+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
220+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
221+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
222+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
223+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
224+
> THE SOFTWARE.
225+
226+
---------------------------------------
227+
199228
## ansi-escapes
200229
License: MIT
201230
By: Sindre Sorhus
@@ -932,6 +961,35 @@ Repository: jonschlinkert/is-number
932961
933962
---------------------------------------
934963

964+
## js-tokens
965+
License: MIT
966+
By: Simon Lydell
967+
Repository: lydell/js-tokens
968+
969+
> The MIT License (MIT)
970+
>
971+
> Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell
972+
>
973+
> Permission is hereby granted, free of charge, to any person obtaining a copy
974+
> of this software and associated documentation files (the "Software"), to deal
975+
> in the Software without restriction, including without limitation the rights
976+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
977+
> copies of the Software, and to permit persons to whom the Software is
978+
> furnished to do so, subject to the following conditions:
979+
>
980+
> The above copyright notice and this permission notice shall be included in
981+
> all copies or substantial portions of the Software.
982+
>
983+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
984+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
985+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
986+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
987+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
988+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
989+
> THE SOFTWARE.
990+
991+
---------------------------------------
992+
935993
## kleur
936994
License: MIT
937995
By: Luke Edwards
@@ -961,6 +1019,35 @@ Repository: lukeed/kleur
9611019
9621020
---------------------------------------
9631021

1022+
## local-pkg
1023+
License: MIT
1024+
By: Anthony Fu
1025+
Repository: git+https://github.com/antfu/local-pkg.git
1026+
1027+
> MIT License
1028+
>
1029+
> Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
1030+
>
1031+
> Permission is hereby granted, free of charge, to any person obtaining a copy
1032+
> of this software and associated documentation files (the "Software"), to deal
1033+
> in the Software without restriction, including without limitation the rights
1034+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1035+
> copies of the Software, and to permit persons to whom the Software is
1036+
> furnished to do so, subject to the following conditions:
1037+
>
1038+
> The above copyright notice and this permission notice shall be included in all
1039+
> copies or substantial portions of the Software.
1040+
>
1041+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1042+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1043+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1044+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1045+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1046+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1047+
> SOFTWARE.
1048+
1049+
---------------------------------------
1050+
9641051
## locate-path
9651052
License: MIT
9661053
By: Sindre Sorhus
@@ -1069,6 +1156,34 @@ Repository: sindresorhus/mimic-fn
10691156
10701157
---------------------------------------
10711158

1159+
## mlly
1160+
License: MIT
1161+
Repository: unjs/mlly
1162+
1163+
> MIT License
1164+
>
1165+
> Copyright (c) Pooya Parsa <[email protected]>
1166+
>
1167+
> Permission is hereby granted, free of charge, to any person obtaining a copy
1168+
> of this software and associated documentation files (the "Software"), to deal
1169+
> in the Software without restriction, including without limitation the rights
1170+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1171+
> copies of the Software, and to permit persons to whom the Software is
1172+
> furnished to do so, subject to the following conditions:
1173+
>
1174+
> The above copyright notice and this permission notice shall be included in all
1175+
> copies or substantial portions of the Software.
1176+
>
1177+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1178+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1179+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1180+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1181+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1182+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1183+
> SOFTWARE.
1184+
1185+
---------------------------------------
1186+
10721187
## onetime
10731188
License: MIT
10741189
By: Sindre Sorhus
@@ -1413,6 +1528,35 @@ Repository: chalk/strip-ansi
14131528
14141529
---------------------------------------
14151530

1531+
## strip-literal
1532+
License: MIT
1533+
By: Anthony Fu
1534+
Repository: git+https://github.com/antfu/strip-literal.git
1535+
1536+
> MIT License
1537+
>
1538+
> Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
1539+
>
1540+
> Permission is hereby granted, free of charge, to any person obtaining a copy
1541+
> of this software and associated documentation files (the "Software"), to deal
1542+
> in the Software without restriction, including without limitation the rights
1543+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1544+
> copies of the Software, and to permit persons to whom the Software is
1545+
> furnished to do so, subject to the following conditions:
1546+
>
1547+
> The above copyright notice and this permission notice shall be included in all
1548+
> copies or substantial portions of the Software.
1549+
>
1550+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1551+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1552+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1553+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1554+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1555+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1556+
> SOFTWARE.
1557+
1558+
---------------------------------------
1559+
14161560
## to-regex-range
14171561
License: MIT
14181562
By: Jon Schlinkert, Rouven Weßling
@@ -1469,6 +1613,34 @@ Repository: git+ssh://[email protected]/chaijs/type-detect.git
14691613
14701614
---------------------------------------
14711615

1616+
## ufo
1617+
License: MIT
1618+
Repository: unjs/ufo
1619+
1620+
> MIT License
1621+
>
1622+
> Copyright (c) Pooya Parsa <[email protected]>
1623+
>
1624+
> Permission is hereby granted, free of charge, to any person obtaining a copy
1625+
> of this software and associated documentation files (the "Software"), to deal
1626+
> in the Software without restriction, including without limitation the rights
1627+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1628+
> copies of the Software, and to permit persons to whom the Software is
1629+
> furnished to do so, subject to the following conditions:
1630+
>
1631+
> The above copyright notice and this permission notice shall be included in all
1632+
> copies or substantial portions of the Software.
1633+
>
1634+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1635+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1636+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1637+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1638+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1639+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1640+
> SOFTWARE.
1641+
1642+
---------------------------------------
1643+
14721644
## wrap-ansi
14731645
License: MIT
14741646
By: Sindre Sorhus

packages/vitest/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,13 @@
152152
"@vitest/snapshot": "workspace:*",
153153
"@vitest/spy": "workspace:*",
154154
"@vitest/utils": "workspace:*",
155-
"acorn-walk": "^8.3.2",
156155
"chai": "^4.3.10",
157156
"debug": "^4.3.4",
158157
"execa": "^8.0.1",
159-
"local-pkg": "^0.5.0",
160158
"magic-string": "^0.30.5",
161159
"pathe": "^1.1.1",
162160
"picocolors": "^1.0.0",
163161
"std-env": "^3.5.0",
164-
"strip-literal": "^2.0.0",
165162
"tinybench": "^2.5.1",
166163
"tinypool": "^0.8.3",
167164
"vite": "^5.0.0",
@@ -181,6 +178,7 @@
181178
"@types/node": "^20.11.5",
182179
"@types/prompts": "^2.4.9",
183180
"@types/sinonjs__fake-timers": "^8.1.5",
181+
"acorn-walk": "^8.3.2",
184182
"birpc": "0.2.15",
185183
"cac": "^6.7.14",
186184
"chai-subset": "^1.6.0",
@@ -192,12 +190,14 @@
192190
"get-tsconfig": "^4.7.3",
193191
"happy-dom": "^14.3.10",
194192
"jsdom": "^24.0.0",
193+
"local-pkg": "^0.5.0",
195194
"log-update": "^5.0.1",
196195
"micromatch": "^4.0.5",
197196
"p-limit": "^5.0.0",
198197
"pretty-format": "^29.7.0",
199198
"prompts": "^2.4.2",
200199
"strip-ansi": "^7.1.0",
200+
"strip-literal": "^2.0.0",
201201
"ws": "^8.14.2"
202202
}
203203
}

packages/vitest/src/node/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type { Logger } from './logger'
1616

1717
function resolvePath(path: string, root: string) {
1818
return normalize(
19-
resolveModule(path, { paths: [root] })
19+
/* @__PURE__ */ resolveModule(path, { paths: [root] })
2020
?? resolve(root, path),
2121
)
2222
}

packages/vitest/src/node/packageInstaller.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class VitestPackageInstaller {
2222
}
2323
}
2424

25-
if (isPackageExists(dependency, { paths: [root, __dirname] }))
25+
if (/* @__PURE__ */ isPackageExists(dependency, { paths: [root, __dirname] }))
2626
return true
2727

2828
const promptInstall = !isCI && process.stdout.isTTY

patches/[email protected]

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/package.json b/package.json
2+
index 1b8dc76afc3cf5890cc3693c2975577fd3117dd6..d215ae8677dc8b82c0f4d9b9af557b860ac16292 100644
3+
--- a/package.json
4+
+++ b/package.json
5+
@@ -5,6 +5,7 @@
6+
"main": "dist/acorn.js",
7+
"types": "dist/acorn.d.ts",
8+
"module": "dist/acorn.mjs",
9+
+ "sideEffects": false,
10+
"exports": {
11+
".": [
12+
{

0 commit comments

Comments
 (0)