@azure-tools/typespec-python 0.60.1 → 0.60.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.
- package/dist/scripts/eng/regenerate-common.d.ts +41 -0
- package/dist/scripts/eng/regenerate-common.d.ts.map +1 -0
- package/dist/scripts/eng/regenerate-common.js +382 -0
- package/dist/scripts/eng/regenerate-common.js.map +1 -0
- package/dist/scripts/eng/regenerate.js +30 -381
- package/dist/scripts/eng/regenerate.js.map +1 -1
- package/package.json +15 -15
- package/scripts/__pycache__/package_manager.cpython-310.pyc +0 -0
- package/scripts/__pycache__/venvtools.cpython-310.pyc +0 -0
- package/scripts/eng/regenerate-common.ts +449 -0
- package/scripts/eng/regenerate.ts +41 -422
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { promises } from "fs";
|
|
2
|
+
import { dirname, join, relative, resolve } from "path";
|
|
3
|
+
|
|
4
|
+
// ---- Shared constants ----
|
|
5
|
+
|
|
6
|
+
export const SKIP_SPECS: string[] = ["type/file"];
|
|
7
|
+
|
|
8
|
+
export const SpecialFlags: Record<string, Record<string, any>> = {
|
|
9
|
+
azure: {
|
|
10
|
+
"generate-test": true,
|
|
11
|
+
"generate-sample": true,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// ---- Base emitter options (shared across repos) ----
|
|
16
|
+
|
|
17
|
+
export const BASE_AZURE_EMITTER_OPTIONS: Record<string, Record<string, string> | Record<string, string>[]> = {
|
|
18
|
+
"azure/client-generator-core/access": {
|
|
19
|
+
namespace: "specs.azure.clientgenerator.core.access",
|
|
20
|
+
},
|
|
21
|
+
"azure/client-generator-core/alternate-type": {
|
|
22
|
+
namespace: "specs.azure.clientgenerator.core.alternatetype",
|
|
23
|
+
},
|
|
24
|
+
"azure/client-generator-core/api-version": {
|
|
25
|
+
namespace: "specs.azure.clientgenerator.core.apiversion",
|
|
26
|
+
},
|
|
27
|
+
"azure/client-generator-core/client-initialization/default": {
|
|
28
|
+
namespace: "specs.azure.clientgenerator.core.clientinitialization.default",
|
|
29
|
+
},
|
|
30
|
+
"azure/client-generator-core/client-initialization/individually": {
|
|
31
|
+
namespace: "specs.azure.clientgenerator.core.clientinitialization.individually",
|
|
32
|
+
},
|
|
33
|
+
"azure/client-generator-core/client-initialization/individuallyParent": {
|
|
34
|
+
namespace: "specs.azure.clientgenerator.core.clientinitialization.individuallyparent",
|
|
35
|
+
},
|
|
36
|
+
"azure/client-generator-core/client-location": {
|
|
37
|
+
namespace: "specs.azure.clientgenerator.core.clientlocation",
|
|
38
|
+
},
|
|
39
|
+
"azure/client-generator-core/deserialize-empty-string-as-null": {
|
|
40
|
+
namespace: "specs.azure.clientgenerator.core.emptystring",
|
|
41
|
+
},
|
|
42
|
+
"azure/client-generator-core/flatten-property": {
|
|
43
|
+
namespace: "specs.azure.clientgenerator.core.flattenproperty",
|
|
44
|
+
},
|
|
45
|
+
"azure/client-generator-core/usage": {
|
|
46
|
+
namespace: "specs.azure.clientgenerator.core.usage",
|
|
47
|
+
},
|
|
48
|
+
"azure/client-generator-core/override": {
|
|
49
|
+
namespace: "specs.azure.clientgenerator.core.override",
|
|
50
|
+
},
|
|
51
|
+
"azure/client-generator-core/hierarchy-building": {
|
|
52
|
+
namespace: "specs.azure.clientgenerator.core.hierarchybuilding",
|
|
53
|
+
},
|
|
54
|
+
"azure/core/basic": {
|
|
55
|
+
namespace: "specs.azure.core.basic",
|
|
56
|
+
},
|
|
57
|
+
"azure/core/lro/rpc": {
|
|
58
|
+
namespace: "specs.azure.core.lro.rpc",
|
|
59
|
+
},
|
|
60
|
+
"azure/core/lro/standard": {
|
|
61
|
+
namespace: "specs.azure.core.lro.standard",
|
|
62
|
+
},
|
|
63
|
+
"azure/core/model": {
|
|
64
|
+
namespace: "specs.azure.core.model",
|
|
65
|
+
},
|
|
66
|
+
"azure/core/page": {
|
|
67
|
+
namespace: "specs.azure.core.page",
|
|
68
|
+
},
|
|
69
|
+
"azure/core/scalar": {
|
|
70
|
+
namespace: "specs.azure.core.scalar",
|
|
71
|
+
},
|
|
72
|
+
"azure/core/traits": {
|
|
73
|
+
namespace: "specs.azure.core.traits",
|
|
74
|
+
},
|
|
75
|
+
"azure/encode/duration": {
|
|
76
|
+
namespace: "specs.azure.encode.duration",
|
|
77
|
+
},
|
|
78
|
+
"azure/example/basic": {
|
|
79
|
+
namespace: "specs.azure.example.basic",
|
|
80
|
+
},
|
|
81
|
+
"azure/payload/pageable": {
|
|
82
|
+
namespace: "specs.azure.payload.pageable",
|
|
83
|
+
},
|
|
84
|
+
"azure/versioning/previewVersion": {
|
|
85
|
+
namespace: "specs.azure.versioning.previewversion",
|
|
86
|
+
},
|
|
87
|
+
"client/structure/default": {
|
|
88
|
+
namespace: "client.structure.service",
|
|
89
|
+
},
|
|
90
|
+
"client/structure/multi-client": {
|
|
91
|
+
"package-name": "client-structure-multiclient",
|
|
92
|
+
"namespace": "client.structure.multiclient",
|
|
93
|
+
},
|
|
94
|
+
"client/structure/renamed-operation": {
|
|
95
|
+
"package-name": "client-structure-renamedoperation",
|
|
96
|
+
"namespace": "client.structure.renamedoperation",
|
|
97
|
+
},
|
|
98
|
+
"client/structure/two-operation-group": {
|
|
99
|
+
"package-name": "client-structure-twooperationgroup",
|
|
100
|
+
"namespace": "client.structure.twooperationgroup",
|
|
101
|
+
},
|
|
102
|
+
"client/naming": {
|
|
103
|
+
namespace: "client.naming.main",
|
|
104
|
+
},
|
|
105
|
+
"client/overload": {
|
|
106
|
+
namespace: "client.overload",
|
|
107
|
+
},
|
|
108
|
+
"encode/duration": {
|
|
109
|
+
namespace: "encode.duration",
|
|
110
|
+
},
|
|
111
|
+
"encode/numeric": {
|
|
112
|
+
namespace: "encode.numeric",
|
|
113
|
+
},
|
|
114
|
+
"parameters/basic": {
|
|
115
|
+
namespace: "parameters.basic",
|
|
116
|
+
},
|
|
117
|
+
"parameters/spread": {
|
|
118
|
+
namespace: "parameters.spread",
|
|
119
|
+
},
|
|
120
|
+
"payload/content-negotiation": {
|
|
121
|
+
namespace: "payload.contentnegotiation",
|
|
122
|
+
},
|
|
123
|
+
"payload/multipart": {
|
|
124
|
+
namespace: "payload.multipart",
|
|
125
|
+
},
|
|
126
|
+
"serialization/encoded-name/json": {
|
|
127
|
+
namespace: "serialization.encodedname.json",
|
|
128
|
+
},
|
|
129
|
+
"special-words": {
|
|
130
|
+
namespace: "specialwords",
|
|
131
|
+
},
|
|
132
|
+
"service/multi-service": {
|
|
133
|
+
namespace: "service.multiservice",
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const BASE_EMITTER_OPTIONS: Record<string, Record<string, string> | Record<string, string>[]> = {
|
|
138
|
+
"resiliency/srv-driven/old.tsp": {
|
|
139
|
+
"package-name": "resiliency-srv-driven1",
|
|
140
|
+
"namespace": "resiliency.srv.driven1",
|
|
141
|
+
"package-mode": "azure-dataplane",
|
|
142
|
+
"package-pprint-name": "ResiliencySrvDriven1",
|
|
143
|
+
},
|
|
144
|
+
"resiliency/srv-driven": {
|
|
145
|
+
"package-name": "resiliency-srv-driven2",
|
|
146
|
+
"namespace": "resiliency.srv.driven2",
|
|
147
|
+
"package-mode": "azure-dataplane",
|
|
148
|
+
"package-pprint-name": "ResiliencySrvDriven2",
|
|
149
|
+
},
|
|
150
|
+
"authentication/api-key": {
|
|
151
|
+
"clear-output-folder": "true",
|
|
152
|
+
},
|
|
153
|
+
"authentication/http/custom": {
|
|
154
|
+
"package-name": "authentication-http-custom",
|
|
155
|
+
"namespace": "authentication.http.custom",
|
|
156
|
+
"package-pprint-name": "Authentication Http Custom",
|
|
157
|
+
},
|
|
158
|
+
"authentication/union": [
|
|
159
|
+
{
|
|
160
|
+
"package-name": "authentication-union",
|
|
161
|
+
"namespace": "authentication.union",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"package-name": "setuppy-authentication-union",
|
|
165
|
+
"namespace": "setuppy.authentication.union",
|
|
166
|
+
"keep-setup-py": "true",
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
"type/array": {
|
|
170
|
+
"package-name": "typetest-array",
|
|
171
|
+
"namespace": "typetest.array",
|
|
172
|
+
},
|
|
173
|
+
"type/dictionary": {
|
|
174
|
+
"package-name": "typetest-dictionary",
|
|
175
|
+
"namespace": "typetest.dictionary",
|
|
176
|
+
},
|
|
177
|
+
"type/enum/extensible": {
|
|
178
|
+
"package-name": "typetest-enum-extensible",
|
|
179
|
+
"namespace": "typetest.enum.extensible",
|
|
180
|
+
},
|
|
181
|
+
"type/enum/fixed": {
|
|
182
|
+
"package-name": "typetest-enum-fixed",
|
|
183
|
+
"namespace": "typetest.enum.fixed",
|
|
184
|
+
},
|
|
185
|
+
"type/model/empty": {
|
|
186
|
+
"package-name": "typetest-model-empty",
|
|
187
|
+
"namespace": "typetest.model.empty",
|
|
188
|
+
},
|
|
189
|
+
"type/model/inheritance/enum-discriminator": {
|
|
190
|
+
"package-name": "typetest-model-enumdiscriminator",
|
|
191
|
+
"namespace": "typetest.model.enumdiscriminator",
|
|
192
|
+
},
|
|
193
|
+
"type/model/inheritance/nested-discriminator": {
|
|
194
|
+
"package-name": "typetest-model-nesteddiscriminator",
|
|
195
|
+
"namespace": "typetest.model.nesteddiscriminator",
|
|
196
|
+
},
|
|
197
|
+
"type/model/inheritance/not-discriminated": {
|
|
198
|
+
"package-name": "typetest-model-notdiscriminated",
|
|
199
|
+
"namespace": "typetest.model.notdiscriminated",
|
|
200
|
+
},
|
|
201
|
+
"type/model/inheritance/single-discriminator": {
|
|
202
|
+
"package-name": "typetest-model-singlediscriminator",
|
|
203
|
+
"namespace": "typetest.model.singlediscriminator",
|
|
204
|
+
},
|
|
205
|
+
"type/model/inheritance/recursive": {
|
|
206
|
+
"package-name": "typetest-model-recursive",
|
|
207
|
+
"namespace": "typetest.model.recursive",
|
|
208
|
+
},
|
|
209
|
+
"type/model/usage": {
|
|
210
|
+
"package-name": "typetest-model-usage",
|
|
211
|
+
"namespace": "typetest.model.usage",
|
|
212
|
+
},
|
|
213
|
+
"type/model/visibility": [
|
|
214
|
+
{
|
|
215
|
+
"package-name": "typetest-model-visibility",
|
|
216
|
+
"namespace": "typetest.model.visibility",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"package-name": "headasbooleantrue",
|
|
220
|
+
"namespace": "headasbooleantrue",
|
|
221
|
+
"head-as-boolean": "true",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"package-name": "headasbooleanfalse",
|
|
225
|
+
"namespace": "headasbooleanfalse",
|
|
226
|
+
"head-as-boolean": "false",
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
"type/property/nullable": {
|
|
230
|
+
"package-name": "typetest-property-nullable",
|
|
231
|
+
"namespace": "typetest.property.nullable",
|
|
232
|
+
},
|
|
233
|
+
"type/property/optionality": {
|
|
234
|
+
"package-name": "typetest-property-optional",
|
|
235
|
+
"namespace": "typetest.property.optional",
|
|
236
|
+
},
|
|
237
|
+
"type/property/additional-properties": {
|
|
238
|
+
"package-name": "typetest-property-additionalproperties",
|
|
239
|
+
"namespace": "typetest.property.additionalproperties",
|
|
240
|
+
},
|
|
241
|
+
"type/scalar": {
|
|
242
|
+
"package-name": "typetest-scalar",
|
|
243
|
+
"namespace": "typetest.scalar",
|
|
244
|
+
},
|
|
245
|
+
"type/property/value-types": {
|
|
246
|
+
"package-name": "typetest-property-valuetypes",
|
|
247
|
+
"namespace": "typetest.property.valuetypes",
|
|
248
|
+
},
|
|
249
|
+
"type/union": {
|
|
250
|
+
"package-name": "typetest-union",
|
|
251
|
+
"namespace": "typetest.union",
|
|
252
|
+
},
|
|
253
|
+
"type/union/discriminated": {
|
|
254
|
+
"package-name": "typetest-discriminatedunion",
|
|
255
|
+
"namespace": "typetest.discriminatedunion",
|
|
256
|
+
},
|
|
257
|
+
"type/file": {
|
|
258
|
+
"package-name": "typetest-file",
|
|
259
|
+
"namespace": "typetest.file",
|
|
260
|
+
},
|
|
261
|
+
"documentation": {
|
|
262
|
+
"package-name": "specs-documentation",
|
|
263
|
+
"namespace": "specs.documentation",
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// ---- Shared interfaces ----
|
|
268
|
+
|
|
269
|
+
export interface TspCommand {
|
|
270
|
+
outputDir: string;
|
|
271
|
+
command: string | string[];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface RegenerateFlagsInput {
|
|
275
|
+
flavor?: string;
|
|
276
|
+
debug?: boolean;
|
|
277
|
+
name?: string;
|
|
278
|
+
pyodide?: boolean;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface RegenerateFlags {
|
|
282
|
+
flavor: string;
|
|
283
|
+
debug: boolean;
|
|
284
|
+
name?: string;
|
|
285
|
+
pyodide?: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface ProcessedEmitterOption {
|
|
289
|
+
options: Record<string, string>;
|
|
290
|
+
outputDir: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface RegenerateConfig {
|
|
294
|
+
azureHttpSpecs: string;
|
|
295
|
+
httpSpecs: string;
|
|
296
|
+
emitterOptions: Record<string, Record<string, string> | Record<string, string>[]>;
|
|
297
|
+
azureEmitterOptions: Record<string, Record<string, string> | Record<string, string>[]>;
|
|
298
|
+
preprocess: (flags: RegenerateFlagsInput) => Promise<void>;
|
|
299
|
+
getCmdList: (spec: string, flags: RegenerateFlags) => TspCommand[];
|
|
300
|
+
executeCommand: (cmd: TspCommand) => Promise<void>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// ---- Shared utility functions ----
|
|
304
|
+
|
|
305
|
+
export function toPosix(dir: string): string {
|
|
306
|
+
return dir.replace(/\\/g, "/");
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export function getEmitterOption(spec: string, flavor: string, config: RegenerateConfig): Record<string, string>[] {
|
|
310
|
+
const specDir = spec.includes("azure") ? config.azureHttpSpecs : config.httpSpecs;
|
|
311
|
+
const relativeSpec = toPosix(relative(specDir, spec));
|
|
312
|
+
const key = relativeSpec.includes("resiliency/srv-driven/old.tsp") ? relativeSpec : dirname(relativeSpec);
|
|
313
|
+
const emitter_options = config.emitterOptions[key] ||
|
|
314
|
+
(flavor === "azure" ? config.azureEmitterOptions[key] : [{}]) || [{}];
|
|
315
|
+
return Array.isArray(emitter_options) ? emitter_options : [emitter_options];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export async function getSubdirectories(baseDir: string, flags: RegenerateFlags): Promise<string[]> {
|
|
319
|
+
const subdirectories: string[] = [];
|
|
320
|
+
|
|
321
|
+
async function searchDir(currentDir: string) {
|
|
322
|
+
const items = await promises.readdir(currentDir, { withFileTypes: true });
|
|
323
|
+
|
|
324
|
+
const promisesArray = items.map(async (item) => {
|
|
325
|
+
const subDirPath = join(currentDir, item.name);
|
|
326
|
+
if (item.isDirectory()) {
|
|
327
|
+
const mainTspPath = join(subDirPath, "main.tsp");
|
|
328
|
+
const clientTspPath = join(subDirPath, "client.tsp");
|
|
329
|
+
|
|
330
|
+
const mainTspRelativePath = toPosix(relative(baseDir, mainTspPath));
|
|
331
|
+
|
|
332
|
+
if (SKIP_SPECS.some((skipSpec) => mainTspRelativePath.includes(skipSpec))) return;
|
|
333
|
+
|
|
334
|
+
const hasMainTsp = await promises
|
|
335
|
+
.access(mainTspPath)
|
|
336
|
+
.then(() => true)
|
|
337
|
+
.catch(() => false);
|
|
338
|
+
const hasClientTsp = await promises
|
|
339
|
+
.access(clientTspPath)
|
|
340
|
+
.then(() => true)
|
|
341
|
+
.catch(() => false);
|
|
342
|
+
|
|
343
|
+
if (mainTspRelativePath.toLowerCase().includes(flags.name || "")) {
|
|
344
|
+
if (mainTspRelativePath.includes("resiliency/srv-driven")) {
|
|
345
|
+
subdirectories.push(resolve(subDirPath, "old.tsp"));
|
|
346
|
+
}
|
|
347
|
+
if (hasClientTsp) {
|
|
348
|
+
subdirectories.push(resolve(subDirPath, "client.tsp"));
|
|
349
|
+
} else if (hasMainTsp) {
|
|
350
|
+
subdirectories.push(resolve(subDirPath, "main.tsp"));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Recursively search in the subdirectory
|
|
355
|
+
await searchDir(subDirPath);
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
await Promise.all(promisesArray);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
await searchDir(baseDir);
|
|
363
|
+
return subdirectories;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export function defaultPackageName(spec: string, config: RegenerateConfig): string {
|
|
367
|
+
const specDir = spec.includes("azure") ? config.azureHttpSpecs : config.httpSpecs;
|
|
368
|
+
return toPosix(relative(specDir, dirname(spec)))
|
|
369
|
+
.replace(/\//g, "-")
|
|
370
|
+
.toLowerCase();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export function buildOptions(
|
|
374
|
+
spec: string,
|
|
375
|
+
generatedFolder: string,
|
|
376
|
+
flags: RegenerateFlags,
|
|
377
|
+
config: RegenerateConfig,
|
|
378
|
+
): ProcessedEmitterOption[] {
|
|
379
|
+
const results: ProcessedEmitterOption[] = [];
|
|
380
|
+
for (const emitterConfig of getEmitterOption(spec, flags.flavor, config)) {
|
|
381
|
+
const options: Record<string, string> = { ...emitterConfig };
|
|
382
|
+
if (flags.pyodide) {
|
|
383
|
+
options["use-pyodide"] = "true";
|
|
384
|
+
}
|
|
385
|
+
options["flavor"] = flags.flavor;
|
|
386
|
+
for (const [k, v] of Object.entries(SpecialFlags[flags.flavor] ?? {})) {
|
|
387
|
+
options[k] = v;
|
|
388
|
+
}
|
|
389
|
+
if (options["emitter-output-dir"] === undefined) {
|
|
390
|
+
const packageName = options["package-name"] || defaultPackageName(spec, config);
|
|
391
|
+
options["emitter-output-dir"] = toPosix(`${generatedFolder}/test/${flags.flavor}/generated/${packageName}`);
|
|
392
|
+
}
|
|
393
|
+
if (flags.debug) {
|
|
394
|
+
options["debug"] = "true";
|
|
395
|
+
}
|
|
396
|
+
options["examples-dir"] = toPosix(join(dirname(spec), "examples"));
|
|
397
|
+
results.push({
|
|
398
|
+
options,
|
|
399
|
+
outputDir: options["emitter-output-dir"],
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
return results;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export async function runTaskPool(tasks: Array<() => Promise<void>>, poolLimit: number): Promise<void> {
|
|
406
|
+
async function worker(start: number, end: number) {
|
|
407
|
+
while (start < end) {
|
|
408
|
+
await tasks[start]();
|
|
409
|
+
start++;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const workers = [];
|
|
414
|
+
let start = 0;
|
|
415
|
+
while (start < tasks.length) {
|
|
416
|
+
const end = Math.min(start + poolLimit, tasks.length);
|
|
417
|
+
workers.push((async () => await worker(start, end))());
|
|
418
|
+
start = end;
|
|
419
|
+
}
|
|
420
|
+
await Promise.all(workers);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export async function regenerate(flags: RegenerateFlagsInput, config: RegenerateConfig): Promise<void> {
|
|
424
|
+
if (flags.flavor === undefined) {
|
|
425
|
+
await regenerate({ flavor: "azure", ...flags }, config);
|
|
426
|
+
await regenerate({ flavor: "unbranded", ...flags }, config);
|
|
427
|
+
} else {
|
|
428
|
+
await config.preprocess(flags);
|
|
429
|
+
|
|
430
|
+
const flagsResolved: RegenerateFlags = { debug: false, flavor: flags.flavor, ...flags };
|
|
431
|
+
const subdirectoriesForAzure = await getSubdirectories(config.azureHttpSpecs, flagsResolved);
|
|
432
|
+
const subdirectoriesForNonAzure = await getSubdirectories(config.httpSpecs, flagsResolved);
|
|
433
|
+
const subdirectories =
|
|
434
|
+
flags.flavor === "azure"
|
|
435
|
+
? [...subdirectoriesForAzure, ...subdirectoriesForNonAzure]
|
|
436
|
+
: subdirectoriesForNonAzure;
|
|
437
|
+
const cmdList: TspCommand[] = subdirectories.flatMap((subdirectory) =>
|
|
438
|
+
config.getCmdList(subdirectory, flagsResolved),
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
// Create tasks as functions for the pool
|
|
442
|
+
const tasks: Array<() => Promise<void>> = cmdList.map((tspCommand) => {
|
|
443
|
+
return () => config.executeCommand(tspCommand);
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
// Run tasks with a concurrency limit
|
|
447
|
+
await runTaskPool(tasks, 30);
|
|
448
|
+
}
|
|
449
|
+
}
|