@modern-js/module-tools 2.0.0-beta.3 → 2.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/CHANGELOG.md +331 -211
  2. package/bin/modern.js +1 -0
  3. package/compiled/@babel/code-frame/index.d.ts +1 -0
  4. package/compiled/@babel/code-frame/index.js +1 -0
  5. package/compiled/@babel/code-frame/license +22 -0
  6. package/compiled/@babel/code-frame/package.json +1 -0
  7. package/compiled/@babel/generator/index.d.ts +1 -0
  8. package/compiled/@babel/generator/index.js +1 -0
  9. package/compiled/@babel/generator/license +22 -0
  10. package/compiled/@babel/generator/package.json +1 -0
  11. package/compiled/@babel/helper-validator-identifier/index.d.ts +1 -0
  12. package/compiled/@babel/helper-validator-identifier/index.js +1 -0
  13. package/compiled/@babel/helper-validator-identifier/license +22 -0
  14. package/compiled/@babel/helper-validator-identifier/package.json +1 -0
  15. package/compiled/@babel/highlight/index.d.ts +1 -0
  16. package/compiled/@babel/highlight/index.js +1 -0
  17. package/compiled/@babel/highlight/license +22 -0
  18. package/compiled/@babel/highlight/package.json +1 -0
  19. package/compiled/@babel/parser/@babel/types/lib/index-legacy.d.ts +2742 -0
  20. package/compiled/@babel/parser/index.js +1 -0
  21. package/compiled/@babel/parser/license +19 -0
  22. package/compiled/@babel/parser/package.json +1 -0
  23. package/compiled/@babel/parser/typings/babel-parser.d.ts +214 -0
  24. package/compiled/@babel/template/index.d.ts +1 -0
  25. package/compiled/@babel/template/index.js +1 -0
  26. package/compiled/@babel/template/license +22 -0
  27. package/compiled/@babel/template/package.json +1 -0
  28. package/compiled/@babel/traverse/index.d.ts +1199 -0
  29. package/compiled/@babel/traverse/index.js +1 -0
  30. package/compiled/@babel/traverse/license +22 -0
  31. package/compiled/@babel/traverse/package.json +1 -0
  32. package/compiled/@babel/types/index.js +1 -0
  33. package/compiled/@babel/types/lib/index-legacy.d.ts +2732 -0
  34. package/compiled/@babel/types/license +22 -0
  35. package/compiled/@babel/types/package.json +1 -0
  36. package/compiled/@rollup/plugin-json/@rollup/pluginutils/types/index.d.ts +86 -0
  37. package/compiled/@rollup/plugin-json/estree/index.d.ts +548 -0
  38. package/compiled/@rollup/plugin-json/index.js +1 -0
  39. package/compiled/@rollup/plugin-json/license +21 -0
  40. package/compiled/@rollup/plugin-json/package.json +1 -0
  41. package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +948 -0
  42. package/compiled/@rollup/plugin-json/types/index.d.ts +41 -0
  43. package/compiled/find-up/index.d.ts +138 -0
  44. package/compiled/find-up/index.js +1 -0
  45. package/compiled/find-up/license +9 -0
  46. package/compiled/find-up/locate-path/index.d.ts +83 -0
  47. package/compiled/find-up/package.json +1 -0
  48. package/compiled/less/index.d.ts +282 -0
  49. package/compiled/less/index.js +1 -0
  50. package/compiled/less/package.json +1 -0
  51. package/compiled/normalize-path/index.d.ts +8 -0
  52. package/compiled/normalize-path/index.js +8 -0
  53. package/compiled/normalize-path/license +21 -0
  54. package/compiled/normalize-path/package.json +1 -0
  55. package/compiled/p-map/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
  56. package/compiled/p-map/cacheable-lookup/index.d.ts +139 -0
  57. package/compiled/p-map/cacheable-request/index.d.ts +137 -0
  58. package/compiled/p-map/got/dist/source/as-promise/index.d.ts +3 -0
  59. package/compiled/p-map/got/dist/source/as-promise/types.d.ts +256 -0
  60. package/compiled/p-map/got/dist/source/core/index.d.ts +1124 -0
  61. package/compiled/p-map/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
  62. package/compiled/p-map/got/dist/source/core/utils/options-to-url.d.ts +14 -0
  63. package/compiled/p-map/got/dist/source/core/utils/timed-out.d.ts +29 -0
  64. package/compiled/p-map/got/dist/source/index.d.ts +4 -0
  65. package/compiled/p-map/got/dist/source/types.d.ts +344 -0
  66. package/compiled/p-map/http-cache-semantics/index.d.ts +170 -0
  67. package/compiled/p-map/index.d.ts +67 -0
  68. package/compiled/p-map/index.js +1 -0
  69. package/compiled/p-map/keyv/src/index.d.ts +104 -0
  70. package/compiled/p-map/license +9 -0
  71. package/compiled/p-map/p-cancelable/index.d.ts +176 -0
  72. package/compiled/p-map/package.json +1 -0
  73. package/compiled/p-map/responselike/index.d.ts +34 -0
  74. package/compiled/postcss-custom-properties/index.d.ts +1 -0
  75. package/compiled/postcss-custom-properties/index.js +1 -0
  76. package/compiled/postcss-custom-properties/package.json +1 -0
  77. package/compiled/postcss-flexbugs-fixes/index.d.ts +1 -0
  78. package/compiled/postcss-flexbugs-fixes/index.js +1 -0
  79. package/compiled/postcss-flexbugs-fixes/license +20 -0
  80. package/compiled/postcss-flexbugs-fixes/package.json +1 -0
  81. package/compiled/postcss-font-variant/index.d.ts +1 -0
  82. package/compiled/postcss-font-variant/index.js +1 -0
  83. package/compiled/postcss-font-variant/license +20 -0
  84. package/compiled/postcss-font-variant/package.json +1 -0
  85. package/compiled/postcss-initial/index.d.ts +1 -0
  86. package/compiled/postcss-initial/index.js +1 -0
  87. package/compiled/postcss-initial/license +20 -0
  88. package/compiled/postcss-initial/package.json +1 -0
  89. package/compiled/postcss-media-minmax/index.d.ts +1 -0
  90. package/compiled/postcss-media-minmax/index.js +1 -0
  91. package/compiled/postcss-media-minmax/license +22 -0
  92. package/compiled/postcss-media-minmax/package.json +1 -0
  93. package/compiled/postcss-nesting/index.d.ts +1 -0
  94. package/compiled/postcss-nesting/index.js +2 -0
  95. package/compiled/postcss-nesting/package.json +1 -0
  96. package/compiled/postcss-page-break/index.d.ts +1 -0
  97. package/compiled/postcss-page-break/index.js +1 -0
  98. package/compiled/postcss-page-break/license +20 -0
  99. package/compiled/postcss-page-break/package.json +1 -0
  100. package/compiled/postcss-value-parser/index.d.ts +1 -0
  101. package/compiled/postcss-value-parser/index.js +1 -0
  102. package/compiled/postcss-value-parser/license +22 -0
  103. package/compiled/postcss-value-parser/package.json +1 -0
  104. package/compiled/rollup/fsevents.node +0 -0
  105. package/compiled/rollup/index.js +82 -0
  106. package/compiled/rollup/package.json +1 -0
  107. package/compiled/rollup/types/rollup.d.ts +948 -0
  108. package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +21 -0
  109. package/compiled/rollup-plugin-dts/index.js +1 -0
  110. package/compiled/rollup-plugin-dts/package.json +1 -0
  111. package/compiled/rollup-plugin-dts/rollup/dist/rollup.d.ts +948 -0
  112. package/compiled/sass/index.js +1 -0
  113. package/compiled/sass/license +1619 -0
  114. package/compiled/sass/package.json +1 -0
  115. package/compiled/sass/types/compile.d.ts +152 -0
  116. package/compiled/sass/types/exception.d.ts +41 -0
  117. package/compiled/sass/types/importer.d.ts +294 -0
  118. package/compiled/sass/types/index.d.ts +80 -0
  119. package/compiled/sass/types/legacy/exception.d.ts +54 -0
  120. package/compiled/sass/types/legacy/function.d.ts +756 -0
  121. package/compiled/sass/types/legacy/importer.d.ts +168 -0
  122. package/compiled/sass/types/legacy/options.d.ts +642 -0
  123. package/compiled/sass/types/legacy/plugin_this.d.ts +73 -0
  124. package/compiled/sass/types/legacy/render.d.ts +139 -0
  125. package/compiled/sass/types/logger/index.d.ts +94 -0
  126. package/compiled/sass/types/logger/source_location.d.ts +21 -0
  127. package/compiled/sass/types/logger/source_span.d.ts +34 -0
  128. package/compiled/sass/types/options.d.ts +435 -0
  129. package/compiled/sass/types/util/promise_or.d.ts +17 -0
  130. package/compiled/sass/types/value/argument_list.d.ts +47 -0
  131. package/compiled/sass/types/value/boolean.d.ts +29 -0
  132. package/compiled/sass/types/value/color.d.ts +107 -0
  133. package/compiled/sass/types/value/function.d.ts +22 -0
  134. package/compiled/sass/types/value/index.d.ts +173 -0
  135. package/compiled/sass/types/value/list.d.ts +54 -0
  136. package/compiled/sass/types/value/map.d.ts +41 -0
  137. package/compiled/sass/types/value/number.d.ts +305 -0
  138. package/compiled/sass/types/value/string.d.ts +84 -0
  139. package/compiled/signal-exit/index.d.ts +24 -0
  140. package/compiled/signal-exit/index.js +1 -0
  141. package/compiled/signal-exit/package.json +1 -0
  142. package/dist/builder/build.d.ts +23 -0
  143. package/dist/builder/build.js +269 -0
  144. package/dist/builder/build.js.map +1 -0
  145. package/dist/builder/clear.d.ts +3 -0
  146. package/dist/builder/clear.js +67 -0
  147. package/dist/builder/clear.js.map +1 -0
  148. package/dist/builder/copy.d.ts +11 -0
  149. package/dist/builder/copy.js +196 -0
  150. package/dist/builder/copy.js.map +1 -0
  151. package/dist/builder/dts/index.d.ts +2 -0
  152. package/dist/builder/dts/index.js +32 -0
  153. package/dist/builder/dts/index.js.map +1 -0
  154. package/dist/builder/dts/rollup.d.ts +17 -0
  155. package/dist/builder/dts/rollup.js +167 -0
  156. package/dist/builder/dts/rollup.js.map +1 -0
  157. package/dist/builder/dts/tsc.d.ts +3 -0
  158. package/dist/builder/dts/tsc.js +153 -0
  159. package/dist/builder/dts/tsc.js.map +1 -0
  160. package/dist/builder/index.d.ts +8 -0
  161. package/dist/builder/index.js +116 -0
  162. package/dist/builder/index.js.map +1 -0
  163. package/dist/builder/platform.d.ts +4 -0
  164. package/dist/builder/platform.js +132 -0
  165. package/dist/builder/platform.js.map +1 -0
  166. package/dist/cli.d.ts +3 -0
  167. package/dist/cli.js +95 -0
  168. package/dist/cli.js.map +1 -0
  169. package/dist/command.d.ts +7 -0
  170. package/dist/command.js +164 -0
  171. package/dist/command.js.map +1 -0
  172. package/dist/config/defineConfig.d.ts +2 -0
  173. package/dist/config/defineConfig.js +29 -0
  174. package/dist/config/defineConfig.js.map +1 -0
  175. package/dist/config/normalize.d.ts +17 -0
  176. package/dist/config/normalize.js +168 -0
  177. package/dist/config/normalize.js.map +1 -0
  178. package/dist/config/schema.d.ts +641 -0
  179. package/dist/config/schema.js +215 -0
  180. package/dist/config/schema.js.map +1 -0
  181. package/dist/constants/build-presets.d.ts +81 -0
  182. package/dist/constants/build-presets.js +236 -0
  183. package/dist/constants/build-presets.js.map +1 -0
  184. package/dist/constants/build.d.ts +5 -0
  185. package/dist/constants/build.js +78 -0
  186. package/dist/constants/build.js.map +1 -0
  187. package/dist/constants/colors.d.ts +4 -0
  188. package/dist/constants/colors.js +35 -0
  189. package/dist/constants/colors.js.map +1 -0
  190. package/dist/constants/dts.d.ts +4 -0
  191. package/dist/constants/dts.js +52 -0
  192. package/dist/constants/dts.js.map +1 -0
  193. package/dist/constants/file.d.ts +3 -0
  194. package/dist/constants/file.js +35 -0
  195. package/dist/constants/file.js.map +1 -0
  196. package/dist/constants/legacy-build-presets.d.ts +13 -0
  197. package/dist/constants/legacy-build-presets.js +198 -0
  198. package/dist/constants/legacy-build-presets.js.map +1 -0
  199. package/dist/constants/log.d.ts +8 -0
  200. package/dist/constants/log.js +43 -0
  201. package/dist/constants/log.js.map +1 -0
  202. package/dist/dev.d.ts +10 -0
  203. package/dist/dev.js +129 -0
  204. package/dist/dev.js.map +1 -0
  205. package/dist/{types/features/build/error.d.ts → error.d.ts} +1 -1
  206. package/dist/error.js +148 -0
  207. package/dist/error.js.map +1 -0
  208. package/dist/hooks/build.d.ts +22 -0
  209. package/dist/hooks/build.js +39 -0
  210. package/dist/hooks/build.js.map +1 -0
  211. package/dist/hooks/dev.d.ts +12 -0
  212. package/dist/hooks/dev.js +37 -0
  213. package/dist/hooks/dev.js.map +1 -0
  214. package/dist/hooks/index.d.ts +29 -0
  215. package/dist/hooks/index.js +46 -0
  216. package/dist/hooks/index.js.map +1 -0
  217. package/dist/hooks/misc.d.ts +5 -0
  218. package/dist/hooks/misc.js +33 -0
  219. package/dist/hooks/misc.js.map +1 -0
  220. package/dist/index.d.ts +5 -0
  221. package/dist/index.js +37 -0
  222. package/dist/index.js.map +1 -0
  223. package/dist/{types/locale → locale}/en.d.ts +0 -0
  224. package/dist/locale/en.js +51 -0
  225. package/dist/locale/en.js.map +1 -0
  226. package/dist/{types/locale → locale}/index.d.ts +0 -0
  227. package/dist/locale/index.js +39 -0
  228. package/dist/locale/index.js.map +1 -0
  229. package/dist/{types/locale → locale}/zh.d.ts +0 -0
  230. package/dist/locale/zh.js +51 -0
  231. package/dist/locale/zh.js.map +1 -0
  232. package/dist/plugins.d.ts +2 -0
  233. package/dist/plugins.js +55 -0
  234. package/dist/plugins.js.map +1 -0
  235. package/dist/types/color.d.ts +1 -0
  236. package/dist/types/color.js +17 -0
  237. package/dist/types/color.js.map +1 -0
  238. package/dist/types/command.d.ts +11 -0
  239. package/dist/types/command.js +17 -0
  240. package/dist/types/command.js.map +1 -0
  241. package/dist/types/config/index.d.ts +92 -0
  242. package/dist/types/config/index.js +19 -0
  243. package/dist/types/config/index.js.map +1 -0
  244. package/dist/types/config/style.d.ts +12 -0
  245. package/dist/types/config/style.js +17 -0
  246. package/dist/types/config/style.js.map +1 -0
  247. package/dist/types/context.d.ts +5 -0
  248. package/dist/types/context.js +17 -0
  249. package/dist/types/context.js.map +1 -0
  250. package/dist/types/copy.d.ts +15 -0
  251. package/dist/types/copy.js +17 -0
  252. package/dist/types/copy.js.map +1 -0
  253. package/dist/types/{utils/tsconfig.d.ts → dts.d.ts} +11 -3
  254. package/dist/types/dts.js +17 -0
  255. package/dist/types/dts.js.map +1 -0
  256. package/dist/types/hooks.d.ts +25 -0
  257. package/dist/types/hooks.js +17 -0
  258. package/dist/types/hooks.js.map +1 -0
  259. package/dist/types/index.d.ts +17 -6
  260. package/dist/types/index.js +23 -0
  261. package/dist/types/index.js.map +1 -0
  262. package/dist/types/utils.d.ts +7 -0
  263. package/dist/types/utils.js +17 -0
  264. package/dist/types/utils.js.map +1 -0
  265. package/dist/utils/builder.d.ts +8 -0
  266. package/dist/utils/builder.js +104 -0
  267. package/dist/utils/builder.js.map +1 -0
  268. package/dist/utils/config.d.ts +6 -0
  269. package/dist/utils/config.js +167 -0
  270. package/dist/utils/config.js.map +1 -0
  271. package/dist/utils/context.d.ts +7 -0
  272. package/dist/utils/context.js +60 -0
  273. package/dist/utils/context.js.map +1 -0
  274. package/dist/utils/dts.d.ts +14 -0
  275. package/dist/utils/dts.js +186 -0
  276. package/dist/utils/dts.js.map +1 -0
  277. package/dist/utils/input.d.ts +16 -0
  278. package/dist/utils/input.js +113 -0
  279. package/dist/utils/input.js.map +1 -0
  280. package/dist/utils/language.d.ts +2 -0
  281. package/dist/utils/language.js +68 -0
  282. package/dist/utils/language.js.map +1 -0
  283. package/dist/utils/libuild-plugins.d.ts +6 -0
  284. package/dist/utils/libuild-plugins.js +83 -0
  285. package/dist/utils/libuild-plugins.js.map +1 -0
  286. package/dist/utils/log.d.ts +2 -0
  287. package/dist/utils/log.js +68 -0
  288. package/dist/utils/log.js.map +1 -0
  289. package/dist/utils/onExit.d.ts +1 -0
  290. package/dist/utils/onExit.js +63 -0
  291. package/dist/utils/onExit.js.map +1 -0
  292. package/dist/utils/path.d.ts +1 -0
  293. package/dist/utils/path.js +59 -0
  294. package/dist/utils/path.js.map +1 -0
  295. package/dist/utils/style.d.ts +31 -0
  296. package/dist/utils/style.js +129 -0
  297. package/dist/utils/style.js.map +1 -0
  298. package/dist/{types/utils/tspaths-transform/index.d.ts → utils/tspaths-transform.d.ts} +0 -0
  299. package/dist/utils/tspaths-transform.js +119 -0
  300. package/dist/utils/tspaths-transform.js.map +1 -0
  301. package/package.json +43 -72
  302. package/dist/js/modern/cli/build.js +0 -11
  303. package/dist/js/modern/cli/dev.js +0 -11
  304. package/dist/js/modern/cli/index.js +0 -3
  305. package/dist/js/modern/cli/new.js +0 -13
  306. package/dist/js/modern/commands/build.js +0 -69
  307. package/dist/js/modern/commands/dev.js +0 -43
  308. package/dist/js/modern/commands/index.js +0 -2
  309. package/dist/js/modern/features/build/build-platform.js +0 -69
  310. package/dist/js/modern/features/build/bundle/index.js +0 -9
  311. package/dist/js/modern/features/build/bundle/runRollup.js +0 -136
  312. package/dist/js/modern/features/build/bundle/runSpeedy.js +0 -176
  313. package/dist/js/modern/features/build/bundleless/copy-assets.js +0 -75
  314. package/dist/js/modern/features/build/bundleless/generator-dts/index.js +0 -106
  315. package/dist/js/modern/features/build/bundleless/generator-dts/utils.js +0 -94
  316. package/dist/js/modern/features/build/bundleless/index.js +0 -21
  317. package/dist/js/modern/features/build/bundleless/runBabel.js +0 -242
  318. package/dist/js/modern/features/build/bundleless/style.js +0 -241
  319. package/dist/js/modern/features/build/constants.js +0 -98
  320. package/dist/js/modern/features/build/error.js +0 -127
  321. package/dist/js/modern/features/build/index.js +0 -117
  322. package/dist/js/modern/features/build/legacy-constants.js +0 -103
  323. package/dist/js/modern/features/build/logger/index.js +0 -2
  324. package/dist/js/modern/features/build/logger/logText.js +0 -56
  325. package/dist/js/modern/features/build/logger/loggerManager.js +0 -93
  326. package/dist/js/modern/features/build/normalize.js +0 -277
  327. package/dist/js/modern/features/build/types.js +0 -0
  328. package/dist/js/modern/features/build/utils.js +0 -92
  329. package/dist/js/modern/features/dev/index.js +0 -47
  330. package/dist/js/modern/hooks/build.js +0 -20
  331. package/dist/js/modern/hooks/dev.js +0 -14
  332. package/dist/js/modern/hooks/index.js +0 -15
  333. package/dist/js/modern/index.js +0 -63
  334. package/dist/js/modern/locale/en.js +0 -25
  335. package/dist/js/modern/locale/index.js +0 -10
  336. package/dist/js/modern/locale/zh.js +0 -25
  337. package/dist/js/modern/schema/build-config.js +0 -117
  338. package/dist/js/modern/schema/index.js +0 -4
  339. package/dist/js/modern/schema/output.js +0 -45
  340. package/dist/js/modern/schema/source.js +0 -7
  341. package/dist/js/modern/schema/tools.js +0 -6
  342. package/dist/js/modern/schema/types.js +0 -0
  343. package/dist/js/modern/types.js +0 -0
  344. package/dist/js/modern/utils/babel.js +0 -84
  345. package/dist/js/modern/utils/color.js +0 -2
  346. package/dist/js/modern/utils/constants.js +0 -3
  347. package/dist/js/modern/utils/copy.js +0 -70
  348. package/dist/js/modern/utils/init-env.js +0 -13
  349. package/dist/js/modern/utils/json.js +0 -13
  350. package/dist/js/modern/utils/language.js +0 -6
  351. package/dist/js/modern/utils/logger.js +0 -96
  352. package/dist/js/modern/utils/readline.js +0 -17
  353. package/dist/js/modern/utils/tsconfig.js +0 -13
  354. package/dist/js/modern/utils/tspaths-transform/constants.js +0 -5
  355. package/dist/js/modern/utils/tspaths-transform/index.js +0 -113
  356. package/dist/js/modern/utils/tspaths-transform/utils.js +0 -18
  357. package/dist/js/modern/utils/valide.js +0 -26
  358. package/dist/js/node/cli/build.js +0 -18
  359. package/dist/js/node/cli/dev.js +0 -18
  360. package/dist/js/node/cli/index.js +0 -38
  361. package/dist/js/node/cli/new.js +0 -20
  362. package/dist/js/node/commands/build.js +0 -80
  363. package/dist/js/node/commands/dev.js +0 -52
  364. package/dist/js/node/commands/index.js +0 -19
  365. package/dist/js/node/features/build/build-platform.js +0 -76
  366. package/dist/js/node/features/build/bundle/index.js +0 -17
  367. package/dist/js/node/features/build/bundle/runRollup.js +0 -145
  368. package/dist/js/node/features/build/bundle/runSpeedy.js +0 -186
  369. package/dist/js/node/features/build/bundleless/copy-assets.js +0 -84
  370. package/dist/js/node/features/build/bundleless/generator-dts/index.js +0 -114
  371. package/dist/js/node/features/build/bundleless/generator-dts/utils.js +0 -105
  372. package/dist/js/node/features/build/bundleless/index.js +0 -29
  373. package/dist/js/node/features/build/bundleless/runBabel.js +0 -255
  374. package/dist/js/node/features/build/bundleless/style.js +0 -254
  375. package/dist/js/node/features/build/constants.js +0 -116
  376. package/dist/js/node/features/build/error.js +0 -139
  377. package/dist/js/node/features/build/index.js +0 -128
  378. package/dist/js/node/features/build/legacy-constants.js +0 -111
  379. package/dist/js/node/features/build/logger/index.js +0 -27
  380. package/dist/js/node/features/build/logger/logText.js +0 -66
  381. package/dist/js/node/features/build/logger/loggerManager.js +0 -95
  382. package/dist/js/node/features/build/normalize.js +0 -288
  383. package/dist/js/node/features/build/types.js +0 -0
  384. package/dist/js/node/features/build/utils.js +0 -107
  385. package/dist/js/node/features/dev/index.js +0 -56
  386. package/dist/js/node/hooks/build.js +0 -32
  387. package/dist/js/node/hooks/dev.js +0 -24
  388. package/dist/js/node/hooks/index.js +0 -36
  389. package/dist/js/node/index.js +0 -83
  390. package/dist/js/node/locale/en.js +0 -32
  391. package/dist/js/node/locale/index.js +0 -17
  392. package/dist/js/node/locale/zh.js +0 -32
  393. package/dist/js/node/schema/build-config.js +0 -126
  394. package/dist/js/node/schema/index.js +0 -11
  395. package/dist/js/node/schema/output.js +0 -52
  396. package/dist/js/node/schema/source.js +0 -14
  397. package/dist/js/node/schema/tools.js +0 -13
  398. package/dist/js/node/schema/types.js +0 -0
  399. package/dist/js/node/types.js +0 -0
  400. package/dist/js/node/utils/babel.js +0 -93
  401. package/dist/js/node/utils/color.js +0 -9
  402. package/dist/js/node/utils/constants.js +0 -11
  403. package/dist/js/node/utils/copy.js +0 -79
  404. package/dist/js/node/utils/init-env.js +0 -20
  405. package/dist/js/node/utils/json.js +0 -20
  406. package/dist/js/node/utils/language.js +0 -12
  407. package/dist/js/node/utils/logger.js +0 -107
  408. package/dist/js/node/utils/readline.js +0 -25
  409. package/dist/js/node/utils/tsconfig.js +0 -21
  410. package/dist/js/node/utils/tspaths-transform/constants.js +0 -12
  411. package/dist/js/node/utils/tspaths-transform/index.js +0 -123
  412. package/dist/js/node/utils/tspaths-transform/utils.js +0 -25
  413. package/dist/js/node/utils/valide.js +0 -34
  414. package/dist/types/cli/build.d.ts +0 -3
  415. package/dist/types/cli/dev.d.ts +0 -3
  416. package/dist/types/cli/index.d.ts +0 -3
  417. package/dist/types/cli/new.d.ts +0 -2
  418. package/dist/types/commands/build.d.ts +0 -17
  419. package/dist/types/commands/dev.d.ts +0 -5
  420. package/dist/types/commands/index.d.ts +0 -2
  421. package/dist/types/features/build/build-platform.d.ts +0 -7
  422. package/dist/types/features/build/bundle/index.d.ts +0 -3
  423. package/dist/types/features/build/bundle/runRollup.d.ts +0 -3
  424. package/dist/types/features/build/bundle/runSpeedy.d.ts +0 -10
  425. package/dist/types/features/build/bundleless/copy-assets.d.ts +0 -3
  426. package/dist/types/features/build/bundleless/generator-dts/index.d.ts +0 -3
  427. package/dist/types/features/build/bundleless/generator-dts/utils.d.ts +0 -21
  428. package/dist/types/features/build/bundleless/index.d.ts +0 -4
  429. package/dist/types/features/build/bundleless/runBabel.d.ts +0 -32
  430. package/dist/types/features/build/bundleless/style.d.ts +0 -25
  431. package/dist/types/features/build/constants.d.ts +0 -18
  432. package/dist/types/features/build/index.d.ts +0 -12
  433. package/dist/types/features/build/legacy-constants.d.ts +0 -8
  434. package/dist/types/features/build/logger/index.d.ts +0 -2
  435. package/dist/types/features/build/logger/logText.d.ts +0 -39
  436. package/dist/types/features/build/logger/loggerManager.d.ts +0 -40
  437. package/dist/types/features/build/normalize.d.ts +0 -19
  438. package/dist/types/features/build/types.d.ts +0 -15
  439. package/dist/types/features/build/utils.d.ts +0 -36
  440. package/dist/types/features/dev/index.d.ts +0 -9
  441. package/dist/types/hooks/build.d.ts +0 -46
  442. package/dist/types/hooks/dev.d.ts +0 -20
  443. package/dist/types/hooks/index.d.ts +0 -30
  444. package/dist/types/schema/build-config.d.ts +0 -205
  445. package/dist/types/schema/index.d.ts +0 -217
  446. package/dist/types/schema/output.d.ts +0 -215
  447. package/dist/types/schema/source.d.ts +0 -6
  448. package/dist/types/schema/tools.d.ts +0 -6
  449. package/dist/types/schema/types.d.ts +0 -45
  450. package/dist/types/types.d.ts +0 -51
  451. package/dist/types/utils/babel.d.ts +0 -8
  452. package/dist/types/utils/color.d.ts +0 -2
  453. package/dist/types/utils/constants.d.ts +0 -2
  454. package/dist/types/utils/copy.d.ts +0 -5
  455. package/dist/types/utils/init-env.d.ts +0 -21
  456. package/dist/types/utils/json.d.ts +0 -4
  457. package/dist/types/utils/language.d.ts +0 -1
  458. package/dist/types/utils/logger.d.ts +0 -58
  459. package/dist/types/utils/readline.d.ts +0 -9
  460. package/dist/types/utils/tspaths-transform/constants.d.ts +0 -1
  461. package/dist/types/utils/tspaths-transform/utils.d.ts +0 -4
  462. package/dist/types/utils/valide.d.ts +0 -12
  463. package/types.d.ts +0 -1
@@ -0,0 +1,948 @@
1
+ export const VERSION: string;
2
+
3
+ export interface RollupError extends RollupLogProps {
4
+ parserError?: Error;
5
+ stack?: string;
6
+ watchFiles?: string[];
7
+ }
8
+
9
+ export interface RollupWarning extends RollupLogProps {
10
+ chunkName?: string;
11
+ cycle?: string[];
12
+ exportName?: string;
13
+ exporter?: string;
14
+ guess?: string;
15
+ importer?: string;
16
+ missing?: string;
17
+ modules?: string[];
18
+ names?: string[];
19
+ reexporter?: string;
20
+ source?: string;
21
+ sources?: string[];
22
+ }
23
+
24
+ export interface RollupLogProps {
25
+ code?: string;
26
+ frame?: string;
27
+ hook?: string;
28
+ id?: string;
29
+ loc?: {
30
+ column: number;
31
+ file?: string;
32
+ line: number;
33
+ };
34
+ message: string;
35
+ name?: string;
36
+ plugin?: string;
37
+ pluginCode?: string;
38
+ pos?: number;
39
+ url?: string;
40
+ }
41
+
42
+ export type SourceMapSegment =
43
+ | [number]
44
+ | [number, number, number, number]
45
+ | [number, number, number, number, number];
46
+
47
+ export interface ExistingDecodedSourceMap {
48
+ file?: string;
49
+ mappings: SourceMapSegment[][];
50
+ names: string[];
51
+ sourceRoot?: string;
52
+ sources: string[];
53
+ sourcesContent?: string[];
54
+ version: number;
55
+ }
56
+
57
+ export interface ExistingRawSourceMap {
58
+ file?: string;
59
+ mappings: string;
60
+ names: string[];
61
+ sourceRoot?: string;
62
+ sources: string[];
63
+ sourcesContent?: string[];
64
+ version: number;
65
+ }
66
+
67
+ export type DecodedSourceMapOrMissing =
68
+ | {
69
+ mappings?: never;
70
+ missing: true;
71
+ plugin: string;
72
+ }
73
+ | ExistingDecodedSourceMap;
74
+
75
+ export interface SourceMap {
76
+ file: string;
77
+ mappings: string;
78
+ names: string[];
79
+ sources: string[];
80
+ sourcesContent: string[];
81
+ version: number;
82
+ toString(): string;
83
+ toUrl(): string;
84
+ }
85
+
86
+ export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
87
+
88
+ type PartialNull<T> = {
89
+ [P in keyof T]: T[P] | null;
90
+ };
91
+
92
+ interface ModuleOptions {
93
+ meta: CustomPluginOptions;
94
+ moduleSideEffects: boolean | 'no-treeshake';
95
+ syntheticNamedExports: boolean | string;
96
+ }
97
+
98
+ export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
99
+ ast?: AcornNode;
100
+ code: string;
101
+ map?: SourceMapInput;
102
+ }
103
+
104
+ export interface TransformModuleJSON {
105
+ ast?: AcornNode;
106
+ code: string;
107
+ // note if plugins use new this.cache to opt-out auto transform cache
108
+ customTransformCache: boolean;
109
+ originalCode: string;
110
+ originalSourcemap: ExistingDecodedSourceMap | null;
111
+ sourcemapChain: DecodedSourceMapOrMissing[];
112
+ transformDependencies: string[];
113
+ }
114
+
115
+ export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
116
+ ast: AcornNode;
117
+ dependencies: string[];
118
+ id: string;
119
+ resolvedIds: ResolvedIdMap;
120
+ transformFiles: EmittedFile[] | undefined;
121
+ }
122
+
123
+ export interface PluginCache {
124
+ delete(id: string): boolean;
125
+ get<T = any>(id: string): T;
126
+ has(id: string): boolean;
127
+ set<T = any>(id: string, value: T): void;
128
+ }
129
+
130
+ export interface MinimalPluginContext {
131
+ meta: PluginContextMeta;
132
+ }
133
+
134
+ export interface EmittedAsset {
135
+ fileName?: string;
136
+ name?: string;
137
+ source?: string | Uint8Array;
138
+ type: 'asset';
139
+ }
140
+
141
+ export interface EmittedChunk {
142
+ fileName?: string;
143
+ id: string;
144
+ implicitlyLoadedAfterOneOf?: string[];
145
+ importer?: string;
146
+ name?: string;
147
+ preserveSignature?: PreserveEntrySignaturesOption;
148
+ type: 'chunk';
149
+ }
150
+
151
+ export type EmittedFile = EmittedAsset | EmittedChunk;
152
+
153
+ export type EmitAsset = (name: string, source?: string | Uint8Array) => string;
154
+
155
+ export type EmitChunk = (id: string, options?: { name?: string }) => string;
156
+
157
+ export type EmitFile = (emittedFile: EmittedFile) => string;
158
+
159
+ interface ModuleInfo extends ModuleOptions {
160
+ ast: AcornNode | null;
161
+ code: string | null;
162
+ dynamicImporters: readonly string[];
163
+ dynamicallyImportedIdResolutions: readonly ResolvedId[];
164
+ dynamicallyImportedIds: readonly string[];
165
+ hasDefaultExport: boolean | null;
166
+ /** @deprecated Use `moduleSideEffects` instead */
167
+ hasModuleSideEffects: boolean | 'no-treeshake';
168
+ id: string;
169
+ implicitlyLoadedAfterOneOf: readonly string[];
170
+ implicitlyLoadedBefore: readonly string[];
171
+ importedIdResolutions: readonly ResolvedId[];
172
+ importedIds: readonly string[];
173
+ importers: readonly string[];
174
+ isEntry: boolean;
175
+ isExternal: boolean;
176
+ isIncluded: boolean | null;
177
+ }
178
+
179
+ export type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
180
+
181
+ export interface CustomPluginOptions {
182
+ [plugin: string]: any;
183
+ }
184
+
185
+ export interface PluginContext extends MinimalPluginContext {
186
+ addWatchFile: (id: string) => void;
187
+ cache: PluginCache;
188
+ /** @deprecated Use `this.emitFile` instead */
189
+ emitAsset: EmitAsset;
190
+ /** @deprecated Use `this.emitFile` instead */
191
+ emitChunk: EmitChunk;
192
+ emitFile: EmitFile;
193
+ error: (err: RollupError | string, pos?: number | { column: number; line: number }) => never;
194
+ /** @deprecated Use `this.getFileName` instead */
195
+ getAssetFileName: (assetReferenceId: string) => string;
196
+ /** @deprecated Use `this.getFileName` instead */
197
+ getChunkFileName: (chunkReferenceId: string) => string;
198
+ getFileName: (fileReferenceId: string) => string;
199
+ getModuleIds: () => IterableIterator<string>;
200
+ getModuleInfo: GetModuleInfo;
201
+ getWatchFiles: () => string[];
202
+ /** @deprecated Use `this.resolve` instead */
203
+ isExternal: IsExternal;
204
+ load: (
205
+ options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
206
+ ) => Promise<ModuleInfo>;
207
+ /** @deprecated Use `this.getModuleIds` instead */
208
+ moduleIds: IterableIterator<string>;
209
+ parse: (input: string, options?: any) => AcornNode;
210
+ resolve: (
211
+ source: string,
212
+ importer?: string,
213
+ options?: { custom?: CustomPluginOptions; isEntry?: boolean; skipSelf?: boolean }
214
+ ) => Promise<ResolvedId | null>;
215
+ /** @deprecated Use `this.resolve` instead */
216
+ resolveId: (source: string, importer?: string) => Promise<string | null>;
217
+ setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
218
+ warn: (warning: RollupWarning | string, pos?: number | { column: number; line: number }) => void;
219
+ }
220
+
221
+ export interface PluginContextMeta {
222
+ rollupVersion: string;
223
+ watchMode: boolean;
224
+ }
225
+
226
+ export interface ResolvedId extends ModuleOptions {
227
+ external: boolean | 'absolute';
228
+ id: string;
229
+ }
230
+
231
+ export interface ResolvedIdMap {
232
+ [key: string]: ResolvedId;
233
+ }
234
+
235
+ interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
236
+ external?: boolean | 'absolute' | 'relative';
237
+ id: string;
238
+ }
239
+
240
+ export type ResolveIdResult = string | false | null | void | PartialResolvedId;
241
+
242
+ export type ResolveIdHook = (
243
+ this: PluginContext,
244
+ source: string,
245
+ importer: string | undefined,
246
+ options: { custom?: CustomPluginOptions; isEntry: boolean }
247
+ ) => ResolveIdResult;
248
+
249
+ export type ShouldTransformCachedModuleHook = (
250
+ this: PluginContext,
251
+ options: {
252
+ ast: AcornNode;
253
+ code: string;
254
+ id: string;
255
+ meta: CustomPluginOptions;
256
+ moduleSideEffects: boolean | 'no-treeshake';
257
+ resolvedSources: ResolvedIdMap;
258
+ syntheticNamedExports: boolean | string;
259
+ }
260
+ ) => boolean;
261
+
262
+ export type IsExternal = (
263
+ source: string,
264
+ importer: string | undefined,
265
+ isResolved: boolean
266
+ ) => boolean;
267
+
268
+ export type IsPureModule = (id: string) => boolean | null | void;
269
+
270
+ export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
271
+
272
+ export type LoadResult = SourceDescription | string | null | void;
273
+
274
+ export type LoadHook = (this: PluginContext, id: string) => LoadResult;
275
+
276
+ export interface TransformPluginContext extends PluginContext {
277
+ getCombinedSourcemap: () => SourceMap;
278
+ }
279
+
280
+ export type TransformResult = string | null | void | Partial<SourceDescription>;
281
+
282
+ export type TransformHook = (
283
+ this: TransformPluginContext,
284
+ code: string,
285
+ id: string
286
+ ) => TransformResult;
287
+
288
+ export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
289
+
290
+ export type RenderChunkHook = (
291
+ this: PluginContext,
292
+ code: string,
293
+ chunk: RenderedChunk,
294
+ options: NormalizedOutputOptions
295
+ ) => { code: string; map?: SourceMapInput } | string | null | undefined;
296
+
297
+ export type ResolveDynamicImportHook = (
298
+ this: PluginContext,
299
+ specifier: string | AcornNode,
300
+ importer: string
301
+ ) => ResolveIdResult;
302
+
303
+ export type ResolveImportMetaHook = (
304
+ this: PluginContext,
305
+ prop: string | null,
306
+ options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
307
+ ) => string | null | void;
308
+
309
+ export type ResolveAssetUrlHook = (
310
+ this: PluginContext,
311
+ options: {
312
+ assetFileName: string;
313
+ chunkId: string;
314
+ format: InternalModuleFormat;
315
+ moduleId: string;
316
+ relativeAssetPath: string;
317
+ }
318
+ ) => string | null | void;
319
+
320
+ export type ResolveFileUrlHook = (
321
+ this: PluginContext,
322
+ options: {
323
+ assetReferenceId: string | null;
324
+ chunkId: string;
325
+ chunkReferenceId: string | null;
326
+ fileName: string;
327
+ format: InternalModuleFormat;
328
+ moduleId: string;
329
+ referenceId: string;
330
+ relativePath: string;
331
+ }
332
+ ) => string | null | void;
333
+
334
+ export type AddonHookFunction = (this: PluginContext) => string | Promise<string>;
335
+ export type AddonHook = string | AddonHookFunction;
336
+
337
+ export type ChangeEvent = 'create' | 'update' | 'delete';
338
+ export type WatchChangeHook = (
339
+ this: PluginContext,
340
+ id: string,
341
+ change: { event: ChangeEvent }
342
+ ) => void;
343
+
344
+ /**
345
+ * use this type for plugin annotation
346
+ * @example
347
+ * ```ts
348
+ * interface Options {
349
+ * ...
350
+ * }
351
+ * const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
352
+ * ```
353
+ */
354
+ // eslint-disable-next-line @typescript-eslint/ban-types
355
+ export type PluginImpl<O extends object = object> = (options?: O) => Plugin;
356
+
357
+ export interface OutputBundle {
358
+ [fileName: string]: OutputAsset | OutputChunk;
359
+ }
360
+
361
+ export interface FilePlaceholder {
362
+ type: 'placeholder';
363
+ }
364
+
365
+ export interface OutputBundleWithPlaceholders {
366
+ [fileName: string]: OutputAsset | OutputChunk | FilePlaceholder;
367
+ }
368
+
369
+ export interface FunctionPluginHooks {
370
+ augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => string | void;
371
+ buildEnd: (this: PluginContext, err?: Error) => void;
372
+ buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
373
+ closeBundle: (this: PluginContext) => void;
374
+ closeWatcher: (this: PluginContext) => void;
375
+ generateBundle: (
376
+ this: PluginContext,
377
+ options: NormalizedOutputOptions,
378
+ bundle: OutputBundle,
379
+ isWrite: boolean
380
+ ) => void;
381
+ load: LoadHook;
382
+ moduleParsed: ModuleParsedHook;
383
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | null | void;
384
+ outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | null | void;
385
+ renderChunk: RenderChunkHook;
386
+ renderDynamicImport: (
387
+ this: PluginContext,
388
+ options: {
389
+ customResolution: string | null;
390
+ format: InternalModuleFormat;
391
+ moduleId: string;
392
+ targetModuleId: string | null;
393
+ }
394
+ ) => { left: string; right: string } | null | void;
395
+ renderError: (this: PluginContext, err?: Error) => void;
396
+ renderStart: (
397
+ this: PluginContext,
398
+ outputOptions: NormalizedOutputOptions,
399
+ inputOptions: NormalizedInputOptions
400
+ ) => void;
401
+ /** @deprecated Use `resolveFileUrl` instead */
402
+ resolveAssetUrl: ResolveAssetUrlHook;
403
+ resolveDynamicImport: ResolveDynamicImportHook;
404
+ resolveFileUrl: ResolveFileUrlHook;
405
+ resolveId: ResolveIdHook;
406
+ resolveImportMeta: ResolveImportMetaHook;
407
+ shouldTransformCachedModule: ShouldTransformCachedModuleHook;
408
+ transform: TransformHook;
409
+ watchChange: WatchChangeHook;
410
+ writeBundle: (
411
+ this: PluginContext,
412
+ options: NormalizedOutputOptions,
413
+ bundle: OutputBundle
414
+ ) => void;
415
+ }
416
+
417
+ export type OutputPluginHooks =
418
+ | 'augmentChunkHash'
419
+ | 'generateBundle'
420
+ | 'outputOptions'
421
+ | 'renderChunk'
422
+ | 'renderDynamicImport'
423
+ | 'renderError'
424
+ | 'renderStart'
425
+ | 'resolveAssetUrl'
426
+ | 'resolveFileUrl'
427
+ | 'resolveImportMeta'
428
+ | 'writeBundle';
429
+
430
+ export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>;
431
+
432
+ export type SyncPluginHooks =
433
+ | 'augmentChunkHash'
434
+ | 'outputOptions'
435
+ | 'renderDynamicImport'
436
+ | 'resolveAssetUrl'
437
+ | 'resolveFileUrl'
438
+ | 'resolveImportMeta';
439
+
440
+ export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
441
+
442
+ export type FirstPluginHooks =
443
+ | 'load'
444
+ | 'renderDynamicImport'
445
+ | 'resolveAssetUrl'
446
+ | 'resolveDynamicImport'
447
+ | 'resolveFileUrl'
448
+ | 'resolveId'
449
+ | 'resolveImportMeta'
450
+ | 'shouldTransformCachedModule';
451
+
452
+ export type SequentialPluginHooks =
453
+ | 'augmentChunkHash'
454
+ | 'generateBundle'
455
+ | 'options'
456
+ | 'outputOptions'
457
+ | 'renderChunk'
458
+ | 'transform';
459
+
460
+ export type ParallelPluginHooks = Exclude<
461
+ keyof FunctionPluginHooks | AddonHooks,
462
+ FirstPluginHooks | SequentialPluginHooks
463
+ >;
464
+
465
+ export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
466
+
467
+ type MakeAsync<Fn> = Fn extends (this: infer This, ...args: infer Args) => infer Return
468
+ ? (this: This, ...args: Args) => Return | Promise<Return>
469
+ : never;
470
+
471
+ // eslint-disable-next-line @typescript-eslint/ban-types
472
+ type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
473
+
474
+ export type PluginHooks = {
475
+ [K in keyof FunctionPluginHooks]: ObjectHook<
476
+ K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
477
+ // eslint-disable-next-line @typescript-eslint/ban-types
478
+ K extends ParallelPluginHooks ? { sequential?: boolean } : {}
479
+ >;
480
+ };
481
+
482
+ export interface OutputPlugin
483
+ extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
484
+ Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
485
+ cacheKey?: string;
486
+ name: string;
487
+ }
488
+
489
+ export interface Plugin extends OutputPlugin, Partial<PluginHooks> {
490
+ // for inter-plugin communication
491
+ api?: any;
492
+ }
493
+
494
+ type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
495
+
496
+ export interface NormalizedTreeshakingOptions {
497
+ annotations: boolean;
498
+ correctVarValueBeforeDeclaration: boolean;
499
+ moduleSideEffects: HasModuleSideEffects;
500
+ propertyReadSideEffects: boolean | 'always';
501
+ tryCatchDeoptimization: boolean;
502
+ unknownGlobalSideEffects: boolean;
503
+ }
504
+
505
+ export interface TreeshakingOptions
506
+ extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
507
+ moduleSideEffects?: ModuleSideEffectsOption;
508
+ preset?: TreeshakingPreset;
509
+ /** @deprecated Use `moduleSideEffects` instead */
510
+ pureExternalModules?: PureModulesOption;
511
+ }
512
+
513
+ interface GetManualChunkApi {
514
+ getModuleIds: () => IterableIterator<string>;
515
+ getModuleInfo: GetModuleInfo;
516
+ }
517
+ export type GetManualChunk = (id: string, api: GetManualChunkApi) => string | null | void;
518
+
519
+ export type ExternalOption =
520
+ | (string | RegExp)[]
521
+ | string
522
+ | RegExp
523
+ | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | void);
524
+ export type PureModulesOption = boolean | string[] | IsPureModule;
525
+ export type GlobalsOption = { [name: string]: string } | ((name: string) => string);
526
+ export type InputOption = string | string[] | { [entryAlias: string]: string };
527
+ export type ManualChunksOption = { [chunkAlias: string]: string[] } | GetManualChunk;
528
+ export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
529
+ export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
530
+ export type SourcemapPathTransformOption = (
531
+ relativeSourcePath: string,
532
+ sourcemapPath: string
533
+ ) => string;
534
+
535
+ export interface InputOptions {
536
+ acorn?: Record<string, unknown>;
537
+ acornInjectPlugins?: (() => unknown)[] | (() => unknown);
538
+ cache?: false | RollupCache;
539
+ context?: string;
540
+ experimentalCacheExpiry?: number;
541
+ external?: ExternalOption;
542
+ /** @deprecated Use the "inlineDynamicImports" output option instead. */
543
+ inlineDynamicImports?: boolean;
544
+ input?: InputOption;
545
+ makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
546
+ /** @deprecated Use the "manualChunks" output option instead. */
547
+ manualChunks?: ManualChunksOption;
548
+ maxParallelFileOps?: number;
549
+ /** @deprecated Use the "maxParallelFileOps" option instead. */
550
+ maxParallelFileReads?: number;
551
+ moduleContext?: ((id: string) => string | null | void) | { [id: string]: string };
552
+ onwarn?: WarningHandlerWithDefault;
553
+ perf?: boolean;
554
+ plugins?: (Plugin | null | false | undefined)[];
555
+ preserveEntrySignatures?: PreserveEntrySignaturesOption;
556
+ /** @deprecated Use the "preserveModules" output option instead. */
557
+ preserveModules?: boolean;
558
+ preserveSymlinks?: boolean;
559
+ shimMissingExports?: boolean;
560
+ strictDeprecations?: boolean;
561
+ treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
562
+ watch?: WatcherOptions | false;
563
+ }
564
+
565
+ export interface NormalizedInputOptions {
566
+ acorn: Record<string, unknown>;
567
+ acornInjectPlugins: (() => unknown)[];
568
+ cache: false | undefined | RollupCache;
569
+ context: string;
570
+ experimentalCacheExpiry: number;
571
+ external: IsExternal;
572
+ /** @deprecated Use the "inlineDynamicImports" output option instead. */
573
+ inlineDynamicImports: boolean | undefined;
574
+ input: string[] | { [entryAlias: string]: string };
575
+ makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
576
+ /** @deprecated Use the "manualChunks" output option instead. */
577
+ manualChunks: ManualChunksOption | undefined;
578
+ maxParallelFileOps: number;
579
+ /** @deprecated Use the "maxParallelFileOps" option instead. */
580
+ maxParallelFileReads: number;
581
+ moduleContext: (id: string) => string;
582
+ onwarn: WarningHandler;
583
+ perf: boolean;
584
+ plugins: Plugin[];
585
+ preserveEntrySignatures: PreserveEntrySignaturesOption;
586
+ /** @deprecated Use the "preserveModules" output option instead. */
587
+ preserveModules: boolean | undefined;
588
+ preserveSymlinks: boolean;
589
+ shimMissingExports: boolean;
590
+ strictDeprecations: boolean;
591
+ treeshake: false | NormalizedTreeshakingOptions;
592
+ }
593
+
594
+ export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
595
+
596
+ export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
597
+
598
+ type GeneratedCodePreset = 'es5' | 'es2015';
599
+
600
+ interface NormalizedGeneratedCodeOptions {
601
+ arrowFunctions: boolean;
602
+ constBindings: boolean;
603
+ objectShorthand: boolean;
604
+ reservedNamesAsProps: boolean;
605
+ symbols: boolean;
606
+ }
607
+
608
+ interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
609
+ preset?: GeneratedCodePreset;
610
+ }
611
+
612
+ export type OptionsPaths = Record<string, string> | ((id: string) => string);
613
+
614
+ export type InteropType = boolean | 'auto' | 'esModule' | 'default' | 'defaultOnly';
615
+
616
+ export type GetInterop = (id: string | null) => InteropType;
617
+
618
+ export type AmdOptions = (
619
+ | {
620
+ autoId?: false;
621
+ id: string;
622
+ }
623
+ | {
624
+ autoId: true;
625
+ basePath?: string;
626
+ id?: undefined;
627
+ }
628
+ | {
629
+ autoId?: false;
630
+ id?: undefined;
631
+ }
632
+ ) & {
633
+ define?: string;
634
+ forceJsExtensionForImports?: boolean;
635
+ };
636
+
637
+ export type NormalizedAmdOptions = (
638
+ | {
639
+ autoId: false;
640
+ id?: string;
641
+ }
642
+ | {
643
+ autoId: true;
644
+ basePath: string;
645
+ }
646
+ ) & {
647
+ define: string;
648
+ forceJsExtensionForImports: boolean;
649
+ };
650
+
651
+ export interface OutputOptions {
652
+ amd?: AmdOptions;
653
+ assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
654
+ banner?: string | (() => string | Promise<string>);
655
+ chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
656
+ compact?: boolean;
657
+ // only required for bundle.write
658
+ dir?: string;
659
+ /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
660
+ dynamicImportFunction?: string;
661
+ entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
662
+ esModule?: boolean;
663
+ exports?: 'default' | 'named' | 'none' | 'auto';
664
+ extend?: boolean;
665
+ externalLiveBindings?: boolean;
666
+ // only required for bundle.write
667
+ file?: string;
668
+ footer?: string | (() => string | Promise<string>);
669
+ format?: ModuleFormat;
670
+ freeze?: boolean;
671
+ generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
672
+ globals?: GlobalsOption;
673
+ hoistTransitiveImports?: boolean;
674
+ indent?: string | boolean;
675
+ inlineDynamicImports?: boolean;
676
+ interop?: InteropType | GetInterop;
677
+ intro?: string | (() => string | Promise<string>);
678
+ manualChunks?: ManualChunksOption;
679
+ minifyInternalExports?: boolean;
680
+ name?: string;
681
+ /** @deprecated Use "generatedCode.symbols" instead. */
682
+ namespaceToStringTag?: boolean;
683
+ noConflict?: boolean;
684
+ outro?: string | (() => string | Promise<string>);
685
+ paths?: OptionsPaths;
686
+ plugins?: (OutputPlugin | null | false | undefined)[];
687
+ /** @deprecated Use "generatedCode.constBindings" instead. */
688
+ preferConst?: boolean;
689
+ preserveModules?: boolean;
690
+ preserveModulesRoot?: string;
691
+ sanitizeFileName?: boolean | ((fileName: string) => string);
692
+ sourcemap?: boolean | 'inline' | 'hidden';
693
+ sourcemapBaseUrl?: string;
694
+ sourcemapExcludeSources?: boolean;
695
+ sourcemapFile?: string;
696
+ sourcemapPathTransform?: SourcemapPathTransformOption;
697
+ strict?: boolean;
698
+ systemNullSetters?: boolean;
699
+ validate?: boolean;
700
+ }
701
+
702
+ export interface NormalizedOutputOptions {
703
+ amd: NormalizedAmdOptions;
704
+ assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
705
+ banner: () => string | Promise<string>;
706
+ chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
707
+ compact: boolean;
708
+ dir: string | undefined;
709
+ /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
710
+ dynamicImportFunction: string | undefined;
711
+ entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
712
+ esModule: boolean;
713
+ exports: 'default' | 'named' | 'none' | 'auto';
714
+ extend: boolean;
715
+ externalLiveBindings: boolean;
716
+ file: string | undefined;
717
+ footer: () => string | Promise<string>;
718
+ format: InternalModuleFormat;
719
+ freeze: boolean;
720
+ generatedCode: NormalizedGeneratedCodeOptions;
721
+ globals: GlobalsOption;
722
+ hoistTransitiveImports: boolean;
723
+ indent: true | string;
724
+ inlineDynamicImports: boolean;
725
+ interop: GetInterop;
726
+ intro: () => string | Promise<string>;
727
+ manualChunks: ManualChunksOption;
728
+ minifyInternalExports: boolean;
729
+ name: string | undefined;
730
+ namespaceToStringTag: boolean;
731
+ noConflict: boolean;
732
+ outro: () => string | Promise<string>;
733
+ paths: OptionsPaths;
734
+ plugins: OutputPlugin[];
735
+ /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
736
+ preferConst: boolean;
737
+ preserveModules: boolean;
738
+ preserveModulesRoot: string | undefined;
739
+ sanitizeFileName: (fileName: string) => string;
740
+ sourcemap: boolean | 'inline' | 'hidden';
741
+ sourcemapBaseUrl: string | undefined;
742
+ sourcemapExcludeSources: boolean;
743
+ sourcemapFile: string | undefined;
744
+ sourcemapPathTransform: SourcemapPathTransformOption | undefined;
745
+ strict: boolean;
746
+ systemNullSetters: boolean;
747
+ validate: boolean;
748
+ }
749
+
750
+ export type WarningHandlerWithDefault = (
751
+ warning: RollupWarning,
752
+ defaultHandler: WarningHandler
753
+ ) => void;
754
+ export type WarningHandler = (warning: RollupWarning) => void;
755
+
756
+ export interface SerializedTimings {
757
+ [label: string]: [number, number, number];
758
+ }
759
+
760
+ export interface PreRenderedAsset {
761
+ name: string | undefined;
762
+ source: string | Uint8Array;
763
+ type: 'asset';
764
+ }
765
+
766
+ export interface OutputAsset extends PreRenderedAsset {
767
+ fileName: string;
768
+ /** @deprecated Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead */
769
+ isAsset: true;
770
+ }
771
+
772
+ export interface RenderedModule {
773
+ code: string | null;
774
+ originalLength: number;
775
+ removedExports: string[];
776
+ renderedExports: string[];
777
+ renderedLength: number;
778
+ }
779
+
780
+ export interface PreRenderedChunk {
781
+ exports: string[];
782
+ facadeModuleId: string | null;
783
+ isDynamicEntry: boolean;
784
+ isEntry: boolean;
785
+ isImplicitEntry: boolean;
786
+ modules: {
787
+ [id: string]: RenderedModule;
788
+ };
789
+ name: string;
790
+ type: 'chunk';
791
+ }
792
+
793
+ export interface RenderedChunk extends PreRenderedChunk {
794
+ code?: string;
795
+ dynamicImports: string[];
796
+ fileName: string;
797
+ implicitlyLoadedBefore: string[];
798
+ importedBindings: {
799
+ [imported: string]: string[];
800
+ };
801
+ imports: string[];
802
+ map?: SourceMap;
803
+ referencedFiles: string[];
804
+ }
805
+
806
+ export interface OutputChunk extends RenderedChunk {
807
+ code: string;
808
+ }
809
+
810
+ export interface SerializablePluginCache {
811
+ [key: string]: [number, any];
812
+ }
813
+
814
+ export interface RollupCache {
815
+ modules: ModuleJSON[];
816
+ plugins?: Record<string, SerializablePluginCache>;
817
+ }
818
+
819
+ export interface RollupOutput {
820
+ output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
821
+ }
822
+
823
+ export interface RollupBuild {
824
+ cache: RollupCache | undefined;
825
+ close: () => Promise<void>;
826
+ closed: boolean;
827
+ generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
828
+ getTimings?: () => SerializedTimings;
829
+ watchFiles: string[];
830
+ write: (options: OutputOptions) => Promise<RollupOutput>;
831
+ }
832
+
833
+ export interface RollupOptions extends InputOptions {
834
+ // This is included for compatibility with config files but ignored by rollup.rollup
835
+ output?: OutputOptions | OutputOptions[];
836
+ }
837
+
838
+ export interface MergedRollupOptions extends InputOptions {
839
+ output: OutputOptions[];
840
+ }
841
+
842
+ export function rollup(options: RollupOptions): Promise<RollupBuild>;
843
+
844
+ export interface ChokidarOptions {
845
+ alwaysStat?: boolean;
846
+ atomic?: boolean | number;
847
+ awaitWriteFinish?:
848
+ | {
849
+ pollInterval?: number;
850
+ stabilityThreshold?: number;
851
+ }
852
+ | boolean;
853
+ binaryInterval?: number;
854
+ cwd?: string;
855
+ depth?: number;
856
+ disableGlobbing?: boolean;
857
+ followSymlinks?: boolean;
858
+ ignoreInitial?: boolean;
859
+ ignorePermissionErrors?: boolean;
860
+ ignored?: any;
861
+ interval?: number;
862
+ persistent?: boolean;
863
+ useFsEvents?: boolean;
864
+ usePolling?: boolean;
865
+ }
866
+
867
+ export type RollupWatchHooks = 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd';
868
+
869
+ export interface WatcherOptions {
870
+ buildDelay?: number;
871
+ chokidar?: ChokidarOptions;
872
+ clearScreen?: boolean;
873
+ exclude?: string | RegExp | (string | RegExp)[];
874
+ include?: string | RegExp | (string | RegExp)[];
875
+ skipWrite?: boolean;
876
+ }
877
+
878
+ export interface RollupWatchOptions extends InputOptions {
879
+ output?: OutputOptions | OutputOptions[];
880
+ watch?: WatcherOptions | false;
881
+ }
882
+
883
+ interface TypedEventEmitter<T extends { [event: string]: (...args: any) => any }> {
884
+ addListener<K extends keyof T>(event: K, listener: T[K]): this;
885
+ emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): boolean;
886
+ eventNames(): Array<keyof T>;
887
+ getMaxListeners(): number;
888
+ listenerCount(type: keyof T): number;
889
+ listeners<K extends keyof T>(event: K): Array<T[K]>;
890
+ off<K extends keyof T>(event: K, listener: T[K]): this;
891
+ on<K extends keyof T>(event: K, listener: T[K]): this;
892
+ once<K extends keyof T>(event: K, listener: T[K]): this;
893
+ prependListener<K extends keyof T>(event: K, listener: T[K]): this;
894
+ prependOnceListener<K extends keyof T>(event: K, listener: T[K]): this;
895
+ rawListeners<K extends keyof T>(event: K): Array<T[K]>;
896
+ removeAllListeners<K extends keyof T>(event?: K): this;
897
+ removeListener<K extends keyof T>(event: K, listener: T[K]): this;
898
+ setMaxListeners(n: number): this;
899
+ }
900
+
901
+ export interface RollupAwaitingEmitter<T extends { [event: string]: (...args: any) => any }>
902
+ extends TypedEventEmitter<T> {
903
+ close(): Promise<void>;
904
+ emitAndAwait<K extends keyof T>(event: K, ...args: Parameters<T[K]>): Promise<ReturnType<T[K]>[]>;
905
+ /**
906
+ * Registers an event listener that will be awaited before Rollup continues
907
+ * for events emitted via emitAndAwait. All listeners will be awaited in
908
+ * parallel while rejections are tracked via Promise.all.
909
+ * Listeners are removed automatically when removeAwaited is called, which
910
+ * happens automatically after each run.
911
+ */
912
+ onCurrentAwaited<K extends keyof T>(
913
+ event: K,
914
+ listener: (...args: Parameters<T[K]>) => Promise<ReturnType<T[K]>>
915
+ ): this;
916
+ removeAwaited(): this;
917
+ }
918
+
919
+ export type RollupWatcherEvent =
920
+ | { code: 'START' }
921
+ | { code: 'BUNDLE_START'; input?: InputOption; output: readonly string[] }
922
+ | {
923
+ code: 'BUNDLE_END';
924
+ duration: number;
925
+ input?: InputOption;
926
+ output: readonly string[];
927
+ result: RollupBuild;
928
+ }
929
+ | { code: 'END' }
930
+ | { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
931
+
932
+ export type RollupWatcher = RollupAwaitingEmitter<{
933
+ change: (id: string, change: { event: ChangeEvent }) => void;
934
+ close: () => void;
935
+ event: (event: RollupWatcherEvent) => void;
936
+ restart: () => void;
937
+ }>;
938
+
939
+ export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher;
940
+
941
+ interface AcornNode {
942
+ end: number;
943
+ start: number;
944
+ type: string;
945
+ }
946
+
947
+ export function defineConfig(options: RollupOptions): RollupOptions;
948
+ export function defineConfig(options: RollupOptions[]): RollupOptions[];