@modern-js/utils 2.13.3 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (443) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/{alias.js → cjs/alias.js} +4 -15
  3. package/dist/{analyzeProject.js → cjs/analyzeProject.js} +5 -25
  4. package/dist/{babel.js → cjs/babel.js} +9 -16
  5. package/dist/{compatRequire.js → cjs/compatRequire.js} +4 -17
  6. package/dist/{constants.js → cjs/constants.js} +7 -13
  7. package/dist/cjs/emptyDir.js +32 -0
  8. package/dist/{getEntryOptions.js → cjs/getEntryOptions.js} +1 -15
  9. package/dist/{getPackageManager.js → cjs/getPackageManager.js} +19 -41
  10. package/dist/{getPort.js → cjs/getPort.js} +4 -24
  11. package/dist/{getServerConfig.js → cjs/getServerConfig.js} +2 -22
  12. package/dist/{is → cjs/is}/index.js +3 -2
  13. package/dist/{logger.js → cjs/logger.js} +5 -16
  14. package/dist/{monorepo.js → cjs/monorepo.js} +4 -15
  15. package/dist/cjs/nodeEnv.js +55 -0
  16. package/dist/{path.js → cjs/path.js} +1 -1
  17. package/dist/{pathSerializer.js → cjs/pathSerializer.js} +1 -1
  18. package/dist/{prettyInstructions.js → cjs/prettyInstructions.js} +26 -8
  19. package/dist/{react.js → cjs/react.js} +4 -15
  20. package/dist/cjs/runtime/index.js +17 -0
  21. package/dist/cjs/runtime/parsed.js +39 -0
  22. package/dist/{runtimeExports.js → cjs/runtimeExports.js} +1 -1
  23. package/dist/{universal → cjs/universal}/nestedRoutes.js +4 -21
  24. package/dist/cjs/version.js +59 -0
  25. package/dist/{watch.js → cjs/watch.js} +9 -29
  26. package/dist/esm/FileSizeReporter.js +133 -0
  27. package/dist/esm/alias.js +61 -0
  28. package/dist/esm/analyzeProject.js +17 -0
  29. package/dist/esm/applyOptionsChain.js +35 -0
  30. package/dist/esm/babel.js +105 -0
  31. package/dist/esm/chainId.js +173 -0
  32. package/dist/esm/clearConsole.js +8 -0
  33. package/dist/esm/commands.js +22 -0
  34. package/dist/esm/compatRequire.js +42 -0
  35. package/dist/esm/compiled.js +77 -0
  36. package/dist/esm/constants.js +260 -0
  37. package/dist/esm/debug.js +5 -0
  38. package/dist/esm/emptyDir.js +9 -0
  39. package/dist/esm/ensureAbsolutePath.js +5 -0
  40. package/dist/esm/ensureArray.js +9 -0
  41. package/dist/esm/findExists.js +12 -0
  42. package/dist/esm/generateMetaTags.js +38 -0
  43. package/dist/esm/getBrowserslist.js +7 -0
  44. package/dist/esm/getCoreJsVersion.js +13 -0
  45. package/dist/esm/getEntryOptions.js +17 -0
  46. package/dist/esm/getPackageManager.js +32 -0
  47. package/dist/esm/getPort.js +59 -0
  48. package/dist/esm/getServerConfig.js +14 -0
  49. package/dist/esm/getTargetDir.js +8 -0
  50. package/dist/esm/import.js +9 -0
  51. package/dist/esm/index.js +44 -0
  52. package/dist/esm/is/index.js +72 -0
  53. package/dist/esm/is/nodeEnv.js +12 -0
  54. package/dist/esm/is/platform.js +6 -0
  55. package/dist/esm/is/type.js +34 -0
  56. package/dist/esm/logger.js +100 -0
  57. package/dist/esm/monorepo.js +87 -0
  58. package/dist/esm/nodeEnv.js +30 -0
  59. package/dist/esm/path.js +50 -0
  60. package/dist/esm/pathSerializer.js +46 -0
  61. package/dist/esm/plugin.js +23 -0
  62. package/dist/esm/prettyInstructions.js +95 -0
  63. package/dist/esm/printBuildError.js +34 -0
  64. package/dist/esm/react.js +20 -0
  65. package/dist/esm/readTsConfig.js +13 -0
  66. package/dist/esm/removeSlash.js +8 -0
  67. package/dist/esm/resolve.js +38 -0
  68. package/dist/esm/routes.js +24 -0
  69. package/dist/esm/runtime/index.js +1 -0
  70. package/dist/esm/runtime/parsed.js +16 -0
  71. package/dist/esm/runtimeExports.js +40 -0
  72. package/dist/esm/ssr.js +6 -0
  73. package/dist/esm/storage.js +42 -0
  74. package/dist/esm/testUtils.js +15 -0
  75. package/dist/esm/types.js +0 -0
  76. package/dist/esm/universal/constants.js +6 -0
  77. package/dist/esm/universal/formatWebpack.js +77 -0
  78. package/dist/esm/universal/nestedRoutes.js +93 -0
  79. package/dist/esm/universal/remixRouter.js +1 -0
  80. package/dist/esm/universal/serialize.js +7 -0
  81. package/dist/esm/version.js +25 -0
  82. package/dist/esm/wait.js +6 -0
  83. package/dist/esm/watch.js +36 -0
  84. package/dist/{constants.d.ts → types/constants.d.ts} +6 -2
  85. package/dist/{prettyInstructions.d.ts → types/prettyInstructions.d.ts} +4 -1
  86. package/dist/types/runtime/index.d.ts +1 -0
  87. package/dist/types/runtime/parsed.d.ts +1 -0
  88. package/package.json +118 -63
  89. package/dist/emptyDir.js +0 -52
  90. package/dist/nodeEnv.js +0 -81
  91. package/dist/version.js +0 -92
  92. /package/dist/{FileSizeReporter.js → cjs/FileSizeReporter.js} +0 -0
  93. /package/dist/{applyOptionsChain.js → cjs/applyOptionsChain.js} +0 -0
  94. /package/dist/{chainId.js → cjs/chainId.js} +0 -0
  95. /package/dist/{clearConsole.js → cjs/clearConsole.js} +0 -0
  96. /package/dist/{commands.js → cjs/commands.js} +0 -0
  97. /package/dist/{compiled.js → cjs/compiled.js} +0 -0
  98. /package/dist/{debug.js → cjs/debug.js} +0 -0
  99. /package/dist/{ensureAbsolutePath.js → cjs/ensureAbsolutePath.js} +0 -0
  100. /package/dist/{ensureArray.js → cjs/ensureArray.js} +0 -0
  101. /package/dist/{findExists.js → cjs/findExists.js} +0 -0
  102. /package/dist/{generateMetaTags.js → cjs/generateMetaTags.js} +0 -0
  103. /package/dist/{getBrowserslist.js → cjs/getBrowserslist.js} +0 -0
  104. /package/dist/{getCoreJsVersion.js → cjs/getCoreJsVersion.js} +0 -0
  105. /package/dist/{getTargetDir.js → cjs/getTargetDir.js} +0 -0
  106. /package/dist/{import.js → cjs/import.js} +0 -0
  107. /package/dist/{index.js → cjs/index.js} +0 -0
  108. /package/dist/{is → cjs/is}/nodeEnv.js +0 -0
  109. /package/dist/{is → cjs/is}/platform.js +0 -0
  110. /package/dist/{is → cjs/is}/type.js +0 -0
  111. /package/dist/{plugin.js → cjs/plugin.js} +0 -0
  112. /package/dist/{printBuildError.js → cjs/printBuildError.js} +0 -0
  113. /package/dist/{readTsConfig.js → cjs/readTsConfig.js} +0 -0
  114. /package/dist/{removeSlash.js → cjs/removeSlash.js} +0 -0
  115. /package/dist/{resolve.js → cjs/resolve.js} +0 -0
  116. /package/dist/{routes.js → cjs/routes.js} +0 -0
  117. /package/dist/{ssr.js → cjs/ssr.js} +0 -0
  118. /package/dist/{storage.js → cjs/storage.js} +0 -0
  119. /package/dist/{testUtils.js → cjs/testUtils.js} +0 -0
  120. /package/dist/{types.js → cjs/types.js} +0 -0
  121. /package/dist/{universal → cjs/universal}/constants.js +0 -0
  122. /package/dist/{universal → cjs/universal}/formatWebpack.js +0 -0
  123. /package/dist/{universal → cjs/universal}/remixRouter.js +0 -0
  124. /package/dist/{universal → cjs/universal}/serialize.js +0 -0
  125. /package/dist/{wait.js → cjs/wait.js} +0 -0
  126. /package/{compiled → dist/compiled}/address/index.js +0 -0
  127. /package/{compiled → dist/compiled}/address/lib/address.d.ts +0 -0
  128. /package/{compiled → dist/compiled}/address/package.json +0 -0
  129. /package/{compiled → dist/compiled}/ajv/codegen.js +0 -0
  130. /package/{compiled → dist/compiled}/ajv/index.js +0 -0
  131. /package/{compiled → dist/compiled}/ajv/license +0 -0
  132. /package/{compiled → dist/compiled}/ajv/package.json +0 -0
  133. /package/{compiled → dist/compiled}/ajv/types/ajv.d.ts +0 -0
  134. /package/{compiled → dist/compiled}/ajv/types/compile/codegen/code.d.ts +0 -0
  135. /package/{compiled → dist/compiled}/ajv/types/compile/codegen/index.d.ts +0 -0
  136. /package/{compiled → dist/compiled}/ajv/types/compile/codegen/scope.d.ts +0 -0
  137. /package/{compiled → dist/compiled}/ajv/types/compile/errors.d.ts +0 -0
  138. /package/{compiled → dist/compiled}/ajv/types/compile/index.d.ts +0 -0
  139. /package/{compiled → dist/compiled}/ajv/types/compile/ref_error.d.ts +0 -0
  140. /package/{compiled → dist/compiled}/ajv/types/compile/resolve.d.ts +0 -0
  141. /package/{compiled → dist/compiled}/ajv/types/compile/rules.d.ts +0 -0
  142. /package/{compiled → dist/compiled}/ajv/types/compile/util.d.ts +0 -0
  143. /package/{compiled → dist/compiled}/ajv/types/compile/validate/index.d.ts +0 -0
  144. /package/{compiled → dist/compiled}/ajv/types/compile/validate/subschema.d.ts +0 -0
  145. /package/{compiled → dist/compiled}/ajv/types/core.d.ts +0 -0
  146. /package/{compiled → dist/compiled}/ajv/types/runtime/validation_error.d.ts +0 -0
  147. /package/{compiled → dist/compiled}/ajv/types/types/index.d.ts +0 -0
  148. /package/{compiled → dist/compiled}/ajv/types/types/json-schema.d.ts +0 -0
  149. /package/{compiled → dist/compiled}/ajv/types/types/jtd-schema.d.ts +0 -0
  150. /package/{compiled → dist/compiled}/ajv/types/vocabularies/errors.d.ts +0 -0
  151. /package/{compiled → dist/compiled}/ajv/uri-js.d.ts +0 -0
  152. /package/{compiled → dist/compiled}/ajv-keywords/index.d.ts +0 -0
  153. /package/{compiled → dist/compiled}/ajv-keywords/index.js +0 -0
  154. /package/{compiled → dist/compiled}/ajv-keywords/license +0 -0
  155. /package/{compiled → dist/compiled}/ajv-keywords/package.json +0 -0
  156. /package/{compiled → dist/compiled}/better-ajv-errors/index.d.ts +0 -0
  157. /package/{compiled → dist/compiled}/better-ajv-errors/index.js +0 -0
  158. /package/{compiled → dist/compiled}/better-ajv-errors/license +0 -0
  159. /package/{compiled → dist/compiled}/better-ajv-errors/package.json +0 -0
  160. /package/{compiled → dist/compiled}/browserslist/index.d.ts +0 -0
  161. /package/{compiled → dist/compiled}/browserslist/index.js +0 -0
  162. /package/{compiled → dist/compiled}/browserslist/license +0 -0
  163. /package/{compiled → dist/compiled}/browserslist/package.json +0 -0
  164. /package/{compiled → dist/compiled}/chalk/index.d.ts +0 -0
  165. /package/{compiled → dist/compiled}/chalk/index.js +0 -0
  166. /package/{compiled → dist/compiled}/chalk/license +0 -0
  167. /package/{compiled → dist/compiled}/chalk/package.json +0 -0
  168. /package/{compiled → dist/compiled}/chokidar/anymatch/index.d.ts +0 -0
  169. /package/{compiled → dist/compiled}/chokidar/fsevents.node +0 -0
  170. /package/{compiled → dist/compiled}/chokidar/index.js +0 -0
  171. /package/{compiled → dist/compiled}/chokidar/license +0 -0
  172. /package/{compiled → dist/compiled}/chokidar/package.json +0 -0
  173. /package/{compiled → dist/compiled}/chokidar/types/index.d.ts +0 -0
  174. /package/{compiled → dist/compiled}/commander/index.js +0 -0
  175. /package/{compiled → dist/compiled}/commander/license +0 -0
  176. /package/{compiled → dist/compiled}/commander/package.json +0 -0
  177. /package/{compiled → dist/compiled}/commander/typings/index.d.ts +0 -0
  178. /package/{compiled → dist/compiled}/debug/index.d.ts +0 -0
  179. /package/{compiled → dist/compiled}/debug/index.js +0 -0
  180. /package/{compiled → dist/compiled}/debug/license +0 -0
  181. /package/{compiled → dist/compiled}/debug/ms/index.d.ts +0 -0
  182. /package/{compiled → dist/compiled}/debug/package.json +0 -0
  183. /package/{compiled → dist/compiled}/dotenv/index.js +0 -0
  184. /package/{compiled → dist/compiled}/dotenv/license +0 -0
  185. /package/{compiled → dist/compiled}/dotenv/package.json +0 -0
  186. /package/{compiled → dist/compiled}/dotenv/types/index.d.ts +0 -0
  187. /package/{compiled → dist/compiled}/dotenv-expand/index.d.ts +0 -0
  188. /package/{compiled → dist/compiled}/dotenv-expand/index.js +0 -0
  189. /package/{compiled → dist/compiled}/dotenv-expand/license +0 -0
  190. /package/{compiled → dist/compiled}/dotenv-expand/package.json +0 -0
  191. /package/{compiled → dist/compiled}/execa/index.d.ts +0 -0
  192. /package/{compiled → dist/compiled}/execa/index.js +0 -0
  193. /package/{compiled → dist/compiled}/execa/license +0 -0
  194. /package/{compiled → dist/compiled}/execa/package.json +0 -0
  195. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -0
  196. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.scandir/out/index.d.ts +0 -0
  197. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +0 -0
  198. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +0 -0
  199. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +0 -0
  200. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -0
  201. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.stat/out/index.d.ts +0 -0
  202. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +0 -0
  203. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.stat/out/settings.d.ts +0 -0
  204. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +0 -0
  205. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.walk/out/index.d.ts +0 -0
  206. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +0 -0
  207. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +0 -0
  208. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +0 -0
  209. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.walk/out/settings.d.ts +0 -0
  210. /package/{compiled → dist/compiled}/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +0 -0
  211. /package/{compiled → dist/compiled}/fast-glob/index.js +0 -0
  212. /package/{compiled → dist/compiled}/fast-glob/license +0 -0
  213. /package/{compiled → dist/compiled}/fast-glob/out/index.d.ts +0 -0
  214. /package/{compiled → dist/compiled}/fast-glob/out/managers/tasks.d.ts +0 -0
  215. /package/{compiled → dist/compiled}/fast-glob/out/settings.d.ts +0 -0
  216. /package/{compiled → dist/compiled}/fast-glob/out/types/index.d.ts +0 -0
  217. /package/{compiled → dist/compiled}/fast-glob/package.json +0 -0
  218. /package/{compiled → dist/compiled}/filesize/filesize.d.ts +0 -0
  219. /package/{compiled → dist/compiled}/filesize/index.js +0 -0
  220. /package/{compiled → dist/compiled}/filesize/license +0 -0
  221. /package/{compiled → dist/compiled}/filesize/package.json +0 -0
  222. /package/{compiled → dist/compiled}/fs-extra/index.d.ts +0 -0
  223. /package/{compiled → dist/compiled}/fs-extra/index.js +0 -0
  224. /package/{compiled → dist/compiled}/fs-extra/license +0 -0
  225. /package/{compiled → dist/compiled}/fs-extra/package.json +0 -0
  226. /package/{compiled → dist/compiled}/glob/index.d.ts +0 -0
  227. /package/{compiled → dist/compiled}/glob/index.js +0 -0
  228. /package/{compiled → dist/compiled}/glob/license +0 -0
  229. /package/{compiled → dist/compiled}/glob/minimatch/index.d.ts +0 -0
  230. /package/{compiled → dist/compiled}/glob/package.json +0 -0
  231. /package/{compiled → dist/compiled}/globby/index.d.ts +0 -0
  232. /package/{compiled → dist/compiled}/globby/index.js +0 -0
  233. /package/{compiled → dist/compiled}/globby/license +0 -0
  234. /package/{compiled → dist/compiled}/globby/package.json +0 -0
  235. /package/{compiled → dist/compiled}/gzip-size/index.d.ts +0 -0
  236. /package/{compiled → dist/compiled}/gzip-size/index.js +0 -0
  237. /package/{compiled → dist/compiled}/gzip-size/license +0 -0
  238. /package/{compiled → dist/compiled}/gzip-size/package.json +0 -0
  239. /package/{compiled → dist/compiled}/import-lazy/index.d.ts +0 -0
  240. /package/{compiled → dist/compiled}/import-lazy/index.js +0 -0
  241. /package/{compiled → dist/compiled}/import-lazy/license +0 -0
  242. /package/{compiled → dist/compiled}/import-lazy/package.json +0 -0
  243. /package/{compiled → dist/compiled}/inquirer/index.d.ts +0 -0
  244. /package/{compiled → dist/compiled}/inquirer/index.js +0 -0
  245. /package/{compiled → dist/compiled}/inquirer/lib/objects/choice.d.ts +0 -0
  246. /package/{compiled → dist/compiled}/inquirer/lib/objects/choices.d.ts +0 -0
  247. /package/{compiled → dist/compiled}/inquirer/lib/objects/separator.d.ts +0 -0
  248. /package/{compiled → dist/compiled}/inquirer/lib/ui/baseUI.d.ts +0 -0
  249. /package/{compiled → dist/compiled}/inquirer/lib/ui/bottom-bar.d.ts +0 -0
  250. /package/{compiled → dist/compiled}/inquirer/lib/ui/prompt.d.ts +0 -0
  251. /package/{compiled → dist/compiled}/inquirer/license +0 -0
  252. /package/{compiled → dist/compiled}/inquirer/package.json +0 -0
  253. /package/{compiled → dist/compiled}/inquirer/through/index.d.ts +0 -0
  254. /package/{compiled → dist/compiled}/js-yaml/index.d.ts +0 -0
  255. /package/{compiled → dist/compiled}/js-yaml/index.js +0 -0
  256. /package/{compiled → dist/compiled}/js-yaml/license +0 -0
  257. /package/{compiled → dist/compiled}/js-yaml/package.json +0 -0
  258. /package/{compiled → dist/compiled}/json5/index.js +0 -0
  259. /package/{compiled → dist/compiled}/json5/lib/index.d.ts +0 -0
  260. /package/{compiled → dist/compiled}/json5/lib/parse.d.ts +0 -0
  261. /package/{compiled → dist/compiled}/json5/lib/stringify.d.ts +0 -0
  262. /package/{compiled → dist/compiled}/json5/package.json +0 -0
  263. /package/{compiled → dist/compiled}/lodash/common/array.d.ts +0 -0
  264. /package/{compiled → dist/compiled}/lodash/common/collection.d.ts +0 -0
  265. /package/{compiled → dist/compiled}/lodash/common/common.d.ts +0 -0
  266. /package/{compiled → dist/compiled}/lodash/common/date.d.ts +0 -0
  267. /package/{compiled → dist/compiled}/lodash/common/function.d.ts +0 -0
  268. /package/{compiled → dist/compiled}/lodash/common/lang.d.ts +0 -0
  269. /package/{compiled → dist/compiled}/lodash/common/math.d.ts +0 -0
  270. /package/{compiled → dist/compiled}/lodash/common/number.d.ts +0 -0
  271. /package/{compiled → dist/compiled}/lodash/common/object.d.ts +0 -0
  272. /package/{compiled → dist/compiled}/lodash/common/seq.d.ts +0 -0
  273. /package/{compiled → dist/compiled}/lodash/common/string.d.ts +0 -0
  274. /package/{compiled → dist/compiled}/lodash/common/util.d.ts +0 -0
  275. /package/{compiled → dist/compiled}/lodash/index.d.ts +0 -0
  276. /package/{compiled → dist/compiled}/lodash/index.js +0 -0
  277. /package/{compiled → dist/compiled}/lodash/license +0 -0
  278. /package/{compiled → dist/compiled}/lodash/package.json +0 -0
  279. /package/{compiled → dist/compiled}/mime-types/index.d.ts +0 -0
  280. /package/{compiled → dist/compiled}/mime-types/index.js +0 -0
  281. /package/{compiled → dist/compiled}/mime-types/license +0 -0
  282. /package/{compiled → dist/compiled}/mime-types/package.json +0 -0
  283. /package/{compiled → dist/compiled}/minimist/index.d.ts +0 -0
  284. /package/{compiled → dist/compiled}/minimist/index.js +0 -0
  285. /package/{compiled → dist/compiled}/minimist/license +0 -0
  286. /package/{compiled → dist/compiled}/minimist/package.json +0 -0
  287. /package/{compiled → dist/compiled}/nanoid/index.d.ts +0 -0
  288. /package/{compiled → dist/compiled}/nanoid/index.js +0 -0
  289. /package/{compiled → dist/compiled}/nanoid/license +0 -0
  290. /package/{compiled → dist/compiled}/nanoid/package.json +0 -0
  291. /package/{compiled → dist/compiled}/ora/cli-spinners/index.d.ts +0 -0
  292. /package/{compiled → dist/compiled}/ora/index.d.ts +0 -0
  293. /package/{compiled → dist/compiled}/ora/index.js +0 -0
  294. /package/{compiled → dist/compiled}/ora/license +0 -0
  295. /package/{compiled → dist/compiled}/ora/package.json +0 -0
  296. /package/{compiled → dist/compiled}/pkg-up/index.d.ts +0 -0
  297. /package/{compiled → dist/compiled}/pkg-up/index.js +0 -0
  298. /package/{compiled → dist/compiled}/pkg-up/license +0 -0
  299. /package/{compiled → dist/compiled}/pkg-up/package.json +0 -0
  300. /package/{compiled → dist/compiled}/recursive-readdir/index.d.ts +0 -0
  301. /package/{compiled → dist/compiled}/recursive-readdir/index.js +0 -0
  302. /package/{compiled → dist/compiled}/recursive-readdir/license +0 -0
  303. /package/{compiled → dist/compiled}/recursive-readdir/package.json +0 -0
  304. /package/{compiled → dist/compiled}/schema-utils3/index.d.ts +0 -0
  305. /package/{compiled → dist/compiled}/schema-utils3/index.js +0 -0
  306. /package/{compiled → dist/compiled}/schema-utils3/license +0 -0
  307. /package/{compiled → dist/compiled}/schema-utils3/package.json +0 -0
  308. /package/{compiled → dist/compiled}/semver/classes/comparator.d.ts +0 -0
  309. /package/{compiled → dist/compiled}/semver/classes/range.d.ts +0 -0
  310. /package/{compiled → dist/compiled}/semver/classes/semver.d.ts +0 -0
  311. /package/{compiled → dist/compiled}/semver/functions/clean.d.ts +0 -0
  312. /package/{compiled → dist/compiled}/semver/functions/cmp.d.ts +0 -0
  313. /package/{compiled → dist/compiled}/semver/functions/coerce.d.ts +0 -0
  314. /package/{compiled → dist/compiled}/semver/functions/compare-build.d.ts +0 -0
  315. /package/{compiled → dist/compiled}/semver/functions/compare-loose.d.ts +0 -0
  316. /package/{compiled → dist/compiled}/semver/functions/compare.d.ts +0 -0
  317. /package/{compiled → dist/compiled}/semver/functions/diff.d.ts +0 -0
  318. /package/{compiled → dist/compiled}/semver/functions/eq.d.ts +0 -0
  319. /package/{compiled → dist/compiled}/semver/functions/gt.d.ts +0 -0
  320. /package/{compiled → dist/compiled}/semver/functions/gte.d.ts +0 -0
  321. /package/{compiled → dist/compiled}/semver/functions/inc.d.ts +0 -0
  322. /package/{compiled → dist/compiled}/semver/functions/lt.d.ts +0 -0
  323. /package/{compiled → dist/compiled}/semver/functions/lte.d.ts +0 -0
  324. /package/{compiled → dist/compiled}/semver/functions/major.d.ts +0 -0
  325. /package/{compiled → dist/compiled}/semver/functions/minor.d.ts +0 -0
  326. /package/{compiled → dist/compiled}/semver/functions/neq.d.ts +0 -0
  327. /package/{compiled → dist/compiled}/semver/functions/parse.d.ts +0 -0
  328. /package/{compiled → dist/compiled}/semver/functions/patch.d.ts +0 -0
  329. /package/{compiled → dist/compiled}/semver/functions/prerelease.d.ts +0 -0
  330. /package/{compiled → dist/compiled}/semver/functions/rcompare.d.ts +0 -0
  331. /package/{compiled → dist/compiled}/semver/functions/rsort.d.ts +0 -0
  332. /package/{compiled → dist/compiled}/semver/functions/satisfies.d.ts +0 -0
  333. /package/{compiled → dist/compiled}/semver/functions/sort.d.ts +0 -0
  334. /package/{compiled → dist/compiled}/semver/functions/valid.d.ts +0 -0
  335. /package/{compiled → dist/compiled}/semver/index.d.ts +0 -0
  336. /package/{compiled → dist/compiled}/semver/index.js +0 -0
  337. /package/{compiled → dist/compiled}/semver/internals/identifiers.d.ts +0 -0
  338. /package/{compiled → dist/compiled}/semver/license +0 -0
  339. /package/{compiled → dist/compiled}/semver/package.json +0 -0
  340. /package/{compiled → dist/compiled}/semver/ranges/gtr.d.ts +0 -0
  341. /package/{compiled → dist/compiled}/semver/ranges/intersects.d.ts +0 -0
  342. /package/{compiled → dist/compiled}/semver/ranges/ltr.d.ts +0 -0
  343. /package/{compiled → dist/compiled}/semver/ranges/max-satisfying.d.ts +0 -0
  344. /package/{compiled → dist/compiled}/semver/ranges/min-satisfying.d.ts +0 -0
  345. /package/{compiled → dist/compiled}/semver/ranges/min-version.d.ts +0 -0
  346. /package/{compiled → dist/compiled}/semver/ranges/outside.d.ts +0 -0
  347. /package/{compiled → dist/compiled}/semver/ranges/simplify.d.ts +0 -0
  348. /package/{compiled → dist/compiled}/semver/ranges/subset.d.ts +0 -0
  349. /package/{compiled → dist/compiled}/semver/ranges/to-comparators.d.ts +0 -0
  350. /package/{compiled → dist/compiled}/semver/ranges/valid.d.ts +0 -0
  351. /package/{compiled → dist/compiled}/signale/index.d.ts +0 -0
  352. /package/{compiled → dist/compiled}/signale/index.js +0 -0
  353. /package/{compiled → dist/compiled}/signale/package.json +0 -0
  354. /package/{compiled → dist/compiled}/slash/index.d.ts +0 -0
  355. /package/{compiled → dist/compiled}/slash/index.js +0 -0
  356. /package/{compiled → dist/compiled}/slash/license +0 -0
  357. /package/{compiled → dist/compiled}/slash/package.json +0 -0
  358. /package/{compiled → dist/compiled}/strip-ansi/index.d.ts +0 -0
  359. /package/{compiled → dist/compiled}/strip-ansi/index.js +0 -0
  360. /package/{compiled → dist/compiled}/strip-ansi/license +0 -0
  361. /package/{compiled → dist/compiled}/strip-ansi/package.json +0 -0
  362. /package/{compiled → dist/compiled}/tsconfig-paths/index.js +0 -0
  363. /package/{compiled → dist/compiled}/tsconfig-paths/lib/config-loader.d.ts +0 -0
  364. /package/{compiled → dist/compiled}/tsconfig-paths/lib/filesystem.d.ts +0 -0
  365. /package/{compiled → dist/compiled}/tsconfig-paths/lib/index.d.ts +0 -0
  366. /package/{compiled → dist/compiled}/tsconfig-paths/lib/mapping-entry.d.ts +0 -0
  367. /package/{compiled → dist/compiled}/tsconfig-paths/lib/match-path-async.d.ts +0 -0
  368. /package/{compiled → dist/compiled}/tsconfig-paths/lib/match-path-sync.d.ts +0 -0
  369. /package/{compiled → dist/compiled}/tsconfig-paths/lib/register.d.ts +0 -0
  370. /package/{compiled → dist/compiled}/tsconfig-paths/lib/try-path.d.ts +0 -0
  371. /package/{compiled → dist/compiled}/tsconfig-paths/lib/tsconfig-loader.d.ts +0 -0
  372. /package/{compiled → dist/compiled}/tsconfig-paths/license +0 -0
  373. /package/{compiled → dist/compiled}/tsconfig-paths/package.json +0 -0
  374. /package/{compiled → dist/compiled}/upath/index.js +0 -0
  375. /package/{compiled → dist/compiled}/upath/license +0 -0
  376. /package/{compiled → dist/compiled}/upath/package.json +0 -0
  377. /package/{compiled → dist/compiled}/upath/upath.d.ts +0 -0
  378. /package/{compiled → dist/compiled}/url-join/index.d.ts +0 -0
  379. /package/{compiled → dist/compiled}/url-join/index.js +0 -0
  380. /package/{compiled → dist/compiled}/url-join/license +0 -0
  381. /package/{compiled → dist/compiled}/url-join/package.json +0 -0
  382. /package/{compiled → dist/compiled}/webpack-chain/index.js +0 -0
  383. /package/{compiled → dist/compiled}/webpack-chain/license +0 -0
  384. /package/{compiled → dist/compiled}/webpack-chain/package.json +0 -0
  385. /package/{compiled → dist/compiled}/webpack-chain/types/index.d.ts +0 -0
  386. /package/{compiled → dist/compiled}/webpack-dev-middleware/index.js +0 -0
  387. /package/{compiled → dist/compiled}/webpack-dev-middleware/license +0 -0
  388. /package/{compiled → dist/compiled}/webpack-dev-middleware/package.json +0 -0
  389. /package/{compiled → dist/compiled}/webpack-dev-middleware/types/index.d.ts +0 -0
  390. /package/dist/{FileSizeReporter.d.ts → types/FileSizeReporter.d.ts} +0 -0
  391. /package/dist/{alias.d.ts → types/alias.d.ts} +0 -0
  392. /package/dist/{analyzeProject.d.ts → types/analyzeProject.d.ts} +0 -0
  393. /package/dist/{applyOptionsChain.d.ts → types/applyOptionsChain.d.ts} +0 -0
  394. /package/dist/{babel.d.ts → types/babel.d.ts} +0 -0
  395. /package/dist/{chainId.d.ts → types/chainId.d.ts} +0 -0
  396. /package/dist/{clearConsole.d.ts → types/clearConsole.d.ts} +0 -0
  397. /package/dist/{commands.d.ts → types/commands.d.ts} +0 -0
  398. /package/dist/{compatRequire.d.ts → types/compatRequire.d.ts} +0 -0
  399. /package/dist/{compiled.d.ts → types/compiled.d.ts} +0 -0
  400. /package/dist/{debug.d.ts → types/debug.d.ts} +0 -0
  401. /package/dist/{emptyDir.d.ts → types/emptyDir.d.ts} +0 -0
  402. /package/dist/{ensureAbsolutePath.d.ts → types/ensureAbsolutePath.d.ts} +0 -0
  403. /package/dist/{ensureArray.d.ts → types/ensureArray.d.ts} +0 -0
  404. /package/dist/{findExists.d.ts → types/findExists.d.ts} +0 -0
  405. /package/dist/{generateMetaTags.d.ts → types/generateMetaTags.d.ts} +0 -0
  406. /package/dist/{getBrowserslist.d.ts → types/getBrowserslist.d.ts} +0 -0
  407. /package/dist/{getCoreJsVersion.d.ts → types/getCoreJsVersion.d.ts} +0 -0
  408. /package/dist/{getEntryOptions.d.ts → types/getEntryOptions.d.ts} +0 -0
  409. /package/dist/{getPackageManager.d.ts → types/getPackageManager.d.ts} +0 -0
  410. /package/dist/{getPort.d.ts → types/getPort.d.ts} +0 -0
  411. /package/dist/{getServerConfig.d.ts → types/getServerConfig.d.ts} +0 -0
  412. /package/dist/{getTargetDir.d.ts → types/getTargetDir.d.ts} +0 -0
  413. /package/dist/{import.d.ts → types/import.d.ts} +0 -0
  414. /package/dist/{index.d.ts → types/index.d.ts} +0 -0
  415. /package/dist/{is → types/is}/index.d.ts +0 -0
  416. /package/dist/{is → types/is}/nodeEnv.d.ts +0 -0
  417. /package/dist/{is → types/is}/platform.d.ts +0 -0
  418. /package/dist/{is → types/is}/type.d.ts +0 -0
  419. /package/dist/{logger.d.ts → types/logger.d.ts} +0 -0
  420. /package/dist/{monorepo.d.ts → types/monorepo.d.ts} +0 -0
  421. /package/dist/{nodeEnv.d.ts → types/nodeEnv.d.ts} +0 -0
  422. /package/dist/{path.d.ts → types/path.d.ts} +0 -0
  423. /package/dist/{pathSerializer.d.ts → types/pathSerializer.d.ts} +0 -0
  424. /package/dist/{plugin.d.ts → types/plugin.d.ts} +0 -0
  425. /package/dist/{printBuildError.d.ts → types/printBuildError.d.ts} +0 -0
  426. /package/dist/{react.d.ts → types/react.d.ts} +0 -0
  427. /package/dist/{readTsConfig.d.ts → types/readTsConfig.d.ts} +0 -0
  428. /package/dist/{removeSlash.d.ts → types/removeSlash.d.ts} +0 -0
  429. /package/dist/{resolve.d.ts → types/resolve.d.ts} +0 -0
  430. /package/dist/{routes.d.ts → types/routes.d.ts} +0 -0
  431. /package/dist/{runtimeExports.d.ts → types/runtimeExports.d.ts} +0 -0
  432. /package/dist/{ssr.d.ts → types/ssr.d.ts} +0 -0
  433. /package/dist/{storage.d.ts → types/storage.d.ts} +0 -0
  434. /package/dist/{testUtils.d.ts → types/testUtils.d.ts} +0 -0
  435. /package/dist/{types.d.ts → types/types.d.ts} +0 -0
  436. /package/dist/{universal → types/universal}/constants.d.ts +0 -0
  437. /package/dist/{universal → types/universal}/formatWebpack.d.ts +0 -0
  438. /package/dist/{universal → types/universal}/nestedRoutes.d.ts +0 -0
  439. /package/dist/{universal → types/universal}/remixRouter.d.ts +0 -0
  440. /package/dist/{universal → types/universal}/serialize.d.ts +0 -0
  441. /package/dist/{version.d.ts → types/version.d.ts} +0 -0
  442. /package/dist/{wait.d.ts → types/wait.d.ts} +0 -0
  443. /package/dist/{watch.d.ts → types/watch.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 16399fd: feat: support extendPageData hook and last updated time
8
+
9
+ feat: 支持 extendPageData 钩子和最后更新时间功能
10
+
11
+ ### Patch Changes
12
+
13
+ - 4779152: fix(utils): the esm format files should be generate for the client
14
+
15
+ fix(utils): 应该为客户端使用,生成 esm 格式的文件
16
+
17
+ - 9321bef: feat: adjust server.worker config to deploy.worker.ssr
18
+
19
+ feat: 调整 server.worker 为 deploy.worker.ssr
20
+
21
+ - 9b45c58: fix(app-tools): should not print all addresses when custom dev.host
22
+
23
+ fix(app-tools): 修复自定义 dev.host 时会输出多余的 URL 地址的问题
24
+
25
+ - 52d0cb1: feat: support config handle of Route
26
+ feat: 支持配置 Route 的 handle 属性
27
+ - 60a81d0: feat: add ssr.inlineScript for use inline json instead inline script when ssr
28
+ feat: 添加 ssr.inlineScript 用于在 ssr 模式下使用内联 json 而不是内联脚本
29
+ - dacef96: chore: remove plugin-egg and plugin-nest
30
+ chore: 移除 plugin-egg 和 plugin-nest
31
+
32
+ ## 2.13.4
33
+
3
34
  ## 2.13.3
4
35
 
5
36
  ## 2.13.2
@@ -2,22 +2,8 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
7
  var __export = (target, all) => {
22
8
  for (var name in all)
23
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -88,7 +74,10 @@ const getAliasConfig = (aliasOption, option) => {
88
74
  const baseUrl = (_a = tsconfig == null ? void 0 : tsconfig.compilerOptions) == null ? void 0 : _a.baseUrl;
89
75
  return {
90
76
  absoluteBaseUrl: baseUrl ? import_path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
91
- paths: __spreadValues(__spreadValues({}, alias), (_b = tsconfig == null ? void 0 : tsconfig.compilerOptions) == null ? void 0 : _b.paths),
77
+ paths: {
78
+ ...alias,
79
+ ...(_b = tsconfig == null ? void 0 : tsconfig.compilerOptions) == null ? void 0 : _b.paths
80
+ },
92
81
  isTsPath: true,
93
82
  isTsProject
94
83
  };
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
28
  var analyzeProject_exports = {};
49
29
  __export(analyzeProject_exports, {
50
30
  isApiOnly: () => isApiOnly,
@@ -54,16 +34,16 @@ module.exports = __toCommonJS(analyzeProject_exports);
54
34
  var path = __toESM(require("path"));
55
35
  var import_commands = require("./commands");
56
36
  var import_compiled = require("./compiled");
57
- const isApiOnly = (appDirectory, entryDir) => __async(void 0, null, function* () {
37
+ const isApiOnly = async (appDirectory, entryDir) => {
58
38
  const srcDir = path.join(appDirectory, entryDir != null ? entryDir : "src");
59
- const existSrc = yield import_compiled.fs.pathExists(srcDir);
39
+ const existSrc = await import_compiled.fs.pathExists(srcDir);
60
40
  const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
61
41
  return !existSrc || Boolean(options["api-only"]);
62
- });
63
- const isWebOnly = () => __async(void 0, null, function* () {
42
+ };
43
+ const isWebOnly = async () => {
64
44
  const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
65
45
  return Boolean(options["web-only"]);
66
- });
46
+ };
67
47
  // Annotate the CommonJS export names for ESM import in node:
68
48
  0 && (module.exports = {
69
49
  isApiOnly,
@@ -1,21 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
5
  var __export = (target, all) => {
20
6
  for (var name in all)
21
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -98,7 +84,11 @@ const modifyPresetOptions = (presetName, options, presets = []) => {
98
84
  presets.forEach((preset, index) => {
99
85
  if (Array.isArray(preset)) {
100
86
  if (typeof preset[0] === "string" && (0, import_path2.normalizeToPosixPath)(preset[0]).includes(presetName)) {
101
- preset[1] = __spreadValues(__spreadValues({}, preset[1] || {}), options);
87
+ preset[1] = {
88
+ ...preset[1] || {},
89
+ ...options
90
+ // `options` is specific to different presets
91
+ };
102
92
  }
103
93
  } else if (typeof preset === "string" && (0, import_path2.normalizeToPosixPath)(preset).includes(presetName)) {
104
94
  presets[index] = [preset, options];
@@ -124,7 +114,10 @@ const getBabelUtils = (config) => {
124
114
  };
125
115
  const applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
126
116
  if (userBabelConfig) {
127
- const babelUtils = __spreadValues(__spreadValues({}, getBabelUtils(defaultOptions)), extraBabelUtils);
117
+ const babelUtils = {
118
+ ...getBabelUtils(defaultOptions),
119
+ ...extraBabelUtils
120
+ };
128
121
  return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
129
122
  }
130
123
  return defaultOptions;
@@ -1,21 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
5
  var __export = (target, all) => {
20
6
  for (var name in all)
21
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -49,10 +35,11 @@ const dynamicImport = new Function(
49
35
  "return import(modulePath)"
50
36
  );
51
37
  const requireExistModule = (filename, opt) => {
52
- const final = __spreadValues({
38
+ const final = {
53
39
  extensions: [".ts", ".js"],
54
- interop: true
55
- }, opt);
40
+ interop: true,
41
+ ...opt
42
+ };
56
43
  const exist = (0, import_findExists.findExists)(final.extensions.map((ext) => `${filename}${ext}`));
57
44
  if (!exist) {
58
45
  return null;
@@ -42,10 +42,8 @@ __export(constants_exports, {
42
42
  SERVER_BUNDLE_DIRECTORY: () => SERVER_BUNDLE_DIRECTORY,
43
43
  SERVER_DIR: () => SERVER_DIR,
44
44
  SERVER_PLUGIN_BFF: () => SERVER_PLUGIN_BFF,
45
- SERVER_PLUGIN_EGG: () => SERVER_PLUGIN_EGG,
46
45
  SERVER_PLUGIN_EXPRESS: () => SERVER_PLUGIN_EXPRESS,
47
46
  SERVER_PLUGIN_KOA: () => SERVER_PLUGIN_KOA,
48
- SERVER_PLUGIN_NEST: () => SERVER_PLUGIN_NEST,
49
47
  SERVER_PLUGIN_POLYFILL: () => SERVER_PLUGIN_POLYFILL,
50
48
  SERVER_PLUGIN_SERVER: () => SERVER_PLUGIN_SERVER,
51
49
  SERVER_RENDER_FUNCTION_NAME: () => SERVER_RENDER_FUNCTION_NAME,
@@ -79,9 +77,7 @@ const INTERNAL_APP_TOOLS_PLUGINS = {
79
77
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
80
78
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
81
79
  "@modern-js/plugin-express": "@modern-js/plugin-express/cli",
82
- "@modern-js/plugin-egg": "@modern-js/plugin-egg/cli",
83
80
  "@modern-js/plugin-koa": "@modern-js/plugin-koa/cli",
84
- "@modern-js/plugin-nest": "@modern-js/plugin-nest/cli",
85
81
  "@modern-js/plugin-server": "@modern-js/plugin-server/cli",
86
82
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
87
83
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
@@ -125,9 +121,7 @@ const INTERNAL_CLI_PLUGINS = {
125
121
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
126
122
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
127
123
  "@modern-js/plugin-express": "@modern-js/plugin-express/cli",
128
- "@modern-js/plugin-egg": "@modern-js/plugin-egg/cli",
129
124
  "@modern-js/plugin-koa": "@modern-js/plugin-koa/cli",
130
- "@modern-js/plugin-nest": "@modern-js/plugin-nest/cli",
131
125
  "@modern-js/plugin-server": "@modern-js/plugin-server/cli",
132
126
  "@modern-js/plugin-swc": "@modern-js/plugin-swc",
133
127
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
@@ -140,17 +134,13 @@ const INTERNAL_CLI_PLUGINS = {
140
134
  };
141
135
  const SERVER_PLUGIN_BFF = "@modern-js/plugin-bff";
142
136
  const SERVER_PLUGIN_EXPRESS = "@modern-js/plugin-express";
143
- const SERVER_PLUGIN_EGG = "@modern-js/plugin-egg";
144
137
  const SERVER_PLUGIN_KOA = "@modern-js/plugin-koa";
145
- const SERVER_PLUGIN_NEST = "@modern-js/plugin-nest";
146
138
  const SERVER_PLUGIN_SERVER = "@modern-js/plugin-server";
147
139
  const SERVER_PLUGIN_POLYFILL = "@modern-js/plugin-polyfill";
148
140
  const INTERNAL_SERVER_PLUGINS = {
149
141
  [SERVER_PLUGIN_BFF]: "@modern-js/plugin-bff/server",
150
142
  [SERVER_PLUGIN_EXPRESS]: "@modern-js/plugin-express/server",
151
- [SERVER_PLUGIN_EGG]: "@modern-js/plugin-egg/server",
152
143
  [SERVER_PLUGIN_KOA]: "@modern-js/plugin-koa/server",
153
- [SERVER_PLUGIN_NEST]: "@modern-js/plugin-nest/server",
154
144
  [SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
155
145
  [SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
156
146
  };
@@ -270,7 +260,13 @@ const PLUGIN_SCHEMAS = {
270
260
  schema: { type: ["boolean", "object"] }
271
261
  }
272
262
  ],
273
- "@modern-js/plugin-nocode": []
263
+ "@modern-js/plugin-nocode": [],
264
+ "@modern-js/plugin-worker": [
265
+ {
266
+ target: "deploy.worker.ssr",
267
+ schema: { type: ["boolean"] }
268
+ }
269
+ ]
274
270
  };
275
271
  const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
276
272
  allowNamespaces: true,
@@ -308,10 +304,8 @@ const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
308
304
  SERVER_BUNDLE_DIRECTORY,
309
305
  SERVER_DIR,
310
306
  SERVER_PLUGIN_BFF,
311
- SERVER_PLUGIN_EGG,
312
307
  SERVER_PLUGIN_EXPRESS,
313
308
  SERVER_PLUGIN_KOA,
314
- SERVER_PLUGIN_NEST,
315
309
  SERVER_PLUGIN_POLYFILL,
316
310
  SERVER_PLUGIN_SERVER,
317
311
  SERVER_RENDER_FUNCTION_NAME,
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var emptyDir_exports = {};
19
+ __export(emptyDir_exports, {
20
+ emptyDir: () => emptyDir
21
+ });
22
+ module.exports = __toCommonJS(emptyDir_exports);
23
+ var import_compiled = require("./compiled");
24
+ const emptyDir = async (dir) => {
25
+ if (await import_compiled.fs.pathExists(dir)) {
26
+ await import_compiled.fs.emptyDir(dir);
27
+ }
28
+ };
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ emptyDir
32
+ });
@@ -1,21 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
5
  var __export = (target, all) => {
20
6
  for (var name in all)
21
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -42,7 +28,7 @@ const getEntryOptions = (name, baseOptions, optionsByEntries, packageName) => {
42
28
  if (optionsByEntry === void 0 && name === import_constants.MAIN_ENTRY_NAME && packageName) {
43
29
  optionsByEntry = getOptionsByEntryName(packageName, optionsByEntries);
44
30
  }
45
- return optionsByEntry !== void 0 ? (0, import_is.isPlainObject)(optionsByEntry) && (0, import_is.isPlainObject)(baseOptions) ? __spreadValues(__spreadValues({}, baseOptions), optionsByEntry) : optionsByEntry : baseOptions;
31
+ return optionsByEntry !== void 0 ? (0, import_is.isPlainObject)(optionsByEntry) && (0, import_is.isPlainObject)(baseOptions) ? { ...baseOptions, ...optionsByEntry } : optionsByEntry : baseOptions;
46
32
  } else {
47
33
  return baseOptions;
48
34
  }
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
28
  var getPackageManager_exports = {};
49
29
  __export(getPackageManager_exports, {
50
30
  getPackageManager: () => getPackageManager
@@ -55,31 +35,29 @@ var import_path = __toESM(require("path"));
55
35
  var import_compiled = require("./compiled");
56
36
  var import_nodeEnv = require("./nodeEnv");
57
37
  const MAX_TIMES = 5;
58
- function getPackageManager() {
59
- return __async(this, arguments, function* (cwd = process.cwd()) {
60
- let appDirectory = cwd;
61
- let times = 0;
62
- while (import_os.default.homedir() !== appDirectory && times < MAX_TIMES) {
63
- times++;
64
- if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "pnpm-lock.yaml"))) {
65
- return "pnpm";
66
- }
67
- if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "yarn.lock"))) {
68
- return "yarn";
69
- }
70
- if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "package-lock.json"))) {
71
- return "npm";
72
- }
73
- appDirectory = import_path.default.join(appDirectory, "..");
74
- }
75
- if (yield (0, import_nodeEnv.canUsePnpm)()) {
38
+ async function getPackageManager(cwd = process.cwd()) {
39
+ let appDirectory = cwd;
40
+ let times = 0;
41
+ while (import_os.default.homedir() !== appDirectory && times < MAX_TIMES) {
42
+ times++;
43
+ if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "pnpm-lock.yaml"))) {
76
44
  return "pnpm";
77
45
  }
78
- if (yield (0, import_nodeEnv.canUseYarn)()) {
46
+ if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "yarn.lock"))) {
79
47
  return "yarn";
80
48
  }
81
- return "npm";
82
- });
49
+ if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "package-lock.json"))) {
50
+ return "npm";
51
+ }
52
+ appDirectory = import_path.default.join(appDirectory, "..");
53
+ }
54
+ if (await (0, import_nodeEnv.canUsePnpm)()) {
55
+ return "pnpm";
56
+ }
57
+ if (await (0, import_nodeEnv.canUseYarn)()) {
58
+ return "yarn";
59
+ }
60
+ return "npm";
83
61
  }
84
62
  // Annotate the CommonJS export names for ESM import in node:
85
63
  0 && (module.exports = {
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
28
  var getPort_exports = {};
49
29
  __export(getPort_exports, {
50
30
  getPort: () => getPort
@@ -53,10 +33,10 @@ module.exports = __toCommonJS(getPort_exports);
53
33
  var import_net = __toESM(require("net"));
54
34
  var import_compiled = require("./compiled");
55
35
  var import_logger = require("./logger");
56
- const getPort = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (port, {
36
+ const getPort = async (port, {
57
37
  tryLimits = 20,
58
38
  strictPort = false
59
- } = {}) {
39
+ } = {}) => {
60
40
  if (typeof port === "string") {
61
41
  port = parseInt(port, 10);
62
42
  }
@@ -68,7 +48,7 @@ const getPort = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (port, {
68
48
  let attempts = 0;
69
49
  while (!found && attempts <= tryLimits) {
70
50
  try {
71
- yield new Promise((resolve, reject) => {
51
+ await new Promise((resolve, reject) => {
72
52
  const server = import_net.default.createServer();
73
53
  server.unref();
74
54
  server.on("error", reject);
@@ -105,7 +85,7 @@ const getPort = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (port, {
105
85
  }
106
86
  }
107
87
  return port;
108
- });
88
+ };
109
89
  // Annotate the CommonJS export names for ESM import in node:
110
90
  0 && (module.exports = {
111
91
  getPort
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
28
  var getServerConfig_exports = {};
49
29
  __export(getServerConfig_exports, {
50
30
  getServerConfig: () => getServerConfig
@@ -53,14 +33,14 @@ module.exports = __toCommonJS(getServerConfig_exports);
53
33
  var path = __toESM(require("path"));
54
34
  var import_constants = require("./constants");
55
35
  var import_findExists = require("./findExists");
56
- const getServerConfig = (appDirectory, configFile) => __async(void 0, null, function* () {
36
+ const getServerConfig = async (appDirectory, configFile) => {
57
37
  const configFilePath = (0, import_findExists.findExists)(
58
38
  import_constants.CONFIG_FILE_EXTENSIONS.map(
59
39
  (extension) => path.resolve(appDirectory, `${configFile}${extension}`)
60
40
  )
61
41
  );
62
42
  return configFilePath;
63
- });
43
+ };
64
44
  // Annotate the CommonJS export names for ESM import in node:
65
45
  0 && (module.exports = {
66
46
  getServerConfig
@@ -82,8 +82,9 @@ const isUseSSRBundle = (config) => {
82
82
  return isSSR(config);
83
83
  };
84
84
  const isServiceWorker = (config) => {
85
- const { output, server } = config;
86
- if ((server == null ? void 0 : server.worker) && ((output == null ? void 0 : output.ssg) || isSSR(config))) {
85
+ var _a;
86
+ const { output, deploy } = config;
87
+ if (((_a = deploy == null ? void 0 : deploy.worker) == null ? void 0 : _a.ssr) && ((output == null ? void 0 : output.ssg) || isSSR(config))) {
87
88
  return true;
88
89
  }
89
90
  return false;
@@ -2,22 +2,8 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
7
  var __export = (target, all) => {
22
8
  for (var name in all)
23
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -88,8 +74,11 @@ const DEFAULT_CONFIG = {
88
74
  class Logger {
89
75
  constructor(options = {}) {
90
76
  this.level = options.level || LOG_TYPES.log.level;
91
- this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
92
- this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
77
+ this.config = { ...DEFAULT_CONFIG, ...options.config || {} };
78
+ this.types = {
79
+ ...LOG_TYPES,
80
+ ...options.types || {}
81
+ };
93
82
  this.longestLabel = this.getLongestLabel();
94
83
  Object.keys(this.types).forEach((type) => {
95
84
  this[type] = this._log.bind(this, type);
@@ -2,22 +2,8 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
7
  var __export = (target, all) => {
22
8
  for (var name in all)
23
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -77,7 +63,10 @@ const isModernjsMonorepo = (root) => {
77
63
  return false;
78
64
  }
79
65
  const json = JSON.parse(import_fs.default.readFileSync(pkgJsonPath, "utf8"));
80
- const deps = __spreadValues(__spreadValues({}, json.dependencies || {}), json.devDependencies || {});
66
+ const deps = {
67
+ ...json.dependencies || {},
68
+ ...json.devDependencies || {}
69
+ };
81
70
  return Boolean(deps["@modern-js/monorepo-tools"]);
82
71
  };
83
72
  const findMonorepoRoot = (appDirectory, maxDepth = PACKAGE_MAX_DEPTH) => {
@@ -0,0 +1,55 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var nodeEnv_exports = {};
19
+ __export(nodeEnv_exports, {
20
+ canUseNpm: () => canUseNpm,
21
+ canUsePnpm: () => canUsePnpm,
22
+ canUseYarn: () => canUseYarn
23
+ });
24
+ module.exports = __toCommonJS(nodeEnv_exports);
25
+ var import_compiled = require("./compiled");
26
+ async function canUseNpm() {
27
+ try {
28
+ await (0, import_compiled.execa)("npm", ["--version"], { env: process.env });
29
+ return true;
30
+ } catch (e) {
31
+ return false;
32
+ }
33
+ }
34
+ async function canUseYarn() {
35
+ try {
36
+ await (0, import_compiled.execa)("yarn", ["--version"], { env: process.env });
37
+ return true;
38
+ } catch (e) {
39
+ return false;
40
+ }
41
+ }
42
+ async function canUsePnpm() {
43
+ try {
44
+ await (0, import_compiled.execa)("pnpm", ["--version"], { env: process.env });
45
+ return true;
46
+ } catch (e) {
47
+ return false;
48
+ }
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ canUseNpm,
53
+ canUsePnpm,
54
+ canUseYarn
55
+ });