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

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 (449) hide show
  1. package/CHANGELOG.md +207 -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 +265 -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 +74 -0
  147. package/dist/builder/clear.js.map +1 -0
  148. package/dist/builder/copy.d.ts +9 -0
  149. package/dist/builder/copy.js +207 -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 +27 -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 +180 -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 +160 -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 +124 -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 +140 -0
  165. package/dist/builder/platform.js.map +1 -0
  166. package/dist/cli.d.ts +3 -0
  167. package/dist/cli.js +103 -0
  168. package/dist/cli.js.map +1 -0
  169. package/dist/command.d.ts +7 -0
  170. package/dist/command.js +169 -0
  171. package/dist/command.js.map +1 -0
  172. package/dist/config/defineConfig.d.ts +2 -0
  173. package/dist/config/defineConfig.js +25 -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 +177 -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 +207 -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 +219 -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 +71 -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 +29 -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 +45 -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 +29 -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 +189 -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 +36 -0
  201. package/dist/constants/log.js.map +1 -0
  202. package/dist/dev.d.ts +10 -0
  203. package/dist/dev.js +135 -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 +139 -0
  207. package/dist/error.js.map +1 -0
  208. package/dist/hooks/build.d.ts +22 -0
  209. package/dist/hooks/build.js +35 -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 +33 -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 +44 -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 +29 -0
  219. package/dist/hooks/misc.js.map +1 -0
  220. package/dist/index.d.ts +5 -0
  221. package/dist/index.js +32 -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 +47 -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 +34 -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 +47 -0
  231. package/dist/locale/zh.js.map +1 -0
  232. package/dist/plugins.d.ts +2 -0
  233. package/dist/plugins.js +51 -0
  234. package/dist/plugins.js.map +1 -0
  235. package/dist/types/color.d.ts +1 -0
  236. package/dist/{js/modern/features/build/types.js → types/color.js} +0 -0
  237. package/dist/types/command.d.ts +11 -0
  238. package/dist/{js/modern/schema/types.js → types/command.js} +0 -0
  239. package/dist/types/config/index.d.ts +95 -0
  240. package/dist/types/config/index.js +19 -0
  241. package/dist/types/config/index.js.map +1 -0
  242. package/dist/types/config/style.d.ts +12 -0
  243. package/dist/{js/modern/types.js → types/config/style.js} +0 -0
  244. package/dist/types/context.d.ts +5 -0
  245. package/dist/{js/node/features/build/types.js → types/context.js} +0 -0
  246. package/dist/types/copy.d.ts +15 -0
  247. package/dist/{js/node/schema/types.js → types/copy.js} +0 -0
  248. package/dist/types/{utils/tsconfig.d.ts → dts.d.ts} +11 -3
  249. package/dist/{js/node/types.js → types/dts.js} +0 -0
  250. package/dist/types/hooks.d.ts +25 -0
  251. package/dist/types/hooks.js +0 -0
  252. package/dist/types/index.d.ts +17 -6
  253. package/dist/types/index.js +23 -0
  254. package/dist/types/index.js.map +1 -0
  255. package/dist/types/utils.d.ts +7 -0
  256. package/dist/types/utils.js +0 -0
  257. package/dist/utils/builder.d.ts +8 -0
  258. package/dist/utils/builder.js +117 -0
  259. package/dist/utils/builder.js.map +1 -0
  260. package/dist/utils/config.d.ts +6 -0
  261. package/dist/utils/config.js +172 -0
  262. package/dist/utils/config.js.map +1 -0
  263. package/dist/utils/context.d.ts +7 -0
  264. package/dist/utils/context.js +68 -0
  265. package/dist/utils/context.js.map +1 -0
  266. package/dist/utils/dts.d.ts +14 -0
  267. package/dist/utils/dts.js +197 -0
  268. package/dist/utils/dts.js.map +1 -0
  269. package/dist/utils/input.d.ts +16 -0
  270. package/dist/utils/input.js +124 -0
  271. package/dist/utils/input.js.map +1 -0
  272. package/dist/utils/language.d.ts +2 -0
  273. package/dist/utils/language.js +75 -0
  274. package/dist/utils/language.js.map +1 -0
  275. package/dist/utils/libuild-plugins.d.ts +6 -0
  276. package/dist/utils/libuild-plugins.js +90 -0
  277. package/dist/utils/libuild-plugins.js.map +1 -0
  278. package/dist/utils/log.d.ts +2 -0
  279. package/dist/utils/log.js +76 -0
  280. package/dist/utils/log.js.map +1 -0
  281. package/dist/utils/onExit.d.ts +1 -0
  282. package/dist/utils/onExit.js +71 -0
  283. package/dist/utils/onExit.js.map +1 -0
  284. package/dist/utils/path.d.ts +1 -0
  285. package/dist/utils/path.js +73 -0
  286. package/dist/utils/path.js.map +1 -0
  287. package/dist/utils/style.d.ts +31 -0
  288. package/dist/utils/style.js +134 -0
  289. package/dist/utils/style.js.map +1 -0
  290. package/dist/{types/utils/tspaths-transform/index.d.ts → utils/tspaths-transform.d.ts} +0 -0
  291. package/dist/utils/tspaths-transform.js +115 -0
  292. package/dist/utils/tspaths-transform.js.map +1 -0
  293. package/package.json +45 -72
  294. package/dist/js/modern/cli/build.js +0 -11
  295. package/dist/js/modern/cli/dev.js +0 -11
  296. package/dist/js/modern/cli/index.js +0 -3
  297. package/dist/js/modern/cli/new.js +0 -13
  298. package/dist/js/modern/commands/build.js +0 -69
  299. package/dist/js/modern/commands/dev.js +0 -43
  300. package/dist/js/modern/commands/index.js +0 -2
  301. package/dist/js/modern/features/build/build-platform.js +0 -69
  302. package/dist/js/modern/features/build/bundle/index.js +0 -9
  303. package/dist/js/modern/features/build/bundle/runRollup.js +0 -136
  304. package/dist/js/modern/features/build/bundle/runSpeedy.js +0 -176
  305. package/dist/js/modern/features/build/bundleless/copy-assets.js +0 -75
  306. package/dist/js/modern/features/build/bundleless/generator-dts/index.js +0 -106
  307. package/dist/js/modern/features/build/bundleless/generator-dts/utils.js +0 -94
  308. package/dist/js/modern/features/build/bundleless/index.js +0 -21
  309. package/dist/js/modern/features/build/bundleless/runBabel.js +0 -242
  310. package/dist/js/modern/features/build/bundleless/style.js +0 -241
  311. package/dist/js/modern/features/build/constants.js +0 -98
  312. package/dist/js/modern/features/build/error.js +0 -127
  313. package/dist/js/modern/features/build/index.js +0 -117
  314. package/dist/js/modern/features/build/legacy-constants.js +0 -103
  315. package/dist/js/modern/features/build/logger/index.js +0 -2
  316. package/dist/js/modern/features/build/logger/logText.js +0 -56
  317. package/dist/js/modern/features/build/logger/loggerManager.js +0 -93
  318. package/dist/js/modern/features/build/normalize.js +0 -277
  319. package/dist/js/modern/features/build/utils.js +0 -92
  320. package/dist/js/modern/features/dev/index.js +0 -47
  321. package/dist/js/modern/hooks/build.js +0 -20
  322. package/dist/js/modern/hooks/dev.js +0 -14
  323. package/dist/js/modern/hooks/index.js +0 -15
  324. package/dist/js/modern/index.js +0 -63
  325. package/dist/js/modern/locale/en.js +0 -25
  326. package/dist/js/modern/locale/index.js +0 -10
  327. package/dist/js/modern/locale/zh.js +0 -25
  328. package/dist/js/modern/schema/build-config.js +0 -117
  329. package/dist/js/modern/schema/index.js +0 -4
  330. package/dist/js/modern/schema/output.js +0 -45
  331. package/dist/js/modern/schema/source.js +0 -7
  332. package/dist/js/modern/schema/tools.js +0 -6
  333. package/dist/js/modern/utils/babel.js +0 -84
  334. package/dist/js/modern/utils/color.js +0 -2
  335. package/dist/js/modern/utils/constants.js +0 -3
  336. package/dist/js/modern/utils/copy.js +0 -70
  337. package/dist/js/modern/utils/init-env.js +0 -13
  338. package/dist/js/modern/utils/json.js +0 -13
  339. package/dist/js/modern/utils/language.js +0 -6
  340. package/dist/js/modern/utils/logger.js +0 -96
  341. package/dist/js/modern/utils/readline.js +0 -17
  342. package/dist/js/modern/utils/tsconfig.js +0 -13
  343. package/dist/js/modern/utils/tspaths-transform/constants.js +0 -5
  344. package/dist/js/modern/utils/tspaths-transform/index.js +0 -113
  345. package/dist/js/modern/utils/tspaths-transform/utils.js +0 -18
  346. package/dist/js/modern/utils/valide.js +0 -26
  347. package/dist/js/node/cli/build.js +0 -18
  348. package/dist/js/node/cli/dev.js +0 -18
  349. package/dist/js/node/cli/index.js +0 -38
  350. package/dist/js/node/cli/new.js +0 -20
  351. package/dist/js/node/commands/build.js +0 -80
  352. package/dist/js/node/commands/dev.js +0 -52
  353. package/dist/js/node/commands/index.js +0 -19
  354. package/dist/js/node/features/build/build-platform.js +0 -76
  355. package/dist/js/node/features/build/bundle/index.js +0 -17
  356. package/dist/js/node/features/build/bundle/runRollup.js +0 -145
  357. package/dist/js/node/features/build/bundle/runSpeedy.js +0 -186
  358. package/dist/js/node/features/build/bundleless/copy-assets.js +0 -84
  359. package/dist/js/node/features/build/bundleless/generator-dts/index.js +0 -114
  360. package/dist/js/node/features/build/bundleless/generator-dts/utils.js +0 -105
  361. package/dist/js/node/features/build/bundleless/index.js +0 -29
  362. package/dist/js/node/features/build/bundleless/runBabel.js +0 -255
  363. package/dist/js/node/features/build/bundleless/style.js +0 -254
  364. package/dist/js/node/features/build/constants.js +0 -116
  365. package/dist/js/node/features/build/error.js +0 -139
  366. package/dist/js/node/features/build/index.js +0 -128
  367. package/dist/js/node/features/build/legacy-constants.js +0 -111
  368. package/dist/js/node/features/build/logger/index.js +0 -27
  369. package/dist/js/node/features/build/logger/logText.js +0 -66
  370. package/dist/js/node/features/build/logger/loggerManager.js +0 -95
  371. package/dist/js/node/features/build/normalize.js +0 -288
  372. package/dist/js/node/features/build/utils.js +0 -107
  373. package/dist/js/node/features/dev/index.js +0 -56
  374. package/dist/js/node/hooks/build.js +0 -32
  375. package/dist/js/node/hooks/dev.js +0 -24
  376. package/dist/js/node/hooks/index.js +0 -36
  377. package/dist/js/node/index.js +0 -83
  378. package/dist/js/node/locale/en.js +0 -32
  379. package/dist/js/node/locale/index.js +0 -17
  380. package/dist/js/node/locale/zh.js +0 -32
  381. package/dist/js/node/schema/build-config.js +0 -126
  382. package/dist/js/node/schema/index.js +0 -11
  383. package/dist/js/node/schema/output.js +0 -52
  384. package/dist/js/node/schema/source.js +0 -14
  385. package/dist/js/node/schema/tools.js +0 -13
  386. package/dist/js/node/utils/babel.js +0 -93
  387. package/dist/js/node/utils/color.js +0 -9
  388. package/dist/js/node/utils/constants.js +0 -11
  389. package/dist/js/node/utils/copy.js +0 -79
  390. package/dist/js/node/utils/init-env.js +0 -20
  391. package/dist/js/node/utils/json.js +0 -20
  392. package/dist/js/node/utils/language.js +0 -12
  393. package/dist/js/node/utils/logger.js +0 -107
  394. package/dist/js/node/utils/readline.js +0 -25
  395. package/dist/js/node/utils/tsconfig.js +0 -21
  396. package/dist/js/node/utils/tspaths-transform/constants.js +0 -12
  397. package/dist/js/node/utils/tspaths-transform/index.js +0 -123
  398. package/dist/js/node/utils/tspaths-transform/utils.js +0 -25
  399. package/dist/js/node/utils/valide.js +0 -34
  400. package/dist/types/cli/build.d.ts +0 -3
  401. package/dist/types/cli/dev.d.ts +0 -3
  402. package/dist/types/cli/index.d.ts +0 -3
  403. package/dist/types/cli/new.d.ts +0 -2
  404. package/dist/types/commands/build.d.ts +0 -17
  405. package/dist/types/commands/dev.d.ts +0 -5
  406. package/dist/types/commands/index.d.ts +0 -2
  407. package/dist/types/features/build/build-platform.d.ts +0 -7
  408. package/dist/types/features/build/bundle/index.d.ts +0 -3
  409. package/dist/types/features/build/bundle/runRollup.d.ts +0 -3
  410. package/dist/types/features/build/bundle/runSpeedy.d.ts +0 -10
  411. package/dist/types/features/build/bundleless/copy-assets.d.ts +0 -3
  412. package/dist/types/features/build/bundleless/generator-dts/index.d.ts +0 -3
  413. package/dist/types/features/build/bundleless/generator-dts/utils.d.ts +0 -21
  414. package/dist/types/features/build/bundleless/index.d.ts +0 -4
  415. package/dist/types/features/build/bundleless/runBabel.d.ts +0 -32
  416. package/dist/types/features/build/bundleless/style.d.ts +0 -25
  417. package/dist/types/features/build/constants.d.ts +0 -18
  418. package/dist/types/features/build/index.d.ts +0 -12
  419. package/dist/types/features/build/legacy-constants.d.ts +0 -8
  420. package/dist/types/features/build/logger/index.d.ts +0 -2
  421. package/dist/types/features/build/logger/logText.d.ts +0 -39
  422. package/dist/types/features/build/logger/loggerManager.d.ts +0 -40
  423. package/dist/types/features/build/normalize.d.ts +0 -19
  424. package/dist/types/features/build/types.d.ts +0 -15
  425. package/dist/types/features/build/utils.d.ts +0 -36
  426. package/dist/types/features/dev/index.d.ts +0 -9
  427. package/dist/types/hooks/build.d.ts +0 -46
  428. package/dist/types/hooks/dev.d.ts +0 -20
  429. package/dist/types/hooks/index.d.ts +0 -30
  430. package/dist/types/schema/build-config.d.ts +0 -205
  431. package/dist/types/schema/index.d.ts +0 -217
  432. package/dist/types/schema/output.d.ts +0 -215
  433. package/dist/types/schema/source.d.ts +0 -6
  434. package/dist/types/schema/tools.d.ts +0 -6
  435. package/dist/types/schema/types.d.ts +0 -45
  436. package/dist/types/types.d.ts +0 -51
  437. package/dist/types/utils/babel.d.ts +0 -8
  438. package/dist/types/utils/color.d.ts +0 -2
  439. package/dist/types/utils/constants.d.ts +0 -2
  440. package/dist/types/utils/copy.d.ts +0 -5
  441. package/dist/types/utils/init-env.d.ts +0 -21
  442. package/dist/types/utils/json.d.ts +0 -4
  443. package/dist/types/utils/language.d.ts +0 -1
  444. package/dist/types/utils/logger.d.ts +0 -58
  445. package/dist/types/utils/readline.d.ts +0 -9
  446. package/dist/types/utils/tspaths-transform/constants.d.ts +0 -1
  447. package/dist/types/utils/tspaths-transform/utils.d.ts +0 -4
  448. package/dist/types/utils/valide.d.ts +0 -12
  449. package/types.d.ts +0 -1
@@ -1,123 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.transformDtsAlias = void 0;
7
- var path = _interopRequireWildcard(require("path"));
8
- var parser = _interopRequireWildcard(require("@babel/parser"));
9
- var _traverse = _interopRequireDefault(require("@babel/traverse"));
10
- var _generator = _interopRequireDefault(require("@babel/generator"));
11
- var t = _interopRequireWildcard(require("@babel/types"));
12
- var _tsconfigPaths = require("@modern-js/utils/tsconfig-paths");
13
- var _utils = require("@modern-js/utils");
14
- var _constants = require("./constants");
15
- var _utils2 = require("./utils");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
- const getPathsMap = (paths, sourceDirName = 'src') => {
20
- const pathKeys = Object.keys(paths);
21
- const pathsMap = {};
22
- const replaceSrcToTypes = s => s.replace(sourceDirName, 'types');
23
- for (const key of pathKeys) {
24
- const p = paths[key];
25
- if (typeof p === 'string') {
26
- pathsMap[key] = [replaceSrcToTypes(p)];
27
- } else {
28
- pathsMap[key] = paths[key].map(sp => replaceSrcToTypes(sp));
29
- }
30
- }
31
- return pathsMap;
32
- };
33
- function mapPathString(nodePath, {
34
- filename,
35
- baseUrl,
36
- paths
37
- }) {
38
- if (!t.isStringLiteral(nodePath)) {
39
- return;
40
- }
41
- const sourcePath = nodePath.node.value;
42
- const currentFile = filename;
43
- const pathsMap = getPathsMap(paths);
44
- const matchPath = (0, _tsconfigPaths.createMatchPath)(baseUrl, pathsMap, ['index']);
45
- const result = matchPath(sourcePath, packageJsonPath => {
46
- if (!_utils.fs.existsSync(packageJsonPath)) {
47
- return undefined;
48
- }
49
- return _utils.fs.readJSONSync(packageJsonPath);
50
- }, filePath => _utils.fs.existsSync(filePath), ['.d.ts']);
51
- if (result) {
52
- const relativePath = path.relative(path.dirname(currentFile), path.dirname(result));
53
- const fileName = path.basename(result);
54
- // 如果是同级文件,则返回的是 ''
55
- const filePath = path.normalize(`${relativePath.length === 0 ? '.' : relativePath}/${fileName}`);
56
- const replaceString = filePath.startsWith('.') ? filePath : `./${filePath}`;
57
- nodePath.replaceWith(t.stringLiteral(replaceString));
58
- }
59
- }
60
- const transformCall = option => nodePath => {
61
- const calleePath = nodePath.get('callee');
62
- const isNormalCall = _constants.defaultTransformedFunctions.some(pattern => (0, _utils2.matchesPattern)(calleePath, pattern));
63
- if (isNormalCall || (0, _utils2.isImportCall)(nodePath)) {
64
- mapPathString(nodePath.get('arguments.0'), option);
65
- }
66
- };
67
- const transformImport = option => nodePath => {
68
- mapPathString(nodePath.get('source'), option);
69
- };
70
- const transformExport = option => nodePath => {
71
- mapPathString(nodePath.get('source'), option);
72
- };
73
- const transformSingleFileAlias = ({
74
- filename,
75
- baseUrl,
76
- paths
77
- }) => {
78
- const sourceCode = _utils.fs.readFileSync(filename, 'utf-8');
79
- const ast = parser.parse(sourceCode, {
80
- sourceType: 'module',
81
- errorRecovery: true,
82
- // 防止typescript不支持的语法出现而报错
83
- plugins: ['typescript']
84
- });
85
- (0, _traverse.default)(ast, {
86
- CallExpression: transformCall({
87
- filename,
88
- baseUrl,
89
- paths
90
- }),
91
- ImportDeclaration: transformImport({
92
- filename,
93
- baseUrl,
94
- paths
95
- }),
96
- ExportDeclaration: transformExport({
97
- filename,
98
- baseUrl,
99
- paths
100
- })
101
- });
102
- return (0, _generator.default)(ast).code;
103
- };
104
- const transformDtsAlias = option => {
105
- const {
106
- filenames = [],
107
- baseUrl,
108
- paths
109
- } = option;
110
- const transformResult = [];
111
- for (const filename of filenames) {
112
- transformResult.push({
113
- path: filename,
114
- content: transformSingleFileAlias({
115
- filename,
116
- baseUrl,
117
- paths
118
- })
119
- });
120
- }
121
- return transformResult;
122
- };
123
- exports.transformDtsAlias = transformDtsAlias;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isImportCall = isImportCall;
7
- exports.matchesPattern = matchesPattern;
8
- var _utils = require("@modern-js/utils");
9
- const t = _utils.Import.lazy('@babel/types', require);
10
- function matchesPattern(calleePath, pattern) {
11
- const {
12
- node
13
- } = calleePath;
14
- if (t.isMemberExpression(node)) {
15
- return calleePath.matchesPattern(pattern);
16
- }
17
- if (!t.isIdentifier(node) || pattern.includes('.')) {
18
- return false;
19
- }
20
- const name = pattern.split('.')[0];
21
- return node.name === name;
22
- }
23
- function isImportCall(calleePath) {
24
- return t.isImport(calleePath.node.callee);
25
- }
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.valideBeforeTask = exports.modernConfigValid = void 0;
7
- var _utils = require("@modern-js/utils");
8
- const valideBeforeTask = ({
9
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
- modernConfig,
11
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
- tsconfigPath
13
- }) => {
14
- // const modernConfigValidResult = modernConfigValid(modernConfig, {
15
- // tsconfigPath,
16
- // });
17
- // if (modernConfigValidResult) {
18
- // console.error(modernConfigValidResult);
19
- // // eslint-disable-next-line no-process-exit
20
- // process.exit(0);
21
- // }
22
- };
23
- exports.valideBeforeTask = valideBeforeTask;
24
- const modernConfigValid = (modernConfig, option) => {
25
- const valids = [_utils.validAlias];
26
- for (const validFn of valids) {
27
- const result = validFn(modernConfig, option);
28
- if (result) {
29
- return result;
30
- }
31
- }
32
- return null;
33
- };
34
- exports.modernConfigValid = modernConfigValid;
@@ -1,3 +0,0 @@
1
- import { Command } from '@modern-js/utils';
2
- import type { PluginAPI } from '@modern-js/core';
3
- export declare const buildCli: (program: Command, api: PluginAPI) => Command;
@@ -1,3 +0,0 @@
1
- import { Command } from '@modern-js/utils';
2
- import type { PluginAPI } from '@modern-js/core';
3
- export declare const devCli: (program: Command, api: PluginAPI) => void;
@@ -1,3 +0,0 @@
1
- export * from './build';
2
- export * from './dev';
3
- export * from './new';
@@ -1,2 +0,0 @@
1
- import { Command } from '@modern-js/utils';
2
- export declare const newCli: (program: Command, locale?: string) => void;
@@ -1,17 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { Platform } from '../types';
3
- /**
4
- * init work before build task.
5
- * @param api
6
- */
7
- export declare const init: (api: PluginAPI) => void;
8
- export interface IBuildCommandOption {
9
- watch?: boolean;
10
- tsconfig: string;
11
- platform?: boolean | Exclude<Platform, 'all'>;
12
- styleOnly?: boolean;
13
- tsc: boolean;
14
- dts?: boolean;
15
- clear: boolean;
16
- }
17
- export declare const build: (api: PluginAPI, buildCommandOption: IBuildCommandOption) => Promise<void>;
@@ -1,5 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- export interface IDevOption {
3
- tsconfig: string;
4
- }
5
- export declare const dev: (api: PluginAPI, option: IDevOption, subCmd?: string) => Promise<void>;
@@ -1,2 +0,0 @@
1
- export { dev } from './dev';
2
- export { build } from './build';
@@ -1,7 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- export declare type Platform = 'all' | 'docs' | 'storybook';
3
- export interface IBuildPlatformOption {
4
- platform: Platform;
5
- isTsProject?: boolean;
6
- }
7
- export declare const buildPlatform: (api: PluginAPI, option: IBuildPlatformOption) => Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { NormalizedBundleBuildConfig } from '../types';
3
- export declare const build: (api: PluginAPI, config: NormalizedBundleBuildConfig) => Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { NormalizedBundleBuildConfig } from '../types';
3
- export declare const startRollup: (api: PluginAPI, options: NormalizedBundleBuildConfig) => Promise<void>;
@@ -1,10 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { NormalizedBundleBuildConfig } from '../types';
3
- export declare type ResolveAlias = {
4
- [index: string]: string;
5
- };
6
- export declare const getAlias: (api: PluginAPI) => {};
7
- export declare const getDefine: (api: PluginAPI) => {
8
- [x: string]: string;
9
- };
10
- export declare const runSpeedy: (api: PluginAPI, config: NormalizedBundleBuildConfig) => Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import { NormalizedBundlelessBuildConfig } from '../types';
3
- export declare const copyStaticAssets: (api: PluginAPI, config: NormalizedBundlelessBuildConfig) => Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { NormalizedBundlelessBuildConfig } from '../../types';
3
- export declare const genDts: (api: PluginAPI, config: NormalizedBundlelessBuildConfig) => Promise<void>;
@@ -1,21 +0,0 @@
1
- import type { NormalizedConfig } from '@modern-js/core';
2
- import type { ITsconfig } from '../../../../types';
3
- export interface IGeneratorConfig {
4
- appDirectory: string;
5
- sourceDir?: string;
6
- distDir: string;
7
- tsconfigPath?: string;
8
- tsCheck?: boolean;
9
- watch?: boolean;
10
- }
11
- export declare const generatorTsConfig: (projectTsconfig: ITsconfig, {
12
- appDirectory,
13
- distDir,
14
- sourceDir
15
- }: {
16
- appDirectory: string;
17
- distDir: string;
18
- sourceDir?: string | undefined;
19
- }) => string;
20
- export declare const resolveAlias: (modernConfig: NormalizedConfig, config: IGeneratorConfig, watchFilenames?: string[]) => void;
21
- export declare const getTscBinPath: (appDirectory: string) => string;
@@ -1,4 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { NormalizedBundlelessBuildConfig } from '../types';
3
- import type { IBuildFeatOption } from '../../../types';
4
- export declare const build: (api: PluginAPI, config: NormalizedBundlelessBuildConfig, legacyOptions?: IBuildFeatOption) => Promise<void>;
@@ -1,32 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { BabelOptions, ICompilerResult, BuildWatchEmitter, ICompilerMessageDetail } from '@modern-js/babel-compiler';
3
- import type { NormalizedBundlelessBuildConfig } from '../types';
4
- import type { ITsconfig } from '../../../types';
5
- export declare class BabelBuildError extends Error {
6
- readonly summary?: string;
7
- readonly details?: ICompilerMessageDetail[];
8
- constructor(message: string, opts?: {
9
- summary?: string;
10
- details?: ICompilerMessageDetail[];
11
- });
12
- toString(): string;
13
- formatError(): string[];
14
- }
15
- interface IBuildSourceCodeConfig {
16
- appDirectory: string;
17
- watch?: boolean;
18
- babelConfig: BabelOptions;
19
- srcRootDir: string;
20
- willCompilerDirOrFile: string;
21
- distDir: string;
22
- tsconfigPath: string;
23
- }
24
- export declare const getWillCompilerCode: (srcDirOrFile: string, option: {
25
- tsconfig: ITsconfig | null;
26
- isTsProject: boolean;
27
- }) => string[];
28
- export declare const buildSourceCode: (config: IBuildSourceCodeConfig) => Promise<ICompilerResult | BuildWatchEmitter>;
29
- export declare const jsFileSuffix: string[];
30
- export declare const haveNotAnyJsFile: (sourceDir: string) => Promise<boolean>;
31
- export declare const runBabelBuild: (api: PluginAPI, config: NormalizedBundlelessBuildConfig) => Promise<void>;
32
- export {};
@@ -1,25 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { BuildWatchEmitter, ICompilerResult, SingleFileCompilerResult, LessOption, PostcssOption, SassOptions } from '@modern-js/style-compiler';
3
- import type { NormalizedBundlelessBuildConfig } from '../types';
4
- export declare class StyleBuildError extends Error {
5
- readonly summary?: string;
6
- readonly details?: SingleFileCompilerResult[];
7
- constructor(message: string, opts?: {
8
- summary?: string;
9
- details?: SingleFileCompilerResult[];
10
- });
11
- toString(): string;
12
- formatError(): string[];
13
- }
14
- export declare const runBuild: (option: {
15
- appDirectory: string;
16
- srcDir: string;
17
- outDir: string;
18
- watch: boolean;
19
- lessOption: LessOption | undefined;
20
- sassOption: SassOptions<'sync'> | undefined;
21
- postcssOption: PostcssOption;
22
- }) => Promise<BuildWatchEmitter | ICompilerResult | undefined>;
23
- export declare const styleFileSuffix: string[];
24
- export declare const haveNotAnyStyles: (sourceDir: string) => Promise<boolean>;
25
- export declare const buildStyle: (api: PluginAPI, config: NormalizedBundlelessBuildConfig) => Promise<void>;
@@ -1,18 +0,0 @@
1
- import type { BaseBuildConfig, Target } from '../../schema/types';
2
- export declare const clearFlag = "\u001Bc";
3
- export declare const buildingText: string;
4
- export declare const buildSuccessText: string;
5
- export declare const buildFailText: string;
6
- export declare const targets: Target[];
7
- export declare const npmLibraryPresetConfig: BaseBuildConfig[];
8
- export declare const npmLibraryWithUmdPresetConfig: BaseBuildConfig[];
9
- export declare const npmComponentPresetConfig: BaseBuildConfig[];
10
- export declare const npmComponentWithUmdPresetConfig: BaseBuildConfig[];
11
- export declare const unPresetConfigs: {
12
- 'npm-library': BaseBuildConfig[];
13
- 'npm-library-with-umd': BaseBuildConfig[];
14
- 'npm-component': BaseBuildConfig[];
15
- 'npm-component-with-umd': BaseBuildConfig[];
16
- };
17
- export declare const unPresets: ("npm-library" | "npm-library-with-umd" | "npm-component" | "npm-component-with-umd")[];
18
- export declare const unPresetWithTargetConfigs: Record<string, BaseBuildConfig[]>;
@@ -1,12 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { IBuildFeatOption } from '../../types';
3
- import type { NormalizedBuildConfig } from './types';
4
- export declare const checkPlatformAndRunBuild: (platform: IBuildFeatOption['platform'], options: {
5
- api: PluginAPI;
6
- isTsProject: boolean;
7
- }) => Promise<{
8
- exit: boolean;
9
- }>;
10
- export declare const runBuild: (api: PluginAPI, normalizedModuleConfig: NormalizedBuildConfig[], config: IBuildFeatOption) => Promise<void>;
11
- export declare const buildInNormalMode: (api: PluginAPI, normalizedModuleConfig: NormalizedBuildConfig[], config: IBuildFeatOption) => Promise<void>;
12
- export declare const build: (api: PluginAPI, config: IBuildFeatOption) => Promise<void>;
@@ -1,8 +0,0 @@
1
- export declare const DEFAULT_PACKAGE_MODE = "universal-js";
2
- export declare const PACKAGE_MODES: {
3
- 'universal-js': import("../../schema/types").BaseBuildConfig[];
4
- 'universal-js-lite': import("../../schema/types").BaseBuildConfig[];
5
- 'browser-js': import("../../schema/types").BaseBuildConfig[];
6
- 'browser-js-lite': import("../../schema/types").BaseBuildConfig[];
7
- 'node-js': import("../../schema/types").BaseBuildConfig[];
8
- };
@@ -1,2 +0,0 @@
1
- export * from './logText';
2
- export * from './loggerManager';
@@ -1,39 +0,0 @@
1
- import { chalk } from '@modern-js/utils';
2
- export declare const colors: {
3
- title: chalk.Chalk;
4
- };
5
- export declare const clearFlag = "\u001Bc";
6
- export declare const logTemplate: (title: string, messageStack: string[], {
7
- noBottomBorder,
8
- bottomBorderText,
9
- noLeftBorder,
10
- leftBorder,
11
- contentColor
12
- }?: {
13
- noBottomBorder?: boolean | undefined;
14
- bottomBorderText?: string | undefined;
15
- noLeftBorder?: boolean | undefined;
16
- leftBorder?: string | undefined;
17
- contentColor?: ((s: string) => string) | undefined;
18
- }) => string;
19
- export interface LoggerTextOption {
20
- title: string;
21
- contentConfig?: {
22
- noBottomBorder?: boolean;
23
- bottomBorderText?: string;
24
- noLeftBorder?: boolean;
25
- leftBorder?: string;
26
- contentColor?: (s: string) => string;
27
- replace?: string[];
28
- };
29
- }
30
- export declare class LoggerText {
31
- messages: string[];
32
- hasErrorMessage: boolean;
33
- option: LoggerTextOption;
34
- constructor(option: LoggerTextOption);
35
- append(message: string): void;
36
- errorHappen(): void;
37
- hasMessages(): boolean;
38
- get value(): string;
39
- }
@@ -1,40 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- /**
5
- * 1. 注册构建任务
6
- * 2. 监听各个构建任务进程中的信息:process.stdout.on('data' | 'error')
7
- * 3. 分别输出内容
8
- */
9
- import type { ChildProcess } from 'child_process';
10
- import EventEmitter from 'events';
11
- import type { LoggerTextOption, LoggerText } from './logText';
12
- export declare type STDOUT = ChildProcess['stdout'] | (NodeJS.WriteStream & {
13
- fd: 1;
14
- });
15
- export declare type STDERR = ChildProcess['stderr'] | (NodeJS.WriteStream & {
16
- fd: 2;
17
- });
18
- interface IAddStdoutConfig {
19
- event?: {
20
- data?: boolean;
21
- error?: boolean;
22
- };
23
- colors?: {
24
- data?: (s: string) => string;
25
- error?: (s: string) => string;
26
- warning?: (s: string) => string;
27
- };
28
- }
29
- export declare class LoggerManager extends EventEmitter {
30
- private _compilering;
31
- private readonly _listeners;
32
- constructor();
33
- createLoggerText(option: LoggerTextOption): LoggerText;
34
- addStdout(loggerText: LoggerText, stdout: STDOUT, config?: IAddStdoutConfig): void;
35
- addStderr(loggerText: LoggerText, stderr: STDERR, color?: (s: string) => string): void;
36
- showCompiling(): void;
37
- disappearCompiling(): void;
38
- listenDateAndShow(logTexts: LoggerText[]): () => never;
39
- }
40
- export {};
@@ -1,19 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { BuildConfig, BaseBuildConfig, SourceMap } from '../../schema/types';
3
- import type { IBuildFeatOption } from '../../types';
4
- import type { NormalizedBuildConfig } from './types';
5
- export declare const getNormalizeModuleConfigByPackageModeAndFileds: (api: PluginAPI, buildFeatOption: IBuildFeatOption) => BuildConfig[];
6
- export declare const getFinalTsconfig: (config: {
7
- tsconfig?: string;
8
- }, buildFeatOption: IBuildFeatOption) => string;
9
- export declare const getFinalDts: (config: Pick<BaseBuildConfig, 'enableDts'>, buildFeatOption: IBuildFeatOption) => boolean;
10
- export declare const getSourceMap: (config: Pick<BaseBuildConfig, 'sourceMap'>, buildType: BaseBuildConfig['buildType'], api: PluginAPI) => SourceMap;
11
- export declare const normalizeBuildConfig: (context: {
12
- buildFeatOption: IBuildFeatOption;
13
- api: PluginAPI;
14
- }, buildConfig: BuildConfig, deps?: string[]) => NormalizedBuildConfig[];
15
- export declare const normalizeModuleConfig: (context: {
16
- buildFeatOption: IBuildFeatOption;
17
- api: PluginAPI;
18
- deps?: string[];
19
- }) => NormalizedBuildConfig[];
@@ -1,15 +0,0 @@
1
- import type { BaseBuildConfig, BundlelessOptions, BundleOptions } from '../../schema/types';
2
- export declare type NormalizedBuildConfig = NormalizedBundleBuildConfig | NormalizedBundlelessBuildConfig;
3
- export declare type CommonNormalizedBuildConfig = Required<Omit<BaseBuildConfig, 'bundleOptions' | 'bundlelessOptions'>> & {
4
- watch?: boolean;
5
- };
6
- export declare type NormalizedBundleBuildConfig = {
7
- buildType: 'bundle';
8
- } & CommonNormalizedBuildConfig & {
9
- bundleOptions: BundleOptions;
10
- };
11
- export declare type NormalizedBundlelessBuildConfig = {
12
- buildType: 'bundleless';
13
- } & CommonNormalizedBuildConfig & {
14
- bundlelessOptions: Required<BundlelessOptions>;
15
- };
@@ -1,36 +0,0 @@
1
- import type { PostcssOption } from '@modern-js/style-compiler';
2
- /**
3
- * 处理日志信息
4
- */
5
- export declare class LogStack {
6
- private _codeLogStack;
7
- constructor();
8
- update(latestLog: string, {
9
- splitEOL
10
- }?: {
11
- splitEOL?: boolean | undefined;
12
- }): void;
13
- clear(): void;
14
- get value(): string[];
15
- }
16
- export declare const logTemplate: (title: string, messageStack: string[], maxLength: number, {
17
- noBottomBorder,
18
- bottomBorderText,
19
- noLeftBorder,
20
- leftBorder,
21
- contentColor
22
- }?: {
23
- noBottomBorder?: boolean | undefined;
24
- bottomBorderText?: string | undefined;
25
- noLeftBorder?: boolean | undefined;
26
- leftBorder?: string | undefined;
27
- contentColor?: ((s: string) => string) | undefined;
28
- }) => string;
29
- export declare enum SectionTitleStatus {
30
- Success = 0,
31
- Fail = 1,
32
- Log = 2,
33
- }
34
- export declare const watchSectionTitle: (str: string, status: SectionTitleStatus) => string;
35
- export declare const getPostcssOption: (...args: any[]) => PostcssOption;
36
- export declare const getAllDeps: <T>(appDirectory: string) => string[];
@@ -1,9 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- export interface IDevConfig {
3
- appDirectory: string;
4
- isTsProject: boolean;
5
- }
6
- export declare type DevTaskType = 'storybook' | 'docsite' | 'unknown';
7
- export declare const showMenu: (api: PluginAPI, config: IDevConfig) => Promise<void>;
8
- export declare const devStorybook: (api: PluginAPI, config: IDevConfig) => Promise<void>;
9
- export declare const runSubCmd: (api: PluginAPI, subCmd: string, config: IDevConfig) => Promise<void>;
@@ -1,46 +0,0 @@
1
- import { NormalizedConfig } from '@modern-js/core';
2
- import { LessOption, SassOptions } from '@modern-js/style-compiler';
3
- export interface PlatformBuildOption {
4
- isTsProject: boolean;
5
- }
6
- export declare const platformBuild: import("@modern-js/plugin").ParallelWorkflow<PlatformBuildOption, {
7
- name: string;
8
- title: string;
9
- taskPath: string;
10
- params: string[];
11
- }>;
12
- export declare const moduleLessConfig: import("@modern-js/plugin").AsyncPipeline<{
13
- modernConfig: NormalizedConfig<any>;
14
- }, LessOption | undefined>;
15
- export declare const moduleSassConfig: import("@modern-js/plugin").AsyncPipeline<{
16
- modernConfig: NormalizedConfig<any>;
17
- }, SassOptions<"sync"> | undefined>;
18
- export declare const moduleTailwindConfig: import("@modern-js/plugin").AsyncPipeline<{
19
- modernConfig: NormalizedConfig<any>;
20
- }, any>;
21
- export declare const buildHooks: {
22
- platformBuild: import("@modern-js/plugin").ParallelWorkflow<PlatformBuildOption, {
23
- name: string;
24
- title: string;
25
- taskPath: string;
26
- params: string[];
27
- }>;
28
- moduleLessConfig: import("@modern-js/plugin").AsyncPipeline<{
29
- modernConfig: NormalizedConfig<any>;
30
- }, LessOption | undefined>;
31
- moduleSassConfig: import("@modern-js/plugin").AsyncPipeline<{
32
- modernConfig: NormalizedConfig<any>;
33
- }, SassOptions<"sync"> | undefined>;
34
- moduleTailwindConfig: import("@modern-js/plugin").AsyncPipeline<{
35
- modernConfig: NormalizedConfig<any>;
36
- }, any>;
37
- };
38
- export declare const lifecycle: () => void;
39
- declare module '@modern-js/core' {
40
- interface Hooks {
41
- platformBuild: typeof platformBuild;
42
- moduleLessConfig: typeof moduleLessConfig;
43
- moduleSassConfig: typeof moduleSassConfig;
44
- moduleTailwindConfig: typeof moduleTailwindConfig;
45
- }
46
- }
@@ -1,20 +0,0 @@
1
- export declare const moduleToolsMenu: import("@modern-js/plugin").ParallelWorkflow<undefined, {
2
- name: string;
3
- value: string;
4
- runTask: (p: any) => void | Promise<void>;
5
- }>;
6
- export declare const afterDev: import("@modern-js/plugin").AsyncWorkflow<void, unknown>;
7
- export declare const devHooks: {
8
- moduleToolsMenu: import("@modern-js/plugin").ParallelWorkflow<undefined, {
9
- name: string;
10
- value: string;
11
- runTask: (p: any) => void | Promise<void>;
12
- }>;
13
- afterDev: import("@modern-js/plugin").AsyncWorkflow<void, unknown>;
14
- };
15
- export declare const lifecycle: () => void;
16
- declare module '@modern-js/core' {
17
- interface Hooks {
18
- moduleToolsMenu: typeof moduleToolsMenu;
19
- }
20
- }