File tree Expand file tree Collapse file tree 2 files changed +12
-20
lines changed Expand file tree Collapse file tree 2 files changed +12
-20
lines changed Original file line number Diff line number Diff line change 6161 "devDependencies" : {
6262 "@mongodb-js/eslint-config-devtools" : " 0.9.11" ,
6363 "@mongodb-js/prettier-config-devtools" : " ^1.0.2" ,
64+ "@mongodb-js/shell-bson-parser" : " ^1.2.2" ,
6465 "@mongodb-js/tsconfig-devtools" : " ^1.0.3" ,
6566 "@types/js-yaml" : " ^4.0.9" ,
6667 "@types/jsdom" : " ^21.1.7" ,
6970 "depcheck" : " ^1.4.7" ,
7071 "eslint" : " ^7.25.0" ,
7172 "gen-esm-wrapper" : " ^1.1.3" ,
73+ "js-yaml" : " ^4.1.0" ,
74+ "jsdom" : " ^24.1.3" ,
7275 "json-refs" : " ^3.0.15" ,
7376 "json-schema-to-zod" : " ^2.6.0" ,
7477 "prettier" : " ^3.5.3" ,
7578 "ts-node" : " ^10.9.2" ,
76- "typescript" : " ^5.0.4"
77- },
78- "dependencies" : {
79- "@mongodb-js/shell-bson-parser" : " ^1.2.2" ,
80- "bson" : " ^6.10.3" ,
81- "js-yaml" : " ^4.1.0" ,
82- "jsdom" : " ^24.1.3" ,
83- "mongodb" : " ^6.9.0" ,
79+ "typescript" : " ^5.0.4" ,
8480 "mongodb-schema" : " ^12.6.2" ,
8581 "yargs" : " ^17.7.2" ,
8682 "zod" : " ^3.24.2"
83+ },
84+ "dependencies" : {
85+ "bson" : " ^6.10.3" ,
86+ "mongodb" : " ^6.9.0"
8787 }
8888}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import path from 'path';
55import * as fs from 'fs/promises' ;
66import * as yaml from 'js-yaml' ;
77import * as bson from 'bson' ;
8+ import { once } from 'events' ;
89
910export type YamlFiles = ReturnType < GeneratorBase [ 'listSourceYAMLFiles' ] > ;
1011
@@ -257,20 +258,11 @@ export abstract class GeneratorBase {
257258 this . outputStream = createWriteStream ( filePath , { encoding : 'utf8' } ) ;
258259 }
259260
260- private flushFile ( ) : Promise < void > {
261+ private async flushFile ( ) : Promise < void > {
261262 if ( this . outputStream ) {
262- return new Promise ( ( resolve , reject ) => {
263- this . outputStream ?. close ( ( err ) => {
264- if ( err ) {
265- reject ( err ) ;
266- } else {
267- resolve ( ) ;
268- }
269- } ) ;
270- } ) ;
263+ this . outputStream . end ( ) ;
264+ await once ( this . outputStream , 'close' ) ;
271265 }
272-
273- return Promise . resolve ( ) ;
274266 }
275267
276268 protected emit ( str : string ) : void {
You can’t perform that action at this time.
0 commit comments