1- import type { Runner } from './runners' ;
2-
3- import { createRunner } from './runners' ;
4- import { cleanupDirectory } from './utils/file' ;
1+ import runner from './runner' ;
2+ import { cleanupDirectory } from './file' ;
53
64export interface BuildRunArgs {
75 md2md ?: boolean ;
@@ -18,41 +16,29 @@ export interface TranslateRunArgs {
1816}
1917
2018class Build {
21- private readonly runner : Runner ;
22-
23- constructor ( runner : Runner ) {
24- this . runner = runner ;
25- }
26-
2719 run ( input : string , output : string , args : string [ ] , env ?: Record < string , string > ) {
28- return this . runner . runYfmDocs (
20+ return runner . runYfmDocs (
2921 [ '--input' , input , '--output' , output , '--quiet' , '--allowHtml' , ...args ] ,
3022 env ,
3123 ) ;
3224 }
3325}
3426
3527class Extract {
36- private readonly runner : Runner ;
37-
38- constructor ( runner : Runner ) {
39- this . runner = runner ;
40- }
41-
4228 run ( input : string , output : string , args : string [ ] , env ?: Record < string , string > ) {
43- return this . runner . runYfmDocs (
29+ return runner . runYfmDocs (
4430 [ 'translate' , 'extract' , '--input' , input , '--output' , output , '--quiet' , ...args ] ,
4531 env ,
4632 ) ;
4733 }
4834}
4935
5036export class CliTestAdapter {
51- readonly runner : Runner = createRunner ( ) ;
37+ readonly runner = runner ;
5238
53- readonly build = new Build ( this . runner ) ;
39+ readonly build = new Build ( ) ;
5440
55- readonly extract = new Extract ( this . runner ) ;
41+ readonly extract = new Extract ( ) ;
5642
5743 async testBuildPass (
5844 inputPath : string ,
@@ -110,7 +96,7 @@ export class CliTestAdapter {
11096 ...additionalArgs . split ( ' ' ) . filter ( Boolean ) ,
11197 ] ;
11298
113- await this . runner . runYfmDocs ( baseArgs ) ;
99+ await runner . runYfmDocs ( baseArgs ) ;
114100 }
115101}
116102
0 commit comments