diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b20467c..b716b81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,9 @@ jobs: - name: Install run: npm ci + - name: Guard against shell scripts (Windows cross-platform) + run: npm run check:no-shell + - name: Typecheck server bundle run: npm run typecheck:bundle diff --git a/package.json b/package.json index fdb9e23..726271c 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build": "pluginpack build", "build:bundle": "node sources/glean-vnext/build.mjs", "clean": "pluginpack clean", + "check:no-shell": "node scripts/check-no-shell-scripts.mjs", "prune": "pluginpack prune", "typecheck:bundle": "tsc --noEmit -p sources/glean-vnext/tsconfig.json", "test:bundle": "vitest run --root sources/glean-vnext", diff --git a/scripts/check-no-shell-scripts.mjs b/scripts/check-no-shell-scripts.mjs new file mode 100644 index 0000000..eb6b494 --- /dev/null +++ b/scripts/check-no-shell-scripts.mjs @@ -0,0 +1,86 @@ +#!/usr/bin/env node +// CI guard: fail if any shell/bash script is added under the glean-vnext +// source tree. +// +// Why: the glean-vnext plugin ships and runs on end-user machines, including +// Windows, where POSIX shell (.sh / bash) is not available. We already +// migrated the launcher from start.sh to start.mjs for exactly this reason. +// Every executable helper the plugin relies on must be cross-platform, so the +// rule is: no shell scripts in the plugin source — use a Node.js (.mjs) script +// instead and invoke it with `node