@@ -3,7 +3,7 @@ import { dirname, join, relative, resolve } from "path";
33
44// ---- Shared constants ----
55
6- export const SKIP_SPECS : string [ ] = [ "type/file" ] ;
6+ export const SKIP_SPECS : string [ ] = [ "type/file" , "service/multiple-services" ] ;
77
88export const SpecialFlags : Record < string , Record < string , any > > = {
99 azure : {
@@ -218,6 +218,7 @@ export const BASE_EMITTER_OPTIONS: Record<
218218 "package-name" : "generation-subdir" ,
219219 namespace : "generation.subdir" ,
220220 "generation-subdir" : "_generated" ,
221+ "generate-test" : "false" ,
221222 "clear-output-folder" : "true" ,
222223 } ,
223224 ] ,
@@ -286,6 +287,7 @@ export const BASE_EMITTER_OPTIONS: Record<
286287 {
287288 "package-name" : "generation-subdir2" ,
288289 namespace : "generation.subdir2" ,
290+ "generate-test" : "false" ,
289291 "generation-subdir" : "_generated" ,
290292 } ,
291293 ] ,
@@ -313,11 +315,6 @@ export interface RegenerateFlags {
313315 pyodide ?: boolean ;
314316}
315317
316- export interface ProcessedEmitterOption {
317- options : Record < string , string > ;
318- outputDir : string ;
319- }
320-
321318export interface RegenerateConfig {
322319 azureHttpSpecs : string ;
323320 httpSpecs : string ;
@@ -400,48 +397,6 @@ export async function getSubdirectories(
400397 return subdirectories ;
401398}
402399
403- export function defaultPackageName ( spec : string , config : RegenerateConfig ) : string {
404- const specDir = spec . includes ( "azure" ) ? config . azureHttpSpecs : config . httpSpecs ;
405- return toPosix ( relative ( specDir , dirname ( spec ) ) )
406- . replace ( / \/ / g, "-" )
407- . toLowerCase ( ) ;
408- }
409-
410- export function buildOptions (
411- spec : string ,
412- generatedFolder : string ,
413- flags : RegenerateFlags ,
414- config : RegenerateConfig ,
415- ) : ProcessedEmitterOption [ ] {
416- const results : ProcessedEmitterOption [ ] = [ ] ;
417- for ( const emitterConfig of getEmitterOption ( spec , flags . flavor , config ) ) {
418- const options : Record < string , string > = { ...emitterConfig } ;
419- if ( flags . pyodide ) {
420- options [ "use-pyodide" ] = "true" ;
421- }
422- options [ "flavor" ] = flags . flavor ;
423- for ( const [ k , v ] of Object . entries ( SpecialFlags [ flags . flavor ] ?? { } ) ) {
424- options [ k ] = v ;
425- }
426- if ( options [ "emitter-output-dir" ] === undefined ) {
427- const packageName = options [ "package-name" ] || defaultPackageName ( spec , config ) ;
428- // Output to new tests/generated/<flavor>/<package> structure
429- options [ "emitter-output-dir" ] = toPosix (
430- `${ generatedFolder } /../tests/generated/${ flags . flavor } /${ packageName } ` ,
431- ) ;
432- }
433- if ( flags . debug ) {
434- options [ "debug" ] = "true" ;
435- }
436- options [ "examples-dir" ] = toPosix ( join ( dirname ( spec ) , "examples" ) ) ;
437- results . push ( {
438- options,
439- outputDir : options [ "emitter-output-dir" ] ,
440- } ) ;
441- }
442- return results ;
443- }
444-
445400export async function runTaskPool (
446401 tasks : Array < ( ) => Promise < void > > ,
447402 poolLimit : number ,
0 commit comments