@modern-js/plugin-swc 2.0.0-beta.2 → 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 (86) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/package.json +10 -10
  3. package/dist/bin.d.ts +0 -2
  4. package/dist/bin.js +0 -38
  5. package/dist/config/createLoadedConfig.d.ts +0 -6
  6. package/dist/config/createLoadedConfig.js +0 -35
  7. package/dist/config/createResolvedConfig.d.ts +0 -3
  8. package/dist/config/createResolvedConfig.js +0 -91
  9. package/dist/config/defaults.d.ts +0 -29
  10. package/dist/config/defaults.js +0 -110
  11. package/dist/config/index.d.ts +0 -2
  12. package/dist/config/index.js +0 -18
  13. package/dist/config/mergeConfig.d.ts +0 -32
  14. package/dist/config/mergeConfig.js +0 -39
  15. package/dist/config/schema/deploy.d.ts +0 -16
  16. package/dist/config/schema/deploy.js +0 -16
  17. package/dist/config/schema/index.d.ts +0 -499
  18. package/dist/config/schema/index.js +0 -94
  19. package/dist/config/schema/output.d.ts +0 -146
  20. package/dist/config/schema/output.js +0 -68
  21. package/dist/config/schema/server.d.ts +0 -194
  22. package/dist/config/schema/server.js +0 -111
  23. package/dist/config/schema/source.d.ts +0 -64
  24. package/dist/config/schema/source.js +0 -38
  25. package/dist/config/schema/tools.d.ts +0 -51
  26. package/dist/config/schema/tools.js +0 -24
  27. package/dist/config/types/electron.d.ts +0 -13
  28. package/dist/config/types/electron.js +0 -2
  29. package/dist/config/types/index.d.ts +0 -260
  30. package/dist/config/types/index.js +0 -2
  31. package/dist/config/types/less.d.ts +0 -12
  32. package/dist/config/types/less.js +0 -2
  33. package/dist/config/types/postcss.d.ts +0 -28
  34. package/dist/config/types/postcss.js +0 -2
  35. package/dist/config/types/sass.d.ts +0 -10
  36. package/dist/config/types/sass.js +0 -2
  37. package/dist/config/types/ssg.d.ts +0 -15
  38. package/dist/config/types/ssg.js +0 -2
  39. package/dist/config/types/test.d.ts +0 -14
  40. package/dist/config/types/test.js +0 -2
  41. package/dist/config/types/ts-loader.d.ts +0 -23
  42. package/dist/config/types/ts-loader.js +0 -2
  43. package/dist/context.d.ts +0 -34
  44. package/dist/context.js +0 -60
  45. package/dist/initWatcher.d.ts +0 -3
  46. package/dist/initWatcher.js +0 -66
  47. package/dist/load-configs/index.d.ts +0 -34
  48. package/dist/load-configs/index.js +0 -124
  49. package/dist/loadEnv.d.ts +0 -1
  50. package/dist/loadEnv.js +0 -21
  51. package/dist/loadPlugins.d.ts +0 -16
  52. package/dist/loadPlugins.js +0 -60
  53. package/dist/manager.d.ts +0 -87
  54. package/dist/manager.js +0 -24
  55. package/dist/pluginAPI.d.ts +0 -13
  56. package/dist/pluginAPI.js +0 -16
  57. package/dist/schema/patchSchema.d.ts +0 -19
  58. package/dist/schema/patchSchema.js +0 -57
  59. package/dist/schema/source.d.ts +0 -9
  60. package/dist/schema/source.js +0 -10
  61. package/dist/schema/testing.d.ts +0 -13
  62. package/dist/schema/testing.js +0 -11
  63. package/dist/schema/traverseSchema.d.ts +0 -2
  64. package/dist/schema/traverseSchema.js +0 -20
  65. package/dist/types/cli.d.ts +0 -59
  66. package/dist/types/cli.js +0 -2
  67. package/dist/types/config/index.d.ts +0 -41
  68. package/dist/types/config/index.js +0 -2
  69. package/dist/types/config/testing.d.ts +0 -15
  70. package/dist/types/config/testing.js +0 -2
  71. package/dist/types/context.d.ts +0 -26
  72. package/dist/types/context.js +0 -2
  73. package/dist/types/hooks.d.ts +0 -26
  74. package/dist/types/hooks.js +0 -2
  75. package/dist/types/index.d.ts +0 -10
  76. package/dist/types/index.js +0 -21
  77. package/dist/types/plugin.d.ts +0 -26
  78. package/dist/types/plugin.js +0 -2
  79. package/dist/types/pluginAPI.d.ts +0 -18
  80. package/dist/types/pluginAPI.js +0 -2
  81. package/dist/utils/commander.d.ts +0 -4
  82. package/dist/utils/commander.js +0 -20
  83. package/dist/utils/mergeConfig.d.ts +0 -2
  84. package/dist/utils/mergeConfig.js +0 -32
  85. package/dist/utils/repeatKeyWarning.d.ts +0 -3
  86. package/dist/utils/repeatKeyWarning.js +0 -22
@@ -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
- };
@@ -1,194 +0,0 @@
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
- resHeaders: {
128
- type: string;
129
- };
130
- };
131
- additionalProperties: boolean;
132
- };
133
- else: {
134
- oneOf: ({
135
- type: string;
136
- items?: undefined;
137
- } | {
138
- type: string;
139
- items: {
140
- type: string;
141
- };
142
- })[];
143
- };
144
- };
145
- };
146
- };
147
- publicRoutes: {
148
- type: string;
149
- patternProperties: {
150
- "^[a-zA-Z0-9_-]+$": {
151
- type: string[];
152
- };
153
- };
154
- };
155
- baseUrl: {
156
- oneOf: ({
157
- type: string;
158
- items?: undefined;
159
- } | {
160
- type: string;
161
- items: {
162
- type: string;
163
- }[];
164
- })[];
165
- };
166
- middleware: {
167
- instanceof: string[];
168
- };
169
- renderHook: {
170
- instanceof: string;
171
- };
172
- logger: {
173
- type: string[];
174
- };
175
- metrics: {
176
- type: string[];
177
- };
178
- proxy: {
179
- type: string;
180
- };
181
- enableMicroFrontendDebug: {
182
- type: string;
183
- };
184
- disableFrameworkExt: {
185
- type: string;
186
- };
187
- watchOptions: {
188
- type: string;
189
- };
190
- compiler: {
191
- type: string;
192
- };
193
- };
194
- };
@@ -1,111 +0,0 @@
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
- resHeaders: { type: 'object' },
73
- },
74
- additionalProperties: false,
75
- },
76
- else: {
77
- oneOf: [
78
- { type: 'string' },
79
- {
80
- type: 'array',
81
- items: { type: 'string' },
82
- },
83
- ],
84
- },
85
- },
86
- },
87
- },
88
- publicRoutes: {
89
- type: 'object',
90
- patternProperties: { [utils_1.ENTRY_NAME_PATTERN]: { type: ['string'] } },
91
- },
92
- baseUrl: {
93
- oneOf: [
94
- { type: 'string' },
95
- {
96
- type: 'array',
97
- items: [{ type: 'string' }],
98
- },
99
- ],
100
- },
101
- middleware: { instanceof: ['Array', 'Function'] },
102
- renderHook: { instanceof: 'Function' },
103
- logger: { type: ['object', 'boolean'] },
104
- metrics: { type: ['object', 'boolean'] },
105
- proxy: { type: 'object' },
106
- enableMicroFrontendDebug: { type: 'boolean' },
107
- disableFrameworkExt: { type: 'boolean' },
108
- watchOptions: { type: 'object' },
109
- compiler: { type: 'string' },
110
- },
111
- };
@@ -1,64 +0,0 @@
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
- preEntry: {
34
- type: string[];
35
- };
36
- alias: {
37
- typeof: string[];
38
- };
39
- enableAsyncEntry: {
40
- type: string;
41
- };
42
- disableDefaultEntries: {
43
- type: string;
44
- };
45
- envVars: {
46
- type: string;
47
- };
48
- globalVars: {
49
- type: string;
50
- };
51
- moduleScopes: {
52
- instanceof: string[];
53
- };
54
- entriesDir: {
55
- type: string;
56
- };
57
- configDir: {
58
- type: string;
59
- };
60
- include: {
61
- type: string[];
62
- };
63
- };
64
- };
@@ -1,38 +0,0 @@
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
- preEntry: { type: ['string', 'array'] },
28
- alias: { typeof: ['object', 'function'] },
29
- enableAsyncEntry: { type: 'boolean' },
30
- disableDefaultEntries: { type: 'boolean' },
31
- envVars: { type: 'array' },
32
- globalVars: { type: 'object' },
33
- moduleScopes: { instanceof: ['Array', 'Function'] },
34
- entriesDir: { type: 'string' },
35
- configDir: { type: 'string' },
36
- include: { type: ['array'] },
37
- },
38
- };
@@ -1,51 +0,0 @@
1
- export declare const tools: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- webpack: {
6
- typeof: string[];
7
- };
8
- webpackChain: {
9
- typeof: string[];
10
- };
11
- babel: {
12
- typeof: string[];
13
- };
14
- postcss: {
15
- typeof: string[];
16
- };
17
- lodash: {
18
- typeof: string[];
19
- };
20
- devServer: {
21
- type: string;
22
- };
23
- tsLoader: {
24
- typeof: string[];
25
- };
26
- autoprefixer: {
27
- typeof: string[];
28
- };
29
- terser: {
30
- typeof: string[];
31
- };
32
- minifyCss: {
33
- typeof: string[];
34
- };
35
- styledComponents: {
36
- typeof: string[];
37
- };
38
- htmlPlugin: {
39
- typeof: string[];
40
- };
41
- esbuild: {
42
- type: string;
43
- };
44
- sass: {
45
- typeof: string[];
46
- };
47
- less: {
48
- typeof: string[];
49
- };
50
- };
51
- };
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tools = void 0;
4
- exports.tools = {
5
- type: 'object',
6
- additionalProperties: false,
7
- properties: {
8
- webpack: { typeof: ['object', 'function'] },
9
- webpackChain: { typeof: ['function'] },
10
- babel: { typeof: ['object', 'function'] },
11
- postcss: { typeof: ['object', 'function'] },
12
- lodash: { typeof: ['object', 'function'] },
13
- devServer: { type: 'object' },
14
- tsLoader: { typeof: ['object', 'function'] },
15
- autoprefixer: { typeof: ['object', 'function'] },
16
- terser: { typeof: ['object', 'function'] },
17
- minifyCss: { typeof: ['object', 'function'] },
18
- styledComponents: { typeof: ['object', 'function'] },
19
- htmlPlugin: { typeof: ['object', 'function'] },
20
- esbuild: { type: 'object' },
21
- sass: { typeof: ['object', 'function'] },
22
- less: { typeof: ['object', 'function'] },
23
- },
24
- };