@cocos/ccbuild 2.2.0 → 2.2.2

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 (32) hide show
  1. package/modules/build-engine/lib/engine-js/index.d.ts.map +1 -1
  2. package/modules/build-engine/lib/engine-js/index.js +303 -331
  3. package/modules/build-engine/lib/engine-js/index.js.map +1 -1
  4. package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts +5 -0
  5. package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +1 -1
  6. package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js +111 -128
  7. package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js.map +1 -1
  8. package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.js +2 -31
  9. package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.js.map +1 -1
  10. package/modules/build-engine/lib/engine-ts/engine-builder.js +416 -461
  11. package/modules/build-engine/lib/engine-ts/engine-builder.js.map +1 -1
  12. package/modules/build-engine/lib/engine-ts/index.js +19 -48
  13. package/modules/build-engine/lib/engine-ts/index.js.map +1 -1
  14. package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js +31 -64
  15. package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js.map +1 -1
  16. package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.js +5 -34
  17. package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.js.map +1 -1
  18. package/modules/build-engine/lib/engine-ts/plugins/node-module-loader.js +28 -59
  19. package/modules/build-engine/lib/engine-ts/plugins/node-module-loader.js.map +1 -1
  20. package/modules/build-engine/lib/index.d.ts +6 -1
  21. package/modules/build-engine/lib/index.d.ts.map +1 -1
  22. package/modules/build-engine/lib/index.js +47 -80
  23. package/modules/build-engine/lib/index.js.map +1 -1
  24. package/modules/dts-bundler/lib/index.js +236 -265
  25. package/modules/dts-bundler/lib/index.js.map +1 -1
  26. package/modules/modularize/lib/module-query.js +153 -198
  27. package/modules/modularize/lib/module-query.js.map +1 -1
  28. package/modules/stats-query/lib/index.js +47 -80
  29. package/modules/stats-query/lib/index.js.map +1 -1
  30. package/modules/utils/lib/path.js +8 -37
  31. package/modules/utils/lib/path.js.map +1 -1
  32. package/package.json +1 -1
@@ -1,32 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) {
5
- return value instanceof P ? value : new P(function (resolve) {
6
- resolve(value);
7
- });
8
- }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) {
11
- try {
12
- step(generator.next(value));
13
- } catch (e) {
14
- reject(e);
15
- }
16
- }
17
- function rejected(value) {
18
- try {
19
- step(generator["throw"](value));
20
- } catch (e) {
21
- reject(e);
22
- }
23
- }
24
- function step(result) {
25
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26
- }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
3
  var __importDefault = this && this.__importDefault || function (mod) {
31
4
  return mod && mod.__esModule ? mod : {
32
5
  "default": mod
@@ -52,222 +25,204 @@ class ModuleQuery {
52
25
  /**
53
26
  * Get all modules' name defined in engine workspaces.
54
27
  */
55
- getAllModules() {
56
- return __awaiter(this, void 0, void 0, function* () {
57
- yield this._ensureModuleName2PkgJson();
58
- if (!this._cachedModuleName2PkgJson) {
59
- throw new Error(`Failed to resolve engine modules.`);
60
- }
61
- return Object.keys(this._cachedModuleName2PkgJson);
62
- });
28
+ async getAllModules() {
29
+ await this._ensureModuleName2PkgJson();
30
+ if (!this._cachedModuleName2PkgJson) {
31
+ throw new Error(`Failed to resolve engine modules.`);
32
+ }
33
+ return Object.keys(this._cachedModuleName2PkgJson);
63
34
  }
64
35
  /**
65
36
  * Get modules' all exports by module name.
66
37
  */
67
- getExports(moduleName) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const config = yield this.getConfig(moduleName);
70
- const moduleExports = [];
71
- if (!config.exports) {
72
- return moduleExports;
73
- }
74
- for (let exportPort in config.exports) {
75
- if (exportPort === '.' || exportPort === './') {
76
- moduleExports.push(moduleName);
77
- } else {
78
- exportPort = utils_1.ps.join(moduleName, exportPort);
79
- if (exportPort.endsWith('/')) {
80
- exportPort = exportPort.slice(0, -1);
81
- }
82
- moduleExports.push(exportPort);
38
+ async getExports(moduleName) {
39
+ const config = await this.getConfig(moduleName);
40
+ const moduleExports = [];
41
+ if (!config.exports) {
42
+ return moduleExports;
43
+ }
44
+ for (let exportPort in config.exports) {
45
+ if (exportPort === '.' || exportPort === './') {
46
+ moduleExports.push(moduleName);
47
+ } else {
48
+ exportPort = utils_1.ps.join(moduleName, exportPort);
49
+ if (exportPort.endsWith('/')) {
50
+ exportPort = exportPort.slice(0, -1);
83
51
  }
52
+ moduleExports.push(exportPort);
84
53
  }
85
- return moduleExports;
86
- });
54
+ }
55
+ return moduleExports;
87
56
  }
88
57
  /**
89
58
  * Get all the modules' exports.
90
59
  */
91
- getAllExports() {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- const allModules = yield this.getAllModules();
94
- const allExports = [];
95
- for (const moduleName of allModules) {
96
- allExports.push(...(yield this.getExports(moduleName)));
97
- }
98
- return allExports;
99
- });
60
+ async getAllExports() {
61
+ const allModules = await this.getAllModules();
62
+ const allExports = [];
63
+ for (const moduleName of allModules) {
64
+ allExports.push(...(await this.getExports(moduleName)));
65
+ }
66
+ return allExports;
100
67
  }
101
68
  /**
102
69
  * Get the map from module name to module path.
103
70
  */
104
- getExportMap() {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- const allExports = yield this.getAllExports();
107
- const map = {};
108
- for (const exportPort of allExports) {
109
- const resolved = yield this.resolveExport(exportPort);
110
- if (resolved) {
111
- map[exportPort] = resolved;
112
- }
71
+ async getExportMap() {
72
+ const allExports = await this.getAllExports();
73
+ const map = {};
74
+ for (const exportPort of allExports) {
75
+ const resolved = await this.resolveExport(exportPort);
76
+ if (resolved) {
77
+ map[exportPort] = resolved;
113
78
  }
114
- return map;
115
- });
79
+ }
80
+ return map;
116
81
  }
117
82
  /**
118
83
  * Resolve module package.json path by module name.
119
84
  */
120
- resolvePackageJson(moduleName) {
121
- return __awaiter(this, void 0, void 0, function* () {
122
- yield this._ensureModuleName2PkgJson();
123
- if (!this._cachedModuleName2PkgJson) {
124
- throw new Error(`Failed to resolve engine modules.`);
125
- }
126
- const pkgJson = this._cachedModuleName2PkgJson[moduleName];
127
- if (!pkgJson) {
128
- throw new Error(`Failed resolve package json of module: ${moduleName}.`);
129
- }
130
- return pkgJson;
131
- });
85
+ async resolvePackageJson(moduleName) {
86
+ await this._ensureModuleName2PkgJson();
87
+ if (!this._cachedModuleName2PkgJson) {
88
+ throw new Error(`Failed to resolve engine modules.`);
89
+ }
90
+ const pkgJson = this._cachedModuleName2PkgJson[moduleName];
91
+ if (!pkgJson) {
92
+ throw new Error(`Failed resolve package json of module: ${moduleName}.`);
93
+ }
94
+ return pkgJson;
132
95
  }
133
96
  /**
134
97
  * Get module config by module name.
135
98
  */
136
- getConfig(moduleName) {
137
- return __awaiter(this, void 0, void 0, function* () {
138
- const modulePath = yield this.resolvePackageJson(moduleName);
139
- if (!modulePath) {
140
- throw new Error(`Failed to resolve engine module: ${moduleName}.`);
141
- }
142
- return yield fs_extra_1.default.readJson(modulePath);
143
- });
99
+ async getConfig(moduleName) {
100
+ const modulePath = await this.resolvePackageJson(moduleName);
101
+ if (!modulePath) {
102
+ throw new Error(`Failed to resolve engine module: ${moduleName}.`);
103
+ }
104
+ return await fs_extra_1.default.readJson(modulePath);
144
105
  }
145
106
  /**
146
107
  * Resolve module entry path by import source.
147
108
  */
148
- resolveExport(source) {
109
+ async resolveExport(source) {
149
110
  var _a;
150
- return __awaiter(this, void 0, void 0, function* () {
151
- if (this._resolvedCache[source]) {
152
- return this._resolvedCache[source];
153
- }
154
- if (source.startsWith('.')) {
155
- // no relative path resolve
156
- return;
157
- }
158
- const allModules = yield this.getAllModules();
159
- const moduleName = allModules.find(moduleName => source.startsWith(moduleName));
160
- if (!moduleName) {
161
- return;
162
- }
163
- let exportPort = '.';
164
- if (utils_1.ps.relative(moduleName, source) !== '') {
165
- exportPort = './' + utils_1.ps.relative(moduleName, source);
166
- }
167
- const moduleRootDir = utils_1.ps.dirname(yield this.resolvePackageJson(moduleName));
168
- const config = yield this.getConfig(moduleName);
169
- // NOTE: '.' export port can cover all export ports.
170
- const rootExport = (_a = config.exports) === null || _a === void 0 ? void 0 : _a[exportPort];
171
- if (!rootExport) {
172
- return;
173
- }
174
- // custom condition
175
- if (this._context.customExportConditions) {
176
- for (const condition of this._context.customExportConditions) {
177
- if (typeof rootExport[condition] === 'string') {
178
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport[condition]);
179
- }
111
+ if (this._resolvedCache[source]) {
112
+ return this._resolvedCache[source];
113
+ }
114
+ if (source.startsWith('.')) {
115
+ // no relative path resolve
116
+ return;
117
+ }
118
+ const allModules = await this.getAllModules();
119
+ const moduleName = allModules.find(moduleName => source.startsWith(moduleName));
120
+ if (!moduleName) {
121
+ return;
122
+ }
123
+ let exportPort = '.';
124
+ if (utils_1.ps.relative(moduleName, source) !== '') {
125
+ exportPort = './' + utils_1.ps.relative(moduleName, source);
126
+ }
127
+ const moduleRootDir = utils_1.ps.dirname(await this.resolvePackageJson(moduleName));
128
+ const config = await this.getConfig(moduleName);
129
+ // NOTE: '.' export port can cover all export ports.
130
+ const rootExport = (_a = config.exports) === null || _a === void 0 ? void 0 : _a[exportPort];
131
+ if (!rootExport) {
132
+ return;
133
+ }
134
+ // custom condition
135
+ if (this._context.customExportConditions) {
136
+ for (const condition of this._context.customExportConditions) {
137
+ if (typeof rootExport[condition] === 'string') {
138
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport[condition]);
180
139
  }
181
140
  }
182
- // platform condition
183
- const platform = this._context.platform.toLowerCase();
184
- if (this._isWebPlatform(platform)) {
185
- if (typeof rootExport.web === 'string') {
186
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.web);
187
- } else if (typeof rootExport.web === 'object') {
188
- if (typeof rootExport.web[platform] === 'string') {
189
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.web[platform]);
190
- } else if (typeof rootExport.web.default === 'string') {
191
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.web.default);
192
- }
193
- }
194
- } else if (this._isMiniGamePlatform(platform)) {
195
- if (typeof rootExport.minigame === 'string') {
196
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.minigame);
197
- } else if (typeof rootExport.minigame === 'object') {
198
- if (typeof rootExport.minigame[platform] === 'string') {
199
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.minigame[platform]);
200
- } else if (typeof rootExport.minigame.default === 'string') {
201
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.minigame.default);
202
- }
141
+ }
142
+ // platform condition
143
+ const platform = this._context.platform.toLowerCase();
144
+ if (this._isWebPlatform(platform)) {
145
+ if (typeof rootExport.web === 'string') {
146
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.web);
147
+ } else if (typeof rootExport.web === 'object') {
148
+ if (typeof rootExport.web[platform] === 'string') {
149
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.web[platform]);
150
+ } else if (typeof rootExport.web.default === 'string') {
151
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.web.default);
203
152
  }
204
- } else if (this._isNativePlatform(platform)) {
205
- if (typeof rootExport.native === 'string') {
206
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.native);
207
- } else if (typeof rootExport.native === 'object') {
208
- if (typeof rootExport.native[platform] === 'string') {
209
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.native[platform]);
210
- } else if (typeof rootExport.native.default === 'string') {
211
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.native.default);
212
- }
153
+ }
154
+ } else if (this._isMiniGamePlatform(platform)) {
155
+ if (typeof rootExport.minigame === 'string') {
156
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.minigame);
157
+ } else if (typeof rootExport.minigame === 'object') {
158
+ if (typeof rootExport.minigame[platform] === 'string') {
159
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.minigame[platform]);
160
+ } else if (typeof rootExport.minigame.default === 'string') {
161
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.minigame.default);
213
162
  }
214
163
  }
215
- // types condition
216
- if (typeof rootExport.types === 'string') {
217
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.types);
218
- } else if (typeof rootExport === 'string') {
219
- return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport);
220
- } else {
221
- throw new Error(`Cannot resolve export: '${source}'.`);
164
+ } else if (this._isNativePlatform(platform)) {
165
+ if (typeof rootExport.native === 'string') {
166
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.native);
167
+ } else if (typeof rootExport.native === 'object') {
168
+ if (typeof rootExport.native[platform] === 'string') {
169
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.native[platform]);
170
+ } else if (typeof rootExport.native.default === 'string') {
171
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.native.default);
172
+ }
222
173
  }
223
- });
174
+ }
175
+ // types condition
176
+ if (typeof rootExport.types === 'string') {
177
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport.types);
178
+ } else if (typeof rootExport === 'string') {
179
+ return this._resolvedCache[source] = utils_1.ps.join(moduleRootDir, rootExport);
180
+ } else {
181
+ throw new Error(`Cannot resolve export: '${source}'.`);
182
+ }
224
183
  }
225
184
  /**
226
185
  * To detect whether the module has a './editor' export.
227
186
  * @param moduleName
228
187
  */
229
- hasEditorSpecificExport(moduleName) {
188
+ async hasEditorSpecificExport(moduleName) {
230
189
  var _a;
231
- return __awaiter(this, void 0, void 0, function* () {
232
- if (typeof this._cachedHasEditorSpecificExport[moduleName] === 'boolean') {
233
- return this._cachedHasEditorSpecificExport[moduleName];
234
- }
235
- const pkgJson = yield this.resolvePackageJson(moduleName);
236
- const pkg = yield fs_extra_1.default.readJson(pkgJson);
237
- return this._cachedHasEditorSpecificExport[moduleName] = typeof ((_a = pkg.exports) === null || _a === void 0 ? void 0 : _a['./editor']) !== 'undefined';
238
- });
190
+ if (typeof this._cachedHasEditorSpecificExport[moduleName] === 'boolean') {
191
+ return this._cachedHasEditorSpecificExport[moduleName];
192
+ }
193
+ const pkgJson = await this.resolvePackageJson(moduleName);
194
+ const pkg = await fs_extra_1.default.readJson(pkgJson);
195
+ return this._cachedHasEditorSpecificExport[moduleName] = typeof ((_a = pkg.exports) === null || _a === void 0 ? void 0 : _a['./editor']) !== 'undefined';
239
196
  }
240
- _ensureModuleName2PkgJson() {
241
- return __awaiter(this, void 0, void 0, function* () {
242
- if (this._cachedModuleName2PkgJson) {
243
- return;
244
- }
245
- const enginePkg = yield fs_extra_1.default.readJson(utils_1.ps.join(this._context.engine, 'package.json'));
246
- let pkgFiles = [];
247
- if (enginePkg.workspaces) {
248
- for (const ws of enginePkg.workspaces) {
249
- pkgFiles.push(...glob_1.default.sync(utils_1.ps.join(this._context.engine, ws), {
250
- ignore: '**/node_modules/**/*'
251
- }));
252
- }
197
+ async _ensureModuleName2PkgJson() {
198
+ if (this._cachedModuleName2PkgJson) {
199
+ return;
200
+ }
201
+ const enginePkg = await fs_extra_1.default.readJson(utils_1.ps.join(this._context.engine, 'package.json'));
202
+ let pkgFiles = [];
203
+ if (enginePkg.workspaces) {
204
+ for (const ws of enginePkg.workspaces) {
205
+ pkgFiles.push(...glob_1.default.sync(utils_1.ps.join(this._context.engine, ws), {
206
+ ignore: '**/node_modules/**/*'
207
+ }));
253
208
  }
254
- pkgFiles = pkgFiles.map(file => {
255
- if (fs_extra_1.default.statSync(file).isDirectory()) {
256
- const pkgFile = utils_1.ps.join(file, 'package.json');
257
- if (fs_extra_1.default.existsSync(pkgFile)) {
258
- return pkgFile;
259
- }
209
+ }
210
+ pkgFiles = pkgFiles.map(file => {
211
+ if (fs_extra_1.default.statSync(file).isDirectory()) {
212
+ const pkgFile = utils_1.ps.join(file, 'package.json');
213
+ if (fs_extra_1.default.existsSync(pkgFile)) {
214
+ return pkgFile;
260
215
  }
261
- return file;
262
- });
263
- pkgFiles = pkgFiles.filter(file => file.endsWith('package.json'));
264
- pkgFiles = pkgFiles.filter((file, index) => pkgFiles.indexOf(file) === index);
265
- this._cachedModuleName2PkgJson = {};
266
- for (const pkg of pkgFiles) {
267
- const name = (yield fs_extra_1.default.readJson(pkg)).name;
268
- this._cachedModuleName2PkgJson[name] = pkg;
269
216
  }
217
+ return file;
270
218
  });
219
+ pkgFiles = pkgFiles.filter(file => file.endsWith('package.json'));
220
+ pkgFiles = pkgFiles.filter((file, index) => pkgFiles.indexOf(file) === index);
221
+ this._cachedModuleName2PkgJson = {};
222
+ for (const pkg of pkgFiles) {
223
+ const name = (await fs_extra_1.default.readJson(pkg)).name;
224
+ this._cachedModuleName2PkgJson[name] = pkg;
225
+ }
271
226
  }
272
227
  _isWebPlatform(platform) {
273
228
  return platform.toUpperCase() in platform_config_1.WebPlatform || platform.toUpperCase() === 'HTML5';
@@ -1 +1 @@
1
- {"version":3,"file":"module-query.js","sourceRoot":"","sources":["../src/module-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,wDAA0B;AAC1B,uDAAkF;AAClF,gDAAwB;AACxB,0CAAoC;AAuBpC;;GAEG;AACH,MAAa,WAAW;IAQpB,YAAa,OAA2B;QAHhC,mBAAc,GAA2B,EAAE,CAAC,CAAE,wCAAwC;QACtF,mCAA8B,GAA4B,EAAE,CAAC;QAGjE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;I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AI,CAAC,KAAK,KAAK,CAAC,CAAC;QAC9E,IAAI,CAAC,yBAAyB,GAAG,EAAE,CAAC;QACpC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;YACxB,MAAM,IAAI,GAAG,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3C,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SAC9C;IACL,CAAC;IAEO,cAAc,CAAE,QAAgB;QACpC,OAAO,QAAQ,CAAC,WAAW,EAAE,IAAI,6BAAW,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;IACvF,CAAC;IAEO,mBAAmB,CAAE,QAAgB;QACzC,OAAO,QAAQ,CAAC,WAAW,EAAE,IAAI,kCAAgB,CAAC;IACtD,CAAC;IAEO,iBAAiB,CAAE,QAAgB;QACvC,OAAO,QAAQ,CAAC,WAAW,EAAE,IAAI,gCAAc,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;IAC3F,CAAC;CACJ;AA5OD,kCA4OC"}
@@ -31,33 +31,6 @@ var __importStar = this && this.__importStar || function (mod) {
31
31
  __setModuleDefault(result, mod);
32
32
  return result;
33
33
  };
34
- var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
35
- function adopt(value) {
36
- return value instanceof P ? value : new P(function (resolve) {
37
- resolve(value);
38
- });
39
- }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) {
42
- try {
43
- step(generator.next(value));
44
- } catch (e) {
45
- reject(e);
46
- }
47
- }
48
- function rejected(value) {
49
- try {
50
- step(generator["throw"](value));
51
- } catch (e) {
52
- reject(e);
53
- }
54
- }
55
- function step(result) {
56
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
57
- }
58
- step((generator = generator.apply(thisArg, _arguments || [])).next());
59
- });
60
- };
61
34
  var __importDefault = this && this.__importDefault || function (mod) {
62
35
  return mod && mod.__esModule ? mod : {
63
36
  "default": mod
@@ -81,16 +54,14 @@ class StatsQuery {
81
54
  /**
82
55
  * @param engine Path to the engine root.
83
56
  */
84
- static create(engine) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- const configFile = path_1.default.join(engine, 'cc.config.json');
87
- const config = json5_1.default.parse(yield fs_extra_1.default.readFile(configFile, 'utf8'));
88
- // @ts-expect-error we should delete this property
89
- delete config['$schema'];
90
- const query = new StatsQuery(engine, config);
91
- yield query._initialize();
92
- return query;
93
- });
57
+ static async create(engine) {
58
+ const configFile = path_1.default.join(engine, 'cc.config.json');
59
+ const config = json5_1.default.parse(await fs_extra_1.default.readFile(configFile, 'utf8'));
60
+ // @ts-expect-error we should delete this property
61
+ delete config['$schema'];
62
+ const query = new StatsQuery(engine, config);
63
+ await query._initialize();
64
+ return query;
94
65
  }
95
66
  /**
96
67
  * Gets the path to the engine root.
@@ -230,21 +201,19 @@ class StatsQuery {
230
201
  });
231
202
  return overrides;
232
203
  }
233
- static _readModulesInDir(exportsDir, mapper) {
234
- return __awaiter(this, void 0, void 0, function* () {
235
- const result = {};
236
- for (const entryFileName of yield fs_extra_1.default.readdir(exportsDir)) {
237
- const entryExtName = path_1.default.extname(entryFileName);
238
- if (!entryExtName.toLowerCase().endsWith('.ts')) {
239
- continue;
240
- }
241
- const baseName = path_1.default.basename(entryFileName, entryExtName);
242
- const moduleName = mapper(baseName);
243
- const entryFile = path_1.default.join(exportsDir, entryFileName);
244
- result[moduleName] = entryFile;
245
- }
246
- return result;
247
- });
204
+ static async _readModulesInDir(exportsDir, mapper) {
205
+ const result = {};
206
+ for (const entryFileName of await fs_extra_1.default.readdir(exportsDir)) {
207
+ const entryExtName = path_1.default.extname(entryFileName);
208
+ if (!entryExtName.toLowerCase().endsWith('.ts')) {
209
+ continue;
210
+ }
211
+ const baseName = path_1.default.basename(entryFileName, entryExtName);
212
+ const moduleName = mapper(baseName);
213
+ const entryFile = path_1.default.join(exportsDir, entryFileName);
214
+ result[moduleName] = entryFile;
215
+ }
216
+ return result;
248
217
  }
249
218
  static _baseNameToFeatureUnitName(baseName) {
250
219
  return `${baseName}`;
@@ -281,38 +250,36 @@ class StatsQuery {
281
250
  }
282
251
  return resultPath;
283
252
  }
284
- _initialize() {
285
- return __awaiter(this, void 0, void 0, function* () {
286
- const {
287
- _config: config,
288
- _engine: engine
289
- } = this;
290
- const featureUnits = this._featureUnits = yield StatsQuery._readModulesInDir(path_1.default.join(engine, 'exports'), StatsQuery._baseNameToFeatureUnitName);
291
- for (const [featureName, feature] of Object.entries(config.features)) {
292
- const parsedFeature = this._features[featureName] = {
293
- modules: []
294
- };
295
- for (const moduleFileBaseName of feature.modules) {
296
- const featureUnitName = StatsQuery._baseNameToFeatureUnitName(moduleFileBaseName);
297
- if (!featureUnits[featureUnitName]) {
298
- throw new Error(`Invalid config file: '${moduleFileBaseName}' is not a valid module.`);
299
- }
300
- parsedFeature.modules.push(featureUnitName);
253
+ async _initialize() {
254
+ const {
255
+ _config: config,
256
+ _engine: engine
257
+ } = this;
258
+ const featureUnits = this._featureUnits = await StatsQuery._readModulesInDir(path_1.default.join(engine, 'exports'), StatsQuery._baseNameToFeatureUnitName);
259
+ for (const [featureName, feature] of Object.entries(config.features)) {
260
+ const parsedFeature = this._features[featureName] = {
261
+ modules: []
262
+ };
263
+ for (const moduleFileBaseName of feature.modules) {
264
+ const featureUnitName = StatsQuery._baseNameToFeatureUnitName(moduleFileBaseName);
265
+ if (!featureUnits[featureUnitName]) {
266
+ throw new Error(`Invalid config file: '${moduleFileBaseName}' is not a valid module.`);
301
267
  }
302
- parsedFeature.intrinsicFlags = feature.intrinsicFlags;
268
+ parsedFeature.modules.push(featureUnitName);
303
269
  }
304
- if (config.index) {
305
- if (config.index.modules) {
306
- for (const [k, v] of Object.entries(config.index.modules)) {
307
- this._index.modules[StatsQuery._baseNameToFeatureUnitName(k)] = v;
308
- }
270
+ parsedFeature.intrinsicFlags = feature.intrinsicFlags;
271
+ }
272
+ if (config.index) {
273
+ if (config.index.modules) {
274
+ for (const [k, v] of Object.entries(config.index.modules)) {
275
+ this._index.modules[StatsQuery._baseNameToFeatureUnitName(k)] = v;
309
276
  }
310
- this._index = Object.assign(Object.assign({}, config.index), {
311
- modules: this._index.modules
312
- });
313
277
  }
314
- this._editorPublicModules = yield StatsQuery._readModulesInDir(path_1.default.join(engine, 'editor', 'exports'), StatsQuery._editorBaseNameToModuleName);
315
- });
278
+ this._index = Object.assign(Object.assign({}, config.index), {
279
+ modules: this._index.modules
280
+ });
281
+ }
282
+ this._editorPublicModules = await StatsQuery._readModulesInDir(path_1.default.join(engine, 'editor', 'exports'), StatsQuery._editorBaseNameToModuleName);
316
283
  }
317
284
  }
318
285
  exports.StatsQuery = StatsQuery;