basalt-ui 2.8.0 → 2.9.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 +2 -2
- package/CHANGELOG.md +209 -189
- package/MIGRATING.md +98 -28
- package/README.md +7 -8
- package/agent/rules/basalt-controls.md +1 -1
- package/agent/rules/basalt-state.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/templates/AGENTS-block.md.tpl +2 -2
- package/configs/oxlint-plugin.js +25 -68
- package/configs/oxlint-plugin.test.ts +19 -27
- package/dist/charts/BandStrip.d.ts +1 -1
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +1 -10
- package/dist/charts/MirroredBars.d.ts.map +1 -1
- package/dist/charts/MirroredBars.js +2 -9
- package/dist/charts/band-fold.d.ts +15 -0
- package/dist/charts/band-fold.d.ts.map +1 -0
- package/dist/charts/band-fold.js +19 -0
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +3 -1
- package/dist/cli/audit-allows.d.ts.map +1 -1
- package/dist/cli/audit-allows.js +1 -1
- package/dist/cli/check-theme.d.ts.map +1 -1
- package/dist/cli/check-theme.js +4 -1
- package/dist/cli/config.d.ts +4 -4
- package/dist/cli/doctor-upgrade.d.ts +5 -4
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +23 -99
- package/dist/cli/doctor.d.ts +2 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +23 -25
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +2 -3
- package/dist/cli/index.d.ts +15 -6
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +16 -27
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +9 -6
- package/dist/cli/install-root.d.ts +10 -0
- package/dist/cli/install-root.d.ts.map +1 -0
- package/dist/cli/install-root.js +32 -0
- package/dist/cli/router-wiring.d.ts +37 -0
- package/dist/cli/router-wiring.d.ts.map +1 -0
- package/dist/cli/router-wiring.js +116 -0
- package/dist/cli/source-text.d.ts +12 -0
- package/dist/cli/source-text.d.ts.map +1 -0
- package/dist/cli/source-text.js +46 -0
- package/dist/cli/sync.d.ts +0 -2
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +23 -21
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +1 -6
- package/dist/common/errors.d.ts +1 -6
- package/dist/common/errors.d.ts.map +1 -1
- package/dist/common/errors.js +0 -7
- package/dist/common/index.d.ts +1 -1
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -9
- package/dist/common/props.d.ts +2 -2
- package/dist/common/vx-family.d.ts +1 -1
- package/dist/content/code-block.d.ts.map +1 -1
- package/dist/content/code-block.js +36 -27
- package/dist/content/code-block.module.css +19 -1
- package/dist/content/mermaid-sanitize.d.ts +15 -0
- package/dist/content/mermaid-sanitize.d.ts.map +1 -0
- package/dist/content/mermaid-sanitize.js +28 -0
- package/dist/content/mermaid.d.ts +6 -0
- package/dist/content/mermaid.d.ts.map +1 -1
- package/dist/content/mermaid.js +3 -1
- package/dist/content/toc-click-pin.d.ts +45 -0
- package/dist/content/toc-click-pin.d.ts.map +1 -0
- package/dist/content/toc-click-pin.js +111 -0
- package/dist/content/toc-spy.d.ts +25 -0
- package/dist/content/toc-spy.d.ts.map +1 -0
- package/dist/content/toc-spy.js +43 -0
- package/dist/content/toc.d.ts +1 -4
- package/dist/content/toc.d.ts.map +1 -1
- package/dist/content/toc.js +38 -49
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +1 -1
- package/dist/dashboard/index.d.ts +1 -1
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -3
- package/dist/dashboard/section.d.ts +10 -2
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +20 -3
- package/dist/dashboard/stat-card.d.ts +2 -8
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +1 -1
- package/dist/guard/index.d.ts +13 -9
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +74 -37
- package/dist/guard/types.d.ts +8 -7
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/guard/vx-names.d.ts +1 -1
- package/dist/guard/vx-names.d.ts.map +1 -1
- package/dist/guard/vx-names.js +1 -33
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +3 -2
- package/dist/router-tanstack/search-store.d.ts +1 -11
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/search-store.js +1 -2
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +3 -0
- package/dist/shell/nav-types.d.ts +1 -1
- package/dist/shell/page-bar.d.ts +6 -0
- package/dist/shell/page-bar.d.ts.map +1 -1
- package/dist/shell/page-bar.js +12 -2
- package/dist/state/fields.d.ts +1 -1
- package/dist/state/fields.d.ts.map +1 -1
- package/dist/state/fields.js +3 -1
- package/dist/surfaces.d.ts +1 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +5 -11
- package/dist/table/data-table.d.ts +2 -2
- package/dist/tokens/core.d.ts +0 -10
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +6 -44
- package/dist/vite-boot.d.ts +25 -0
- package/dist/vite-boot.d.ts.map +1 -0
- package/dist/vite-boot.js +36 -0
- package/dist/vite.d.ts +24 -3
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +7 -16
- package/llms.txt +26 -9
- package/package.json +8 -5
- package/src/charts/BandStrip.tsx +4 -16
- package/src/charts/MirroredBars.tsx +2 -11
- package/src/charts/band-fold.ts +26 -0
- package/src/charts/index.ts +1 -0
- package/src/cli/audit-allows.ts +1 -3
- package/src/cli/check-theme.ts +7 -1
- package/src/cli/config.ts +4 -4
- package/src/cli/doctor-upgrade.ts +29 -145
- package/src/cli/doctor.ts +25 -31
- package/src/cli/help.ts +1 -4
- package/src/cli/index.ts +27 -43
- package/src/cli/init.ts +9 -6
- package/src/cli/install-root.ts +40 -0
- package/src/cli/router-wiring.ts +185 -0
- package/src/cli/source-text.ts +62 -0
- package/src/cli/sync.ts +26 -22
- package/src/cli/tokens-css.ts +0 -5
- package/src/common/errors.ts +1 -18
- package/src/common/index.ts +1 -8
- package/src/common/props.ts +2 -2
- package/src/common/vx-family.ts +1 -1
- package/src/content/code-block.module.css +19 -1
- package/src/content/code-block.tsx +7 -2
- package/src/content/mermaid-sanitize.ts +49 -0
- package/src/content/mermaid.tsx +3 -2
- package/src/content/toc-click-pin.ts +156 -0
- package/src/content/toc-spy.ts +61 -0
- package/src/content/toc.tsx +47 -95
- package/src/controls/form-layout.tsx +1 -1
- package/src/controls/number-filter.tsx +6 -1
- package/src/dashboard/index.ts +1 -6
- package/src/dashboard/section.tsx +39 -8
- package/src/dashboard/stat-card.tsx +4 -11
- package/src/guard/index.ts +114 -89
- package/src/guard/types.ts +8 -7
- package/src/guard/vx-names.ts +1 -33
- package/src/index.ts +1 -2
- package/src/provider/index.tsx +6 -3
- package/src/router-tanstack/search-store.ts +2 -14
- package/src/shell/index.tsx +2 -0
- package/src/shell/nav-types.ts +1 -1
- package/src/shell/page-bar.tsx +21 -2
- package/src/state/fields.ts +7 -2
- package/src/surfaces.ts +5 -11
- package/src/table/data-table.tsx +2 -2
- package/src/tokens/core.ts +6 -67
- package/src/vite-boot.ts +109 -0
- package/src/vite.ts +32 -61
- package/dist/tokens.css +0 -331
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":"
|
|
1
|
+
{"version":3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;AAE1D,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAuBlE;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAiCnF;AAQD;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,aAAa,CAAA;AAsIvD,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,EAAE,CAE/D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4DzF;AAGD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAA;AAClC,YAAY,EAAE,WAAW,EAAE,CAAA;AAI3B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,uBAAuB,EAAE,SAAS,EAAE,CAAA;AAClG,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
existsSync,
|
|
5
5
|
mkdirSync,
|
|
6
6
|
readdirSync,
|
|
7
|
-
readFileSync,
|
|
8
7
|
rmdirSync,
|
|
9
8
|
statSync,
|
|
10
9
|
realpathSync,
|
|
@@ -21,6 +20,8 @@ import { guardHook } from "./guard-hook.js";
|
|
|
21
20
|
import { COMMAND_OPTIONS, USAGE, unknownFlag } from "./help.js";
|
|
22
21
|
import { init } from "./init.js";
|
|
23
22
|
import { sync } from "./sync.js";
|
|
23
|
+
import { CODE_ROUTED_NOTE, routerSeedSkip } from "./router-wiring.js";
|
|
24
|
+
import { hasDependency, readIfExists, readPackageJson } from "./source-text.js";
|
|
24
25
|
import { fontsCss, normalizeColorFunctions, tokensCss } from "./tokens-css.js";
|
|
25
26
|
import { DEFAULT_ROOT, exemptRulePaths, resolveRoots } from "./config.js";
|
|
26
27
|
const GUARD_PASSTHROUGH = {
|
|
@@ -224,21 +225,6 @@ const LEGACY_BLOCK_HOST = "CLAUDE.md";
|
|
|
224
225
|
function sha256(text) {
|
|
225
226
|
return createHash("sha256").update(text, "utf8").digest("hex");
|
|
226
227
|
}
|
|
227
|
-
function readIfExists(abs) {
|
|
228
|
-
try {
|
|
229
|
-
return readFileSync(abs, "utf8");
|
|
230
|
-
} catch {
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
function readPackageJson(dir) {
|
|
235
|
-
const raw = readIfExists(resolve(dir, "package.json"));
|
|
236
|
-
try {
|
|
237
|
-
return raw === null ? null : JSON.parse(raw);
|
|
238
|
-
} catch {
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
228
|
function readSource(pkgRoot, source) {
|
|
243
229
|
return readIfExists(resolve(pkgRoot, source));
|
|
244
230
|
}
|
|
@@ -360,10 +346,15 @@ function routerSeedDests(appRel) {
|
|
|
360
346
|
(seed) => routerSeedDest(appRel, seed)
|
|
361
347
|
);
|
|
362
348
|
}
|
|
363
|
-
function isStartApp(cwd, appRel) {
|
|
364
|
-
return hasDependency(resolve(cwd, appRel), "@tanstack/react-start");
|
|
365
|
-
}
|
|
366
349
|
const START_APP_NOTE = "TanStack Start app \u2014 no main.tsx/nav.tsx/__root.tsx seeded (Start owns the router); render <BasaltProvider><Outlet /></BasaltProvider> in your root route component.";
|
|
350
|
+
function routerSeedPlan(cwd, appRel, tokensOnly = false) {
|
|
351
|
+
const skip = tokensOnly ? null : routerSeedSkip(cwd, appRel);
|
|
352
|
+
return { skip, skipped: new Set(tokensOnly || skip !== null ? routerSeedDests(appRel) : []) };
|
|
353
|
+
}
|
|
354
|
+
function seedSkipNote(skip) {
|
|
355
|
+
if (skip === "start") return START_APP_NOTE;
|
|
356
|
+
return skip === "code-routed" ? CODE_ROUTED_NOTE : null;
|
|
357
|
+
}
|
|
367
358
|
const appRelative = (root, dir) => relativePosix(root, dir).replace(/^\.\/?/, "");
|
|
368
359
|
const hasViteEntry = (dir) => existsSync(resolve(dir, "src/main.tsx")) || existsSync(resolve(dir, "index.html"));
|
|
369
360
|
function resolveAppDir(root) {
|
|
@@ -392,12 +383,6 @@ function resolveAppDir(root) {
|
|
|
392
383
|
error: `${candidates.length} workspace packages depend on basalt-ui and have a Vite entry (${names}) \u2014 cannot tell which is the app. Set \`basalt.app\` (e.g. \`"basalt": { "app": "apps/web" }\`) in the root package.json.`
|
|
393
384
|
};
|
|
394
385
|
}
|
|
395
|
-
function hasDependency(cwd, pkgName) {
|
|
396
|
-
const pkg = readPackageJson(cwd);
|
|
397
|
-
return Boolean(
|
|
398
|
-
pkg?.dependencies?.[pkgName] ?? pkg?.devDependencies?.[pkgName] ?? pkg?.peerDependencies?.[pkgName]
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
386
|
const ROOT_PLACEMENT = {
|
|
402
387
|
isPackageRepoRoot: true,
|
|
403
388
|
repoRoot: "",
|
|
@@ -979,6 +964,8 @@ function run(argv, cwd = process.cwd()) {
|
|
|
979
964
|
return 1;
|
|
980
965
|
}
|
|
981
966
|
}
|
|
967
|
+
import { isStartApp } from "./router-wiring.js";
|
|
968
|
+
import { readIfExists as readIfExists2, readPackageJson as readPackageJson2 } from "./source-text.js";
|
|
982
969
|
export {
|
|
983
970
|
AGENTS_MD,
|
|
984
971
|
LEGACY_BLOCK_HOST,
|
|
@@ -1028,9 +1015,9 @@ export {
|
|
|
1028
1015
|
pruneRetiredManagedFiles,
|
|
1029
1016
|
readBasaltConfig,
|
|
1030
1017
|
readFrameworkVersion,
|
|
1031
|
-
readIfExists,
|
|
1018
|
+
readIfExists2 as readIfExists,
|
|
1032
1019
|
readManifest,
|
|
1033
|
-
readPackageJson,
|
|
1020
|
+
readPackageJson2 as readPackageJson,
|
|
1034
1021
|
readSource,
|
|
1035
1022
|
reconcileRoots,
|
|
1036
1023
|
relativePosix,
|
|
@@ -1044,10 +1031,12 @@ export {
|
|
|
1044
1031
|
rootsNotices,
|
|
1045
1032
|
routerSeedDest,
|
|
1046
1033
|
routerSeedDests,
|
|
1034
|
+
routerSeedPlan,
|
|
1047
1035
|
run,
|
|
1048
1036
|
sameFile,
|
|
1049
1037
|
scanBlock,
|
|
1050
1038
|
scannableFiles,
|
|
1039
|
+
seedSkipNote,
|
|
1051
1040
|
sha256,
|
|
1052
1041
|
shippedAssetPath,
|
|
1053
1042
|
sync,
|
package/dist/cli/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAA;AA6D7D,yGAAyG;AACzG,wBAAgB,IAAI,CAAC,GAAG,GAAE,MAAsB,EAAE,aAAa,GAAE,aAAkB,GAAG,MAAM,CA8L3F"}
|
package/dist/cli/init.js
CHANGED
|
@@ -4,9 +4,8 @@ import { deriveSpacing } from "../tokens/core.js";
|
|
|
4
4
|
import {
|
|
5
5
|
MANIFEST_PATH,
|
|
6
6
|
declaredProfile,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
START_APP_NOTE,
|
|
7
|
+
routerSeedPlan,
|
|
8
|
+
seedSkipNote,
|
|
10
9
|
readBasaltConfig,
|
|
11
10
|
findBasaltInstall,
|
|
12
11
|
managedFiles,
|
|
@@ -81,8 +80,11 @@ function init(cwd = process.cwd(), scaffoldFlags = {}) {
|
|
|
81
80
|
const manifest = readManifest(cwd);
|
|
82
81
|
const placement = resolvePlacement(cwd);
|
|
83
82
|
const tokensOnly = declaredProfile(readBasaltConfig(cwd), []) === "tokens-only";
|
|
84
|
-
const
|
|
85
|
-
|
|
83
|
+
const { skip: seedSkip, skipped: skippedSeeds } = routerSeedPlan(
|
|
84
|
+
cwd,
|
|
85
|
+
placement.appRel,
|
|
86
|
+
tokensOnly
|
|
87
|
+
);
|
|
86
88
|
const files = managedFiles(placement).filter((f) => !skippedSeeds.has(f.dest));
|
|
87
89
|
const writtenFiles = [];
|
|
88
90
|
const keptFiles = [];
|
|
@@ -136,7 +138,8 @@ Kept (already present \u2014 basalt did not touch them):`);
|
|
|
136
138
|
const tsconfigLine = tokensOnly ? null : seedTsconfigExtends(cwd);
|
|
137
139
|
if (tsconfigLine !== null) console.log(`basalt-ui init: ${tsconfigLine}`);
|
|
138
140
|
if (buildNote !== null) console.log(`basalt-ui init: ${buildNote}`);
|
|
139
|
-
|
|
141
|
+
const skipNote = seedSkipNote(seedSkip);
|
|
142
|
+
if (skipNote !== null) console.log(`basalt-ui init: ${skipNote}`);
|
|
140
143
|
const rootsMessages = rootsNotices(rootsState);
|
|
141
144
|
for (const line of rootsMessages.log) console.log(`basalt-ui init: ${line}`);
|
|
142
145
|
for (const line of rootsMessages.error) console.error(`\u26A0 basalt-ui init: ${line}`);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The nearest ANCESTOR of `dir` (exclusive) carrying a basalt manifest, or null. */
|
|
2
|
+
export declare function findManifestAbove(dir: string): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* The install root above `dir`, when `dir` is the APP package of that install: no manifest here,
|
|
5
|
+
* basalt-ui declared here, an ancestor manifest, `resolveAppDir(root)` naming `dir`, and the
|
|
6
|
+
* basalt-ui that resolves from `dir` the same copy (or version) the root uses. Anything else is
|
|
7
|
+
* null — a sub-package with its own basalt-ui is a competing install, not part of the root's.
|
|
8
|
+
*/
|
|
9
|
+
export declare function installRootAbove(dir: string): string | null;
|
|
10
|
+
//# sourceMappingURL=install-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-root.d.ts","sourceRoot":"","sources":["../../src/cli/install-root.ts"],"names":[],"mappings":"AAOA,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ5D;AAOD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU3D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { MANIFEST_PATH, findBasaltInstall, resolveAppDir } from "./index.js";
|
|
4
|
+
import { hasDependency } from "./source-text.js";
|
|
5
|
+
function findManifestAbove(dir) {
|
|
6
|
+
let current = resolve(dir, "..");
|
|
7
|
+
for (; ; ) {
|
|
8
|
+
if (existsSync(resolve(current, MANIFEST_PATH))) return current;
|
|
9
|
+
const parent = resolve(current, "..");
|
|
10
|
+
if (parent === current) return null;
|
|
11
|
+
current = parent;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function sameInstall(a, b) {
|
|
15
|
+
if (a === null || b === null) return false;
|
|
16
|
+
return a === b || realpathSync(a) === realpathSync(b);
|
|
17
|
+
}
|
|
18
|
+
function installRootAbove(dir) {
|
|
19
|
+
if (existsSync(resolve(dir, MANIFEST_PATH)) || !hasDependency(dir, "basalt-ui")) return null;
|
|
20
|
+
const root = findManifestAbove(dir);
|
|
21
|
+
if (root === null) return null;
|
|
22
|
+
const app = resolveAppDir(root);
|
|
23
|
+
if ("error" in app || app.dir !== dir) return null;
|
|
24
|
+
const here = findBasaltInstall(dir);
|
|
25
|
+
const there = findBasaltInstall(root);
|
|
26
|
+
const sameVersion = here.version !== null && here.version === there.version;
|
|
27
|
+
return sameInstall(here.dir, there.dir) || sameVersion ? root : null;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
findManifestAbove,
|
|
31
|
+
installRootAbove
|
|
32
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { tokenize } from './source-text.js';
|
|
2
|
+
/** The module `index.html` loads for the app at `dir` (default src/main.tsx), relative to `dir`. */
|
|
3
|
+
export declare function appEntry(dir: string): string;
|
|
4
|
+
type Tokens = ReturnType<typeof tokenize>;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the entry or a module it imports (relative imports, static or dynamic, `IMPORT_DEPTH`
|
|
7
|
+
* hops) matches `pattern` in code — a global regex, ignoring comments and string literals; an
|
|
8
|
+
* import inside a comment or a string is not followed. `entryTokens` reuses an already-tokenized entry.
|
|
9
|
+
*/
|
|
10
|
+
export declare function callsIn(dir: string, entry: string, pattern: RegExp, entryTokens?: Tokens): boolean;
|
|
11
|
+
/** A global regex matching a CALL of `name` (itself a regex source), generic or not — not an import or bare mention. */
|
|
12
|
+
export declare function callOf(pattern: string): RegExp;
|
|
13
|
+
/** The directories a generated `routeTree.gen.*` is looked for in: beside the entry, then src/. */
|
|
14
|
+
export declare function routeTreeDirs(entry: string): string[];
|
|
15
|
+
/** A TanStack router plugin in the vite config, or a `routeTree.gen.*` in `routeTreeDirs`. */
|
|
16
|
+
export declare function hasRouteTree(dir: string, entry: string): boolean;
|
|
17
|
+
/** Whether `createBasaltRouter` is called in a module reachable from the entry. */
|
|
18
|
+
export declare function hasRouter(dir: string, entry: string, entryTokens?: Tokens): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* THE classification, shared by `init`, `sync` and `doctor`: code-routed = `createBasaltRouter` is
|
|
21
|
+
* called in a module reachable from the entry, no router plugin is registered and no
|
|
22
|
+
* `routeTree.gen.*` exists, and the entry does not import a generated tree (a freshly seeded entry
|
|
23
|
+
* does, before the first vite run — that app is file-routed). Comments and strings do not count.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isCodeRoutedApp(cwd: string, appRel: string): boolean;
|
|
26
|
+
/** A TanStack Start app owns its router, so its router seeds give way to an in-tree `<BasaltProvider>`. */
|
|
27
|
+
export declare function isStartApp(cwd: string, appRel: string): boolean;
|
|
28
|
+
/** Why an app's router seeds are not placed (see `routerSeedSkip`). */
|
|
29
|
+
export type RouterSeedSkip = 'start' | 'code-routed' | null;
|
|
30
|
+
export declare const CODE_ROUTED_NOTE = "code-routed app (createBasaltRouter, no route-tree plugin or routeTree.gen) \u2014 no main.tsx/nav.tsx/__root.tsx seeded.";
|
|
31
|
+
/**
|
|
32
|
+
* Why an app's router seeds (main/nav/__root) are not placed: `start` (Start owns the router, and
|
|
33
|
+
* wins when both apply) or `code-routed` (no generated tree to assume); null when they are.
|
|
34
|
+
*/
|
|
35
|
+
export declare function routerSeedSkip(cwd: string, appRel: string): RouterSeedSkip;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=router-wiring.d.ts.map
|
|
@@ -0,0 +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,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,IAAI,CAAA;AAE3D,eAAO,MAAM,gBAAgB,8HAC2F,CAAA;AAExH;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CAG1E"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { hasDependency, readIfExists, tokenize } from "./source-text.js";
|
|
4
|
+
const IMPORT_DEPTH = 3;
|
|
5
|
+
const VITE_CONFIGS = ["ts", "mts", "cts", "js", "mjs", "cjs"].map((e) => `vite.config.${e}`);
|
|
6
|
+
function htmlEntry(html) {
|
|
7
|
+
for (const [, attrs = ""] of html.replace(/<!--[\s\S]*?-->/g, "").matchAll(/<script\b([^>]*)>/gi)) {
|
|
8
|
+
const src = /\bsrc\s*=\s*["']?([^"'\s>]+)/i.exec(attrs)?.[1];
|
|
9
|
+
if (/\btype\s*=\s*["']?module\b/i.test(attrs) && src !== void 0 && !/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(src)) {
|
|
10
|
+
return src;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
function registersRouterPlugin(src) {
|
|
16
|
+
const { code, inLiteral } = tokenize(src);
|
|
17
|
+
const pluginsAt = [...code.matchAll(/\bplugins\b/g)].find((m) => !inLiteral(m.index))?.index;
|
|
18
|
+
if (pluginsAt === void 0) return false;
|
|
19
|
+
const imports = code.matchAll(
|
|
20
|
+
/(?:^|;)[ \t]*import\s+(?:type\s+)?([^'"`;]*?)\s*from\s*(['"])@tanstack\/router-plugin(?:\/[^'"]*)?\2/gm
|
|
21
|
+
);
|
|
22
|
+
return [...imports].some((m) => {
|
|
23
|
+
if (inLiteral(m.index)) return false;
|
|
24
|
+
const names = (m[1] ?? "").replace(/[{}]/g, "").split(",").map((part) => part.trim()).filter((part) => part !== "" && !/^type\s/.test(part)).map((part) => part.split(/\s+as\s+/).pop() ?? part);
|
|
25
|
+
return names.some(
|
|
26
|
+
(name) => [
|
|
27
|
+
...code.matchAll(
|
|
28
|
+
new RegExp(`(?<![.\\w$])${name.replace(/\$/g, "\\$")}(?:\\.\\w+)?\\s*\\(`, "g")
|
|
29
|
+
)
|
|
30
|
+
].some((call) => call.index > pluginsAt && !inLiteral(call.index))
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const RELATIVE_IMPORT = /(?<![.\w$])(?:(?:import|export)\b[^'";]*?\bfrom|import\s*\(?)\s*['"](\.{1,2}\/[^'"]+)['"]/g;
|
|
35
|
+
const GENERATED_TREE_IMPORT = /(?<![.\w$])(?:(?:import|export)\b[^'";]*?\bfrom|import\s*\(?)\s*['"][^'"]*routeTree\.gen[^'"]*['"]/g;
|
|
36
|
+
function resolveRelative(from, spec) {
|
|
37
|
+
const base = resolve(dirname(from), spec.replace(/\.[jt]sx?$/, ""));
|
|
38
|
+
return [
|
|
39
|
+
resolve(dirname(from), spec),
|
|
40
|
+
`${base}.ts`,
|
|
41
|
+
`${base}.tsx`,
|
|
42
|
+
`${base}/index.ts`,
|
|
43
|
+
`${base}/index.tsx`
|
|
44
|
+
].find((f) => /\.[jt]sx?$/.test(f) && existsSync(f)) ?? null;
|
|
45
|
+
}
|
|
46
|
+
function appEntry(dir) {
|
|
47
|
+
const src = htmlEntry(readIfExists(resolve(dir, "index.html")) ?? "") ?? "src/main.tsx";
|
|
48
|
+
return src.replace(/^\//, "");
|
|
49
|
+
}
|
|
50
|
+
function callsIn(dir, entry, pattern, entryTokens) {
|
|
51
|
+
const entryPath = resolve(dir, entry);
|
|
52
|
+
const seen = /* @__PURE__ */ new Set([entryPath]);
|
|
53
|
+
let frontier = [entryPath];
|
|
54
|
+
for (let depth = 0; depth <= IMPORT_DEPTH && frontier.length > 0; depth++) {
|
|
55
|
+
const next = [];
|
|
56
|
+
for (const file of frontier) {
|
|
57
|
+
const { code, inLiteral } = file === entryPath && entryTokens ? entryTokens : tokenize(readIfExists(file) ?? "");
|
|
58
|
+
if ([...code.matchAll(pattern)].some((c) => !inLiteral(c.index))) return true;
|
|
59
|
+
for (const m of code.matchAll(RELATIVE_IMPORT)) {
|
|
60
|
+
if (inLiteral(m.index)) continue;
|
|
61
|
+
const dep = resolveRelative(file, m[1] ?? "");
|
|
62
|
+
if (dep === null || seen.has(dep)) continue;
|
|
63
|
+
seen.add(dep);
|
|
64
|
+
next.push(dep);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
frontier = next;
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
function callOf(pattern) {
|
|
72
|
+
return new RegExp(`\\b${pattern}\\b\\s*(?:<[^()]*>)?\\s*\\(`, "g");
|
|
73
|
+
}
|
|
74
|
+
const CREATE_BASALT_ROUTER = callOf("createBasaltRouter");
|
|
75
|
+
function routeTreeDirs(entry) {
|
|
76
|
+
return [.../* @__PURE__ */ new Set([dirname(entry), "src"])];
|
|
77
|
+
}
|
|
78
|
+
function hasRouteTree(dir, entry) {
|
|
79
|
+
const vite = VITE_CONFIGS.map((f) => readIfExists(resolve(dir, f))).find((t) => t !== null) ?? "";
|
|
80
|
+
return registersRouterPlugin(vite) || routeTreeDirs(entry).some(
|
|
81
|
+
(d) => ["ts", "tsx", "js"].some((e) => existsSync(resolve(dir, d, `routeTree.gen.${e}`)))
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function hasRouter(dir, entry, entryTokens) {
|
|
85
|
+
return callsIn(dir, entry, CREATE_BASALT_ROUTER, entryTokens);
|
|
86
|
+
}
|
|
87
|
+
function importsGeneratedTree({ code, inLiteral }) {
|
|
88
|
+
return [...code.matchAll(GENERATED_TREE_IMPORT)].some((m) => !inLiteral(m.index));
|
|
89
|
+
}
|
|
90
|
+
function isCodeRoutedApp(cwd, appRel) {
|
|
91
|
+
const dir = resolve(cwd, appRel);
|
|
92
|
+
const entry = appEntry(dir);
|
|
93
|
+
const tokens = tokenize(readIfExists(resolve(dir, entry)) ?? "");
|
|
94
|
+
if (importsGeneratedTree(tokens)) return false;
|
|
95
|
+
return hasRouter(dir, entry, tokens) && !hasRouteTree(dir, entry);
|
|
96
|
+
}
|
|
97
|
+
function isStartApp(cwd, appRel) {
|
|
98
|
+
return hasDependency(resolve(cwd, appRel), "@tanstack/react-start");
|
|
99
|
+
}
|
|
100
|
+
const CODE_ROUTED_NOTE = "code-routed app (createBasaltRouter, no route-tree plugin or routeTree.gen) \u2014 no main.tsx/nav.tsx/__root.tsx seeded.";
|
|
101
|
+
function routerSeedSkip(cwd, appRel) {
|
|
102
|
+
if (isStartApp(cwd, appRel)) return "start";
|
|
103
|
+
return isCodeRoutedApp(cwd, appRel) ? "code-routed" : null;
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
CODE_ROUTED_NOTE,
|
|
107
|
+
appEntry,
|
|
108
|
+
callOf,
|
|
109
|
+
callsIn,
|
|
110
|
+
hasRouteTree,
|
|
111
|
+
hasRouter,
|
|
112
|
+
isCodeRoutedApp,
|
|
113
|
+
isStartApp,
|
|
114
|
+
routeTreeDirs,
|
|
115
|
+
routerSeedSkip
|
|
116
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** `abs` read as text, or null: absent, a directory, unreadable or raced away all mean "not there". */
|
|
2
|
+
export declare function readIfExists(abs: string): string | null;
|
|
3
|
+
/** `<dir>/package.json` parsed as `T`; null when absent or not JSON. */
|
|
4
|
+
export declare function readPackageJson<T>(dir: string): T | null;
|
|
5
|
+
/** True when `pkgName` appears in any of the consumer's dependencies, devDependencies or peerDependencies. */
|
|
6
|
+
export declare function hasDependency(cwd: string, pkgName: string): boolean;
|
|
7
|
+
/** Source with comments blanked (and template text), plus a test for "offset sits inside a string". */
|
|
8
|
+
export declare function tokenize(src: string): {
|
|
9
|
+
code: string;
|
|
10
|
+
inLiteral: (at: number) => boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=source-text.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
function readIfExists(abs) {
|
|
4
|
+
try {
|
|
5
|
+
return readFileSync(abs, "utf8");
|
|
6
|
+
} catch {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function readPackageJson(dir) {
|
|
11
|
+
const raw = readIfExists(resolve(dir, "package.json"));
|
|
12
|
+
try {
|
|
13
|
+
return raw === null ? null : JSON.parse(raw);
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const DEPENDENCY_FIELDS = ["dependencies", "devDependencies", "peerDependencies"];
|
|
19
|
+
function hasDependency(cwd, pkgName) {
|
|
20
|
+
const pkg = readPackageJson(
|
|
21
|
+
cwd
|
|
22
|
+
);
|
|
23
|
+
return DEPENDENCY_FIELDS.some((field) => pkg?.[field]?.[pkgName] !== void 0);
|
|
24
|
+
}
|
|
25
|
+
const TOKEN = /("(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'|`(?:\\.|[^`\\])*`)|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
|
|
26
|
+
function tokenize(src) {
|
|
27
|
+
const literals = [];
|
|
28
|
+
const code = src.replace(TOKEN, (m, literal, at) => {
|
|
29
|
+
if (literal === void 0) return m.replace(/[^\n]/g, " ");
|
|
30
|
+
if (!literal.startsWith("`")) {
|
|
31
|
+
literals.push([at, at + m.length]);
|
|
32
|
+
return m;
|
|
33
|
+
}
|
|
34
|
+
return m.replace(
|
|
35
|
+
/(\$\{[^}]*\})|[^\n`]/g,
|
|
36
|
+
(c, interpolation) => interpolation ?? " "
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
return { code, inLiteral: (at) => literals.some(([from, to]) => at >= from && at < to) };
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
hasDependency,
|
|
43
|
+
readIfExists,
|
|
44
|
+
readPackageJson,
|
|
45
|
+
tokenize
|
|
46
|
+
};
|
package/dist/cli/sync.d.ts
CHANGED
|
@@ -11,8 +11,6 @@ export type SyncOptions = {
|
|
|
11
11
|
* (a package under a configured repo); one text, so neither prescribes a second `init`.
|
|
12
12
|
*/
|
|
13
13
|
export declare function parentInstallAdvice(cwd: string, parent: string, verb: string): string;
|
|
14
|
-
/** The nearest ANCESTOR of `dir` (exclusive) carrying a basalt manifest, or null. */
|
|
15
|
-
export declare function findManifestAbove(dir: string): string | null;
|
|
16
14
|
/**
|
|
17
15
|
* Reconcile managed files with the shipped versions via a sha256 three-way compare.
|
|
18
16
|
*
|
package/dist/cli/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AA2CA,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
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AA2CA,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,CAuO1F"}
|
package/dist/cli/sync.js
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
diffSummary,
|
|
11
11
|
findBasaltInstall,
|
|
12
12
|
inspectLefthookGate,
|
|
13
|
-
isStartApp,
|
|
14
13
|
isStringArray,
|
|
15
14
|
managedFiles,
|
|
16
15
|
normalizeForLedger,
|
|
@@ -29,7 +28,7 @@ import {
|
|
|
29
28
|
reportPrune,
|
|
30
29
|
resolvePlacement,
|
|
31
30
|
resolveProjectDir,
|
|
32
|
-
|
|
31
|
+
routerSeedPlan,
|
|
33
32
|
rootsNotices,
|
|
34
33
|
sha256,
|
|
35
34
|
shippedAssetPath,
|
|
@@ -38,6 +37,7 @@ import {
|
|
|
38
37
|
writeFileEnsuringDir,
|
|
39
38
|
writeUnit
|
|
40
39
|
} from "./index.js";
|
|
40
|
+
import { findManifestAbove, installRootAbove } from "./install-root.js";
|
|
41
41
|
function readOxlintPresetPlugins(pkgRoot) {
|
|
42
42
|
const plugins = parseJsonc(readSource(pkgRoot, OXLINT_FILES.preset) ?? "null")?.["plugins"];
|
|
43
43
|
return isStringArray(plugins) ? plugins : [];
|
|
@@ -45,21 +45,18 @@ function readOxlintPresetPlugins(pkgRoot) {
|
|
|
45
45
|
function parentInstallAdvice(cwd, parent, verb) {
|
|
46
46
|
return `This repo's install is at ${relativePosix(cwd, parent)} (${parent}) \u2014 run ${verb} there, or set BASALT_CWD to it.`;
|
|
47
47
|
}
|
|
48
|
-
function findManifestAbove(dir) {
|
|
49
|
-
let current = resolve(dir, "..");
|
|
50
|
-
for (; ; ) {
|
|
51
|
-
if (existsSync(resolve(current, MANIFEST_PATH))) return current;
|
|
52
|
-
const parent = resolve(current, "..");
|
|
53
|
-
if (parent === current) return null;
|
|
54
|
-
current = parent;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
48
|
function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
58
49
|
const syncFlags = opts.flags ?? [];
|
|
59
50
|
if (conflictingProfileFlags("sync", syncFlags)) return 1;
|
|
60
51
|
const project = resolveProjectDir(invocationCwd);
|
|
61
|
-
const cwd = project.dir;
|
|
62
52
|
noteRelocation("sync", project);
|
|
53
|
+
const installAbove = project.relocatedFrom === null ? installRootAbove(project.dir) : null;
|
|
54
|
+
const cwd = installAbove ?? project.dir;
|
|
55
|
+
if (installAbove !== null) {
|
|
56
|
+
console.log(
|
|
57
|
+
`basalt-ui sync: ${project.dir} is a package of the install at ${installAbove}; syncing there.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
63
60
|
if (declaredProfile(readBasaltConfig(cwd), syncFlags) === "tokens-only") {
|
|
64
61
|
console.log(
|
|
65
62
|
`basalt-ui sync: ${MANIFEST_PATH}: n/a \u2014 a tokens-only consumer has no scaffold to reconcile. The token layer is refreshed by re-running \`basalt-ui tokens:css\`, and \`tokens:css --check\` is its drift gate. Pass --framework to force the full profile.`
|
|
@@ -74,8 +71,8 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
74
71
|
if (!existsSync(resolve(cwd, MANIFEST_PATH))) {
|
|
75
72
|
const elsewhere = findManifestAbove(cwd);
|
|
76
73
|
const refused = resolvePlacement(cwd);
|
|
77
|
-
const
|
|
78
|
-
const wouldWrite = managedFiles(refused).filter((f) => !
|
|
74
|
+
const { skipped: skippedSeeds } = routerSeedPlan(cwd, refused.appRel);
|
|
75
|
+
const wouldWrite = managedFiles(refused).filter((f) => !skippedSeeds.has(f.dest)).length;
|
|
79
76
|
console.error(
|
|
80
77
|
`\u2716 basalt-ui sync: no ${MANIFEST_PATH} at ${cwd} \u2014 refusing to scaffold. \`sync\` refreshes an EXISTING basalt install; creating one is \`basalt-ui init\`'s decision, and continuing here would write ${wouldWrite} managed file(s) into this directory.` + (elsewhere === null ? " No manifest exists at any ancestor either \u2014 run `basalt-ui init` here if this package really is meant to be a consumer." : ` ${parentInstallAdvice(cwd, elsewhere, "sync")}`)
|
|
81
78
|
);
|
|
@@ -85,8 +82,7 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
85
82
|
const ctx = renderContext(cwd);
|
|
86
83
|
const manifest = readManifest(cwd);
|
|
87
84
|
const placement = resolvePlacement(cwd);
|
|
88
|
-
const
|
|
89
|
-
const skipped = new Set(startApp ? routerSeedDests(placement.appRel) : []);
|
|
85
|
+
const { skip: seedSkip, skipped } = routerSeedPlan(cwd, placement.appRel);
|
|
90
86
|
const files = managedFiles(placement).filter((f) => !skipped.has(f.dest));
|
|
91
87
|
let updated = 0;
|
|
92
88
|
let created = 0;
|
|
@@ -133,9 +129,16 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
133
129
|
force: opts.force === true
|
|
134
130
|
});
|
|
135
131
|
staleForCheck += pruned.removed.length + pruned.drifted.length;
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
)
|
|
132
|
+
const isTracked = (d) => manifest.files[d] !== void 0;
|
|
133
|
+
const codeRoutedSeeds = seedSkip === "code-routed" ? [...skipped].filter(isTracked) : [];
|
|
134
|
+
if (codeRoutedSeeds.length > 0 && !opts.check) {
|
|
135
|
+
for (const d of codeRoutedSeeds) delete manifest.files[d];
|
|
136
|
+
console.error(
|
|
137
|
+
`\u26A0 basalt-ui sync: code-routed app \u2014 dropped ${codeRoutedSeeds.join(", ")} from the manifest (any file is yours).`
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
const startSkippedSeeds = seedSkip === "start" ? [...skipped] : [];
|
|
141
|
+
const stale = startSkippedSeeds.filter((d) => isTracked(d) && existsSync(resolve(cwd, d)));
|
|
139
142
|
const mounting = stale.filter((d) => !d.endsWith("nav.tsx"));
|
|
140
143
|
const inert = stale.filter((d) => d.endsWith("nav.tsx"));
|
|
141
144
|
const embedded = "Delete them and render <BasaltProvider><Outlet /></BasaltProvider> in the Start root route (embedded mode).";
|
|
@@ -149,7 +152,7 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
149
152
|
`\u26A0 basalt-ui sync: ${inert.join(", ")} was seeded before this became a Start app; it mounts nothing, so keep or delete it. Left untouched.`
|
|
150
153
|
);
|
|
151
154
|
}
|
|
152
|
-
if (
|
|
155
|
+
if (seedSkip === "start" && (!opts.check || syncFlags.includes("--verbose")))
|
|
153
156
|
console.log(`basalt-ui sync: ${START_APP_NOTE}`);
|
|
154
157
|
const placementSkips = placementNotices(cwd, placement);
|
|
155
158
|
if (opts.check !== true || syncFlags.includes("--verbose")) {
|
|
@@ -212,7 +215,6 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
212
215
|
return 0;
|
|
213
216
|
}
|
|
214
217
|
export {
|
|
215
|
-
findManifestAbove,
|
|
216
218
|
parentInstallAdvice,
|
|
217
219
|
readOxlintPresetPlugins,
|
|
218
220
|
sync
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["../../src/cli/tokens-css.ts"],"names":[],"mappings":"AAkCA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK3D;AA4DD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["../../src/cli/tokens-css.ts"],"names":[],"mappings":"AAkCA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK3D;AA4DD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,CAuE9E;AAgBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,CAa7E"}
|
package/dist/cli/tokens-css.js
CHANGED
|
@@ -112,12 +112,7 @@ function tokensCss(flags, cwd = process.cwd()) {
|
|
|
112
112
|
...Object.keys(scheme).length === 0 ? {} : { scheme },
|
|
113
113
|
...defaultScheme === void 0 ? {} : { defaultScheme },
|
|
114
114
|
...flags.includes("--media-fallback") ? { mediaFallback: true } : {},
|
|
115
|
-
...only === void 0 ? {} : { only }
|
|
116
|
-
// The tokens-only consumer is exactly the one who writes these names by hand, so they are also
|
|
117
|
-
// the one who wants the deprecated camelCase aliases gone — and this command is their only
|
|
118
|
-
// entry point. Without the flag the CLI and the API could disagree about what basalt's tokens
|
|
119
|
-
// are, which is the one thing this command is documented never to allow.
|
|
120
|
-
...flags.includes("--no-legacy-aliases") ? { legacyAliases: false } : {}
|
|
115
|
+
...only === void 0 ? {} : { only }
|
|
121
116
|
});
|
|
122
117
|
if (schemeClass !== void 0) {
|
|
123
118
|
css = css.replace(
|
package/dist/common/errors.d.ts
CHANGED
|
@@ -18,16 +18,11 @@ export declare const BASALT_PREFIX = "[basalt]";
|
|
|
18
18
|
export declare function requiredProp(component: string, prop: string, hint?: string): string;
|
|
19
19
|
/** A prop with a closed value set that got something outside it. */
|
|
20
20
|
export declare function oneOf(component: string, prop: string, allowed: readonly string[], got: unknown): string;
|
|
21
|
-
/**
|
|
22
|
-
* A prop still shipped and still working, with a named successor and the version it goes away in.
|
|
23
|
-
* Majors are banned here, so the deprecation notice IS the migration channel.
|
|
24
|
-
*/
|
|
25
|
-
export declare function deprecatedProp(component: string, oldProp: string, newProp: string, removeIn: string, note?: string): string;
|
|
26
21
|
/**
|
|
27
22
|
* A prop the component ACCEPTS, reads nothing from, and cannot report as wrong — because a SECOND
|
|
28
23
|
* prop it was passed alongside decides the same thing and won.
|
|
29
24
|
*
|
|
30
|
-
* Distinct from {@link
|
|
25
|
+
* Distinct from {@link oneOf} (read, and the
|
|
31
26
|
* value is out of range): this one renders something the caller did not ask for and nothing in the
|
|
32
27
|
* type system, the linter or the console says so. A 1.x chart's `height` under `fill` was the
|
|
33
28
|
* reference case — weatherorb passed both for the life of the file and never learnt that eight height
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,yDAAyD;AACzD,eAAO,MAAM,aAAa,aAAa,CAAA;AAMvC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,oEAAoE;AACpE,wBAAgB,KAAK,CACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,EAAE,OAAO,GACX,MAAM,CAMR;AAED
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,yDAAyD;AACzD,eAAO,MAAM,aAAa,aAAa,CAAA;AAMvC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,oEAAoE;AACpE,wBAAgB,KAAK,CACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,EAAE,OAAO,GACX,MAAM,CAMR;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,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