@modern-js/core 1.8.0 → 1.9.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.
- package/.eslintrc.js +1 -0
- package/CHANGELOG.md +22 -0
- package/bin/modern-js.js +1 -1
- package/compiled/ajv/codegen.js +1 -0
- package/compiled/ajv/dist/ajv.d.ts +16 -0
- package/compiled/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/compiled/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/ajv/dist/compile/ref_error.d.ts +6 -0
- package/compiled/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/ajv/dist/core.d.ts +173 -0
- package/compiled/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/ajv/dist/types/index.d.ts +183 -0
- package/compiled/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/ajv/dist/types/jtd-schema.d.ts +169 -0
- package/compiled/ajv/index.js +9 -0
- package/compiled/ajv/license +22 -0
- package/compiled/ajv/package.json +1 -0
- package/compiled/ajv/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/ajv-keywords/ajv/dist/ajv.d.ts +16 -0
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/ajv-keywords/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/ajv-keywords/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/ajv-keywords/ajv/dist/compile/ref_error.d.ts +6 -0
- package/compiled/ajv-keywords/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/ajv-keywords/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/ajv-keywords/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/ajv-keywords/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/ajv-keywords/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/ajv-keywords/ajv/dist/core.d.ts +173 -0
- package/compiled/ajv-keywords/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/ajv-keywords/ajv/dist/types/index.d.ts +183 -0
- package/compiled/ajv-keywords/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/ajv-keywords/ajv/dist/types/jtd-schema.d.ts +169 -0
- package/compiled/ajv-keywords/dist/index.d.ts +4 -0
- package/compiled/ajv-keywords/index.js +1 -0
- package/compiled/ajv-keywords/license +21 -0
- package/compiled/ajv-keywords/package.json +1 -0
- package/compiled/ajv-keywords/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/better-ajv-errors/ajv/dist/ajv.d.ts +16 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/ref_error.d.ts +6 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/better-ajv-errors/ajv/dist/core.d.ts +173 -0
- package/compiled/better-ajv-errors/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/better-ajv-errors/ajv/dist/types/index.d.ts +183 -0
- package/compiled/better-ajv-errors/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/better-ajv-errors/ajv/dist/types/jtd-schema.d.ts +169 -0
- package/compiled/better-ajv-errors/index.js +1 -0
- package/compiled/better-ajv-errors/license +13 -0
- package/compiled/better-ajv-errors/package.json +1 -0
- package/compiled/better-ajv-errors/typings.d.ts +24 -0
- package/compiled/better-ajv-errors/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/v8-compile-cache/index.js +1 -0
- package/compiled/v8-compile-cache/license +21 -0
- package/compiled/v8-compile-cache/package.json +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +33 -0
- package/dist/config/defaults.d.ts +28 -0
- package/dist/config/defaults.js +98 -0
- package/dist/{types/config → config}/index.d.ts +2 -2
- package/dist/config/index.js +120 -0
- package/dist/config/mergeConfig.d.ts +30 -0
- package/dist/config/mergeConfig.js +26 -0
- package/dist/config/schema/deploy.d.ts +16 -0
- package/dist/config/schema/deploy.js +16 -0
- package/dist/config/schema/index.d.ts +466 -0
- package/dist/config/schema/index.js +95 -0
- package/dist/config/schema/output.d.ts +146 -0
- package/dist/config/schema/output.js +68 -0
- package/dist/config/schema/server.d.ts +182 -0
- package/dist/config/schema/server.js +107 -0
- package/dist/config/schema/source.d.ts +58 -0
- package/dist/config/schema/source.js +36 -0
- package/dist/config/schema/tools.d.ts +36 -0
- package/dist/config/schema/tools.js +19 -0
- package/dist/config/types/electron.d.ts +13 -0
- package/dist/config/types/electron.js +2 -0
- package/dist/config/types/index.d.ts +240 -0
- package/dist/config/types/index.js +2 -0
- package/dist/config/types/less.d.ts +10 -0
- package/dist/config/types/less.js +2 -0
- package/dist/config/types/sass.d.ts +8 -0
- package/dist/config/types/sass.js +2 -0
- package/dist/{types/config → config}/types/ssg.d.ts +8 -8
- package/dist/config/types/ssg.js +2 -0
- package/dist/config/types/test.d.ts +14 -0
- package/dist/config/types/test.js +2 -0
- package/dist/config/types/unbundle.d.ts +25 -0
- package/dist/config/types/unbundle.js +2 -0
- package/dist/{types/context.d.ts → context.d.ts} +12 -22
- package/dist/context.js +59 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +177 -0
- package/dist/{types/initWatcher.d.ts → initWatcher.d.ts} +1 -1
- package/dist/initWatcher.js +75 -0
- package/dist/{types/loadEnv.d.ts → loadEnv.d.ts} +1 -1
- package/dist/loadEnv.js +21 -0
- package/dist/{types/loadPlugins.d.ts → loadPlugins.d.ts} +13 -16
- package/dist/loadPlugins.js +109 -0
- package/dist/manager.d.ts +72 -0
- package/dist/manager.js +24 -0
- package/dist/{types/pluginAPI.d.ts → pluginAPI.d.ts} +5 -6
- package/dist/pluginAPI.js +16 -0
- package/dist/{types/utils → utils}/commander.d.ts +1 -1
- package/dist/utils/commander.js +20 -0
- package/dist/{types/utils → utils}/repeatKeyWarning.d.ts +1 -1
- package/dist/utils/repeatKeyWarning.js +22 -0
- package/package.json +12 -26
- package/tsconfig.json +3 -4
- package/dist/js/modern/cli.js +0 -29
- package/dist/js/modern/config/defaults.js +0 -103
- package/dist/js/modern/config/index.js +0 -115
- package/dist/js/modern/config/mergeConfig.js +0 -22
- package/dist/js/modern/config/schema/deploy.js +0 -17
- package/dist/js/modern/config/schema/index.js +0 -107
- package/dist/js/modern/config/schema/output.js +0 -147
- package/dist/js/modern/config/schema/server.js +0 -170
- package/dist/js/modern/config/schema/source.js +0 -59
- package/dist/js/modern/config/schema/tools.js +0 -36
- package/dist/js/modern/config/types/electron.js +0 -1
- package/dist/js/modern/config/types/index.js +0 -1
- package/dist/js/modern/config/types/less.js +0 -0
- package/dist/js/modern/config/types/sass.js +0 -0
- package/dist/js/modern/config/types/ssg.js +0 -0
- package/dist/js/modern/config/types/test.js +0 -0
- package/dist/js/modern/config/types/unbundle.js +0 -0
- package/dist/js/modern/context.js +0 -63
- package/dist/js/modern/index.js +0 -169
- package/dist/js/modern/initWatcher.js +0 -62
- package/dist/js/modern/loadEnv.js +0 -14
- package/dist/js/modern/loadPlugins.js +0 -122
- package/dist/js/modern/manager.js +0 -28
- package/dist/js/modern/pluginAPI.js +0 -11
- package/dist/js/modern/utils/commander.js +0 -19
- package/dist/js/modern/utils/repeatKeyWarning.js +0 -18
- package/dist/js/node/cli.js +0 -35
- package/dist/js/node/config/defaults.js +0 -110
- package/dist/js/node/config/index.js +0 -182
- package/dist/js/node/config/mergeConfig.js +0 -32
- package/dist/js/node/config/schema/deploy.js +0 -26
- package/dist/js/node/config/schema/index.js +0 -127
- package/dist/js/node/config/schema/output.js +0 -156
- package/dist/js/node/config/schema/server.js +0 -179
- package/dist/js/node/config/schema/source.js +0 -68
- package/dist/js/node/config/schema/tools.js +0 -43
- package/dist/js/node/config/types/electron.js +0 -5
- package/dist/js/node/config/types/index.js +0 -5
- package/dist/js/node/config/types/less.js +0 -0
- package/dist/js/node/config/types/sass.js +0 -0
- package/dist/js/node/config/types/ssg.js +0 -0
- package/dist/js/node/config/types/test.js +0 -0
- package/dist/js/node/config/types/unbundle.js +0 -0
- package/dist/js/node/context.js +0 -93
- package/dist/js/node/index.js +0 -329
- package/dist/js/node/initWatcher.js +0 -82
- package/dist/js/node/loadEnv.js +0 -30
- package/dist/js/node/loadPlugins.js +0 -134
- package/dist/js/node/manager.js +0 -45
- package/dist/js/node/pluginAPI.js +0 -54
- package/dist/js/node/utils/commander.js +0 -32
- package/dist/js/node/utils/repeatKeyWarning.js +0 -31
- package/dist/types/cli.d.ts +0 -1
- package/dist/types/config/defaults.d.ts +0 -28
- package/dist/types/config/mergeConfig.d.ts +0 -31
- package/dist/types/config/schema/deploy.d.ts +0 -16
- package/dist/types/config/schema/index.d.ts +0 -466
- package/dist/types/config/schema/output.d.ts +0 -146
- package/dist/types/config/schema/server.d.ts +0 -182
- package/dist/types/config/schema/source.d.ts +0 -58
- package/dist/types/config/schema/tools.d.ts +0 -36
- package/dist/types/config/types/electron.d.ts +0 -13
- package/dist/types/config/types/index.d.ts +0 -252
- package/dist/types/config/types/less.d.ts +0 -10
- package/dist/types/config/types/sass.d.ts +0 -8
- package/dist/types/config/types/test.d.ts +0 -15
- package/dist/types/config/types/unbundle.d.ts +0 -28
- package/dist/types/index.d.ts +0 -64
- package/dist/types/manager.d.ts +0 -75
- package/modern.config.js +0 -6
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.traverseSchema = exports.patchSchema = void 0;
|
|
4
|
+
const utils_1 = require("@modern-js/utils");
|
|
5
|
+
const lodash_1 = require("@modern-js/utils/lodash");
|
|
6
|
+
const source_1 = require("./source");
|
|
7
|
+
const output_1 = require("./output");
|
|
8
|
+
const server_1 = require("./server");
|
|
9
|
+
const deploy_1 = require("./deploy");
|
|
10
|
+
const tools_1 = require("./tools");
|
|
11
|
+
const debug = (0, utils_1.createDebugger)('validate-schema');
|
|
12
|
+
const plugins = {
|
|
13
|
+
type: 'array',
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
};
|
|
16
|
+
const dev = {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
assetPrefix: { type: ['boolean', 'string'] },
|
|
20
|
+
https: {
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
};
|
|
26
|
+
const patchSchema = (pluginSchemas) => {
|
|
27
|
+
const finalSchema = (0, lodash_1.cloneDeep)({
|
|
28
|
+
type: 'object',
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
properties: {
|
|
31
|
+
source: source_1.source,
|
|
32
|
+
output: output_1.output,
|
|
33
|
+
server: server_1.server,
|
|
34
|
+
deploy: deploy_1.deploy,
|
|
35
|
+
plugins,
|
|
36
|
+
dev,
|
|
37
|
+
tools: tools_1.tools,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const findTargetNode = (props) => {
|
|
41
|
+
let node = finalSchema.properties;
|
|
42
|
+
for (const prop of props) {
|
|
43
|
+
node = node[prop];
|
|
44
|
+
if (!node || !(0, utils_1.isObject)(node)) {
|
|
45
|
+
throw new Error(`add schema ${props.join('.')} error`);
|
|
46
|
+
}
|
|
47
|
+
node.properties = node.hasOwnProperty('properties')
|
|
48
|
+
? node.properties
|
|
49
|
+
: {};
|
|
50
|
+
node = node.properties;
|
|
51
|
+
}
|
|
52
|
+
return node;
|
|
53
|
+
};
|
|
54
|
+
const finalPluginSchemas = [];
|
|
55
|
+
pluginSchemas.forEach(item => {
|
|
56
|
+
if (Array.isArray(item)) {
|
|
57
|
+
finalPluginSchemas.push(...item);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
finalPluginSchemas.push(item);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
for (const { target, schema } of finalPluginSchemas) {
|
|
64
|
+
if (!target) {
|
|
65
|
+
throw new Error(`should return target property in plugin schema.`);
|
|
66
|
+
}
|
|
67
|
+
const props = target.split('.');
|
|
68
|
+
const mountProperty = props.pop();
|
|
69
|
+
const targetNode = findTargetNode(props);
|
|
70
|
+
if (targetNode.hasOwnProperty(mountProperty)) {
|
|
71
|
+
throw new Error(`${target} already exists in current validate schema`);
|
|
72
|
+
}
|
|
73
|
+
targetNode[mountProperty] = (0, lodash_1.cloneDeep)(schema);
|
|
74
|
+
}
|
|
75
|
+
debug(`final validate schema: %o`, finalSchema);
|
|
76
|
+
return finalSchema;
|
|
77
|
+
};
|
|
78
|
+
exports.patchSchema = patchSchema;
|
|
79
|
+
const traverseSchema = (schema) => {
|
|
80
|
+
const keys = [];
|
|
81
|
+
const traverse = ({ properties }, old = []) => {
|
|
82
|
+
for (const key of Object.keys(properties)) {
|
|
83
|
+
const current = [...old, key];
|
|
84
|
+
if (properties[key].type === 'object' && properties[key].properties) {
|
|
85
|
+
traverse(properties[key], current);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
keys.push(current.join('.'));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
traverse(schema);
|
|
93
|
+
return keys;
|
|
94
|
+
};
|
|
95
|
+
exports.traverseSchema = traverseSchema;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export declare const output: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
properties: {
|
|
5
|
+
assetPrefix: {
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
path: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
jsPath: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
cssPath: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
htmlPath: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
mediaPath: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
mountId: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
favicon: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
faviconByEntries: {
|
|
30
|
+
type: string;
|
|
31
|
+
patternProperties: {
|
|
32
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
title: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
titleByEntries: {
|
|
41
|
+
type: string;
|
|
42
|
+
patternProperties: {
|
|
43
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
meta: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
metaByEntries: {
|
|
52
|
+
type: string;
|
|
53
|
+
patternProperties: {
|
|
54
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
inject: {
|
|
60
|
+
enum: (string | boolean)[];
|
|
61
|
+
};
|
|
62
|
+
injectByEntries: {
|
|
63
|
+
type: string;
|
|
64
|
+
patternProperties: {
|
|
65
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
66
|
+
enum: (string | boolean)[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
copy: {
|
|
71
|
+
type: string;
|
|
72
|
+
};
|
|
73
|
+
scriptExt: {
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
disableTsChecker: {
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
disableHtmlFolder: {
|
|
80
|
+
type: string;
|
|
81
|
+
};
|
|
82
|
+
disableCssModuleExtension: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
disableCssExtract: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
enableCssModuleTSDeclaration: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
disableMinimize: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
enableInlineStyles: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
enableInlineScripts: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
disableSourceMap: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
disableInlineRuntimeChunk: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
disableAssetsCache: {
|
|
107
|
+
type: string;
|
|
108
|
+
};
|
|
109
|
+
enableLatestDecorators: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
enableTsLoader: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
dataUriLimit: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
templateParameters: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
templateParametersByEntries: {
|
|
122
|
+
type: string;
|
|
123
|
+
patternProperties: {
|
|
124
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
polyfill: {
|
|
130
|
+
type: string;
|
|
131
|
+
enum: string[];
|
|
132
|
+
};
|
|
133
|
+
cssModuleLocalIdentName: {
|
|
134
|
+
type: string;
|
|
135
|
+
};
|
|
136
|
+
federation: {
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
disableNodePolyfill: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
enableModernMode: {
|
|
143
|
+
type: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.output = void 0;
|
|
4
|
+
const utils_1 = require("@modern-js/utils");
|
|
5
|
+
exports.output = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
properties: {
|
|
9
|
+
assetPrefix: { type: 'string' },
|
|
10
|
+
path: { type: 'string' },
|
|
11
|
+
jsPath: { type: 'string' },
|
|
12
|
+
cssPath: { type: 'string' },
|
|
13
|
+
htmlPath: { type: 'string' },
|
|
14
|
+
mediaPath: { type: 'string' },
|
|
15
|
+
mountId: { type: 'string' },
|
|
16
|
+
favicon: { type: 'string' },
|
|
17
|
+
faviconByEntries: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
patternProperties: { [utils_1.ENTRY_NAME_PATTERN]: { type: 'string' } },
|
|
20
|
+
},
|
|
21
|
+
title: { type: 'string' },
|
|
22
|
+
titleByEntries: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
patternProperties: { [utils_1.ENTRY_NAME_PATTERN]: { type: 'string' } },
|
|
25
|
+
},
|
|
26
|
+
meta: { type: 'object' },
|
|
27
|
+
metaByEntries: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
patternProperties: { [utils_1.ENTRY_NAME_PATTERN]: { type: 'object' } },
|
|
30
|
+
},
|
|
31
|
+
inject: { enum: [true, 'head', 'body', false] },
|
|
32
|
+
injectByEntries: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
patternProperties: {
|
|
35
|
+
[utils_1.ENTRY_NAME_PATTERN]: { enum: [true, 'head', 'body', false] },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
copy: { type: 'array' },
|
|
39
|
+
scriptExt: { type: 'object' },
|
|
40
|
+
disableTsChecker: { type: 'boolean' },
|
|
41
|
+
disableHtmlFolder: { type: 'boolean' },
|
|
42
|
+
disableCssModuleExtension: { type: 'boolean' },
|
|
43
|
+
disableCssExtract: { type: 'boolean' },
|
|
44
|
+
enableCssModuleTSDeclaration: { type: 'boolean' },
|
|
45
|
+
disableMinimize: { type: 'boolean' },
|
|
46
|
+
enableInlineStyles: { type: 'boolean' },
|
|
47
|
+
enableInlineScripts: { type: 'boolean' },
|
|
48
|
+
disableSourceMap: { type: 'boolean' },
|
|
49
|
+
disableInlineRuntimeChunk: { type: 'boolean' },
|
|
50
|
+
disableAssetsCache: { type: 'boolean' },
|
|
51
|
+
enableLatestDecorators: { type: 'boolean' },
|
|
52
|
+
enableTsLoader: { type: 'boolean' },
|
|
53
|
+
dataUriLimit: { type: 'number' },
|
|
54
|
+
templateParameters: { type: 'object' },
|
|
55
|
+
templateParametersByEntries: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
patternProperties: { [utils_1.ENTRY_NAME_PATTERN]: { type: 'object' } },
|
|
58
|
+
},
|
|
59
|
+
polyfill: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
enum: ['usage', 'entry', 'off', 'ua'],
|
|
62
|
+
},
|
|
63
|
+
cssModuleLocalIdentName: { type: 'string' },
|
|
64
|
+
federation: { type: 'object' },
|
|
65
|
+
disableNodePolyfill: { type: 'boolean' },
|
|
66
|
+
enableModernMode: { type: 'boolean' },
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export declare const server: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
properties: {
|
|
5
|
+
port: {
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
ssr: {
|
|
9
|
+
if: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
then: {
|
|
13
|
+
properties: {
|
|
14
|
+
disableLoadable: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
disableHelmet: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
disableRedirect: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
enableAsyncData: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
enableProductWarning: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
timeout: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
asyncDataTimeout: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
else: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
ssrByEntries: {
|
|
42
|
+
type: string;
|
|
43
|
+
patternProperties: {
|
|
44
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
45
|
+
if: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
then: {
|
|
49
|
+
properties: {
|
|
50
|
+
disableLoadable: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
disableHelmet: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
disableRedirect: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
enableProductWarning: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
enableAsyncData: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
timeout: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
asyncDataTimeout: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
additionalProperties: boolean;
|
|
73
|
+
};
|
|
74
|
+
else: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
routes: {
|
|
81
|
+
type: string;
|
|
82
|
+
patternProperties: {
|
|
83
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
84
|
+
if: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
then: {
|
|
88
|
+
properties: {
|
|
89
|
+
route: {
|
|
90
|
+
oneOf: ({
|
|
91
|
+
type: string;
|
|
92
|
+
properties: {
|
|
93
|
+
path: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
headers: {
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
additionalProperties: boolean;
|
|
101
|
+
} | {
|
|
102
|
+
type: string;
|
|
103
|
+
items?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
type: string;
|
|
106
|
+
items: {
|
|
107
|
+
oneOf: ({
|
|
108
|
+
type: string;
|
|
109
|
+
properties: {
|
|
110
|
+
path: {
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
headers: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
additionalProperties: boolean;
|
|
118
|
+
} | {
|
|
119
|
+
type: string;
|
|
120
|
+
})[];
|
|
121
|
+
};
|
|
122
|
+
})[];
|
|
123
|
+
};
|
|
124
|
+
disableSpa: {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
additionalProperties: boolean;
|
|
129
|
+
};
|
|
130
|
+
else: {
|
|
131
|
+
oneOf: ({
|
|
132
|
+
type: string;
|
|
133
|
+
items?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
type: string;
|
|
136
|
+
items: {
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
})[];
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
publicRoutes: {
|
|
145
|
+
type: string;
|
|
146
|
+
patternProperties: {
|
|
147
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
148
|
+
type: string[];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
baseUrl: {
|
|
153
|
+
oneOf: ({
|
|
154
|
+
type: string;
|
|
155
|
+
items?: undefined;
|
|
156
|
+
} | {
|
|
157
|
+
type: string;
|
|
158
|
+
items: {
|
|
159
|
+
type: string;
|
|
160
|
+
}[];
|
|
161
|
+
})[];
|
|
162
|
+
};
|
|
163
|
+
middleware: {
|
|
164
|
+
instanceof: string[];
|
|
165
|
+
};
|
|
166
|
+
renderHook: {
|
|
167
|
+
instanceof: string;
|
|
168
|
+
};
|
|
169
|
+
logger: {
|
|
170
|
+
type: string[];
|
|
171
|
+
};
|
|
172
|
+
metrics: {
|
|
173
|
+
type: string[];
|
|
174
|
+
};
|
|
175
|
+
proxy: {
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
178
|
+
enableMicroFrontendDebug: {
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.server = void 0;
|
|
4
|
+
const utils_1 = require("@modern-js/utils");
|
|
5
|
+
const SERVER_ROUTE_OBJECT = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
path: { type: 'string' },
|
|
9
|
+
headers: { type: 'object' },
|
|
10
|
+
},
|
|
11
|
+
additionalProperties: false,
|
|
12
|
+
};
|
|
13
|
+
exports.server = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
properties: {
|
|
17
|
+
port: { type: 'number' },
|
|
18
|
+
ssr: {
|
|
19
|
+
if: { type: 'object' },
|
|
20
|
+
then: {
|
|
21
|
+
properties: {
|
|
22
|
+
disableLoadable: { type: 'boolean' },
|
|
23
|
+
disableHelmet: { type: 'boolean' },
|
|
24
|
+
disableRedirect: { type: 'boolean' },
|
|
25
|
+
enableAsyncData: { type: 'boolean' },
|
|
26
|
+
enableProductWarning: { type: 'boolean' },
|
|
27
|
+
timeout: { type: 'number' },
|
|
28
|
+
asyncDataTimeout: { type: 'number' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
else: { type: 'boolean' },
|
|
32
|
+
},
|
|
33
|
+
ssrByEntries: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
patternProperties: {
|
|
36
|
+
[utils_1.ENTRY_NAME_PATTERN]: {
|
|
37
|
+
if: { type: 'object' },
|
|
38
|
+
then: {
|
|
39
|
+
properties: {
|
|
40
|
+
disableLoadable: { type: 'boolean' },
|
|
41
|
+
disableHelmet: { type: 'boolean' },
|
|
42
|
+
disableRedirect: { type: 'boolean' },
|
|
43
|
+
enableProductWarning: { type: 'boolean' },
|
|
44
|
+
enableAsyncData: { type: 'boolean' },
|
|
45
|
+
timeout: { type: 'number' },
|
|
46
|
+
asyncDataTimeout: { type: 'number' },
|
|
47
|
+
},
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
},
|
|
50
|
+
else: { type: 'boolean' },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
routes: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
patternProperties: {
|
|
57
|
+
[utils_1.ENTRY_NAME_PATTERN]: {
|
|
58
|
+
if: { type: 'object' },
|
|
59
|
+
then: {
|
|
60
|
+
properties: {
|
|
61
|
+
route: {
|
|
62
|
+
oneOf: [
|
|
63
|
+
{ type: 'string' },
|
|
64
|
+
{
|
|
65
|
+
type: 'array',
|
|
66
|
+
items: { oneOf: [{ type: 'string' }, SERVER_ROUTE_OBJECT] },
|
|
67
|
+
},
|
|
68
|
+
SERVER_ROUTE_OBJECT,
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
disableSpa: { type: 'boolean' },
|
|
72
|
+
},
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
},
|
|
75
|
+
else: {
|
|
76
|
+
oneOf: [
|
|
77
|
+
{ type: 'string' },
|
|
78
|
+
{
|
|
79
|
+
type: 'array',
|
|
80
|
+
items: { type: 'string' },
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
publicRoutes: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
patternProperties: { [utils_1.ENTRY_NAME_PATTERN]: { type: ['string'] } },
|
|
90
|
+
},
|
|
91
|
+
baseUrl: {
|
|
92
|
+
oneOf: [
|
|
93
|
+
{ type: 'string' },
|
|
94
|
+
{
|
|
95
|
+
type: 'array',
|
|
96
|
+
items: [{ type: 'string' }],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
middleware: { instanceof: ['Array', 'Function'] },
|
|
101
|
+
renderHook: { instanceof: 'Function' },
|
|
102
|
+
logger: { type: ['object', 'boolean'] },
|
|
103
|
+
metrics: { type: ['object', 'boolean'] },
|
|
104
|
+
proxy: { type: 'object' },
|
|
105
|
+
enableMicroFrontendDebug: { type: 'boolean' },
|
|
106
|
+
},
|
|
107
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const source: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
properties: {
|
|
5
|
+
entries: {
|
|
6
|
+
type: string;
|
|
7
|
+
patternProperties: {
|
|
8
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
9
|
+
if: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
then: {
|
|
13
|
+
required: string[];
|
|
14
|
+
properties: {
|
|
15
|
+
entry: {
|
|
16
|
+
type: string[];
|
|
17
|
+
};
|
|
18
|
+
disableMount: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
enableFileSystemRoutes: {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
additionalProperties: boolean;
|
|
26
|
+
};
|
|
27
|
+
else: {
|
|
28
|
+
type: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
alias: {
|
|
34
|
+
typeof: string[];
|
|
35
|
+
};
|
|
36
|
+
disableDefaultEntries: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
envVars: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
globalVars: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
moduleScopes: {
|
|
46
|
+
instanceof: string[];
|
|
47
|
+
};
|
|
48
|
+
entriesDir: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
configDir: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
include: {
|
|
55
|
+
type: string[];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.source = void 0;
|
|
4
|
+
const utils_1 = require("@modern-js/utils");
|
|
5
|
+
exports.source = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
properties: {
|
|
9
|
+
entries: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
patternProperties: {
|
|
12
|
+
[utils_1.ENTRY_NAME_PATTERN]: {
|
|
13
|
+
if: { type: 'object' },
|
|
14
|
+
then: {
|
|
15
|
+
required: ['entry'],
|
|
16
|
+
properties: {
|
|
17
|
+
entry: { type: ['string', 'array'] },
|
|
18
|
+
disableMount: { type: 'boolean' },
|
|
19
|
+
enableFileSystemRoutes: { type: 'boolean' },
|
|
20
|
+
},
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
},
|
|
23
|
+
else: { type: ['string', 'array'] },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
alias: { typeof: ['object', 'function'] },
|
|
28
|
+
disableDefaultEntries: { type: 'boolean' },
|
|
29
|
+
envVars: { type: 'array' },
|
|
30
|
+
globalVars: { type: 'object' },
|
|
31
|
+
moduleScopes: { instanceof: ['Array', 'Function'] },
|
|
32
|
+
entriesDir: { type: 'string' },
|
|
33
|
+
configDir: { type: 'string' },
|
|
34
|
+
include: { type: ['array'] },
|
|
35
|
+
},
|
|
36
|
+
};
|