From 66ab735c618cc5b053814edb56f73e1355607dcc Mon Sep 17 00:00:00 2001 From: MGrin Date: Fri, 21 Aug 2026 11:12:20 +0800 Subject: [PATCH] ci(typecheck): gate on tsc, the only gate this repo can honestly run (MX-222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only CI job here was `managed-install`, which proves the plugin builds from a git install with runtime deps only. That is a real check and it stays. It is not a check on whether the code compiles: `bb plugin build` bundles WITHOUT typechecking, so a type error anywhere in server.ts (34k) or app.tsx still produced a green check. This repo differs from its two siblings: it has NO test files and had NO scripts at all, so `npm test` has nothing to run and adding one is a bigger piece of work than a gate change. The workflow is named Typecheck rather than Test so the check's name does not claim more than it does — green here means it compiles, and no line of this repo is ever executed in CI. Separate job, not extra steps: managed-install installs `--omit=dev`, so typescript and @types/* are absent by the time it ends. Verified locally on this commit, from an empty node_modules: `npm ci` exits 0 without touching package-lock.json, `npm run typecheck` exits 0 under strict with skipLibCheck false. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/typecheck.yml | 38 +++++++++++++++++++++++++++++++++ package.json | 3 +++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/typecheck.yml diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 0000000..48b0ec0 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,38 @@ +# The type gate. There is no test suite in this repo to run. +# +# Until MX-222 this repo's only CI job was `managed-install`, which proves the +# plugin BUILDS from a git install and says nothing about whether it works: +# `bb plugin build` bundles WITHOUT typechecking, so a type error anywhere in +# server.ts (34k) or app.tsx still produced a green check. +# +# This is a SEPARATE job rather than more steps on managed-install, because +# that job installs `--omit=dev` — typescript and @types/* are absent by the +# time it ends. +# +# What a green run here covers: `tsc --noEmit` under `strict` with +# `skipLibCheck: false`, over server.ts, app.tsx, components, lib, hooks and +# types. What it does NOT cover: this repo has ZERO test files, so no line of +# it is ever EXECUTED in CI. Green means it compiles, not that it works — a +# weaker claim than the sibling plugins' Test job, and deliberately named so. +name: Typecheck + +on: + pull_request: + push: + branches: [main, main-public] + workflow_dispatch: + +jobs: + typecheck: + name: tsc --noEmit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + # `npm ci` rather than `npm install`: it installs the lockfile exactly and + # fails when package.json and package-lock.json disagree, so CI checks the + # tree a fresh clone would get. + - run: npm ci --no-audit --no-fund + - run: npm run typecheck diff --git a/package.json b/package.json index 787ce4c..cda4a84 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "bb-plugin-system", "version": "0.1.0", "type": "module", + "scripts": { + "typecheck": "tsc --noEmit" + }, "engines": { "bb": ">=0.36", "bbPluginSdk": "^0.4.1"