basalt-ui 1.0.2 → 1.1.1
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 +18 -2
- package/CHANGELOG.md +14 -0
- package/README.md +2 -2
- package/agent/rules/basalt-charts.md +22 -12
- package/agent/skills/basalt-app/SKILL.md +4 -3
- package/agent/skills/basalt-charts/SKILL.md +8 -2
- package/agent/skills/basalt-design/SKILL.md +4 -3
- package/agent/templates/CLAUDE-block.md.tpl +3 -3
- package/configs/check.yml +3 -1
- package/configs/oxlint-plugin.js +144 -59
- package/configs/oxlint-plugin.test.ts +88 -31
- package/configs/oxlint.json +3 -2
- package/dist/cli/index.d.ts +11 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +23 -29
- package/dist/surfaces.d.ts +34 -16
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +28 -21
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/cli/index.ts +76 -46
- package/src/cli/init-sync.test.ts +68 -0
- package/src/surfaces.ts +63 -37
|
@@ -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
|
|
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/
|
|
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
|
-
// ──
|
|
114
|
+
// ── visx-boundary ────────────────────────────────────────────────────────────
|
|
113
115
|
|
|
114
|
-
describe('basalt/
|
|
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('
|
|
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('
|
|
126
|
+
expect(rules).not.toContain('visx-boundary')
|
|
125
127
|
})
|
|
126
128
|
|
|
127
|
-
it('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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
|
})
|
package/configs/oxlint.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"rules": {
|
|
9
9
|
"no-var": "error",
|
|
10
|
-
"eqeqeq": "error",
|
|
10
|
+
"eqeqeq": ["error", "smart"],
|
|
11
11
|
"no-console": "warn",
|
|
12
12
|
"no-shadow": "off",
|
|
13
13
|
"react/rules-of-hooks": "error",
|
|
@@ -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/
|
|
23
|
+
"basalt/visx-boundary": "error",
|
|
24
|
+
"basalt/visx-tooltip": "error"
|
|
24
25
|
},
|
|
25
26
|
"overrides": [
|
|
26
27
|
{
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -96,7 +96,10 @@ export type BasaltConfig = {
|
|
|
96
96
|
* `sub-16-input-font` check.
|
|
97
97
|
*/
|
|
98
98
|
sub16InputFont?: boolean;
|
|
99
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Path of the consumer's guard-exempt series file, for DESIGN.md `{{SERIES_MODULE_PATH}}`.
|
|
101
|
+
* Default: `<first basalt.root>/lib/series.ts` — see `resolveSeriesModulePath`.
|
|
102
|
+
*/
|
|
100
103
|
seriesModulePath?: string;
|
|
101
104
|
};
|
|
102
105
|
/**
|
|
@@ -160,6 +163,8 @@ type TemplateVars = {
|
|
|
160
163
|
BASALT_VERSION: string;
|
|
161
164
|
ACCENT_HUE: string;
|
|
162
165
|
SERIES_MODULE_PATH: string;
|
|
166
|
+
/** The consumer's configured roots as space-separated quoted oxfmt globs, e.g. `'apps/web/src/**'`. */
|
|
167
|
+
ROOTS_GLOBS: string;
|
|
163
168
|
};
|
|
164
169
|
declare const MANIFEST_PATH = ".basalt/manifest.json";
|
|
165
170
|
/**
|
|
@@ -232,8 +237,11 @@ export declare function sync(opts?: SyncOptions, cwd?: string): number;
|
|
|
232
237
|
* 5. Every real package.json exports key has a SURFACES entry.
|
|
233
238
|
* 6. Every surface with non-empty forbiddenImports has a globs field.
|
|
234
239
|
* 7. Every headless surface is Mantine-free — via all 3 `forbiddenImports` bans, OR (for
|
|
235
|
-
* `
|
|
236
|
-
*
|
|
240
|
+
* `TOKEN_LAYER_BOUNDARY_SURFACES` members, `./charts`/`./tokens`) exemption, since their
|
|
241
|
+
* Mantine-free guarantee is covered by the repo-local-only `basalt/token-layer-boundary`
|
|
242
|
+
* plugin rule instead — this assertion cannot verify that rule's live registration itself (see
|
|
243
|
+
* the assertion's own comment below for why); basalt's own CI does
|
|
244
|
+
* (`tests/surfaces-coverage.test.ts`).
|
|
237
245
|
* 8. Every doctrine optionalPeers entry exists in peerDependencies AND peerDependenciesMeta.
|
|
238
246
|
*
|
|
239
247
|
* Tooling surfaces are exempt from assertions 1–3 by the discriminant.
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAqCA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,UAAU,EAAE,WAAW,EAA2C,MAAM,aAAa,CAAA;AAG9F,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;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAA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AE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAyF1D;AAMD,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAED,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,WAAW,EAAE,CAAA;CACxB,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,17 +12,22 @@ 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
15
|
+
import { RULE_NAMES, SKILL_NAMES, SURFACES, TOKEN_LAYER_BOUNDARY_SURFACES } from "../surfaces.js";
|
|
16
|
+
const DEFAULT_ROOT = "src";
|
|
17
|
+
const DEFAULT_ROOTS = [DEFAULT_ROOT];
|
|
18
|
+
function resolveRoots(cfg) {
|
|
19
|
+
return cfg.roots?.length ? cfg.roots : DEFAULT_ROOTS;
|
|
20
|
+
}
|
|
21
|
+
function resolveSeriesModulePath(cfg) {
|
|
22
|
+
if (cfg.seriesModulePath !== void 0) return cfg.seriesModulePath;
|
|
23
|
+
const [firstRoot = DEFAULT_ROOT] = resolveRoots(cfg);
|
|
24
|
+
return `${firstRoot}/lib/series.ts`;
|
|
25
|
+
}
|
|
26
|
+
function toRootGlob(root) {
|
|
27
|
+
return `'${root.replace(/'/g, `'\\''`)}/**'`;
|
|
28
|
+
}
|
|
24
29
|
function defaultExempt(cfg) {
|
|
25
|
-
return [cfg
|
|
30
|
+
return [resolveSeriesModulePath(cfg)];
|
|
26
31
|
}
|
|
27
32
|
const SKIP = /\.gen\.ts$|\.test\.[tj]sx?$|\.d\.ts$/;
|
|
28
33
|
const SERIES_MODULE_HINT_RE = /(series|palette)\.tsx?$/i;
|
|
@@ -186,7 +191,8 @@ function buildTemplateVars(pkgRoot, cwd, cfg) {
|
|
|
186
191
|
APP_NAME: readPackageName(cwd),
|
|
187
192
|
BASALT_VERSION: readFrameworkVersion(pkgRoot),
|
|
188
193
|
ACCENT_HUE: cfg.accentHue ?? "blue",
|
|
189
|
-
SERIES_MODULE_PATH: cfg
|
|
194
|
+
SERIES_MODULE_PATH: resolveSeriesModulePath(cfg),
|
|
195
|
+
ROOTS_GLOBS: resolveRoots(cfg).map(toRootGlob).join(" ")
|
|
190
196
|
};
|
|
191
197
|
}
|
|
192
198
|
function fillTemplate(tpl, vars) {
|
|
@@ -288,7 +294,11 @@ function managedFiles(peers) {
|
|
|
288
294
|
dest: ".github/workflows/check.yml",
|
|
289
295
|
mode: "seed",
|
|
290
296
|
source: "configs/check.yml",
|
|
291
|
-
render: (ctx) =>
|
|
297
|
+
render: (ctx) => {
|
|
298
|
+
const tpl = readSource(ctx.pkgRoot, "configs/check.yml");
|
|
299
|
+
if (tpl === null) return null;
|
|
300
|
+
return fillTemplate(tpl, ctx.vars);
|
|
301
|
+
}
|
|
292
302
|
};
|
|
293
303
|
const oxlintrc = {
|
|
294
304
|
dest: ".oxlintrc.json",
|
|
@@ -598,25 +608,9 @@ function checkCoverage() {
|
|
|
598
608
|
}
|
|
599
609
|
}
|
|
600
610
|
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
611
|
for (const [key, spec] of allSpecs) {
|
|
612
612
|
if (spec.layer !== "headless") continue;
|
|
613
|
-
if (
|
|
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
|
-
}
|
|
613
|
+
if (TOKEN_LAYER_BOUNDARY_SURFACES.has(key)) continue;
|
|
620
614
|
for (const required of REQUIRED_MANTINE_BANS) {
|
|
621
615
|
const hasBan = spec.forbiddenImports.some((fi) => fi.spec === required);
|
|
622
616
|
if (!hasBan) {
|
package/dist/surfaces.d.ts
CHANGED
|
@@ -347,7 +347,7 @@ export declare const SURFACES: {
|
|
|
347
347
|
readonly guardKinds: readonly [];
|
|
348
348
|
readonly globs: {
|
|
349
349
|
readonly shipped: readonly ["**/*.{ts,tsx}"];
|
|
350
|
-
readonly repo: readonly ["packages/basalt-ui/src/**"
|
|
350
|
+
readonly repo: readonly ["packages/basalt-ui/src/**"];
|
|
351
351
|
};
|
|
352
352
|
readonly ruleOverrides: readonly [{
|
|
353
353
|
readonly rule: "no-console";
|
|
@@ -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/
|
|
379
|
-
* oxlint plugin rule (`configs/oxlint-plugin.js`) instead of a `forbiddenImports`
|
|
380
|
-
* imports ban — the rule fires on `charts`/`tokens` path segments only, so ONLY
|
|
381
|
-
* qualify (every other headless surface still carries its Mantine ban in
|
|
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
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
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
|
|
402
|
+
export declare const TOKEN_LAYER_BOUNDARY_SURFACES: ReadonlySet<string>;
|
|
388
403
|
/**
|
|
389
|
-
* True when a parsed oxlint config's `rules` object registers `basalt/
|
|
390
|
-
* — the live signal (not just a hardcoded assumption) that `
|
|
391
|
-
*
|
|
392
|
-
*
|
|
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
|
-
*
|
|
396
|
-
*
|
|
413
|
+
* hasTokenLayerBoundaryRegistered({ 'basalt/token-layer-boundary': 'error' }) // true
|
|
414
|
+
* hasTokenLayerBoundaryRegistered({}) // false
|
|
397
415
|
*/
|
|
398
|
-
export declare function
|
|
416
|
+
export declare function hasTokenLayerBoundaryRegistered(rules: Record<string, unknown> | undefined): boolean;
|
|
399
417
|
export {};
|
|
400
418
|
//# sourceMappingURL=surfaces.d.ts.map
|
package/dist/surfaces.d.ts.map
CHANGED
|
@@ -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,QAAQ,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,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAC5B,CAAA;AAED,kEAAkE;AAClE,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,WAAW,CAAA;AA8BpD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiS2B,CAAA;AAIhD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,qBAMiB,CAAA;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
|
|
43
|
-
// `basalt/
|
|
44
|
-
//
|
|
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
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
226
|
+
// @visx/* ban dropped — `basalt/visx-boundary` now bans it universally outside charts.
|
|
225
227
|
forbiddenImports: [...MANTINE_BANS]
|
|
226
228
|
},
|
|
227
229
|
"./connectivity": {
|
|
@@ -265,11 +267,19 @@ 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/
|
|
269
|
-
// (
|
|
270
|
-
// framer-motion) are plain global bans with no narrower
|
|
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 is packages/basalt-ui/src/** ONLY. apps/playground is deliberately absent: it
|
|
276
|
+
// dogfoods the shipped consumer preset through its own apps/playground/.oxlintrc.json
|
|
277
|
+
// (`extends: ["./node_modules/basalt-ui/configs/oxlint.json"]`, resolved via the workspace
|
|
278
|
+
// symlink), which oxlint honours as a nested config — the nearest config REPLACES this one
|
|
279
|
+
// for that subtree, so listing playground here would be dead glob. That indirection is the
|
|
280
|
+
// point: the playground sees exactly what a real consumer sees, including NOT receiving
|
|
281
|
+
// `basalt/token-layer-boundary` (repo-local by design — see TOKEN_LAYER_BOUNDARY_SURFACES).
|
|
282
|
+
repo: ["packages/basalt-ui/src/**"]
|
|
273
283
|
},
|
|
274
284
|
ruleOverrides: [{ rule: "no-console", level: "off", target: "repo" }],
|
|
275
285
|
// cli/bin/scripts, repo-local only
|
|
@@ -289,17 +299,14 @@ const SKILL_NAMES = [
|
|
|
289
299
|
Object.values(SURFACES).filter((s) => s.kind === "doctrine").flatMap((s) => [...s.skill])
|
|
290
300
|
)
|
|
291
301
|
];
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
"
|
|
295
|
-
]);
|
|
296
|
-
function hasImportBoundaryRuleRegistered(rules) {
|
|
297
|
-
return rules?.["basalt/import-boundary"] === "error";
|
|
302
|
+
const TOKEN_LAYER_BOUNDARY_SURFACES = /* @__PURE__ */ new Set(["./charts", "./tokens"]);
|
|
303
|
+
function hasTokenLayerBoundaryRegistered(rules) {
|
|
304
|
+
return rules?.["basalt/token-layer-boundary"] === "error";
|
|
298
305
|
}
|
|
299
306
|
export {
|
|
300
|
-
MANTINE_FREE_VIA_IMPORT_BOUNDARY,
|
|
301
307
|
RULE_NAMES,
|
|
302
308
|
SKILL_NAMES,
|
|
303
309
|
SURFACES,
|
|
304
|
-
|
|
310
|
+
TOKEN_LAYER_BOUNDARY_SURFACES,
|
|
311
|
+
hasTokenLayerBoundaryRegistered
|
|
305
312
|
};
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v1.
|
|
1
|
+
# basalt-ui v1.1.1
|
|
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.
|
|
18
|
+
Version: 1.1.1
|
|
19
19
|
|
|
20
20
|
## basalt-ui
|
|
21
21
|
Import: import { ... } from 'basalt-ui'
|