basalt-ui 1.0.2 → 1.1.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/AGENTS.md CHANGED
@@ -31,8 +31,24 @@ Toolchain: Bun runtime, oxlint + oxfmt, conventional commits (empty scope), `mas
31
31
 
32
32
  **Mantine-free boundary**: `basalt-ui/charts`, `basalt-ui/tokens`, `basalt-ui/guard`,
33
33
  `basalt-ui/query`, `basalt-ui/router-tanstack`, `basalt-ui/agent`, and `basalt-ui/state` must
34
- import zero `@mantine/*`. `@visx/*` is permitted only inside `src/charts/**`. Both rules are
35
- enforced by oxlint `no-restricted-imports` (repo-local and in the shipped consumer preset).
34
+ import zero `@mantine/*`. `@visx/*` is permitted only inside `src/charts/**`. `@visx/*`
35
+ (`basalt/visx-boundary`) is enforced by an oxlint plugin rule in both the repo and the shipped
36
+ consumer preset.
37
+
38
+ The Mantine-free boundary protects two things: **layering** (keeps the token layer upstream of
39
+ Mantine — `cssVariablesResolver` reads `--vx-*` tokens to bind Mantine's surfaces to them, so an
40
+ `@mantine/*` import here would cycle back through the theme layer or let a chart bypass `--vx-*`
41
+ and fork chrome/charts apart) and **packaging** (each of these seven dist entries resolves with
42
+ **no `@mantine/*` installed** — `scripts/check-dist-layering.mjs` walks the built dist graph of all
43
+ seven and fails if any reaches `@mantine/*`; `scripts/pack-test.sh`'s "charts/tokens-only
44
+ (no-Mantine) resolution + render" step additionally scratch-installs the tarball with only
45
+ `react`/`react-dom` and SSR-renders `basalt-ui/charts` + `basalt-ui/tokens` live). The LAYER is
46
+ Mantine-free — the FRAMEWORK is not: `.` requires Mantine (`@mantine/core`/`@mantine/hooks` are
47
+ required, non-optional peers); these seven subpaths don't.
48
+
49
+ Enforcement is repo-local ONLY for the Mantine-free side, not in the shipped preset:
50
+ `./charts`/`./tokens` via the `basalt/token-layer-boundary` plugin rule, `guard`/`query`/
51
+ `router-tanstack`/`agent`/`state` via a plain `no-restricted-imports` ban.
36
52
 
37
53
  **No raw hex or raw color functions**: route every color through `VX.*` tokens or the Mantine
38
54
  theme. Never write `#rrggbb`, `rgb(…)`, or `hsl(…)` in component or style code. Use
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.1.0](https://github.com/jkrumm/basalt-ui/compare/v1.0.2...v1.1.0) (2026-07-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * split the import boundary into three independent rules ([784b673](https://github.com/jkrumm/basalt-ui/commit/784b6739367a25b9ffe379603c02322896e43658))
7
+
1
8
  ## [1.0.2](https://github.com/jkrumm/basalt-ui/compare/v1.0.1...v1.0.2) (2026-07-17)
2
9
 
3
10
 
package/README.md CHANGED
@@ -182,9 +182,9 @@ Named exports only — no default exports.
182
182
 
183
183
  ## Mantine-free boundary
184
184
 
185
- `./charts` and `./tokens` import zero `@mantine/*`. `@visx/*` is only allowed inside `src/charts/**`. The root barrel (`.`) does not re-export `./charts` or `./tokens` — a charts/tokens-only consumer never pulls in Mantine.
185
+ `./charts` and `./tokens` import zero `@mantine/*`. `@visx/*` is only allowed inside `src/charts/**`. The root barrel (`.`) does not re-export `./charts` or `./tokens`.
186
186
 
187
- This boundary is enforced by oxlint `no-restricted-imports` in both the repo and the shipped consumer preset, so the constraint holds downstream too.
187
+ The Mantine-free part protects two things. First, layering: `tokens` is pure data that `cssVariablesResolver` reads to bind Mantine's surfaces to the same `--vx-*` vars charts use, so an `@mantine/*` import in either would cycle back through the theme layer or let a chart bypass `--vx-*` and fork chrome/charts apart. Second, packaging: `./charts` and `./tokens` resolve and render with **no `@mantine/*` installed** — a charts/tokens-only consumer never pulls Mantine into their bundle. This is real and CI-tested (`scripts/pack-test.sh`'s "charts/tokens-only (no-Mantine) resolution + render" step scratch-installs the tarball with only `react`/`react-dom` and SSR-renders `basalt-ui/charts`; `scripts/check-dist-layering.mjs` walks the built dist graph and fails if those entries reach `@mantine/*`; the root barrel not re-exporting them is the third leg). The LAYER is Mantine-free — the FRAMEWORK is not: `.` requires Mantine (`@mantine/core`/`@mantine/hooks` are required, non-optional peers); only `./charts`/`./tokens` don't. Both consequences are a basalt-internal invariant enforced by the repo-local-only `basalt/token-layer-boundary` oxlint plugin rule — not a consumer contract, so it is deliberately absent from the shipped consumer preset. The `@visx/*`-only-in-charts part (`basalt/visx-boundary`) IS shipped, so that constraint holds downstream too.
188
188
 
189
189
  ---
190
190
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  source: basalt-ui
3
- description: visx chart conventions — compose basalt-ui primitives/kinds, stay Mantine-free, and keep all color in `--vx-*` tokens. Enforced by the oxlint `@visx` ban.
3
+ description: visx chart conventions — compose basalt-ui primitives/kinds and keep all color in `--vx-*` tokens. Enforced by the oxlint `@visx` ban.
4
4
  paths:
5
5
  - 'src/**/charts/**'
6
6
  - 'apps/**/charts/**'
@@ -19,15 +19,25 @@ contract, not optional polish.**
19
19
  The shipped oxlint preset (`basalt-ui/configs/oxlint.json`) enforces two hard rules — they hold in
20
20
  downstream apps too:
21
21
 
22
- - **`@visx/*` may only be imported inside a `**/charts/**` directory.** Everywhere else, compose
23
- basalt-ui chart primitives/kinds. If you need a raw visx primitive for a bespoke chart, import it
24
- from `basalt-ui/charts` (it re-exports `Group`, `LinePath`, `Bar`, `AreaClosed`, `scaleLinear`,
25
- `curveMonotoneX`, …) — keep the dependency declared in one place.
26
- - **`@visx/tooltip` is banned everywhere.** Use `ChartTooltip` + `TooltipHeader`/`TooltipRow`/
27
- `TooltipBody` from `basalt-ui/charts`.
28
- - **The `src/charts/` tree must be Mantine-free** — no `@mantine/*` imports. Bridge the Mantine
29
- color scheme to charts in exactly one file (see basalt-mantine.md, the VxBridge pattern); route
30
- components import chart primitives directly from `basalt-ui/charts`, never from the bridge file.
22
+ - **`@visx/*` may only be imported inside a `charts/` directory** (`basalt/visx-boundary`).
23
+ Everywhere else, compose basalt-ui chart primitives/kinds. If you need a raw visx primitive for a
24
+ bespoke chart, import it from `basalt-ui/charts` (it re-exports `Group`, `LinePath`, `Bar`,
25
+ `AreaClosed`, `scaleLinear`, `curveMonotoneX`, …) — keep the dependency declared in one place, and
26
+ keep your own bespoke chart file under a `charts/` directory so it stays on the right side of the
27
+ boundary.
28
+ - **`@visx/tooltip` is banned everywhere** (`basalt/visx-tooltip`). Use `ChartTooltip` +
29
+ `TooltipHeader`/`TooltipRow`/`TooltipBody` from `basalt-ui/charts`.
30
+
31
+ `basalt-ui/charts` is itself Mantine-free (`basalt/token-layer-boundary`, enforced only inside
32
+ basalt-ui's own repo) — that keeps the token layer it reads from upstream of Mantine
33
+ (`cssVariablesResolver` reads `--vx-*` tokens to bind Mantine's surfaces to them, so a chart
34
+ importing `@mantine/*` directly would fork chrome and charts apart instead of sharing one source),
35
+ AND it means `basalt-ui/charts`/`basalt-ui/tokens` resolve and render with no `@mantine/*`
36
+ installed (real, CI-tested — `scripts/pack-test.sh`'s "charts/tokens-only (no-Mantine) resolution +
37
+ render" step). Neither is something a consumer app maintains: there is no local chart-primitives
38
+ tree to keep Mantine-free and no bridge file to own — `BasaltProvider` already bridges the Mantine
39
+ color scheme to the `--vx-*` CSS variables charts read internally. Just compose the shipped
40
+ primitives/kinds and pull color from `VX.*`/`alpha()` (`basalt-ui/tokens`).
31
41
 
32
42
  ## Every chart has
33
43
 
@@ -120,8 +130,8 @@ clutter). Keep stacked-area bands opaque — fading them leaks lower bands.
120
130
  ## Responsive sizing
121
131
 
122
132
  Use `ResponsiveChart` (render-prop container) or `useChartSize` (hook) from `basalt-ui/charts` —
123
- both are backed by `@visx/responsive`'s `useParentSize` and keep the `@visx/*` import inside
124
- `src/charts/**` per the boundary rule. Never reach for `@visx/responsive` directly or
133
+ both are backed by `@visx/responsive`'s `useParentSize` and keep the `@visx/*` import inside a
134
+ `charts/` directory per `basalt/visx-boundary`. Never reach for `@visx/responsive` directly or
125
135
  `useElementSize` from `@mantine/hooks` in a chart file.
126
136
 
127
137
  ```tsx
@@ -158,8 +158,14 @@ import { ChartHoverSync } from 'basalt-ui/charts'
158
158
  - **`@visx/*` may only be imported inside chart files.** The shipped consumer oxlint preset bans
159
159
  direct `@visx/*` outside `**/charts/**`. Need a raw visx primitive for a bespoke chart? Pull it
160
160
  from basalt-ui's curated re-export in `basalt-ui/charts`, or keep the chart under a charts dir.
161
- - **`./charts` and `./tokens` are Mantine-free** — zero `@mantine/*` imports. Keep new chart code
162
- free of Mantine so a charts/tokens-only consumer never pulls Mantine in.
161
+ - **basalt-ui's own `./charts` and `./tokens` are Mantine-free** — zero `@mantine/*` imports,
162
+ keeping the token layer upstream of Mantine inside the framework itself (`cssVariablesResolver`
163
+ reads `--vx-*` tokens to bind Mantine's surfaces to them; a chart importing `@mantine/*` directly
164
+ would fork chrome and charts apart), AND letting `basalt-ui/charts`/`basalt-ui/tokens` resolve and
165
+ render with no `@mantine/*` installed (real, CI-tested — `scripts/pack-test.sh`'s
166
+ "charts/tokens-only (no-Mantine) resolution + render" step). This is a basalt-internal invariant,
167
+ not a rule enforced on your own app code — compose the shipped primitives from
168
+ `basalt-ui/charts`/`basalt-ui/tokens` and you inherit it for free.
163
169
  - **No raw color literals** anywhere except the one guard-exempt series file (and a deliberate
164
170
  `theme-allow` line). `basalt-ui check-theme` is the teeth; run it before committing.
165
171
  - **No raw visx axes.** `basalt-ui check-theme`'s `raw-visx-axis` guard fails the build on a raw
@@ -234,9 +234,10 @@ or auto domain — also z-score/σ via a symmetric domain + zero refLine), **`Du
234
234
  > `--vx-*`, exposed as a `VX.*` ref — never an inline hex. The mechanics of all three live in
235
235
  > **`/basalt-charts`** — defer to it for the "how".
236
236
 
237
- The Mantine-free boundary holds here too: `./charts` and `./tokens` import zero `@mantine/*`, and
238
- `@visx/*` is only allowed under chart files. Both are oxlint-enforced in the shipped consumer
239
- preset.
237
+ The Mantine-free boundary holds here too: `./charts` and `./tokens` import zero `@mantine/*` (an
238
+ internal invariant keeping the token layer upstream of Mantine, and letting those two subpaths
239
+ resolve/render with no `@mantine/*` installed — CI-tested, repo-local only, not shipped), and
240
+ `@visx/*` is only allowed under chart files (oxlint-enforced in the shipped consumer preset too).
240
241
 
241
242
  ## Checklist before declaring a chart "done"
242
243
 
@@ -11,9 +11,9 @@ Colors come from the three-tier `--vx-*` token system — read `VX.*` / a `defin
11
11
  never a raw hex/`rgb()`/`hsl()`. Charts are visx via `basalt-ui/charts` (compose the primitives:
12
12
  `ChartCard`, `ChartLegend`, the `ChartTooltip` family, `AxisLeftNumeric`/`AxisBottomDate`); add a
13
13
  kind on the third repeat, don't loosen the primitives. `basalt-ui/charts` and `basalt-ui/tokens`
14
- are Mantine-free — never import `@mantine/*` under `**/charts/**`, never import `@visx/*` outside
15
- charts. Toolchain is oxlint + oxfmt (no ESLint/Biome/Prettier) and `basalt-ui check-theme` guards the
16
- palette. Runtime is Bun.
14
+ are Mantine-free internally (a framework invariant, not something your own app code must follow)
15
+ — never import `@visx/*` outside a `charts/` directory (oxlint-enforced). Toolchain is oxlint +
16
+ oxfmt (no ESLint/Biome/Prettier) and `basalt-ui check-theme` guards the palette. Runtime is Bun.
17
17
 
18
18
  **Before guessing an import, check the installed package's machine docs**:
19
19
  `node_modules/basalt-ui/llms.txt` (per-subpath import map), `node_modules/basalt-ui/AGENTS.md`, or
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * basalt — the shipped oxlint JS plugin (alpha `jsPlugins`, ESLint-v9-compatible `create(context)`
4
4
  * API). Design-guard AST rules steering consumers onto the token/idiom system that `src/guard`
5
- * (the regex-based `check-theme` CLI) cannot see from a raw-text scan alone, plus the
6
- * `import-boundary` rule enforcing basalt's architecture boundaries (see below).
5
+ * (the regex-based `check-theme` CLI) cannot see from a raw-text scan alone, plus three
6
+ * independent architecture-boundary rules (see below).
7
7
  *
8
8
  * Ships inside `configs/` so the shipped preset (`configs/oxlint.json`) can reference it as
9
9
  * `./oxlint-plugin.js` — a consumer `extends`-ing that preset inherits `jsPlugins` too, and the
@@ -11,7 +11,37 @@
11
11
  *
12
12
  * The four design-guard rules below support the same `theme-allow` escape as `src/guard`: skip a
13
13
  * reported node if a line comment containing `theme-allow` sits on the node's own line or the line
14
- * immediately above it. `import-boundary` deliberately does NOT — see its own comment for why.
14
+ * immediately above it. The three boundary rules deliberately do NOT — see their own comment for
15
+ * why.
16
+ *
17
+ * ── The three boundary rules (`visx-boundary` / `visx-tooltip` / `token-layer-boundary`) ─────────
18
+ * These used to be one bundled `import-boundary` rule sharing a single on/off toggle — that meant
19
+ * a consumer disabling the one check they disagreed with silently dropped the other two as well.
20
+ * Each is now its own rule id with its own `meta`/`create`/registration, so a consumer can only
21
+ * turn one off explicitly, by name — never accidentally take out the others with it.
22
+ *
23
+ * `basalt/token-layer-boundary` is registered ONLY in the repo-local `.oxlintrc.json`, NOT in the
24
+ * shipped `configs/oxlint.json` preset — deliberately absent from what consumers inherit. It
25
+ * protects two things.
26
+ *
27
+ * 1. Layering: `src/tokens/**` is pure data (zero React, zero Mantine) that `cssVariablesResolver`
28
+ * (Mantine-coupled, `src/theme/**`) reads to bind Mantine's surfaces to the same `--vx-*` vars
29
+ * `src/charts/**` reads — chrome and charts are ONE source. If `tokens` imported `@mantine/*`
30
+ * that would cycle (`tokens → theme → tokens`); if `charts` imported `@mantine/*` a chart could
31
+ * read Mantine's theme directly instead of going through `--vx-*`, forking chrome and charts
32
+ * apart. The rule keeps that arrow pointing one way.
33
+ * 2. Packaging: `./charts` and `./tokens` resolve and render with NO `@mantine/*` installed — real
34
+ * and CI-tested, not aspirational (`scripts/pack-test.sh`'s "charts/tokens-only (no-Mantine)
35
+ * resolution + render" step scratch-installs the tarball with only react/react-dom and
36
+ * SSR-renders `basalt-ui/charts`; `scripts/check-dist-layering.mjs` walks the built dist graph
37
+ * and fails if those entries reach `@mantine/*`; the root barrel not re-exporting them is the
38
+ * third leg).
39
+ *
40
+ * The LAYER is Mantine-free — the FRAMEWORK is not: `.` requires Mantine (`@mantine/core`/
41
+ * `@mantine/hooks` are required, non-optional peers); it's just `./charts`/`./tokens` that don't.
42
+ * Both consequences govern basalt's OWN internal layering/packaging, not a consumer contract — a
43
+ * consumer's own `charts/`/`tokens/`-named directories carry no such obligation, which is why
44
+ * shipping this rule in the consumer preset would be meaningless.
15
45
  *
16
46
  * ── About the shipped `configs/oxlint.json` preset ────────────────────────────────────────────
17
47
  * Consumers extend it from their own `.oxlintrc.json` via the node_modules-relative path:
@@ -21,9 +51,9 @@
21
51
  * override glob, so any ban that must also hold inside an override is duplicated into that
22
52
  * override, AND a consumer's own `no-restricted-imports` override on an overlapping glob silently
23
53
  * REPLACES basalt's ban rather than merging with it. That is exactly why the `@visx/*`-only-in-
24
- * charts and Mantine-free charts/tokens boundaries live in the `import-boundary` rule below instead
25
- * of `no-restricted-imports`: a jsPlugin rule has its own rule id, so a consumer can only turn it
26
- * off explicitly, by name — never silently. `configs/oxlint.json` is generated from `SURFACES` by
54
+ * charts and token-layer charts/tokens boundaries live in plugin rules below instead of
55
+ * `no-restricted-imports`: a jsPlugin rule has its own rule id, so a consumer can only turn it off
56
+ * explicitly, by name — never silently. `configs/oxlint.json` is generated from `SURFACES` by
27
57
  * `scripts/gen-oxlint.ts` (`--check` is the CI drift gate) — its top-level keys are limited to what
28
58
  * oxlint's own parser accepts (see `ALLOWED_TOP_LEVEL_KEYS` in that script); do not add ad hoc keys
29
59
  * to that file.
@@ -263,21 +293,23 @@ const rawScrollContainer = {
263
293
  },
264
294
  }
265
295
 
266
- // ── Rule 5 — import-boundary ────────────────────────────────────────────────────────────────────
296
+ // ── Rules 5–7 — the three architecture-boundary rules ───────────────────────────────────────────
267
297
 
268
298
  // Message bodies mirror the wording that used to live in the shipped `no-restricted-imports`
269
299
  // overrides (configs/oxlint.json) verbatim, so the DX doesn't regress.
270
- const IMPORT_BOUNDARY_MESSAGES = {
271
- visxOutsideCharts:
272
- 'Direct @visx/* imports are only allowed inside the charts boundary (**/charts/**). ' +
273
- '(basalt/import-boundary)',
274
- visxTooltip:
275
- 'Use ChartTooltip + TooltipHeader/Row/Body from basalt-ui charts primitives. ' +
276
- '(basalt/import-boundary)',
277
- mantineInCharts:
278
- 'charts must be Mantine-free — no Mantine imports allowed. (basalt/import-boundary)',
279
- mantineInTokens:
280
- 'tokens must be Mantine-free — no Mantine imports allowed. (basalt/import-boundary)',
300
+ const VISX_BOUNDARY_MESSAGE =
301
+ 'Direct @visx/* imports are only allowed inside the charts boundary (**/charts/**). ' +
302
+ '(basalt/visx-boundary)'
303
+ const VISX_TOOLTIP_MESSAGE =
304
+ 'Use ChartTooltip + TooltipHeader/Row/Body from basalt-ui charts primitives. ' +
305
+ '(basalt/visx-tooltip)'
306
+ const TOKEN_LAYER_BOUNDARY_MESSAGES = {
307
+ charts:
308
+ 'charts must stay upstream-of-Mantine (no Mantine imports) — read color via --vx-* tokens, ' +
309
+ 'not the Mantine theme directly. (basalt/token-layer-boundary)',
310
+ tokens:
311
+ 'tokens must stay upstream-of-Mantine (no Mantine imports) — importing Mantine here would ' +
312
+ 'cycle back through cssVariablesResolver. (basalt/token-layer-boundary)',
281
313
  }
282
314
 
283
315
  /** True when any path segment of `filename` equals `segment` (POSIX or Windows separators). */
@@ -305,65 +337,116 @@ function exportSource(node) {
305
337
  return undefined
306
338
  }
307
339
 
308
- const importBoundary = {
340
+ /**
341
+ * Wires a `reportFor(node, source)` boundary check into the four import/export AST handlers shared
342
+ * by all three boundary rules below.
343
+ */
344
+ function boundaryVisitor(reportFor) {
345
+ return {
346
+ ImportDeclaration(node) {
347
+ reportFor(node, importSource(node))
348
+ },
349
+ ImportExpression(node) {
350
+ reportFor(node, importSource(node))
351
+ },
352
+ ExportNamedDeclaration(node) {
353
+ reportFor(node, exportSource(node))
354
+ },
355
+ ExportAllDeclaration(node) {
356
+ reportFor(node, exportSource(node))
357
+ },
358
+ }
359
+ }
360
+
361
+ // Rule 5 — visx-boundary: @visx/* only allowed inside a `charts` path segment. Matching any path
362
+ // segment named `charts` is deliberately permissive, not restrictive — it only ever widens where
363
+ // visx is allowed, never narrows where it's flagged elsewhere. "Your visx lives in a charts/ dir"
364
+ // is the intended convention.
365
+ const visxBoundary = {
309
366
  meta: {
310
367
  type: 'suggestion',
311
368
  docs: {
312
- description:
313
- 'Enforce the @visx/*-only-in-charts and Mantine-free charts/tokens import boundaries.',
369
+ description: 'Disallow direct @visx/* imports outside a charts/ directory.',
314
370
  },
315
371
  schema: [],
316
372
  },
317
373
  create(context) {
318
- const filename = getFilename(context)
319
- const inCharts = hasPathSegment(filename, 'charts')
320
- const inTokens = hasPathSegment(filename, 'tokens')
374
+ const inCharts = hasPathSegment(getFilename(context), 'charts')
321
375
 
322
376
  // Deliberately NO `hasThemeAllow` escape here (unlike the four design-guard rules above).
323
377
  // `theme-allow` exists so the theme/palette source can opt out of DESIGN guidance (raw font
324
378
  // sizes, raw colors) — it is not a license to punch through an ARCHITECTURE boundary. The whole
325
- // point of moving this check into a plugin rule instead of `no-restricted-imports` was that it
326
- // can only be turned off explicitly, by rule id (see the file-header comment); a stray
379
+ // point of moving this check into its own plugin rule instead of `no-restricted-imports` was
380
+ // that it can only be turned off explicitly, by rule id (see the file-header comment); a stray
327
381
  // `theme-allow` comment (which also matches the line above the flagged node) must not silently
328
382
  // bypass it. Do not "restore consistency" by adding it back.
329
383
  function reportFor(node, source) {
330
- if (typeof source !== 'string') return
384
+ if (typeof source !== 'string' || !source.startsWith('@visx/')) return
385
+ if (source === '@visx/tooltip') return // basalt/visx-tooltip owns this one, everywhere
386
+ if (!inCharts) context.report({ node, message: VISX_BOUNDARY_MESSAGE })
387
+ }
331
388
 
332
- if (source === '@visx/tooltip') {
333
- context.report({ node, message: IMPORT_BOUNDARY_MESSAGES.visxTooltip })
334
- return
335
- }
336
- if (source.startsWith('@visx/')) {
337
- if (!inCharts) context.report({ node, message: IMPORT_BOUNDARY_MESSAGES.visxOutsideCharts })
338
- return
339
- }
389
+ return boundaryVisitor(reportFor)
390
+ },
391
+ }
392
+
393
+ // Rule 6 — visx-tooltip: @visx/tooltip banned everywhere, including inside charts. Fires ahead of
394
+ // (and instead of) basalt/visx-boundary for that one specifier — basalt's own src/ never imports
395
+ // @visx/tooltip, so no theme-allow-style exemption is needed here either.
396
+ const visxTooltip = {
397
+ meta: {
398
+ type: 'suggestion',
399
+ docs: {
400
+ description: 'Disallow @visx/tooltip everywhere — use basalt-ui ChartTooltip instead.',
401
+ },
402
+ schema: [],
403
+ },
404
+ create(context) {
405
+ function reportFor(node, source) {
406
+ if (source !== '@visx/tooltip') return
407
+ context.report({ node, message: VISX_TOOLTIP_MESSAGE })
408
+ }
409
+
410
+ return boundaryVisitor(reportFor)
411
+ },
412
+ }
413
+
414
+ // Rule 7 — token-layer-boundary: @mantine/* banned inside `charts` OR `tokens` path segments —
415
+ // keeps the token layer upstream of Mantine AND keeps those two subpaths resolving with no
416
+ // @mantine/* installed (see the file-header comment for the cycle/fork + packaging rationale).
417
+ // Repo-local only — never registered in the shipped consumer preset, since this governs basalt's
418
+ // own internal layering/packaging, not a consumer contract.
419
+ const tokenLayerBoundary = {
420
+ meta: {
421
+ type: 'suggestion',
422
+ docs: {
423
+ description: 'Disallow @mantine/* imports inside charts/ or tokens/ directories.',
424
+ },
425
+ schema: [],
426
+ },
427
+ create(context) {
428
+ const filename = getFilename(context)
429
+ const inCharts = hasPathSegment(filename, 'charts')
430
+ const inTokens = hasPathSegment(filename, 'tokens')
431
+
432
+ // Deliberately NO `hasThemeAllow` escape — see basalt/visx-boundary's comment above for why.
433
+ function reportFor(node, source) {
434
+ if (typeof source !== 'string') return
340
435
  if (
341
- source === '@mantine/core' ||
342
- source === '@mantine/hooks' ||
343
- source.startsWith('@mantine/')
344
- ) {
345
- if (inCharts) {
346
- context.report({ node, message: IMPORT_BOUNDARY_MESSAGES.mantineInCharts })
347
- } else if (inTokens) {
348
- context.report({ node, message: IMPORT_BOUNDARY_MESSAGES.mantineInTokens })
349
- }
436
+ source !== '@mantine/core' &&
437
+ source !== '@mantine/hooks' &&
438
+ !source.startsWith('@mantine/')
439
+ )
440
+ return
441
+
442
+ if (inCharts) {
443
+ context.report({ node, message: TOKEN_LAYER_BOUNDARY_MESSAGES.charts })
444
+ } else if (inTokens) {
445
+ context.report({ node, message: TOKEN_LAYER_BOUNDARY_MESSAGES.tokens })
350
446
  }
351
447
  }
352
448
 
353
- return {
354
- ImportDeclaration(node) {
355
- reportFor(node, importSource(node))
356
- },
357
- ImportExpression(node) {
358
- reportFor(node, importSource(node))
359
- },
360
- ExportNamedDeclaration(node) {
361
- reportFor(node, exportSource(node))
362
- },
363
- ExportAllDeclaration(node) {
364
- reportFor(node, exportSource(node))
365
- },
366
- }
449
+ return boundaryVisitor(reportFor)
367
450
  },
368
451
  }
369
452
 
@@ -376,6 +459,8 @@ export default {
376
459
  'card-inset': cardInset,
377
460
  'chart-in-raw-surface': chartInRawSurface,
378
461
  'raw-scroll-container': rawScrollContainer,
379
- 'import-boundary': importBoundary,
462
+ 'visx-boundary': visxBoundary,
463
+ 'visx-tooltip': visxTooltip,
464
+ 'token-layer-boundary': tokenLayerBoundary,
380
465
  },
381
466
  }
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * Each fixture repo gets a minimal `.oxlintrc.json` pointing `jsPlugins` at the plugin (absolute
6
6
  * path — verified to resolve the same as the relative path the shipped/repo configs use) and
7
- * enabling all three rules. `runOxlint` shells the workspace-root `node_modules/.bin/oxlint` binary
8
- * and returns the parsed set of `basalt/<rule>` diagnostics it printed.
7
+ * enabling every rule this file tests. `run` shells the workspace-root `node_modules/.bin/oxlint`
8
+ * binary and returns the parsed set of `basalt/<rule>` diagnostics it printed.
9
9
  */
10
10
  import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
11
11
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
@@ -28,7 +28,9 @@ beforeEach(() => {
28
28
  'basalt/no-raw-font-size': 'error',
29
29
  'basalt/card-inset': 'error',
30
30
  'basalt/chart-in-raw-surface': 'error',
31
- 'basalt/import-boundary': 'error',
31
+ 'basalt/visx-boundary': 'error',
32
+ 'basalt/visx-tooltip': 'error',
33
+ 'basalt/token-layer-boundary': 'error',
32
34
  },
33
35
  }),
34
36
  )
@@ -109,43 +111,25 @@ describe('basalt/chart-in-raw-surface', () => {
109
111
  })
110
112
  })
111
113
 
112
- // ── import-boundary ────────────────────────────────────────────────────────────
114
+ // ── visx-boundary ────────────────────────────────────────────────────────────
113
115
 
114
- describe('basalt/import-boundary', () => {
116
+ describe('basalt/visx-boundary', () => {
115
117
  it('flags a @visx/* import outside charts', () => {
116
118
  const { code, rules } = run(`import { scaleLinear } from '@visx/scale'\n`, 'lib.ts')
117
119
  expect(code).toBe(1)
118
- expect(rules).toContain('import-boundary')
120
+ expect(rules).toContain('visx-boundary')
119
121
  })
120
122
 
121
123
  it('does NOT flag a @visx/* import inside charts', () => {
122
124
  const { code, rules } = run(`import { scaleLinear } from '@visx/scale'\n`, 'charts/lib.ts')
123
125
  expect(code).toBe(0)
124
- expect(rules).not.toContain('import-boundary')
126
+ expect(rules).not.toContain('visx-boundary')
125
127
  })
126
128
 
127
- it('flags a @mantine/* import inside charts (Mantine-free)', () => {
128
- const { code, rules } = run(`import { Button } from '@mantine/core'\n`, 'charts/lib.tsx')
129
- expect(code).toBe(1)
130
- expect(rules).toContain('import-boundary')
131
- })
132
-
133
- it('does NOT flag a @mantine/* import outside charts/tokens', () => {
129
+ it('does NOT flag a @mantine/* import (out of scope for this rule)', () => {
134
130
  const { code, rules } = run(`import { Button } from '@mantine/core'\n`, 'lib.tsx')
135
131
  expect(code).toBe(0)
136
- expect(rules).not.toContain('import-boundary')
137
- })
138
-
139
- it('flags @visx/tooltip even inside charts', () => {
140
- const { code, rules } = run(`import { Tooltip } from '@visx/tooltip'\n`, 'charts/lib.tsx')
141
- expect(code).toBe(1)
142
- expect(rules).toContain('import-boundary')
143
- })
144
-
145
- it('flags a @mantine/* import inside tokens (Mantine-free)', () => {
146
- const { code, rules } = run(`import { Button } from '@mantine/core'\n`, 'tokens/lib.ts')
147
- expect(code).toBe(1)
148
- expect(rules).toContain('import-boundary')
132
+ expect(rules).not.toContain('visx-boundary')
149
133
  })
150
134
 
151
135
  it('still flags a @visx/* import outside charts carrying a theme-allow comment (no escape hatch)', () => {
@@ -154,24 +138,97 @@ describe('basalt/import-boundary', () => {
154
138
  'lib.ts',
155
139
  )
156
140
  expect(code).toBe(1)
157
- expect(rules).toContain('import-boundary')
141
+ expect(rules).toContain('visx-boundary')
158
142
  })
159
143
 
160
144
  it('flags a source-bearing named re-export of @visx/* outside charts', () => {
161
145
  const { code, rules } = run(`export { scaleLinear } from '@visx/scale'\n`, 'lib.ts')
162
146
  expect(code).toBe(1)
163
- expect(rules).toContain('import-boundary')
147
+ expect(rules).toContain('visx-boundary')
164
148
  })
165
149
 
166
150
  it('flags a wildcard re-export of @visx/* outside charts', () => {
167
151
  const { code, rules } = run(`export * from '@visx/scale'\n`, 'lib.ts')
168
152
  expect(code).toBe(1)
169
- expect(rules).toContain('import-boundary')
153
+ expect(rules).toContain('visx-boundary')
170
154
  })
171
155
 
172
156
  it('does NOT flag a plain local named export (no source)', () => {
173
157
  const { code, rules } = run(`const x = 1\nexport { x }\n`, 'lib.ts')
174
158
  expect(code).toBe(0)
175
- expect(rules).not.toContain('import-boundary')
159
+ expect(rules).not.toContain('visx-boundary')
160
+ })
161
+ })
162
+
163
+ // ── visx-tooltip ─────────────────────────────────────────────────────────────
164
+
165
+ describe('basalt/visx-tooltip', () => {
166
+ it('flags @visx/tooltip even inside charts', () => {
167
+ const { code, rules } = run(`import { Tooltip } from '@visx/tooltip'\n`, 'charts/lib.tsx')
168
+ expect(code).toBe(1)
169
+ expect(rules).toContain('visx-tooltip')
170
+ })
171
+
172
+ it('flags @visx/tooltip outside charts too', () => {
173
+ const { code, rules } = run(`import { Tooltip } from '@visx/tooltip'\n`, 'lib.tsx')
174
+ expect(code).toBe(1)
175
+ expect(rules).toContain('visx-tooltip')
176
+ })
177
+
178
+ it('takes precedence over basalt/visx-boundary for @visx/tooltip specifically', () => {
179
+ const { rules } = run(`import { Tooltip } from '@visx/tooltip'\n`, 'lib.tsx')
180
+ expect(rules).toContain('visx-tooltip')
181
+ expect(rules).not.toContain('visx-boundary')
182
+ })
183
+ })
184
+
185
+ // ── token-layer-boundary ─────────────────────────────────────────────────────
186
+
187
+ describe('basalt/token-layer-boundary', () => {
188
+ it('flags a @mantine/* import inside charts', () => {
189
+ const { code, rules } = run(`import { Button } from '@mantine/core'\n`, 'charts/lib.tsx')
190
+ expect(code).toBe(1)
191
+ expect(rules).toContain('token-layer-boundary')
192
+ })
193
+
194
+ it('flags a @mantine/* import inside tokens', () => {
195
+ const { code, rules } = run(`import { Button } from '@mantine/core'\n`, 'tokens/lib.ts')
196
+ expect(code).toBe(1)
197
+ expect(rules).toContain('token-layer-boundary')
198
+ })
199
+
200
+ it('does NOT flag a @mantine/* import outside charts/tokens', () => {
201
+ const { code, rules } = run(`import { Button } from '@mantine/core'\n`, 'lib.tsx')
202
+ expect(code).toBe(0)
203
+ expect(rules).not.toContain('token-layer-boundary')
204
+ })
205
+ })
206
+
207
+ // ── rule independence ──────────────────────────────────────────────────────────
208
+ // The three rules used to be one bundled `import-boundary` rule with a single on/off toggle — a
209
+ // consumer disabling the one check they disagreed with silently dropped the other two. Proves
210
+ // disabling one of the three leaves the other two enforced.
211
+
212
+ describe('rule independence', () => {
213
+ it('disabling basalt/visx-boundary leaves basalt/visx-tooltip enforced', () => {
214
+ writeFileSync(
215
+ resolve(dir, '.oxlintrc.json'),
216
+ JSON.stringify({
217
+ plugins: [],
218
+ jsPlugins: [PLUGIN_PATH],
219
+ rules: {
220
+ 'basalt/visx-boundary': 'off',
221
+ 'basalt/visx-tooltip': 'error',
222
+ 'basalt/token-layer-boundary': 'error',
223
+ },
224
+ }),
225
+ )
226
+ const { code, rules } = run(
227
+ `import { scaleLinear } from '@visx/scale'\nimport { Tooltip } from '@visx/tooltip'\n`,
228
+ 'lib.ts',
229
+ )
230
+ expect(code).toBe(1)
231
+ expect(rules).not.toContain('visx-boundary')
232
+ expect(rules).toContain('visx-tooltip')
176
233
  })
177
234
  })
@@ -20,7 +20,8 @@
20
20
  "basalt/card-inset": "error",
21
21
  "basalt/chart-in-raw-surface": "error",
22
22
  "basalt/raw-scroll-container": "off",
23
- "basalt/import-boundary": "error"
23
+ "basalt/visx-boundary": "error",
24
+ "basalt/visx-tooltip": "error"
24
25
  },
25
26
  "overrides": [
26
27
  {
@@ -232,8 +232,11 @@ export declare function sync(opts?: SyncOptions, cwd?: string): number;
232
232
  * 5. Every real package.json exports key has a SURFACES entry.
233
233
  * 6. Every surface with non-empty forbiddenImports has a globs field.
234
234
  * 7. Every headless surface is Mantine-free — via all 3 `forbiddenImports` bans, OR (for
235
- * `MANTINE_FREE_VIA_IMPORT_BOUNDARY` members) the `basalt/import-boundary` plugin rule actually
236
- * registered as `'error'` in the shipped config.
235
+ * `TOKEN_LAYER_BOUNDARY_SURFACES` members, `./charts`/`./tokens`) exemption, since their
236
+ * Mantine-free guarantee is covered by the repo-local-only `basalt/token-layer-boundary`
237
+ * plugin rule instead — this assertion cannot verify that rule's live registration itself (see
238
+ * the assertion's own comment below for why); basalt's own CI does
239
+ * (`tests/surfaces-coverage.test.ts`).
237
240
  * 8. Every doctrine optionalPeers entry exists in peerDependencies AND peerDependenciesMeta.
238
241
  *
239
242
  * Tooling surfaces are exempt from assertions 1–3 by the discriminant.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAqCA,OAAO,EAGL,UAAU,EACV,WAAW,EAEZ,MAAM,aAAa,CAAA;AAGpB,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG;IACzB,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,uGAAuG;IACvG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,iFAAiF;IAC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B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CA8F5C;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoF5E;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkCzF;AAKD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAE,WAAW,EAAE,CAAA;AACnF,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,CAAA"}
package/dist/cli/index.js CHANGED
@@ -12,13 +12,7 @@ import { dirname, isAbsolute, relative, resolve } from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
13
  import { checkSource, DEFAULT_GUARD_CONFIG, GUARD_RULES } from "../guard/index.js";
14
14
  import { evaluateGuardHook } from "../guard/guard-hook.js";
15
- import {
16
- hasImportBoundaryRuleRegistered,
17
- MANTINE_FREE_VIA_IMPORT_BOUNDARY,
18
- RULE_NAMES,
19
- SKILL_NAMES,
20
- SURFACES
21
- } from "../surfaces.js";
15
+ import { RULE_NAMES, SKILL_NAMES, SURFACES, TOKEN_LAYER_BOUNDARY_SURFACES } from "../surfaces.js";
22
16
  const DEFAULT_ROOTS = ["src"];
23
17
  const DEFAULT_SERIES_MODULE_PATH = "src/lib/series.ts";
24
18
  function defaultExempt(cfg) {
@@ -598,25 +592,9 @@ function checkCoverage() {
598
592
  }
599
593
  }
600
594
  const REQUIRED_MANTINE_BANS = ["@mantine/core", "@mantine/hooks", "@mantine/*"];
601
- let shippedRules;
602
- try {
603
- const shippedConfig = JSON.parse(
604
- readFileSync(resolve(pkgRoot, "configs/oxlint.json"), "utf8")
605
- );
606
- shippedRules = shippedConfig.rules;
607
- } catch {
608
- failures.push(`Cannot read configs/oxlint.json at ${pkgRoot} to verify basalt/import-boundary`);
609
- }
610
- const importBoundaryRegistered = hasImportBoundaryRuleRegistered(shippedRules);
611
595
  for (const [key, spec] of allSpecs) {
612
596
  if (spec.layer !== "headless") continue;
613
- if (MANTINE_FREE_VIA_IMPORT_BOUNDARY.has(key)) {
614
- if (importBoundaryRegistered) continue;
615
- failures.push(
616
- `SURFACES['${key}'] relies on the basalt/import-boundary plugin rule for Mantine-free coverage, but that rule is not registered as 'error' in configs/oxlint.json`
617
- );
618
- continue;
619
- }
597
+ if (TOKEN_LAYER_BOUNDARY_SURFACES.has(key)) continue;
620
598
  for (const required of REQUIRED_MANTINE_BANS) {
621
599
  const hasBan = spec.forbiddenImports.some((fi) => fi.spec === required);
622
600
  if (!hasBan) {
@@ -375,26 +375,44 @@ export declare const RULE_NAMES: readonly RuleName[];
375
375
  */
376
376
  export declare const SKILL_NAMES: readonly SkillName[];
377
377
  /**
378
- * Headless SURFACES keys whose Mantine-free guarantee is enforced by the `basalt/import-boundary`
379
- * oxlint plugin rule (`configs/oxlint-plugin.js`) instead of a `forbiddenImports` no-restricted-
380
- * imports ban — the rule fires on `charts`/`tokens` path segments only, so ONLY these two surfaces
381
- * qualify (every other headless surface still carries its Mantine ban in `forbiddenImports`).
378
+ * Headless SURFACES keys whose Mantine-free guarantee is enforced by the `basalt/token-layer-
379
+ * boundary` oxlint plugin rule (`configs/oxlint-plugin.js`) instead of a `forbiddenImports`
380
+ * no-restricted-imports ban — the rule fires on `charts`/`tokens` path segments only, so ONLY
381
+ * these two surfaces qualify (every other headless surface still carries its Mantine ban in
382
+ * `forbiddenImports`).
382
383
  *
383
- * Membership alone does NOT satisfy the coverage check — `checkCoverage()`'s assertion 7 (and its
384
- * test mirror) also require `hasImportBoundaryRuleRegistered` to hold, so a future removal of the
385
- * plugin rule's registration still fails loudly instead of silently passing.
384
+ * `basalt/token-layer-boundary` is registered ONLY in the repo-local `.oxlintrc.json`, never the
385
+ * shipped consumer preset. It protects two things: layering — `tokens` is pure data that
386
+ * `cssVariablesResolver` (Mantine-coupled) reads to bind Mantine's surfaces to the same `--vx-*`
387
+ * vars `charts` reads, so an `@mantine/*` import in either would cycle back through the theme
388
+ * layer or let a chart bypass `--vx-*` and fork chrome/charts apart — and packaging: `./charts`
389
+ * and `./tokens` resolve and render with NO `@mantine/*` installed, real and CI-tested
390
+ * (`scripts/pack-test.sh`'s "charts/tokens-only (no-Mantine) resolution + render" step,
391
+ * `scripts/check-dist-layering.mjs`'s dist-graph walk). The LAYER is Mantine-free — the FRAMEWORK
392
+ * is not (`.` requires Mantine as a non-optional peer; these two subpaths don't). Both are a
393
+ * basalt-internal invariant, not a consumer contract (a consumer's own `charts/`/`tokens/`-named
394
+ * directories carry no such obligation), which is why it stays repo-local. Because
395
+ * of that, `checkCoverage()`'s assertion 7 treats membership here as a pure EXEMPTION from the
396
+ * forbiddenImports requirement — it does NOT (and, being a shipped CLI subcommand that must run
397
+ * from inside a consumer's node_modules, CANNOT) verify the rule's live registration itself. That
398
+ * "fails loudly if enforcement is removed" guarantee lives in basalt's own CI instead
399
+ * (`tests/surfaces-coverage.test.ts`, via `hasTokenLayerBoundaryRegistered` against
400
+ * `.oxlintrc.json`).
386
401
  */
387
- export declare const MANTINE_FREE_VIA_IMPORT_BOUNDARY: ReadonlySet<string>;
402
+ export declare const TOKEN_LAYER_BOUNDARY_SURFACES: ReadonlySet<string>;
388
403
  /**
389
- * True when a parsed oxlint config's `rules` object registers `basalt/import-boundary` as `'error'`
390
- * — the live signal (not just a hardcoded assumption) that `MANTINE_FREE_VIA_IMPORT_BOUNDARY`
391
- * surfaces are actually enforced. Pure — callers read + JSON.parse the config file themselves
392
- * (surfaces.ts stays dependency-free, no fs access here).
404
+ * True when a parsed oxlint config's `rules` object registers `basalt/token-layer-boundary` as
405
+ * `'error'` — the live signal (not just a hardcoded assumption) that `TOKEN_LAYER_BOUNDARY_SURFACES`
406
+ * are actually enforced. Pure — callers read + JSON.parse the config file themselves (surfaces.ts
407
+ * stays dependency-free, no fs access here). Consumed only by basalt's own CI
408
+ * (`tests/surfaces-coverage.test.ts`) against the repo-local `.oxlintrc.json` — NOT by
409
+ * `checkCoverage()`, which cannot read that repo-local file from an installed package (see
410
+ * `TOKEN_LAYER_BOUNDARY_SURFACES`'s doc comment).
393
411
  *
394
412
  * @example
395
- * hasImportBoundaryRuleRegistered({ 'basalt/import-boundary': 'error' }) // true
396
- * hasImportBoundaryRuleRegistered({}) // false
413
+ * hasTokenLayerBoundaryRegistered({ 'basalt/token-layer-boundary': 'error' }) // true
414
+ * hasTokenLayerBoundaryRegistered({}) // false
397
415
  */
398
- export declare function hasImportBoundaryRuleRegistered(rules: Record<string, unknown> | undefined): boolean;
416
+ export declare function hasTokenLayerBoundaryRegistered(rules: Record<string, unknown> | undefined): boolean;
399
417
  export {};
400
418
  //# sourceMappingURL=surfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,eAAe,GACf,UAAU,GACV,MAAM,GACN,OAAO,GACP,SAAS,CAAA;AAEb;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAA;AAExE;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,iBAAiB,GAAG,UAAU,GAAG,YAAY,GAAG,cAAc,CAAA;AAElF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,Q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AA;AAIxC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,sBAMiB,CAAA;AAIzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,MAAM,CAAqC,CAAA;AAEnG;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACzC,OAAO,CAET"}
package/dist/surfaces.js CHANGED
@@ -39,9 +39,10 @@ const SURFACES = {
39
39
  shipped: ["**/charts/**"],
40
40
  repo: ["packages/basalt-ui/src/charts/**"]
41
41
  },
42
- // The @visx/*-only-in-charts and Mantine-free boundaries are enforced by the
43
- // `basalt/import-boundary` oxlint plugin rule (configs/oxlint-plugin.js), not
44
- // no-restricted-imports — see that file's header comment for why.
42
+ // The @visx/*-only-in-charts boundary is enforced by the `basalt/visx-boundary` oxlint plugin
43
+ // rule, and the Mantine-free boundary by `basalt/token-layer-boundary` (repo-local only — see
44
+ // that rule's file-header comment for why) — both configs/oxlint-plugin.js, not
45
+ // no-restricted-imports.
45
46
  forbiddenImports: [],
46
47
  ruleOverrides: [{ rule: "no-underscore-dangle", level: "off", target: "repo" }]
47
48
  },
@@ -56,7 +57,8 @@ const SURFACES = {
56
57
  shipped: ["**/tokens/**"],
57
58
  repo: ["packages/basalt-ui/src/tokens/**"]
58
59
  },
59
- // Mantine-free + @visx/* boundaries enforced by `basalt/import-boundary` (see ./charts above).
60
+ // Mantine-free boundary enforced by `basalt/token-layer-boundary`, repo-local only (see
61
+ // ./charts above and that rule's file-header comment for why).
60
62
  forbiddenImports: []
61
63
  },
62
64
  "./theme-lab": {
@@ -79,7 +81,7 @@ const SURFACES = {
79
81
  shipped: [],
80
82
  repo: ["packages/basalt-ui/src/guard/**"]
81
83
  },
82
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
84
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
83
85
  forbiddenImports: [...MANTINE_BANS]
84
86
  },
85
87
  // 6th JS subpath
@@ -95,7 +97,7 @@ const SURFACES = {
95
97
  shipped: [],
96
98
  repo: ["packages/basalt-ui/src/query/**"]
97
99
  },
98
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
100
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
99
101
  forbiddenImports: [...MANTINE_BANS]
100
102
  },
101
103
  "./router-tanstack": {
@@ -110,7 +112,7 @@ const SURFACES = {
110
112
  shipped: [],
111
113
  repo: ["packages/basalt-ui/src/router-tanstack/**"]
112
114
  },
113
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
115
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
114
116
  forbiddenImports: [...MANTINE_BANS]
115
117
  },
116
118
  "./forms": {
@@ -185,7 +187,7 @@ const SURFACES = {
185
187
  shipped: [],
186
188
  repo: ["packages/basalt-ui/src/agent/**"]
187
189
  },
188
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
190
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
189
191
  forbiddenImports: [...MANTINE_BANS]
190
192
  },
191
193
  "./content": {
@@ -221,7 +223,7 @@ const SURFACES = {
221
223
  shipped: [],
222
224
  repo: ["packages/basalt-ui/src/state.ts"]
223
225
  },
224
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
226
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
225
227
  forbiddenImports: [...MANTINE_BANS]
226
228
  },
227
229
  "./connectivity": {
@@ -265,9 +267,10 @@ const SURFACES = {
265
267
  // Shipped is a catch-all (not just src/**+app/**) so consumer code under components/, lib/,
266
268
  // features/, etc. is also covered. The @visx/*-only-in-charts and Mantine-free charts/tokens
267
269
  // boundaries used to live here too and need last-writer-wins EMIT_ORDER games against the
268
- // narrower ./tokens/./charts overrides — they're now enforced by `basalt/import-boundary`
269
- // (a plugin rule, immune to that class of clobbering) instead, so the bans left below (antd,
270
- // framer-motion) are plain global bans with no narrower override to out-order.
270
+ // narrower ./tokens/./charts overrides — they're now enforced by `basalt/visx-boundary` and
271
+ // `basalt/token-layer-boundary` (plugin rules, immune to that class of clobbering) instead,
272
+ // so the bans left below (antd, framer-motion) are plain global bans with no narrower
273
+ // override to out-order.
271
274
  shipped: ["**/*.{ts,tsx}"],
272
275
  repo: ["packages/basalt-ui/src/**", "apps/playground/src/**"]
273
276
  },
@@ -289,17 +292,14 @@ const SKILL_NAMES = [
289
292
  Object.values(SURFACES).filter((s) => s.kind === "doctrine").flatMap((s) => [...s.skill])
290
293
  )
291
294
  ];
292
- const MANTINE_FREE_VIA_IMPORT_BOUNDARY = /* @__PURE__ */ new Set([
293
- "./charts",
294
- "./tokens"
295
- ]);
296
- function hasImportBoundaryRuleRegistered(rules) {
297
- return rules?.["basalt/import-boundary"] === "error";
295
+ const TOKEN_LAYER_BOUNDARY_SURFACES = /* @__PURE__ */ new Set(["./charts", "./tokens"]);
296
+ function hasTokenLayerBoundaryRegistered(rules) {
297
+ return rules?.["basalt/token-layer-boundary"] === "error";
298
298
  }
299
299
  export {
300
- MANTINE_FREE_VIA_IMPORT_BOUNDARY,
301
300
  RULE_NAMES,
302
301
  SKILL_NAMES,
303
302
  SURFACES,
304
- hasImportBoundaryRuleRegistered
303
+ TOKEN_LAYER_BOUNDARY_SURFACES,
304
+ hasTokenLayerBoundaryRegistered
305
305
  };
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # basalt-ui v1.0.1
1
+ # basalt-ui v1.1.0
2
2
  # Opinionated framework for Mantine-based React apps — theme, app shell, visx charts, toolchain presets
3
3
  #
4
4
  # basalt-ui is an opinionated framework for Mantine-based React apps.
@@ -15,7 +15,7 @@
15
15
  # Optional peers are listed per subpath; install only what you use.
16
16
 
17
17
  Package: basalt-ui
18
- Version: 1.0.1
18
+ Version: 1.1.0
19
19
 
20
20
  ## basalt-ui
21
21
  Import: import { ... } from 'basalt-ui'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basalt-ui",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Opinionated framework for Mantine-based React apps — theme, app shell, visx charts, toolchain presets",
5
5
  "keywords": [
6
6
  "charts",
package/src/cli/index.ts CHANGED
@@ -35,13 +35,7 @@ import { fileURLToPath } from 'node:url'
35
35
  import { checkSource, DEFAULT_GUARD_CONFIG, GUARD_RULES } from '../guard'
36
36
  import type { Finding, GuardConfig, GuardKind } from '../guard'
37
37
  import { evaluateGuardHook } from '../guard/guard-hook'
38
- import {
39
- hasImportBoundaryRuleRegistered,
40
- MANTINE_FREE_VIA_IMPORT_BOUNDARY,
41
- RULE_NAMES,
42
- SKILL_NAMES,
43
- SURFACES,
44
- } from '../surfaces'
38
+ import { RULE_NAMES, SKILL_NAMES, SURFACES, TOKEN_LAYER_BOUNDARY_SURFACES } from '../surfaces'
45
39
  import type { DoctrineSpec, SurfaceSpec } from '../surfaces'
46
40
 
47
41
  /** Shape of the optional `"basalt"` key in a consumer's package.json. */
@@ -1070,8 +1064,11 @@ export function sync(opts: SyncOptions = {}, cwd: string = process.cwd()): numbe
1070
1064
  * 5. Every real package.json exports key has a SURFACES entry.
1071
1065
  * 6. Every surface with non-empty forbiddenImports has a globs field.
1072
1066
  * 7. Every headless surface is Mantine-free — via all 3 `forbiddenImports` bans, OR (for
1073
- * `MANTINE_FREE_VIA_IMPORT_BOUNDARY` members) the `basalt/import-boundary` plugin rule actually
1074
- * registered as `'error'` in the shipped config.
1067
+ * `TOKEN_LAYER_BOUNDARY_SURFACES` members, `./charts`/`./tokens`) exemption, since their
1068
+ * Mantine-free guarantee is covered by the repo-local-only `basalt/token-layer-boundary`
1069
+ * plugin rule instead — this assertion cannot verify that rule's live registration itself (see
1070
+ * the assertion's own comment below for why); basalt's own CI does
1071
+ * (`tests/surfaces-coverage.test.ts`).
1075
1072
  * 8. Every doctrine optionalPeers entry exists in peerDependencies AND peerDependenciesMeta.
1076
1073
  *
1077
1074
  * Tooling surfaces are exempt from assertions 1–3 by the discriminant.
@@ -1166,32 +1163,23 @@ export function checkCoverage(): number {
1166
1163
 
1167
1164
  // ── Assertion 7: every headless surface is Mantine-free ──────────────────────
1168
1165
  // Guarantees the Mantine-free boundary — a future headless surface without coverage fails here.
1169
- // Coverage is either all 3 forbiddenImports bans, OR (for `./charts`/`./tokens`, the surfaces the
1170
- // `basalt/import-boundary` plugin rule fires on) that rule actually registered as 'error' in the
1171
- // shipped config — membership in MANTINE_FREE_VIA_IMPORT_BOUNDARY alone does NOT pass this; the
1172
- // registration must be live, so a future removal of the rule fails loudly instead of silently.
1166
+ // Coverage is either all 3 forbiddenImports bans, OR membership in
1167
+ // `TOKEN_LAYER_BOUNDARY_SURFACES` (`./charts`/`./tokens`), whose Mantine-free guarantee comes
1168
+ // from the `basalt/token-layer-boundary` plugin rule instead — protects both layering (tokens
1169
+ // upstream of Mantine) and packaging (those two subpaths resolve with no `@mantine/*` installed,
1170
+ // CI-tested via `scripts/pack-test.sh` + `scripts/check-dist-layering.mjs`; see surfaces.ts's
1171
+ // `TOKEN_LAYER_BOUNDARY_SURFACES` doc comment). This assertion CANNOT also verify
1172
+ // that rule's live registration: `check-coverage` is a shipped CLI subcommand whose assertions
1173
+ // must all read pkgRoot-relative paths so it works from inside a consumer's node_modules — and a
1174
+ // repo-local `.oxlintrc.json` read from an installed package path-resolves to the CONSUMER's own
1175
+ // config, not basalt's. That "fails loudly if enforcement is removed" guarantee lives in
1176
+ // basalt's own CI instead (`tests/surfaces-coverage.test.ts`, via
1177
+ // `hasTokenLayerBoundaryRegistered` against `.oxlintrc.json`).
1173
1178
  const REQUIRED_MANTINE_BANS = ['@mantine/core', '@mantine/hooks', '@mantine/*'] as const
1174
- let shippedRules: Record<string, unknown> | undefined
1175
- try {
1176
- const shippedConfig = JSON.parse(
1177
- readFileSync(resolve(pkgRoot, 'configs/oxlint.json'), 'utf8'),
1178
- ) as { rules?: Record<string, unknown> }
1179
- shippedRules = shippedConfig.rules
1180
- } catch {
1181
- failures.push(`Cannot read configs/oxlint.json at ${pkgRoot} to verify basalt/import-boundary`)
1182
- }
1183
- const importBoundaryRegistered = hasImportBoundaryRuleRegistered(shippedRules)
1184
1179
 
1185
1180
  for (const [key, spec] of allSpecs) {
1186
1181
  if (spec.layer !== 'headless') continue
1187
- if (MANTINE_FREE_VIA_IMPORT_BOUNDARY.has(key)) {
1188
- if (importBoundaryRegistered) continue
1189
- failures.push(
1190
- `SURFACES['${key}'] relies on the basalt/import-boundary plugin rule for Mantine-free ` +
1191
- `coverage, but that rule is not registered as 'error' in configs/oxlint.json`,
1192
- )
1193
- continue
1194
- }
1182
+ if (TOKEN_LAYER_BOUNDARY_SURFACES.has(key)) continue
1195
1183
  for (const required of REQUIRED_MANTINE_BANS) {
1196
1184
  const hasBan = spec.forbiddenImports.some((fi) => fi.spec === required)
1197
1185
  if (!hasBan) {
package/src/surfaces.ts CHANGED
@@ -152,10 +152,11 @@ const vg = (spec: string, message: string, extra?: Partial<ForbiddenImport>): Fo
152
152
  ...extra,
153
153
  })
154
154
 
155
- // Mantine-free ban for headless surfaces the `basalt/import-boundary` plugin rule does NOT cover
156
- // (it only enforces charts/tokens path segments — see oxlint-plugin.js). `./charts` and `./tokens`
157
- // no longer use this: their Mantine-free + @visx/* boundaries are enforced by that plugin rule
158
- // instead, so duplicating the ban here would be redundant no-restricted-imports config.
155
+ // Mantine-free ban for headless surfaces the `basalt/token-layer-boundary` plugin rule does NOT
156
+ // cover (it only enforces charts/tokens path segments, and is registered repo-local only — see
157
+ // oxlint-plugin.js). `./charts` and `./tokens` no longer use this: their Mantine-free boundary is
158
+ // enforced by that plugin rule instead (and their @visx/* boundary by `basalt/visx-boundary`), so
159
+ // duplicating the ban here would be redundant no-restricted-imports config.
159
160
  const MANTINE_BANS = [
160
161
  v('@mantine/core', '{ctx} must be Mantine-free — no Mantine imports allowed.'),
161
162
  v('@mantine/hooks', '{ctx} must be Mantine-free — no Mantine imports allowed.'),
@@ -198,9 +199,10 @@ export const SURFACES = {
198
199
  shipped: ['**/charts/**'],
199
200
  repo: ['packages/basalt-ui/src/charts/**'],
200
201
  },
201
- // The @visx/*-only-in-charts and Mantine-free boundaries are enforced by the
202
- // `basalt/import-boundary` oxlint plugin rule (configs/oxlint-plugin.js), not
203
- // no-restricted-imports — see that file's header comment for why.
202
+ // The @visx/*-only-in-charts boundary is enforced by the `basalt/visx-boundary` oxlint plugin
203
+ // rule, and the Mantine-free boundary by `basalt/token-layer-boundary` (repo-local only — see
204
+ // that rule's file-header comment for why) — both configs/oxlint-plugin.js, not
205
+ // no-restricted-imports.
204
206
  forbiddenImports: [],
205
207
  ruleOverrides: [{ rule: 'no-underscore-dangle', level: 'off', target: 'repo' }],
206
208
  },
@@ -216,7 +218,8 @@ export const SURFACES = {
216
218
  shipped: ['**/tokens/**'],
217
219
  repo: ['packages/basalt-ui/src/tokens/**'],
218
220
  },
219
- // Mantine-free + @visx/* boundaries enforced by `basalt/import-boundary` (see ./charts above).
221
+ // Mantine-free boundary enforced by `basalt/token-layer-boundary`, repo-local only (see
222
+ // ./charts above and that rule's file-header comment for why).
220
223
  forbiddenImports: [],
221
224
  },
222
225
  './theme-lab': {
@@ -239,7 +242,7 @@ export const SURFACES = {
239
242
  shipped: [],
240
243
  repo: ['packages/basalt-ui/src/guard/**'],
241
244
  },
242
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
245
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
243
246
  forbiddenImports: [...MANTINE_BANS],
244
247
  }, // 6th JS subpath
245
248
  './query': {
@@ -254,7 +257,7 @@ export const SURFACES = {
254
257
  shipped: [],
255
258
  repo: ['packages/basalt-ui/src/query/**'],
256
259
  },
257
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
260
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
258
261
  forbiddenImports: [...MANTINE_BANS],
259
262
  },
260
263
  './router-tanstack': {
@@ -270,7 +273,7 @@ export const SURFACES = {
270
273
  shipped: [],
271
274
  repo: ['packages/basalt-ui/src/router-tanstack/**'],
272
275
  },
273
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
276
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
274
277
  forbiddenImports: [...MANTINE_BANS],
275
278
  },
276
279
  './forms': {
@@ -352,7 +355,7 @@ export const SURFACES = {
352
355
  shipped: [],
353
356
  repo: ['packages/basalt-ui/src/agent/**'],
354
357
  },
355
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
358
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
356
359
  forbiddenImports: [...MANTINE_BANS],
357
360
  },
358
361
  './content': {
@@ -390,7 +393,7 @@ export const SURFACES = {
390
393
  shipped: [],
391
394
  repo: ['packages/basalt-ui/src/state.ts'],
392
395
  },
393
- // @visx/* ban dropped — `basalt/import-boundary` now bans it universally outside charts.
396
+ // @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
394
397
  forbiddenImports: [...MANTINE_BANS],
395
398
  },
396
399
 
@@ -441,9 +444,10 @@ export const SURFACES = {
441
444
  // Shipped is a catch-all (not just src/**+app/**) so consumer code under components/, lib/,
442
445
  // features/, etc. is also covered. The @visx/*-only-in-charts and Mantine-free charts/tokens
443
446
  // boundaries used to live here too and need last-writer-wins EMIT_ORDER games against the
444
- // narrower ./tokens/./charts overrides — they're now enforced by `basalt/import-boundary`
445
- // (a plugin rule, immune to that class of clobbering) instead, so the bans left below (antd,
446
- // framer-motion) are plain global bans with no narrower override to out-order.
447
+ // narrower ./tokens/./charts overrides — they're now enforced by `basalt/visx-boundary` and
448
+ // `basalt/token-layer-boundary` (plugin rules, immune to that class of clobbering) instead,
449
+ // so the bans left below (antd, framer-motion) are plain global bans with no narrower
450
+ // override to out-order.
447
451
  shipped: ['**/*.{ts,tsx}'],
448
452
  repo: ['packages/basalt-ui/src/**', 'apps/playground/src/**'],
449
453
  },
@@ -490,35 +494,50 @@ export const SKILL_NAMES = [
490
494
  ),
491
495
  ] as const satisfies readonly SkillName[]
492
496
 
493
- // ── Mantine-free-via-plugin membership ────────────────────────────────────────────────────────────
497
+ // ── Token-layer-boundary-via-plugin membership ────────────────────────────────────────────────────
494
498
 
495
499
  /**
496
- * Headless SURFACES keys whose Mantine-free guarantee is enforced by the `basalt/import-boundary`
497
- * oxlint plugin rule (`configs/oxlint-plugin.js`) instead of a `forbiddenImports` no-restricted-
498
- * imports ban — the rule fires on `charts`/`tokens` path segments only, so ONLY these two surfaces
499
- * qualify (every other headless surface still carries its Mantine ban in `forbiddenImports`).
500
+ * Headless SURFACES keys whose Mantine-free guarantee is enforced by the `basalt/token-layer-
501
+ * boundary` oxlint plugin rule (`configs/oxlint-plugin.js`) instead of a `forbiddenImports`
502
+ * no-restricted-imports ban — the rule fires on `charts`/`tokens` path segments only, so ONLY
503
+ * these two surfaces qualify (every other headless surface still carries its Mantine ban in
504
+ * `forbiddenImports`).
500
505
  *
501
- * Membership alone does NOT satisfy the coverage check — `checkCoverage()`'s assertion 7 (and its
502
- * test mirror) also require `hasImportBoundaryRuleRegistered` to hold, so a future removal of the
503
- * plugin rule's registration still fails loudly instead of silently passing.
506
+ * `basalt/token-layer-boundary` is registered ONLY in the repo-local `.oxlintrc.json`, never the
507
+ * shipped consumer preset. It protects two things: layering — `tokens` is pure data that
508
+ * `cssVariablesResolver` (Mantine-coupled) reads to bind Mantine's surfaces to the same `--vx-*`
509
+ * vars `charts` reads, so an `@mantine/*` import in either would cycle back through the theme
510
+ * layer or let a chart bypass `--vx-*` and fork chrome/charts apart — and packaging: `./charts`
511
+ * and `./tokens` resolve and render with NO `@mantine/*` installed, real and CI-tested
512
+ * (`scripts/pack-test.sh`'s "charts/tokens-only (no-Mantine) resolution + render" step,
513
+ * `scripts/check-dist-layering.mjs`'s dist-graph walk). The LAYER is Mantine-free — the FRAMEWORK
514
+ * is not (`.` requires Mantine as a non-optional peer; these two subpaths don't). Both are a
515
+ * basalt-internal invariant, not a consumer contract (a consumer's own `charts/`/`tokens/`-named
516
+ * directories carry no such obligation), which is why it stays repo-local. Because
517
+ * of that, `checkCoverage()`'s assertion 7 treats membership here as a pure EXEMPTION from the
518
+ * forbiddenImports requirement — it does NOT (and, being a shipped CLI subcommand that must run
519
+ * from inside a consumer's node_modules, CANNOT) verify the rule's live registration itself. That
520
+ * "fails loudly if enforcement is removed" guarantee lives in basalt's own CI instead
521
+ * (`tests/surfaces-coverage.test.ts`, via `hasTokenLayerBoundaryRegistered` against
522
+ * `.oxlintrc.json`).
504
523
  */
505
- export const MANTINE_FREE_VIA_IMPORT_BOUNDARY: ReadonlySet<string> = new Set([
506
- './charts',
507
- './tokens',
508
- ])
524
+ export const TOKEN_LAYER_BOUNDARY_SURFACES: ReadonlySet<string> = new Set(['./charts', './tokens'])
509
525
 
510
526
  /**
511
- * True when a parsed oxlint config's `rules` object registers `basalt/import-boundary` as `'error'`
512
- * — the live signal (not just a hardcoded assumption) that `MANTINE_FREE_VIA_IMPORT_BOUNDARY`
513
- * surfaces are actually enforced. Pure — callers read + JSON.parse the config file themselves
514
- * (surfaces.ts stays dependency-free, no fs access here).
527
+ * True when a parsed oxlint config's `rules` object registers `basalt/token-layer-boundary` as
528
+ * `'error'` — the live signal (not just a hardcoded assumption) that `TOKEN_LAYER_BOUNDARY_SURFACES`
529
+ * are actually enforced. Pure — callers read + JSON.parse the config file themselves (surfaces.ts
530
+ * stays dependency-free, no fs access here). Consumed only by basalt's own CI
531
+ * (`tests/surfaces-coverage.test.ts`) against the repo-local `.oxlintrc.json` — NOT by
532
+ * `checkCoverage()`, which cannot read that repo-local file from an installed package (see
533
+ * `TOKEN_LAYER_BOUNDARY_SURFACES`'s doc comment).
515
534
  *
516
535
  * @example
517
- * hasImportBoundaryRuleRegistered({ 'basalt/import-boundary': 'error' }) // true
518
- * hasImportBoundaryRuleRegistered({}) // false
536
+ * hasTokenLayerBoundaryRegistered({ 'basalt/token-layer-boundary': 'error' }) // true
537
+ * hasTokenLayerBoundaryRegistered({}) // false
519
538
  */
520
- export function hasImportBoundaryRuleRegistered(
539
+ export function hasTokenLayerBoundaryRegistered(
521
540
  rules: Record<string, unknown> | undefined,
522
541
  ): boolean {
523
- return rules?.['basalt/import-boundary'] === 'error'
542
+ return rules?.['basalt/token-layer-boundary'] === 'error'
524
543
  }