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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/compiled/address/index.js +1 -0
  3. package/compiled/address/lib/address.d.ts +28 -0
  4. package/compiled/address/package.json +1 -0
  5. package/compiled/browserslist/index.js +1 -1
  6. package/compiled/dotenv/index.js +1 -0
  7. package/compiled/dotenv/license +23 -0
  8. package/compiled/dotenv/package.json +1 -0
  9. package/compiled/dotenv/types/index.d.ts +59 -0
  10. package/compiled/dotenv-expand/index.d.ts +15 -0
  11. package/compiled/dotenv-expand/index.js +1 -0
  12. package/compiled/dotenv-expand/license +24 -0
  13. package/compiled/dotenv-expand/package.json +1 -0
  14. package/compiled/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  15. package/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +12 -0
  16. package/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  17. package/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  18. package/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  19. package/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  20. package/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +12 -0
  21. package/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  22. package/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +16 -0
  23. package/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  24. package/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +14 -0
  25. package/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  26. package/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  27. package/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  28. package/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +30 -0
  29. package/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  30. package/compiled/fast-glob/index.js +37 -0
  31. package/compiled/fast-glob/license +21 -0
  32. package/compiled/fast-glob/out/index.d.ts +27 -0
  33. package/compiled/fast-glob/out/managers/tasks.d.ts +22 -0
  34. package/compiled/fast-glob/out/settings.d.ts +164 -0
  35. package/compiled/fast-glob/out/types/index.d.ts +31 -0
  36. package/compiled/fast-glob/package.json +1 -0
  37. package/compiled/globby/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  38. package/compiled/globby/@nodelib/fs.scandir/out/index.d.ts +12 -0
  39. package/compiled/globby/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  40. package/compiled/globby/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  41. package/compiled/globby/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  42. package/compiled/globby/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  43. package/compiled/globby/@nodelib/fs.stat/out/index.d.ts +12 -0
  44. package/compiled/globby/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  45. package/compiled/globby/@nodelib/fs.stat/out/settings.d.ts +16 -0
  46. package/compiled/globby/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  47. package/compiled/globby/@nodelib/fs.walk/out/index.d.ts +14 -0
  48. package/compiled/globby/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  49. package/compiled/globby/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  50. package/compiled/globby/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  51. package/compiled/globby/@nodelib/fs.walk/out/settings.d.ts +30 -0
  52. package/compiled/globby/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  53. package/compiled/globby/fast-glob/index.d.ts +27 -0
  54. package/compiled/globby/fast-glob/managers/tasks.d.ts +22 -0
  55. package/compiled/globby/fast-glob/settings.d.ts +164 -0
  56. package/compiled/globby/fast-glob/types/index.d.ts +31 -0
  57. package/compiled/globby/index.d.ts +186 -0
  58. package/compiled/globby/index.js +1 -0
  59. package/compiled/globby/license +9 -0
  60. package/compiled/globby/package.json +1 -0
  61. package/compiled/inquirer/index.d.ts +997 -0
  62. package/compiled/inquirer/index.js +9 -0
  63. package/compiled/inquirer/lib/objects/choice.d.ts +65 -0
  64. package/compiled/inquirer/lib/objects/choices.d.ts +206 -0
  65. package/compiled/inquirer/lib/objects/separator.d.ts +37 -0
  66. package/compiled/inquirer/lib/ui/baseUI.d.ts +37 -0
  67. package/compiled/inquirer/lib/ui/bottom-bar.d.ts +65 -0
  68. package/compiled/inquirer/lib/ui/prompt.d.ts +104 -0
  69. package/compiled/inquirer/license +22 -0
  70. package/compiled/inquirer/package.json +1 -0
  71. package/compiled/inquirer/through/index.d.ts +25 -0
  72. package/compiled/json5/index.js +1 -0
  73. package/compiled/json5/lib/index.d.ts +4 -0
  74. package/compiled/json5/lib/parse.d.ts +15 -0
  75. package/compiled/json5/lib/stringify.d.ts +89 -0
  76. package/compiled/json5/package.json +1 -0
  77. package/compiled/mime-types/index.d.ts +14 -0
  78. package/compiled/mime-types/index.js +14 -0
  79. package/compiled/mime-types/license +23 -0
  80. package/compiled/mime-types/package.json +1 -0
  81. package/compiled/minimist/index.d.ts +95 -0
  82. package/compiled/minimist/index.js +1 -0
  83. package/compiled/minimist/license +18 -0
  84. package/compiled/minimist/package.json +1 -0
  85. package/compiled/ora/cli-spinners/index.d.ts +125 -0
  86. package/compiled/ora/index.d.ts +277 -0
  87. package/compiled/ora/index.js +3 -0
  88. package/compiled/ora/license +9 -0
  89. package/compiled/ora/package.json +1 -0
  90. package/compiled/slash/index.d.ts +25 -0
  91. package/compiled/slash/index.js +1 -0
  92. package/compiled/slash/license +9 -0
  93. package/compiled/slash/package.json +1 -0
  94. package/compiled/url-join/index.d.ts +17 -0
  95. package/compiled/url-join/index.js +1 -0
  96. package/compiled/url-join/license +21 -0
  97. package/compiled/url-join/package.json +1 -0
  98. package/dist/analyzeProject.d.ts +1 -0
  99. package/dist/analyzeProject.js +40 -0
  100. package/dist/compiled.d.ts +33 -17
  101. package/dist/compiled.js +57 -21
  102. package/dist/constants.d.ts +1 -1
  103. package/dist/constants.js +1 -1
  104. package/dist/index.d.ts +2 -2
  105. package/dist/index.js +2 -2
  106. package/dist/prettyInstructions.js +3 -3
  107. package/dist/{ssrHelpers.d.ts → ssr.d.ts} +3 -0
  108. package/dist/{ssrHelpers.js → ssr.js} +0 -0
  109. package/dist/storage.js +1 -1
  110. package/package.json +12 -30
  111. package/dist/getCacheIdentifier.d.ts +0 -7
  112. package/dist/getCacheIdentifier.js +0 -24
  113. package/dist/js/modern/monorepo.js +0 -83
  114. package/dist/js/node/monorepo.js +0 -116
  115. package/dist/js/treeshaking/monorepo.js +0 -96
  116. package/dist/pkgUp.d.ts +0 -2
  117. package/dist/pkgUp.js +0 -8
  118. package/dist/types/FileSizeReporter.d.ts +0 -16
  119. package/dist/types/alias.d.ts +0 -21
  120. package/dist/types/applyOptionsChain.d.ts +0 -6
  121. package/dist/types/clearConsole.d.ts +0 -1
  122. package/dist/types/compatRequire.d.ts +0 -8
  123. package/dist/types/compiled.d.ts +0 -17
  124. package/dist/types/constants.d.ts +0 -222
  125. package/dist/types/debug.d.ts +0 -6
  126. package/dist/types/emptyDir.d.ts +0 -1
  127. package/dist/types/ensureAbsolutePath.d.ts +0 -7
  128. package/dist/types/findExists.d.ts +0 -6
  129. package/dist/types/format.d.ts +0 -16
  130. package/dist/types/generateMetaTags.d.ts +0 -16
  131. package/dist/types/getBrowserslist.d.ts +0 -2
  132. package/dist/types/getCacheIdentifier.d.ts +0 -7
  133. package/dist/types/getEntryOptions.d.ts +0 -1
  134. package/dist/types/getPackageManager.d.ts +0 -1
  135. package/dist/types/getPort.d.ts +0 -7
  136. package/dist/types/getServerConfig.d.ts +0 -1
  137. package/dist/types/import.d.ts +0 -5
  138. package/dist/types/index.d.ts +0 -32
  139. package/dist/types/is/index.d.ts +0 -34
  140. package/dist/types/is/node-env.d.ts +0 -4
  141. package/dist/types/is/platform.d.ts +0 -2
  142. package/dist/types/is/type.d.ts +0 -8
  143. package/dist/types/logger.d.ts +0 -63
  144. package/dist/types/monorepo.d.ts +0 -11
  145. package/dist/types/nodeEnv.d.ts +0 -3
  146. package/dist/types/path.d.ts +0 -3
  147. package/dist/types/prettyInstructions.d.ts +0 -6
  148. package/dist/types/printBuildError.d.ts +0 -8
  149. package/dist/types/readTsConfig.d.ts +0 -2
  150. package/dist/types/removeSlash.d.ts +0 -3
  151. package/dist/types/runtimeExports.d.ts +0 -4
  152. package/dist/types/wait.d.ts +0 -2
  153. package/dist/types/watch.d.ts +0 -8
  154. package/modern.config.js +0 -6
  155. package/tests/.eslintrc.js +0 -6
  156. package/tests/__snapshots__/prettyInstructions.test.ts.snap +0 -19
  157. package/tests/applyOptionsChain.test.ts +0 -100
  158. package/tests/compatRequire.test.ts +0 -32
  159. package/tests/debug.test.ts +0 -25
  160. package/tests/ensureAbsolutePath.test.ts +0 -16
  161. package/tests/findExists.test.ts +0 -22
  162. package/tests/fixtures/browserlist/develop/package.json +0 -11
  163. package/tests/fixtures/browserlist/dotfile/.browserslistrc +0 -3
  164. package/tests/fixtures/browserlist/pkg/package.json +0 -7
  165. package/tests/fixtures/compat-require/cjs.js +0 -1
  166. package/tests/fixtures/compat-require/empty.js +0 -1
  167. package/tests/fixtures/compat-require/esm.js +0 -5
  168. package/tests/fixtures/compat-require/foo.js +0 -3
  169. package/tests/fixtures/file-exists/a.ejs +0 -0
  170. package/tests/fixtures/file-exists/a.js/.gitkeep +0 -0
  171. package/tests/fixtures/file-exists/a.mjs +0 -0
  172. package/tests/fixtures/file-exists/a.ts +0 -0
  173. package/tests/format.test.ts +0 -60
  174. package/tests/generateMetaTags.test.ts +0 -19
  175. package/tests/getBrowserslist.test.ts +0 -32
  176. package/tests/getCacheIdentifier.test.ts +0 -37
  177. package/tests/getEntryOptions.test.ts +0 -53
  178. package/tests/index.test.ts +0 -18
  179. package/tests/is.test.ts +0 -27
  180. package/tests/isPlatform.test.ts +0 -19
  181. package/tests/isType.test.ts +0 -85
  182. package/tests/logger.test.ts +0 -53
  183. package/tests/prettyInstructions.test.ts +0 -139
  184. package/tests/removeSlash.test.ts +0 -19
  185. package/tests/tsconfig.json +0 -11
  186. package/tests/wait.ts +0 -38
@@ -1,222 +0,0 @@
1
- /**
2
- * hmr socket connect path
3
- */
4
- export declare const HMR_SOCK_PATH = "/_modern_js_hmr_ws";
5
- /**
6
- * route specification file
7
- */
8
- export declare const ROUTE_SPEC_FILE = "route.json";
9
- /**
10
- * main entry name
11
- */
12
- export declare const MAIN_ENTRY_NAME = "main";
13
- /**
14
- * open editor request path
15
- */
16
- export declare const LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
17
- /**
18
- * server side bundles directory, which relative to dist.
19
- */
20
- export declare const SERVER_BUNDLE_DIRECTORY = "bundles";
21
- /**
22
- * entry name pattern used for ajv pattern properties.
23
- */
24
- export declare const ENTRY_NAME_PATTERN = "^[a-zA-Z0-9_-]+$";
25
- /**
26
- * SSR server render function name
27
- */
28
- export declare const SERVER_RENDER_FUNCTION_NAME = "serverRender";
29
- /**
30
- * loadbale manifest json file
31
- */
32
- export declare const LOADABLE_STATS_FILE = "loadable-stats.json";
33
- /**
34
- * internal specified folder
35
- */
36
- export declare const API_DIR = "api";
37
- export declare const SERVER_DIR = "server";
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";
52
- /**
53
- * Internal plugins that work as soon as they are installed.
54
- */
55
- export declare const INTERNAL_PLUGINS: {
56
- [name: string]: {
57
- cli?: string;
58
- server?: string;
59
- };
60
- };
61
- /**
62
- * The schema registered in the plugin.
63
- */
64
- export declare const PLUGIN_SCHEMAS: {
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: {
75
- type: string;
76
- patternProperties: {
77
- "^[a-zA-Z0-9_-]+$": {
78
- type: string;
79
- };
80
- };
81
- additionalProperties: boolean;
82
- };
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
- };
105
- };
106
- }[];
107
- '@modern-js/plugin-esbuild': {
108
- target: string;
109
- schema: {
110
- typeof: string[];
111
- };
112
- }[];
113
- '@modern-js/plugin-less': {
114
- target: string;
115
- schema: {
116
- typeof: string[];
117
- };
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: {
140
- type: string;
141
- properties?: undefined;
142
- };
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
- };
164
- };
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
- })[];
176
- };
177
- }[];
178
- '@modern-js/plugin-ssr': {
179
- target: string;
180
- schema: {
181
- type: string[];
182
- };
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,6 +0,0 @@
1
- /**
2
- * Create debug function with unified namespace prefix.
3
- * @param scope - Custom module name of your debug function.
4
- * @returns Debug function which namespace start with modern-js:.
5
- */
6
- export declare const createDebugger: (scope: string) => import("../compiled/debug").Debugger;
@@ -1 +0,0 @@
1
- export declare const emptyDir: (dir: string) => Promise<void>;
@@ -1,7 +0,0 @@
1
- /**
2
- * ensure absolute file path.
3
- * @param base - Base path to resolve relative from.
4
- * @param filePath - Aboluste or relative file path.
5
- * @returns Resolved absolute file path.
6
- */
7
- export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
@@ -1,6 +0,0 @@
1
- /**
2
- * Find first already exists file.
3
- * @param files - Asbolute file paths with extension.
4
- * @returns The file path if exists, or false if no file exists.
5
- */
6
- export declare const findExists: (files: string[]) => string | false;
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file at
6
- * https://github.com/facebook/create-react-app/blob/master/LICENSE
7
- */
8
- import { StatsCompilation } from 'webpack';
9
- import type { ProxyDetail, BffProxyOptions } from '@modern-js/types';
10
- declare function formatWebpackMessages(json: StatsCompilation): {
11
- errors: string[];
12
- warnings: string[];
13
- };
14
- export { formatWebpackMessages };
15
- declare function formatProxyOptions(proxyOptions: BffProxyOptions): ProxyDetail[];
16
- export { formatProxyOptions };
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright JS Foundation and other contributors.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file at
6
- * https://github.com/jantimon/html-webpack-plugin/blob/main/LICENSE
7
- *
8
- * Modified from https://github.com/jantimon/html-webpack-plugin/blob/2f5de7ab9e8bca60e9e200f2e4b4cfab90db28d4/index.js#L800
9
- */
10
- export declare type MetaAttributes = {
11
- [attributeName: string]: string | boolean;
12
- };
13
- export interface MetaOptions {
14
- [name: string]: string | false | MetaAttributes;
15
- }
16
- export declare const generateMetaTags: (metaOptions?: MetaOptions | undefined) => string;
@@ -1,2 +0,0 @@
1
- export declare const defaults: string[];
2
- export declare const getBrowserslist: (appDirectory: string) => string[];
@@ -1,7 +0,0 @@
1
- /**
2
- * Generate cache identifier from some packages and config files.
3
- */
4
- export declare function getCacheIdentifier(packages: {
5
- name: string;
6
- version: string;
7
- }[], _files?: string[]): string;
@@ -1 +0,0 @@
1
- export declare const getEntryOptions: <T>(name: string, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string | undefined) => T | undefined;
@@ -1 +0,0 @@
1
- export declare function getPackageManager(cwd?: string): Promise<"npm" | "yarn" | "pnpm">;
@@ -1,7 +0,0 @@
1
- /**
2
- * Get available free port.
3
- * @param port - Current port want to use.
4
- * @param tryLimits - Maximum number of retries.
5
- * @returns Available port number.
6
- */
7
- export declare const getPort: (port: string | number, tryLimits?: number) => Promise<number>;
@@ -1 +0,0 @@
1
- export declare const getServerConfig: (appDirectory: string, configFile: string) => Promise<string | false>;
@@ -1,5 +0,0 @@
1
- declare const lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
2
- export { lazy as lazyImport };
3
- export declare const Import: {
4
- lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
5
- };
@@ -1,32 +0,0 @@
1
- export * from './compiled';
2
- export * from './format';
3
- export * from './FileSizeReporter';
4
- export * from './printBuildError';
5
- export * from './debug';
6
- export * from './findExists';
7
- export * from './is';
8
- export * from './compatRequire';
9
- export * from './logger';
10
- export * from './constants';
11
- export * from './ensureAbsolutePath';
12
- export * from './getCacheIdentifier';
13
- export * from './clearConsole';
14
- export * from './applyOptionsChain';
15
- export * from './getBrowserslist';
16
- export * from './removeSlash';
17
- export * from './getEntryOptions';
18
- export * from './getPort';
19
- export * from './monorepo';
20
- export * from './getPackageManager';
21
- export * from './runtimeExports';
22
- export * from './readTsConfig';
23
- export * from './path';
24
- export * from './generateMetaTags';
25
- export * from './prettyInstructions';
26
- export * from './alias';
27
- export * from './import';
28
- export * from './watch';
29
- export * from './nodeEnv';
30
- export * from './wait';
31
- export * from './emptyDir';
32
- export * from './getServerConfig';
@@ -1,34 +0,0 @@
1
- /**
2
- * Check if the package name is in dependencies or devDependencies.
3
- *
4
- * @param appDirectory - Project root directory.
5
- * @param name - Package name.
6
- * @returns True if the name is in dependencies or devDependencies, false otherwise.
7
- */
8
- export declare const isDepExists: (appDirectory: string, name: string) => boolean;
9
- /**
10
- * Is typescript project.
11
- *
12
- * @param root - App directory.
13
- * @returns Whether to use typescript.
14
- */
15
- export declare const isTypescript: (root: string) => boolean;
16
- /**
17
- * Is Empty object
18
- *
19
- * @param o - Any object.
20
- * @returns Whether it is empty object.
21
- */
22
- export declare const isEmpty: (o: Record<string, unknown>) => boolean;
23
- /**
24
- * Is SSR project
25
- *
26
- * @param config - User config.
27
- * @returns Whether to use server side render.
28
- */
29
- export declare const isSSR: (config: any) => boolean;
30
- export declare const isUseSSRBundle: (config: any) => boolean;
31
- export declare const isFastRefresh: () => boolean;
32
- export * from './node-env';
33
- export * from './platform';
34
- export * from './type';
@@ -1,4 +0,0 @@
1
- export declare const isDev: () => boolean;
2
- export declare const isProd: () => boolean;
3
- export declare const isTest: () => boolean;
4
- export declare const isProdProfile: () => boolean;
@@ -1,2 +0,0 @@
1
- export declare const isNodeJS: () => boolean;
2
- export declare const isBrowser: () => boolean;
@@ -1,8 +0,0 @@
1
- export declare function isString(str: any): str is string;
2
- export declare function isUndefined(obj: any): obj is undefined;
3
- export declare function isArray(obj: unknown): obj is any[];
4
- export declare function isFunction(func: any): func is Function;
5
- export declare function isObject(obj: unknown): obj is Record<string, any>;
6
- export declare function isPlainObject(obj: unknown): obj is Record<string, any>;
7
- export declare function isPromise(obj: any): obj is Promise<any>;
8
- export declare function isRegExp(obj: any): obj is RegExp;
@@ -1,63 +0,0 @@
1
- import { Color } from '../compiled/chalk';
2
- declare type LogLevel = 'debug' | 'info' | 'warn' | 'error';
3
- interface LoggerConfiguration {
4
- color?: typeof Color;
5
- label?: string;
6
- level?: LogLevel;
7
- }
8
- interface InstanceConfiguration {
9
- displayLabel?: boolean;
10
- underlineLabel?: boolean;
11
- uppercaseLabel?: boolean;
12
- }
13
- interface ConstructorOptions {
14
- config?: InstanceConfiguration;
15
- types?: Record<string, LoggerConfiguration>;
16
- }
17
- declare type LoggerFunction = (message?: number | string | Error, ...args: any[]) => void;
18
- declare const LOG_TYPES: {
19
- error: {
20
- color: string;
21
- label: string;
22
- level: string;
23
- };
24
- info: {
25
- color: string;
26
- label: string;
27
- level: string;
28
- };
29
- warn: {
30
- color: string;
31
- label: string;
32
- level: string;
33
- };
34
- debug: {
35
- color: string;
36
- label: string;
37
- level: string;
38
- };
39
- log: {
40
- level: string;
41
- };
42
- };
43
- declare class Logger {
44
- private readonly logCount;
45
- private history;
46
- private readonly config;
47
- private readonly types;
48
- private readonly longestLabel;
49
- [key: string]: any;
50
- constructor(options?: ConstructorOptions);
51
- private retainLog;
52
- private _log;
53
- private getLongestLabel;
54
- private get longestUnderlinedLabel();
55
- getRetainedLogs(type: string): string[];
56
- clearRetainedLogs(type: string): void;
57
- }
58
- declare type LoggerInterface = {
59
- [key in keyof typeof LOG_TYPES]: LoggerFunction;
60
- };
61
- declare const logger: Logger & LoggerInterface;
62
- export { logger };
63
- export type { LoggerInterface };
@@ -1,11 +0,0 @@
1
- import path from 'path';
2
- export declare const isLerna: (root: string) => boolean;
3
- export declare const isYarnWorkspaces: (root: string) => boolean;
4
- export declare const isPnpmWorkspaces: (root: string) => boolean;
5
- export declare const isMonorepo: (root: string) => boolean;
6
- export declare const isModernjsMonorepo: (root: string) => boolean;
7
- export declare const findMonorepoRoot: (appDirectory: string, maxDepth?: number) => string | undefined;
8
- export declare const getMonorepoPackages: (root: string) => {
9
- name: string;
10
- path: string;
11
- }[];
@@ -1,3 +0,0 @@
1
- export declare function canUseNpm(): Promise<boolean>;
2
- export declare function canUseYarn(): Promise<boolean>;
3
- export declare function canUsePnpm(): Promise<boolean>;
@@ -1,3 +0,0 @@
1
- export declare const isRelativePath: (test: string) => boolean;
2
- export declare const normalizeOutputPath: (s: string) => string;
3
- export declare const normalizeToPosixPath: (p: string) => string;
@@ -1,6 +0,0 @@
1
- interface EntryPoint {
2
- entryName: string;
3
- }
4
- export declare const isSingleEntry: (entrypoints: EntryPoint[]) => boolean;
5
- export declare const prettyInstructions: (appContext: any, config: any) => string;
6
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file at
6
- * https://github.com/facebook/create-react-app/blob/master/LICENSE
7
- */
8
- export declare function printBuildError(err: Error): void;
@@ -1,2 +0,0 @@
1
- export declare const readTsConfig: (root: string) => any;
2
- export declare const readTsConfigByFile: (filename: string) => any;
@@ -1,3 +0,0 @@
1
- export declare const removeLeadingSlash: (s: string) => string;
2
- export declare const removeTailSlash: (s: string) => string;
3
- export declare const removeSlash: (s: string) => string;
@@ -1,4 +0,0 @@
1
- export declare const createRuntimeExportsUtils: (pwd: any, namespace: string, ts?: any) => {
2
- addExport: (statement: string) => void;
3
- getPath: () => string;
4
- };
@@ -1,2 +0,0 @@
1
- declare const wait: (time?: number) => Promise<unknown>;
2
- export { wait };
@@ -1,8 +0,0 @@
1
- export declare type WatchChangeTypeValueT = 'add' | 'unlink' | 'change';
2
- export declare const WatchChangeType: Record<'ADD' | 'UNLINK' | 'CHANGE', WatchChangeTypeValueT>;
3
- declare type RunTaskType = (option: {
4
- changedFilePath: string;
5
- changeType: WatchChangeTypeValueT;
6
- }) => void | Promise<void>;
7
- export declare const watch: (watchDir: string | string[], runTask: RunTaskType, ignored?: string[]) => import("./compiled").FSWatcher;
8
- export {};
package/modern.config.js DELETED
@@ -1,6 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {
3
- output: {
4
- disableSourceMap: true,
5
- },
6
- };
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- extends: ['@modern-js'],
3
- parserOptions: {
4
- project: require.resolve('./tsconfig.json'),
5
- },
6
- };
@@ -1,19 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`prettyInstructions The src directory does not exist 1`] = `
4
- "App running at:
5
-
6
- > Network: http://127.0.0.1:8080/api
7
- > Network: http://11.11.111.11:8080/api
8
- > Network: http://10.100.100.100:8080/api
9
- "
10
- `;
11
-
12
- exports[`prettyInstructions basic usage 1`] = `
13
- "App running at:
14
-
15
- > Network: http://127.0.0.1:8080/
16
- > Network: http://11.11.111.11:8080/
17
- > Network: http://10.100.100.100:8080/
18
- "
19
- `;