Skip to content

feat: real-scaffold preset validation + v0.2.0 release prep - #3

Merged
leofmarciano merged 3 commits into
mainfrom
feat/presets
Jun 8, 2026
Merged

feat: real-scaffold preset validation + v0.2.0 release prep#3
leofmarciano merged 3 commits into
mainfrom
feat/presets

Conversation

@leofmarciano

@leofmarciano leofmarciano commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Follow-up to #2. Two things: (1) validates every built-in preset against real official-CLI scaffolds and fixes the false positives that surfaced; (2) cuts the v0.2.0 release and hardens the publish pipeline. Merging this leaves main release-ready.

Engine

  • appliesTo: { kind: [...] } — scopes declaration-level clauses (be/haveSuffix/extend/implement/haveMethod/haveDecorator) to specific symbol kinds, so a co-located input/command DTO in a *.use-case.ts no longer trips a class-only rule.
  • Real alias resolution — project analysis now auto-loads tsconfig.json and the package.json imports map (#-subpath aliases), so import rules resolve @/* and #alias/* edges instead of silently missing them (previously the Next @/* and Adonis #models/* guards were inert).

Presets (validated on real scaffolds)

All 10 pass clean (exit 0) on fresh official-CLI projects; every signature guard fires on intentional breaches.

  • nest-js — bootstrap layer matches only main.ts; dropped the Entity suffix the generator doesn't emit.
  • nextjs — DI composition layer; @/* resolution confirmed (bad route → 2 real errors, clean route passes).
  • tanstack-starter / elysiajscreateServerFn / module index.ts composition roots may wire infrastructure.
  • encore-ts — exclude encore.gen/**; api becomes the service-root catch-all.
  • adonisjs — dedicated env leaf layer so framework config files may import env from '#start/env' (was wrongly mapped into kernel).

Release (v0.2.0)

  • Version bumped in lockstep: package.json, src/index.ts VERSION, and CHANGELOG.md ([Unreleased][0.2.0] - 2026-06-08).
  • Publish workflows now run the test suite before publishing and guard against tag/manifest drift (fail the job if package.json version ≠ release tag).
  • bin normalized to dist/cli.js (drops npm's ./-prefix warning); cli --version test asserts the VERSION constant.
  • New RELEASING.md documents the one-step post-merge flow.

Note (corrected by an adversarial release audit): npm already has 0.1.1 published with provenance — the NPM_TOKEN works; there was no pending token blocker. The only release gate was the version bump, now done.

Verification

358 tests pass · cli --version → 0.2.0 · npm pack --dry-runarch-contract-0.2.0.tgz (dist + README + LICENSE) · frozen-lockfile valid · arch:check + arch:docs:check exit 0.

🤖 Generated with Claude Code

Leonardo and others added 2 commits June 8, 2026 14:56
Validated every preset against real projects scaffolded with each
framework's official CLI (NestJS, Next.js, TanStack Start, AdonisJS,
ElysiaJS, Encore.ts, etc.). This surfaced false positives on idiomatic
and framework-generated code; fixed via two engine additions plus
per-preset corrections.

Engine:
- appliesTo: { kind: [...] } scopes declaration-level clauses
  (be/haveSuffix/extend/implement/haveMethod/haveDecorator) to specific
  symbol kinds, so a co-located input/command DTO in a *.use-case.ts no
  longer trips a class-only rule.
- Project analysis auto-loads tsconfig.json and the package.json imports
  map (#-subpath aliases), so import rules resolve @/* and #alias/* edges
  instead of silently missing them.

Presets:
- nest-js: bootstrap layer matches only main.ts; dropped Entity suffix.
- nextjs: DI composition layer; @/* alias resolution confirms guards fire.
- tanstack-starter / elysiajs: server-fn / module index composition roots
  may wire infrastructure.
- encore-ts: exclude encore.gen/**; api becomes the service-root catch-all.
- adonisjs: dedicated env leaf layer so framework config files may import
  #start/env (was wrongly mapped into kernel).

Tests: +applies-to, +alias-resolution, +adonisjs env-layer regression
(358 passing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cuts the 0.2.0 release (presets + engine appliesTo/alias-resolution +
real-scaffold preset fixes — all backward-compatible additions).

- Bump version in all three sites in lockstep: package.json,
  src/index.ts VERSION (drives `arch-contract --version`), and CHANGELOG
  ([Unreleased] -> [0.2.0] - 2026-06-08 + compare links).
- Normalize bin to "dist/cli.js" (drops npm's "./"-prefix publish warning).
- cli --version test asserts against the VERSION constant, not a literal,
  so future bumps never break it.
- Publish workflows (npm + GitHub Packages): run the test suite before
  publishing, and add a guard that fails the job if package.json version
  does not match the release tag (prevents tag/manifest drift — the
  workflows publish package.json verbatim).
- Add RELEASING.md documenting the one-step post-merge release flow and
  the NPM_TOKEN automation-token requirement.

Verified: 358 tests pass, `cli --version` prints 0.2.0, frozen-lockfile
stays valid, `npm pack --dry-run` ships arch-contract-0.2.0.tgz with
dist + README + LICENSE, arch:check + arch:docs:check exit 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@leofmarciano leofmarciano changed the title fix(presets): validate all 10 presets against real framework scaffolds feat: real-scaffold preset validation + v0.2.0 release prep Jun 8, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@leofmarciano
leofmarciano merged commit b790137 into main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant