@modern-js/core 1.8.0 → 1.9.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/.eslintrc.js +1 -0
- package/CHANGELOG.md +22 -0
- package/bin/modern-js.js +1 -1
- package/compiled/ajv/codegen.js +1 -0
- package/compiled/ajv/dist/ajv.d.ts +16 -0
- package/compiled/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/compiled/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/ajv/dist/compile/ref_error.d.ts +6 -0
- package/compiled/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/ajv/dist/core.d.ts +173 -0
- package/compiled/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/ajv/dist/types/index.d.ts +183 -0
- package/compiled/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/ajv/dist/types/jtd-schema.d.ts +169 -0
- package/compiled/ajv/index.js +9 -0
- package/compiled/ajv/license +22 -0
- package/compiled/ajv/package.json +1 -0
- package/compiled/ajv/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/ajv-keywords/ajv/dist/ajv.d.ts +16 -0
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/ajv-keywords/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/ajv-keywords/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/ajv-keywords/ajv/dist/compile/ref_error.d.ts +6 -0
- package/compiled/ajv-keywords/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/ajv-keywords/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/ajv-keywords/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/ajv-keywords/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/ajv-keywords/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/ajv-keywords/ajv/dist/core.d.ts +173 -0
- package/compiled/ajv-keywords/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/ajv-keywords/ajv/dist/types/index.d.ts +183 -0
- package/compiled/ajv-keywords/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/ajv-keywords/ajv/dist/types/jtd-schema.d.ts +169 -0
- package/compiled/ajv-keywords/dist/index.d.ts +4 -0
- package/compiled/ajv-keywords/index.js +1 -0
- package/compiled/ajv-keywords/license +21 -0
- package/compiled/ajv-keywords/package.json +1 -0
- package/compiled/ajv-keywords/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/better-ajv-errors/ajv/dist/ajv.d.ts +16 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/ref_error.d.ts +6 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/better-ajv-errors/ajv/dist/core.d.ts +173 -0
- package/compiled/better-ajv-errors/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/better-ajv-errors/ajv/dist/types/index.d.ts +183 -0
- package/compiled/better-ajv-errors/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/better-ajv-errors/ajv/dist/types/jtd-schema.d.ts +169 -0
- package/compiled/better-ajv-errors/index.js +1 -0
- package/compiled/better-ajv-errors/license +13 -0
- package/compiled/better-ajv-errors/package.json +1 -0
- package/compiled/better-ajv-errors/typings.d.ts +24 -0
- package/compiled/better-ajv-errors/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/v8-compile-cache/index.js +1 -0
- package/compiled/v8-compile-cache/license +21 -0
- package/compiled/v8-compile-cache/package.json +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +33 -0
- package/dist/config/defaults.d.ts +28 -0
- package/dist/config/defaults.js +98 -0
- package/dist/{types/config → config}/index.d.ts +2 -2
- package/dist/config/index.js +120 -0
- package/dist/config/mergeConfig.d.ts +30 -0
- package/dist/config/mergeConfig.js +26 -0
- package/dist/config/schema/deploy.d.ts +16 -0
- package/dist/config/schema/deploy.js +16 -0
- package/dist/config/schema/index.d.ts +466 -0
- package/dist/config/schema/index.js +95 -0
- package/dist/config/schema/output.d.ts +146 -0
- package/dist/config/schema/output.js +68 -0
- package/dist/config/schema/server.d.ts +182 -0
- package/dist/config/schema/server.js +107 -0
- package/dist/config/schema/source.d.ts +58 -0
- package/dist/config/schema/source.js +36 -0
- package/dist/config/schema/tools.d.ts +36 -0
- package/dist/config/schema/tools.js +19 -0
- package/dist/config/types/electron.d.ts +13 -0
- package/dist/config/types/electron.js +2 -0
- package/dist/config/types/index.d.ts +240 -0
- package/dist/config/types/index.js +2 -0
- package/dist/config/types/less.d.ts +10 -0
- package/dist/config/types/less.js +2 -0
- package/dist/config/types/sass.d.ts +8 -0
- package/dist/config/types/sass.js +2 -0
- package/dist/{types/config → config}/types/ssg.d.ts +8 -8
- package/dist/config/types/ssg.js +2 -0
- package/dist/config/types/test.d.ts +14 -0
- package/dist/config/types/test.js +2 -0
- package/dist/config/types/unbundle.d.ts +25 -0
- package/dist/config/types/unbundle.js +2 -0
- package/dist/{types/context.d.ts → context.d.ts} +12 -22
- package/dist/context.js +59 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +177 -0
- package/dist/{types/initWatcher.d.ts → initWatcher.d.ts} +1 -1
- package/dist/initWatcher.js +75 -0
- package/dist/{types/loadEnv.d.ts → loadEnv.d.ts} +1 -1
- package/dist/loadEnv.js +21 -0
- package/dist/{types/loadPlugins.d.ts → loadPlugins.d.ts} +13 -16
- package/dist/loadPlugins.js +109 -0
- package/dist/manager.d.ts +72 -0
- package/dist/manager.js +24 -0
- package/dist/{types/pluginAPI.d.ts → pluginAPI.d.ts} +5 -6
- package/dist/pluginAPI.js +16 -0
- package/dist/{types/utils → utils}/commander.d.ts +1 -1
- package/dist/utils/commander.js +20 -0
- package/dist/{types/utils → utils}/repeatKeyWarning.d.ts +1 -1
- package/dist/utils/repeatKeyWarning.js +22 -0
- package/package.json +12 -26
- package/tsconfig.json +3 -4
- 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/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/test.d.ts +0 -15
- package/dist/types/config/types/unbundle.d.ts +0 -28
- package/dist/types/index.d.ts +0 -64
- package/dist/types/manager.d.ts +0 -75
- package/modern.config.js +0 -6
|
@@ -1,182 +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
|
-
};
|
|
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
|
-
};
|
|
@@ -1,58 +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
|
-
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
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare const tools: {
|
|
2
|
-
type: string;
|
|
3
|
-
additionalProperties: boolean;
|
|
4
|
-
properties: {
|
|
5
|
-
webpack: {
|
|
6
|
-
typeof: string[];
|
|
7
|
-
};
|
|
8
|
-
babel: {
|
|
9
|
-
typeof: string[];
|
|
10
|
-
};
|
|
11
|
-
postcss: {
|
|
12
|
-
typeof: string[];
|
|
13
|
-
};
|
|
14
|
-
lodash: {
|
|
15
|
-
typeof: string[];
|
|
16
|
-
};
|
|
17
|
-
devServer: {
|
|
18
|
-
type: string;
|
|
19
|
-
};
|
|
20
|
-
tsLoader: {
|
|
21
|
-
typeof: string[];
|
|
22
|
-
};
|
|
23
|
-
autoprefixer: {
|
|
24
|
-
typeof: string[];
|
|
25
|
-
};
|
|
26
|
-
terser: {
|
|
27
|
-
typeof: string[];
|
|
28
|
-
};
|
|
29
|
-
minifyCss: {
|
|
30
|
-
typeof: string[];
|
|
31
|
-
};
|
|
32
|
-
styledComponents: {
|
|
33
|
-
typeof: string[];
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TransformOptions } from '@babel/core';
|
|
2
|
-
import { Configuration } from 'electron-builder';
|
|
3
|
-
export declare type BuildConfig = {
|
|
4
|
-
baseConfig: Configuration;
|
|
5
|
-
macConfig?: Configuration;
|
|
6
|
-
winConfig?: Configuration;
|
|
7
|
-
win64Config?: Configuration;
|
|
8
|
-
linuxConfig?: Configuration;
|
|
9
|
-
};
|
|
10
|
-
export declare type ElectronConfig = {
|
|
11
|
-
builder?: BuildConfig;
|
|
12
|
-
babel?: TransformOptions | ((defaultBabelConfig: TransformOptions) => TransformOptions);
|
|
13
|
-
};
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
import type { NextFunction, BffProxyOptions } from '@modern-js/types';
|
|
4
|
-
import type { MetaOptions } from '@modern-js/utils';
|
|
5
|
-
import type { TransformOptions } from '@babel/core';
|
|
6
|
-
import type webpack from 'webpack';
|
|
7
|
-
import type { Configuration as WebpackConfiguration } from 'webpack';
|
|
8
|
-
import autoprefixer from 'autoprefixer';
|
|
9
|
-
import type { BasePluginOptions, TerserOptions as RawTerserOptions } from 'terser-webpack-plugin';
|
|
10
|
-
import type { PluginConfig } from '../../loadPlugins';
|
|
11
|
-
import type { TestConfig, JestConfig } from './test';
|
|
12
|
-
import type { SassConfig, SassLoaderOptions } from './sass';
|
|
13
|
-
import type { LessConfig, LessLoaderOptions } from './less';
|
|
14
|
-
import type { UnbundleConfig } from './unbundle';
|
|
15
|
-
import type { SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions } from './ssg';
|
|
16
|
-
import { ElectronConfig } from './electron';
|
|
17
|
-
declare type AutoprefixerOptions = autoprefixer.Options;
|
|
18
|
-
declare type TerserOptions = BasePluginOptions & RawTerserOptions;
|
|
19
|
-
export type { TestConfig, JestConfig, UnbundleConfig, SassConfig, SassLoaderOptions, LessConfig, LessLoaderOptions, SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions, TransformOptions, AutoprefixerOptions, TerserOptions };
|
|
20
|
-
export interface SourceConfig {
|
|
21
|
-
entries?: Record<string, string | {
|
|
22
|
-
entry: string;
|
|
23
|
-
enableFileSystemRoutes?: boolean;
|
|
24
|
-
disableMount?: boolean;
|
|
25
|
-
}>;
|
|
26
|
-
disableDefaultEntries?: boolean;
|
|
27
|
-
entriesDir?: string;
|
|
28
|
-
configDir?: string;
|
|
29
|
-
apiDir?: string;
|
|
30
|
-
envVars?: Array<string>;
|
|
31
|
-
globalVars?: Record<string, string>;
|
|
32
|
-
alias?: Record<string, string> | ((aliases: Record<string, string>) => Record<string, unknown>);
|
|
33
|
-
moduleScopes?: Array<string | RegExp> | ((scopes: Array<string | RegExp>) => void) | ((scopes: Array<string | RegExp>) => Array<string | RegExp>);
|
|
34
|
-
include?: Array<string | RegExp>;
|
|
35
|
-
/**
|
|
36
|
-
* The configuration of `source.designSystem` is provided by plugin `@modern-js/plugin-tailwindcss`.
|
|
37
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
38
|
-
* @requires `@modern-js/plugin-tailwindcss`
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
designSystem?: Record<string, any>;
|
|
42
|
-
}
|
|
43
|
-
export interface OutputConfig {
|
|
44
|
-
assetPrefix?: string;
|
|
45
|
-
htmlPath?: string;
|
|
46
|
-
jsPath?: string;
|
|
47
|
-
cssPath?: string;
|
|
48
|
-
mediaPath?: string;
|
|
49
|
-
path?: string;
|
|
50
|
-
title?: string;
|
|
51
|
-
titleByEntries?: Record<string, string>;
|
|
52
|
-
meta?: MetaOptions;
|
|
53
|
-
metaByEntries?: Record<string, MetaOptions>;
|
|
54
|
-
inject?: 'body' | 'head' | boolean;
|
|
55
|
-
injectByEntries?: Record<string, 'body' | 'head' | boolean>;
|
|
56
|
-
mountId?: string;
|
|
57
|
-
favicon?: string;
|
|
58
|
-
faviconByEntries?: Record<string, string | undefined>;
|
|
59
|
-
copy?: Array<Record<string, unknown> & {
|
|
60
|
-
from: string;
|
|
61
|
-
}>;
|
|
62
|
-
scriptExt?: Record<string, unknown>;
|
|
63
|
-
disableTsChecker?: boolean;
|
|
64
|
-
disableHtmlFolder?: boolean;
|
|
65
|
-
disableCssModuleExtension?: boolean;
|
|
66
|
-
disableCssExtract?: boolean;
|
|
67
|
-
enableCssModuleTSDeclaration?: boolean;
|
|
68
|
-
disableMinimize?: boolean;
|
|
69
|
-
enableInlineStyles?: boolean;
|
|
70
|
-
enableInlineScripts?: boolean;
|
|
71
|
-
disableSourceMap?: boolean;
|
|
72
|
-
disableInlineRuntimeChunk?: boolean;
|
|
73
|
-
disableAssetsCache?: boolean;
|
|
74
|
-
enableLatestDecorators?: boolean;
|
|
75
|
-
polyfill?: 'off' | 'usage' | 'entry' | 'ua';
|
|
76
|
-
dataUriLimit?: number;
|
|
77
|
-
templateParameters?: Record<string, unknown>;
|
|
78
|
-
templateParametersByEntries?: Record<string, Record<string, unknown> | undefined>;
|
|
79
|
-
cssModuleLocalIdentName?: string;
|
|
80
|
-
enableModernMode?: boolean;
|
|
81
|
-
federation?: boolean;
|
|
82
|
-
disableNodePolyfill?: boolean;
|
|
83
|
-
enableTsLoader?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Disables lazy import support for styles, currently supports antd and arco-design.
|
|
86
|
-
* The configuration of `output.disableAutoImportStyle` is provided by plugin `@modern-js/plugin-unbundle`.
|
|
87
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
88
|
-
* @requires `@modern-js/plugin-unbundle`
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
disableAutoImportStyle?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* The configuration of `output.ssg` is provided by plugin `@modern-js/plugin-ssg`.
|
|
94
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
95
|
-
* @requires `@modern-js/plugin-ssg`
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
ssg?: SSGConfig;
|
|
99
|
-
}
|
|
100
|
-
export interface ServerConfig {
|
|
101
|
-
routes?: Record<string, string | string[] | {
|
|
102
|
-
route: string | string[];
|
|
103
|
-
disableSpa?: boolean;
|
|
104
|
-
}>;
|
|
105
|
-
publicRoutes?: {
|
|
106
|
-
[filepath: string]: string;
|
|
107
|
-
};
|
|
108
|
-
ssr?: boolean | Record<string, unknown>;
|
|
109
|
-
ssrByEntries?: Record<string, boolean | Record<string, unknown>>;
|
|
110
|
-
baseUrl?: string | Array<string>;
|
|
111
|
-
port?: number;
|
|
112
|
-
logger?: boolean | Record<string, any>;
|
|
113
|
-
metrics?: boolean | Record<string, any>;
|
|
114
|
-
enableMicroFrontendDebug?: boolean;
|
|
115
|
-
}
|
|
116
|
-
export declare type DevProxyOptions = string | Record<string, string>;
|
|
117
|
-
export interface DevConfig {
|
|
118
|
-
assetPrefix?: string | boolean;
|
|
119
|
-
https?: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* The configuration of `dev.proxy` is provided by plugin `@modern-js/plugin-proxy`.
|
|
122
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
123
|
-
* @requires `@modern-js/plugin-proxy`
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
proxy?: DevProxyOptions;
|
|
127
|
-
/**
|
|
128
|
-
* The configuration of `dev.unbundle` is provided by plugin `@modern-js/plugin-unbundle`.
|
|
129
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
130
|
-
* @requires `@modern-js/plugin-unbundle`
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
unbundle?: UnbundleConfig;
|
|
134
|
-
}
|
|
135
|
-
export interface MicroFrontend {
|
|
136
|
-
enableHtmlEntry?: boolean;
|
|
137
|
-
externalBasicLibrary?: boolean;
|
|
138
|
-
moduleApp?: string;
|
|
139
|
-
}
|
|
140
|
-
export interface DeployConfig {
|
|
141
|
-
microFrontend?: false | MicroFrontend;
|
|
142
|
-
domain?: string | Array<string>;
|
|
143
|
-
domainByEntries?: Record<string, string | Array<string>>;
|
|
144
|
-
}
|
|
145
|
-
declare type ConfigFunction = Record<string, unknown> | ((config: Record<string, unknown>, utils?: any) => Record<string, unknown> | void);
|
|
146
|
-
export declare type RequestHandler = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => void;
|
|
147
|
-
export declare type DevServerConfig = {
|
|
148
|
-
proxy?: BffProxyOptions;
|
|
149
|
-
headers?: Record<string, string>;
|
|
150
|
-
before?: RequestHandler[];
|
|
151
|
-
after?: RequestHandler[];
|
|
152
|
-
[propsName: string]: any;
|
|
153
|
-
};
|
|
154
|
-
export declare type WebpackConfig = WebpackConfiguration | ((config: WebpackConfiguration, utils: {
|
|
155
|
-
env: string;
|
|
156
|
-
webpack: typeof webpack;
|
|
157
|
-
[key: string]: any;
|
|
158
|
-
}) => WebpackConfiguration | void);
|
|
159
|
-
export declare type BabelConfig = TransformOptions | ((config: TransformOptions, utils?: any) => TransformOptions | void);
|
|
160
|
-
export declare type AutoprefixerConfig = AutoprefixerOptions | ((config: AutoprefixerOptions) => AutoprefixerOptions | void);
|
|
161
|
-
export declare type TerserConfig = TerserOptions | ((config: TerserOptions) => TerserOptions | void);
|
|
162
|
-
export interface ToolsConfig {
|
|
163
|
-
webpack?: WebpackConfig;
|
|
164
|
-
babel?: BabelConfig;
|
|
165
|
-
autoprefixer?: AutoprefixerConfig;
|
|
166
|
-
postcss?: ConfigFunction;
|
|
167
|
-
styledComponents?: ConfigFunction;
|
|
168
|
-
lodash?: ConfigFunction;
|
|
169
|
-
devServer?: DevServerConfig;
|
|
170
|
-
tsLoader?: ConfigFunction;
|
|
171
|
-
terser?: TerserConfig;
|
|
172
|
-
minifyCss?: ConfigFunction;
|
|
173
|
-
esbuild?: Record<string, unknown>;
|
|
174
|
-
/**
|
|
175
|
-
* The configuration of `tools.tailwindcss` is provided by plugin `@modern-js/plugin-tailwindcss`.
|
|
176
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
177
|
-
* @requires `@modern-js/plugin-tailwindcss`
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
tailwindcss?: Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
|
|
181
|
-
/**
|
|
182
|
-
* The configuration of `tools.jest` is provided by plugin `@modern-js/plugin-testing`.
|
|
183
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
184
|
-
* @requires `@modern-js/plugin-testing`
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
jest?: TestConfig['jest'];
|
|
188
|
-
/**
|
|
189
|
-
* The configuration of `tools.sass` is provided by plugin `@modern-js/plugin-sass`.
|
|
190
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
191
|
-
* @requires `@modern-js/plugin-sass`
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
sass?: SassConfig;
|
|
195
|
-
/**
|
|
196
|
-
* The configuration of `tools.less` is provided by plugin `@modern-js/plugin-less`.
|
|
197
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
198
|
-
* @requires `@modern-js/plugin-less`
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
less?: LessConfig;
|
|
202
|
-
}
|
|
203
|
-
export declare type RuntimeConfig = Record<string, any>;
|
|
204
|
-
export interface RuntimeByEntriesConfig {
|
|
205
|
-
[name: string]: RuntimeConfig;
|
|
206
|
-
}
|
|
207
|
-
export declare type BffConfig = Partial<{
|
|
208
|
-
prefix: string;
|
|
209
|
-
requestCreator: string;
|
|
210
|
-
fetcher: string;
|
|
211
|
-
proxy: Record<string, any>;
|
|
212
|
-
}>;
|
|
213
|
-
export interface UserConfig {
|
|
214
|
-
source?: SourceConfig;
|
|
215
|
-
output?: OutputConfig;
|
|
216
|
-
server?: ServerConfig;
|
|
217
|
-
dev?: DevConfig;
|
|
218
|
-
deploy?: DeployConfig;
|
|
219
|
-
tools?: ToolsConfig;
|
|
220
|
-
plugins?: PluginConfig;
|
|
221
|
-
runtime?: RuntimeConfig;
|
|
222
|
-
runtimeByEntries?: RuntimeByEntriesConfig;
|
|
223
|
-
/**
|
|
224
|
-
* The configuration of `bff` is provided by plugin `@modern-js/plugin-bff`.
|
|
225
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
226
|
-
* @requires `@modern-js/plugin-bff`
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
|
-
bff?: BffConfig;
|
|
230
|
-
/**
|
|
231
|
-
* The configuration of `testing` is provided by plugin `@modern-js/plugin-testing`.
|
|
232
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
233
|
-
* @requires `@modern-js/plugin-testing`
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
testing?: TestConfig;
|
|
237
|
-
/**
|
|
238
|
-
* The configuration of `electron` is provided by plugin `@modern-js/plugin-electron`.
|
|
239
|
-
* Please use `yarn new` to enable the corresponding capability.
|
|
240
|
-
* @requires `@modern-js/plugin-electron`
|
|
241
|
-
*/
|
|
242
|
-
|
|
243
|
-
electron?: ElectronConfig;
|
|
244
|
-
}
|
|
245
|
-
export declare type ConfigParam = UserConfig | Promise<UserConfig> | ((env: any) => UserConfig | Promise<UserConfig>);
|
|
246
|
-
export interface LoadedConfig {
|
|
247
|
-
config: UserConfig;
|
|
248
|
-
filePath: string | false;
|
|
249
|
-
dependencies: string[];
|
|
250
|
-
pkgConfig: UserConfig;
|
|
251
|
-
jsConfig: UserConfig;
|
|
252
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="less" />
|
|
2
|
-
import type { LoaderContext } from 'webpack';
|
|
3
|
-
export declare type LessLoaderOptions = {
|
|
4
|
-
lessOptions?: Less.Options;
|
|
5
|
-
additionalData?: string | ((content: string, loaderContext: LoaderContext<LessLoaderOptions>) => string);
|
|
6
|
-
sourceMap?: boolean;
|
|
7
|
-
webpackImporter?: boolean;
|
|
8
|
-
implementation?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare type LessConfig = LessLoaderOptions | ((options: LessLoaderOptions, utils?: any) => LessLoaderOptions | void);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { LegacyFileOptions } from 'sass';
|
|
2
|
-
export interface SassLoaderOptions {
|
|
3
|
-
sassOptions?: LegacyFileOptions<'sync'>;
|
|
4
|
-
sourceMap?: boolean;
|
|
5
|
-
implementation?: string;
|
|
6
|
-
additionalData?: string | ((content: string, filename: string) => string);
|
|
7
|
-
}
|
|
8
|
-
export declare type SassConfig = SassLoaderOptions | ((options: SassLoaderOptions, utils?: any) => SassLoaderOptions | void);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Config as JestConfigTypes } from '@jest/types';
|
|
2
|
-
export declare type JestConfig = JestConfigTypes.InitialOptions;
|
|
3
|
-
export interface TestConfig {
|
|
4
|
-
/**
|
|
5
|
-
* Decide which transformer will be used to compile file
|
|
6
|
-
* Default: babel-jest
|
|
7
|
-
*/
|
|
8
|
-
transformer?: 'babel-jest' | 'ts-jest';
|
|
9
|
-
/**
|
|
10
|
-
* Original jest config
|
|
11
|
-
* Doc: https://jestjs.io/docs/configuration
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
|
|
15
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare type UnbundleConfig = {
|
|
2
|
-
/**
|
|
3
|
-
* Some package A may require another package B that is intended for Node.js
|
|
4
|
-
* use only. In such a case, if package B cannot be converted to ESM, it will
|
|
5
|
-
* cause package A to fail during unbundle development, even though package B
|
|
6
|
-
* is not really required. Package B can thus be safely ignored via this option
|
|
7
|
-
* to ensure transpilation of package A to ESM
|
|
8
|
-
*/
|
|
9
|
-
ignore?: string | string[];
|
|
10
|
-
/**
|
|
11
|
-
* ignores cached esm modules and recompiles dependencies not available
|
|
12
|
-
* from PDN host on dev start.
|
|
13
|
-
* default: false
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
ignoreModuleCache?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* clears cache of downloaded esm modules (from PDN) on dev start.
|
|
19
|
-
* default: false
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
clearPdnCache?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* modifies host to attempt to download esm modules from
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
pdnHost?: string;
|
|
28
|
-
};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { INTERNAL_PLUGINS } from '@modern-js/utils';
|
|
2
|
-
import type { Hooks } from '@modern-js/types';
|
|
3
|
-
import { ErrorObject } from 'ajv';
|
|
4
|
-
import { TransformPlugin } from './loadPlugins';
|
|
5
|
-
import { IAppContext, initAppContext } from './context';
|
|
6
|
-
import type { NormalizedConfig } from './config/mergeConfig';
|
|
7
|
-
export type { Hooks };
|
|
8
|
-
export * from './config';
|
|
9
|
-
export * from '@modern-js/plugin';
|
|
10
|
-
export * from '@modern-js/plugin/node';
|
|
11
|
-
export { manager, mountHook, usePlugins, createPlugin, registerHook } from './manager';
|
|
12
|
-
export type { CliHooks, CliPlugin, CliHookCallbacks } from './manager';
|
|
13
|
-
export { AppContext, ConfigContext, ResolvedConfigContext, useAppContext, useConfigContext, useResolvedConfigContext } from './pluginAPI';
|
|
14
|
-
export type { PluginAPI } from './pluginAPI';
|
|
15
|
-
export type { NormalizedConfig, IAppContext };
|
|
16
|
-
declare const initAppDir: (cwd?: string | undefined) => Promise<string>;
|
|
17
|
-
export interface CoreOptions {
|
|
18
|
-
configFile?: string;
|
|
19
|
-
serverConfigFile?: string;
|
|
20
|
-
packageJsonConfig?: string;
|
|
21
|
-
plugins?: typeof INTERNAL_PLUGINS;
|
|
22
|
-
transformPlugin?: TransformPlugin;
|
|
23
|
-
onSchemaError?: (error: ErrorObject) => void;
|
|
24
|
-
options?: {
|
|
25
|
-
metaName?: string;
|
|
26
|
-
srcDir?: string;
|
|
27
|
-
distDir?: string;
|
|
28
|
-
sharedDir?: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export declare const mergeOptions: (options?: CoreOptions | undefined) => {
|
|
32
|
-
configFile?: string | undefined;
|
|
33
|
-
serverConfigFile: string;
|
|
34
|
-
packageJsonConfig?: string | undefined;
|
|
35
|
-
plugins?: {
|
|
36
|
-
[name: string]: {
|
|
37
|
-
cli?: string | undefined;
|
|
38
|
-
server?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
} | undefined;
|
|
41
|
-
transformPlugin?: TransformPlugin | undefined;
|
|
42
|
-
onSchemaError?: ((error: ErrorObject) => void) | undefined;
|
|
43
|
-
options?: {
|
|
44
|
-
metaName?: string | undefined;
|
|
45
|
-
srcDir?: string | undefined;
|
|
46
|
-
distDir?: string | undefined;
|
|
47
|
-
sharedDir?: string | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
};
|
|
50
|
-
export declare const cli: {
|
|
51
|
-
init: (argv?: string[], options?: CoreOptions | undefined) => Promise<{
|
|
52
|
-
loadedConfig: import("./config").LoadedConfig;
|
|
53
|
-
appContext: IAppContext;
|
|
54
|
-
resolved: NormalizedConfig;
|
|
55
|
-
}>;
|
|
56
|
-
run: (argv: string[], options?: CoreOptions | undefined) => Promise<void>;
|
|
57
|
-
restart: () => Promise<void>;
|
|
58
|
-
};
|
|
59
|
-
export { initAppDir, initAppContext };
|
|
60
|
-
declare module '@modern-js/utils/compiled/commander' {
|
|
61
|
-
interface Command {
|
|
62
|
-
commandsMap: Map<string, Command>;
|
|
63
|
-
}
|
|
64
|
-
}
|