@cocos/ccbuild 2.0.3-alpha.0 → 2.0.3-alpha.10
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 +269 -0
- package/README.md +16 -37
- package/lib/src/index.d.ts +5 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +5 -1
- package/lib/src/index.js.map +1 -1
- package/modules/build-engine/lib/build-dts.d.ts +7 -0
- package/modules/build-engine/lib/build-dts.d.ts.map +1 -0
- package/modules/build-engine/lib/build-dts.js +297 -0
- package/modules/build-engine/lib/build-dts.js.map +1 -0
- package/modules/build-engine/lib/engine-js/index.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/index.js +11 -2
- package/modules/build-engine/lib/engine-js/index.js.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts +33 -33
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js +72 -43
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.d.ts +4 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.js +43 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.js.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.js +8 -7
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts +1 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.js +32 -44
- package/modules/build-engine/lib/engine-ts/engine-builder.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js +20 -3
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/interface.d.ts +14 -14
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.d.ts +3 -0
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.js +52 -0
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.js.map +1 -0
- package/modules/build-engine/lib/engine-ts/plugins/node-module-loader.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/node-module-loader.js +3 -2
- package/modules/build-engine/lib/engine-ts/plugins/node-module-loader.js.map +1 -1
- package/modules/build-engine/lib/index.d.ts +98 -86
- package/modules/build-engine/lib/index.d.ts.map +1 -1
- package/modules/build-engine/lib/index.js +69 -38
- package/modules/build-engine/lib/index.js.map +1 -1
- package/modules/dts-bundler/lib/index.d.ts +5 -0
- package/modules/dts-bundler/lib/index.d.ts.map +1 -0
- package/modules/dts-bundler/lib/index.js +344 -0
- package/modules/dts-bundler/lib/index.js.map +1 -0
- package/modules/modularize/lib/index.d.ts +3 -20
- package/modules/modularize/lib/index.d.ts.map +1 -1
- package/modules/modularize/lib/index.js +20 -75
- package/modules/modularize/lib/index.js.map +1 -1
- package/modules/modularize/lib/module-config.d.ts +134 -0
- package/modules/modularize/lib/module-config.d.ts.map +1 -0
- package/modules/modularize/lib/module-config.js +6 -0
- package/modules/modularize/lib/module-config.js.map +1 -0
- package/modules/modularize/lib/module-config.schema.json +425 -0
- package/modules/modularize/lib/module-query.d.ts +55 -0
- package/modules/modularize/lib/module-query.d.ts.map +1 -0
- package/modules/modularize/lib/module-query.js +207 -0
- package/modules/modularize/lib/module-query.js.map +1 -0
- package/modules/modularize/lib/platform-config.d.ts +43 -0
- package/modules/modularize/lib/platform-config.d.ts.map +1 -0
- package/modules/modularize/lib/platform-config.js +52 -0
- package/modules/modularize/lib/platform-config.js.map +1 -0
- package/modules/stats-query/lib/cc.config.schema.json +216 -0
- package/modules/stats-query/lib/config-interface.d.ts +61 -61
- package/modules/stats-query/lib/config-interface.js +1 -1
- package/modules/stats-query/lib/config-interface.js.map +1 -1
- package/modules/stats-query/lib/index.d.ts +62 -73
- package/modules/stats-query/lib/index.d.ts.map +1 -1
- package/modules/stats-query/lib/index.js +43 -38
- package/modules/stats-query/lib/index.js.map +1 -1
- package/modules/transformer/lib/babel/plugins.d.ts +1 -0
- package/modules/transformer/lib/babel/plugins.d.ts.map +1 -1
- package/modules/transformer/lib/babel/plugins.js +2 -4
- package/modules/transformer/lib/babel/plugins.js.map +1 -1
- package/modules/transformer/lib/index.d.ts +2 -1
- package/modules/transformer/lib/index.d.ts.map +1 -1
- package/modules/transformer/lib/index.js +4 -2
- package/modules/transformer/lib/index.js.map +1 -1
- package/modules/transformer/lib/typescript/index.d.ts +2 -0
- package/modules/transformer/lib/typescript/index.d.ts.map +1 -0
- package/modules/transformer/lib/typescript/index.js +39 -0
- package/modules/transformer/lib/typescript/index.js.map +1 -0
- package/modules/transformer/static/types-polyfill.d.ts +18 -0
- package/modules/utils/lib/index.d.ts +3 -1
- package/modules/utils/lib/index.d.ts.map +1 -1
- package/modules/utils/lib/index.js +61 -4
- package/modules/utils/lib/index.js.map +1 -1
- package/modules/utils/lib/path.d.ts +5 -0
- package/modules/utils/lib/path.d.ts.map +1 -1
- package/modules/utils/lib/path.js +21 -4
- package/modules/utils/lib/path.js.map +1 -1
- package/package.json +26 -20
- package/static/helper-dynamic-constants.txt +13 -13
- package/static/helper-file-decorator.ts +20 -20
- package/static/helper-global-exporter.txt +8 -8
- package/static/lib.dom.d.ts +2330 -2330
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/ModuleConfig",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"ModuleConfig": {
|
|
6
|
+
"additionalProperties": {},
|
|
7
|
+
"properties": {
|
|
8
|
+
"cc": {
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"description": "This is a CC-specific item difference from the node package.json standard specification.",
|
|
11
|
+
"properties": {
|
|
12
|
+
"assetDependencies": {
|
|
13
|
+
"description": "The module asset dependencies, which is an array of asset uuid.",
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"type": "array"
|
|
18
|
+
},
|
|
19
|
+
"moduleOverrides": {
|
|
20
|
+
"description": "This is different with conditional exports. Sometimes we just want to override a script file instead of the whole module. Module override could support to do this job.\n- eg. { \"test\": \"context.mode === 'BUILD'\", \"overrides\": { \"/path/to/dev.ts\": \"/path/to/build.ts\" } }",
|
|
21
|
+
"items": {
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"properties": {
|
|
24
|
+
"overrides": {
|
|
25
|
+
"additionalProperties": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"description": "The override config, override mapping from key to value.",
|
|
29
|
+
"type": "object"
|
|
30
|
+
},
|
|
31
|
+
"test": {
|
|
32
|
+
"description": "The test string to evaluate.",
|
|
33
|
+
"type": "string"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"test",
|
|
38
|
+
"overrides"
|
|
39
|
+
],
|
|
40
|
+
"type": "object"
|
|
41
|
+
},
|
|
42
|
+
"type": "array"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"type": "object"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"additionalProperties": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"description": "Specify the module dependencies is required if this module import another one. We need this field to generate the module dependency graph.",
|
|
52
|
+
"type": "object"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"additionalProperties": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
"description": "Specify the dev dependencies, these dependencies are always used in `scripts` folder.",
|
|
59
|
+
"type": "object"
|
|
60
|
+
},
|
|
61
|
+
"exports": {
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"description": "The config for conditional exports.",
|
|
64
|
+
"properties": {
|
|
65
|
+
".": {
|
|
66
|
+
"additionalProperties": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"description": "This is exported to the game runtime. Also we build the `cc.d.ts` with this export condition's `types` field. `node` field is required to resolve the path of package.json for build tools.",
|
|
70
|
+
"properties": {
|
|
71
|
+
"minigame": {
|
|
72
|
+
"anyOf": [
|
|
73
|
+
{
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"properties": {
|
|
76
|
+
"alipay": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"baidu": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
},
|
|
82
|
+
"bytedance": {
|
|
83
|
+
"type": "string"
|
|
84
|
+
},
|
|
85
|
+
"cocosplay": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"default": {
|
|
89
|
+
"description": "Default platform export for unspecified platforms.",
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"huawei": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"linksure": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"oppo": {
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"qtt": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"taobao": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"taobao_minigame": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
},
|
|
110
|
+
"vivo": {
|
|
111
|
+
"type": "string"
|
|
112
|
+
},
|
|
113
|
+
"wechat": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"wechat_mini_program": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"xiaomi": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"required": [
|
|
124
|
+
"default"
|
|
125
|
+
],
|
|
126
|
+
"type": "object"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"type": "string"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }."
|
|
133
|
+
},
|
|
134
|
+
"native": {
|
|
135
|
+
"anyOf": [
|
|
136
|
+
{
|
|
137
|
+
"additionalProperties": false,
|
|
138
|
+
"properties": {
|
|
139
|
+
"android": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
"default": {
|
|
143
|
+
"description": "Default platform export for unspecified platforms.",
|
|
144
|
+
"type": "string"
|
|
145
|
+
},
|
|
146
|
+
"ios": {
|
|
147
|
+
"type": "string"
|
|
148
|
+
},
|
|
149
|
+
"linux": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
152
|
+
"mac": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"native_editor": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
},
|
|
158
|
+
"ohos": {
|
|
159
|
+
"type": "string"
|
|
160
|
+
},
|
|
161
|
+
"open_harmony": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"windows": {
|
|
165
|
+
"type": "string"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"required": [
|
|
169
|
+
"default"
|
|
170
|
+
],
|
|
171
|
+
"type": "object"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "string"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }."
|
|
178
|
+
},
|
|
179
|
+
"node": {
|
|
180
|
+
"const": "./package.json",
|
|
181
|
+
"description": "`node` should be specified as './package.json' to resolve the path of package.json for build tools.",
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"types": {
|
|
185
|
+
"description": "This is the main module export condition.\n- The dts bundle tools resolve this condition as entry.\n- The API doc tools resolve this condition as entry.\n- If no platform export is specified, the build tools resolve this condition as entry.",
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"web": {
|
|
189
|
+
"anyOf": [
|
|
190
|
+
{
|
|
191
|
+
"additionalProperties": false,
|
|
192
|
+
"properties": {
|
|
193
|
+
"default": {
|
|
194
|
+
"description": "Default platform export for unspecified platforms.",
|
|
195
|
+
"type": "string"
|
|
196
|
+
},
|
|
197
|
+
"web_desktop": {
|
|
198
|
+
"type": "string"
|
|
199
|
+
},
|
|
200
|
+
"web_editor": {
|
|
201
|
+
"type": "string"
|
|
202
|
+
},
|
|
203
|
+
"web_mobile": {
|
|
204
|
+
"type": "string"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"required": [
|
|
208
|
+
"default"
|
|
209
|
+
],
|
|
210
|
+
"type": "object"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "string"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }."
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"required": [
|
|
220
|
+
"node",
|
|
221
|
+
"types"
|
|
222
|
+
],
|
|
223
|
+
"type": "object"
|
|
224
|
+
},
|
|
225
|
+
"./editor": {
|
|
226
|
+
"additionalProperties": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
},
|
|
229
|
+
"description": "This is exported to the editor, which is useful when we need to export some editor only interfaces. Also we build `cc.editor.d.ts` from this export condition's `types` field. If this is not specified, we use the '.' export condition by default for module editor export, otherwise, the build tools merges '.' and './editor' exports together for editor runtime environment. It is different with `web_editor` or `native_editor` platform export:\n- this condition exports some editor specific interfaces which is not cross-platform.\n- the `web_editor` or `native_editor` platform export is an editor version of implementation of interfaces defined in `types` field which should be cross-platform.",
|
|
230
|
+
"properties": {
|
|
231
|
+
"types": {
|
|
232
|
+
"description": "This is the main module export condition.\n- The dts bundle tools resolve this condition as entry.\n- The API doc tools resolve this condition as entry.\n- If no platform export is specified, the build tools resolve this condition as entry.",
|
|
233
|
+
"type": "string"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"required": [
|
|
237
|
+
"types"
|
|
238
|
+
],
|
|
239
|
+
"type": "object"
|
|
240
|
+
},
|
|
241
|
+
"./internal": {
|
|
242
|
+
"additionalProperties": {
|
|
243
|
+
"type": "string"
|
|
244
|
+
},
|
|
245
|
+
"description": "This is exported to the engine internal. It useful when we need to export some friend interfaces for internal engine modules.",
|
|
246
|
+
"properties": {
|
|
247
|
+
"minigame": {
|
|
248
|
+
"anyOf": [
|
|
249
|
+
{
|
|
250
|
+
"additionalProperties": false,
|
|
251
|
+
"properties": {
|
|
252
|
+
"alipay": {
|
|
253
|
+
"type": "string"
|
|
254
|
+
},
|
|
255
|
+
"baidu": {
|
|
256
|
+
"type": "string"
|
|
257
|
+
},
|
|
258
|
+
"bytedance": {
|
|
259
|
+
"type": "string"
|
|
260
|
+
},
|
|
261
|
+
"cocosplay": {
|
|
262
|
+
"type": "string"
|
|
263
|
+
},
|
|
264
|
+
"default": {
|
|
265
|
+
"description": "Default platform export for unspecified platforms.",
|
|
266
|
+
"type": "string"
|
|
267
|
+
},
|
|
268
|
+
"huawei": {
|
|
269
|
+
"type": "string"
|
|
270
|
+
},
|
|
271
|
+
"linksure": {
|
|
272
|
+
"type": "string"
|
|
273
|
+
},
|
|
274
|
+
"oppo": {
|
|
275
|
+
"type": "string"
|
|
276
|
+
},
|
|
277
|
+
"qtt": {
|
|
278
|
+
"type": "string"
|
|
279
|
+
},
|
|
280
|
+
"taobao": {
|
|
281
|
+
"type": "string"
|
|
282
|
+
},
|
|
283
|
+
"taobao_minigame": {
|
|
284
|
+
"type": "string"
|
|
285
|
+
},
|
|
286
|
+
"vivo": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
},
|
|
289
|
+
"wechat": {
|
|
290
|
+
"type": "string"
|
|
291
|
+
},
|
|
292
|
+
"wechat_mini_program": {
|
|
293
|
+
"type": "string"
|
|
294
|
+
},
|
|
295
|
+
"xiaomi": {
|
|
296
|
+
"type": "string"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"required": [
|
|
300
|
+
"default"
|
|
301
|
+
],
|
|
302
|
+
"type": "object"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"type": "string"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }."
|
|
309
|
+
},
|
|
310
|
+
"native": {
|
|
311
|
+
"anyOf": [
|
|
312
|
+
{
|
|
313
|
+
"additionalProperties": false,
|
|
314
|
+
"properties": {
|
|
315
|
+
"android": {
|
|
316
|
+
"type": "string"
|
|
317
|
+
},
|
|
318
|
+
"default": {
|
|
319
|
+
"description": "Default platform export for unspecified platforms.",
|
|
320
|
+
"type": "string"
|
|
321
|
+
},
|
|
322
|
+
"ios": {
|
|
323
|
+
"type": "string"
|
|
324
|
+
},
|
|
325
|
+
"linux": {
|
|
326
|
+
"type": "string"
|
|
327
|
+
},
|
|
328
|
+
"mac": {
|
|
329
|
+
"type": "string"
|
|
330
|
+
},
|
|
331
|
+
"native_editor": {
|
|
332
|
+
"type": "string"
|
|
333
|
+
},
|
|
334
|
+
"ohos": {
|
|
335
|
+
"type": "string"
|
|
336
|
+
},
|
|
337
|
+
"open_harmony": {
|
|
338
|
+
"type": "string"
|
|
339
|
+
},
|
|
340
|
+
"windows": {
|
|
341
|
+
"type": "string"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"required": [
|
|
345
|
+
"default"
|
|
346
|
+
],
|
|
347
|
+
"type": "object"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"type": "string"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }."
|
|
354
|
+
},
|
|
355
|
+
"types": {
|
|
356
|
+
"description": "This is the main module export condition.\n- The dts bundle tools resolve this condition as entry.\n- The API doc tools resolve this condition as entry.\n- If no platform export is specified, the build tools resolve this condition as entry.",
|
|
357
|
+
"type": "string"
|
|
358
|
+
},
|
|
359
|
+
"web": {
|
|
360
|
+
"anyOf": [
|
|
361
|
+
{
|
|
362
|
+
"additionalProperties": false,
|
|
363
|
+
"properties": {
|
|
364
|
+
"default": {
|
|
365
|
+
"description": "Default platform export for unspecified platforms.",
|
|
366
|
+
"type": "string"
|
|
367
|
+
},
|
|
368
|
+
"web_desktop": {
|
|
369
|
+
"type": "string"
|
|
370
|
+
},
|
|
371
|
+
"web_editor": {
|
|
372
|
+
"type": "string"
|
|
373
|
+
},
|
|
374
|
+
"web_mobile": {
|
|
375
|
+
"type": "string"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"required": [
|
|
379
|
+
"default"
|
|
380
|
+
],
|
|
381
|
+
"type": "object"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"type": "string"
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }."
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"required": [
|
|
391
|
+
"types"
|
|
392
|
+
],
|
|
393
|
+
"type": "object"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"required": [
|
|
397
|
+
"."
|
|
398
|
+
],
|
|
399
|
+
"type": "object"
|
|
400
|
+
},
|
|
401
|
+
"name": {
|
|
402
|
+
"description": "The module name.",
|
|
403
|
+
"type": "string"
|
|
404
|
+
},
|
|
405
|
+
"peerDependencies": {
|
|
406
|
+
"additionalProperties": {
|
|
407
|
+
"type": "string"
|
|
408
|
+
},
|
|
409
|
+
"description": "The dependencies between modules form a tree-structured dependency graph. The correct dependency relationship should be that the upper module depends on the lower module one-way, and the reverse is wrong. However, it is normal for modules at the same layer to depend on each other, and such dependencies should be declared as `peerDependencies`. Otherwise the Turbo pipeline will report an error due to module circular dependencies. see: https://github.com/vercel/turbo/issues/1480",
|
|
410
|
+
"type": "object"
|
|
411
|
+
},
|
|
412
|
+
"version": {
|
|
413
|
+
"description": "The version of module. It is useful when we change the module config, then we need to make some migration. This usually comes with the `cc.migrations` field.",
|
|
414
|
+
"type": "string"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"required": [
|
|
418
|
+
"name",
|
|
419
|
+
"version",
|
|
420
|
+
"exports"
|
|
421
|
+
],
|
|
422
|
+
"type": "object"
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ModuleConfig, PlatformType } from './module-config';
|
|
2
|
+
export interface ModuleQueryContext {
|
|
3
|
+
/**
|
|
4
|
+
* The engine root path.
|
|
5
|
+
*/
|
|
6
|
+
engine: string;
|
|
7
|
+
/**
|
|
8
|
+
* The platform to resolve conditional export.
|
|
9
|
+
*/
|
|
10
|
+
platform: PlatformType;
|
|
11
|
+
/**
|
|
12
|
+
* The custom export condition.
|
|
13
|
+
* The higher the array is sorted, the higher the priority is.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* [ 'webgl1', 'cannon' ] // the backend of 'gfx' and 'physics' modules.
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
customExportConditions?: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The module info manager.
|
|
24
|
+
*/
|
|
25
|
+
export declare class ModuleQuery {
|
|
26
|
+
private _context;
|
|
27
|
+
private _cachedAllModules?;
|
|
28
|
+
private _resolvedCache;
|
|
29
|
+
private _cachedHasEditorSpecificExport;
|
|
30
|
+
constructor(context: ModuleQueryContext);
|
|
31
|
+
/**
|
|
32
|
+
* Get all modules' name defined in engine workspaces.
|
|
33
|
+
*/
|
|
34
|
+
getAllModules(): Promise<string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve module package.json path by module name.
|
|
37
|
+
*/
|
|
38
|
+
resolvePackageJson(moduleName: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get module config by module name.
|
|
41
|
+
*/
|
|
42
|
+
getConfig(moduleName: string): Promise<ModuleConfig>;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve module entry path by import source.
|
|
45
|
+
*/
|
|
46
|
+
resolveExport(source: string): Promise<string | void>;
|
|
47
|
+
/**
|
|
48
|
+
* To detect whether the module has a './editor' export.
|
|
49
|
+
* @param moduleName
|
|
50
|
+
*/
|
|
51
|
+
hasEditorSpecificExport(moduleName: string): Promise<boolean>;
|
|
52
|
+
private _isWebPlatform;
|
|
53
|
+
private _isMiniGamePlatform;
|
|
54
|
+
private _isNativePlatform;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-query.d.ts","sourceRoot":"","sources":["../src/module-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAwB,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAM9H,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED;;GAEG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,QAAQ,CAAqB;IAGrC,OAAO,CAAC,iBAAiB,CAAC,CAAW;IACrC,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,8BAA8B,CAA+B;gBAExD,OAAO,EAAE,kBAAkB;IAIxC;;OAEG;IACU,aAAa,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAgChD;;OAEG;IACI,kBAAkB,CAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAMtD;;OAEG;IACU,SAAS,CAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAKlE;;OAEG;IACU,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA6EnE;;;OAGG;IACU,uBAAuB,CAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS3E,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;CAG5B"}
|