Commit Graph

8 Commits

Author SHA1 Message Date
b1e2e8a788 feat(tooling): pre-ship approved library traces in optional core generator templates
Each of the five optional core package generators (events, realtime, audit,
trpc, ui) now copies pre-written decision: approved trace files into
docs/library-decisions/ at scaffold time, covering every direct runtime
dependency of that core package.

This prevents a pre-commit gate failure the first time a developer runs
pnpm turbo gen core-package <name> — the generator is the policy-compliant
path, so the traces land by construction.

- Added docs/library-decisions/*.md.hbs trace files under each of the five
  core-package template directories (15 files total)
- Updated generator config to emit traces into workspace docs/library-decisions/
  via a second emitTemplateTree call per core package
- Updated all five __snapshots__/core-package/*.snapshot.json to include the
  new trace file entries
- Added verify-doc-shas.test.ts to pin SHA256 hashes of all 15 trace templates
  so snapshot and file content cannot drift independently

ADR refs: events→ADR-015, realtime→ADR-016, audit→ADR-018;
trpc and ui cite closest ADR or null where no specific ADR exists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 09:34:17 +00:00
769548c186 feat(turbo-generators): feature scaffold registers in release-please
Closes the user's gap: when `pnpm turbo gen feature <name>` scaffolds
a new feature, that feature must also be tracked by release-please —
otherwise it sits outside the versioning + changelog pipeline.

The generator now performs three release-please integrations:

1. **CHANGELOG.md seeded at v0.1.0** — new template at
   templates/feature/CHANGELOG.md.hbs emits a baseline entry pointing
   at ADR-021 + docs/guides/releasing.md so the consumer immediately
   sees where future entries will appear.

2. **package.json version field bumped** — templates/feature/
   package.json.hbs: "0.0.0" -> "0.1.0", matching the per-feature
   baseline established when release-please was set up.

3. **Manifest + config registration via a new custom action** —
   lib/release-please-utils.ts exports
   registerFeatureInReleasePlease(repoRoot, name) which:
     - Reads .release-please-manifest.json, adds
       `"packages/<name>": "0.1.0"`, writes back with sorted keys
       (root stays first, rest alphabetical) so diffs stay minimal
     - Reads release-please-config.json, adds the per-package config
       block (package-name, component, changelog-path), writes back
       with the same sort
     - Idempotent — re-running on an already-tracked feature is a
       no-op
     - Throws fast if either file is missing (ADR-021 requires
       release-please to be set up BEFORE features can register)

The generator wires this in via a function action between the last
file `add` and the next-steps printout. Its return string surfaces
in the generator log so the user sees "Registered @repo/<name> in
release-please tracking".

Tested: 5/5 unit tests cover the happy path, idempotency, sort
order, and both missing-file error paths. Smoke-tested against the
real repo configs (adding a synthetic "demo" feature, then
restoring) — manifest entry appears in the correct sorted position;
config block has the right shape.

Future `pnpm turbo gen feature` invocations cannot leave a feature
untracked. Existing features (auth, blog, media, marketing-pages,
navigation) were registered manually when the release-please epic
landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 17:21:49 +02:00
b593bea8ca fix(generators): wire lint+typecheck into pipeline and fix uncovered errors
The turbo/generators package shipped without `lint` or `typecheck` scripts,
so `pnpm lint` / `pnpm typecheck` at the root silently skipped it. This
masked 2 ESLint errors (unused imports) and 11 TypeScript errors (relative
imports missing the `.js` extension required by `moduleResolution: NodeNext`,
plus JSON imports missing the `with { type: "json" }` attribute).

- Add `lint` and `typecheck` scripts to turbo/generators/package.json so the
  turbo pipeline picks them up (lint: 14/14, was 13/13).
- Add `.js` extensions to 7 relative imports across config.test.ts,
  lib/core-package-utils.test.ts, lib/snapshot.test.ts, and the 4 e2e tests.
- Add `with { type: "json" }` attributes to 4 snapshot JSON imports in the
  e2e tests.
- Remove unused `existsSync` and `splicePluginImportsAt` imports from
  lib/core-package-utils.test.ts.
- Declare `@repo/core-typescript` + `typescript` devDependencies so the
  generators package can run `tsc --noEmit` for typecheck.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 08:09:17 +02:00
57b2ff5191 refactor: remove core-realtime from main (scaffoldable via gen core-package realtime) 2026-05-09 13:45:52 +02:00
421d765b80 feat(generators): splicePluginRulesAt + splicePluginImportsAt + addBoundariesEntry + emitTemplateTree helpers 2026-05-09 13:31:28 +02:00
af062480b5 feat(generators): byte-identical snapshot machinery + realtime snapshot 2026-05-09 13:30:08 +02:00
d5313f95ea feat(generators): core-package-utils (assertNotPresent + addToTranspilePackages)
Two helpers for use by per-package generator actions:
- assertOptionalPackageNotPresent — guards against double-scaffolding
- addToTranspilePackages — idempotent alphabetical splice into next.config.mjs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:22:52 +02:00
cf71547223 feat(turbo-gen): assertAnchors helper 2026-05-08 16:12:52 +02:00