@modern-js/core 1.8.0 → 1.9.2

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 (127) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +22 -0
  3. package/bin/modern-js.js +1 -1
  4. package/compiled/ajv/codegen.js +1 -0
  5. package/compiled/ajv/dist/ajv.d.ts +16 -0
  6. package/compiled/ajv/dist/compile/codegen/code.d.ts +40 -0
  7. package/compiled/ajv/dist/compile/codegen/index.d.ts +79 -0
  8. package/compiled/ajv/dist/compile/codegen/scope.d.ts +79 -0
  9. package/compiled/ajv/dist/compile/errors.d.ts +13 -0
  10. package/compiled/ajv/dist/compile/index.d.ts +80 -0
  11. package/compiled/ajv/dist/compile/ref_error.d.ts +6 -0
  12. package/compiled/ajv/dist/compile/resolve.d.ts +12 -0
  13. package/compiled/ajv/dist/compile/rules.d.ts +28 -0
  14. package/compiled/ajv/dist/compile/util.d.ts +40 -0
  15. package/compiled/ajv/dist/compile/validate/index.d.ts +42 -0
  16. package/compiled/ajv/dist/compile/validate/subschema.d.ts +47 -0
  17. package/compiled/ajv/dist/core.d.ts +173 -0
  18. package/compiled/ajv/dist/runtime/validation_error.d.ts +7 -0
  19. package/compiled/ajv/dist/types/index.d.ts +183 -0
  20. package/compiled/ajv/dist/types/json-schema.d.ts +124 -0
  21. package/compiled/ajv/dist/types/jtd-schema.d.ts +169 -0
  22. package/compiled/ajv/index.js +9 -0
  23. package/compiled/ajv/license +22 -0
  24. package/compiled/ajv/package.json +1 -0
  25. package/compiled/ajv/uri-js/dist/es5/uri.all.d.ts +59 -0
  26. package/compiled/ajv-keywords/ajv/dist/ajv.d.ts +16 -0
  27. package/compiled/ajv-keywords/ajv/dist/compile/codegen/code.d.ts +40 -0
  28. package/compiled/ajv-keywords/ajv/dist/compile/codegen/index.d.ts +79 -0
  29. package/compiled/ajv-keywords/ajv/dist/compile/codegen/scope.d.ts +79 -0
  30. package/compiled/ajv-keywords/ajv/dist/compile/errors.d.ts +13 -0
  31. package/compiled/ajv-keywords/ajv/dist/compile/index.d.ts +80 -0
  32. package/compiled/ajv-keywords/ajv/dist/compile/ref_error.d.ts +6 -0
  33. package/compiled/ajv-keywords/ajv/dist/compile/resolve.d.ts +12 -0
  34. package/compiled/ajv-keywords/ajv/dist/compile/rules.d.ts +28 -0
  35. package/compiled/ajv-keywords/ajv/dist/compile/util.d.ts +40 -0
  36. package/compiled/ajv-keywords/ajv/dist/compile/validate/index.d.ts +42 -0
  37. package/compiled/ajv-keywords/ajv/dist/compile/validate/subschema.d.ts +47 -0
  38. package/compiled/ajv-keywords/ajv/dist/core.d.ts +173 -0
  39. package/compiled/ajv-keywords/ajv/dist/runtime/validation_error.d.ts +7 -0
  40. package/compiled/ajv-keywords/ajv/dist/types/index.d.ts +183 -0
  41. package/compiled/ajv-keywords/ajv/dist/types/json-schema.d.ts +124 -0
  42. package/compiled/ajv-keywords/ajv/dist/types/jtd-schema.d.ts +169 -0
  43. package/compiled/ajv-keywords/dist/index.d.ts +4 -0
  44. package/compiled/ajv-keywords/index.js +1 -0
  45. package/compiled/ajv-keywords/license +21 -0
  46. package/compiled/ajv-keywords/package.json +1 -0
  47. package/compiled/ajv-keywords/uri-js/dist/es5/uri.all.d.ts +59 -0
  48. package/compiled/better-ajv-errors/ajv/dist/ajv.d.ts +16 -0
  49. package/compiled/better-ajv-errors/ajv/dist/compile/codegen/code.d.ts +40 -0
  50. package/compiled/better-ajv-errors/ajv/dist/compile/codegen/index.d.ts +79 -0
  51. package/compiled/better-ajv-errors/ajv/dist/compile/codegen/scope.d.ts +79 -0
  52. package/compiled/better-ajv-errors/ajv/dist/compile/errors.d.ts +13 -0
  53. package/compiled/better-ajv-errors/ajv/dist/compile/index.d.ts +80 -0
  54. package/compiled/better-ajv-errors/ajv/dist/compile/ref_error.d.ts +6 -0
  55. package/compiled/better-ajv-errors/ajv/dist/compile/resolve.d.ts +12 -0
  56. package/compiled/better-ajv-errors/ajv/dist/compile/rules.d.ts +28 -0
  57. package/compiled/better-ajv-errors/ajv/dist/compile/util.d.ts +40 -0
  58. package/compiled/better-ajv-errors/ajv/dist/compile/validate/index.d.ts +42 -0
  59. package/compiled/better-ajv-errors/ajv/dist/compile/validate/subschema.d.ts +47 -0
  60. package/compiled/better-ajv-errors/ajv/dist/core.d.ts +173 -0
  61. package/compiled/better-ajv-errors/ajv/dist/runtime/validation_error.d.ts +7 -0
  62. package/compiled/better-ajv-errors/ajv/dist/types/index.d.ts +183 -0
  63. package/compiled/better-ajv-errors/ajv/dist/types/json-schema.d.ts +124 -0
  64. package/compiled/better-ajv-errors/ajv/dist/types/jtd-schema.d.ts +169 -0
  65. package/compiled/better-ajv-errors/index.js +1 -0
  66. package/compiled/better-ajv-errors/license +13 -0
  67. package/compiled/better-ajv-errors/package.json +1 -0
  68. package/compiled/better-ajv-errors/typings.d.ts +24 -0
  69. package/compiled/better-ajv-errors/uri-js/dist/es5/uri.all.d.ts +59 -0
  70. package/compiled/v8-compile-cache/index.js +1 -0
  71. package/compiled/v8-compile-cache/license +21 -0
  72. package/compiled/v8-compile-cache/package.json +1 -0
  73. package/dist/cli.d.ts +1 -0
  74. package/dist/cli.js +33 -0
  75. package/dist/config/defaults.d.ts +28 -0
  76. package/dist/config/defaults.js +98 -0
  77. package/dist/config/index.d.ts +12 -0
  78. package/dist/config/index.js +124 -0
  79. package/dist/config/mergeConfig.d.ts +30 -0
  80. package/dist/config/mergeConfig.js +26 -0
  81. package/dist/config/schema/deploy.d.ts +16 -0
  82. package/dist/config/schema/deploy.js +16 -0
  83. package/dist/config/schema/index.d.ts +466 -0
  84. package/dist/config/schema/index.js +94 -0
  85. package/dist/config/schema/output.d.ts +146 -0
  86. package/dist/config/schema/output.js +68 -0
  87. package/dist/config/schema/server.d.ts +182 -0
  88. package/dist/config/schema/server.js +107 -0
  89. package/dist/config/schema/source.d.ts +58 -0
  90. package/dist/config/schema/source.js +36 -0
  91. package/dist/config/schema/tools.d.ts +36 -0
  92. package/dist/config/schema/tools.js +19 -0
  93. package/dist/config/types/electron.d.ts +13 -0
  94. package/dist/config/types/electron.js +2 -0
  95. package/dist/config/types/index.d.ts +240 -0
  96. package/dist/config/types/index.js +2 -0
  97. package/dist/config/types/less.d.ts +10 -0
  98. package/dist/config/types/less.js +2 -0
  99. package/dist/config/types/sass.d.ts +8 -0
  100. package/dist/config/types/sass.js +2 -0
  101. package/dist/config/types/ssg.d.ts +13 -0
  102. package/dist/config/types/ssg.js +2 -0
  103. package/dist/config/types/test.d.ts +14 -0
  104. package/dist/config/types/test.js +2 -0
  105. package/dist/config/types/unbundle.d.ts +25 -0
  106. package/dist/config/types/unbundle.js +2 -0
  107. package/dist/context.d.ts +37 -0
  108. package/dist/context.js +59 -0
  109. package/dist/index.d.ts +64 -0
  110. package/dist/index.js +181 -0
  111. package/dist/initWatcher.d.ts +3 -0
  112. package/dist/initWatcher.js +75 -0
  113. package/dist/loadEnv.d.ts +1 -0
  114. package/dist/loadEnv.js +21 -0
  115. package/dist/loadPlugins.d.ts +41 -0
  116. package/dist/loadPlugins.js +109 -0
  117. package/dist/manager.d.ts +72 -0
  118. package/dist/manager.js +24 -0
  119. package/dist/pluginAPI.d.ts +12 -0
  120. package/dist/pluginAPI.js +16 -0
  121. package/dist/utils/commander.d.ts +4 -0
  122. package/dist/utils/commander.js +20 -0
  123. package/dist/utils/repeatKeyWarning.d.ts +3 -0
  124. package/dist/utils/repeatKeyWarning.js +22 -0
  125. package/package.json +16 -30
  126. package/tsconfig.json +3 -4
  127. package/modern.config.js +0 -6
@@ -0,0 +1,94 @@
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
+ targetNode[mountProperty] = (0, lodash_1.cloneDeep)(schema);
72
+ }
73
+ }
74
+ debug(`final validate schema: %o`, finalSchema);
75
+ return finalSchema;
76
+ };
77
+ exports.patchSchema = patchSchema;
78
+ const traverseSchema = (schema) => {
79
+ const keys = [];
80
+ const traverse = ({ properties }, old = []) => {
81
+ for (const key of Object.keys(properties)) {
82
+ const current = [...old, key];
83
+ if (properties[key].type === 'object' && properties[key].properties) {
84
+ traverse(properties[key], current);
85
+ }
86
+ else {
87
+ keys.push(current.join('.'));
88
+ }
89
+ }
90
+ };
91
+ traverse(schema);
92
+ return keys;
93
+ };
94
+ 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
+ };