@modern-js/core 2.0.0-beta.1 → 2.0.0-beta.3

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 (78) hide show
  1. package/CHANGELOG.md +156 -0
  2. package/dist/bin.js +1 -4
  3. package/dist/config/createLoadedConfig.d.ts +6 -0
  4. package/dist/config/createLoadedConfig.js +35 -0
  5. package/dist/config/createResolvedConfig.d.ts +3 -0
  6. package/dist/config/createResolvedConfig.js +91 -0
  7. package/dist/config/index.d.ts +2 -17
  8. package/dist/config/index.js +2 -136
  9. package/dist/context.d.ts +5 -9
  10. package/dist/index.d.ts +8 -13
  11. package/dist/index.js +22 -59
  12. package/dist/loadPlugins.d.ts +2 -12
  13. package/dist/loadPlugins.js +12 -5
  14. package/dist/manager.d.ts +80 -64
  15. package/dist/manager.js +11 -5
  16. package/dist/runBin.d.ts +5 -0
  17. package/dist/runBin.js +50 -0
  18. package/dist/schema/patchSchema.d.ts +19 -0
  19. package/dist/{config/schema/index.js → schema/patchSchema.js} +8 -45
  20. package/dist/schema/source.d.ts +9 -0
  21. package/dist/schema/source.js +10 -0
  22. package/dist/schema/testing.d.ts +13 -0
  23. package/dist/schema/testing.js +11 -0
  24. package/dist/schema/traverseSchema.d.ts +2 -0
  25. package/dist/schema/traverseSchema.js +20 -0
  26. package/dist/types/config/index.d.ts +41 -0
  27. package/dist/{config/types → types/config}/index.js +0 -0
  28. package/dist/types/config/testing.d.ts +15 -0
  29. package/dist/{config/types/electron.js → types/config/testing.js} +0 -0
  30. package/dist/types/context.d.ts +26 -0
  31. package/dist/{config/types/less.js → types/context.js} +0 -0
  32. package/dist/types/hooks.d.ts +26 -0
  33. package/dist/{config/types/postcss.js → types/hooks.js} +0 -0
  34. package/dist/types/index.d.ts +10 -1
  35. package/dist/types/index.js +5 -1
  36. package/dist/types/plugin.d.ts +26 -0
  37. package/dist/{config/types/sass.js → types/plugin.js} +0 -0
  38. package/dist/types/pluginAPI.d.ts +18 -0
  39. package/dist/{config/types/ssg.js → types/pluginAPI.js} +0 -0
  40. package/dist/utils/mergeConfig.d.ts +2 -0
  41. package/dist/{config → utils}/mergeConfig.js +1 -8
  42. package/dist/utils/repeatKeyWarning.d.ts +2 -2
  43. package/dist/utils/repeatKeyWarning.js +2 -2
  44. package/package.json +24 -10
  45. package/compiled/v8-compile-cache/index.d.ts +0 -1
  46. package/compiled/v8-compile-cache/index.js +0 -1
  47. package/compiled/v8-compile-cache/license +0 -21
  48. package/compiled/v8-compile-cache/package.json +0 -1
  49. package/dist/config/defaults.d.ts +0 -29
  50. package/dist/config/defaults.js +0 -110
  51. package/dist/config/mergeConfig.d.ts +0 -32
  52. package/dist/config/schema/deploy.d.ts +0 -16
  53. package/dist/config/schema/deploy.js +0 -16
  54. package/dist/config/schema/index.d.ts +0 -499
  55. package/dist/config/schema/output.d.ts +0 -146
  56. package/dist/config/schema/output.js +0 -68
  57. package/dist/config/schema/server.d.ts +0 -194
  58. package/dist/config/schema/server.js +0 -111
  59. package/dist/config/schema/source.d.ts +0 -64
  60. package/dist/config/schema/source.js +0 -38
  61. package/dist/config/schema/tools.d.ts +0 -51
  62. package/dist/config/schema/tools.js +0 -24
  63. package/dist/config/types/electron.d.ts +0 -13
  64. package/dist/config/types/index.d.ts +0 -260
  65. package/dist/config/types/less.d.ts +0 -12
  66. package/dist/config/types/postcss.d.ts +0 -28
  67. package/dist/config/types/sass.d.ts +0 -10
  68. package/dist/config/types/ssg.d.ts +0 -15
  69. package/dist/config/types/test.d.ts +0 -14
  70. package/dist/config/types/test.js +0 -2
  71. package/dist/config/types/ts-loader.d.ts +0 -23
  72. package/dist/config/types/ts-loader.js +0 -2
  73. package/dist/initWatcher.d.ts +0 -3
  74. package/dist/initWatcher.js +0 -66
  75. package/dist/pluginAPI.d.ts +0 -13
  76. package/dist/pluginAPI.js +0 -16
  77. package/dist/types/cli.d.ts +0 -59
  78. package/dist/types/cli.js +0 -2
@@ -1,499 +0,0 @@
1
- import type { JSONSchemaType } from '@modern-js/utils/ajv';
2
- export interface PluginValidateSchema {
3
- target: string;
4
- schema: JSONSchemaType<any>;
5
- }
6
- export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | PluginValidateSchema[]>) => {
7
- type: string;
8
- additionalProperties: boolean;
9
- properties: {
10
- source: {
11
- type: string;
12
- additionalProperties: boolean;
13
- properties: {
14
- entries: {
15
- type: string;
16
- patternProperties: {
17
- "^[a-zA-Z0-9_-]+$": {
18
- if: {
19
- type: string;
20
- };
21
- then: {
22
- required: string[];
23
- properties: {
24
- entry: {
25
- type: string[];
26
- };
27
- disableMount: {
28
- type: string;
29
- };
30
- enableFileSystemRoutes: {
31
- type: string;
32
- };
33
- };
34
- additionalProperties: boolean;
35
- };
36
- else: {
37
- type: string[];
38
- };
39
- };
40
- };
41
- };
42
- preEntry: {
43
- type: string[];
44
- };
45
- alias: {
46
- typeof: string[];
47
- };
48
- enableAsyncEntry: {
49
- type: string;
50
- };
51
- disableDefaultEntries: {
52
- type: string;
53
- };
54
- envVars: {
55
- type: string;
56
- };
57
- globalVars: {
58
- type: string;
59
- };
60
- moduleScopes: {
61
- instanceof: string[];
62
- };
63
- entriesDir: {
64
- type: string;
65
- };
66
- configDir: {
67
- type: string;
68
- };
69
- include: {
70
- type: string[];
71
- };
72
- };
73
- };
74
- output: {
75
- type: string;
76
- additionalProperties: boolean;
77
- properties: {
78
- assetPrefix: {
79
- type: string;
80
- };
81
- path: {
82
- type: string;
83
- };
84
- jsPath: {
85
- type: string;
86
- };
87
- cssPath: {
88
- type: string;
89
- };
90
- htmlPath: {
91
- type: string;
92
- };
93
- mediaPath: {
94
- type: string;
95
- };
96
- mountId: {
97
- type: string;
98
- };
99
- favicon: {
100
- type: string;
101
- };
102
- faviconByEntries: {
103
- type: string;
104
- patternProperties: {
105
- "^[a-zA-Z0-9_-]+$": {
106
- type: string;
107
- };
108
- };
109
- };
110
- title: {
111
- type: string;
112
- };
113
- titleByEntries: {
114
- type: string;
115
- patternProperties: {
116
- "^[a-zA-Z0-9_-]+$": {
117
- type: string;
118
- };
119
- };
120
- };
121
- meta: {
122
- type: string;
123
- };
124
- metaByEntries: {
125
- type: string;
126
- patternProperties: {
127
- "^[a-zA-Z0-9_-]+$": {
128
- type: string;
129
- };
130
- };
131
- };
132
- inject: {
133
- enum: (string | boolean)[];
134
- };
135
- injectByEntries: {
136
- type: string;
137
- patternProperties: {
138
- "^[a-zA-Z0-9_-]+$": {
139
- enum: (string | boolean)[];
140
- };
141
- };
142
- };
143
- copy: {
144
- type: string;
145
- };
146
- scriptExt: {
147
- type: string;
148
- };
149
- disableTsChecker: {
150
- type: string;
151
- };
152
- disableHtmlFolder: {
153
- type: string;
154
- };
155
- disableCssModuleExtension: {
156
- type: string;
157
- };
158
- disableCssExtract: {
159
- type: string;
160
- };
161
- enableCssModuleTSDeclaration: {
162
- type: string;
163
- };
164
- disableMinimize: {
165
- type: string;
166
- };
167
- enableInlineStyles: {
168
- type: string;
169
- };
170
- enableInlineScripts: {
171
- type: string;
172
- };
173
- disableSourceMap: {
174
- type: string;
175
- };
176
- disableInlineRuntimeChunk: {
177
- type: string;
178
- };
179
- disableAssetsCache: {
180
- type: string;
181
- };
182
- enableLatestDecorators: {
183
- type: string;
184
- };
185
- enableTsLoader: {
186
- type: string;
187
- };
188
- dataUriLimit: {
189
- type: string;
190
- };
191
- templateParameters: {
192
- type: string;
193
- };
194
- templateParametersByEntries: {
195
- type: string;
196
- patternProperties: {
197
- "^[a-zA-Z0-9_-]+$": {
198
- type: string;
199
- };
200
- };
201
- };
202
- polyfill: {
203
- type: string;
204
- enum: string[];
205
- };
206
- cssModuleLocalIdentName: {
207
- type: string;
208
- };
209
- federation: {
210
- type: string;
211
- };
212
- disableNodePolyfill: {
213
- type: string;
214
- };
215
- enableModernMode: {
216
- type: string;
217
- };
218
- };
219
- };
220
- server: {
221
- type: string;
222
- additionalProperties: boolean;
223
- properties: {
224
- port: {
225
- type: string;
226
- };
227
- ssr: {
228
- if: {
229
- type: string;
230
- };
231
- then: {
232
- properties: {
233
- disableLoadable: {
234
- type: string;
235
- };
236
- disableHelmet: {
237
- type: string;
238
- };
239
- disableRedirect: {
240
- type: string;
241
- };
242
- enableAsyncData: {
243
- type: string;
244
- };
245
- enableProductWarning: {
246
- type: string;
247
- };
248
- timeout: {
249
- type: string;
250
- };
251
- asyncDataTimeout: {
252
- type: string;
253
- };
254
- };
255
- };
256
- else: {
257
- type: string;
258
- };
259
- };
260
- ssrByEntries: {
261
- type: string;
262
- patternProperties: {
263
- "^[a-zA-Z0-9_-]+$": {
264
- if: {
265
- type: string;
266
- };
267
- then: {
268
- properties: {
269
- disableLoadable: {
270
- type: string;
271
- };
272
- disableHelmet: {
273
- type: string;
274
- };
275
- disableRedirect: {
276
- type: string;
277
- };
278
- enableProductWarning: {
279
- type: string;
280
- };
281
- enableAsyncData: {
282
- type: string;
283
- };
284
- timeout: {
285
- type: string;
286
- };
287
- asyncDataTimeout: {
288
- type: string;
289
- };
290
- };
291
- additionalProperties: boolean;
292
- };
293
- else: {
294
- type: string;
295
- };
296
- };
297
- };
298
- };
299
- routes: {
300
- type: string;
301
- patternProperties: {
302
- "^[a-zA-Z0-9_-]+$": {
303
- if: {
304
- type: string;
305
- };
306
- then: {
307
- properties: {
308
- route: {
309
- oneOf: ({
310
- type: string;
311
- properties: {
312
- path: {
313
- type: string;
314
- };
315
- headers: {
316
- type: string;
317
- };
318
- };
319
- additionalProperties: boolean;
320
- } | {
321
- type: string;
322
- items?: undefined;
323
- } | {
324
- type: string;
325
- items: {
326
- oneOf: ({
327
- type: string;
328
- properties: {
329
- path: {
330
- type: string;
331
- };
332
- headers: {
333
- type: string;
334
- };
335
- };
336
- additionalProperties: boolean;
337
- } | {
338
- type: string;
339
- })[];
340
- };
341
- })[];
342
- };
343
- disableSpa: {
344
- type: string;
345
- };
346
- resHeaders: {
347
- type: string;
348
- };
349
- };
350
- additionalProperties: boolean;
351
- };
352
- else: {
353
- oneOf: ({
354
- type: string;
355
- items?: undefined;
356
- } | {
357
- type: string;
358
- items: {
359
- type: string;
360
- };
361
- })[];
362
- };
363
- };
364
- };
365
- };
366
- publicRoutes: {
367
- type: string;
368
- patternProperties: {
369
- "^[a-zA-Z0-9_-]+$": {
370
- type: string[];
371
- };
372
- };
373
- };
374
- baseUrl: {
375
- oneOf: ({
376
- type: string;
377
- items?: undefined;
378
- } | {
379
- type: string;
380
- items: {
381
- type: string;
382
- }[];
383
- })[];
384
- };
385
- middleware: {
386
- instanceof: string[];
387
- };
388
- renderHook: {
389
- instanceof: string;
390
- };
391
- logger: {
392
- type: string[];
393
- };
394
- metrics: {
395
- type: string[];
396
- };
397
- proxy: {
398
- type: string;
399
- };
400
- enableMicroFrontendDebug: {
401
- type: string;
402
- };
403
- disableFrameworkExt: {
404
- type: string;
405
- };
406
- watchOptions: {
407
- type: string;
408
- };
409
- compiler: {
410
- type: string;
411
- };
412
- };
413
- };
414
- deploy: {
415
- type: string;
416
- properties: {
417
- domain: {
418
- type: string[];
419
- };
420
- domainByEntries: {
421
- type: string;
422
- patternProperties: {
423
- "^[a-zA-Z0-9_-]+$": {
424
- type: string[];
425
- };
426
- };
427
- };
428
- };
429
- };
430
- plugins: {
431
- type: string;
432
- additionalProperties: boolean;
433
- };
434
- dev: {
435
- type: string;
436
- properties: {
437
- assetPrefix: {
438
- type: string[];
439
- };
440
- https: {
441
- type: string;
442
- };
443
- };
444
- additionalProperties: boolean;
445
- };
446
- tools: {
447
- type: string;
448
- additionalProperties: boolean;
449
- properties: {
450
- webpack: {
451
- typeof: string[];
452
- };
453
- webpackChain: {
454
- typeof: string[];
455
- };
456
- babel: {
457
- typeof: string[];
458
- };
459
- postcss: {
460
- typeof: string[];
461
- };
462
- lodash: {
463
- typeof: string[];
464
- };
465
- devServer: {
466
- type: string;
467
- };
468
- tsLoader: {
469
- typeof: string[];
470
- };
471
- autoprefixer: {
472
- typeof: string[];
473
- };
474
- terser: {
475
- typeof: string[];
476
- };
477
- minifyCss: {
478
- typeof: string[];
479
- };
480
- styledComponents: {
481
- typeof: string[];
482
- };
483
- htmlPlugin: {
484
- typeof: string[];
485
- };
486
- esbuild: {
487
- type: string;
488
- };
489
- sass: {
490
- typeof: string[];
491
- };
492
- less: {
493
- typeof: string[];
494
- };
495
- };
496
- };
497
- };
498
- };
499
- export declare const traverseSchema: (schema: ReturnType<typeof patchSchema>) => string[];
@@ -1,146 +0,0 @@
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
- };
@@ -1,68 +0,0 @@
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
- };