@modern-js/utils 1.3.6 → 1.3.8-canary.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. package/.eslintrc.js +9 -0
  2. package/CHANGELOG.md +6 -0
  3. package/compiled/browserslist/index.d.ts +178 -0
  4. package/compiled/browserslist/index.js +1 -0
  5. package/compiled/browserslist/license +20 -0
  6. package/compiled/browserslist/package.json +1 -0
  7. package/compiled/chalk/index.d.ts +415 -0
  8. package/compiled/chalk/index.js +1 -0
  9. package/compiled/chalk/license +9 -0
  10. package/compiled/chalk/package.json +1 -0
  11. package/compiled/chokidar/anymatch/index.d.ts +19 -0
  12. package/compiled/chokidar/fsevents.node +0 -0
  13. package/compiled/chokidar/index.js +40 -0
  14. package/compiled/chokidar/license +21 -0
  15. package/compiled/chokidar/package.json +1 -0
  16. package/compiled/chokidar/types/index.d.ts +188 -0
  17. package/compiled/commander/index.js +1 -0
  18. package/compiled/commander/license +22 -0
  19. package/compiled/commander/package.json +1 -0
  20. package/compiled/commander/typings/index.d.ts +774 -0
  21. package/compiled/debug/index.d.ts +54 -0
  22. package/compiled/debug/index.js +1 -0
  23. package/compiled/debug/license +20 -0
  24. package/compiled/debug/ms/index.d.ts +25 -0
  25. package/compiled/debug/package.json +1 -0
  26. package/compiled/execa/index.d.ts +564 -0
  27. package/compiled/execa/index.js +1 -0
  28. package/compiled/execa/license +9 -0
  29. package/compiled/execa/package.json +1 -0
  30. package/compiled/filesize/filesize.d.ts +131 -0
  31. package/compiled/filesize/index.js +9 -0
  32. package/compiled/filesize/license +28 -0
  33. package/compiled/filesize/package.json +1 -0
  34. package/compiled/fs-extra/index.d.ts +563 -0
  35. package/compiled/fs-extra/index.js +1 -0
  36. package/compiled/fs-extra/license +15 -0
  37. package/compiled/fs-extra/package.json +1 -0
  38. package/compiled/glob/index.d.ts +91 -0
  39. package/compiled/glob/index.js +1 -0
  40. package/compiled/glob/license +21 -0
  41. package/compiled/glob/minimatch/index.d.ts +204 -0
  42. package/compiled/glob/package.json +1 -0
  43. package/compiled/gzip-size/index.d.ts +96 -0
  44. package/compiled/gzip-size/index.js +1 -0
  45. package/compiled/gzip-size/license +9 -0
  46. package/compiled/gzip-size/package.json +1 -0
  47. package/compiled/import-lazy/index.d.ts +26 -0
  48. package/compiled/import-lazy/index.js +1 -0
  49. package/compiled/import-lazy/license +9 -0
  50. package/compiled/import-lazy/package.json +1 -0
  51. package/compiled/js-yaml/index.d.ts +154 -0
  52. package/compiled/js-yaml/index.js +1 -0
  53. package/compiled/js-yaml/license +21 -0
  54. package/compiled/js-yaml/package.json +1 -0
  55. package/compiled/lodash/common/array.d.ts +2126 -0
  56. package/compiled/lodash/common/collection.d.ts +1930 -0
  57. package/compiled/lodash/common/common.d.ts +280 -0
  58. package/compiled/lodash/common/date.d.ts +23 -0
  59. package/compiled/lodash/common/function.d.ts +1446 -0
  60. package/compiled/lodash/common/lang.d.ts +1693 -0
  61. package/compiled/lodash/common/math.d.ts +405 -0
  62. package/compiled/lodash/common/number.d.ts +131 -0
  63. package/compiled/lodash/common/object.d.ts +2519 -0
  64. package/compiled/lodash/common/seq.d.ts +210 -0
  65. package/compiled/lodash/common/string.d.ts +788 -0
  66. package/compiled/lodash/common/util.d.ts +1220 -0
  67. package/compiled/lodash/index.d.ts +46 -0
  68. package/compiled/lodash/index.js +9 -0
  69. package/compiled/lodash/license +47 -0
  70. package/compiled/lodash/package.json +1 -0
  71. package/compiled/pkg-up/index.d.ts +48 -0
  72. package/compiled/pkg-up/index.js +1 -0
  73. package/compiled/pkg-up/license +9 -0
  74. package/compiled/pkg-up/package.json +1 -0
  75. package/compiled/recursive-readdir/index.d.ts +21 -0
  76. package/compiled/recursive-readdir/index.js +1 -0
  77. package/compiled/recursive-readdir/license +21 -0
  78. package/compiled/recursive-readdir/package.json +1 -0
  79. package/compiled/signale/index.d.ts +162 -0
  80. package/compiled/signale/index.js +1 -0
  81. package/compiled/signale/package.json +1 -0
  82. package/compiled/strip-ansi/index.d.ts +17 -0
  83. package/compiled/strip-ansi/index.js +1 -0
  84. package/compiled/strip-ansi/license +9 -0
  85. package/compiled/strip-ansi/package.json +1 -0
  86. package/compiled/upath/index.js +1 -0
  87. package/compiled/upath/license +22 -0
  88. package/compiled/upath/package.json +1 -0
  89. package/compiled/upath/upath.d.ts +241 -0
  90. package/dist/FileSizeReporter.d.ts +16 -0
  91. package/dist/FileSizeReporter.js +151 -0
  92. package/dist/alias.d.ts +21 -0
  93. package/dist/alias.js +62 -0
  94. package/dist/applyOptionsChain.d.ts +6 -0
  95. package/dist/applyOptionsChain.js +30 -0
  96. package/dist/clearConsole.d.ts +1 -0
  97. package/dist/clearConsole.js +9 -0
  98. package/dist/compatRequire.d.ts +8 -0
  99. package/dist/compatRequire.js +28 -0
  100. package/dist/compiled.d.ts +21 -0
  101. package/dist/compiled.js +33 -0
  102. package/dist/constants.d.ts +222 -0
  103. package/dist/constants.js +277 -0
  104. package/dist/{js/modern/debug.js → debug.d.ts} +1 -3
  105. package/dist/debug.js +11 -0
  106. package/dist/emptyDir.d.ts +1 -0
  107. package/dist/emptyDir.js +19 -0
  108. package/dist/{js/modern/ensureAbsolutePath.js → ensureAbsolutePath.d.ts} +1 -3
  109. package/dist/ensureAbsolutePath.js +15 -0
  110. package/dist/findExists.d.ts +6 -0
  111. package/dist/findExists.js +21 -0
  112. package/dist/format.d.ts +16 -0
  113. package/dist/format.js +113 -0
  114. package/dist/generateMetaTags.d.ts +16 -0
  115. package/dist/generateMetaTags.js +48 -0
  116. package/dist/getBrowserslist.d.ts +2 -0
  117. package/dist/getBrowserslist.js +7 -0
  118. package/dist/getCacheIdentifier.d.ts +7 -0
  119. package/dist/getCacheIdentifier.js +24 -0
  120. package/dist/getEntryOptions.d.ts +1 -0
  121. package/dist/getEntryOptions.js +26 -0
  122. package/dist/getPackageManager.d.ts +1 -0
  123. package/dist/getPackageManager.js +47 -0
  124. package/dist/getPort.d.ts +7 -0
  125. package/dist/getPort.js +62 -0
  126. package/dist/getServerConfig.d.ts +1 -0
  127. package/dist/getServerConfig.js +39 -0
  128. package/dist/import.d.ts +5 -0
  129. package/dist/import.js +10 -0
  130. package/dist/index.d.ts +33 -0
  131. package/dist/index.js +45 -0
  132. package/dist/is/index.d.ts +34 -0
  133. package/dist/is/index.js +82 -0
  134. package/dist/is/node-env.d.ts +4 -0
  135. package/dist/is/node-env.js +12 -0
  136. package/dist/is/platform.d.ts +2 -0
  137. package/dist/is/platform.js +10 -0
  138. package/dist/is/type.d.ts +8 -0
  139. package/dist/is/type.js +38 -0
  140. package/dist/js/modern/monorepo.js +4 -5
  141. package/dist/js/node/monorepo.js +5 -7
  142. package/dist/js/treeshaking/monorepo.js +7 -6
  143. package/dist/logger.d.ts +63 -0
  144. package/dist/logger.js +128 -0
  145. package/dist/monorepo.d.ts +11 -0
  146. package/dist/monorepo.js +80 -0
  147. package/dist/nodeEnv.d.ts +3 -0
  148. package/dist/nodeEnv.js +49 -0
  149. package/dist/path.d.ts +3 -0
  150. package/dist/path.js +14 -0
  151. package/dist/{types/pkgUp.d.ts → pkgUp.d.ts} +1 -1
  152. package/dist/pkgUp.js +8 -0
  153. package/dist/prettyInstructions.d.ts +6 -0
  154. package/dist/prettyInstructions.js +64 -0
  155. package/dist/printBuildError.d.ts +8 -0
  156. package/dist/printBuildError.js +43 -0
  157. package/dist/readTsConfig.d.ts +2 -0
  158. package/dist/readTsConfig.js +19 -0
  159. package/dist/removeSlash.d.ts +3 -0
  160. package/dist/removeSlash.js +9 -0
  161. package/dist/runtimeExports.d.ts +4 -0
  162. package/dist/runtimeExports.js +53 -0
  163. package/dist/ssrHelpers.d.ts +4 -0
  164. package/dist/ssrHelpers.js +7 -0
  165. package/dist/storage.d.ts +5 -0
  166. package/dist/storage.js +61 -0
  167. package/dist/types/FileSizeReporter.d.ts +5 -5
  168. package/dist/types/alias.d.ts +12 -14
  169. package/dist/types/applyOptionsChain.d.ts +5 -5
  170. package/dist/types/clearConsole.d.ts +1 -1
  171. package/dist/types/compatRequire.d.ts +1 -1
  172. package/dist/types/compiled.d.ts +17 -0
  173. package/dist/types/constants.d.ts +165 -162
  174. package/dist/types/debug.d.ts +1 -3
  175. package/dist/types/emptyDir.d.ts +1 -1
  176. package/dist/types/ensureAbsolutePath.d.ts +1 -1
  177. package/dist/types/findExists.d.ts +1 -1
  178. package/dist/types/format.d.ts +5 -5
  179. package/dist/types/generateMetaTags.d.ts +3 -3
  180. package/dist/types/getBrowserslist.d.ts +1 -1
  181. package/dist/types/getCacheIdentifier.d.ts +3 -3
  182. package/dist/types/getEntryOptions.d.ts +1 -1
  183. package/dist/types/getPackageManager.d.ts +1 -1
  184. package/dist/types/getPort.d.ts +1 -1
  185. package/dist/types/getServerConfig.d.ts +1 -0
  186. package/dist/types/import.d.ts +2 -2
  187. package/dist/types/index.d.ts +3 -4
  188. package/dist/types/is/index.d.ts +1 -4
  189. package/dist/types/is/node-env.d.ts +1 -1
  190. package/dist/types/is/platform.d.ts +1 -1
  191. package/dist/types/is/type.d.ts +1 -1
  192. package/dist/types/logger.d.ts +49 -49
  193. package/dist/types/monorepo.d.ts +3 -3
  194. package/dist/types/nodeEnv.d.ts +1 -1
  195. package/dist/types/path.d.ts +1 -1
  196. package/dist/types/prettyInstructions.d.ts +2 -2
  197. package/dist/types/printBuildError.d.ts +1 -1
  198. package/dist/types/readTsConfig.d.ts +1 -1
  199. package/dist/types/removeSlash.d.ts +1 -1
  200. package/dist/types/runtimeExports.d.ts +3 -3
  201. package/dist/types/wait.d.ts +1 -1
  202. package/dist/types/watch.d.ts +4 -4
  203. package/dist/wait.d.ts +2 -0
  204. package/dist/wait.js +7 -0
  205. package/dist/watch.d.ts +8 -0
  206. package/dist/watch.js +64 -0
  207. package/jest.config.js +0 -1
  208. package/package.json +57 -40
  209. package/tests/debug.test.ts +2 -2
  210. package/tests/is.test.ts +27 -0
  211. package/tests/isPlatform.test.ts +19 -0
  212. package/tests/prettyInstructions.test.ts +1 -1
  213. package/tsconfig.json +3 -5
  214. package/dist/js/modern/FileSizeReporter.js +0 -156
  215. package/dist/js/modern/alias.js +0 -74
  216. package/dist/js/modern/applyOptionsChain.js +0 -27
  217. package/dist/js/modern/chalk.js +0 -2
  218. package/dist/js/modern/clearConsole.js +0 -5
  219. package/dist/js/modern/compatRequire.js +0 -26
  220. package/dist/js/modern/constants.js +0 -333
  221. package/dist/js/modern/emptyDir.js +0 -6
  222. package/dist/js/modern/findExists.js +0 -16
  223. package/dist/js/modern/format.js +0 -137
  224. package/dist/js/modern/generateMetaTags.js +0 -49
  225. package/dist/js/modern/getBrowserslist.js +0 -5
  226. package/dist/js/modern/getCacheIdentifier.js +0 -20
  227. package/dist/js/modern/getEntryOptions.js +0 -24
  228. package/dist/js/modern/getPackageManager.js +0 -37
  229. package/dist/js/modern/getPort.js +0 -52
  230. package/dist/js/modern/import.js +0 -11
  231. package/dist/js/modern/index.js +0 -34
  232. package/dist/js/modern/is/index.js +0 -77
  233. package/dist/js/modern/is/node-env.js +0 -5
  234. package/dist/js/modern/is/platform.js +0 -2
  235. package/dist/js/modern/is/type.js +0 -27
  236. package/dist/js/modern/logger.js +0 -152
  237. package/dist/js/modern/nodeEnv.js +0 -31
  238. package/dist/js/modern/path.js +0 -5
  239. package/dist/js/modern/pkgUp.js +0 -2
  240. package/dist/js/modern/prettyInstructions.js +0 -79
  241. package/dist/js/modern/printBuildError.js +0 -40
  242. package/dist/js/modern/readTsConfig.js +0 -13
  243. package/dist/js/modern/removeSlash.js +0 -3
  244. package/dist/js/modern/runtimeExports.js +0 -52
  245. package/dist/js/modern/wait.js +0 -5
  246. package/dist/js/modern/watch.js +0 -43
  247. package/dist/js/node/FileSizeReporter.js +0 -175
  248. package/dist/js/node/alias.js +0 -97
  249. package/dist/js/node/applyOptionsChain.js +0 -37
  250. package/dist/js/node/chalk.js +0 -15
  251. package/dist/js/node/clearConsole.js +0 -14
  252. package/dist/js/node/compatRequire.js +0 -41
  253. package/dist/js/node/constants.js +0 -353
  254. package/dist/js/node/debug.js +0 -19
  255. package/dist/js/node/emptyDir.js +0 -18
  256. package/dist/js/node/ensureAbsolutePath.js +0 -20
  257. package/dist/js/node/findExists.js +0 -27
  258. package/dist/js/node/format.js +0 -141
  259. package/dist/js/node/generateMetaTags.js +0 -58
  260. package/dist/js/node/getBrowserslist.js +0 -17
  261. package/dist/js/node/getCacheIdentifier.js +0 -27
  262. package/dist/js/node/getEntryOptions.js +0 -35
  263. package/dist/js/node/getPackageManager.js +0 -51
  264. package/dist/js/node/getPort.js +0 -67
  265. package/dist/js/node/import.js +0 -19
  266. package/dist/js/node/index.js +0 -465
  267. package/dist/js/node/is/index.js +0 -150
  268. package/dist/js/node/is/node-env.js +0 -23
  269. package/dist/js/node/is/platform.js +0 -14
  270. package/dist/js/node/is/type.js +0 -48
  271. package/dist/js/node/logger.js +0 -162
  272. package/dist/js/node/nodeEnv.js +0 -45
  273. package/dist/js/node/path.js +0 -24
  274. package/dist/js/node/pkgUp.js +0 -15
  275. package/dist/js/node/prettyInstructions.js +0 -95
  276. package/dist/js/node/printBuildError.js +0 -52
  277. package/dist/js/node/readTsConfig.js +0 -28
  278. package/dist/js/node/removeSlash.js +0 -18
  279. package/dist/js/node/runtimeExports.js +0 -68
  280. package/dist/js/node/wait.js +0 -12
  281. package/dist/js/node/watch.js +0 -61
  282. package/dist/js/treeshaking/FileSizeReporter.js +0 -185
  283. package/dist/js/treeshaking/alias.js +0 -72
  284. package/dist/js/treeshaking/applyOptionsChain.js +0 -31
  285. package/dist/js/treeshaking/chalk.js +0 -2
  286. package/dist/js/treeshaking/clearConsole.js +0 -5
  287. package/dist/js/treeshaking/compatRequire.js +0 -29
  288. package/dist/js/treeshaking/constants.js +0 -333
  289. package/dist/js/treeshaking/debug.js +0 -10
  290. package/dist/js/treeshaking/emptyDir.js +0 -37
  291. package/dist/js/treeshaking/ensureAbsolutePath.js +0 -11
  292. package/dist/js/treeshaking/findExists.js +0 -33
  293. package/dist/js/treeshaking/format.js +0 -167
  294. package/dist/js/treeshaking/generateMetaTags.js +0 -55
  295. package/dist/js/treeshaking/getBrowserslist.js +0 -7
  296. package/dist/js/treeshaking/getCacheIdentifier.js +0 -35
  297. package/dist/js/treeshaking/getEntryOptions.js +0 -26
  298. package/dist/js/treeshaking/getPackageManager.js +0 -101
  299. package/dist/js/treeshaking/getPort.js +0 -103
  300. package/dist/js/treeshaking/import.js +0 -11
  301. package/dist/js/treeshaking/index.js +0 -34
  302. package/dist/js/treeshaking/is/index.js +0 -81
  303. package/dist/js/treeshaking/is/node-env.js +0 -13
  304. package/dist/js/treeshaking/is/platform.js +0 -6
  305. package/dist/js/treeshaking/is/type.js +0 -29
  306. package/dist/js/treeshaking/logger.js +0 -188
  307. package/dist/js/treeshaking/nodeEnv.js +0 -108
  308. package/dist/js/treeshaking/path.js +0 -11
  309. package/dist/js/treeshaking/pkgUp.js +0 -2
  310. package/dist/js/treeshaking/prettyInstructions.js +0 -100
  311. package/dist/js/treeshaking/printBuildError.js +0 -40
  312. package/dist/js/treeshaking/readTsConfig.js +0 -13
  313. package/dist/js/treeshaking/removeSlash.js +0 -9
  314. package/dist/js/treeshaking/runtimeExports.js +0 -61
  315. package/dist/js/treeshaking/wait.js +0 -8
  316. package/dist/js/treeshaking/watch.js +0 -112
  317. package/dist/types/chalk.d.ts +0 -2
@@ -1,23 +1,21 @@
1
1
  declare type AliasOption = Record<string, string> | ((aliases: Record<string, string>) => Record<string, unknown>) | Record<string, string> | undefined;
2
2
  interface NormalizedConfig {
3
- source: {
4
- alias?: AliasOption | Array<AliasOption>;
5
- };
3
+ source: {
4
+ alias?: AliasOption | Array<AliasOption>;
5
+ };
6
6
  }
7
7
  interface IAliasConfig {
8
- absoluteBaseUrl: string;
9
- paths?: Record<string, string | string[]>;
10
- isTsPath?: boolean;
11
- isTsProject?: boolean;
8
+ absoluteBaseUrl: string;
9
+ paths?: Record<string, string | string[]>;
10
+ isTsPath?: boolean;
11
+ isTsProject?: boolean;
12
12
  }
13
- export declare const validAlias: <T extends NormalizedConfig>(modernConfig: T, {
14
- tsconfigPath
15
- }: {
16
- tsconfigPath: string;
13
+ export declare const validAlias: <T extends NormalizedConfig>(modernConfig: T, { tsconfigPath }: {
14
+ tsconfigPath: string;
17
15
  }) => string | null;
18
16
  export declare const getAlias: (aliasOption: AliasOption | Array<AliasOption>, option: {
19
- appDirectory: string;
20
- tsconfigPath: string;
17
+ appDirectory: string;
18
+ tsconfigPath: string;
21
19
  }) => IAliasConfig;
22
20
  export declare const getUserAlias: (alias?: Record<string, string | string[]>) => Record<string, string | string[]>;
23
- export {};
21
+ export {};
@@ -1,6 +1,6 @@
1
1
  export declare const applyOptionsChain: <T, U>(defaults: T, options?: T | (T | ((config: T, utils?: U | undefined) => void | T))[] | ((config: T, utils?: U | undefined) => void | T) | undefined, utils?: U | undefined, mergeFn?: {
2
- <T_1, U_1>(target: T_1, source: U_1): T_1 & U_1;
3
- <T_2, U_2, V>(target: T_2, source1: U_2, source2: V): T_2 & U_2 & V;
4
- <T_3, U_3, V_1, W>(target: T_3, source1: U_3, source2: V_1, source3: W): T_3 & U_3 & V_1 & W;
5
- (target: object, ...sources: any[]): any;
6
- }) => T;
2
+ <T_1, U_1>(target: T_1, source: U_1): T_1 & U_1;
3
+ <T_2, U_2, V>(target: T_2, source1: U_2, source2: V): T_2 & U_2 & V;
4
+ <T_3, U_3, V_1, W>(target: T_3, source1: U_3, source2: V_1, source3: W): T_3 & U_3 & V_1 & W;
5
+ (target: object, ...sources: any[]): any;
6
+ }) => T;
@@ -1 +1 @@
1
- export declare const clearConsole: () => void;
1
+ export declare const clearConsole: () => void;
@@ -5,4 +5,4 @@
5
5
  */
6
6
  export declare const compatRequire: (filePath: string) => any;
7
7
  export declare const requireExistModule: (filename: string, extensions?: string[]) => any;
8
- export declare const cleanRequireCache: (filelist: string[]) => void;
8
+ export declare const cleanRequireCache: (filelist: string[]) => void;
@@ -0,0 +1,17 @@
1
+ import fs from '../compiled/fs-extra';
2
+ import chalk from '../compiled/chalk';
3
+ export { fs, chalk };
4
+ export type { IOptions as GlobOptions } from '../compiled/glob';
5
+ export type { FSWatcher, WatchOptions } from '../compiled/chokidar';
6
+ export declare const glob: typeof import('../compiled/glob');
7
+ export declare const yaml: typeof import('../compiled/js-yaml');
8
+ export declare const execa: typeof import('../compiled/execa');
9
+ export declare const pkgUp: typeof import('../compiled/pkg-up');
10
+ export declare const upath: typeof import('../compiled/upath');
11
+ export declare const debug: typeof import('../compiled/debug');
12
+ export declare const chokidar: typeof import('../compiled/chokidar');
13
+ export declare const gzipSize: typeof import('../compiled/gzip-size');
14
+ export declare const filesize: typeof import('../compiled/filesize');
15
+ export declare const stripAnsi: typeof import('../compiled/strip-ansi');
16
+ export declare const browserslist: typeof import('../compiled/browserslist');
17
+ export declare const recursiveReaddir: typeof import('../compiled/recursive-readdir');
@@ -5,215 +5,218 @@ export declare const HMR_SOCK_PATH = "/_modern_js_hmr_ws";
5
5
  /**
6
6
  * route specification file
7
7
  */
8
-
9
8
  export declare const ROUTE_SPEC_FILE = "route.json";
10
9
  /**
11
10
  * main entry name
12
11
  */
13
-
14
12
  export declare const MAIN_ENTRY_NAME = "main";
15
13
  /**
16
14
  * open editor request path
17
15
  */
18
-
19
16
  export declare const LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
20
17
  /**
21
18
  * server side bundles directory, which relative to dist.
22
19
  */
23
-
24
20
  export declare const SERVER_BUNDLE_DIRECTORY = "bundles";
25
21
  /**
26
22
  * entry name pattern used for ajv pattern properties.
27
23
  */
28
-
29
24
  export declare const ENTRY_NAME_PATTERN = "^[a-zA-Z0-9_-]+$";
30
25
  /**
31
26
  * SSR server render function name
32
27
  */
33
-
34
28
  export declare const SERVER_RENDER_FUNCTION_NAME = "serverRender";
35
29
  /**
36
30
  * loadbale manifest json file
37
31
  */
38
-
39
32
  export declare const LOADABLE_STATS_FILE = "loadable-stats.json";
40
33
  /**
41
34
  * internal specified folder
42
35
  */
43
-
44
36
  export declare const API_DIR = "api";
45
37
  export declare const SERVER_DIR = "server";
46
38
  export declare const SHARED_DIR = "shared";
39
+ /**
40
+ * Modern.config.ts cached dir
41
+ */
42
+ export declare const CONFIG_CACHE_DIR = "./node_modules/.node-bundle-require";
43
+ export declare const CONFIG_FILE_EXTENSIONS: string[];
44
+ /**
45
+ * Serialized config path
46
+ */
47
+ export declare const OUTPUT_CONFIG_FILE = "modern.config.json";
48
+ /**
49
+ * Default server config basename
50
+ */
51
+ export declare const DEFAULT_SERVER_CONFIG = "modern.server.config";
47
52
  /**
48
53
  * Internal plugins that work as soon as they are installed.
49
54
  */
50
-
51
55
  export declare const INTERNAL_PLUGINS: {
52
- [name: string]: {
53
- cli?: string;
54
- server?: string;
55
- };
56
+ [name: string]: {
57
+ cli?: string;
58
+ server?: string;
59
+ };
56
60
  };
57
61
  /**
58
62
  * The schema registered in the plugin.
59
63
  */
60
-
61
64
  export declare const PLUGIN_SCHEMAS: {
62
- '@modern-js/runtime': ({
63
- target: string;
64
- schema: {
65
- type: string;
66
- additionalProperties: boolean;
67
- patternProperties?: undefined;
68
- };
69
- } | {
70
- target: string;
71
- schema: {
72
- type: string;
73
- patternProperties: {
74
- "^[a-zA-Z0-9_-]+$": {
75
- type: string;
76
- };
77
- };
78
- additionalProperties: boolean;
79
- };
80
- })[];
81
- '@modern-js/plugin-bff': {
82
- target: string;
83
- schema: {
84
- type: string;
85
- properties: {
86
- prefix: {
87
- type: string[];
88
- items: {
65
+ '@modern-js/runtime': ({
66
+ target: string;
67
+ schema: {
68
+ type: string;
69
+ additionalProperties: boolean;
70
+ patternProperties?: undefined;
71
+ };
72
+ } | {
73
+ target: string;
74
+ schema: {
89
75
  type: string;
90
- };
76
+ patternProperties: {
77
+ "^[a-zA-Z0-9_-]+$": {
78
+ type: string;
79
+ };
80
+ };
81
+ additionalProperties: boolean;
91
82
  };
92
- fetcher: {
93
- type: string;
83
+ })[];
84
+ '@modern-js/plugin-bff': {
85
+ target: string;
86
+ schema: {
87
+ type: string;
88
+ properties: {
89
+ prefix: {
90
+ type: string[];
91
+ items: {
92
+ type: string;
93
+ };
94
+ };
95
+ fetcher: {
96
+ type: string;
97
+ };
98
+ proxy: {
99
+ type: string;
100
+ };
101
+ requestCreator: {
102
+ type: string;
103
+ };
104
+ };
94
105
  };
95
- proxy: {
96
- type: string;
106
+ }[];
107
+ '@modern-js/plugin-esbuild': {
108
+ target: string;
109
+ schema: {
110
+ typeof: string[];
97
111
  };
98
- requestCreator: {
99
- type: string;
112
+ }[];
113
+ '@modern-js/plugin-less': {
114
+ target: string;
115
+ schema: {
116
+ typeof: string[];
100
117
  };
101
- };
102
- };
103
- }[];
104
- '@modern-js/plugin-esbuild': {
105
- target: string;
106
- schema: {
107
- typeof: string[];
108
- };
109
- }[];
110
- '@modern-js/plugin-less': {
111
- target: string;
112
- schema: {
113
- typeof: string[];
114
- };
115
- }[];
116
- '@modern-js/plugin-sass': {
117
- target: string;
118
- schema: {
119
- typeof: string[];
120
- };
121
- }[];
122
- '@modern-js/plugin-tailwindcss': {
123
- target: string;
124
- schema: {
125
- typeof: string[];
126
- };
127
- }[];
128
- '@modern-js/plugin-proxy': {
129
- target: string;
130
- schema: {
131
- typeof: string[];
132
- };
133
- }[];
134
- '@modern-js/plugin-unbundle': ({
135
- target: string;
136
- schema: {
137
- type: string;
138
- properties?: undefined;
139
- };
140
- } | {
141
- target: string;
142
- schema: {
143
- type: string;
144
- properties: {
145
- ignore: {
146
- type: string[];
147
- items: {
118
+ }[];
119
+ '@modern-js/plugin-sass': {
120
+ target: string;
121
+ schema: {
122
+ typeof: string[];
123
+ };
124
+ }[];
125
+ '@modern-js/plugin-tailwindcss': {
126
+ target: string;
127
+ schema: {
128
+ typeof: string[];
129
+ };
130
+ }[];
131
+ '@modern-js/plugin-proxy': {
132
+ target: string;
133
+ schema: {
134
+ typeof: string[];
135
+ };
136
+ }[];
137
+ '@modern-js/plugin-unbundle': ({
138
+ target: string;
139
+ schema: {
148
140
  type: string;
149
- };
141
+ properties?: undefined;
150
142
  };
151
- ignoreModuleCache: {
152
- type: string;
143
+ } | {
144
+ target: string;
145
+ schema: {
146
+ type: string;
147
+ properties: {
148
+ ignore: {
149
+ type: string[];
150
+ items: {
151
+ type: string;
152
+ };
153
+ };
154
+ ignoreModuleCache: {
155
+ type: string;
156
+ };
157
+ clearPdnCache: {
158
+ type: string;
159
+ };
160
+ pdnHost: {
161
+ type: string;
162
+ };
163
+ };
153
164
  };
154
- clearPdnCache: {
155
- type: string;
165
+ })[];
166
+ '@modern-js/plugin-ssg': {
167
+ target: string;
168
+ schema: {
169
+ oneOf: ({
170
+ type: string;
171
+ instanceof?: undefined;
172
+ } | {
173
+ instanceof: string;
174
+ type?: undefined;
175
+ })[];
156
176
  };
157
- pdnHost: {
158
- type: string;
177
+ }[];
178
+ '@modern-js/plugin-ssr': {
179
+ target: string;
180
+ schema: {
181
+ type: string[];
159
182
  };
160
- };
161
- };
162
- })[];
163
- '@modern-js/plugin-ssg': {
164
- target: string;
165
- schema: {
166
- oneOf: ({
167
- type: string;
168
- instanceof?: undefined;
169
- } | {
170
- instanceof: string;
171
- type?: undefined;
172
- })[];
173
- };
174
- }[];
175
- '@modern-js/plugin-ssr': {
176
- target: string;
177
- schema: {
178
- type: string[];
179
- };
180
- }[];
181
- '@modern-js/plugin-state': {
182
- target: string;
183
- schema: {
184
- type: string[];
185
- };
186
- }[];
187
- '@modern-js/plugin-design-token': ({
188
- target: string;
189
- schema: {
190
- typeof: string[];
191
- type?: undefined;
192
- };
193
- } | {
194
- target: string;
195
- schema: {
196
- type: string[];
197
- typeof?: undefined;
198
- };
199
- })[];
200
- '@modern-js/plugin-router': {
201
- target: string;
202
- schema: {
203
- type: string[];
204
- };
205
- }[];
206
- '@modern-js/plugin-testing': {
207
- target: string;
208
- schema: {
209
- typeof: string[];
210
- };
211
- }[];
212
- '@modern-js/plugin-garfish': {
213
- target: string;
214
- schema: {
215
- type: string[];
216
- };
217
- }[];
218
- '@modern-js/plugin-nocode': never[];
219
- };
183
+ }[];
184
+ '@modern-js/plugin-state': {
185
+ target: string;
186
+ schema: {
187
+ type: string[];
188
+ };
189
+ }[];
190
+ '@modern-js/plugin-design-token': ({
191
+ target: string;
192
+ schema: {
193
+ typeof: string[];
194
+ type?: undefined;
195
+ };
196
+ } | {
197
+ target: string;
198
+ schema: {
199
+ type: string[];
200
+ typeof?: undefined;
201
+ };
202
+ })[];
203
+ '@modern-js/plugin-router': {
204
+ target: string;
205
+ schema: {
206
+ type: string[];
207
+ };
208
+ }[];
209
+ '@modern-js/plugin-testing': {
210
+ target: string;
211
+ schema: {
212
+ typeof: string[];
213
+ };
214
+ }[];
215
+ '@modern-js/plugin-garfish': {
216
+ target: string;
217
+ schema: {
218
+ type: string[];
219
+ };
220
+ }[];
221
+ '@modern-js/plugin-nocode': never[];
222
+ };
@@ -1,8 +1,6 @@
1
- import debug from 'debug';
2
1
  /**
3
2
  * Create debug function with unified namespace prefix.
4
3
  * @param scope - Custom module name of your debug function.
5
4
  * @returns Debug function which namespace start with modern-js:.
6
5
  */
7
-
8
- export declare const createDebugger: (scope: string) => debug.Debugger;
6
+ export declare const createDebugger: (scope: string) => import("../compiled/debug").Debugger;
@@ -1 +1 @@
1
- export declare const emptyDir: (dir: string) => Promise<void>;
1
+ export declare const emptyDir: (dir: string) => Promise<void>;
@@ -4,4 +4,4 @@
4
4
  * @param filePath - Aboluste or relative file path.
5
5
  * @returns Resolved absolute file path.
6
6
  */
7
- export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
7
+ export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
@@ -3,4 +3,4 @@
3
3
  * @param files - Asbolute file paths with extension.
4
4
  * @returns The file path if exists, or false if no file exists.
5
5
  */
6
- export declare const findExists: (files: string[]) => string | false;
6
+ export declare const findExists: (files: string[]) => string | false;
@@ -6,11 +6,11 @@
6
6
  * https://github.com/facebook/create-react-app/blob/master/LICENSE
7
7
  */
8
8
  import { StatsCompilation } from 'webpack';
9
- import type { ProxyDetail, ProxyOptions } from '@modern-js/types';
9
+ import type { ProxyDetail, BffProxyOptions } from '@modern-js/types';
10
10
  declare function formatWebpackMessages(json: StatsCompilation): {
11
- errors: string[];
12
- warnings: string[];
11
+ errors: string[];
12
+ warnings: string[];
13
13
  };
14
14
  export { formatWebpackMessages };
15
- declare function formatProxyOptions(proxyOptions: ProxyOptions): ProxyDetail[];
16
- export { formatProxyOptions };
15
+ declare function formatProxyOptions(proxyOptions: BffProxyOptions): ProxyDetail[];
16
+ export { formatProxyOptions };
@@ -8,9 +8,9 @@
8
8
  * Modified from https://github.com/jantimon/html-webpack-plugin/blob/2f5de7ab9e8bca60e9e200f2e4b4cfab90db28d4/index.js#L800
9
9
  */
10
10
  export declare type MetaAttributes = {
11
- [attributeName: string]: string | boolean;
11
+ [attributeName: string]: string | boolean;
12
12
  };
13
13
  export interface MetaOptions {
14
- [name: string]: string | false | MetaAttributes;
14
+ [name: string]: string | false | MetaAttributes;
15
15
  }
16
- export declare const generateMetaTags: (metaOptions?: MetaOptions | undefined) => string;
16
+ export declare const generateMetaTags: (metaOptions?: MetaOptions | undefined) => string;
@@ -1,2 +1,2 @@
1
1
  export declare const defaults: string[];
2
- export declare const getBrowserslist: (appDirectory: string) => string[];
2
+ export declare const getBrowserslist: (appDirectory: string) => string[];
@@ -2,6 +2,6 @@
2
2
  * Generate cache identifier from some packages and config files.
3
3
  */
4
4
  export declare function getCacheIdentifier(packages: {
5
- name: string;
6
- version: string;
7
- }[], _files?: string[]): string;
5
+ name: string;
6
+ version: string;
7
+ }[], _files?: string[]): string;
@@ -1 +1 @@
1
- export declare const getEntryOptions: <T>(name: string, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string | undefined) => T | undefined;
1
+ export declare const getEntryOptions: <T>(name: string, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string | undefined) => T | undefined;
@@ -1 +1 @@
1
- export declare function getPackageManager(cwd?: string): Promise<"npm" | "yarn" | "pnpm">;
1
+ export declare function getPackageManager(cwd?: string): Promise<"npm" | "yarn" | "pnpm">;
@@ -4,4 +4,4 @@
4
4
  * @param tryLimits - Maximum number of retries.
5
5
  * @returns Available port number.
6
6
  */
7
- export declare const getPort: (port: string | number, tryLimits?: number) => Promise<number>;
7
+ export declare const getPort: (port: string | number, tryLimits?: number) => Promise<number>;
@@ -0,0 +1 @@
1
+ export declare const getServerConfig: (appDirectory: string, configFile: string) => Promise<string | false>;
@@ -1,5 +1,5 @@
1
1
  declare const lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
2
2
  export { lazy as lazyImport };
3
3
  export declare const Import: {
4
- lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
5
- };
4
+ lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
5
+ };
@@ -1,5 +1,4 @@
1
- export * as fs from 'fs-extra';
2
- export * from './chalk';
1
+ export * from './compiled';
3
2
  export * from './format';
4
3
  export * from './FileSizeReporter';
5
4
  export * from './printBuildError';
@@ -12,7 +11,6 @@ export * from './constants';
12
11
  export * from './ensureAbsolutePath';
13
12
  export * from './getCacheIdentifier';
14
13
  export * from './clearConsole';
15
- export * from './pkgUp';
16
14
  export * from './applyOptionsChain';
17
15
  export * from './getBrowserslist';
18
16
  export * from './removeSlash';
@@ -30,4 +28,5 @@ export * from './import';
30
28
  export * from './watch';
31
29
  export * from './nodeEnv';
32
30
  export * from './wait';
33
- export * from './emptyDir';
31
+ export * from './emptyDir';
32
+ export * from './getServerConfig';
@@ -12,7 +12,6 @@ export declare const isDepExists: (appDirectory: string, name: string) => boolea
12
12
  * @param root - App directory.
13
13
  * @returns Whether to use typescript.
14
14
  */
15
-
16
15
  export declare const isTypescript: (root: string) => boolean;
17
16
  /**
18
17
  * Is Empty object
@@ -20,7 +19,6 @@ export declare const isTypescript: (root: string) => boolean;
20
19
  * @param o - Any object.
21
20
  * @returns Whether it is empty object.
22
21
  */
23
-
24
22
  export declare const isEmpty: (o: Record<string, unknown>) => boolean;
25
23
  /**
26
24
  * Is SSR project
@@ -28,10 +26,9 @@ export declare const isEmpty: (o: Record<string, unknown>) => boolean;
28
26
  * @param config - User config.
29
27
  * @returns Whether to use server side render.
30
28
  */
31
-
32
29
  export declare const isSSR: (config: any) => boolean;
33
30
  export declare const isUseSSRBundle: (config: any) => boolean;
34
31
  export declare const isFastRefresh: () => boolean;
35
32
  export * from './node-env';
36
33
  export * from './platform';
37
- export * from './type';
34
+ export * from './type';
@@ -1,4 +1,4 @@
1
1
  export declare const isDev: () => boolean;
2
2
  export declare const isProd: () => boolean;
3
3
  export declare const isTest: () => boolean;
4
- export declare const isProdProfile: () => boolean;
4
+ export declare const isProdProfile: () => boolean;
@@ -1,2 +1,2 @@
1
1
  export declare const isNodeJS: () => boolean;
2
- export declare const isBrowser: () => boolean;
2
+ export declare const isBrowser: () => boolean;
@@ -5,4 +5,4 @@ export declare function isFunction(func: any): func is Function;
5
5
  export declare function isObject(obj: unknown): obj is Record<string, any>;
6
6
  export declare function isPlainObject(obj: unknown): obj is Record<string, any>;
7
7
  export declare function isPromise(obj: any): obj is Promise<any>;
8
- export declare function isRegExp(obj: any): obj is RegExp;
8
+ export declare function isRegExp(obj: any): obj is RegExp;