basalt-ui 2.12.0 → 2.13.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/MIGRATING.md +50 -12
  3. package/agent/rules/basalt-state.md +1 -1
  4. package/agent/skills/basalt-app/SKILL.md +1 -1
  5. package/agent/templates/main.tpl +1 -0
  6. package/dist/cli/basalt-install.d.ts +10 -0
  7. package/dist/cli/basalt-install.d.ts.map +1 -0
  8. package/dist/cli/basalt-install.js +0 -0
  9. package/dist/cli/check-theme.js +1 -1
  10. package/dist/cli/doctor-upgrade.d.ts +3 -3
  11. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  12. package/dist/cli/doctor-upgrade.js +28 -44
  13. package/dist/cli/doctor.js +3 -3
  14. package/dist/cli/index.d.ts +4 -28
  15. package/dist/cli/index.d.ts.map +1 -1
  16. package/dist/cli/index.js +10 -49
  17. package/dist/cli/provider-tags.d.ts +12 -0
  18. package/dist/cli/provider-tags.d.ts.map +1 -0
  19. package/dist/cli/provider-tags.js +28 -0
  20. package/dist/cli/render-imports.d.ts +24 -0
  21. package/dist/cli/render-imports.d.ts.map +1 -0
  22. package/dist/cli/render-imports.js +74 -0
  23. package/dist/cli/router-wiring.d.ts +12 -0
  24. package/dist/cli/router-wiring.d.ts.map +1 -1
  25. package/dist/cli/router-wiring.js +18 -0
  26. package/dist/cli/source-text.d.ts +7 -0
  27. package/dist/cli/source-text.d.ts.map +1 -1
  28. package/dist/cli/source-text.js +34 -0
  29. package/dist/cli/sync.d.ts.map +1 -1
  30. package/dist/cli/sync.js +18 -13
  31. package/dist/guard/fonts-hint.d.ts +3 -0
  32. package/dist/guard/fonts-hint.d.ts.map +1 -0
  33. package/dist/guard/fonts-hint.js +4 -0
  34. package/dist/guard/index.d.ts +1 -1
  35. package/dist/guard/index.d.ts.map +1 -1
  36. package/dist/guard/index.js +2 -1
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +3 -1
  40. package/dist/provider/create-router.d.ts +57 -10
  41. package/dist/provider/create-router.d.ts.map +1 -1
  42. package/dist/provider/create-router.js +28 -17
  43. package/dist/provider/index.d.ts +2 -2
  44. package/dist/provider/index.d.ts.map +1 -1
  45. package/dist/provider/index.js +23 -7
  46. package/dist/query-client.d.ts +2 -62
  47. package/dist/query-client.d.ts.map +1 -1
  48. package/dist/query-client.js +13 -18
  49. package/dist/router-tanstack/nav.d.ts +5 -0
  50. package/dist/router-tanstack/nav.d.ts.map +1 -1
  51. package/dist/router-tanstack/search-store-warnings.d.ts +33 -0
  52. package/dist/router-tanstack/search-store-warnings.d.ts.map +1 -0
  53. package/dist/router-tanstack/search-store-warnings.js +77 -0
  54. package/dist/router-tanstack/search-store.d.ts +2 -5
  55. package/dist/router-tanstack/search-store.d.ts.map +1 -1
  56. package/dist/router-tanstack/search-store.js +111 -110
  57. package/dist/router-tanstack/use-nav.d.ts +4 -2
  58. package/dist/router-tanstack/use-nav.d.ts.map +1 -1
  59. package/dist/router-tanstack/use-nav.js +55 -18
  60. package/dist/shell/app-breadcrumbs.d.ts +1 -3
  61. package/dist/shell/app-breadcrumbs.d.ts.map +1 -1
  62. package/dist/shell/app-breadcrumbs.js +1 -6
  63. package/dist/shell/index.d.ts +14 -5
  64. package/dist/shell/index.d.ts.map +1 -1
  65. package/dist/shell/index.js +6 -29
  66. package/dist/shell/nav-types.d.ts +7 -0
  67. package/dist/shell/nav-types.d.ts.map +1 -1
  68. package/dist/shell/page-aside.d.ts +4 -2
  69. package/dist/shell/page-aside.d.ts.map +1 -1
  70. package/dist/shell/page-aside.js +41 -23
  71. package/dist/shell/page-bar.d.ts +1 -1
  72. package/dist/shell/page-bar.d.ts.map +1 -1
  73. package/dist/shell/page-bar.js +39 -33
  74. package/dist/telemetry.d.ts +31 -2
  75. package/dist/telemetry.d.ts.map +1 -1
  76. package/dist/telemetry.js +32 -12
  77. package/dist/theme/ctl-theme.d.ts.map +1 -1
  78. package/dist/theme/ctl-theme.js +17 -30
  79. package/dist/theme/extend.d.ts +18 -0
  80. package/dist/theme/extend.d.ts.map +1 -0
  81. package/dist/theme/extend.js +6 -0
  82. package/dist/theme/index.d.ts.map +1 -1
  83. package/dist/theme/index.js +44 -84
  84. package/dist/unwrap.d.ts +29 -0
  85. package/dist/unwrap.d.ts.map +1 -0
  86. package/dist/unwrap.js +18 -0
  87. package/llms.txt +9 -5
  88. package/package.json +1 -1
  89. package/src/cli/basalt-install.ts +9 -0
  90. package/src/cli/check-theme.ts +1 -1
  91. package/src/cli/doctor-upgrade.ts +40 -61
  92. package/src/cli/doctor.ts +3 -3
  93. package/src/cli/index.ts +14 -71
  94. package/src/cli/provider-tags.ts +38 -0
  95. package/src/cli/render-imports.ts +104 -0
  96. package/src/cli/router-wiring.ts +23 -0
  97. package/src/cli/source-text.ts +39 -0
  98. package/src/cli/sync.ts +27 -21
  99. package/src/guard/fonts-hint.ts +2 -0
  100. package/src/guard/index.ts +2 -2
  101. package/src/index.ts +4 -2
  102. package/src/provider/create-router.tsx +103 -39
  103. package/src/provider/index.tsx +27 -9
  104. package/src/query-client.ts +20 -78
  105. package/src/router-tanstack/nav.ts +5 -0
  106. package/src/router-tanstack/search-store-warnings.ts +120 -0
  107. package/src/router-tanstack/search-store.ts +200 -206
  108. package/src/router-tanstack/use-nav.ts +116 -76
  109. package/src/shell/app-breadcrumbs.tsx +1 -12
  110. package/src/shell/index.tsx +22 -55
  111. package/src/shell/nav-types.ts +8 -0
  112. package/src/shell/page-aside.tsx +59 -26
  113. package/src/shell/page-bar.tsx +63 -59
  114. package/src/telemetry.ts +71 -13
  115. package/src/theme/__snapshots__/plain-theme.test.ts.snap +2354 -0
  116. package/src/theme/ctl-theme.tsx +20 -19
  117. package/src/theme/extend.ts +18 -0
  118. package/src/theme/index.ts +50 -49
  119. package/src/unwrap.ts +44 -0
package/dist/cli/index.js CHANGED
@@ -20,8 +20,16 @@ import { guardHook } from "./guard-hook.js";
20
20
  import { COMMAND_OPTIONS, USAGE, unknownFlag } from "./help.js";
21
21
  import { init } from "./init.js";
22
22
  import { sync } from "./sync.js";
23
- import { CODE_ROUTED_NOTE, SHELL_LESS_NOTE, routerSeedSkip } from "./router-wiring.js";
24
- import { hasDependency, readIfExists, readPackageJson } from "./source-text.js";
23
+ import {
24
+ CODE_ROUTED_NOTE,
25
+ ROUTER_SEED_DESTS,
26
+ SHELL_LESS_NOTE,
27
+ START_PROVIDER_HINT,
28
+ routerSeedDest,
29
+ routerSeedDests,
30
+ routerSeedSkip
31
+ } from "./router-wiring.js";
32
+ import { hasDependency, parseJsonc, readIfExists, readPackageJson, stripJsonc } from "./source-text.js";
25
33
  import { fontsCss, normalizeColorFunctions, tokensCss } from "./tokens-css.js";
26
34
  import { DEFAULT_ROOT, exemptRulePaths, resolveRoots } from "./config.js";
27
35
  const GUARD_PASSTHROUGH = {
@@ -333,20 +341,6 @@ function isAgentsImportLine(line) {
333
341
  function importsAgentsMd(text) {
334
342
  return text.split(/\r?\n/).some(isAgentsImportLine);
335
343
  }
336
- const ROUTER_SEED_DESTS = {
337
- nav: "src/lib/nav.tsx",
338
- root: "src/routes/__root.tsx",
339
- main: "src/main.tsx"
340
- };
341
- function routerSeedDest(appRel, seed) {
342
- return appRel === "" ? ROUTER_SEED_DESTS[seed] : `${appRel}/${ROUTER_SEED_DESTS[seed]}`;
343
- }
344
- function routerSeedDests(appRel) {
345
- return Object.keys(ROUTER_SEED_DESTS).map(
346
- (seed) => routerSeedDest(appRel, seed)
347
- );
348
- }
349
- const START_PROVIDER_HINT = "render <BasaltProvider><Outlet /></BasaltProvider> in the root route component or a pathless layout";
350
344
  const START_APP_NOTE = `TanStack Start app \u2014 no main.tsx/nav.tsx/__root.tsx seeded (Start owns the router); ${START_PROVIDER_HINT}.`;
351
345
  function routerSeedPlan(cwd, appRel, tokensOnly = false) {
352
346
  const detected = tokensOnly ? null : routerSeedSkip(cwd, appRel);
@@ -746,38 +740,6 @@ function rootsNotices(state) {
746
740
  error: []
747
741
  };
748
742
  }
749
- function stripJsonc(text) {
750
- let out = "";
751
- let inString = false;
752
- for (let i = 0; i < text.length; i++) {
753
- const ch = text[i];
754
- if (inString) {
755
- out += ch;
756
- if (ch === "\\") out += text[++i] ?? "";
757
- else if (ch === '"') inString = false;
758
- continue;
759
- }
760
- if (ch === '"') inString = true;
761
- else if (ch === "/" && text[i + 1] === "/") {
762
- while (i < text.length && text[i] !== "\n") i++;
763
- continue;
764
- } else if (ch === "/" && text[i + 1] === "*") {
765
- i += 2;
766
- while (i < text.length && !(text[i] === "*" && text[i + 1] === "/")) i++;
767
- i++;
768
- continue;
769
- }
770
- out += ch;
771
- }
772
- return out.replace(/,(\s*[}\]])/g, "$1");
773
- }
774
- function parseJsonc(text) {
775
- try {
776
- return JSON.parse(stripJsonc(text.replace(/^\uFEFF/, "")));
777
- } catch {
778
- return null;
779
- }
780
- }
781
743
  const OXLINT_FILES = {
782
744
  preset: "configs/oxlint.json",
783
745
  guards: "configs/oxlint-basalt.json",
@@ -1013,7 +975,6 @@ export {
1013
975
  noteRelocation,
1014
976
  oxlintBinResolves,
1015
977
  packageRoot,
1016
- parseJsonc,
1017
978
  patchPackageJson,
1018
979
  placementNotices,
1019
980
  pruneRetiredManagedFiles,
@@ -0,0 +1,12 @@
1
+ export type ProviderTag = {
2
+ attrs: string;
3
+ spread: boolean;
4
+ };
5
+ /**
6
+ * Every `<BasaltProvider …>` opening tag in a root route: its attribute text at JSX brace depth 0,
7
+ * with string literals skipped (so `className="a > b"` cannot end the tag, nor `"router="` count),
8
+ * and whether a `{...spread}` could carry a `router`.
9
+ */
10
+ export declare function providerTags(src: string): ProviderTag[];
11
+ export declare const carriesRouter: (tag: ProviderTag) => boolean;
12
+ //# sourceMappingURL=provider-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-tags.d.ts","sourceRoot":"","sources":["../../src/cli/provider-tags.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5D;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,EAAE,CAkBvD;AAED,eAAO,MAAM,aAAa,GAAI,KAAK,WAAW,KAAG,OAA6C,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { tokenize } from "./source-text.js";
2
+ function isSpreadAt(code, i) {
3
+ const spread = /\{\s*\.\.\./y;
4
+ spread.lastIndex = i;
5
+ return spread.test(code);
6
+ }
7
+ function providerTags(src) {
8
+ const { code, inLiteral } = tokenize(src);
9
+ return [...code.matchAll(/<BasaltProvider\b/g)].filter((m) => !inLiteral(m.index)).map((m) => {
10
+ const tag = { attrs: "", spread: false };
11
+ let depth = 0;
12
+ for (let i = m.index + m[0].length; i < code.length; i++) {
13
+ const ch = code[i];
14
+ if (inLiteral(i)) continue;
15
+ if (ch === "{") {
16
+ if (depth++ === 0 && isSpreadAt(code, i)) tag.spread = true;
17
+ } else if (ch === "}") depth--;
18
+ else if (ch === ">" && depth === 0) break;
19
+ else if (depth === 0) tag.attrs += ch;
20
+ }
21
+ return tag;
22
+ });
23
+ }
24
+ const carriesRouter = (tag) => /(^|\s)router\s*=/.test(tag.attrs);
25
+ export {
26
+ carriesRouter,
27
+ providerTags
28
+ };
@@ -0,0 +1,24 @@
1
+ import type { ProviderTag } from './provider-tags.js';
2
+ export type ModuleFile = {
3
+ file: string;
4
+ text: string | null;
5
+ tags: ProviderTag[];
6
+ };
7
+ /** One read path for every module in the walk; `text` is null for a missing file. */
8
+ export declare function loadModule(cwd: string, file: string): ModuleFile;
9
+ type Alias = [prefix: string, dir: string];
10
+ /** tsconfig `compilerOptions.paths` single-wildcard `alias/*` entries; a malformed shape is no alias. */
11
+ export declare function pathAliases(cwd: string): Alias[];
12
+ /** The local modules `file` renders a component from: `<Name` in JSX, name imported from a relative or aliased specifier. */
13
+ export declare function renderedImports(cwd: string, file: string, text: string, aliases: Alias[]): string[];
14
+ /**
15
+ * `hops`: one entry per render EDGE (scanned file -> rendered module holding a provider tag), so the
16
+ * same wrapper rendered from two route files counts twice. `far`: provider-holding modules one more hop out, which doctor does not follow but
17
+ * names (the one-provider invariant and the failure message both need them).
18
+ */
19
+ export declare function followProviderHops(cwd: string, scanned: ModuleFile[]): {
20
+ hops: ModuleFile[];
21
+ far: string[];
22
+ };
23
+ export {};
24
+ //# sourceMappingURL=render-imports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-imports.d.ts","sourceRoot":"","sources":["../../src/cli/render-imports.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,CAAA;AAEnF,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAGhE;AAID,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;AAE1C,yGAAyG;AACzG,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAWhD;AASD,6HAA6H;AAC7H,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,KAAK,EAAE,GACf,MAAM,EAAE,CAqBV;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,UAAU,EAAE,GACpB;IAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAsBvC"}
@@ -0,0 +1,74 @@
1
+ import { dirname, relative, resolve } from "node:path";
2
+ import { providerTags } from "./provider-tags.js";
3
+ import { parseJsonc, readIfExists, tokenize } from "./source-text.js";
4
+ function loadModule(cwd, file) {
5
+ const text = readIfExists(resolve(cwd, file));
6
+ return { file, text, tags: providerTags(text ?? "") };
7
+ }
8
+ const MODULE_SUFFIXES = [".tsx", ".ts", ".jsx", ".js", "/index.tsx", "/index.ts"];
9
+ function pathAliases(cwd) {
10
+ const opts = parseJsonc(readIfExists(resolve(cwd, "tsconfig.json")) ?? "")?.["compilerOptions"];
11
+ if (typeof opts !== "object" || opts === null) return [];
12
+ const { baseUrl, paths } = opts;
13
+ if (typeof paths !== "object" || paths === null || Array.isArray(paths)) return [];
14
+ const base = typeof baseUrl === "string" ? baseUrl : ".";
15
+ return Object.entries(paths).flatMap(([pattern, targets]) => {
16
+ const target = Array.isArray(targets) ? targets[0] : void 0;
17
+ if (!pattern.endsWith("/*") || typeof target !== "string" || !target.endsWith("/*")) return [];
18
+ return [[pattern.slice(0, -1), `${base}/${target.slice(0, -1)}`]];
19
+ });
20
+ }
21
+ const aliasedBase = (cwd, spec, aliases) => {
22
+ const hit = aliases.find(([prefix]) => spec.startsWith(prefix));
23
+ return hit === void 0 ? void 0 : resolve(cwd, hit[1] + spec.slice(hit[0].length));
24
+ };
25
+ const escapeRegex = (name) => name.replaceAll("$", String.raw`\$`);
26
+ function renderedImports(cwd, file, text, aliases) {
27
+ const { code, inLiteral } = tokenize(text);
28
+ const found = /* @__PURE__ */ new Set();
29
+ for (const m of code.matchAll(/\bimport\s+(?!type\b)([^'"]*?)\s*from\s*['"]([^'"]+)['"]/g)) {
30
+ if (inLiteral(m.index)) continue;
31
+ const spec = m[2].replace(/\.[jt]sx?$/, "");
32
+ const base = spec.startsWith(".") ? resolve(cwd, dirname(file), spec) : aliasedBase(cwd, spec, aliases);
33
+ if (base === void 0) continue;
34
+ const names = [...m[1].replace(/\btype\s+/g, "").matchAll(/[A-Za-z_$][\w$]*/g)].map(
35
+ (n) => n[0]
36
+ );
37
+ if (!names.some((n) => new RegExp(`<${escapeRegex(n)}\\b`).test(code))) continue;
38
+ const rel = relative(cwd, base).split("\\").join("/");
39
+ const hit = MODULE_SUFFIXES.map((x) => rel + x).find(
40
+ (c) => readIfExists(resolve(cwd, c)) !== null
41
+ );
42
+ if (hit !== void 0) found.add(hit);
43
+ }
44
+ return [...found];
45
+ }
46
+ function followProviderHops(cwd, scanned) {
47
+ const aliases = pathAliases(cwd);
48
+ const modules = new Map(scanned.map((f) => [f.file, f]));
49
+ const load = (file) => {
50
+ const known = modules.get(file) ?? loadModule(cwd, file);
51
+ modules.set(file, known);
52
+ return known;
53
+ };
54
+ const hops = [];
55
+ const far = /* @__PURE__ */ new Set();
56
+ for (const f of scanned) {
57
+ for (const mod of renderedImports(cwd, f.file, f.text ?? "", aliases)) {
58
+ if (scanned.some((s) => s.file === mod)) continue;
59
+ const hop = load(mod);
60
+ if (hop.tags.length > 0) hops.push(hop);
61
+ for (const next of renderedImports(cwd, mod, hop.text ?? "", aliases)) {
62
+ if (!scanned.some((s) => s.file === next) && load(next).tags.length > 0) far.add(next);
63
+ }
64
+ }
65
+ }
66
+ const nearFiles = new Set(hops.map((h) => h.file));
67
+ return { hops, far: [...far].filter((f) => !nearFiles.has(f)) };
68
+ }
69
+ export {
70
+ followProviderHops,
71
+ loadModule,
72
+ pathAliases,
73
+ renderedImports
74
+ };
@@ -35,5 +35,17 @@ export declare const CODE_ROUTED_NOTE = "code-routed app (createBasaltRouter, no
35
35
  */
36
36
  export declare function routerSeedSkip(cwd: string, appRel: string): RouterSeedSkip;
37
37
  export declare const SHELL_LESS_NOTE = "`basalt.shell: false` \u2014 no main.tsx/nav.tsx/__root.tsx seeded; the app owns its root route (or has none).";
38
+ /** The router seeds (TanStack Router and Query are required peers of `.`, so they are always written). */
39
+ export declare const ROUTER_SEED_DESTS: {
40
+ readonly nav: "src/lib/nav.tsx";
41
+ readonly root: "src/routes/__root.tsx";
42
+ readonly main: "src/main.tsx";
43
+ };
44
+ /** A router seed's dest, relative to the install root: under the app dir when it is not the root. */
45
+ export declare function routerSeedDest(appRel: string, seed: keyof typeof ROUTER_SEED_DESTS): string;
46
+ /** The router seeds' dests for an app dir (`main.tsx`, `nav.tsx`, `__root.tsx`). */
47
+ export declare function routerSeedDests(appRel: string): string[];
48
+ /** Where a Start app's embedded provider goes (doctor, init and sync all say it). */
49
+ export declare const START_PROVIDER_HINT = "render <BasaltProvider><Outlet /></BasaltProvider> in the root route component or a pathless layout";
38
50
  export {};
39
51
  //# sourceMappingURL=router-wiring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router-wiring.d.ts","sourceRoot":"","sources":["../../src/cli/router-wiring.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+B,QAAQ,EAAE,MAAM,eAAe,CAAA;AAuErE,oGAAoG;AACpG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEzC;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAqBT;AAED,wHAAwH;AACxH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9C;AAID,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAErD;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQhE;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,C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AE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAEnF;AAOD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAMpE;AAED,2GAA2G;AAC3G,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,CAAA;AAE1E,eAAO,MAAM,gBAAgB,8HAC2F,CAAA;AAExH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CAG1E;AAED,eAAO,MAAM,eAAe,mHACiF,CAAA;AAE7G,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAA;AAEV,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,iBAAiB,GAAG,MAAM,CAE3F;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAIxD;AAED,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,wGACuE,CAAA"}
@@ -103,9 +103,25 @@ function routerSeedSkip(cwd, appRel) {
103
103
  return isCodeRoutedApp(cwd, appRel) ? "code-routed" : null;
104
104
  }
105
105
  const SHELL_LESS_NOTE = "`basalt.shell: false` \u2014 no main.tsx/nav.tsx/__root.tsx seeded; the app owns its root route (or has none).";
106
+ const ROUTER_SEED_DESTS = {
107
+ nav: "src/lib/nav.tsx",
108
+ root: "src/routes/__root.tsx",
109
+ main: "src/main.tsx"
110
+ };
111
+ function routerSeedDest(appRel, seed) {
112
+ return appRel === "" ? ROUTER_SEED_DESTS[seed] : `${appRel}/${ROUTER_SEED_DESTS[seed]}`;
113
+ }
114
+ function routerSeedDests(appRel) {
115
+ return Object.keys(ROUTER_SEED_DESTS).map(
116
+ (seed) => routerSeedDest(appRel, seed)
117
+ );
118
+ }
119
+ const START_PROVIDER_HINT = "render <BasaltProvider><Outlet /></BasaltProvider> in the root route component or a pathless layout";
106
120
  export {
107
121
  CODE_ROUTED_NOTE,
122
+ ROUTER_SEED_DESTS,
108
123
  SHELL_LESS_NOTE,
124
+ START_PROVIDER_HINT,
109
125
  appEntry,
110
126
  callOf,
111
127
  callsIn,
@@ -114,5 +130,7 @@ export {
114
130
  isCodeRoutedApp,
115
131
  isStartApp,
116
132
  routeTreeDirs,
133
+ routerSeedDest,
134
+ routerSeedDests,
117
135
  routerSeedSkip
118
136
  };
@@ -9,4 +9,11 @@ export declare function tokenize(src: string): {
9
9
  code: string;
10
10
  inLiteral: (at: number) => boolean;
11
11
  };
12
+ /**
13
+ * Strip JSONC comments and trailing commas so oxlint/tsconfig files can be READ (string-aware). A
14
+ * mangled string fails as a parse error, which callers treat as "cannot tell", never as a pass.
15
+ */
16
+ export declare function stripJsonc(text: string): string;
17
+ /** Parse a JSONC document, or null when it does not parse at all. */
18
+ export declare function parseJsonc(text: string): Record<string, unknown> | null;
12
19
  //# sourceMappingURL=source-text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-text.d.ts","sourceRoot":"","sources":["../../src/cli/source-text.ts"],"names":[],"mappings":"AAOA,uGAAuG;AACvG,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMvD;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAOxD;AAID,8GAA8G;AAC9G,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAMnE;AAUD,uGAAuG;AACvG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CAAE,CAe1F"}
1
+ {"version":3,"file":"source-text.d.ts","sourceRoot":"","sources":["../../src/cli/source-text.ts"],"names":[],"mappings":"AAOA,uGAAuG;AACvG,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMvD;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAOxD;AAID,8GAA8G;AAC9G,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAMnE;AAUD,uGAAuG;AACvG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CAAE,CAe1F;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAwB/C;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMvE"}
@@ -38,9 +38,43 @@ function tokenize(src) {
38
38
  });
39
39
  return { code, inLiteral: (at) => literals.some(([from, to]) => at >= from && at < to) };
40
40
  }
41
+ function stripJsonc(text) {
42
+ let out = "";
43
+ let inString = false;
44
+ for (let i = 0; i < text.length; i++) {
45
+ const ch = text[i];
46
+ if (inString) {
47
+ out += ch;
48
+ if (ch === "\\") out += text[++i] ?? "";
49
+ else if (ch === '"') inString = false;
50
+ continue;
51
+ }
52
+ if (ch === '"') inString = true;
53
+ else if (ch === "/" && text[i + 1] === "/") {
54
+ while (i < text.length && text[i] !== "\n") i++;
55
+ continue;
56
+ } else if (ch === "/" && text[i + 1] === "*") {
57
+ i += 2;
58
+ while (i < text.length && !(text[i] === "*" && text[i + 1] === "/")) i++;
59
+ i++;
60
+ continue;
61
+ }
62
+ out += ch;
63
+ }
64
+ return out.replace(/,(\s*[}\]])/g, "$1");
65
+ }
66
+ function parseJsonc(text) {
67
+ try {
68
+ return JSON.parse(stripJsonc(text.replace(/^\uFEFF/, "")));
69
+ } catch {
70
+ return null;
71
+ }
72
+ }
41
73
  export {
42
74
  hasDependency,
75
+ parseJsonc,
43
76
  readIfExists,
44
77
  readPackageJson,
78
+ stripJsonc,
45
79
  tokenize
46
80
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AA6CA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mGAAmG;IACnG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,EAAE,aAAa,GAAE,MAAsB,GAAG,MAAM,CAmP1F"}
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AA+CA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mGAAmG;IACnG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrF;AAQD;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,EAAE,aAAa,GAAE,MAAsB,GAAG,MAAM,CAiP1F"}
package/dist/cli/sync.js CHANGED
@@ -2,6 +2,7 @@ import { existsSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
3
  import { deriveSpacing } from "../tokens/core.js";
4
4
  import { shellConfigError } from "./config.js";
5
+ import { carriesRouter, providerTags } from "./provider-tags.js";
5
6
  import {
6
7
  MANIFEST_PATH,
7
8
  basaltPresetEntry,
@@ -16,7 +17,6 @@ import {
16
17
  normalizeForLedger,
17
18
  noteRelocation,
18
19
  OXLINT_FILES,
19
- parseJsonc,
20
20
  placementNotices,
21
21
  pruneRetiredManagedFiles,
22
22
  readBasaltConfig,
@@ -39,6 +39,7 @@ import {
39
39
  writeFileEnsuringDir,
40
40
  writeUnit
41
41
  } from "./index.js";
42
+ import { parseJsonc } from "./source-text.js";
42
43
  import { findManifestAbove, installRootAbove } from "./install-root.js";
43
44
  function readOxlintPresetPlugins(pkgRoot) {
44
45
  const plugins = parseJsonc(readSource(pkgRoot, OXLINT_FILES.preset) ?? "null")?.["plugins"];
@@ -47,6 +48,11 @@ function readOxlintPresetPlugins(pkgRoot) {
47
48
  function parentInstallAdvice(cwd, parent, verb) {
48
49
  return `This repo's install is at ${relativePosix(cwd, parent)} (${parent}) \u2014 run ${verb} there, or set BASALT_CWD to it.`;
49
50
  }
51
+ const RETIRED_BECAUSE = {
52
+ "code-routed": "code-routed app",
53
+ start: "TanStack Start app",
54
+ "shell-less": "basalt.shell: false"
55
+ };
50
56
  function sync(opts = {}, invocationCwd = process.cwd()) {
51
57
  const syncFlags = opts.flags ?? [];
52
58
  if (conflictingProfileFlags("sync", syncFlags)) return 1;
@@ -137,27 +143,26 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
137
143
  });
138
144
  staleForCheck += pruned.removed.length + pruned.drifted.length;
139
145
  const isTracked = (d) => manifest.files[d] !== void 0;
140
- const retiredBecause = seedSkip === "code-routed" ? "code-routed app" : seedSkip === "shell-less" ? "basalt.shell: false" : null;
146
+ const retiredBecause = seedSkip === null ? null : RETIRED_BECAUSE[seedSkip];
141
147
  const retiredSeeds = retiredBecause === null ? [] : [...skipped].filter(isTracked);
148
+ if (opts.check && seedSkip === "start" && retiredSeeds.length > 0) {
149
+ staleForCheck += retiredSeeds.length;
150
+ console.error(
151
+ `basalt-ui sync --check: ${retiredSeeds.join(", ")} still tracked in the manifest of a TanStack Start app. Fix: run \`basalt-ui sync\`.`
152
+ );
153
+ }
142
154
  if (retiredSeeds.length > 0 && !opts.check) {
143
155
  for (const d of retiredSeeds) delete manifest.files[d];
144
156
  console.error(
145
157
  `\u26A0 basalt-ui sync: ${retiredBecause} \u2014 dropped ${retiredSeeds.join(", ")} from the manifest (any file is yours).`
146
158
  );
147
159
  }
148
- const startSkippedSeeds = seedSkip === "start" ? [...skipped] : [];
149
- const stale = startSkippedSeeds.filter((d) => isTracked(d) && existsSync(resolve(cwd, d)));
150
- const mounting = stale.filter((d) => !d.endsWith("nav.tsx"));
151
- const inert = stale.filter((d) => d.endsWith("nav.tsx"));
152
- const embedded = `Delete them and ${START_PROVIDER_HINT} (embedded mode).`;
160
+ const mounting = seedSkip === "start" ? [...skipped].filter(
161
+ (d) => providerTags(readIfExists(resolve(cwd, d)) ?? "").some(carriesRouter)
162
+ ) : [];
153
163
  if (mounting.length > 0) {
154
164
  console.error(
155
- `\u26A0 basalt-ui sync: ${mounting.join(", ")} mount a second router inside this TanStack Start app; left untouched. ${embedded}`
156
- );
157
- }
158
- if (inert.length > 0) {
159
- console.error(
160
- `\u26A0 basalt-ui sync: ${inert.join(", ")} was seeded before this became a Start app; it mounts nothing, so keep or delete it. Left untouched.`
165
+ `\u26A0 basalt-ui sync: ${mounting.join(", ")} mount a second router inside this TanStack Start app; left untouched. Delete them and ${START_PROVIDER_HINT} (embedded mode).`
161
166
  );
162
167
  }
163
168
  if (seedSkip === "start" && (!opts.check || syncFlags.includes("--verbose")))
@@ -0,0 +1,3 @@
1
+ /** The fix a provider-free page needs beside `tokens:css`; one spelling for the guard and `doctor`. */
2
+ export declare const FONTS_CSS_HINT = "provider-free page: `basalt-ui fonts:css --out src/fonts.css`";
3
+ //# sourceMappingURL=fonts-hint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts-hint.d.ts","sourceRoot":"","sources":["../../src/guard/fonts-hint.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,eAAO,MAAM,cAAc,kEAAkE,CAAA"}
@@ -0,0 +1,4 @@
1
+ const FONTS_CSS_HINT = "provider-free page: `basalt-ui fonts:css --out src/fonts.css`";
2
+ export {
3
+ FONTS_CSS_HINT
4
+ };
@@ -174,7 +174,7 @@ export declare const GUARD_RULES: {
174
174
  readonly 'raw-font-family': {
175
175
  readonly kind: "raw-font-family";
176
176
  readonly pattern: RegExp;
177
- readonly message: "Route the font stack through createBasaltTheme(overrides, { fonts }) / the shipped --basalt-font-sans|head|mono vars instead of a hardcoded fontFamily literal.";
177
+ readonly message: "Route the font stack through createBasaltTheme(overrides, { fonts }) / the shipped --basalt-font-sans|head|mono vars instead of a hardcoded fontFamily literal (provider-free page: `basalt-ui fonts:css --out src/fonts.css`).";
178
178
  };
179
179
  readonly 'off-identity-accent': {
180
180
  readonly kind: "off-identity-accent";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS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M,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAM9F"}
@@ -1,5 +1,6 @@
1
1
  import { vxFamilyOf } from "../common/vx-family.js";
2
2
  import { BASALT_VX_FAMILIES } from "../common/vx-families.js";
3
+ import { FONTS_CSS_HINT } from "./fonts-hint.js";
3
4
  import { BASALT_VX_NAMES } from "./vx-names.js";
4
5
  const HEX = /#(?!(?<=&#)\d+;)[0-9a-fA-F]{3,8}\b/g;
5
6
  const FUNC = /\b(?:rgba?|hsla?)\((?!\s*\$\{)/g;
@@ -748,7 +749,7 @@ const GUARD_RULES = {
748
749
  "raw-font-family": {
749
750
  kind: "raw-font-family",
750
751
  pattern: RAW_FONT_FAMILY,
751
- message: "Route the font stack through createBasaltTheme(overrides, { fonts }) / the shipped --basalt-font-sans|head|mono vars instead of a hardcoded fontFamily literal."
752
+ message: `Route the font stack through createBasaltTheme(overrides, { fonts }) / the shipped --basalt-font-sans|head|mono vars instead of a hardcoded fontFamily literal (${FONTS_CSS_HINT}).`
752
753
  },
753
754
  "off-identity-accent": {
754
755
  kind: "off-identity-accent",
package/dist/index.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * `@mantine/*`. One import path per symbol: `docs/V2-SPEC.md` § 1; the per-symbol verdicts are
6
6
  * `docs/waves/v2-surface.md`.
7
7
  */
8
- export { BasaltProvider } from './provider/index.js';
9
- export { createBasaltRouter, type BasaltRouter, type BasaltRouterContext, } from './provider/create-router.js';
8
+ export { BasaltProvider, type BasaltProviderProps } from './provider/index.js';
9
+ export { basaltRouterOptions, createBasaltRouter, type BasaltRouter, type BasaltRouterOptions, type BasaltRouterContext, } from './provider/create-router.js';
10
10
  export type { BasaltEvent, ChatTurnEnd, ChatTurnTrace, Telemetry, TraceHeaders } from './telemetry.js';
11
11
  export { defineNav, navGroup, navTarget, flattenNav, useBasaltNav, type NavItemId, } from './router-tanstack/index.js';
12
12
  export { scrollParentOf, useCoarsePointer, type Tone } from './common/index.js';
@@ -14,6 +14,6 @@ export { createBasaltTheme } from './theme/index.js';
14
14
  export { ThemeToggle } from './theme/theme-toggle.js';
15
15
  export { BasaltShell, PageBar, PageAside, useSizeClass, PageTitle, type ShellBaseProps, type SidebarBlock, type SettingsMenuItem, } from './shell/index.js';
16
16
  export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, EmptyState, SettingsSection, SettingsRow, DangerZone, } from './dashboard/index.js';
17
- export { unwrap } from './query-client.js';
17
+ export { unwrap } from './unwrap.js';
18
18
  export type { BasaltRegister, SeriesKey } from './register.js';
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACnG,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,YAAY,EACZ,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,OAAO,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AAA;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAMjC,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { BasaltProvider } from "./provider/index.js";
2
2
  import {
3
+ basaltRouterOptions,
3
4
  createBasaltRouter
4
5
  } from "./provider/create-router.js";
5
6
  import {
@@ -30,7 +31,7 @@ import {
30
31
  SettingsRow,
31
32
  DangerZone
32
33
  } from "./dashboard/index.js";
33
- import { unwrap } from "./query-client.js";
34
+ import { unwrap } from "./unwrap.js";
34
35
  export {
35
36
  BasaltProvider,
36
37
  BasaltShell,
@@ -47,6 +48,7 @@ export {
47
48
  StatGroup,
48
49
  ThemeToggle,
49
50
  WidgetHeader,
51
+ basaltRouterOptions,
50
52
  createBasaltRouter,
51
53
  createBasaltTheme,
52
54
  defineNav,