diff --git a/.changeset/scaffold-blank-template-ci-workflow.md b/.changeset/scaffold-blank-template-ci-workflow.md new file mode 100644 index 0000000000..6dd09b327f --- /dev/null +++ b/.changeset/scaffold-blank-template-ci-workflow.md @@ -0,0 +1,24 @@ +--- +"create-objectstack": minor +--- + +Scaffolded projects now ship a CI workflow, and a `lint` script for it to run. +The blank template carries `.github/workflows/ci.yml` — one job, on `push` and +`pull_request`: checkout, pnpm, Node 22, `pnpm install --frozen-lockfile`, then +`pnpm validate`, `pnpm lint` and `pnpm typecheck`. + +`lint` is new to the template (`objectstack lint`). It is not a second spelling +of `validate`: the two share the authoring-rule engine but only `lint` runs the +hook-body lowering check, which catches handlers that have silently stopped +lowering to metadata-only bodies — a change of deployment shape produced by a +refactor that looks like tidying. + +The scaffolder already created `.github/` at runtime for a single file +(`copilot-instructions.md`) while the template's gates shipped as npm scripts +nothing ever ran, so a fresh project started with no CI at all — and ObjectStack +metadata mistakes fail silently at runtime, which makes `objectstack validate` +the only place they surface early. That gate is now unskippable for a human and +for an AI agent authoring metadata in the project, instead of advisory. + +Existing projects are unaffected; copy the file from a fresh scaffold to adopt +it. 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..ca72e93a2c --- /dev/null +++ b/packages/create-objectstack/src/template-ci-workflow.test.ts @@ -0,0 +1,221 @@ +// 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