@modern-js/utils 2.4.1-beta.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -1
- package/dist/FileSizeReporter.d.ts +5 -5
- package/dist/FileSizeReporter.js +143 -136
- package/dist/alias.d.ts +14 -12
- package/dist/alias.js +94 -54
- package/dist/analyzeProject.d.ts +1 -1
- package/dist/analyzeProject.js +58 -33
- package/dist/applyOptionsChain.d.ts +1 -1
- package/dist/applyOptionsChain.js +55 -27
- package/dist/chainId.d.ts +256 -184
- package/dist/chainId.js +132 -187
- package/dist/clearConsole.d.ts +1 -1
- package/dist/clearConsole.js +29 -7
- package/dist/commands.d.ts +1 -1
- package/dist/commands.js +33 -10
- package/dist/compatRequire.d.ts +3 -3
- package/dist/compatRequire.js +74 -38
- package/dist/compiled.d.ts +2 -1
- package/dist/compiled.js +137 -72
- package/dist/constants.d.ts +127 -105
- package/dist/constants.js +298 -281
- package/dist/debug.d.ts +1 -1
- package/dist/debug.js +28 -11
- package/dist/emptyDir.d.ts +1 -1
- package/dist/emptyDir.js +51 -9
- package/dist/ensureAbsolutePath.d.ts +1 -1
- package/dist/ensureAbsolutePath.js +33 -14
- package/dist/ensureArray.d.ts +1 -1
- package/dist/ensureArray.js +30 -8
- package/dist/findExists.d.ts +1 -1
- package/dist/findExists.js +37 -17
- package/dist/format.d.ts +3 -3
- package/dist/format.js +93 -81
- package/dist/generateMetaTags.d.ts +3 -3
- package/dist/generateMetaTags.js +56 -43
- package/dist/getBrowserslist.d.ts +1 -1
- package/dist/getBrowserslist.js +31 -7
- package/dist/getCoreJsVersion.d.ts +1 -1
- package/dist/getCoreJsVersion.js +39 -35
- package/dist/getEntryOptions.d.ts +1 -1
- package/dist/getEntryOptions.js +51 -24
- package/dist/getPackageManager.d.ts +1 -1
- package/dist/getPackageManager.js +75 -28
- package/dist/getPort.d.ts +7 -4
- package/dist/getPort.js +104 -58
- package/dist/getServerConfig.d.ts +1 -1
- package/dist/getServerConfig.js +61 -32
- package/dist/import.d.ts +2 -2
- package/dist/import.js +31 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +59 -59
- package/dist/is/index.d.ts +5 -1
- package/dist/is/index.js +81 -94
- package/dist/is/node-env.d.ts +1 -1
- package/dist/is/node-env.js +39 -17
- package/dist/is/platform.d.ts +1 -1
- package/dist/is/platform.js +30 -10
- package/dist/is/type.d.ts +1 -1
- package/dist/is/type.js +48 -22
- package/dist/logger.d.ts +48 -48
- package/dist/logger.js +127 -95
- package/dist/monorepo.d.ts +3 -3
- package/dist/monorepo.js +117 -74
- package/dist/nodeEnv.d.ts +1 -1
- package/dist/nodeEnv.js +72 -25
- package/dist/path.d.ts +3 -1
- package/dist/path.js +76 -59
- package/dist/pathSerializer.d.ts +6 -6
- package/dist/pathSerializer.js +65 -43
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +45 -26
- package/dist/prettyInstructions.d.ts +4 -4
- package/dist/prettyInstructions.js +107 -65
- package/dist/printBuildError.d.ts +1 -1
- package/dist/printBuildError.js +54 -40
- package/dist/react.d.ts +1 -1
- package/dist/react.js +57 -21
- package/dist/readTsConfig.d.ts +1 -1
- package/dist/readTsConfig.js +38 -12
- package/dist/removeSlash.d.ts +1 -1
- package/dist/removeSlash.js +33 -9
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +49 -22
- package/dist/runtimeExports.d.ts +3 -3
- package/dist/runtimeExports.js +59 -39
- package/dist/ssr.d.ts +2 -1
- package/dist/ssr.js +30 -7
- package/dist/storage.d.ts +3 -3
- package/dist/storage.js +65 -59
- package/dist/test-utils.d.ts +1 -1
- package/dist/test-utils.js +30 -24
- package/dist/tryResolve.d.ts +2 -1
- package/dist/tryResolve.js +45 -33
- package/dist/types.d.ts +1 -1
- package/dist/types.js +15 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +83 -24
- package/dist/wait.d.ts +1 -1
- package/dist/wait.js +28 -6
- package/dist/watch.d.ts +3 -3
- package/dist/watch.js +82 -55
- package/package.json +7 -8
package/dist/constants.js
CHANGED
@@ -1,289 +1,306 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
/**
|
9
|
-
* route specification file
|
10
|
-
*/
|
11
|
-
exports.ROUTE_SPEC_FILE = 'route.json';
|
12
|
-
/**
|
13
|
-
* main entry name
|
14
|
-
*/
|
15
|
-
exports.MAIN_ENTRY_NAME = 'main';
|
16
|
-
/**
|
17
|
-
* open editor request path
|
18
|
-
*/
|
19
|
-
exports.LAUNCH_EDITOR_ENDPOINT = '/__open-stack-frame-in-editor';
|
20
|
-
/**
|
21
|
-
* server side bundles directory, which relative to dist.
|
22
|
-
*/
|
23
|
-
exports.SERVER_BUNDLE_DIRECTORY = 'bundles';
|
24
|
-
/**
|
25
|
-
* server side bundles directory, which relative to dist.
|
26
|
-
*/
|
27
|
-
exports.SERVER_WORKER_BUNDLE_DIRECTORY = 'worker';
|
28
|
-
/**
|
29
|
-
* entry name pattern used for ajv pattern properties.
|
30
|
-
*/
|
31
|
-
exports.ENTRY_NAME_PATTERN = '^[a-zA-Z0-9_-]+$';
|
32
|
-
/**
|
33
|
-
* SSR server render function name
|
34
|
-
*/
|
35
|
-
exports.SERVER_RENDER_FUNCTION_NAME = 'serverRender';
|
36
|
-
/**
|
37
|
-
* loadbale manifest json file
|
38
|
-
*/
|
39
|
-
exports.LOADABLE_STATS_FILE = 'loadable-stats.json';
|
40
|
-
/**
|
41
|
-
* internal specified folder
|
42
|
-
*/
|
43
|
-
exports.API_DIR = 'api';
|
44
|
-
exports.SERVER_DIR = 'server';
|
45
|
-
exports.SHARED_DIR = 'shared';
|
46
|
-
/**
|
47
|
-
* Modern.config.ts cached dir
|
48
|
-
*/
|
49
|
-
exports.CONFIG_CACHE_DIR = './node_modules/.cache/node-bundle-require';
|
50
|
-
exports.CONFIG_FILE_EXTENSIONS = ['.js', '.ts', '.mjs'];
|
51
|
-
/**
|
52
|
-
* Serialized config path
|
53
|
-
*/
|
54
|
-
exports.OUTPUT_CONFIG_FILE = 'modern.config.json';
|
55
|
-
/**
|
56
|
-
* Default server config basename
|
57
|
-
*/
|
58
|
-
exports.DEFAULT_SERVER_CONFIG = 'modern.server-runtime.config';
|
59
|
-
/**
|
60
|
-
* Routes manifest filename
|
61
|
-
*/
|
62
|
-
exports.ROUTE_MINIFEST_FILE = 'routes-manifest.json';
|
63
|
-
/**
|
64
|
-
* Property mounted on window that describes route manifest
|
65
|
-
*/
|
66
|
-
exports.ROUTE_MANIFEST = `_MODERNJS_ROUTE_MANIFEST`;
|
67
|
-
/**
|
68
|
-
* directory name for loader routes
|
69
|
-
*/
|
70
|
-
exports.LOADER_ROUTES_DIR = `loader-routes`;
|
71
|
-
/**
|
72
|
-
* Internal app-tools plugins that work as soon as they are installed.
|
73
|
-
*/
|
74
|
-
exports.INTERNAL_APP_TOOLS_PLUGINS = {
|
75
|
-
'@modern-js/app-tools': '@modern-js/app-tools/cli',
|
76
|
-
'@modern-js/plugin-proxy': '@modern-js/plugin-proxy/cli',
|
77
|
-
'@modern-js/plugin-ssg': '@modern-js/plugin-ssg/cli',
|
78
|
-
'@modern-js/plugin-bff': '@modern-js/plugin-bff/cli',
|
79
|
-
'@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
|
80
|
-
'@modern-js/plugin-storybook': '@modern-js/plugin-storybook/cli',
|
81
|
-
'@modern-js/plugin-express': '@modern-js/plugin-express/cli',
|
82
|
-
'@modern-js/plugin-egg': '@modern-js/plugin-egg/cli',
|
83
|
-
'@modern-js/plugin-koa': '@modern-js/plugin-koa/cli',
|
84
|
-
'@modern-js/plugin-nest': '@modern-js/plugin-nest/cli',
|
85
|
-
'@modern-js/plugin-server': '@modern-js/plugin-server/cli',
|
86
|
-
'@modern-js/plugin-garfish': '@modern-js/plugin-garfish/cli',
|
87
|
-
'@modern-js/plugin-tailwindcss': '@modern-js/plugin-tailwindcss/cli',
|
88
|
-
'@modern-js/plugin-polyfill': '@modern-js/plugin-polyfill/cli',
|
89
|
-
// legacy router (inner react-router-dom v5)
|
90
|
-
'@modern-js/plugin-router-v5': '@modern-js/plugin-router-v5/cli',
|
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 });
|
91
8
|
};
|
92
|
-
|
93
|
-
|
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;
|
94
16
|
};
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
var constants_exports = {};
|
19
|
+
__export(constants_exports, {
|
20
|
+
API_DIR: () => API_DIR,
|
21
|
+
CONFIG_CACHE_DIR: () => CONFIG_CACHE_DIR,
|
22
|
+
CONFIG_FILE_EXTENSIONS: () => CONFIG_FILE_EXTENSIONS,
|
23
|
+
DEFAULT_SERVER_CONFIG: () => DEFAULT_SERVER_CONFIG,
|
24
|
+
ENTRY_NAME_PATTERN: () => ENTRY_NAME_PATTERN,
|
25
|
+
HMR_SOCK_PATH: () => HMR_SOCK_PATH,
|
26
|
+
INTERNAL_APP_TOOLS_PLUGINS: () => INTERNAL_APP_TOOLS_PLUGINS,
|
27
|
+
INTERNAL_APP_TOOLS_RUNTIME_PLUGINS: () => INTERNAL_APP_TOOLS_RUNTIME_PLUGINS,
|
28
|
+
INTERNAL_CLI_PLUGINS: () => INTERNAL_CLI_PLUGINS,
|
29
|
+
INTERNAL_DOC_TOOLS_PLUGINS: () => INTERNAL_DOC_TOOLS_PLUGINS,
|
30
|
+
INTERNAL_MODULE_TOOLS_PLUGINS: () => INTERNAL_MODULE_TOOLS_PLUGINS,
|
31
|
+
INTERNAL_MONOREPO_TOOLS_PLUGINS: () => INTERNAL_MONOREPO_TOOLS_PLUGINS,
|
32
|
+
INTERNAL_SERVER_PLUGINS: () => INTERNAL_SERVER_PLUGINS,
|
33
|
+
LAUNCH_EDITOR_ENDPOINT: () => LAUNCH_EDITOR_ENDPOINT,
|
34
|
+
LOADABLE_STATS_FILE: () => LOADABLE_STATS_FILE,
|
35
|
+
LOADER_ROUTES_DIR: () => LOADER_ROUTES_DIR,
|
36
|
+
MAIN_ENTRY_NAME: () => MAIN_ENTRY_NAME,
|
37
|
+
OUTPUT_CONFIG_FILE: () => OUTPUT_CONFIG_FILE,
|
38
|
+
PLUGIN_SCHEMAS: () => PLUGIN_SCHEMAS,
|
39
|
+
ROUTE_MANIFEST: () => ROUTE_MANIFEST,
|
40
|
+
ROUTE_MINIFEST_FILE: () => ROUTE_MINIFEST_FILE,
|
41
|
+
ROUTE_SPEC_FILE: () => ROUTE_SPEC_FILE,
|
42
|
+
SERVER_BUNDLE_DIRECTORY: () => SERVER_BUNDLE_DIRECTORY,
|
43
|
+
SERVER_DIR: () => SERVER_DIR,
|
44
|
+
SERVER_PLUGIN_BFF: () => SERVER_PLUGIN_BFF,
|
45
|
+
SERVER_PLUGIN_EGG: () => SERVER_PLUGIN_EGG,
|
46
|
+
SERVER_PLUGIN_EXPRESS: () => SERVER_PLUGIN_EXPRESS,
|
47
|
+
SERVER_PLUGIN_KOA: () => SERVER_PLUGIN_KOA,
|
48
|
+
SERVER_PLUGIN_NEST: () => SERVER_PLUGIN_NEST,
|
49
|
+
SERVER_PLUGIN_POLYFILL: () => SERVER_PLUGIN_POLYFILL,
|
50
|
+
SERVER_PLUGIN_SERVER: () => SERVER_PLUGIN_SERVER,
|
51
|
+
SERVER_RENDER_FUNCTION_NAME: () => SERVER_RENDER_FUNCTION_NAME,
|
52
|
+
SERVER_WORKER_BUNDLE_DIRECTORY: () => SERVER_WORKER_BUNDLE_DIRECTORY,
|
53
|
+
SHARED_DIR: () => SHARED_DIR
|
54
|
+
});
|
55
|
+
module.exports = __toCommonJS(constants_exports);
|
56
|
+
const HMR_SOCK_PATH = "/webpack-hmr";
|
57
|
+
const ROUTE_SPEC_FILE = "route.json";
|
58
|
+
const MAIN_ENTRY_NAME = "main";
|
59
|
+
const LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
|
60
|
+
const SERVER_BUNDLE_DIRECTORY = "bundles";
|
61
|
+
const SERVER_WORKER_BUNDLE_DIRECTORY = "worker";
|
62
|
+
const ENTRY_NAME_PATTERN = "^[a-zA-Z0-9_-]+$";
|
63
|
+
const SERVER_RENDER_FUNCTION_NAME = "serverRender";
|
64
|
+
const LOADABLE_STATS_FILE = "loadable-stats.json";
|
65
|
+
const API_DIR = "api";
|
66
|
+
const SERVER_DIR = "server";
|
67
|
+
const SHARED_DIR = "shared";
|
68
|
+
const CONFIG_CACHE_DIR = "./node_modules/.cache/node-bundle-require";
|
69
|
+
const CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
|
70
|
+
const OUTPUT_CONFIG_FILE = "modern.config.json";
|
71
|
+
const DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
72
|
+
const ROUTE_MINIFEST_FILE = "routes-manifest.json";
|
73
|
+
const ROUTE_MANIFEST = `_MODERNJS_ROUTE_MANIFEST`;
|
74
|
+
const LOADER_ROUTES_DIR = `loader-routes`;
|
75
|
+
const INTERNAL_APP_TOOLS_PLUGINS = {
|
76
|
+
"@modern-js/app-tools": "@modern-js/app-tools/cli",
|
77
|
+
"@modern-js/plugin-proxy": "@modern-js/plugin-proxy/cli",
|
78
|
+
"@modern-js/plugin-ssg": "@modern-js/plugin-ssg/cli",
|
79
|
+
"@modern-js/plugin-bff": "@modern-js/plugin-bff/cli",
|
80
|
+
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
|
81
|
+
"@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
|
82
|
+
"@modern-js/plugin-express": "@modern-js/plugin-express/cli",
|
83
|
+
"@modern-js/plugin-egg": "@modern-js/plugin-egg/cli",
|
84
|
+
"@modern-js/plugin-koa": "@modern-js/plugin-koa/cli",
|
85
|
+
"@modern-js/plugin-nest": "@modern-js/plugin-nest/cli",
|
86
|
+
"@modern-js/plugin-server": "@modern-js/plugin-server/cli",
|
87
|
+
"@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
|
88
|
+
"@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
|
89
|
+
"@modern-js/plugin-polyfill": "@modern-js/plugin-polyfill/cli",
|
90
|
+
"@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
|
109
91
|
};
|
110
|
-
|
111
|
-
|
112
|
-
*/
|
113
|
-
exports.INTERNAL_MONOREPO_TOOLS_PLUGINS = {
|
114
|
-
'@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
|
115
|
-
'@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
|
92
|
+
const INTERNAL_APP_TOOLS_RUNTIME_PLUGINS = {
|
93
|
+
"@modern-js/runtime": "@modern-js/runtime/cli"
|
116
94
|
};
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
95
|
+
const INTERNAL_MODULE_TOOLS_PLUGINS = {
|
96
|
+
"@modern-js/module-tools": "@modern-js/module-tools",
|
97
|
+
"@modern-js/doc-tools": "@modern-js/doc-tools",
|
98
|
+
"@modern-js/runtime": "@modern-js/runtime/cli",
|
99
|
+
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
|
100
|
+
"@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
|
101
|
+
"@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
|
102
|
+
"@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
|
103
|
+
"@modern-js/plugin-router-legacy": "@modern-js/plugin-router-legacy/cli"
|
124
104
|
};
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
exports.INTERNAL_CLI_PLUGINS = {
|
129
|
-
'@modern-js/app-tools': '@modern-js/app-tools/cli',
|
130
|
-
'@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
|
131
|
-
'@modern-js/module-tools': '@modern-js/module-tools',
|
132
|
-
'@modern-js/doc-tools': '@modern-js/doc-tools',
|
133
|
-
'@modern-js/runtime': '@modern-js/runtime/cli',
|
134
|
-
'@modern-js/plugin-proxy': '@modern-js/plugin-proxy/cli',
|
135
|
-
'@modern-js/plugin-ssg': '@modern-js/plugin-ssg/cli',
|
136
|
-
'@modern-js/plugin-bff': '@modern-js/plugin-bff/cli',
|
137
|
-
'@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
|
138
|
-
'@modern-js/plugin-storybook': '@modern-js/plugin-storybook/cli',
|
139
|
-
'@modern-js/plugin-express': '@modern-js/plugin-express/cli',
|
140
|
-
'@modern-js/plugin-egg': '@modern-js/plugin-egg/cli',
|
141
|
-
'@modern-js/plugin-koa': '@modern-js/plugin-koa/cli',
|
142
|
-
'@modern-js/plugin-nest': '@modern-js/plugin-nest/cli',
|
143
|
-
'@modern-js/plugin-server': '@modern-js/plugin-server/cli',
|
144
|
-
'@modern-js/plugin-swc': '@modern-js/plugin-swc',
|
145
|
-
'@modern-js/plugin-garfish': '@modern-js/plugin-garfish/cli',
|
146
|
-
'@modern-js/plugin-tailwindcss': '@modern-js/plugin-tailwindcss/cli',
|
147
|
-
'@modern-js/plugin-polyfill': '@modern-js/plugin-polyfill/cli',
|
148
|
-
// TODO: Maybe can remove it
|
149
|
-
'@modern-js/plugin-nocode': '@modern-js/plugin-nocode/cli',
|
150
|
-
// legacy router (inner react-router-dom v5)
|
151
|
-
'@modern-js/plugin-router-v5': '@modern-js/plugin-router-v5/cli',
|
105
|
+
const INTERNAL_MONOREPO_TOOLS_PLUGINS = {
|
106
|
+
"@modern-js/monorepo-tools": "@modern-js/monorepo-tools/cli",
|
107
|
+
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli"
|
152
108
|
};
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
exports.SERVER_PLUGIN_NEST = '@modern-js/plugin-nest';
|
158
|
-
exports.SERVER_PLUGIN_SERVER = '@modern-js/plugin-server';
|
159
|
-
exports.SERVER_PLUGIN_POLYFILL = '@modern-js/plugin-polyfill';
|
160
|
-
exports.INTERNAL_SERVER_PLUGINS = {
|
161
|
-
[exports.SERVER_PLUGIN_BFF]: '@modern-js/plugin-bff/server',
|
162
|
-
[exports.SERVER_PLUGIN_EXPRESS]: '@modern-js/plugin-express/server',
|
163
|
-
[exports.SERVER_PLUGIN_EGG]: '@modern-js/plugin-egg/server',
|
164
|
-
[exports.SERVER_PLUGIN_KOA]: '@modern-js/plugin-koa/server',
|
165
|
-
[exports.SERVER_PLUGIN_NEST]: '@modern-js/plugin-nest/server',
|
166
|
-
[exports.SERVER_PLUGIN_SERVER]: '@modern-js/plugin-server/server',
|
167
|
-
[exports.SERVER_PLUGIN_POLYFILL]: '@modern-js/plugin-polyfill/server',
|
109
|
+
const INTERNAL_DOC_TOOLS_PLUGINS = {
|
110
|
+
"@modern-js/doc-tools": "@modern-js/doc-tools",
|
111
|
+
"@modern-js/runtime": "@modern-js/runtime/cli",
|
112
|
+
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli"
|
168
113
|
};
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
{
|
192
|
-
target: 'tools.swc',
|
193
|
-
schema: { typeof: ['object'] },
|
194
|
-
},
|
195
|
-
],
|
196
|
-
'@modern-js/plugin-bff': [
|
197
|
-
{
|
198
|
-
target: 'bff',
|
199
|
-
schema: {
|
200
|
-
type: 'object',
|
201
|
-
properties: {
|
202
|
-
prefix: {
|
203
|
-
type: ['string', 'array'],
|
204
|
-
items: { type: 'string' },
|
205
|
-
},
|
206
|
-
fetcher: { type: 'string' },
|
207
|
-
proxy: { type: 'object' },
|
208
|
-
requestCreator: { type: 'string' },
|
209
|
-
},
|
210
|
-
},
|
211
|
-
},
|
212
|
-
],
|
213
|
-
'@modern-js/plugin-tailwindcss': [
|
214
|
-
{
|
215
|
-
target: 'tools.tailwindcss',
|
216
|
-
schema: { typeof: ['object', 'function'] },
|
217
|
-
},
|
218
|
-
],
|
219
|
-
'@modern-js/plugin-proxy': [
|
220
|
-
{
|
221
|
-
target: 'dev.proxy',
|
222
|
-
schema: { typeof: ['string', 'object'] },
|
223
|
-
},
|
224
|
-
],
|
225
|
-
'@modern-js/plugin-ssg': [
|
226
|
-
{
|
227
|
-
target: 'output.ssg',
|
228
|
-
schema: {
|
229
|
-
oneOf: [
|
230
|
-
{ type: 'boolean' },
|
231
|
-
{ type: 'object' },
|
232
|
-
{ instanceof: 'Function' },
|
233
|
-
],
|
234
|
-
},
|
235
|
-
},
|
236
|
-
],
|
237
|
-
'@modern-js/plugin-state': [
|
238
|
-
{
|
239
|
-
target: 'runtime.state',
|
240
|
-
schema: { type: ['boolean', 'object'] },
|
241
|
-
},
|
242
|
-
],
|
243
|
-
'@modern-js/plugin-design-token': [
|
244
|
-
// Legacy Features
|
245
|
-
{
|
246
|
-
target: 'source.designSystem',
|
247
|
-
schema: { typeof: ['object'] },
|
248
|
-
},
|
249
|
-
{
|
250
|
-
target: 'source.designSystem.supportStyledComponents',
|
251
|
-
schema: { type: ['boolean'] },
|
252
|
-
},
|
253
|
-
{
|
254
|
-
target: 'designSystem',
|
255
|
-
schema: { typeof: ['object'] },
|
256
|
-
},
|
257
|
-
],
|
258
|
-
'@modern-js/plugin-router': [
|
259
|
-
{
|
260
|
-
target: 'runtime.router',
|
261
|
-
schema: { type: ['boolean', 'object'] },
|
262
|
-
},
|
263
|
-
],
|
264
|
-
'@modern-js/plugin-testing': [
|
265
|
-
{
|
266
|
-
target: 'testing',
|
267
|
-
schema: { typeof: ['object'] },
|
268
|
-
},
|
269
|
-
{
|
270
|
-
target: 'tools.jest',
|
271
|
-
schema: { typeof: ['object', 'function'] },
|
272
|
-
},
|
273
|
-
],
|
274
|
-
'@modern-js/plugin-garfish': [
|
275
|
-
{
|
276
|
-
target: 'runtime.masterApp',
|
277
|
-
schema: { type: ['boolean', 'object'] },
|
278
|
-
},
|
279
|
-
{
|
280
|
-
target: 'dev.withMasterApp',
|
281
|
-
schema: { type: ['object'] },
|
282
|
-
},
|
283
|
-
{
|
284
|
-
target: 'deploy.microFrontend',
|
285
|
-
schema: { type: ['boolean', 'object'] },
|
286
|
-
},
|
287
|
-
],
|
288
|
-
'@modern-js/plugin-nocode': [],
|
114
|
+
const INTERNAL_CLI_PLUGINS = {
|
115
|
+
"@modern-js/app-tools": "@modern-js/app-tools/cli",
|
116
|
+
"@modern-js/monorepo-tools": "@modern-js/monorepo-tools/cli",
|
117
|
+
"@modern-js/module-tools": "@modern-js/module-tools",
|
118
|
+
"@modern-js/doc-tools": "@modern-js/doc-tools",
|
119
|
+
"@modern-js/runtime": "@modern-js/runtime/cli",
|
120
|
+
"@modern-js/plugin-proxy": "@modern-js/plugin-proxy/cli",
|
121
|
+
"@modern-js/plugin-ssg": "@modern-js/plugin-ssg/cli",
|
122
|
+
"@modern-js/plugin-bff": "@modern-js/plugin-bff/cli",
|
123
|
+
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
|
124
|
+
"@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
|
125
|
+
"@modern-js/plugin-express": "@modern-js/plugin-express/cli",
|
126
|
+
"@modern-js/plugin-egg": "@modern-js/plugin-egg/cli",
|
127
|
+
"@modern-js/plugin-koa": "@modern-js/plugin-koa/cli",
|
128
|
+
"@modern-js/plugin-nest": "@modern-js/plugin-nest/cli",
|
129
|
+
"@modern-js/plugin-server": "@modern-js/plugin-server/cli",
|
130
|
+
"@modern-js/plugin-swc": "@modern-js/plugin-swc",
|
131
|
+
"@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
|
132
|
+
"@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
|
133
|
+
"@modern-js/plugin-polyfill": "@modern-js/plugin-polyfill/cli",
|
134
|
+
"@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
|
135
|
+
"@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
|
289
136
|
};
|
137
|
+
const SERVER_PLUGIN_BFF = "@modern-js/plugin-bff";
|
138
|
+
const SERVER_PLUGIN_EXPRESS = "@modern-js/plugin-express";
|
139
|
+
const SERVER_PLUGIN_EGG = "@modern-js/plugin-egg";
|
140
|
+
const SERVER_PLUGIN_KOA = "@modern-js/plugin-koa";
|
141
|
+
const SERVER_PLUGIN_NEST = "@modern-js/plugin-nest";
|
142
|
+
const SERVER_PLUGIN_SERVER = "@modern-js/plugin-server";
|
143
|
+
const SERVER_PLUGIN_POLYFILL = "@modern-js/plugin-polyfill";
|
144
|
+
const INTERNAL_SERVER_PLUGINS = {
|
145
|
+
[SERVER_PLUGIN_BFF]: "@modern-js/plugin-bff/server",
|
146
|
+
[SERVER_PLUGIN_EXPRESS]: "@modern-js/plugin-express/server",
|
147
|
+
[SERVER_PLUGIN_EGG]: "@modern-js/plugin-egg/server",
|
148
|
+
[SERVER_PLUGIN_KOA]: "@modern-js/plugin-koa/server",
|
149
|
+
[SERVER_PLUGIN_NEST]: "@modern-js/plugin-nest/server",
|
150
|
+
[SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
|
151
|
+
[SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
|
152
|
+
};
|
153
|
+
const PLUGIN_SCHEMAS = {
|
154
|
+
"@modern-js/runtime": [
|
155
|
+
{
|
156
|
+
target: "runtime",
|
157
|
+
schema: {
|
158
|
+
type: "object",
|
159
|
+
additionalProperties: false
|
160
|
+
}
|
161
|
+
},
|
162
|
+
{
|
163
|
+
target: "runtimeByEntries",
|
164
|
+
schema: {
|
165
|
+
type: "object",
|
166
|
+
patternProperties: { [ENTRY_NAME_PATTERN]: { type: "object" } },
|
167
|
+
additionalProperties: false
|
168
|
+
}
|
169
|
+
}
|
170
|
+
],
|
171
|
+
"@modern-js/plugin-swc": [
|
172
|
+
{
|
173
|
+
target: "tools.swc",
|
174
|
+
schema: { typeof: ["object"] }
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"@modern-js/plugin-bff": [
|
178
|
+
{
|
179
|
+
target: "bff",
|
180
|
+
schema: {
|
181
|
+
type: "object",
|
182
|
+
properties: {
|
183
|
+
prefix: {
|
184
|
+
type: ["string", "array"],
|
185
|
+
items: { type: "string" }
|
186
|
+
},
|
187
|
+
fetcher: { type: "string" },
|
188
|
+
proxy: { type: "object" },
|
189
|
+
requestCreator: { type: "string" }
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
],
|
194
|
+
"@modern-js/plugin-tailwindcss": [
|
195
|
+
{
|
196
|
+
target: "tools.tailwindcss",
|
197
|
+
schema: { typeof: ["object", "function"] }
|
198
|
+
}
|
199
|
+
],
|
200
|
+
"@modern-js/plugin-proxy": [
|
201
|
+
{
|
202
|
+
target: "dev.proxy",
|
203
|
+
schema: { typeof: ["string", "object"] }
|
204
|
+
}
|
205
|
+
],
|
206
|
+
"@modern-js/plugin-ssg": [
|
207
|
+
{
|
208
|
+
target: "output.ssg",
|
209
|
+
schema: {
|
210
|
+
oneOf: [
|
211
|
+
{ type: "boolean" },
|
212
|
+
{ type: "object" },
|
213
|
+
{ instanceof: "Function" }
|
214
|
+
]
|
215
|
+
}
|
216
|
+
}
|
217
|
+
],
|
218
|
+
"@modern-js/plugin-state": [
|
219
|
+
{
|
220
|
+
target: "runtime.state",
|
221
|
+
schema: { type: ["boolean", "object"] }
|
222
|
+
}
|
223
|
+
],
|
224
|
+
"@modern-js/plugin-design-token": [
|
225
|
+
{
|
226
|
+
target: "source.designSystem",
|
227
|
+
schema: { typeof: ["object"] }
|
228
|
+
},
|
229
|
+
{
|
230
|
+
target: "source.designSystem.supportStyledComponents",
|
231
|
+
schema: { type: ["boolean"] }
|
232
|
+
},
|
233
|
+
{
|
234
|
+
target: "designSystem",
|
235
|
+
schema: { typeof: ["object"] }
|
236
|
+
}
|
237
|
+
],
|
238
|
+
"@modern-js/plugin-router": [
|
239
|
+
{
|
240
|
+
target: "runtime.router",
|
241
|
+
schema: { type: ["boolean", "object"] }
|
242
|
+
}
|
243
|
+
],
|
244
|
+
"@modern-js/plugin-testing": [
|
245
|
+
{
|
246
|
+
target: "testing",
|
247
|
+
schema: { typeof: ["object"] }
|
248
|
+
},
|
249
|
+
{
|
250
|
+
target: "tools.jest",
|
251
|
+
schema: { typeof: ["object", "function"] }
|
252
|
+
}
|
253
|
+
],
|
254
|
+
"@modern-js/plugin-garfish": [
|
255
|
+
{
|
256
|
+
target: "runtime.masterApp",
|
257
|
+
schema: { type: ["boolean", "object"] }
|
258
|
+
},
|
259
|
+
{
|
260
|
+
target: "dev.withMasterApp",
|
261
|
+
schema: { type: ["object"] }
|
262
|
+
},
|
263
|
+
{
|
264
|
+
target: "deploy.microFrontend",
|
265
|
+
schema: { type: ["boolean", "object"] }
|
266
|
+
}
|
267
|
+
],
|
268
|
+
"@modern-js/plugin-nocode": []
|
269
|
+
};
|
270
|
+
// Annotate the CommonJS export names for ESM import in node:
|
271
|
+
0 && (module.exports = {
|
272
|
+
API_DIR,
|
273
|
+
CONFIG_CACHE_DIR,
|
274
|
+
CONFIG_FILE_EXTENSIONS,
|
275
|
+
DEFAULT_SERVER_CONFIG,
|
276
|
+
ENTRY_NAME_PATTERN,
|
277
|
+
HMR_SOCK_PATH,
|
278
|
+
INTERNAL_APP_TOOLS_PLUGINS,
|
279
|
+
INTERNAL_APP_TOOLS_RUNTIME_PLUGINS,
|
280
|
+
INTERNAL_CLI_PLUGINS,
|
281
|
+
INTERNAL_DOC_TOOLS_PLUGINS,
|
282
|
+
INTERNAL_MODULE_TOOLS_PLUGINS,
|
283
|
+
INTERNAL_MONOREPO_TOOLS_PLUGINS,
|
284
|
+
INTERNAL_SERVER_PLUGINS,
|
285
|
+
LAUNCH_EDITOR_ENDPOINT,
|
286
|
+
LOADABLE_STATS_FILE,
|
287
|
+
LOADER_ROUTES_DIR,
|
288
|
+
MAIN_ENTRY_NAME,
|
289
|
+
OUTPUT_CONFIG_FILE,
|
290
|
+
PLUGIN_SCHEMAS,
|
291
|
+
ROUTE_MANIFEST,
|
292
|
+
ROUTE_MINIFEST_FILE,
|
293
|
+
ROUTE_SPEC_FILE,
|
294
|
+
SERVER_BUNDLE_DIRECTORY,
|
295
|
+
SERVER_DIR,
|
296
|
+
SERVER_PLUGIN_BFF,
|
297
|
+
SERVER_PLUGIN_EGG,
|
298
|
+
SERVER_PLUGIN_EXPRESS,
|
299
|
+
SERVER_PLUGIN_KOA,
|
300
|
+
SERVER_PLUGIN_NEST,
|
301
|
+
SERVER_PLUGIN_POLYFILL,
|
302
|
+
SERVER_PLUGIN_SERVER,
|
303
|
+
SERVER_RENDER_FUNCTION_NAME,
|
304
|
+
SERVER_WORKER_BUNDLE_DIRECTORY,
|
305
|
+
SHARED_DIR
|
306
|
+
});
|
package/dist/debug.d.ts
CHANGED
@@ -3,4 +3,4 @@
|
|
3
3
|
* @param scope - Custom module name of your debug function.
|
4
4
|
* @returns Debug function which namespace start with modern-js:.
|
5
5
|
*/
|
6
|
-
export declare const createDebugger: (scope: string) => import("../compiled/debug").Debugger;
|
6
|
+
export declare const createDebugger: (scope: string) => import("../compiled/debug").Debugger;
|
package/dist/debug.js
CHANGED
@@ -1,11 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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 debug_exports = {};
|
19
|
+
__export(debug_exports, {
|
20
|
+
createDebugger: () => createDebugger
|
21
|
+
});
|
22
|
+
module.exports = __toCommonJS(debug_exports);
|
23
|
+
var import_debug = require("../compiled/debug");
|
24
|
+
const createDebugger = (scope) => (0, import_debug.debug)(`modern-js:${scope}`);
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
26
|
+
0 && (module.exports = {
|
27
|
+
createDebugger
|
28
|
+
});
|
package/dist/emptyDir.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare const emptyDir: (dir: string) => Promise<void>;
|
1
|
+
export declare const emptyDir: (dir: string) => Promise<void>;
|