basalt-ui 1.1.0 → 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/CHANGELOG.md +7 -0
- package/agent/skills/basalt-app/SKILL.md +4 -3
- package/configs/check.yml +3 -1
- package/configs/oxlint.json +1 -1
- package/dist/cli/index.d.ts +6 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +21 -5
- package/dist/surfaces.d.ts +1 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +8 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/cli/index.ts +57 -15
- package/src/cli/init-sync.test.ts +68 -0
- package/src/surfaces.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.1.1](https://github.com/jkrumm/basalt-ui/compare/v1.1.0...v1.1.1) (2026-07-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* derive consumer seeds from basalt.roots, relax eqeqeq to smart ([b598112](https://github.com/jkrumm/basalt-ui/commit/b5981124b5758cca421164037d4f320ed65af362))
|
|
7
|
+
|
|
1
8
|
# [1.1.0](https://github.com/jkrumm/basalt-ui/compare/v1.0.2...v1.1.0) (2026-07-17)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -84,8 +84,9 @@ import 'basalt-ui/styles.css' // @layer basalt base styles, iOS input safety net
|
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Lint wires as `oxlint . && basalt-ui check-theme` — the theme guard is the teeth behind the token
|
|
87
|
-
doctrine. The consumer series file (
|
|
88
|
-
`
|
|
87
|
+
doctrine. The consumer series file (`<first basalt.root>/lib/series.ts` by default — so `src/lib/series.ts`
|
|
88
|
+
on a plain app, `apps/web/src/lib/series.ts` on a monorepo; override via `basalt.seriesModulePath`) is the
|
|
89
|
+
single guard-exempt palette source — see `/basalt-charts`.
|
|
89
90
|
|
|
90
91
|
## Refresh: `bunx basalt-ui sync`
|
|
91
92
|
|
|
@@ -120,7 +121,7 @@ both.
|
|
|
120
121
|
imported.
|
|
121
122
|
- `basaltViteConfig` adopted; `oxlint . && basalt-ui check-theme` is the lint command.
|
|
122
123
|
- A thin `DESIGN.md` (deltas) + the twelve `basalt-*` rules + the managed CLAUDE block are present.
|
|
123
|
-
-
|
|
124
|
+
- `<first basalt.root>/lib/series.ts` exists as the one guard-exempt series source (for any app metric colors).
|
|
124
125
|
- `basalt-ui sync --check` wired in CI (recommended) to catch drift on future upgrades.
|
|
125
126
|
|
|
126
127
|
## Notes
|
package/configs/check.yml
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
# color literals / off-identity accents that bypass the --vx-* token system).
|
|
6
6
|
# `basalt-ui sync --check` fails when the basalt-managed files (rules, skills, the
|
|
7
7
|
# CLAUDE block) have drifted from the installed basalt-ui version.
|
|
8
|
+
# The oxfmt globs below are rendered from `basalt.roots` at init time — this file is a
|
|
9
|
+
# template, not a raw copy, so a monorepo doesn't seed a `src/**` that matches nothing.
|
|
8
10
|
name: check
|
|
9
11
|
on:
|
|
10
12
|
pull_request:
|
|
@@ -23,7 +25,7 @@ jobs:
|
|
|
23
25
|
- run: bunx oxlint .
|
|
24
26
|
- run: bunx basalt-ui check-theme
|
|
25
27
|
- run: bunx basalt-ui sync --check
|
|
26
|
-
- run: bunx oxfmt
|
|
28
|
+
- run: bunx oxfmt {{ROOTS_GLOBS}} '!**/dist/**' --check
|
|
27
29
|
# Enable once your app defines these package.json scripts:
|
|
28
30
|
# - run: bun run typecheck
|
|
29
31
|
# - run: bun run test
|
package/configs/oxlint.json
CHANGED
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
|
/**
|
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,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,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,a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AM,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
|
@@ -13,10 +13,21 @@ 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
15
|
import { RULE_NAMES, SKILL_NAMES, SURFACES, TOKEN_LAYER_BOUNDARY_SURFACES } from "../surfaces.js";
|
|
16
|
-
const
|
|
17
|
-
const
|
|
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
|
+
}
|
|
18
29
|
function defaultExempt(cfg) {
|
|
19
|
-
return [cfg
|
|
30
|
+
return [resolveSeriesModulePath(cfg)];
|
|
20
31
|
}
|
|
21
32
|
const SKIP = /\.gen\.ts$|\.test\.[tj]sx?$|\.d\.ts$/;
|
|
22
33
|
const SERIES_MODULE_HINT_RE = /(series|palette)\.tsx?$/i;
|
|
@@ -180,7 +191,8 @@ function buildTemplateVars(pkgRoot, cwd, cfg) {
|
|
|
180
191
|
APP_NAME: readPackageName(cwd),
|
|
181
192
|
BASALT_VERSION: readFrameworkVersion(pkgRoot),
|
|
182
193
|
ACCENT_HUE: cfg.accentHue ?? "blue",
|
|
183
|
-
SERIES_MODULE_PATH: cfg
|
|
194
|
+
SERIES_MODULE_PATH: resolveSeriesModulePath(cfg),
|
|
195
|
+
ROOTS_GLOBS: resolveRoots(cfg).map(toRootGlob).join(" ")
|
|
184
196
|
};
|
|
185
197
|
}
|
|
186
198
|
function fillTemplate(tpl, vars) {
|
|
@@ -282,7 +294,11 @@ function managedFiles(peers) {
|
|
|
282
294
|
dest: ".github/workflows/check.yml",
|
|
283
295
|
mode: "seed",
|
|
284
296
|
source: "configs/check.yml",
|
|
285
|
-
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
|
+
}
|
|
286
302
|
};
|
|
287
303
|
const oxlintrc = {
|
|
288
304
|
dest: ".oxlintrc.json",
|
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";
|
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,CAAC,K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const SURFACES = {
|
|
|
272
272
|
// so the bans left below (antd, framer-motion) are plain global bans with no narrower
|
|
273
273
|
// override to out-order.
|
|
274
274
|
shipped: ["**/*.{ts,tsx}"],
|
|
275
|
-
|
|
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/**"]
|
|
276
283
|
},
|
|
277
284
|
ruleOverrides: [{ rule: "no-console", level: "off", target: "repo" }],
|
|
278
285
|
// cli/bin/scripts, repo-local only
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v1.1.
|
|
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.1.
|
|
18
|
+
Version: 1.1.1
|
|
19
19
|
|
|
20
20
|
## basalt-ui
|
|
21
21
|
Import: import { ... } from 'basalt-ui'
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -135,27 +135,59 @@ export type BasaltConfig = {
|
|
|
135
135
|
* `sub-16-input-font` check.
|
|
136
136
|
*/
|
|
137
137
|
sub16InputFont?: boolean
|
|
138
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* Path of the consumer's guard-exempt series file, for DESIGN.md `{{SERIES_MODULE_PATH}}`.
|
|
140
|
+
* Default: `<first basalt.root>/lib/series.ts` — see `resolveSeriesModulePath`.
|
|
141
|
+
*/
|
|
139
142
|
seriesModulePath?: string
|
|
140
143
|
}
|
|
141
144
|
|
|
142
|
-
const
|
|
145
|
+
const DEFAULT_ROOT = 'src'
|
|
146
|
+
const DEFAULT_ROOTS = [DEFAULT_ROOT]
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The configured source roots, or the built-in default. The ONE resolution every roots-derived seed
|
|
150
|
+
* reads — an empty `roots: []` falls back rather than resolving to nothing, because a bare `??`
|
|
151
|
+
* would let `[]` through and render an empty oxfmt glob into the seeded CI, reproducing the exact
|
|
152
|
+
* "matches zero files" break this derivation exists to prevent.
|
|
153
|
+
*/
|
|
154
|
+
function resolveRoots(cfg: BasaltConfig): string[] {
|
|
155
|
+
return cfg.roots?.length ? cfg.roots : DEFAULT_ROOTS
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The one consumer series path — the DESIGN.md template's `{{SERIES_MODULE_PATH}}`, the default
|
|
160
|
+
* scan exemption, and the skills' prose all resolve through this single function.
|
|
161
|
+
*
|
|
162
|
+
* Derived from the FIRST configured root (argo's convention: `<root>/lib/series.ts`), not a fixed
|
|
163
|
+
* `src/lib/series.ts` — a monorepo that correctly sets `roots: ['apps/web/src']` has no top-level
|
|
164
|
+
* `src/`, so a hardcoded default would seed a DESIGN.md pointing at a path that cannot exist and
|
|
165
|
+
* silently exempt nothing. `seriesModulePath` still overrides for a layout that isn't `<root>/lib/`.
|
|
166
|
+
*/
|
|
167
|
+
function resolveSeriesModulePath(cfg: BasaltConfig): string {
|
|
168
|
+
if (cfg.seriesModulePath !== undefined) return cfg.seriesModulePath
|
|
169
|
+
const [firstRoot = DEFAULT_ROOT] = resolveRoots(cfg)
|
|
170
|
+
return `${firstRoot}/lib/series.ts`
|
|
171
|
+
}
|
|
143
172
|
|
|
144
173
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
174
|
+
* A root as a single-quoted oxfmt glob for the seeded CI `run:` step. POSIX-escapes any embedded
|
|
175
|
+
* quote (`'` → `'\''`) — `roots` is consumer-authored, and an unescaped apostrophe would break out
|
|
176
|
+
* of the quoting and emit a workflow that fails on a syntax error the consumer can't trace back
|
|
177
|
+
* here. Not a privilege boundary (it's their own config rendering into their own CI), just a file
|
|
178
|
+
* this CLI generates and therefore owes valid quoting.
|
|
148
179
|
*/
|
|
149
|
-
|
|
180
|
+
function toRootGlob(root: string): string {
|
|
181
|
+
return `'${root.replace(/'/g, `'\\''`)}/**'`
|
|
182
|
+
}
|
|
150
183
|
|
|
151
184
|
/**
|
|
152
|
-
* Default scan exemption — a bare consumer's only palette source is its
|
|
153
|
-
*
|
|
154
|
-
* `
|
|
155
|
-
* `{{SERIES_MODULE_PATH}}`, so overriding `seriesModulePath` keeps the exemption in sync.
|
|
185
|
+
* Default scan exemption — a bare consumer's only palette source is its series module (the doctrine
|
|
186
|
+
* directs every consumer to put raw hex series colors there). Shares `resolveSeriesModulePath` with
|
|
187
|
+
* `buildTemplateVars`'s `{{SERIES_MODULE_PATH}}`, so the seeded path and the exemption can't drift.
|
|
156
188
|
*/
|
|
157
189
|
function defaultExempt(cfg: BasaltConfig): string[] {
|
|
158
|
-
return [cfg
|
|
190
|
+
return [resolveSeriesModulePath(cfg)]
|
|
159
191
|
}
|
|
160
192
|
|
|
161
193
|
const SKIP = /\.gen\.ts$|\.test\.[tj]sx?$|\.d\.ts$/
|
|
@@ -409,6 +441,8 @@ type TemplateVars = {
|
|
|
409
441
|
BASALT_VERSION: string
|
|
410
442
|
ACCENT_HUE: string
|
|
411
443
|
SERIES_MODULE_PATH: string
|
|
444
|
+
/** The consumer's configured roots as space-separated quoted oxfmt globs, e.g. `'apps/web/src/**'`. */
|
|
445
|
+
ROOTS_GLOBS: string
|
|
412
446
|
}
|
|
413
447
|
|
|
414
448
|
// The block markers the CLAUDE.md template emits. The begin marker carries the framework version
|
|
@@ -459,7 +493,8 @@ function buildTemplateVars(pkgRoot: string, cwd: string, cfg: BasaltConfig): Tem
|
|
|
459
493
|
APP_NAME: readPackageName(cwd),
|
|
460
494
|
BASALT_VERSION: readFrameworkVersion(pkgRoot),
|
|
461
495
|
ACCENT_HUE: cfg.accentHue ?? 'blue',
|
|
462
|
-
SERIES_MODULE_PATH: cfg
|
|
496
|
+
SERIES_MODULE_PATH: resolveSeriesModulePath(cfg),
|
|
497
|
+
ROOTS_GLOBS: resolveRoots(cfg).map(toRootGlob).join(' '),
|
|
463
498
|
}
|
|
464
499
|
}
|
|
465
500
|
|
|
@@ -616,13 +651,20 @@ function managedFiles(peers: PeerFlags): ManagedFile[] {
|
|
|
616
651
|
' - node_modules/basalt-ui/configs/lefthook.yml\n',
|
|
617
652
|
}
|
|
618
653
|
|
|
619
|
-
// CI is inherently repo-shaped (a monorepo's check.yml needs its own
|
|
620
|
-
//
|
|
654
|
+
// CI is inherently repo-shaped (a monorepo's check.yml needs its own scripts), and GitHub Actions
|
|
655
|
+
// has no in-repo `extends` — so the workflow seeds as an explicit starting copy. Its oxfmt globs
|
|
656
|
+
// come from `{{ROOTS_GLOBS}}` rather than a hardcoded `src/**`: on a monorepo the latter matches
|
|
657
|
+
// nothing and oxfmt exits 2, breaking the consumer's very first CI run for a reason that reads
|
|
658
|
+
// like a basalt bug.
|
|
621
659
|
const ci: ManagedFile = {
|
|
622
660
|
dest: '.github/workflows/check.yml',
|
|
623
661
|
mode: 'seed',
|
|
624
662
|
source: 'configs/check.yml',
|
|
625
|
-
render: (ctx) =>
|
|
663
|
+
render: (ctx) => {
|
|
664
|
+
const tpl = readSource(ctx.pkgRoot, 'configs/check.yml')
|
|
665
|
+
if (tpl === null) return null
|
|
666
|
+
return fillTemplate(tpl, ctx.vars)
|
|
667
|
+
},
|
|
626
668
|
}
|
|
627
669
|
|
|
628
670
|
// Seed an `.oxlintrc.json` that extends the shipped preset (written once, then consumer-owned).
|
|
@@ -158,3 +158,71 @@ describe('init — first-run hint', () => {
|
|
|
158
158
|
expect(log.toLowerCase()).toContain('basalt.*')
|
|
159
159
|
})
|
|
160
160
|
})
|
|
161
|
+
|
|
162
|
+
describe('seeds derive from basalt.roots', () => {
|
|
163
|
+
// A monorepo sets `roots` because it has no top-level `src/`. Both the CI oxfmt globs and the
|
|
164
|
+
// DESIGN.md series path used to hardcode `src`, so a consumer that configured roots CORRECTLY
|
|
165
|
+
// still got a CI run that matched zero files (oxfmt exits 2) and a series path that can't exist.
|
|
166
|
+
const MONOREPO = { name: 'fixture', basalt: { roots: ['apps/web/src'] } }
|
|
167
|
+
|
|
168
|
+
it('renders the CI oxfmt globs from roots', () => {
|
|
169
|
+
writeFixture('package.json', JSON.stringify(MONOREPO))
|
|
170
|
+
init(dir)
|
|
171
|
+
const ci = readFileSync(resolve(dir, '.github/workflows/check.yml'), 'utf8')
|
|
172
|
+
expect(ci).toContain("bunx oxfmt 'apps/web/src/**' '!**/dist/**' --check")
|
|
173
|
+
expect(ci).not.toContain('{{ROOTS_GLOBS}}')
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it('renders every root, not just the first', () => {
|
|
177
|
+
writeFixture(
|
|
178
|
+
'package.json',
|
|
179
|
+
JSON.stringify({ name: 'f', basalt: { roots: ['a/src', 'b/src'] } }),
|
|
180
|
+
)
|
|
181
|
+
init(dir)
|
|
182
|
+
const ci = readFileSync(resolve(dir, '.github/workflows/check.yml'), 'utf8')
|
|
183
|
+
expect(ci).toContain("bunx oxfmt 'a/src/**' 'b/src/**' '!**/dist/**' --check")
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
it("falls back to 'src/**' when roots is unset", () => {
|
|
187
|
+
writeFixture('package.json', JSON.stringify({ name: 'fixture' }))
|
|
188
|
+
init(dir)
|
|
189
|
+
const ci = readFileSync(resolve(dir, '.github/workflows/check.yml'), 'utf8')
|
|
190
|
+
expect(ci).toContain("bunx oxfmt 'src/**' '!**/dist/**' --check")
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
it('seeds DESIGN.md with a series path under the first root', () => {
|
|
194
|
+
writeFixture('package.json', JSON.stringify(MONOREPO))
|
|
195
|
+
init(dir)
|
|
196
|
+
const design = readFileSync(resolve(dir, 'DESIGN.md'), 'utf8')
|
|
197
|
+
expect(design).toContain('apps/web/src/lib/series.ts')
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it('falls back to the default root when roots is an explicit empty array', () => {
|
|
201
|
+
// `[]` is nonsense config, but a bare `??` would let it through and render an empty oxfmt glob
|
|
202
|
+
// into CI — the exact "matches zero files" break this derivation exists to prevent.
|
|
203
|
+
writeFixture('package.json', JSON.stringify({ name: 'f', basalt: { roots: [] } }))
|
|
204
|
+
init(dir)
|
|
205
|
+
const ci = readFileSync(resolve(dir, '.github/workflows/check.yml'), 'utf8')
|
|
206
|
+
expect(ci).toContain("bunx oxfmt 'src/**' '!**/dist/**' --check")
|
|
207
|
+
expect(readFileSync(resolve(dir, 'DESIGN.md'), 'utf8')).toContain('src/lib/series.ts')
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it('POSIX-escapes a quote in a root instead of breaking out of the CI shell quoting', () => {
|
|
211
|
+
writeFixture('package.json', JSON.stringify({ name: 'f', basalt: { roots: ["it's/src"] } }))
|
|
212
|
+
init(dir)
|
|
213
|
+
const ci = readFileSync(resolve(dir, '.github/workflows/check.yml'), 'utf8')
|
|
214
|
+
expect(ci).toContain("'it'\\''s/src/**'")
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
it('lets seriesModulePath override the roots-derived default', () => {
|
|
218
|
+
writeFixture(
|
|
219
|
+
'package.json',
|
|
220
|
+
JSON.stringify({
|
|
221
|
+
name: 'f',
|
|
222
|
+
basalt: { roots: ['apps/web/src'], seriesModulePath: 'custom/p.ts' },
|
|
223
|
+
}),
|
|
224
|
+
)
|
|
225
|
+
init(dir)
|
|
226
|
+
expect(readFileSync(resolve(dir, 'DESIGN.md'), 'utf8')).toContain('custom/p.ts')
|
|
227
|
+
})
|
|
228
|
+
})
|
package/src/surfaces.ts
CHANGED
|
@@ -449,7 +449,14 @@ export const SURFACES = {
|
|
|
449
449
|
// so the bans left below (antd, framer-motion) are plain global bans with no narrower
|
|
450
450
|
// override to out-order.
|
|
451
451
|
shipped: ['**/*.{ts,tsx}'],
|
|
452
|
-
|
|
452
|
+
// Repo is packages/basalt-ui/src/** ONLY. apps/playground is deliberately absent: it
|
|
453
|
+
// dogfoods the shipped consumer preset through its own apps/playground/.oxlintrc.json
|
|
454
|
+
// (`extends: ["./node_modules/basalt-ui/configs/oxlint.json"]`, resolved via the workspace
|
|
455
|
+
// symlink), which oxlint honours as a nested config — the nearest config REPLACES this one
|
|
456
|
+
// for that subtree, so listing playground here would be dead glob. That indirection is the
|
|
457
|
+
// point: the playground sees exactly what a real consumer sees, including NOT receiving
|
|
458
|
+
// `basalt/token-layer-boundary` (repo-local by design — see TOKEN_LAYER_BOUNDARY_SURFACES).
|
|
459
|
+
repo: ['packages/basalt-ui/src/**'],
|
|
453
460
|
},
|
|
454
461
|
ruleOverrides: [{ rule: 'no-console', level: 'off', target: 'repo' }], // cli/bin/scripts, repo-local only
|
|
455
462
|
forbiddenImports: [
|