@ori-ori/arch-adapter-generic
v0.1.0
Published
Language-neutral regex fallback adapter for ori arch (ts/js/py/rs/go)
Readme
@ori-ori/arch-adapter-generic
Language-neutral fallback adapter for ori arch. Parses imports via per-language regex and checks against .ori/architecture.md rules — used when no native linter integration exists for the target language.
Precision is per-file regex, not AST. Use a native adapter (
eslint,dependency-cruiser,rust) when available. This adapter is the safety net.
Install
pnpm add -D @ori-ori/arch-adapter-genericUse
# Emit .ori/arch-rules.json for inspection / debugging
ori arch export --adapter=generic
# Scan source files and report violations
ori arch check --adapter=genericSupported languages (v0.1)
| Language | Import patterns recognised |
|-------------|-------------------------------------------------------------|
| TypeScript / JavaScript | import, import(), require(), export ... from |
| Python | import x, from .x import y, relative .. |
| Rust | use crate::x, use super::x, use self::x |
| Go | import "..." (single + grouped) |
| Java | import x.y.z; (incl. import static) |
Bare specifiers (e.g. react, serde) are ignored — external packages are out of scope.
What it enforces
- Cross-layer rules from
spec.layer_sets[<id>].rules.cross_layer. - Cross-slice isolation — direct imports between two different slices under the same
slicelayer are flagged with a dedicatedcross-slicemessage.
Layer → filesystem convention (v0.1)
Same convention as @ori-ori/arch-adapter-eslint:
| Layer kind | Path prefix |
|--------------|----------------------------------------------|
| shared | <root.path>/<root.slice_root>/<id>/ |
| slice | <root.path>/<root.slice_root>/<slice>/ |
| ui-layer | <root.path>/<id>/ |
What's deferred to v0.2
- Slice-internal sub-layer enforcement (
presentation → application → domain). tsconfigpath alias (@/foo) resolution — currently only relative imports resolve.- Per-layer path overrides in the schema.
