Skip to content

Commit 94ff00f

Browse files
committed
Fix through2 v5 migration
Use the new objectTransform API and align the transform callback with the v5 types. Replace the deprecated through2 stub types with the readable-stream types required by through2's declarations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8a4f7856-b291-4191-a8af-e2b410a8c01f
1 parent 78d32a9 commit 94ff00f

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

extensions/ql-vscode/gulpfile.ts/textmate.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { dest, src } from "gulp";
22
import { load } from "js-yaml";
3-
import { obj } from "through2";
3+
import { objectTransform } from "through2";
44
import PluginError from "plugin-error";
55
import type Vinyl from "vinyl";
66
import type {
@@ -247,11 +247,11 @@ function transformFile(yaml: ExtendedTextmateGrammar<ExtendedMatchType>) {
247247
}
248248

249249
export function transpileTextMateGrammar() {
250-
return obj(
250+
return objectTransform(
251251
(
252252
file: Vinyl,
253253
_encoding: string,
254-
callback: (err: string | null, file: Vinyl | PluginError) => void,
254+
callback: (err?: Error | null, file?: Vinyl) => void,
255255
): void => {
256256
if (file.isNull()) {
257257
callback(null, file);
@@ -266,7 +266,6 @@ export function transpileTextMateGrammar() {
266266
callback(null, file);
267267
} else {
268268
callback(
269-
"error",
270269
new PluginError("transpileTextMateGrammar", "Format not supported."),
271270
);
272271
}

extensions/ql-vscode/package-lock.json

Lines changed: 11 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,12 +2138,12 @@
21382138
"@types/proper-lockfile": "^4.1.4",
21392139
"@types/react": "^19.2.17",
21402140
"@types/react-dom": "^19.2.3",
2141+
"@types/readable-stream": "^4.0.24",
21412142
"@types/sarif": "^2.1.2",
21422143
"@types/semver": "^7.7.1",
21432144
"@types/stream-json": "^1.7.8",
21442145
"@types/styled-components": "^5.1.11",
21452146
"@types/tar-stream": "^3.1.4",
2146-
"@types/through2": "^5.0.0",
21472147
"@types/tmp": "^0.2.6",
21482148
"@types/vscode": "1.90.0",
21492149
"@types/yauzl": "^3.4.0",

0 commit comments

Comments
 (0)