feat: real-scaffold preset validation + v0.2.0 release prep - #3
Merged
Conversation
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>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainrelease-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.tsno longer trips a class-only rule.tsconfig.jsonand thepackage.jsonimportsmap (#-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.
main.ts; dropped theEntitysuffix the generator doesn't emit.compositionlayer;@/*resolution confirmed (bad route → 2 real errors, clean route passes).createServerFn/ moduleindex.tscomposition roots may wire infrastructure.encore.gen/**;apibecomes the service-root catch-all.envleaf layer so framework config files mayimport env from '#start/env'(was wrongly mapped intokernel).Release (v0.2.0)
package.json,src/index.tsVERSION, andCHANGELOG.md([Unreleased]→[0.2.0] - 2026-06-08).package.jsonversion ≠ release tag).binnormalized todist/cli.js(drops npm's./-prefix warning);cli --versiontest asserts theVERSIONconstant.RELEASING.mddocuments the one-step post-merge flow.Verification
358 tests pass ·
cli --version→ 0.2.0 ·npm pack --dry-run→arch-contract-0.2.0.tgz(dist + README + LICENSE) · frozen-lockfile valid ·arch:check+arch:docs:checkexit 0.🤖 Generated with Claude Code