Repository navigation
test: add tsArch to check for module-structure - #83
Merged
Merged
Conversation
An ArchUnitTS rule in test/architecture.test.ts fails when a module lands next to index.ts, api.ts and cli.ts instead of in the folder of its stage. Vitest runs with globals, which ArchUnitTS needs to register toPassAsync.
emaarco
enabled auto-merge (squash)
October 21, 2026 18:13
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.
Summary
#82 reduced the root of
src/to the entriesindex.ts,api.tsandcli.ts, but nothing kept it that way.test/architecture.test.tsadds an ArchUnitTS rule that fails when another module lands there. The failure names the file, andCONTRIBUTING.mdpoints to the test.archunit2.5.4, pinned. It brings its own TypeScript 5.9 for parsing; the repo's TypeScript 7 is unaffected.vitest.config.tssetsglobals: truebecause ArchUnitTS registerstoPassAsync()on the globalexpect. The existing tests importdescribe/it/expectexplicitly and are unaffected.main, and red on a straysrc/stray.tsand on a root file without imports. A pattern that matches no file also fails, so a typo in a folder name can't pass silently.The dependency is meant for the next rules too. The spike already shows what those would catch today: 59 import cycles (type and value imports are marked separately) and 7 imports from
query/intoops/. Those need a list of known violations first, so they are not part of this PR.Checklist
npm run typecheckpassesnpm run gatepasses (2318 tests; one earlier run failed on the timing assertion instep3-ids-report.test.tsunder high machine load, which also happened before this change)src/report/guide.tsand the matching page indocs/are updated (only if a command, option or output changed)Linked issue
None.