@modern-js/core 0.0.0-windows-20211056953 → 0.0.1-20221226

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 (130) hide show
  1. package/CHANGELOG.md +1164 -6
  2. package/dist/bin.d.ts +2 -0
  3. package/dist/bin.js +5 -0
  4. package/dist/config/createDefaultConfig.d.ts +2 -0
  5. package/dist/config/createDefaultConfig.js +9 -0
  6. package/dist/config/createLoadedConfig.d.ts +6 -0
  7. package/dist/config/createLoadedConfig.js +35 -0
  8. package/dist/config/createResolvedConfig.d.ts +3 -0
  9. package/dist/config/createResolvedConfig.js +92 -0
  10. package/dist/config/index.d.ts +3 -0
  11. package/dist/config/index.js +19 -0
  12. package/dist/context.d.ts +35 -0
  13. package/dist/context.js +61 -0
  14. package/dist/index.d.ts +73 -0
  15. package/dist/index.js +150 -0
  16. package/dist/load-configs/index.d.ts +34 -0
  17. package/dist/load-configs/index.js +124 -0
  18. package/dist/{types/loadEnv.d.ts → loadEnv.d.ts} +1 -1
  19. package/dist/loadEnv.js +21 -0
  20. package/dist/loadPlugins.d.ts +18 -0
  21. package/dist/loadPlugins.js +65 -0
  22. package/dist/manager.d.ts +87 -0
  23. package/dist/manager.js +24 -0
  24. package/dist/runBin.d.ts +5 -0
  25. package/dist/runBin.js +51 -0
  26. package/dist/schema/patchSchema.d.ts +19 -0
  27. package/dist/schema/patchSchema.js +57 -0
  28. package/dist/schema/source.d.ts +9 -0
  29. package/dist/schema/source.js +10 -0
  30. package/dist/schema/testing.d.ts +13 -0
  31. package/dist/schema/testing.js +11 -0
  32. package/dist/schema/traverseSchema.d.ts +2 -0
  33. package/dist/schema/traverseSchema.js +20 -0
  34. package/dist/types/config/index.d.ts +49 -125
  35. package/dist/types/config/index.js +2 -0
  36. package/dist/types/config/testing.d.ts +15 -0
  37. package/dist/types/config/testing.js +2 -0
  38. package/dist/types/context.d.ts +28 -14
  39. package/dist/types/context.js +2 -0
  40. package/dist/types/hooks.d.ts +44 -0
  41. package/dist/types/hooks.js +2 -0
  42. package/dist/types/index.d.ts +9 -87
  43. package/dist/types/index.js +21 -0
  44. package/dist/types/plugin.d.ts +26 -0
  45. package/dist/types/plugin.js +2 -0
  46. package/dist/types/pluginAPI.d.ts +18 -0
  47. package/dist/types/pluginAPI.js +2 -0
  48. package/dist/utils/commander.d.ts +4 -0
  49. package/dist/utils/commander.js +20 -0
  50. package/dist/utils/mergeConfig.d.ts +2 -0
  51. package/dist/utils/mergeConfig.js +32 -0
  52. package/dist/utils/repeatKeyWarning.d.ts +3 -0
  53. package/dist/utils/repeatKeyWarning.js +22 -0
  54. package/package.json +52 -48
  55. package/bin/modern-js.js +0 -18
  56. package/dist/js/modern/config/defaults.js +0 -100
  57. package/dist/js/modern/config/index.js +0 -104
  58. package/dist/js/modern/config/mergeConfig.js +0 -20
  59. package/dist/js/modern/config/schema/deploy.js +0 -20
  60. package/dist/js/modern/config/schema/index.js +0 -107
  61. package/dist/js/modern/config/schema/output.js +0 -147
  62. package/dist/js/modern/config/schema/server.js +0 -170
  63. package/dist/js/modern/config/schema/source.js +0 -59
  64. package/dist/js/modern/config/schema/tools.js +0 -33
  65. package/dist/js/modern/context.js +0 -25
  66. package/dist/js/modern/index.js +0 -142
  67. package/dist/js/modern/initWatcher.js +0 -46
  68. package/dist/js/modern/loadEnv.js +0 -12
  69. package/dist/js/modern/loadPlugins.js +0 -66
  70. package/dist/js/modern/utils/commander.js +0 -19
  71. package/dist/js/modern/utils/repeatKeyWarning.js +0 -18
  72. package/dist/js/node/config/defaults.js +0 -107
  73. package/dist/js/node/config/index.js +0 -142
  74. package/dist/js/node/config/mergeConfig.js +0 -32
  75. package/dist/js/node/config/schema/deploy.js +0 -29
  76. package/dist/js/node/config/schema/index.js +0 -129
  77. package/dist/js/node/config/schema/output.js +0 -156
  78. package/dist/js/node/config/schema/server.js +0 -179
  79. package/dist/js/node/config/schema/source.js +0 -68
  80. package/dist/js/node/config/schema/tools.js +0 -40
  81. package/dist/js/node/context.js +0 -52
  82. package/dist/js/node/index.js +0 -247
  83. package/dist/js/node/initWatcher.js +0 -67
  84. package/dist/js/node/loadEnv.js +0 -28
  85. package/dist/js/node/loadPlugins.js +0 -76
  86. package/dist/js/node/utils/commander.js +0 -35
  87. package/dist/js/node/utils/repeatKeyWarning.js +0 -31
  88. package/dist/types/config/defaults.d.ts +0 -25
  89. package/dist/types/config/mergeConfig.d.ts +0 -29
  90. package/dist/types/config/schema/deploy.d.ts +0 -19
  91. package/dist/types/config/schema/index.d.ts +0 -466
  92. package/dist/types/config/schema/output.d.ts +0 -146
  93. package/dist/types/config/schema/server.d.ts +0 -182
  94. package/dist/types/config/schema/source.d.ts +0 -58
  95. package/dist/types/config/schema/tools.d.ts +0 -33
  96. package/dist/types/initWatcher.d.ts +0 -3
  97. package/dist/types/loadPlugins.d.ts +0 -16
  98. package/dist/types/utils/commander.d.ts +0 -7
  99. package/dist/types/utils/repeatKeyWarning.d.ts +0 -3
  100. package/modern.config.js +0 -13
  101. package/src/config/defaults.ts +0 -101
  102. package/src/config/index.ts +0 -296
  103. package/src/config/mergeConfig.ts +0 -68
  104. package/src/config/schema/deploy.ts +0 -17
  105. package/src/config/schema/index.ts +0 -116
  106. package/src/config/schema/output.ts +0 -66
  107. package/src/config/schema/server.ts +0 -106
  108. package/src/config/schema/source.ts +0 -34
  109. package/src/config/schema/tools.ts +0 -15
  110. package/src/context.ts +0 -46
  111. package/src/index.ts +0 -247
  112. package/src/initWatcher.ts +0 -77
  113. package/src/loadEnv.ts +0 -21
  114. package/src/loadPlugins.ts +0 -81
  115. package/src/types.d.ts +0 -0
  116. package/src/utils/commander.ts +0 -22
  117. package/src/utils/repeatKeyWarning.ts +0 -29
  118. package/tests/.eslintrc.js +0 -6
  119. package/tests/fixtures/load-plugin/not-found/package.json +0 -3
  120. package/tests/fixtures/load-plugin/not-found/test-plugin-a.js +0 -1
  121. package/tests/fixtures/load-plugin/user-plugins/package.json +0 -3
  122. package/tests/fixtures/load-plugin/user-plugins/test-plugin-a.js +0 -1
  123. package/tests/fixtures/load-plugin/user-plugins/test-plugin-b.js +0 -3
  124. package/tests/loadEnv.test.ts +0 -100
  125. package/tests/loadPlugin.test.ts +0 -29
  126. package/tests/mergeConfig.test.ts +0 -78
  127. package/tests/repeatKeyWarning.test.ts +0 -68
  128. package/tests/schema.test.ts +0 -109
  129. package/tests/tsconfig.json +0 -13
  130. package/tsconfig.json +0 -14
@@ -1,142 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "defaultsConfig", {
7
- enumerable: true,
8
- get: function () {
9
- return _defaults.defaults;
10
- }
11
- });
12
- exports.resolveConfig = exports.loadUserConfig = exports.defineConfig = void 0;
13
-
14
- var _loadConfig = require("@modern-js/load-config");
15
-
16
- var _ajv = _interopRequireDefault(require("ajv"));
17
-
18
- var _ajvKeywords = _interopRequireDefault(require("ajv-keywords"));
19
-
20
- var _signale = _interopRequireDefault(require("signale"));
21
-
22
- var _utils = require("@modern-js/utils");
23
-
24
- var _lodash = _interopRequireDefault(require("lodash.mergewith"));
25
-
26
- var _betterAjvErrors = _interopRequireDefault(require("better-ajv-errors"));
27
-
28
- var _codeFrame = require("@babel/code-frame");
29
-
30
- var _repeatKeyWarning = require("../utils/repeatKeyWarning");
31
-
32
- var _defaults = require("./defaults");
33
-
34
- var _mergeConfig = require("./mergeConfig");
35
-
36
- var _schema = require("./schema");
37
-
38
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
-
40
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
41
-
42
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
43
-
44
- 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; }
45
-
46
- const debug = (0, _utils.createDebugger)('resolve-config');
47
-
48
- const defineConfig = config => config;
49
-
50
- exports.defineConfig = defineConfig;
51
-
52
- const loadUserConfig = async (appDirectory, filePath) => {
53
- const loaded = await (0, _loadConfig.loadConfig)(appDirectory, filePath);
54
- const config = !loaded ? {} : await (typeof loaded.config === 'function' ? loaded.config(0) : loaded.config);
55
- return {
56
- config: (0, _lodash.default)({}, config || {}, (loaded === null || loaded === void 0 ? void 0 : loaded.pkgConfig) || {}),
57
- jsConfig: config || {},
58
- pkgConfig: (loaded === null || loaded === void 0 ? void 0 : loaded.pkgConfig) || {},
59
- filePath: loaded === null || loaded === void 0 ? void 0 : loaded.path,
60
- dependencies: (loaded === null || loaded === void 0 ? void 0 : loaded.dependencies) || []
61
- };
62
- };
63
-
64
- exports.loadUserConfig = loadUserConfig;
65
-
66
- const showAdditionalPropertiesError = error => {
67
- if (error.keyword === 'additionalProperties' && error.instancePath && error.params.additionalProperty) {
68
- const target = `${error.instancePath.substr(1)}.${error.params.additionalProperty}`;
69
- const name = Object.keys(_utils.PLUGIN_SCHEMAS).find(key => _utils.PLUGIN_SCHEMAS[key].some(schemaItem => schemaItem.target === target));
70
-
71
- if (name) {
72
- _signale.default.warn(`The configuration of ${_utils.chalk.bold(target)} is provided by plugin ${_utils.chalk.bold(name)}. Please use ${_utils.chalk.bold('yarn new')} to enable the corresponding capability.\n`);
73
- }
74
- }
75
- };
76
- /* eslint-disable max-statements, max-params */
77
-
78
-
79
- const resolveConfig = async (loaded, configs, schemas, isRestart, argv) => {
80
- var _validate$errors;
81
-
82
- const {
83
- config: userConfig,
84
- jsConfig,
85
- pkgConfig
86
- } = loaded;
87
- const ajv = new _ajv.default({
88
- $data: true,
89
- strict: false
90
- });
91
- (0, _ajvKeywords.default)(ajv);
92
- const validateSchema = (0, _schema.patchSchema)(schemas);
93
- const validate = ajv.compile(validateSchema);
94
- (0, _repeatKeyWarning.repeatKeyWarning)(validateSchema, jsConfig, pkgConfig); // validate user config.
95
-
96
- const valid = validate(userConfig);
97
-
98
- if (!valid && (_validate$errors = validate.errors) !== null && _validate$errors !== void 0 && _validate$errors.length) {
99
- var _validate$errors2;
100
-
101
- showAdditionalPropertiesError(validate === null || validate === void 0 ? void 0 : validate.errors[0]);
102
- const errors = (0, _betterAjvErrors.default)(validateSchema, userConfig, (_validate$errors2 = validate.errors) === null || _validate$errors2 === void 0 ? void 0 : _validate$errors2.map(e => _objectSpread(_objectSpread({}, e), {}, {
103
- dataPath: e.instancePath
104
- })), {
105
- format: 'js',
106
- indent: 2
107
- });
108
-
109
- _signale.default.log((0, _codeFrame.codeFrameColumns)(JSON.stringify(userConfig, null, 2), {
110
- start: errors === null || errors === void 0 ? void 0 : errors[0].start,
111
- end: errors === null || errors === void 0 ? void 0 : errors[0].end
112
- }, {
113
- highlightCode: true,
114
- message: errors === null || errors === void 0 ? void 0 : errors[0].error
115
- }));
116
-
117
- throw new Error(`Validate configuration error`);
118
- } // validate config from plugins.
119
-
120
-
121
- for (const config of configs) {
122
- if (!validate(config)) {
123
- _signale.default.error(validate.errors);
124
-
125
- throw new Error(`Validate configuration error.`);
126
- }
127
- }
128
-
129
- const resolved = (0, _mergeConfig.mergeConfig)([_defaults.defaults, ...configs, userConfig]);
130
- resolved._raw = loaded.config;
131
-
132
- if ((0, _utils.isDev)() && argv[0] === 'dev' && !isRestart) {
133
- resolved.server.port = await (0, _utils.getPort)(resolved.server.port);
134
- }
135
-
136
- debug('resolved %o', resolved);
137
- return resolved;
138
- };
139
- /* eslint-enable max-statements, max-params */
140
-
141
-
142
- exports.resolveConfig = resolveConfig;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.mergeConfig = void 0;
7
-
8
- var _lodash = _interopRequireDefault(require("lodash.mergewith"));
9
-
10
- var _utils = require("@modern-js/utils");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- /**
15
- * merge configuration from modern.config.js and plugins.
16
- *
17
- * @param configs - Configuration from modern.config.ts or plugin's config hook.
18
- * @returns - normalized user config.
19
- */
20
- const mergeConfig = configs => (0, _lodash.default)({}, ...configs, (target, source) => {
21
- if (Array.isArray(target) && Array.isArray(source)) {
22
- return [...target, ...source];
23
- }
24
-
25
- if ((0, _utils.isFunction)(source)) {
26
- return Array.isArray(target) ? [...target, source] : [target, source].filter(Boolean);
27
- }
28
-
29
- return undefined;
30
- });
31
-
32
- exports.mergeConfig = mergeConfig;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.deploy = void 0;
7
-
8
- var _utils = require("@modern-js/utils");
9
-
10
- const deploy = {
11
- type: 'object',
12
- properties: {
13
- microFrontend: {
14
- type: ['boolean', 'object']
15
- },
16
- domain: {
17
- type: ['array', 'string']
18
- },
19
- domainByEntries: {
20
- type: 'object',
21
- patternProperties: {
22
- [_utils.ENTRY_NAME_PATTERN]: {
23
- type: ['array', 'string']
24
- }
25
- }
26
- }
27
- }
28
- };
29
- exports.deploy = deploy;
@@ -1,129 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.traverseSchema = exports.patchSchema = void 0;
7
-
8
- var _utils = require("@modern-js/utils");
9
-
10
- var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
11
-
12
- var _source = require("./source");
13
-
14
- var _output = require("./output");
15
-
16
- var _server = require("./server");
17
-
18
- var _deploy = require("./deploy");
19
-
20
- var _tools = require("./tools");
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
- const debug = (0, _utils.createDebugger)('validate-schema');
25
- const plugins = {
26
- type: 'array',
27
- additionalProperties: false
28
- };
29
- const dev = {
30
- type: 'object',
31
- properties: {
32
- assetPrefix: {
33
- type: ['boolean', 'string']
34
- },
35
- https: {
36
- type: 'boolean'
37
- }
38
- },
39
- additionalProperties: false
40
- };
41
-
42
- const patchSchema = pluginSchemas => {
43
- const finalSchema = (0, _lodash.default)({
44
- type: 'object',
45
- additionalProperties: false,
46
- properties: {
47
- source: _source.source,
48
- output: _output.output,
49
- server: _server.server,
50
- deploy: _deploy.deploy,
51
- plugins,
52
- dev,
53
- tools: _tools.tools
54
- }
55
- });
56
-
57
- const findTargetNode = props => {
58
- let node = finalSchema.properties;
59
-
60
- for (const prop of props) {
61
- node = node[prop];
62
-
63
- if (!node || !(0, _utils.isObject)(node)) {
64
- throw new Error(`add schema ${props.join('.')} error`);
65
- }
66
-
67
- node.properties = node.hasOwnProperty('properties') ? node.properties : {};
68
- node = node.properties;
69
- }
70
-
71
- return node;
72
- };
73
-
74
- const finalPluginSchemas = [];
75
- pluginSchemas.forEach(item => {
76
- if (Array.isArray(item)) {
77
- finalPluginSchemas.push(...item);
78
- } else {
79
- finalPluginSchemas.push(item);
80
- }
81
- });
82
-
83
- for (const {
84
- target,
85
- schema
86
- } of finalPluginSchemas) {
87
- if (!target) {
88
- throw new Error(`should return target property in plugin schema.`);
89
- }
90
-
91
- const props = target.split('.');
92
- const mountProperty = props.pop();
93
- const targetNode = findTargetNode(props);
94
-
95
- if (targetNode.hasOwnProperty(mountProperty)) {
96
- throw new Error(`${target} already exists in current validate schema`);
97
- }
98
-
99
- targetNode[mountProperty] = (0, _lodash.default)(schema);
100
- }
101
-
102
- debug(`final validate schema: %o`, finalSchema);
103
- return finalSchema;
104
- };
105
-
106
- exports.patchSchema = patchSchema;
107
-
108
- const traverseSchema = schema => {
109
- const keys = [];
110
-
111
- const traverse = ({
112
- properties
113
- }, old = []) => {
114
- for (const key of Object.keys(properties)) {
115
- const current = [...old, key];
116
-
117
- if (properties[key].type === 'object' && properties[key].properties) {
118
- traverse(properties[key], current);
119
- } else {
120
- keys.push(current.join('.'));
121
- }
122
- }
123
- };
124
-
125
- traverse(schema);
126
- return keys;
127
- };
128
-
129
- exports.traverseSchema = traverseSchema;
@@ -1,156 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.output = void 0;
7
-
8
- var _utils = require("@modern-js/utils");
9
-
10
- const output = {
11
- type: 'object',
12
- additionalProperties: false,
13
- properties: {
14
- assetPrefix: {
15
- type: 'string'
16
- },
17
- path: {
18
- type: 'string'
19
- },
20
- jsPath: {
21
- type: 'string'
22
- },
23
- cssPath: {
24
- type: 'string'
25
- },
26
- htmlPath: {
27
- type: 'string'
28
- },
29
- mediaPath: {
30
- type: 'string'
31
- },
32
- mountId: {
33
- type: 'string'
34
- },
35
- favicon: {
36
- type: 'string'
37
- },
38
- faviconByEntries: {
39
- type: 'object',
40
- patternProperties: {
41
- [_utils.ENTRY_NAME_PATTERN]: {
42
- type: 'string'
43
- }
44
- }
45
- },
46
- title: {
47
- type: 'string'
48
- },
49
- titleByEntries: {
50
- type: 'object',
51
- patternProperties: {
52
- [_utils.ENTRY_NAME_PATTERN]: {
53
- type: 'string'
54
- }
55
- }
56
- },
57
- meta: {
58
- type: 'object'
59
- },
60
- metaByEntries: {
61
- type: 'object',
62
- patternProperties: {
63
- [_utils.ENTRY_NAME_PATTERN]: {
64
- type: 'object'
65
- }
66
- }
67
- },
68
- inject: {
69
- enum: [true, 'head', 'body', false]
70
- },
71
- injectByEntries: {
72
- type: 'object',
73
- patternProperties: {
74
- [_utils.ENTRY_NAME_PATTERN]: {
75
- enum: [true, 'head', 'body', false]
76
- }
77
- }
78
- },
79
- copy: {
80
- type: 'array'
81
- },
82
- scriptExt: {
83
- type: 'object'
84
- },
85
- disableHtmlFolder: {
86
- type: 'boolean'
87
- },
88
- disableCssModuleExtension: {
89
- type: 'boolean'
90
- },
91
- disableCssExtract: {
92
- type: 'boolean'
93
- },
94
- enableCssModuleTSDeclaration: {
95
- type: 'boolean'
96
- },
97
- disableMinimize: {
98
- type: 'boolean'
99
- },
100
- enableInlineStyles: {
101
- type: 'boolean'
102
- },
103
- enableInlineScripts: {
104
- type: 'boolean'
105
- },
106
- disableSourceMap: {
107
- type: 'boolean'
108
- },
109
- disableInlineRuntimeChunk: {
110
- type: 'boolean'
111
- },
112
- disableAssetsCache: {
113
- type: 'boolean'
114
- },
115
- enableLatestDecorators: {
116
- type: 'boolean'
117
- },
118
- enableUsageBuiltIns: {
119
- type: 'boolean'
120
- },
121
- enableTsLoader: {
122
- type: 'boolean'
123
- },
124
- dataUriLimit: {
125
- type: 'number'
126
- },
127
- templateParameters: {
128
- type: 'object'
129
- },
130
- templateParametersByEntries: {
131
- type: 'object',
132
- patternProperties: {
133
- [_utils.ENTRY_NAME_PATTERN]: {
134
- type: 'object'
135
- }
136
- }
137
- },
138
- polyfill: {
139
- type: 'string',
140
- enum: ['usage', 'entry', 'off', 'ua']
141
- },
142
- cssModuleLocalIdentName: {
143
- type: 'string'
144
- },
145
- federation: {
146
- type: 'object'
147
- },
148
- disableNodePolyfill: {
149
- type: 'boolean'
150
- },
151
- enableModernMode: {
152
- type: 'boolean'
153
- }
154
- }
155
- };
156
- exports.output = output;
@@ -1,179 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.server = void 0;
7
-
8
- var _utils = require("@modern-js/utils");
9
-
10
- const SERVER_ROUTE_OBJECT = {
11
- type: 'object',
12
- properties: {
13
- path: {
14
- type: 'string'
15
- },
16
- headers: {
17
- type: 'object'
18
- }
19
- },
20
- additionalProperties: false
21
- };
22
- const server = {
23
- type: 'object',
24
- additionalProperties: false,
25
- properties: {
26
- port: {
27
- type: 'number'
28
- },
29
- ssr: {
30
- if: {
31
- type: 'object'
32
- },
33
- then: {
34
- properties: {
35
- disableLoadable: {
36
- type: 'boolean'
37
- },
38
- disableHelmet: {
39
- type: 'boolean'
40
- },
41
- disableRedirect: {
42
- type: 'boolean'
43
- },
44
- enableAsyncData: {
45
- type: 'boolean'
46
- },
47
- enableProductWarning: {
48
- type: 'boolean'
49
- },
50
- timeout: {
51
- type: 'number'
52
- },
53
- asyncDataTimeout: {
54
- type: 'number'
55
- }
56
- }
57
- },
58
- else: {
59
- type: 'boolean'
60
- }
61
- },
62
- ssrByEntries: {
63
- type: 'object',
64
- patternProperties: {
65
- [_utils.ENTRY_NAME_PATTERN]: {
66
- if: {
67
- type: 'object'
68
- },
69
- then: {
70
- properties: {
71
- disableLoadable: {
72
- type: 'boolean'
73
- },
74
- disableHelmet: {
75
- type: 'boolean'
76
- },
77
- disableRedirect: {
78
- type: 'boolean'
79
- },
80
- enableProductWarning: {
81
- type: 'boolean'
82
- },
83
- enableAsyncData: {
84
- type: 'boolean'
85
- },
86
- timeout: {
87
- type: 'number'
88
- },
89
- asyncDataTimeout: {
90
- type: 'number'
91
- }
92
- },
93
- additionalProperties: false
94
- },
95
- else: {
96
- type: 'boolean'
97
- }
98
- }
99
- }
100
- },
101
- routes: {
102
- type: 'object',
103
- patternProperties: {
104
- [_utils.ENTRY_NAME_PATTERN]: {
105
- if: {
106
- type: 'object'
107
- },
108
- then: {
109
- properties: {
110
- route: {
111
- oneOf: [{
112
- type: 'string'
113
- }, {
114
- type: 'array',
115
- items: {
116
- oneOf: [{
117
- type: 'string'
118
- }, SERVER_ROUTE_OBJECT]
119
- }
120
- }, SERVER_ROUTE_OBJECT]
121
- },
122
- disableSpa: {
123
- type: 'boolean'
124
- }
125
- },
126
- additionalProperties: false
127
- },
128
- else: {
129
- oneOf: [{
130
- type: 'string'
131
- }, {
132
- type: 'array',
133
- items: {
134
- type: 'string'
135
- }
136
- }]
137
- }
138
- }
139
- }
140
- },
141
- publicRoutes: {
142
- type: 'object',
143
- patternProperties: {
144
- [_utils.ENTRY_NAME_PATTERN]: {
145
- type: ['string']
146
- }
147
- }
148
- },
149
- baseUrl: {
150
- oneOf: [{
151
- type: 'string'
152
- }, {
153
- type: 'array',
154
- items: [{
155
- type: 'string'
156
- }]
157
- }]
158
- },
159
- middleware: {
160
- instanceof: ['Array', 'Function']
161
- },
162
- renderHook: {
163
- instanceof: 'Function'
164
- },
165
- logger: {
166
- type: 'object'
167
- },
168
- measure: {
169
- type: 'object'
170
- },
171
- proxy: {
172
- type: 'object'
173
- },
174
- enableMicroFrontendDebug: {
175
- type: 'boolean'
176
- }
177
- }
178
- };
179
- exports.server = server;