From b2a4d6d95c59df1df266287c1895c8a5c146d9de Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 6 Sep 2026 14:50:18 +0000 Subject: [PATCH 1/3] feat(create-objectstack): ship a CI workflow in the blank template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scaffolder already created `.github/` at runtime for one file (copilot-instructions.md) while the template's own gates — `validate` and `typecheck` — shipped as npm scripts nothing ever ran, so every scaffolded project started with zero CI and the "metadata mistakes fail silently at runtime, the gates are where they surface" claim rested on a human remembering to type the command. Adds `.github/workflows/ci.yml` to the blank template: one job, one file, checkout -> pnpm/action-setup -> setup-node (Node 22, pnpm cache) -> `pnpm install --frozen-lockfile` -> `pnpm validate` -> `pnpm typecheck`. No `pnpm lint` step: the blank template declares no `lint` script and neither scaffolder writes one, so that step would fail on the first push of every scaffolded project. The new test derives the allowed step set from the template's package.json so the two cannot drift. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PbJ5Cy9KDAzeQHo8bsMadG --- packages/create-objectstack/package.json | 3 +- .../src/template-ci-workflow.test.ts | 211 ++++++++++++++++++ .../src/template-consistency.test.ts | 11 + .../templates/blank/.github/workflows/ci.yml | 60 +++++ pnpm-lock.yaml | 3 + 5 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 packages/create-objectstack/src/template-ci-workflow.test.ts create mode 100644 packages/create-objectstack/src/templates/blank/.github/workflows/ci.yml diff --git a/packages/create-objectstack/package.json b/packages/create-objectstack/package.json index bb6cdb946e..fc54248249 100644 --- a/packages/create-objectstack/package.json +++ b/packages/create-objectstack/package.json @@ -34,7 +34,8 @@ "@types/node": "^26.2.0", "tsup": "^8.5.1", "typescript": "^6.0.3", - "vitest": "^4.1.10" + "vitest": "^4.1.10", + "yaml": "^2.9.0" }, "repository": { "type": "git", diff --git a/packages/create-objectstack/src/template-ci-workflow.test.ts b/packages/create-objectstack/src/template-ci-workflow.test.ts new file mode 100644 index 0000000000..14319353c1 --- /dev/null +++ b/packages/create-objectstack/src/template-ci-workflow.test.ts @@ -0,0 +1,211 @@ +// Copyright (c) 2026 ObjectStack contributors. Apache-2.0 license. +// +// The bundled template's own CI workflow (#16330). +// +// The scaffolder already creates a `.github/` directory at runtime — for one +// file, `copilot-instructions.md` — while the template's gates (`validate`, +// `typecheck`) shipped as npm scripts nothing ever ran. A scaffolded project +// therefore started with zero CI, and the product claim that metadata mistakes +// surface at authoring time rested entirely on a human remembering to type the +// command. `.github/workflows/ci.yml` is the fix; this file is what keeps it +// honest. +// +// Three properties, each of which failed silently before it was pinned: +// +// 1. The file is real YAML. A workflow GitHub cannot parse is not reported as +// a broken workflow to the user who just scaffolded — it is reported as no +// CI at all, which is indistinguishable from the defect being fixed here. +// 2. Every `pnpm