@modern-js/module-tools 1.5.8 → 1.6.1
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/CHANGELOG.md +41 -0
- package/dist/js/modern/cli/build.js +5 -4
- package/dist/js/modern/commands/build.js +55 -28
- package/dist/js/modern/features/build/bundle/index.js +9 -0
- package/dist/js/modern/features/build/bundle/runRollup.js +149 -0
- package/dist/js/modern/features/build/bundle/runSpeedy.js +185 -0
- package/dist/js/modern/{tasks → features/build/bundleless}/copy-assets.js +31 -56
- package/dist/js/modern/{tasks → features/build/bundleless}/generator-dts/index.js +46 -71
- package/dist/js/modern/{tasks → features/build/bundleless}/generator-dts/utils.js +10 -10
- package/dist/js/modern/features/build/bundleless/index.js +23 -0
- package/dist/js/modern/features/build/bundleless/runBabel.js +269 -0
- package/dist/js/modern/features/build/bundleless/style.js +266 -0
- package/dist/js/modern/features/build/constants.js +94 -59
- package/dist/js/modern/features/build/error.js +150 -0
- package/dist/js/modern/features/build/index.js +87 -18
- package/dist/js/modern/features/build/legacy-constants.js +99 -0
- package/dist/js/modern/features/build/normalize.js +301 -0
- package/dist/js/modern/features/build/types.js +0 -0
- package/dist/js/modern/features/build/utils.js +39 -136
- package/dist/js/modern/index.js +3 -1
- package/dist/js/modern/locale/en.js +5 -3
- package/dist/js/modern/locale/zh.js +5 -3
- package/dist/js/modern/schema/build-config.js +111 -0
- package/dist/js/modern/schema/index.js +2 -1
- package/dist/js/modern/schema/output.js +18 -9
- package/dist/js/modern/schema/source.js +2 -10
- package/dist/js/modern/schema/tools.js +6 -0
- package/dist/js/modern/schema/types.js +0 -0
- package/dist/js/modern/utils/babel.js +4 -1
- package/dist/js/modern/utils/constants.js +3 -0
- package/dist/js/modern/utils/copy.js +2 -2
- package/dist/js/node/cli/build.js +5 -4
- package/dist/js/node/commands/build.js +62 -29
- package/dist/js/node/features/build/bundle/index.js +23 -0
- package/dist/js/node/features/build/bundle/runRollup.js +174 -0
- package/dist/js/node/features/build/bundle/runSpeedy.js +209 -0
- package/dist/js/node/{tasks → features/build/bundleless}/copy-assets.js +37 -56
- package/dist/js/node/{tasks → features/build/bundleless}/generator-dts/index.js +58 -73
- package/dist/js/node/{tasks → features/build/bundleless}/generator-dts/utils.js +9 -10
- package/dist/js/node/features/build/bundleless/index.js +40 -0
- package/dist/js/node/features/build/bundleless/runBabel.js +309 -0
- package/dist/js/node/features/build/bundleless/style.js +299 -0
- package/dist/js/node/features/build/constants.js +115 -67
- package/dist/js/node/features/build/error.js +175 -0
- package/dist/js/node/features/build/index.js +104 -18
- package/dist/js/node/features/build/legacy-constants.js +107 -0
- package/dist/js/node/features/build/normalize.js +330 -0
- package/dist/js/node/features/build/types.js +0 -0
- package/dist/js/node/features/build/utils.js +48 -145
- package/dist/js/node/index.js +20 -1
- package/dist/js/node/locale/en.js +5 -3
- package/dist/js/node/locale/zh.js +5 -3
- package/dist/js/node/schema/build-config.js +120 -0
- package/dist/js/node/schema/index.js +3 -1
- package/dist/js/node/schema/output.js +20 -9
- package/dist/js/node/schema/source.js +2 -10
- package/dist/js/node/schema/tools.js +13 -0
- package/dist/js/node/schema/types.js +0 -0
- package/dist/js/node/utils/babel.js +4 -1
- package/dist/js/node/utils/constants.js +11 -0
- package/dist/js/node/utils/copy.js +1 -1
- package/dist/types/cli/build.d.ts +1 -1
- package/dist/types/commands/build.d.ts +12 -12
- package/dist/types/features/build/bundle/index.d.ts +3 -0
- package/dist/types/features/build/bundle/runRollup.d.ts +3 -0
- package/dist/types/features/build/bundle/runSpeedy.d.ts +10 -0
- package/dist/types/features/build/bundleless/copy-assets.d.ts +3 -0
- package/dist/types/features/build/bundleless/generator-dts/index.d.ts +3 -0
- package/dist/types/{tasks → features/build/bundleless}/generator-dts/utils.d.ts +3 -6
- package/dist/types/features/build/bundleless/index.d.ts +4 -0
- package/dist/types/features/build/bundleless/runBabel.d.ts +32 -0
- package/dist/types/features/build/bundleless/style.d.ts +25 -0
- package/dist/types/features/build/constants.d.ts +17 -13
- package/dist/types/features/build/error.d.ts +33 -0
- package/dist/types/features/build/index.d.ts +12 -3
- package/dist/types/features/build/legacy-constants.d.ts +8 -0
- package/dist/types/features/build/normalize.d.ts +19 -0
- package/dist/types/features/build/types.d.ts +15 -0
- package/dist/types/features/build/utils.d.ts +10 -31
- package/dist/types/index.d.ts +1 -0
- package/dist/types/locale/en.d.ts +2 -0
- package/dist/types/locale/index.d.ts +4 -0
- package/dist/types/locale/zh.d.ts +2 -0
- package/dist/types/schema/build-config.d.ts +197 -0
- package/dist/types/schema/index.d.ts +184 -18
- package/dist/types/schema/output.d.ts +188 -10
- package/dist/types/schema/source.d.ts +2 -11
- package/dist/types/schema/tools.d.ts +6 -0
- package/dist/types/schema/types.d.ts +46 -0
- package/dist/types/types.d.ts +29 -28
- package/dist/types/utils/babel.d.ts +3 -2
- package/dist/types/utils/constants.d.ts +2 -0
- package/package.json +23 -9
- package/dist/js/modern/features/build/build-watch.js +0 -101
- package/dist/js/modern/features/build/build.js +0 -123
- package/dist/js/modern/tasks/build-source-code.js +0 -208
- package/dist/js/modern/tasks/build-style.js +0 -169
- package/dist/js/modern/tasks/build-watch-source-code.js +0 -162
- package/dist/js/modern/tasks/build-watch-style.js +0 -216
- package/dist/js/modern/tasks/constants.js +0 -1
- package/dist/js/node/features/build/build-watch.js +0 -121
- package/dist/js/node/features/build/build.js +0 -143
- package/dist/js/node/tasks/build-source-code.js +0 -234
- package/dist/js/node/tasks/build-style.js +0 -184
- package/dist/js/node/tasks/build-watch-source-code.js +0 -174
- package/dist/js/node/tasks/build-watch-style.js +0 -233
- package/dist/js/node/tasks/constants.js +0 -8
- package/dist/types/features/build/build-watch.d.ts +0 -3
- package/dist/types/features/build/build.d.ts +0 -3
- package/dist/types/tasks/build-source-code.d.ts +0 -25
- package/dist/types/tasks/build-style.d.ts +0 -1
- package/dist/types/tasks/build-watch-source-code.d.ts +0 -1
- package/dist/types/tasks/build-watch-style.d.ts +0 -1
- package/dist/types/tasks/constants.d.ts +0 -1
- package/dist/types/tasks/copy-assets.d.ts +0 -1
- package/dist/types/tasks/generator-dts/index.d.ts +0 -1
|
@@ -1,43 +1,209 @@
|
|
|
1
1
|
export declare const addSchema: () => ({
|
|
2
|
-
target: string;
|
|
3
|
-
schema: {
|
|
4
|
-
type: string;
|
|
5
|
-
enum?: undefined;
|
|
6
|
-
default?: undefined;
|
|
7
|
-
};
|
|
8
|
-
} | {
|
|
9
2
|
target: string;
|
|
10
3
|
schema: {
|
|
11
4
|
enum: string[];
|
|
12
|
-
default: string;
|
|
13
|
-
type?: undefined;
|
|
14
5
|
};
|
|
15
6
|
} | {
|
|
16
7
|
target: string;
|
|
17
8
|
schema: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
if: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
then: {
|
|
13
|
+
items: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: {
|
|
16
|
+
target: {
|
|
17
|
+
enum: string[];
|
|
18
|
+
};
|
|
19
|
+
format: {
|
|
20
|
+
enum: string[];
|
|
21
|
+
};
|
|
22
|
+
sourceMap: {
|
|
23
|
+
enum: (string | boolean)[];
|
|
24
|
+
};
|
|
25
|
+
buildType: {
|
|
26
|
+
enum: string[];
|
|
27
|
+
};
|
|
28
|
+
bundleOptions: {
|
|
29
|
+
type: string;
|
|
30
|
+
properties: {
|
|
31
|
+
entry: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
splitting: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
externals: {
|
|
38
|
+
type: string;
|
|
39
|
+
items: {
|
|
40
|
+
anyOf: ({
|
|
41
|
+
instanceof: string;
|
|
42
|
+
typeof?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
typeof: string;
|
|
45
|
+
instanceof?: undefined;
|
|
46
|
+
})[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
platform: {
|
|
50
|
+
enum: string[];
|
|
51
|
+
};
|
|
52
|
+
minify: {
|
|
53
|
+
enum: (string | boolean)[];
|
|
54
|
+
};
|
|
55
|
+
skipDeps: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
bundlelessOptions: {
|
|
61
|
+
type: string;
|
|
62
|
+
properties: {
|
|
63
|
+
sourceDir: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
style: {
|
|
67
|
+
type: string;
|
|
68
|
+
properties: {
|
|
69
|
+
compileMode: {
|
|
70
|
+
enum: (string | boolean)[];
|
|
71
|
+
};
|
|
72
|
+
path: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
static: {
|
|
78
|
+
type: string;
|
|
79
|
+
properties: {
|
|
80
|
+
path: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
tsconfig: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
enableDts: {
|
|
91
|
+
type: string;
|
|
92
|
+
};
|
|
93
|
+
dtsOnly: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
outputPath: {
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
}[];
|
|
101
|
+
};
|
|
102
|
+
else: {
|
|
103
|
+
type: string;
|
|
104
|
+
properties: {
|
|
105
|
+
target: {
|
|
106
|
+
enum: string[];
|
|
107
|
+
};
|
|
108
|
+
format: {
|
|
109
|
+
enum: string[];
|
|
110
|
+
};
|
|
111
|
+
sourceMap: {
|
|
112
|
+
enum: (string | boolean)[];
|
|
113
|
+
};
|
|
114
|
+
buildType: {
|
|
115
|
+
enum: string[];
|
|
116
|
+
};
|
|
117
|
+
bundleOptions: {
|
|
118
|
+
type: string;
|
|
119
|
+
properties: {
|
|
120
|
+
entry: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
splitting: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
externals: {
|
|
127
|
+
type: string;
|
|
128
|
+
items: {
|
|
129
|
+
anyOf: ({
|
|
130
|
+
instanceof: string;
|
|
131
|
+
typeof?: undefined;
|
|
132
|
+
} | {
|
|
133
|
+
typeof: string;
|
|
134
|
+
instanceof?: undefined;
|
|
135
|
+
})[];
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
platform: {
|
|
139
|
+
enum: string[];
|
|
140
|
+
};
|
|
141
|
+
minify: {
|
|
142
|
+
enum: (string | boolean)[];
|
|
143
|
+
};
|
|
144
|
+
skipDeps: {
|
|
145
|
+
type: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
bundlelessOptions: {
|
|
150
|
+
type: string;
|
|
151
|
+
properties: {
|
|
152
|
+
sourceDir: {
|
|
153
|
+
type: string;
|
|
154
|
+
};
|
|
155
|
+
style: {
|
|
156
|
+
type: string;
|
|
157
|
+
properties: {
|
|
158
|
+
compileMode: {
|
|
159
|
+
enum: (string | boolean)[];
|
|
160
|
+
};
|
|
161
|
+
path: {
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
static: {
|
|
167
|
+
type: string;
|
|
168
|
+
properties: {
|
|
169
|
+
path: {
|
|
170
|
+
type: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
tsconfig: {
|
|
177
|
+
type: string;
|
|
178
|
+
};
|
|
179
|
+
enableDts: {
|
|
180
|
+
type: string;
|
|
181
|
+
};
|
|
182
|
+
dtsOnly: {
|
|
183
|
+
type: string;
|
|
184
|
+
};
|
|
185
|
+
outputPath: {
|
|
186
|
+
type: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
enum?: undefined;
|
|
21
191
|
};
|
|
22
192
|
} | {
|
|
23
193
|
target: string;
|
|
24
194
|
schema: {
|
|
25
195
|
typeof: string;
|
|
26
|
-
enum?: undefined;
|
|
27
196
|
default?: undefined;
|
|
28
197
|
};
|
|
29
198
|
} | {
|
|
30
199
|
target: string;
|
|
31
200
|
schema: {
|
|
32
|
-
|
|
201
|
+
typeof: string;
|
|
33
202
|
default: string;
|
|
34
|
-
typeof?: undefined;
|
|
35
203
|
};
|
|
36
204
|
} | {
|
|
37
205
|
target: string;
|
|
38
206
|
schema: {
|
|
39
|
-
typeof: string;
|
|
40
|
-
default: string;
|
|
41
|
-
enum?: undefined;
|
|
207
|
+
typeof: string[];
|
|
42
208
|
};
|
|
43
209
|
})[];
|
|
@@ -1,29 +1,207 @@
|
|
|
1
1
|
export declare const outputSchema: ({
|
|
2
2
|
target: string;
|
|
3
3
|
schema: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
if: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
then: {
|
|
8
|
+
items: {
|
|
9
|
+
type: string;
|
|
10
|
+
properties: {
|
|
11
|
+
target: {
|
|
12
|
+
enum: string[];
|
|
13
|
+
};
|
|
14
|
+
format: {
|
|
15
|
+
enum: string[];
|
|
16
|
+
};
|
|
17
|
+
sourceMap: {
|
|
18
|
+
enum: (string | boolean)[];
|
|
19
|
+
};
|
|
20
|
+
buildType: {
|
|
21
|
+
enum: string[];
|
|
22
|
+
};
|
|
23
|
+
bundleOptions: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
entry: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
splitting: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
externals: {
|
|
33
|
+
type: string;
|
|
34
|
+
items: {
|
|
35
|
+
anyOf: ({
|
|
36
|
+
instanceof: string;
|
|
37
|
+
typeof?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
typeof: string;
|
|
40
|
+
instanceof?: undefined;
|
|
41
|
+
})[];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
platform: {
|
|
45
|
+
enum: string[];
|
|
46
|
+
};
|
|
47
|
+
minify: {
|
|
48
|
+
enum: (string | boolean)[];
|
|
49
|
+
};
|
|
50
|
+
skipDeps: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
bundlelessOptions: {
|
|
56
|
+
type: string;
|
|
57
|
+
properties: {
|
|
58
|
+
sourceDir: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
style: {
|
|
62
|
+
type: string;
|
|
63
|
+
properties: {
|
|
64
|
+
compileMode: {
|
|
65
|
+
enum: (string | boolean)[];
|
|
66
|
+
};
|
|
67
|
+
path: {
|
|
68
|
+
type: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
static: {
|
|
73
|
+
type: string;
|
|
74
|
+
properties: {
|
|
75
|
+
path: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
tsconfig: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
enableDts: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
dtsOnly: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
outputPath: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
else: {
|
|
98
|
+
type: string;
|
|
99
|
+
properties: {
|
|
100
|
+
target: {
|
|
101
|
+
enum: string[];
|
|
102
|
+
};
|
|
103
|
+
format: {
|
|
104
|
+
enum: string[];
|
|
105
|
+
};
|
|
106
|
+
sourceMap: {
|
|
107
|
+
enum: (string | boolean)[];
|
|
108
|
+
};
|
|
109
|
+
buildType: {
|
|
110
|
+
enum: string[];
|
|
111
|
+
};
|
|
112
|
+
bundleOptions: {
|
|
113
|
+
type: string;
|
|
114
|
+
properties: {
|
|
115
|
+
entry: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
splitting: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
externals: {
|
|
122
|
+
type: string;
|
|
123
|
+
items: {
|
|
124
|
+
anyOf: ({
|
|
125
|
+
instanceof: string;
|
|
126
|
+
typeof?: undefined;
|
|
127
|
+
} | {
|
|
128
|
+
typeof: string;
|
|
129
|
+
instanceof?: undefined;
|
|
130
|
+
})[];
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
platform: {
|
|
134
|
+
enum: string[];
|
|
135
|
+
};
|
|
136
|
+
minify: {
|
|
137
|
+
enum: (string | boolean)[];
|
|
138
|
+
};
|
|
139
|
+
skipDeps: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
bundlelessOptions: {
|
|
145
|
+
type: string;
|
|
146
|
+
properties: {
|
|
147
|
+
sourceDir: {
|
|
148
|
+
type: string;
|
|
149
|
+
};
|
|
150
|
+
style: {
|
|
151
|
+
type: string;
|
|
152
|
+
properties: {
|
|
153
|
+
compileMode: {
|
|
154
|
+
enum: (string | boolean)[];
|
|
155
|
+
};
|
|
156
|
+
path: {
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
static: {
|
|
162
|
+
type: string;
|
|
163
|
+
properties: {
|
|
164
|
+
path: {
|
|
165
|
+
type: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
tsconfig: {
|
|
172
|
+
type: string;
|
|
173
|
+
};
|
|
174
|
+
enableDts: {
|
|
175
|
+
type: string;
|
|
176
|
+
};
|
|
177
|
+
dtsOnly: {
|
|
178
|
+
type: string;
|
|
179
|
+
};
|
|
180
|
+
outputPath: {
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
enum?: undefined;
|
|
7
186
|
};
|
|
8
187
|
} | {
|
|
9
188
|
target: string;
|
|
10
189
|
schema: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
190
|
+
enum: string[];
|
|
191
|
+
if?: undefined;
|
|
192
|
+
then?: undefined;
|
|
193
|
+
else?: undefined;
|
|
14
194
|
};
|
|
15
195
|
} | {
|
|
16
196
|
target: string;
|
|
17
197
|
schema: {
|
|
18
|
-
|
|
19
|
-
default
|
|
20
|
-
typeof?: undefined;
|
|
198
|
+
typeof: string;
|
|
199
|
+
default?: undefined;
|
|
21
200
|
};
|
|
22
201
|
} | {
|
|
23
202
|
target: string;
|
|
24
203
|
schema: {
|
|
25
204
|
typeof: string;
|
|
26
205
|
default: string;
|
|
27
|
-
enum?: undefined;
|
|
28
206
|
};
|
|
29
207
|
})[];
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
export declare const sourceSchema:
|
|
2
|
-
target: string;
|
|
3
|
-
schema: {
|
|
4
|
-
type: string;
|
|
5
|
-
enum?: undefined;
|
|
6
|
-
default?: undefined;
|
|
7
|
-
};
|
|
8
|
-
} | {
|
|
1
|
+
export declare const sourceSchema: {
|
|
9
2
|
target: string;
|
|
10
3
|
schema: {
|
|
11
4
|
enum: string[];
|
|
12
|
-
default: string;
|
|
13
|
-
type?: undefined;
|
|
14
5
|
};
|
|
15
|
-
}
|
|
6
|
+
}[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { UserConfig as SpeedyConfig } from '@speedy-js/speedy-core';
|
|
2
|
+
export declare type Format = 'esm' | 'cjs' | 'umd';
|
|
3
|
+
export declare type Target = 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'esnext';
|
|
4
|
+
export declare type BuildType = 'bundle' | 'bundleless';
|
|
5
|
+
export declare type SourceMap = boolean | 'inline' | 'external';
|
|
6
|
+
export declare type BundleOptions = {
|
|
7
|
+
entry?: Record<string, string>;
|
|
8
|
+
platform?: SpeedyConfig['platform'];
|
|
9
|
+
splitting?: boolean;
|
|
10
|
+
minify?: SpeedyConfig['minify'];
|
|
11
|
+
externals?: SpeedyConfig['external'];
|
|
12
|
+
skipDeps?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare type BundlelessOptions = {
|
|
15
|
+
sourceDir?: string;
|
|
16
|
+
style?: {
|
|
17
|
+
compileMode?: 'all' | 'only-compiled-code' |
|
|
18
|
+
/* may be will be deprecated */
|
|
19
|
+
'only-source-code' | false;
|
|
20
|
+
path?: string;
|
|
21
|
+
};
|
|
22
|
+
static?: {
|
|
23
|
+
path?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare type BaseBuildConfig = {
|
|
27
|
+
format?: Format;
|
|
28
|
+
target?: Target;
|
|
29
|
+
sourceMap?: SourceMap;
|
|
30
|
+
buildType?: BuildType;
|
|
31
|
+
bundleOptions?: BundleOptions;
|
|
32
|
+
bundlelessOptions?: BundlelessOptions;
|
|
33
|
+
tsconfig?: string;
|
|
34
|
+
enableDts?: boolean;
|
|
35
|
+
dtsOnly?: boolean;
|
|
36
|
+
outputPath?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare type BuildConfig = BaseBuildConfig | BaseBuildConfig[];
|
|
39
|
+
export declare type BuildPreset = 'npm-library' | 'npm-library-with-umd' | 'npm-component' | 'npm-component-with-umd';
|
|
40
|
+
export declare type JsSyntaxType = 'CJS+ES6' | 'ESM+ES5' | 'ESM+ES6';
|
|
41
|
+
export interface PackageFields {
|
|
42
|
+
main?: JsSyntaxType;
|
|
43
|
+
'jsnext:modern'?: JsSyntaxType;
|
|
44
|
+
module?: JsSyntaxType;
|
|
45
|
+
}
|
|
46
|
+
export declare type PackageModeType = 'universal-js' | 'universal-js-lite' | 'browser-js' | 'browser-js-lite' | 'node-js';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { OutputConfig, SourceConfig } from '@modern-js/core/config';
|
|
2
1
|
import type { ImportStyleType } from '@modern-js/babel-preset-module';
|
|
3
|
-
import type {
|
|
2
|
+
import type { CLIConfig as SpeedyConfig } from '@speedy-js/speedy-core';
|
|
4
3
|
import type { LoggerText } from './features/build/logger/logText';
|
|
5
4
|
import type { Platform } from './features/build/build-platform';
|
|
5
|
+
import type { BuildPreset, BuildConfig, PackageModeType, PackageFields } from './schema/types';
|
|
6
6
|
export type { Platform } from './features/build/build-platform';
|
|
7
7
|
export type { ITsconfig } from './utils/tsconfig';
|
|
8
8
|
export interface ITaskMapper {
|
|
@@ -10,23 +10,16 @@ export interface ITaskMapper {
|
|
|
10
10
|
taskPath: string;
|
|
11
11
|
params?: string[];
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
export declare type JsSyntaxType = 'CJS+ES6' | 'ESM+ES5' | 'ESM+ES6';
|
|
15
|
-
export interface IPackageFields {
|
|
16
|
-
main?: JsSyntaxType;
|
|
17
|
-
modern?: JsSyntaxType;
|
|
18
|
-
module?: JsSyntaxType;
|
|
19
|
-
}
|
|
20
|
-
export interface IBuildConfig {
|
|
21
|
-
appDirectory: string;
|
|
13
|
+
export interface IBuildFeatOption {
|
|
22
14
|
platform: boolean | Exclude<Platform, 'all'>;
|
|
23
|
-
|
|
15
|
+
enableDtsGen: boolean;
|
|
24
16
|
enableWatchMode?: boolean;
|
|
25
17
|
isTsProject: boolean;
|
|
26
|
-
|
|
27
|
-
tsconfigName?: string;
|
|
18
|
+
tsconfigName: string;
|
|
28
19
|
clear?: boolean;
|
|
29
20
|
styleOnly?: boolean;
|
|
21
|
+
outputPath: string;
|
|
22
|
+
legacyTsc: boolean;
|
|
30
23
|
}
|
|
31
24
|
export interface IPackageModeValue {
|
|
32
25
|
type: 'module' | 'commonjs';
|
|
@@ -34,18 +27,26 @@ export interface IPackageModeValue {
|
|
|
34
27
|
outDir: 'node' | 'treeshaking' | 'modern';
|
|
35
28
|
copyDirs?: ('node' | 'treeshaking' | 'modern')[];
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
disableTsChecker: boolean;
|
|
40
|
-
enableSourceMap: boolean;
|
|
41
|
-
packageMode: PackageModeType;
|
|
42
|
-
packageFields: IPackageFields;
|
|
43
|
-
importStyle: ImportStyleType;
|
|
44
|
-
}
|
|
45
|
-
export interface ModuleToolsSource extends SourceConfig {
|
|
46
|
-
jsxTransformRuntime: 'automatic' | 'classic';
|
|
30
|
+
interface ToolsConfig {
|
|
31
|
+
speedy?: SpeedyConfig | ((config: SpeedyConfig) => SpeedyConfig);
|
|
47
32
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
declare module '@modern-js/core' {
|
|
34
|
+
interface OutputConfig {
|
|
35
|
+
/** @deprecated Use the `buildConfig.bundlelessOptions.static.path` instead . */
|
|
36
|
+
assetsPath?: string;
|
|
37
|
+
/** @deprecated Use the `buildConfig.sourceMap` instead */
|
|
38
|
+
|
|
39
|
+
disableSourceMap?: boolean;
|
|
40
|
+
buildPreset?: BuildPreset;
|
|
41
|
+
buildConfig?: BuildConfig;
|
|
42
|
+
importStyle?: ImportStyleType;
|
|
43
|
+
packageMode?: PackageModeType;
|
|
44
|
+
packageFields?: PackageFields;
|
|
45
|
+
}
|
|
46
|
+
interface NormalizedToolsConfig {
|
|
47
|
+
speedy: ToolsConfig['speedy'] | Array<NonNullable<ToolsConfig['speedy']>>;
|
|
48
|
+
}
|
|
49
|
+
interface SourceConfig {
|
|
50
|
+
jsxTransformRuntime?: 'automatic' | 'classic';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { NormalizedConfig } from '@modern-js/core';
|
|
2
|
-
import { IPackageModeValue } from '../types';
|
|
2
|
+
import type { IPackageModeValue } from '../types';
|
|
3
|
+
import type { BundlelessOptions, SourceMap } from '../schema/types';
|
|
3
4
|
export declare const getFinalAlias: any;
|
|
4
|
-
export declare const resolveBabelConfig: (appDirectory: string, modernConfig: NormalizedConfig, option: Pick<IPackageModeValue, 'syntax' | 'type'> & {
|
|
5
|
+
export declare const resolveBabelConfig: (appDirectory: string, modernConfig: NormalizedConfig, sourceMap: SourceMap, bundlelessOptions: Required<BundlelessOptions>, option: Pick<IPackageModeValue, 'syntax' | 'type'> & {
|
|
5
6
|
sourceAbsDir: string;
|
|
6
7
|
tsconfigPath: string;
|
|
7
8
|
}) => import("@modern-js/core").TransformOptions;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.6.1",
|
|
15
15
|
"bin": {
|
|
16
16
|
"modern": "./bin/modern.js"
|
|
17
17
|
},
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@babel/traverse": "^7.18.0",
|
|
56
56
|
"@babel/types": "^7.18.0",
|
|
57
57
|
"@modern-js/babel-compiler": "^1.2.6",
|
|
58
|
-
"@modern-js/babel-preset-module": "^1.3.
|
|
59
|
-
"@modern-js/core": "^1.12.
|
|
58
|
+
"@modern-js/babel-preset-module": "^1.3.10",
|
|
59
|
+
"@modern-js/core": "^1.12.4",
|
|
60
60
|
"@modern-js/css-config": "^1.2.7",
|
|
61
61
|
"@modern-js/i18n-cli-language-detector": "^1.2.4",
|
|
62
62
|
"@modern-js/new-action": "^1.3.11",
|
|
@@ -65,15 +65,24 @@
|
|
|
65
65
|
"@modern-js/plugin-changeset": "^1.3.1",
|
|
66
66
|
"@modern-js/plugin-i18n": "^1.2.7",
|
|
67
67
|
"@modern-js/plugin-jarvis": "^1.2.14",
|
|
68
|
-
"@modern-js/style-compiler": "^1.2.
|
|
69
|
-
"@modern-js/utils": "^1.7.
|
|
68
|
+
"@modern-js/style-compiler": "^1.2.12",
|
|
69
|
+
"@modern-js/utils": "^1.7.11",
|
|
70
|
+
"@rollup/plugin-json": "~4.1.0",
|
|
71
|
+
"@speedy-js/speedy-types": "0.13.2-alpha.3",
|
|
72
|
+
"@speedy-js/speedy-core": "0.13.2-alpha.3",
|
|
73
|
+
"@speedy-js/speedy-plugin-es5": "0.13.2-alpha.3",
|
|
70
74
|
"normalize-path": "^3.0.0",
|
|
71
75
|
"p-map": "^4",
|
|
72
|
-
"process.argv": "^0.6.0"
|
|
76
|
+
"process.argv": "^0.6.0",
|
|
77
|
+
"rollup": "^2.70.2",
|
|
78
|
+
"rollup-plugin-dts": "^4.2.1",
|
|
79
|
+
"rollup-plugin-hashbang": "^3.0.0",
|
|
80
|
+
"signal-exit": "^3.0.7"
|
|
73
81
|
},
|
|
74
82
|
"devDependencies": {
|
|
75
83
|
"@scripts/build": "0.0.0",
|
|
76
84
|
"@scripts/jest-config": "0.0.0",
|
|
85
|
+
"@speedy-js/speedy-types": "0.13.2-alpha.3",
|
|
77
86
|
"@types/babel__core": "^7.1.15",
|
|
78
87
|
"@types/babel__generator": "^7.6.3",
|
|
79
88
|
"@types/babel__traverse": "^7.14.2",
|
|
@@ -83,8 +92,11 @@
|
|
|
83
92
|
"@types/normalize-path": "^3.0.0",
|
|
84
93
|
"@types/react": "^17",
|
|
85
94
|
"@types/react-dom": "^17",
|
|
95
|
+
"@types/signal-exit": "^3.0.1",
|
|
86
96
|
"jest": "^27",
|
|
87
|
-
"typescript": "^4"
|
|
97
|
+
"typescript": "^4",
|
|
98
|
+
"ajv": "^8",
|
|
99
|
+
"ajv-keywords": "^5"
|
|
88
100
|
},
|
|
89
101
|
"sideEffects": false,
|
|
90
102
|
"modernConfig": {
|
|
@@ -102,7 +114,8 @@
|
|
|
102
114
|
"files": [
|
|
103
115
|
"src/**/*",
|
|
104
116
|
"tsconfig.json",
|
|
105
|
-
"package.json"
|
|
117
|
+
"package.json",
|
|
118
|
+
"./modern.config.js"
|
|
106
119
|
],
|
|
107
120
|
"output": [
|
|
108
121
|
"dist/**/*"
|
|
@@ -122,7 +135,8 @@
|
|
|
122
135
|
"scripts": {
|
|
123
136
|
"new": "modern new",
|
|
124
137
|
"build": "wireit",
|
|
125
|
-
"test": "wireit"
|
|
138
|
+
"test": "wireit",
|
|
139
|
+
"dev": "modern build --watch"
|
|
126
140
|
},
|
|
127
141
|
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
|
128
142
|
}
|