Skip to content

Avoid unhandled errors in build streams #4009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions extensions/ql-vscode/gulpfile.ts/textmate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
Pattern,
TextmateGrammar,
} from "./textmate-grammar";
import { pipeline } from "stream/promises";

/**
* Replaces all rule references with the match pattern of the referenced rule.
Expand Down Expand Up @@ -276,7 +277,9 @@ export function transpileTextMateGrammar() {
}

export function compileTextMateGrammar() {
return src("syntaxes/*.tmLanguage.yml")
.pipe(transpileTextMateGrammar())
.pipe(dest("out/syntaxes"));
return pipeline(
src("syntaxes/*.tmLanguage.yml"),
transpileTextMateGrammar(),
dest("out/syntaxes"),
);
}
35 changes: 18 additions & 17 deletions extensions/ql-vscode/gulpfile.ts/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import esbuild from "gulp-esbuild";
import type { reporter } from "gulp-typescript";
import { createProject } from "gulp-typescript";
import del from "del";
import { pipeline } from "stream/promises";

export function goodReporter(): reporter.Reporter {
return {
Expand Down Expand Up @@ -37,23 +38,23 @@ export function cleanOutput() {
}

export function compileEsbuild() {
return src("./src/extension.ts")
.pipe(
esbuild({
outfile: "extension.js",
bundle: true,
external: ["vscode", "fsevents"],
format: "cjs",
platform: "node",
target: "es2020",
sourcemap: "linked",
sourceRoot: "..",
loader: {
".node": "copy",
},
}),
)
.pipe(dest("out"));
return pipeline(
src("./src/extension.ts"),
esbuild({
outfile: "extension.js",
bundle: true,
external: ["vscode", "fsevents"],
format: "cjs",
platform: "node",
target: "es2020",
sourcemap: "linked",
sourceRoot: "..",
loader: {
".node": "copy",
},
}),
dest("out"),
);
}

export function watchEsbuild() {
Expand Down
35 changes: 18 additions & 17 deletions extensions/ql-vscode/gulpfile.ts/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@ import esbuild from "gulp-esbuild";
import { createProject } from "gulp-typescript";
import { goodReporter } from "./typescript";

import { pipeline } from "stream/promises";
import chromiumVersion from "./chromium-version.json";

const tsProject = createProject("src/view/tsconfig.json");

export function compileViewEsbuild() {
return src("./src/view/webview.tsx")
.pipe(
esbuild({
outfile: "webview.js",
bundle: true,
format: "iife",
platform: "browser",
target: `chrome${chromiumVersion.chromiumVersion}`,
jsx: "automatic",
sourcemap: "linked",
sourceRoot: "..",
loader: {
".ttf": "file",
},
}),
)
.pipe(dest("out"));
return pipeline(
src("./src/view/webview.tsx"),
esbuild({
outfile: "webview.js",
bundle: true,
format: "iife",
platform: "browser",
target: `chrome${chromiumVersion.chromiumVersion}`,
jsx: "automatic",
sourcemap: "linked",
sourceRoot: "..",
loader: {
".ttf": "file",
},
}),
dest("out"),
);
}

export function watchViewEsbuild() {
Expand Down
Loading