@modern-js/core 1.9.2 → 1.10.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/CHANGELOG.md +15 -0
- package/compiled/ajv-keywords/index.d.ts +1 -0
- package/compiled/ajv-keywords/package.json +1 -1
- package/compiled/better-ajv-errors/index.d.ts +1 -0
- package/compiled/better-ajv-errors/package.json +1 -1
- package/compiled/v8-compile-cache/index.d.ts +1 -0
- package/compiled/v8-compile-cache/package.json +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +19 -28
- package/dist/config/types/index.d.ts +36 -36
- package/dist/index.js +55 -60
- package/dist/initWatcher.js +3 -12
- package/package.json +7 -8
- package/tsconfig.json +1 -0
- package/compiled/ajv-keywords/ajv/dist/ajv.d.ts +0 -16
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/code.d.ts +0 -40
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/index.d.ts +0 -79
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/scope.d.ts +0 -79
- package/compiled/ajv-keywords/ajv/dist/compile/errors.d.ts +0 -13
- package/compiled/ajv-keywords/ajv/dist/compile/index.d.ts +0 -80
- package/compiled/ajv-keywords/ajv/dist/compile/ref_error.d.ts +0 -6
- package/compiled/ajv-keywords/ajv/dist/compile/resolve.d.ts +0 -12
- package/compiled/ajv-keywords/ajv/dist/compile/rules.d.ts +0 -28
- package/compiled/ajv-keywords/ajv/dist/compile/util.d.ts +0 -40
- package/compiled/ajv-keywords/ajv/dist/compile/validate/index.d.ts +0 -42
- package/compiled/ajv-keywords/ajv/dist/compile/validate/subschema.d.ts +0 -47
- package/compiled/ajv-keywords/ajv/dist/core.d.ts +0 -173
- package/compiled/ajv-keywords/ajv/dist/runtime/validation_error.d.ts +0 -7
- package/compiled/ajv-keywords/ajv/dist/types/index.d.ts +0 -183
- package/compiled/ajv-keywords/ajv/dist/types/json-schema.d.ts +0 -124
- package/compiled/ajv-keywords/ajv/dist/types/jtd-schema.d.ts +0 -169
- package/compiled/ajv-keywords/dist/index.d.ts +0 -4
- package/compiled/ajv-keywords/uri-js/dist/es5/uri.all.d.ts +0 -59
- package/compiled/better-ajv-errors/ajv/dist/ajv.d.ts +0 -16
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/code.d.ts +0 -40
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/index.d.ts +0 -79
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/scope.d.ts +0 -79
- package/compiled/better-ajv-errors/ajv/dist/compile/errors.d.ts +0 -13
- package/compiled/better-ajv-errors/ajv/dist/compile/index.d.ts +0 -80
- package/compiled/better-ajv-errors/ajv/dist/compile/ref_error.d.ts +0 -6
- package/compiled/better-ajv-errors/ajv/dist/compile/resolve.d.ts +0 -12
- package/compiled/better-ajv-errors/ajv/dist/compile/rules.d.ts +0 -28
- package/compiled/better-ajv-errors/ajv/dist/compile/util.d.ts +0 -40
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/index.d.ts +0 -42
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/subschema.d.ts +0 -47
- package/compiled/better-ajv-errors/ajv/dist/core.d.ts +0 -173
- package/compiled/better-ajv-errors/ajv/dist/runtime/validation_error.d.ts +0 -7
- package/compiled/better-ajv-errors/ajv/dist/types/index.d.ts +0 -183
- package/compiled/better-ajv-errors/ajv/dist/types/json-schema.d.ts +0 -124
- package/compiled/better-ajv-errors/ajv/dist/types/jtd-schema.d.ts +0 -169
- package/compiled/better-ajv-errors/typings.d.ts +0 -24
- package/compiled/better-ajv-errors/uri-js/dist/es5/uri.all.d.ts +0 -59
- 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/index.d.ts +0 -12
- 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/ssg.d.ts +0 -13
- package/dist/types/config/types/test.d.ts +0 -15
- package/dist/types/config/types/unbundle.d.ts +0 -28
- package/dist/types/context.d.ts +0 -47
- package/dist/types/index.d.ts +0 -64
- package/dist/types/initWatcher.d.ts +0 -3
- package/dist/types/loadEnv.d.ts +0 -1
- package/dist/types/loadPlugins.d.ts +0 -44
- package/dist/types/manager.d.ts +0 -75
- package/dist/types/pluginAPI.d.ts +0 -13
- package/dist/types/utils/commander.d.ts +0 -4
- package/dist/types/utils/repeatKeyWarning.d.ts +0 -3
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
|
-
import { loadConfig } from '@modern-js/load-config';
|
|
8
|
-
import Ajv from 'ajv';
|
|
9
|
-
import ajvKeywords from 'ajv-keywords';
|
|
10
|
-
import { signale as logger, createDebugger, getPort, isDev, PLUGIN_SCHEMAS, chalk, getServerConfig } from '@modern-js/utils';
|
|
11
|
-
import { mergeWith } from '@modern-js/utils/lodash';
|
|
12
|
-
import betterAjvErrors from 'better-ajv-errors';
|
|
13
|
-
import { codeFrameColumns } from '@babel/code-frame';
|
|
14
|
-
import { repeatKeyWarning } from "../utils/repeatKeyWarning";
|
|
15
|
-
import { defaults } from "./defaults";
|
|
16
|
-
import { mergeConfig } from "./mergeConfig";
|
|
17
|
-
import { patchSchema } from "./schema";
|
|
18
|
-
const debug = createDebugger('resolve-config');
|
|
19
|
-
export { defaults as defaultsConfig };
|
|
20
|
-
export { mergeConfig };
|
|
21
|
-
export * from "./types";
|
|
22
|
-
export const addServerConfigToDeps = async (dependencies, appDirectory, serverConfigFile) => {
|
|
23
|
-
const serverConfig = await getServerConfig(appDirectory, serverConfigFile);
|
|
24
|
-
|
|
25
|
-
if (serverConfig) {
|
|
26
|
-
dependencies.push(serverConfig);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export const defineConfig = config => config;
|
|
30
|
-
export const loadUserConfig = async (appDirectory, filePath, packageJsonConfig) => {
|
|
31
|
-
const loaded = await loadConfig(appDirectory, filePath, packageJsonConfig);
|
|
32
|
-
const config = !loaded ? {} : await (typeof loaded.config === 'function' ? loaded.config(0) : loaded.config);
|
|
33
|
-
return {
|
|
34
|
-
config: mergeWith({}, config || {}, (loaded === null || loaded === void 0 ? void 0 : loaded.pkgConfig) || {}),
|
|
35
|
-
jsConfig: config || {},
|
|
36
|
-
pkgConfig: (loaded === null || loaded === void 0 ? void 0 : loaded.pkgConfig) || {},
|
|
37
|
-
filePath: loaded === null || loaded === void 0 ? void 0 : loaded.path,
|
|
38
|
-
dependencies: (loaded === null || loaded === void 0 ? void 0 : loaded.dependencies) || []
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const showAdditionalPropertiesError = error => {
|
|
43
|
-
if (error.keyword === 'additionalProperties' && error.params.additionalProperty) {
|
|
44
|
-
const target = [error.instancePath.slice(1), error.params.additionalProperty].filter(Boolean).join('.');
|
|
45
|
-
const name = Object.keys(PLUGIN_SCHEMAS).find(key => PLUGIN_SCHEMAS[key].some(schemaItem => schemaItem.target === target));
|
|
46
|
-
|
|
47
|
-
if (name) {
|
|
48
|
-
logger.warn(`The configuration of ${chalk.bold(target)} is provided by plugin ${chalk.bold(name)}. Please use ${chalk.bold('yarn new')} to enable the corresponding capability.\n`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const resolveConfig = async (loaded, configs, schemas, restartWithExistingPort, argv, onSchemaError = showAdditionalPropertiesError) => {
|
|
54
|
-
var _validate$errors;
|
|
55
|
-
|
|
56
|
-
const {
|
|
57
|
-
config: userConfig,
|
|
58
|
-
jsConfig,
|
|
59
|
-
pkgConfig
|
|
60
|
-
} = loaded;
|
|
61
|
-
const ajv = new Ajv({
|
|
62
|
-
$data: true,
|
|
63
|
-
strict: false
|
|
64
|
-
});
|
|
65
|
-
ajvKeywords(ajv);
|
|
66
|
-
const validateSchema = patchSchema(schemas);
|
|
67
|
-
const validate = ajv.compile(validateSchema);
|
|
68
|
-
repeatKeyWarning(validateSchema, jsConfig, pkgConfig); // validate user config.
|
|
69
|
-
|
|
70
|
-
const valid = validate(userConfig);
|
|
71
|
-
|
|
72
|
-
if (!valid && (_validate$errors = validate.errors) !== null && _validate$errors !== void 0 && _validate$errors.length) {
|
|
73
|
-
var _validate$errors2;
|
|
74
|
-
|
|
75
|
-
onSchemaError(validate === null || validate === void 0 ? void 0 : validate.errors[0]);
|
|
76
|
-
const errors = betterAjvErrors(validateSchema, userConfig, (_validate$errors2 = validate.errors) === null || _validate$errors2 === void 0 ? void 0 : _validate$errors2.map(e => _objectSpread(_objectSpread({}, e), {}, {
|
|
77
|
-
dataPath: e.instancePath
|
|
78
|
-
})), {
|
|
79
|
-
format: 'js',
|
|
80
|
-
indent: 2
|
|
81
|
-
});
|
|
82
|
-
logger.log(codeFrameColumns(JSON.stringify(userConfig, null, 2), {
|
|
83
|
-
start: errors === null || errors === void 0 ? void 0 : errors[0].start,
|
|
84
|
-
end: errors === null || errors === void 0 ? void 0 : errors[0].end
|
|
85
|
-
}, {
|
|
86
|
-
highlightCode: true,
|
|
87
|
-
message: errors === null || errors === void 0 ? void 0 : errors[0].error
|
|
88
|
-
}));
|
|
89
|
-
throw new Error(`Validate configuration error`);
|
|
90
|
-
} // validate config from plugins.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
for (const config of configs) {
|
|
94
|
-
if (!validate(config)) {
|
|
95
|
-
logger.error(validate.errors);
|
|
96
|
-
throw new Error(`Validate configuration error.`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const resolved = mergeConfig([defaults, ...configs, userConfig]);
|
|
101
|
-
resolved._raw = loaded.config;
|
|
102
|
-
|
|
103
|
-
if (isDev() && argv[0] === 'dev') {
|
|
104
|
-
if (restartWithExistingPort > 0) {
|
|
105
|
-
// dev server is restarted, should use existing port number
|
|
106
|
-
resolved.server.port = restartWithExistingPort;
|
|
107
|
-
} else {
|
|
108
|
-
// get port for new dev server
|
|
109
|
-
resolved.server.port = await getPort(resolved.server.port);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
debug('resolved %o', resolved);
|
|
114
|
-
return resolved;
|
|
115
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { mergeWith } from '@modern-js/utils/lodash';
|
|
2
|
-
import { isFunction } from '@modern-js/utils';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* merge configuration from modern.config.js and plugins.
|
|
6
|
-
*
|
|
7
|
-
* @param configs - Configuration from modern.config.ts or plugin's config hook.
|
|
8
|
-
* @returns - normalized user config.
|
|
9
|
-
*/
|
|
10
|
-
export const mergeConfig = configs => mergeWith({}, ...configs, (target, source) => {
|
|
11
|
-
if (Array.isArray(target)) {
|
|
12
|
-
if (Array.isArray(source)) {
|
|
13
|
-
return [...target, ...source];
|
|
14
|
-
} else {
|
|
15
|
-
return typeof source !== 'undefined' ? [...target, source] : target;
|
|
16
|
-
}
|
|
17
|
-
} else if (isFunction(source)) {
|
|
18
|
-
return typeof target !== 'undefined' ? [target, source] : [source];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return undefined;
|
|
22
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ENTRY_NAME_PATTERN } from '@modern-js/utils';
|
|
2
|
-
export const deploy = {
|
|
3
|
-
type: 'object',
|
|
4
|
-
properties: {
|
|
5
|
-
domain: {
|
|
6
|
-
type: ['array', 'string']
|
|
7
|
-
},
|
|
8
|
-
domainByEntries: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
patternProperties: {
|
|
11
|
-
[ENTRY_NAME_PATTERN]: {
|
|
12
|
-
type: ['array', 'string']
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { isObject, createDebugger } from '@modern-js/utils';
|
|
2
|
-
import { cloneDeep } from '@modern-js/utils/lodash';
|
|
3
|
-
import { source } from "./source";
|
|
4
|
-
import { output } from "./output";
|
|
5
|
-
import { server } from "./server";
|
|
6
|
-
import { deploy } from "./deploy";
|
|
7
|
-
import { tools } from "./tools";
|
|
8
|
-
const debug = createDebugger('validate-schema');
|
|
9
|
-
const plugins = {
|
|
10
|
-
type: 'array',
|
|
11
|
-
additionalProperties: false
|
|
12
|
-
};
|
|
13
|
-
const dev = {
|
|
14
|
-
type: 'object',
|
|
15
|
-
properties: {
|
|
16
|
-
assetPrefix: {
|
|
17
|
-
type: ['boolean', 'string']
|
|
18
|
-
},
|
|
19
|
-
https: {
|
|
20
|
-
type: 'boolean'
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
additionalProperties: false
|
|
24
|
-
};
|
|
25
|
-
export const patchSchema = pluginSchemas => {
|
|
26
|
-
const finalSchema = cloneDeep({
|
|
27
|
-
type: 'object',
|
|
28
|
-
additionalProperties: false,
|
|
29
|
-
properties: {
|
|
30
|
-
source,
|
|
31
|
-
output,
|
|
32
|
-
server,
|
|
33
|
-
deploy,
|
|
34
|
-
plugins,
|
|
35
|
-
dev,
|
|
36
|
-
tools
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const findTargetNode = props => {
|
|
41
|
-
let node = finalSchema.properties;
|
|
42
|
-
|
|
43
|
-
for (const prop of props) {
|
|
44
|
-
node = node[prop];
|
|
45
|
-
|
|
46
|
-
if (!node || !isObject(node)) {
|
|
47
|
-
throw new Error(`add schema ${props.join('.')} error`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
node.properties = node.hasOwnProperty('properties') ? node.properties : {};
|
|
51
|
-
node = node.properties;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return node;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const finalPluginSchemas = [];
|
|
58
|
-
pluginSchemas.forEach(item => {
|
|
59
|
-
if (Array.isArray(item)) {
|
|
60
|
-
finalPluginSchemas.push(...item);
|
|
61
|
-
} else {
|
|
62
|
-
finalPluginSchemas.push(item);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
for (const {
|
|
67
|
-
target,
|
|
68
|
-
schema
|
|
69
|
-
} of finalPluginSchemas) {
|
|
70
|
-
if (!target) {
|
|
71
|
-
throw new Error(`should return target property in plugin schema.`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const props = target.split('.');
|
|
75
|
-
const mountProperty = props.pop();
|
|
76
|
-
const targetNode = findTargetNode(props);
|
|
77
|
-
|
|
78
|
-
if (targetNode.hasOwnProperty(mountProperty)) {
|
|
79
|
-
throw new Error(`${target} already exists in current validate schema`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
targetNode[mountProperty] = cloneDeep(schema);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
debug(`final validate schema: %o`, finalSchema);
|
|
86
|
-
return finalSchema;
|
|
87
|
-
};
|
|
88
|
-
export const traverseSchema = schema => {
|
|
89
|
-
const keys = [];
|
|
90
|
-
|
|
91
|
-
const traverse = ({
|
|
92
|
-
properties
|
|
93
|
-
}, old = []) => {
|
|
94
|
-
for (const key of Object.keys(properties)) {
|
|
95
|
-
const current = [...old, key];
|
|
96
|
-
|
|
97
|
-
if (properties[key].type === 'object' && properties[key].properties) {
|
|
98
|
-
traverse(properties[key], current);
|
|
99
|
-
} else {
|
|
100
|
-
keys.push(current.join('.'));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
traverse(schema);
|
|
106
|
-
return keys;
|
|
107
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { ENTRY_NAME_PATTERN } from '@modern-js/utils';
|
|
2
|
-
export const output = {
|
|
3
|
-
type: 'object',
|
|
4
|
-
additionalProperties: false,
|
|
5
|
-
properties: {
|
|
6
|
-
assetPrefix: {
|
|
7
|
-
type: 'string'
|
|
8
|
-
},
|
|
9
|
-
path: {
|
|
10
|
-
type: 'string'
|
|
11
|
-
},
|
|
12
|
-
jsPath: {
|
|
13
|
-
type: 'string'
|
|
14
|
-
},
|
|
15
|
-
cssPath: {
|
|
16
|
-
type: 'string'
|
|
17
|
-
},
|
|
18
|
-
htmlPath: {
|
|
19
|
-
type: 'string'
|
|
20
|
-
},
|
|
21
|
-
mediaPath: {
|
|
22
|
-
type: 'string'
|
|
23
|
-
},
|
|
24
|
-
mountId: {
|
|
25
|
-
type: 'string'
|
|
26
|
-
},
|
|
27
|
-
favicon: {
|
|
28
|
-
type: 'string'
|
|
29
|
-
},
|
|
30
|
-
faviconByEntries: {
|
|
31
|
-
type: 'object',
|
|
32
|
-
patternProperties: {
|
|
33
|
-
[ENTRY_NAME_PATTERN]: {
|
|
34
|
-
type: 'string'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
title: {
|
|
39
|
-
type: 'string'
|
|
40
|
-
},
|
|
41
|
-
titleByEntries: {
|
|
42
|
-
type: 'object',
|
|
43
|
-
patternProperties: {
|
|
44
|
-
[ENTRY_NAME_PATTERN]: {
|
|
45
|
-
type: 'string'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
meta: {
|
|
50
|
-
type: 'object'
|
|
51
|
-
},
|
|
52
|
-
metaByEntries: {
|
|
53
|
-
type: 'object',
|
|
54
|
-
patternProperties: {
|
|
55
|
-
[ENTRY_NAME_PATTERN]: {
|
|
56
|
-
type: 'object'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
inject: {
|
|
61
|
-
enum: [true, 'head', 'body', false]
|
|
62
|
-
},
|
|
63
|
-
injectByEntries: {
|
|
64
|
-
type: 'object',
|
|
65
|
-
patternProperties: {
|
|
66
|
-
[ENTRY_NAME_PATTERN]: {
|
|
67
|
-
enum: [true, 'head', 'body', false]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
copy: {
|
|
72
|
-
type: 'array'
|
|
73
|
-
},
|
|
74
|
-
scriptExt: {
|
|
75
|
-
type: 'object'
|
|
76
|
-
},
|
|
77
|
-
disableTsChecker: {
|
|
78
|
-
type: 'boolean'
|
|
79
|
-
},
|
|
80
|
-
disableHtmlFolder: {
|
|
81
|
-
type: 'boolean'
|
|
82
|
-
},
|
|
83
|
-
disableCssModuleExtension: {
|
|
84
|
-
type: 'boolean'
|
|
85
|
-
},
|
|
86
|
-
disableCssExtract: {
|
|
87
|
-
type: 'boolean'
|
|
88
|
-
},
|
|
89
|
-
enableCssModuleTSDeclaration: {
|
|
90
|
-
type: 'boolean'
|
|
91
|
-
},
|
|
92
|
-
disableMinimize: {
|
|
93
|
-
type: 'boolean'
|
|
94
|
-
},
|
|
95
|
-
enableInlineStyles: {
|
|
96
|
-
type: 'boolean'
|
|
97
|
-
},
|
|
98
|
-
enableInlineScripts: {
|
|
99
|
-
type: 'boolean'
|
|
100
|
-
},
|
|
101
|
-
disableSourceMap: {
|
|
102
|
-
type: 'boolean'
|
|
103
|
-
},
|
|
104
|
-
disableInlineRuntimeChunk: {
|
|
105
|
-
type: 'boolean'
|
|
106
|
-
},
|
|
107
|
-
disableAssetsCache: {
|
|
108
|
-
type: 'boolean'
|
|
109
|
-
},
|
|
110
|
-
enableLatestDecorators: {
|
|
111
|
-
type: 'boolean'
|
|
112
|
-
},
|
|
113
|
-
enableTsLoader: {
|
|
114
|
-
type: 'boolean'
|
|
115
|
-
},
|
|
116
|
-
dataUriLimit: {
|
|
117
|
-
type: 'number'
|
|
118
|
-
},
|
|
119
|
-
templateParameters: {
|
|
120
|
-
type: 'object'
|
|
121
|
-
},
|
|
122
|
-
templateParametersByEntries: {
|
|
123
|
-
type: 'object',
|
|
124
|
-
patternProperties: {
|
|
125
|
-
[ENTRY_NAME_PATTERN]: {
|
|
126
|
-
type: 'object'
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
polyfill: {
|
|
131
|
-
type: 'string',
|
|
132
|
-
enum: ['usage', 'entry', 'off', 'ua']
|
|
133
|
-
},
|
|
134
|
-
cssModuleLocalIdentName: {
|
|
135
|
-
type: 'string'
|
|
136
|
-
},
|
|
137
|
-
federation: {
|
|
138
|
-
type: 'object'
|
|
139
|
-
},
|
|
140
|
-
disableNodePolyfill: {
|
|
141
|
-
type: 'boolean'
|
|
142
|
-
},
|
|
143
|
-
enableModernMode: {
|
|
144
|
-
type: 'boolean'
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
};
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { ENTRY_NAME_PATTERN } from '@modern-js/utils';
|
|
2
|
-
const SERVER_ROUTE_OBJECT = {
|
|
3
|
-
type: 'object',
|
|
4
|
-
properties: {
|
|
5
|
-
path: {
|
|
6
|
-
type: 'string'
|
|
7
|
-
},
|
|
8
|
-
headers: {
|
|
9
|
-
type: 'object'
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
additionalProperties: false
|
|
13
|
-
};
|
|
14
|
-
export const server = {
|
|
15
|
-
type: 'object',
|
|
16
|
-
additionalProperties: false,
|
|
17
|
-
properties: {
|
|
18
|
-
port: {
|
|
19
|
-
type: 'number'
|
|
20
|
-
},
|
|
21
|
-
ssr: {
|
|
22
|
-
if: {
|
|
23
|
-
type: 'object'
|
|
24
|
-
},
|
|
25
|
-
then: {
|
|
26
|
-
properties: {
|
|
27
|
-
disableLoadable: {
|
|
28
|
-
type: 'boolean'
|
|
29
|
-
},
|
|
30
|
-
disableHelmet: {
|
|
31
|
-
type: 'boolean'
|
|
32
|
-
},
|
|
33
|
-
disableRedirect: {
|
|
34
|
-
type: 'boolean'
|
|
35
|
-
},
|
|
36
|
-
enableAsyncData: {
|
|
37
|
-
type: 'boolean'
|
|
38
|
-
},
|
|
39
|
-
enableProductWarning: {
|
|
40
|
-
type: 'boolean'
|
|
41
|
-
},
|
|
42
|
-
timeout: {
|
|
43
|
-
type: 'number'
|
|
44
|
-
},
|
|
45
|
-
asyncDataTimeout: {
|
|
46
|
-
type: 'number'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
else: {
|
|
51
|
-
type: 'boolean'
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
ssrByEntries: {
|
|
55
|
-
type: 'object',
|
|
56
|
-
patternProperties: {
|
|
57
|
-
[ENTRY_NAME_PATTERN]: {
|
|
58
|
-
if: {
|
|
59
|
-
type: 'object'
|
|
60
|
-
},
|
|
61
|
-
then: {
|
|
62
|
-
properties: {
|
|
63
|
-
disableLoadable: {
|
|
64
|
-
type: 'boolean'
|
|
65
|
-
},
|
|
66
|
-
disableHelmet: {
|
|
67
|
-
type: 'boolean'
|
|
68
|
-
},
|
|
69
|
-
disableRedirect: {
|
|
70
|
-
type: 'boolean'
|
|
71
|
-
},
|
|
72
|
-
enableProductWarning: {
|
|
73
|
-
type: 'boolean'
|
|
74
|
-
},
|
|
75
|
-
enableAsyncData: {
|
|
76
|
-
type: 'boolean'
|
|
77
|
-
},
|
|
78
|
-
timeout: {
|
|
79
|
-
type: 'number'
|
|
80
|
-
},
|
|
81
|
-
asyncDataTimeout: {
|
|
82
|
-
type: 'number'
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
additionalProperties: false
|
|
86
|
-
},
|
|
87
|
-
else: {
|
|
88
|
-
type: 'boolean'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
routes: {
|
|
94
|
-
type: 'object',
|
|
95
|
-
patternProperties: {
|
|
96
|
-
[ENTRY_NAME_PATTERN]: {
|
|
97
|
-
if: {
|
|
98
|
-
type: 'object'
|
|
99
|
-
},
|
|
100
|
-
then: {
|
|
101
|
-
properties: {
|
|
102
|
-
route: {
|
|
103
|
-
oneOf: [{
|
|
104
|
-
type: 'string'
|
|
105
|
-
}, {
|
|
106
|
-
type: 'array',
|
|
107
|
-
items: {
|
|
108
|
-
oneOf: [{
|
|
109
|
-
type: 'string'
|
|
110
|
-
}, SERVER_ROUTE_OBJECT]
|
|
111
|
-
}
|
|
112
|
-
}, SERVER_ROUTE_OBJECT]
|
|
113
|
-
},
|
|
114
|
-
disableSpa: {
|
|
115
|
-
type: 'boolean'
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
additionalProperties: false
|
|
119
|
-
},
|
|
120
|
-
else: {
|
|
121
|
-
oneOf: [{
|
|
122
|
-
type: 'string'
|
|
123
|
-
}, {
|
|
124
|
-
type: 'array',
|
|
125
|
-
items: {
|
|
126
|
-
type: 'string'
|
|
127
|
-
}
|
|
128
|
-
}]
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
publicRoutes: {
|
|
134
|
-
type: 'object',
|
|
135
|
-
patternProperties: {
|
|
136
|
-
[ENTRY_NAME_PATTERN]: {
|
|
137
|
-
type: ['string']
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
baseUrl: {
|
|
142
|
-
oneOf: [{
|
|
143
|
-
type: 'string'
|
|
144
|
-
}, {
|
|
145
|
-
type: 'array',
|
|
146
|
-
items: [{
|
|
147
|
-
type: 'string'
|
|
148
|
-
}]
|
|
149
|
-
}]
|
|
150
|
-
},
|
|
151
|
-
middleware: {
|
|
152
|
-
instanceof: ['Array', 'Function']
|
|
153
|
-
},
|
|
154
|
-
renderHook: {
|
|
155
|
-
instanceof: 'Function'
|
|
156
|
-
},
|
|
157
|
-
logger: {
|
|
158
|
-
type: ['object', 'boolean']
|
|
159
|
-
},
|
|
160
|
-
metrics: {
|
|
161
|
-
type: ['object', 'boolean']
|
|
162
|
-
},
|
|
163
|
-
proxy: {
|
|
164
|
-
type: 'object'
|
|
165
|
-
},
|
|
166
|
-
enableMicroFrontendDebug: {
|
|
167
|
-
type: 'boolean'
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ENTRY_NAME_PATTERN } from '@modern-js/utils';
|
|
2
|
-
export const source = {
|
|
3
|
-
type: 'object',
|
|
4
|
-
additionalProperties: false,
|
|
5
|
-
properties: {
|
|
6
|
-
entries: {
|
|
7
|
-
type: 'object',
|
|
8
|
-
patternProperties: {
|
|
9
|
-
[ENTRY_NAME_PATTERN]: {
|
|
10
|
-
if: {
|
|
11
|
-
type: 'object'
|
|
12
|
-
},
|
|
13
|
-
then: {
|
|
14
|
-
required: ['entry'],
|
|
15
|
-
properties: {
|
|
16
|
-
entry: {
|
|
17
|
-
type: ['string', 'array']
|
|
18
|
-
},
|
|
19
|
-
disableMount: {
|
|
20
|
-
type: 'boolean'
|
|
21
|
-
},
|
|
22
|
-
enableFileSystemRoutes: {
|
|
23
|
-
type: 'boolean'
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
additionalProperties: false
|
|
27
|
-
},
|
|
28
|
-
else: {
|
|
29
|
-
type: ['string', 'array']
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
alias: {
|
|
35
|
-
typeof: ['object', 'function']
|
|
36
|
-
},
|
|
37
|
-
disableDefaultEntries: {
|
|
38
|
-
type: 'boolean'
|
|
39
|
-
},
|
|
40
|
-
envVars: {
|
|
41
|
-
type: 'array'
|
|
42
|
-
},
|
|
43
|
-
globalVars: {
|
|
44
|
-
type: 'object'
|
|
45
|
-
},
|
|
46
|
-
moduleScopes: {
|
|
47
|
-
instanceof: ['Array', 'Function']
|
|
48
|
-
},
|
|
49
|
-
entriesDir: {
|
|
50
|
-
type: 'string'
|
|
51
|
-
},
|
|
52
|
-
configDir: {
|
|
53
|
-
type: 'string'
|
|
54
|
-
},
|
|
55
|
-
include: {
|
|
56
|
-
type: ['array']
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const tools = {
|
|
2
|
-
type: 'object',
|
|
3
|
-
additionalProperties: false,
|
|
4
|
-
properties: {
|
|
5
|
-
webpack: {
|
|
6
|
-
typeof: ['object', 'function']
|
|
7
|
-
},
|
|
8
|
-
babel: {
|
|
9
|
-
typeof: ['object', 'function']
|
|
10
|
-
},
|
|
11
|
-
postcss: {
|
|
12
|
-
typeof: ['object', 'function']
|
|
13
|
-
},
|
|
14
|
-
lodash: {
|
|
15
|
-
typeof: ['object', 'function']
|
|
16
|
-
},
|
|
17
|
-
devServer: {
|
|
18
|
-
type: 'object'
|
|
19
|
-
},
|
|
20
|
-
tsLoader: {
|
|
21
|
-
typeof: ['object', 'function']
|
|
22
|
-
},
|
|
23
|
-
autoprefixer: {
|
|
24
|
-
typeof: ['object', 'function']
|
|
25
|
-
},
|
|
26
|
-
terser: {
|
|
27
|
-
typeof: ['object', 'function']
|
|
28
|
-
},
|
|
29
|
-
minifyCss: {
|
|
30
|
-
typeof: ['object', 'function']
|
|
31
|
-
},
|
|
32
|
-
styledComponents: {
|
|
33
|
-
typeof: ['object', 'function']
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|