Skip to content

Commit edeb493

Browse files
committed
move dev dependencies to devDependencies
1 parent f878c8a commit edeb493

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

packages/mql-typescript/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
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",
@@ -69,20 +70,19 @@
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
}

packages/mql-typescript/src/generator.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import path from 'path';
55
import * as fs from 'fs/promises';
66
import * as yaml from 'js-yaml';
77
import * as bson from 'bson';
8+
import { once } from 'events';
89

910
export 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 {

0 commit comments

Comments
 (0)