archprint 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +42 -26
- package/dist/cli/adopted-rules.d.ts +23 -2
- package/dist/cli/adopted-rules.d.ts.map +1 -1
- package/dist/cli/adopted-rules.js +100 -2
- package/dist/cli/adopted-rules.js.map +1 -1
- package/dist/cli/allow.d.ts.map +1 -1
- package/dist/cli/allow.js +5 -14
- package/dist/cli/allow.js.map +1 -1
- package/dist/cli/allowed-evidence.d.ts.map +1 -1
- package/dist/cli/allowed-evidence.js +105 -0
- package/dist/cli/allowed-evidence.js.map +1 -1
- package/dist/cli/check-evaluate.d.ts +2 -1
- package/dist/cli/check-evaluate.d.ts.map +1 -1
- package/dist/cli/check-evaluate.js +84 -1
- package/dist/cli/check-evaluate.js.map +1 -1
- package/dist/cli/check-locate.d.ts.map +1 -1
- package/dist/cli/check-locate.js +4 -2
- package/dist/cli/check-locate.js.map +1 -1
- package/dist/cli/check.js +2 -2
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/eslint-check.d.ts +6 -0
- package/dist/cli/eslint-check.d.ts.map +1 -0
- package/dist/cli/eslint-check.js +160 -0
- package/dist/cli/eslint-check.js.map +1 -0
- package/dist/cli/generate.d.ts +3 -6
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +67 -64
- package/dist/cli/generate.js.map +1 -1
- package/dist/cli/layout.d.ts +18 -2
- package/dist/cli/layout.d.ts.map +1 -1
- package/dist/cli/layout.js +82 -15
- package/dist/cli/layout.js.map +1 -1
- package/dist/cli/migrate.d.ts.map +1 -1
- package/dist/cli/migrate.js +1 -2
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/program.d.ts +0 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +59 -79
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/ratchet.d.ts +24 -0
- package/dist/cli/ratchet.d.ts.map +1 -0
- package/dist/cli/ratchet.js +43 -0
- package/dist/cli/ratchet.js.map +1 -0
- package/dist/cli/recommend.d.ts +3 -0
- package/dist/cli/recommend.d.ts.map +1 -1
- package/dist/cli/recommend.js +16 -1
- package/dist/cli/recommend.js.map +1 -1
- package/dist/cli/report.d.ts +8 -4
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +50 -34
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/rule-ref.d.ts +10 -0
- package/dist/cli/rule-ref.d.ts.map +1 -0
- package/dist/cli/rule-ref.js +18 -0
- package/dist/cli/rule-ref.js.map +1 -0
- package/dist/cli/scan.d.ts.map +1 -1
- package/dist/cli/scan.js +4 -4
- package/dist/cli/scan.js.map +1 -1
- package/dist/cli/summary.d.ts +7 -0
- package/dist/cli/summary.d.ts.map +1 -1
- package/dist/cli/summary.js +60 -2
- package/dist/cli/summary.js.map +1 -1
- package/dist/detector/orphan-detector.d.ts +8 -6
- package/dist/detector/orphan-detector.d.ts.map +1 -1
- package/dist/detector/orphan-detector.js +74 -15
- package/dist/detector/orphan-detector.js.map +1 -1
- package/dist/detector/pattern-detector.d.ts +2 -0
- package/dist/detector/pattern-detector.d.ts.map +1 -1
- package/dist/detector/pattern-detector.js +5 -0
- package/dist/detector/pattern-detector.js.map +1 -1
- package/dist/detector/stories-isolation-detector.d.ts +1 -0
- package/dist/detector/stories-isolation-detector.d.ts.map +1 -1
- package/dist/detector/stories-isolation-detector.js +1 -1
- package/dist/detector/stories-isolation-detector.js.map +1 -1
- package/dist/generator/app-isolation-emitters.d.ts +4 -1
- package/dist/generator/app-isolation-emitters.d.ts.map +1 -1
- package/dist/generator/app-isolation-emitters.js +10 -4
- package/dist/generator/app-isolation-emitters.js.map +1 -1
- package/dist/generator/console-isolation-emitters.d.ts +2 -6
- package/dist/generator/console-isolation-emitters.d.ts.map +1 -1
- package/dist/generator/console-isolation-emitters.js +3 -2
- package/dist/generator/console-isolation-emitters.js.map +1 -1
- package/dist/generator/deep-relative-emitters.d.ts +2 -16
- package/dist/generator/deep-relative-emitters.d.ts.map +1 -1
- package/dist/generator/deep-relative-emitters.js +6 -20
- package/dist/generator/deep-relative-emitters.js.map +1 -1
- package/dist/generator/depcruise-exempt.d.ts +17 -2
- package/dist/generator/depcruise-exempt.d.ts.map +1 -1
- package/dist/generator/depcruise-exempt.js +18 -4
- package/dist/generator/depcruise-exempt.js.map +1 -1
- package/dist/generator/dependency-internals-emitters.d.ts +1 -1
- package/dist/generator/dependency-internals-emitters.d.ts.map +1 -1
- package/dist/generator/dependency-internals-emitters.js +2 -2
- package/dist/generator/dependency-internals-emitters.js.map +1 -1
- package/dist/generator/entry-purity-emitters.d.ts +1 -1
- package/dist/generator/entry-purity-emitters.d.ts.map +1 -1
- package/dist/generator/entry-purity-emitters.js +3 -3
- package/dist/generator/entry-purity-emitters.js.map +1 -1
- package/dist/generator/env-access-emitters.d.ts +3 -2
- package/dist/generator/env-access-emitters.d.ts.map +1 -1
- package/dist/generator/env-access-emitters.js +4 -11
- package/dist/generator/env-access-emitters.js.map +1 -1
- package/dist/generator/eslint-app-emitter.d.ts +1 -0
- package/dist/generator/eslint-app-emitter.d.ts.map +1 -1
- package/dist/generator/eslint-app-emitter.js +1 -22
- package/dist/generator/eslint-app-emitter.js.map +1 -1
- package/dist/generator/eslint-family-rules.d.ts +23 -0
- package/dist/generator/eslint-family-rules.d.ts.map +1 -0
- package/dist/generator/eslint-family-rules.js +35 -0
- package/dist/generator/eslint-family-rules.js.map +1 -0
- package/dist/generator/eslint-plugin-emitter.d.ts +2 -0
- package/dist/generator/eslint-plugin-emitter.d.ts.map +1 -1
- package/dist/generator/eslint-plugin-emitter.js +21 -0
- package/dist/generator/eslint-plugin-emitter.js.map +1 -1
- package/dist/generator/eslint-preset-emitter.d.ts +2 -1
- package/dist/generator/eslint-preset-emitter.d.ts.map +1 -1
- package/dist/generator/eslint-preset-emitter.js +13 -10
- package/dist/generator/eslint-preset-emitter.js.map +1 -1
- package/dist/generator/eslint-scope.d.ts +0 -11
- package/dist/generator/eslint-scope.d.ts.map +1 -1
- package/dist/generator/eslint-scope.js +0 -44
- package/dist/generator/eslint-scope.js.map +1 -1
- package/dist/generator/feature-slice-emitters.d.ts +4 -1
- package/dist/generator/feature-slice-emitters.d.ts.map +1 -1
- package/dist/generator/feature-slice-emitters.js +10 -4
- package/dist/generator/feature-slice-emitters.js.map +1 -1
- package/dist/generator/layer-emitters.d.ts.map +1 -1
- package/dist/generator/layer-emitters.js +1 -4
- package/dist/generator/layer-emitters.js.map +1 -1
- package/dist/generator/phantom-dependency-emitters.d.ts +1 -1
- package/dist/generator/phantom-dependency-emitters.d.ts.map +1 -1
- package/dist/generator/phantom-dependency-emitters.js +2 -2
- package/dist/generator/phantom-dependency-emitters.js.map +1 -1
- package/dist/generator/public-api-emitters.d.ts +2 -1
- package/dist/generator/public-api-emitters.d.ts.map +1 -1
- package/dist/generator/public-api-emitters.js +8 -5
- package/dist/generator/public-api-emitters.js.map +1 -1
- package/dist/generator/role-layering-emitters.d.ts +5 -1
- package/dist/generator/role-layering-emitters.d.ts.map +1 -1
- package/dist/generator/role-layering-emitters.js +16 -8
- package/dist/generator/role-layering-emitters.js.map +1 -1
- package/dist/generator/server-client-emitters.d.ts.map +1 -1
- package/dist/generator/server-client-emitters.js +1 -4
- package/dist/generator/server-client-emitters.js.map +1 -1
- package/dist/generator/stories-isolation-emitters.d.ts +4 -2
- package/dist/generator/stories-isolation-emitters.d.ts.map +1 -1
- package/dist/generator/stories-isolation-emitters.js +7 -3
- package/dist/generator/stories-isolation-emitters.js.map +1 -1
- package/dist/generator/test-isolation-emitters.d.ts +4 -3
- package/dist/generator/test-isolation-emitters.d.ts.map +1 -1
- package/dist/generator/test-isolation-emitters.js +8 -17
- package/dist/generator/test-isolation-emitters.js.map +1 -1
- package/dist/generator/ui-data-isolation-emitters.d.ts +4 -1
- package/dist/generator/ui-data-isolation-emitters.d.ts.map +1 -1
- package/dist/generator/ui-data-isolation-emitters.js +8 -3
- package/dist/generator/ui-data-isolation-emitters.js.map +1 -1
- package/dist/generator/workspace-package-emitters.d.ts +3 -2
- package/dist/generator/workspace-package-emitters.d.ts.map +1 -1
- package/dist/generator/workspace-package-emitters.js +7 -15
- package/dist/generator/workspace-package-emitters.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/remote/server.d.ts +2 -2
- package/dist/mcp/remote/server.d.ts.map +1 -1
- package/dist/mcp/remote/server.js +8 -2
- package/dist/mcp/remote/server.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +2 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +4 -4
- package/dist/mcp/tools.js.map +1 -1
- package/dist/scanner/file-walker.d.ts +4 -0
- package/dist/scanner/file-walker.d.ts.map +1 -1
- package/dist/scanner/file-walker.js +33 -2
- package/dist/scanner/file-walker.js.map +1 -1
- package/dist/scanner/usage-scanner.d.ts +2 -0
- package/dist/scanner/usage-scanner.d.ts.map +1 -1
- package/dist/scanner/usage-scanner.js +25 -8
- package/dist/scanner/usage-scanner.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# archprint
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `archprint generate` no longer adds a new break to an adopted rule's exceptions. Earlier, each run rebuilt the exceptions from the current code, so a violation that had been merged (`check` only warns unless `--fail-on new`) became a permanent exception the next time anyone ran `generate`, without a word. On a small repo the same slip could drop the rule instead. Each adopted rule now records its exceptions in `.archprint/config.json`. When a file breaks an adopted rule and was not one of them, `generate` stops, names the rule and the file, and writes nothing, so the rules already in `.archprint/` stay in force. Fix the file, or accept it with `archprint allow <rule> <file> --reason "..."`. When an exception is fixed, the next `generate` enforces the rule on that file and lists it. Rules adopted by an earlier version have their current exceptions recorded on the first run, which lists every one. A forbidden-import (AP-) rule adopted from a full scan and regenerated with `--fast`, or the other way round, has its exceptions measured again and listed rather than compared, because the two scans see different imports. `generate --reset` starts afresh.
|
|
8
|
+
- `generate --check` now runs through your repo's own ESLint. It used the copy of ESLint that came with archprint, which `npx archprint` does not install, so under `npx` it failed with "Cannot find package 'eslint'". It now loads ESLint from your repo (version 9 or later) and exits with code 2 and a clear message when there is none. Once the rules are wired, it lints through your ESLint config, the one your editor and CI run, instead of the generated rules on their own, and names any generated rule that config turns off, downgrades to a warning or overrides for some files, with an example file. If your ESLint config fails to load, the check stops with exit code 2 and the error instead of passing. Before wiring, it checks the generated rules on their own, says so, and uses your repo's TypeScript parser.
|
|
9
|
+
- `archprint explain`, the `archprint_explain` MCP tool and `archprint allow` now accept a rule by any of its names: its id (`no-lib-to-components`, the one `generate --rules` takes), its label (`lib !-> components`), or its ESLint name (`archprint/no-lib-to-components`, or `archprint/no-ui-layer-in-server-entry` for `AP-002`), in any case and spacing. `generate --rules` accepts the ESLint name too. Earlier, `archprint_explain` took only the label and `archprint explain` only the forbidden-import (AP-) ids, so the name ESLint printed was rejected. `archprint explain` now explains every rule `scan` lists, with its evidence, the files that break it and how to adopt it. Each rule in `scan --json` and `archprint_scan` now carries its `id`.
|
|
10
|
+
- The test-isolation, import-style, console-isolation, env-access and workspace-package rules in `.archprint/eslint.mjs` now run under their own names (`archprint/test-isolation`, `archprint/import-style`, `archprint/console-isolation`, `archprint/env-access`, `archprint/workspace-package`) instead of ESLint's `no-restricted-imports`, `no-console` and `no-restricted-properties`. ESLint keeps one setting per core rule for each file, so a repo that configured one of those rules itself, for a folder or the whole project, silently replaced archprint's rule there (or the other way round). Both now apply side by side. Each rule counts imports the way the scan does: test-isolation and workspace-package ignore type-only imports, and all three import rules check `import()` calls. Run `archprint generate` to refresh the file. If you silenced an archprint finding with an `eslint-disable` comment naming the core rule, rename it to the `archprint/` name. Rule ids in `config.json`, `check` and `allow` are unchanged.
|
|
11
|
+
- `archprint generate` now keeps the rules you adopted on every run, not only with `--only` or `--rules`. Earlier, a plain run (including `generate --check`) reset `.archprint/` to the default rule set, so rules you had adopted with `--rules`, such as layer boundaries, disappeared without a word. A plain run now refreshes the adopted rules alongside the defaults and says which it kept. To start again from the default set, pass the new `--reset` flag: it lists every adopted rule it removes. `init --force` does the same. `generate --check` on its own now checks the rules already in `.archprint/` and writes nothing; with other flags it generates first, as before.
|
|
12
|
+
- `archprint init` no longer edits your `README.md` unless you pass `--readme`, the same flag `generate` takes. The README section it writes now lists each adopted rule with this repo's evidence (for example "`AP-001`: A request handler must not import the database client directly (45 of 45 files it applies to follow it)"), plus what your code follows that no rule enforces and what is held for review. It no longer carries the "% of comparable repos" figures or the "Worth adopting" list; those stay in the terminal output and in `archprint recommend`. `init` now ends by listing every file it wrote or changed.
|
|
13
|
+
- `archprint scan` reports far fewer false orphan modules, and lists the files only tests import separately. A file now counts as used when anything references it: a type-only import, an `export ... from` through a barrel, an `import()` call, or a tool config that names it (such as Vitest's `setupFiles`). Next.js metadata files (`robots`, `sitemap`, `manifest`, `opengraph-image`, `twitter-image`, `icon`, `apple-icon`), `proxy` and `instrumentation-client` at the app root, and Storybook stories are recognized as entries. Production files that only their own tests import, which is dead code the tests keep alive, now come first, under "Imported only by tests". On five open-source Next.js apps the orphan list shrank from 389 to 246 files without listing any file the earlier version did not. `detectOrphans` in the library API no longer takes an options argument, and its result adds `testOnly`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- The generated dependency-cruiser rules now exempt exactly the files a rule tolerates. Earlier, an exemption matched any path ending the same way, so in a monorepo the exempted `src/lib/legacy.ts` of `apps/web` also silenced a new break at `apps/api/src/lib/legacy.ts` when dependency-cruiser checked both apps, and within one app it also exempted, say, `src/lib/legacy.ts` when only `lib/legacy.ts` was meant. An exemption still applies whether dependency-cruiser runs from the repository root or inside the app. Run `archprint generate` to refresh `.archprint/dependency-cruiser.json`.
|
|
18
|
+
- Fixed three ways the generated dependency-cruiser rules could be wrong. The role-layering, feature-slice, app-isolation, stories-isolation and UI/data rules did not exempt the files they were inferred with, so adopting one could fail dependency-cruiser straight away on code that already broke it. Those rules, the public-API rules and test isolation also ignored `archprint allow`, so an allowed file kept failing in dependency-cruiser. All of them now exempt both. For an app below the repository root, such as `apps/web`, the public-API, feature-slice and app-isolation rules matched paths without the app's folder, so dependency-cruiser, which reports `apps/web/src/...`, never applied them. They now include it. Run `archprint generate` to refresh `.archprint/dependency-cruiser.json`. `archprint allow` now says to regenerate for these rules too, instead of telling you to edit dependency-cruiser's config by hand.
|
|
19
|
+
- `archprint check` now gives console-isolation and env-access findings a line number: the line of the first `console.*` call or `process.env` read in the file. Earlier, those findings carried no line, so `--format github` annotated the whole file instead of the line.
|
|
20
|
+
|
|
21
|
+
## 0.15.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- `generate --only <family>` and `generate --rules <ids>` now add to the rules you adopted before instead of replacing them. Earlier, a scoped run kept only what it generated, so `--only layer` on a repo with no layer rules removed every adopted rule and `.archprint/eslint.mjs` with them. A scoped run now lists the rules it kept and names any earlier rule the current code no longer supports. A plain `archprint generate` still resets to the default rule set.
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- `.archprint/config.json` now records every rule written to `.archprint/eslint.mjs` or `.archprint/dependency-cruiser.json`. Env access, workspace-package API, role layering, feature slices, app isolation, stories isolation and UI/data separation were enforced but missing from the adopted rules, so `archprint check` did not report them and `archprint allow` refused them. The enforced, report-only and held-for-review lists in `config.json`, the `--readme` section and the `init` summary now follow the adopted rules: a held rule you adopt with `--rules` is listed as adopted, and a recommended rule you did not adopt is listed as report only rather than as adopted.
|
|
30
|
+
|
|
31
|
+
If your CI pins an archprint version (for example the GitHub Action's `archprint-version`), use 0.15.0 or later there too: an older `archprint check` stops with an error on a `config.json` that records these rules.
|
|
32
|
+
|
|
3
33
|
## 0.14.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -153,7 +153,7 @@ archprint explain AP-002 apps/web
|
|
|
153
153
|
# Structural-inference rules are held for review; add --include-structural to emit them too.
|
|
154
154
|
archprint generate apps/web
|
|
155
155
|
|
|
156
|
-
# Confirm the generated rules pass on your repo before wiring
|
|
156
|
+
# Confirm the generated rules pass on your repo before wiring (on its own, --check writes nothing)
|
|
157
157
|
archprint generate apps/web --check
|
|
158
158
|
|
|
159
159
|
# Generate a single rule by id after reviewing it (including a SUGGEST rule)
|
|
@@ -213,7 +213,10 @@ that could be wrong is enforced without you opting in.
|
|
|
213
213
|
|
|
214
214
|
Generated rules are green by construction: each one lets through the few known exception files it was inferred
|
|
215
215
|
from, so adopting it keeps your lint green while new violations are still caught, and a self-consistency check
|
|
216
|
-
refuses to write a rule whose evidence does not hold together.
|
|
216
|
+
refuses to write a rule whose evidence does not hold together. The exceptions are recorded with the rule in
|
|
217
|
+
`.archprint/config.json` and only shrink: when you fix one, the next `generate` enforces the rule there too and
|
|
218
|
+
says so, and a file that breaks an adopted rule later is never added to its exceptions. `generate` stops instead,
|
|
219
|
+
names the file, and writes nothing until you fix it or accept it with `archprint allow` and a reason. To run the generated rules against your code before
|
|
217
220
|
connecting them, use `archprint generate --check`.
|
|
218
221
|
|
|
219
222
|
## What it can detect
|
|
@@ -270,34 +273,43 @@ format.
|
|
|
270
273
|
never re-infers a rule), the exceptions you allowed with a reason, what is enforced, followed but only reported,
|
|
271
274
|
held for review, and worth adopting, and the list of managed outputs `eject` removes.
|
|
272
275
|
- **`.archprint/eslint.mjs`** (when ESLint is present): one self-contained ESLint flat-config file that inlines
|
|
273
|
-
every inferred ESLint rule (marker-based forbidden imports,
|
|
274
|
-
|
|
275
|
-
undeclared (phantom) dependencies, the server/client boundary, package internals and entry
|
|
276
|
+
every inferred ESLint rule (marker-based forbidden imports, import style, test isolation, console isolation,
|
|
277
|
+
and, when you include structural rules and do not use dependency-cruiser, env access, workspace package APIs,
|
|
278
|
+
layer boundaries, undeclared (phantom) dependencies, the server/client boundary, package internals and entry
|
|
279
|
+
purity)
|
|
276
280
|
and needs no extra plugins: it adds rules to your existing ESLint setup, which already parses your TypeScript.
|
|
277
281
|
So you can commit it, publish it, or hand it to another repo and adopt it in one line
|
|
278
282
|
(`import archprint from './.archprint/eslint.mjs'`). Layer boundaries are the exception: they find your app
|
|
279
283
|
relative to the file, so they only apply where it was generated. It self-ignores `**/.archprint/**`. The
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
rules ship as a generated local eslint plugin inside it, so wiring the eslint config enforces them too, no extra
|
|
285
|
+
install. Each rule has its own name, `archprint/<rule id>` (for example `archprint/test-isolation` or
|
|
286
|
+
`archprint/no-lib-to-app`), so your own settings for core rules such as `no-console` or `no-restricted-imports`
|
|
287
|
+
never replace archprint's, and archprint's never replace yours.
|
|
282
288
|
- **`.archprint/dependency-cruiser.json`** (when dependency-cruiser is present): one `forbidden` ruleset with the
|
|
283
289
|
mechanical boundaries (public-API deep-import, test-isolation); the review-held ones (layer, role-layering,
|
|
284
290
|
feature-slice, app-isolation, entry-purity, dependency-internals, phantom deps, server/client) are added only with
|
|
285
291
|
`--include-structural`, after you review them.
|
|
286
|
-
- **A managed
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
- **A managed `.prettierignore` entry** so the generated files stay out of your formatter, and, only when you pass
|
|
293
|
+
`--readme` to `init` or `generate`, a managed section in your `README.md` listing each adopted rule with this
|
|
294
|
+
repo's evidence (for example "45 of 45 files it applies to follow it"), what your code follows but no rule
|
|
295
|
+
enforces, and what is held for review.
|
|
289
296
|
|
|
290
297
|
`--expand` additionally writes the granular artifacts inside `.archprint/`: the per-family ESLint and
|
|
291
298
|
dependency-cruiser JSON, per-rule cards (`.md`) with passing and failing fixtures, the eslint-plugin-boundaries
|
|
292
299
|
element-types config, ts-arch tests, and the Mermaid and Graphviz DOT layer graph.
|
|
293
300
|
|
|
294
|
-
**Staying in sync, and leaving cleanly.** Re-running `generate`
|
|
295
|
-
|
|
301
|
+
**Staying in sync, and leaving cleanly.** Re-running `generate` refreshes `.archprint/`: it keeps every rule you
|
|
302
|
+
adopted, names any the evidence no longer supports and drops it, so the output never drifts from the code.
|
|
303
|
+
`generate --reset` (and `init --force`) start again from the default rule set and list the adopted rules they
|
|
304
|
+
remove. `wire` inserts a single managed
|
|
296
305
|
reference into each enforcement tool your repo uses (a flat eslint config, a `.dependency-cruiser.json`), one that
|
|
297
306
|
survives those regenerations; for a config it cannot safely edit (a JS dependency-cruiser config, say), it prints
|
|
298
307
|
the exact snippet to paste. `eject` removes Archprint's files and every wired reference, restoring each config
|
|
299
|
-
exactly. `generate --check` runs the generated ESLint rules against your repo
|
|
300
|
-
|
|
308
|
+
exactly. `generate --check` runs the generated ESLint rules against your repo with your own ESLint (version 9 or
|
|
309
|
+
later, installed in the repo) and reports whether they pass; on its own it checks the rules already generated and
|
|
310
|
+
writes nothing. Once they are wired, it lints through your ESLint config, the one your editor and CI run, and names
|
|
311
|
+
any generated rule that config turns off or overrides for some files. Before wiring, it checks the rules on their
|
|
312
|
+
own. Upgrading from 0.5.x? `archprint migrate` moves an older `archprint-rules/` setup to
|
|
301
313
|
this layout and rewires your configs in place.
|
|
302
314
|
|
|
303
315
|
## Use in CI
|
|
@@ -390,8 +402,8 @@ jobs:
|
|
|
390
402
|
what architecture rules your repo already follows, with the evidence, before it writes code. It exposes four
|
|
391
403
|
read-only tools: `archprint_scan`, `archprint_recommend`, `archprint_explain`, and `archprint_check`. Each rule
|
|
392
404
|
comes back stated in plain words, with its evidence, the files that break it, and whether archprint enforces it,
|
|
393
|
-
holds it for review, or only reports it. `archprint_explain` takes any rule
|
|
394
|
-
`AP-002` or `
|
|
405
|
+
holds it for review, or only reports it. `archprint_explain` takes any rule from the scan by its id, label or
|
|
406
|
+
ESLint name (for example `AP-002`, `env-access`, `no-lib-to-app`, `lib !-> app` or `archprint/no-lib-to-app`). `archprint_check` reports the adopted rules the agent's current change breaks,
|
|
395
407
|
uncommitted edits included, so it can fix them before it finishes. Point Claude Desktop, Claude Code, Cursor, or
|
|
396
408
|
any MCP client at it:
|
|
397
409
|
|
|
@@ -480,25 +492,28 @@ reachability) and knip (dead code); rather than compete, it writes the rules it
|
|
|
480
492
|
## Commands
|
|
481
493
|
|
|
482
494
|
- **`archprint init [path]`**: zero-config setup. Detects the stack, enforces the rules the code already follows,
|
|
483
|
-
|
|
484
|
-
`--out <dir>`, `--fast`, `--force`.
|
|
495
|
+
writes `.archprint/`, and lists every file it wrote or changed. Options: `--readme` (also add a managed section
|
|
496
|
+
to `README.md`), `--expand`, `--include-structural`, `--out <dir>`, `--fast`, `--force`.
|
|
485
497
|
- **`archprint scan [path]`**: reports the rules the repo already follows, with evidence. Changes nothing.
|
|
486
498
|
`--deep` resolves through barrels and aliases.
|
|
487
|
-
- **`archprint explain <
|
|
488
|
-
|
|
499
|
+
- **`archprint explain <rule> [path]`**: shows the evidence behind one rule, named by its id, label or ESLint name
|
|
500
|
+
(`AP-002`, `no-lib-to-app`, `"lib !-> app"`, `archprint/no-lib-to-app`): its gate, the files that break it, and how
|
|
501
|
+
to adopt it. For the forbidden-import (AP-) rules it adds a codeframe per exception, how to fix, and when not to
|
|
502
|
+
use it.
|
|
489
503
|
- **`archprint recommend [path]`**: recommends a rule set from the repo's evidence and detected stack (works on a
|
|
490
504
|
fresh repo too), and names the installed tool that will enforce each rule it can write.
|
|
491
505
|
- **`archprint generate [path]`**: writes the auto-trusted mechanical rules to `.archprint/` for the linters your
|
|
492
506
|
repo uses; structural rules are held for review. `--emit <eslint|dependency-cruiser|all>` forces the format,
|
|
493
|
-
`--only <family>` and `--rules <ids>`
|
|
494
|
-
|
|
507
|
+
`--only <family>` and `--rules <ids>` adopt one family or the rules they name (such as `AP-002`, `import-style`
|
|
508
|
+
or the layer rule `no-lib-to-app`), every run keeps the rules you adopted before and `--reset` returns to the
|
|
509
|
+
default set, `--check` runs the generated rules against your repo (writing nothing when passed on its own),
|
|
495
510
|
`--readme` adds the README section, `--expand` also writes the per-family files, cards, fixtures and graph, and
|
|
496
511
|
`--rule <id>` emits one reviewed rule. Also `--include-structural`, `--no-graph`, `--out <dir>`, `--fast`.
|
|
497
512
|
- **`archprint check [path]`**: reports the violations of your adopted rules that a change introduces, compared
|
|
498
513
|
with `--base <branch or commit>`. Warning only unless `--fail-on new`. `--format text|json|github`,
|
|
499
514
|
`--out <dir>`. See [Use in CI](#use-in-ci).
|
|
500
|
-
- **`archprint allow <rule> <file> --reason "..."`**: accepts one adopted rule
|
|
501
|
-
reason, recorded in `.archprint/config.json`. `check` stops counting it and lists it in the pull request;
|
|
515
|
+
- **`archprint allow <rule> <file> --reason "..."`**: accepts one adopted rule (by id or ESLint name) being broken
|
|
516
|
+
in one file, with a reason, recorded in `.archprint/config.json`. `check` stops counting it and lists it in the pull request;
|
|
502
517
|
`generate` stops the generated rules flagging it. `--remove` takes it back out.
|
|
503
518
|
- **`archprint wire`**: references the generated rules from the enforcement tools your repo uses (flat eslint
|
|
504
519
|
config, `.dependency-cruiser.json`) through a managed, reversible reference. `--out <dir>`, `--dry-run`.
|
|
@@ -564,8 +579,9 @@ Without dependency-cruiser, each boundary becomes an ESLint rule in `.archprint/
|
|
|
564
579
|
`archprint/no-utils-to-app`, with no extra plugin; with dependency-cruiser, it goes there instead. The rule
|
|
565
580
|
exempts the files that already break the boundary, so your lint stays green, and it catches a new import across
|
|
566
581
|
the boundary, by relative path or alias. `archprint check` reports a new break in a pull request, and
|
|
567
|
-
`archprint allow` records a justified exception. `--rules`
|
|
568
|
-
|
|
582
|
+
`archprint allow` records a justified exception. `--rules` adds the rules it names to the ones you adopted before,
|
|
583
|
+
so you can adopt boundaries one run at a time, and a plain `archprint generate` keeps them too (`--reset` returns to
|
|
584
|
+
the default rule set). If your CI pins archprint (for example the GitHub Action's `archprint-version`), use 0.13.0
|
|
569
585
|
or later there first. The [rules reference](https://tommkruix.github.io/archprint/rules#layer-boundaries-review)
|
|
570
586
|
says exactly which imports and files the rule reads.
|
|
571
587
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Role } from '../scanner/role-classifier.js';
|
|
2
|
+
import type { AppIsolationGroup } from '../detector/app-isolation-detector.js';
|
|
3
|
+
import type { FeatureSliceGroup } from '../detector/feature-slice-detector.js';
|
|
2
4
|
import type { LayerBoundary } from '../detector/layer-detector.js';
|
|
5
|
+
import type { RoleBoundary } from '../detector/role-layering-detector.js';
|
|
3
6
|
import type { ScannedPattern, ScanResult } from './scan.js';
|
|
4
7
|
/** Where 0.9.0 to 0.11.x kept the adopted rules, before they moved into config.json. */
|
|
5
8
|
export declare const LEGACY_RULES_FILE = "rules.json";
|
|
@@ -14,6 +17,8 @@ interface RuleBase {
|
|
|
14
17
|
statement: string;
|
|
15
18
|
mode: ResolutionMode;
|
|
16
19
|
evidence: AdoptionEvidence;
|
|
20
|
+
/** The known breaks recorded when the rule was written; `generate` only shrinks the list. Absent in older configs. */
|
|
21
|
+
exceptions?: string[];
|
|
17
22
|
}
|
|
18
23
|
export interface ForbiddenImportRule extends RuleBase {
|
|
19
24
|
family: 'forbidden-imports';
|
|
@@ -28,14 +33,23 @@ export interface PublicApiRule extends RuleBase {
|
|
|
28
33
|
dir: string;
|
|
29
34
|
}
|
|
30
35
|
export interface SingleFamilyRule extends RuleBase {
|
|
31
|
-
family: 'test-isolation' | 'console-isolation' | 'import-style' | 'phantom-deps' | 'server-client' | 'dependency-hygiene' | 'entry-purity' | 'cycles';
|
|
36
|
+
family: 'test-isolation' | 'console-isolation' | 'import-style' | 'phantom-deps' | 'server-client' | 'dependency-hygiene' | 'entry-purity' | 'cycles' | 'env-access' | 'workspace-package-api' | 'stories-isolation' | 'ui-data';
|
|
32
37
|
}
|
|
33
38
|
export interface LayerRule extends RuleBase {
|
|
34
39
|
family: 'layer';
|
|
35
40
|
from: string;
|
|
36
41
|
to: string;
|
|
37
42
|
}
|
|
38
|
-
export
|
|
43
|
+
export interface RoleLayeringRule extends RuleBase {
|
|
44
|
+
family: 'role-layering';
|
|
45
|
+
from: Role;
|
|
46
|
+
to: Role;
|
|
47
|
+
}
|
|
48
|
+
export interface SiblingIsolationRule extends RuleBase {
|
|
49
|
+
family: 'feature-slice' | 'app-isolation';
|
|
50
|
+
container: string;
|
|
51
|
+
}
|
|
52
|
+
export type AdoptedRule = ForbiddenImportRule | PublicApiRule | LayerRule | RoleLayeringRule | SiblingIsolationRule | SingleFamilyRule;
|
|
39
53
|
export declare function forbiddenImportRule(pattern: ScannedPattern, mode: ResolutionMode): AdoptedRule;
|
|
40
54
|
export declare function testIsolationRule(scan: ScanResult): AdoptedRule;
|
|
41
55
|
export declare function consoleIsolationRule(scan: ScanResult): AdoptedRule;
|
|
@@ -44,6 +58,13 @@ export declare function phantomDependencyRule(scan: ScanResult): AdoptedRule;
|
|
|
44
58
|
export declare function serverClientRule(scan: ScanResult): AdoptedRule;
|
|
45
59
|
export declare function dependencyInternalsRule(scan: ScanResult): AdoptedRule;
|
|
46
60
|
export declare function entryPurityRule(scan: ScanResult): AdoptedRule;
|
|
61
|
+
export declare function envAccessRule(scan: ScanResult): AdoptedRule;
|
|
62
|
+
export declare function workspacePackageRule(scan: ScanResult): AdoptedRule;
|
|
63
|
+
export declare function storiesIsolationRule(scan: ScanResult): AdoptedRule;
|
|
64
|
+
export declare function uiDataRule(scan: ScanResult): AdoptedRule;
|
|
65
|
+
export declare function roleLayeringRule(boundary: RoleBoundary): RoleLayeringRule;
|
|
66
|
+
export declare function featureSliceRule(group: FeatureSliceGroup): SiblingIsolationRule;
|
|
67
|
+
export declare function appIsolationRule(group: AppIsolationGroup): SiblingIsolationRule;
|
|
47
68
|
export declare const NO_CYCLES_RULE = "no-cycles";
|
|
48
69
|
/** Whether the code has no cycle and enough files to say so: only then is no-cycles a rule it follows. */
|
|
49
70
|
export declare const isCycleFree: (scan: ScanResult) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adopted-rules.d.ts","sourceRoot":"","sources":["../../src/cli/adopted-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"adopted-rules.d.ts","sourceRoot":"","sources":["../../src/cli/adopted-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAqB1E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5D,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAG9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,sHAAsH;IACtH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,IA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AW,EAAE,CAQ1E;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,IAAI,CAGjF;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,IAAI,CAKrE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAoB3D"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
+
import { appIsolationRuleName } from '../generator/app-isolation-emitters.js';
|
|
4
|
+
import { ENV_ACCESS_RULE } from '../generator/env-access-emitters.js';
|
|
5
|
+
import { featureSliceRuleName } from '../generator/feature-slice-emitters.js';
|
|
3
6
|
import { layerRuleName } from '../generator/layer-emitters.js';
|
|
4
7
|
import { DEPENDENCY_INTERNALS_RULE } from '../generator/dependency-internals-emitters.js';
|
|
5
8
|
import { ENTRY_PURITY_RULE } from '../generator/entry-purity-emitters.js';
|
|
6
9
|
import { PHANTOM_DEPENDENCY_RULE } from '../generator/phantom-dependency-emitters.js';
|
|
7
10
|
import { publicApiRuleName } from '../generator/public-api-emitters.js';
|
|
11
|
+
import { roleLayeringRuleName } from '../generator/role-layering-emitters.js';
|
|
8
12
|
import { SERVER_CLIENT_RULE } from '../generator/server-client-emitters.js';
|
|
13
|
+
import { STORIES_ISOLATION_RULE } from '../generator/stories-isolation-emitters.js';
|
|
14
|
+
import { UI_DATA_RULE } from '../generator/ui-data-isolation-emitters.js';
|
|
15
|
+
import { WORKSPACE_PACKAGE_RULE } from '../generator/workspace-package-emitters.js';
|
|
9
16
|
import { configPath, configSection, readConfigSection } from './archprint-config.js';
|
|
10
|
-
import { FAMILY_STATEMENTS } from './rule-statements.js';
|
|
17
|
+
import { appIsolationStatement, boundaryStatement, FAMILY_STATEMENTS, sliceStatement, } from './rule-statements.js';
|
|
11
18
|
/** Where 0.9.0 to 0.11.x kept the adopted rules, before they moved into config.json. */
|
|
12
19
|
export const LEGACY_RULES_FILE = 'rules.json';
|
|
13
20
|
const LEGACY_RULES_FORMAT = 1;
|
|
@@ -98,6 +105,77 @@ export function entryPurityRule(scan) {
|
|
|
98
105
|
evidence: evidenceOf(analysis.gate, analysis.entryCount, analysis.offenderCount),
|
|
99
106
|
};
|
|
100
107
|
}
|
|
108
|
+
export function envAccessRule(scan) {
|
|
109
|
+
const analysis = scan.envAccess;
|
|
110
|
+
return {
|
|
111
|
+
id: ENV_ACCESS_RULE,
|
|
112
|
+
family: 'env-access',
|
|
113
|
+
statement: FAMILY_STATEMENTS['env-access'],
|
|
114
|
+
mode: 'fast',
|
|
115
|
+
evidence: evidenceOf(analysis.gate, analysis.subjectFileCount, analysis.offenderCount),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export function workspacePackageRule(scan) {
|
|
119
|
+
const analysis = scan.workspacePackageApi;
|
|
120
|
+
return {
|
|
121
|
+
id: WORKSPACE_PACKAGE_RULE,
|
|
122
|
+
family: 'workspace-package-api',
|
|
123
|
+
statement: FAMILY_STATEMENTS['workspace-package-api'],
|
|
124
|
+
mode: 'fast',
|
|
125
|
+
evidence: evidenceOf(analysis.gate, analysis.consumerCount, analysis.offenderCount),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export function storiesIsolationRule(scan) {
|
|
129
|
+
const analysis = scan.storiesIsolation;
|
|
130
|
+
return {
|
|
131
|
+
id: STORIES_ISOLATION_RULE,
|
|
132
|
+
family: 'stories-isolation',
|
|
133
|
+
statement: FAMILY_STATEMENTS['stories-isolation'],
|
|
134
|
+
mode: 'fast',
|
|
135
|
+
evidence: evidenceOf(analysis.gate, analysis.storyCount, analysis.offenderCount),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export function uiDataRule(scan) {
|
|
139
|
+
const analysis = scan.uiDataIsolation;
|
|
140
|
+
return {
|
|
141
|
+
id: UI_DATA_RULE,
|
|
142
|
+
family: 'ui-data',
|
|
143
|
+
statement: FAMILY_STATEMENTS['ui-data'],
|
|
144
|
+
mode: 'fast',
|
|
145
|
+
evidence: evidenceOf(analysis.gate, analysis.componentCount, analysis.offenderCount),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export function roleLayeringRule(boundary) {
|
|
149
|
+
return {
|
|
150
|
+
id: roleLayeringRuleName(boundary.from, boundary.to),
|
|
151
|
+
family: 'role-layering',
|
|
152
|
+
from: boundary.from,
|
|
153
|
+
to: boundary.to,
|
|
154
|
+
statement: boundaryStatement(boundary.from, boundary.to),
|
|
155
|
+
mode: 'fast',
|
|
156
|
+
evidence: evidenceOf(boundary.gate, boundary.roleFileCount, boundary.violatingFileCount),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export function featureSliceRule(group) {
|
|
160
|
+
return {
|
|
161
|
+
id: featureSliceRuleName(group.container),
|
|
162
|
+
family: 'feature-slice',
|
|
163
|
+
container: group.container,
|
|
164
|
+
statement: sliceStatement(group.container),
|
|
165
|
+
mode: 'fast',
|
|
166
|
+
evidence: evidenceOf(group.gate, group.sliceFileCount, group.crossImporterCount),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export function appIsolationRule(group) {
|
|
170
|
+
return {
|
|
171
|
+
id: appIsolationRuleName(group.container),
|
|
172
|
+
family: 'app-isolation',
|
|
173
|
+
container: group.container,
|
|
174
|
+
statement: appIsolationStatement(group.container),
|
|
175
|
+
mode: 'fast',
|
|
176
|
+
evidence: evidenceOf(group.gate, group.appFileCount, group.crossImporterCount),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
101
179
|
export const NO_CYCLES_RULE = 'no-cycles';
|
|
102
180
|
/** Whether the code has no cycle and enough files to say so: only then is no-cycles a rule it follows. */
|
|
103
181
|
export const isCycleFree = (scan) => scan.cycles.cycles.length === 0 && scan.cycles.gate.status === 'AUTO';
|
|
@@ -150,6 +228,13 @@ const FAMILIES = new Set([
|
|
|
150
228
|
'test-isolation',
|
|
151
229
|
'console-isolation',
|
|
152
230
|
'import-style',
|
|
231
|
+
'env-access',
|
|
232
|
+
'workspace-package-api',
|
|
233
|
+
'stories-isolation',
|
|
234
|
+
'ui-data',
|
|
235
|
+
'role-layering',
|
|
236
|
+
'feature-slice',
|
|
237
|
+
'app-isolation',
|
|
153
238
|
]);
|
|
154
239
|
const MAX_PATTERN_LENGTH = 200;
|
|
155
240
|
const PATTERN_FLAGS = /^[imsu]*$/;
|
|
@@ -166,6 +251,11 @@ function validateRule(rule, file) {
|
|
|
166
251
|
if (candidate.mode !== 'deep' && candidate.mode !== 'fast') {
|
|
167
252
|
return invalid(`rule ${candidate.id} has no valid resolution mode`);
|
|
168
253
|
}
|
|
254
|
+
const { exceptions } = candidate;
|
|
255
|
+
if (exceptions !== undefined &&
|
|
256
|
+
!(Array.isArray(exceptions) && exceptions.every((item) => typeof item === 'string'))) {
|
|
257
|
+
return invalid(`rule ${candidate.id} has exceptions that are not a list of paths`);
|
|
258
|
+
}
|
|
169
259
|
if (candidate.family === 'forbidden-imports') {
|
|
170
260
|
const markers = candidate.forbidden;
|
|
171
261
|
if (!Array.isArray(markers) || !Array.isArray(candidate.roles)) {
|
|
@@ -190,10 +280,14 @@ function validateRule(rule, file) {
|
|
|
190
280
|
if (candidate.family === 'public-api' && typeof candidate.dir !== 'string') {
|
|
191
281
|
return invalid(`rule ${candidate.id} has no directory`);
|
|
192
282
|
}
|
|
193
|
-
if (candidate.family === 'layer' &&
|
|
283
|
+
if ((candidate.family === 'layer' || candidate.family === 'role-layering') &&
|
|
194
284
|
(typeof candidate.from !== 'string' || typeof candidate.to !== 'string')) {
|
|
195
285
|
return invalid(`rule ${candidate.id} has no layers`);
|
|
196
286
|
}
|
|
287
|
+
if ((candidate.family === 'feature-slice' || candidate.family === 'app-isolation') &&
|
|
288
|
+
typeof candidate.container !== 'string') {
|
|
289
|
+
return invalid(`rule ${candidate.id} has no directory`);
|
|
290
|
+
}
|
|
197
291
|
return rule;
|
|
198
292
|
}
|
|
199
293
|
function parseRuleList(rules, file) {
|
|
@@ -238,7 +332,11 @@ export function ruleDefinitionKey(rule) {
|
|
|
238
332
|
case 'public-api':
|
|
239
333
|
return JSON.stringify([...common, rule.dir]);
|
|
240
334
|
case 'layer':
|
|
335
|
+
case 'role-layering':
|
|
241
336
|
return JSON.stringify([...common, rule.from, rule.to]);
|
|
337
|
+
case 'feature-slice':
|
|
338
|
+
case 'app-isolation':
|
|
339
|
+
return JSON.stringify([...common, rule.container]);
|
|
242
340
|
default:
|
|
243
341
|
return JSON.stringify(common);
|
|
244
342
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adopted-rules.js","sourceRoot":"","sources":["../../src/cli/adopted-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAC9C,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAgD9B,MAAM,UAAU,GAAG,CAAC,IAAgB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E,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,mBAAmB;YACtB,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,GAAG,MAAM;gBACT,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;gBACtB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE;aAC1E,CAAC,CAAC;QACL,KAAK,YAAY;YACf,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/C,KAAK,OAAO,CAAC;QACb,KAAK,eAAe;YAClB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACzD,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QACrD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;AACH,CAAC"}
|
package/dist/cli/allow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allow.d.ts","sourceRoot":"","sources":["../../src/cli/allow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"allow.d.ts","sourceRoot":"","sources":["../../src/cli/allow.ts"],"names":[],"mappings":"AAcA,qBAAa,UAAW,SAAQ,KAAK;CAAG;AAExC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CA6CtD"}
|
package/dist/cli/allow.js
CHANGED
|
@@ -4,18 +4,12 @@ import { assertRealDirectory, ownedPath } from '../generator/owned-paths.js';
|
|
|
4
4
|
import { readAdoptedRules } from './adopted-rules.js';
|
|
5
5
|
import { allowKey, readAllowed, writeAllowed, } from './allowed-exceptions.js';
|
|
6
6
|
import { readConfig } from './archprint-config.js';
|
|
7
|
+
import { findRule } from './rule-ref.js';
|
|
7
8
|
import { evaluateRules } from './check-evaluate.js';
|
|
8
9
|
export class AllowError extends Error {
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'phantom-deps',
|
|
13
|
-
'server-client',
|
|
14
|
-
]);
|
|
15
|
-
/** What to run so the generated rules follow the change; nothing when only archprint check enforces the rule. */
|
|
16
|
-
const regenerateHint = (rule) => rule.family === 'cycles'
|
|
17
|
-
? ''
|
|
18
|
-
: ` Run archprint generate to update the ${GENERATED_FOR_EITHER_ENFORCER.has(rule.family) ? 'generated' : 'ESLint'} rules.`;
|
|
11
|
+
/** What to run so the generated rules follow the change; cycles have no generated rule. */
|
|
12
|
+
const regenerateHint = (rule) => rule.family === 'cycles' ? '' : ' Run archprint generate to update the generated rules.';
|
|
19
13
|
const toPosix = (value) => value.split(path.sep).join('/');
|
|
20
14
|
export function runAllow(options) {
|
|
21
15
|
const outDir = path.resolve(options.cwd, options.out);
|
|
@@ -25,7 +19,7 @@ export function runAllow(options) {
|
|
|
25
19
|
if (config === null || adopted === null) {
|
|
26
20
|
throw new AllowError('No adopted rules here. Run archprint init (or generate) first.');
|
|
27
21
|
}
|
|
28
|
-
const rule =
|
|
22
|
+
const rule = findRule(options.rule, adopted);
|
|
29
23
|
if (rule === undefined) {
|
|
30
24
|
const known = adopted.map((candidate) => candidate.id).join(', ');
|
|
31
25
|
throw new AllowError(`No adopted rule "${options.rule}". Adopted rules: ${known || 'none'}.`);
|
|
@@ -59,9 +53,6 @@ export function runAllow(options) {
|
|
|
59
53
|
}
|
|
60
54
|
const entry = { rule: rule.id, file, reason };
|
|
61
55
|
writeAllowed(outDir, [...others, entry]);
|
|
62
|
-
|
|
63
|
-
? ' dependency-cruiser does not read this list, so add the exception there too if you use it.'
|
|
64
|
-
: regenerateHint(rule);
|
|
65
|
-
return `Allowed ${rule.id} in ${file}. archprint check accepts it now.${lint}`;
|
|
56
|
+
return `Allowed ${rule.id} in ${file}. archprint check accepts it now.${regenerateHint(rule)}`;
|
|
66
57
|
}
|
|
67
58
|
//# sourceMappingURL=allow.js.map
|
package/dist/cli/allow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allow.js","sourceRoot":"","sources":["../../src/cli/allow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,GAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG;AAWxC,
|
|
1
|
+
{"version":3,"file":"allow.js","sourceRoot":"","sources":["../../src/cli/allow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC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E,OAAO,IAAI,oCAAoC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;AACjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowed-evidence.d.ts","sourceRoot":"","sources":["../../src/cli/allowed-evidence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"allowed-evidence.d.ts","sourceRoot":"","sources":["../../src/cli/allowed-evidence.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,KAAK,aAAa,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AAoK5D,gHAAgH;AAChH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAU/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,UAAU,CAuKnF"}
|