Skip to content

feat: local rules shim, ARCH-010, and parallel file discovery#86

Merged
rhuanbarreto merged 6 commits into
mainfrom
worktree-zesty-shimmying-rabin
Mar 19, 2026
Merged

feat: local rules shim, ARCH-010, and parallel file discovery#86
rhuanbarreto merged 6 commits into
mainfrom
worktree-zesty-shimmying-rabin

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Generate local rules.d.ts shim so .rules.ts files get type checking without requiring node_modules (supports non-JS projects). Removes the archgate/rules npm export.
  • Add ARCH-010 (prefer Bun built-in JSON parsing) ADR and auto-configure linter overrides on init.
  • Parallelize file discovery across loader, context, adr-writer, git-files, and ADR rule files using Promise.all, removing most no-await-in-loop lint suppressions.
  • Add documentation note about triple-slash-reference linter conflict.

Test plan

  • bun run validate passes (lint, typecheck, format, 313 tests, ADR check, build)
  • Verify archgate init generates .archgate/rules.d.ts and configures oxlint overrides
  • Verify archgate check still reports violations correctly with parallel execution

Rules files no longer need node_modules or package.json. The CLI
generates an ambient .archgate/rules.d.ts on init/check so .rules.ts
files get full editor IntelliSense via triple-slash references.

- Remove defineRules() function and ./rules npm export
- Generate ambient rules.d.ts (declare types, no export) on every check
- Rule files use plain `export default { rules: {...} } satisfies RuleSet`
- Scaffold companion .rules.ts on `adr create --rules`
- Add .archgate/rules.d.ts to .gitignore during init
- Missing companion files now throw instead of warning
- Migrate all project rule files, tests, and docs to new pattern
- archgate init detects .oxlintrc.json and .eslintrc.json and adds
  an override to disable triple-slash-reference for .archgate/adrs/
- Add ARCH-010: prefer Bun.file().json() over JSON.parse()
- Replace JSON.parse(content) with Bun.file().json() in claude-settings
- Extend ARCH-010 rule to catch two-line pattern (Bun.file().text()
  assigned to variable then passed to JSON.parse)
Replace sequential await-in-loop patterns with Promise.all for
independent file reads in loader, context, and adr-writer. Removes
all no-await-in-loop lint suppressions from these files.
Remove no-await-in-loop suppressions from ARCH-010 and GEN-002 rule
files and git-files.ts by replacing sequential loops with Promise.all.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: d9ae092
Status: ✅  Deploy successful!
Preview URL: https://d7e77a2a.archgate-cli.pages.dev
Branch Preview URL: https://worktree-zesty-shimmying-rab.archgate-cli.pages.dev

View logs

@rhuanbarreto rhuanbarreto merged commit 3975be4 into main Mar 19, 2026
10 checks passed
@rhuanbarreto rhuanbarreto deleted the worktree-zesty-shimmying-rabin branch March 19, 2026 14:01
@github-actions github-actions Bot mentioned this pull request Mar 19, 2026
rhuanbarreto added a commit that referenced this pull request Mar 20, 2026
* feat: generate local rules.d.ts shim, remove archgate/rules npm export

Rules files no longer need node_modules or package.json. The CLI
generates an ambient .archgate/rules.d.ts on init/check so .rules.ts
files get full editor IntelliSense via triple-slash references.

- Remove defineRules() function and ./rules npm export
- Generate ambient rules.d.ts (declare types, no export) on every check
- Rule files use plain `export default { rules: {...} } satisfies RuleSet`
- Scaffold companion .rules.ts on `adr create --rules`
- Add .archgate/rules.d.ts to .gitignore during init
- Missing companion files now throw instead of warning
- Migrate all project rule files, tests, and docs to new pattern

* docs: add note about triple-slash-reference linter conflict

* feat: auto-configure linter overrides on init, add ARCH-010

- archgate init detects .oxlintrc.json and .eslintrc.json and adds
  an override to disable triple-slash-reference for .archgate/adrs/
- Add ARCH-010: prefer Bun.file().json() over JSON.parse()

* fix: apply ARCH-010 to claude-settings.ts, improve rule detection

- Replace JSON.parse(content) with Bun.file().json() in claude-settings
- Extend ARCH-010 rule to catch two-line pattern (Bun.file().text()
  assigned to variable then passed to JSON.parse)

* refactor: parallelize file discovery with Promise.all

Replace sequential await-in-loop patterns with Promise.all for
independent file reads in loader, context, and adr-writer. Removes
all no-await-in-loop lint suppressions from these files.

* refactor: parallelize ADR rules and git file resolution with Promise.all

Remove no-await-in-loop suppressions from ARCH-010 and GEN-002 rule
files and git-files.ts by replacing sequential loops with Promise.all.
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