kerfjs 5.0.0-beta.122 → 5.0.0-beta.123
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 +10 -0
- package/ai/manifest.json +1 -1
- package/package.json +2 -2
- package/setup/cli.mjs +3 -2
- package/setup/index.d.mts +2 -1
- package/setup/index.mjs +112 -75
- package/setup/state.schema.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,8 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
### Removed
|
|
10
|
+
|
|
11
|
+
- **Pinned TabBarItem support.** Removed `pinned` and its sticky/backdrop tokens and RTL compensation. Put fixed controls in TabBar's existing `leading`, `trailing`, or `end` zones outside the scrolling tablist. Ordinary tabs retain keyboard navigation, selection reveal, reordering, scroll dividers, and optional whole-tab snapping (`KF-K6GKN3`).
|
|
12
|
+
|
|
9
13
|
### Added
|
|
10
14
|
|
|
15
|
+
- **One Kerf UI Sketch Library.** `@kerfjs/ui` ships `docs/design/sketch/Kerf-UI.sketch`, with 308 editable light/dark Symbols covering all 110 design-template variants on one page per family. It includes 141 `Kerf/<Theme>/<Role>` Color Variables and Button's shared styles. Its document, Symbol, Text, and Color Variable IDs stay stable across releases, so linked instances sync while keeping overrides. The six family `.sketch` files become build inputs; install `Kerf-UI.sketch` instead (`KF-WW7BNZ`).
|
|
16
|
+
- **Kerf UI Sketch text names SF Pro.** `Kerf-UI.sketch` used Sketch's nameless system font, which Sketch's Embed Fonts settings reported as three Invalid Font entries. It now names SF Pro's Regular, Medium, and Semibold faces, the font production's `system-ui` uses on macOS, so install Apple's SF Pro fonts before adding the Library (`KF-KFV416`).
|
|
17
|
+
- **Decline setup value proposals.** `kerfjs setup --resolve <id>=skip` remembers an unused dependency, script, compiler option, or catalog/profile value per package. Dry runs expose proposal ids, `=kerf` adopts a declined value later, and new authored conflicts still require an explicit conflict resolution (`KF-0TTETG`).
|
|
11
18
|
- **Stable `StateBanner` root identity.** `rootAttributes` accepts a safe `data-key` so a conditional status banner can disappear before a sibling without replacing the sibling's focused action (`KF-KDF5YG`).
|
|
12
19
|
- **Native drag on `SummaryRow` options.** `draggable` writes the native attribute on the selectable row or board card root, preserving its option semantics and delegated identity across rerenders (`KF-NHPCWZ`).
|
|
13
20
|
- **Static diagnostic `SummaryRow`.** `semanticRole="group"` renders a labeled, non-option list row or board card that retains rail and selected visuals while a nested native recovery action owns focus and activation (`KF-H32FQY`).
|
|
@@ -111,6 +118,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
111
118
|
|
|
112
119
|
### Changed
|
|
113
120
|
|
|
121
|
+
- **`ListHeader` action ends on the list's bordered edge.** A full-width header's fitted trailing action no longer sits 4px inside its header to center its glyph on a Pane toolbar slot; its border box now ends flush at the 8px inline margin, on the same edge as a selected or hovered `ListItem` and a Pane header's trailing `ToolbarControlGroup`. Bordered elements in one column align outer edges; borderless nested glyphs align with nested content (`KF-78N7HE`).
|
|
114
122
|
- **A `Switch` hint sits directly under its label.** The `Switch` hint no longer leaves a 7px gap below the switch row; it sits flush under it on the label's column, the same offset as a `Checkbox` hint or a grouped choice hint, so every toggle control reads alike (`KF-YG5CM2`).
|
|
115
123
|
- **A standalone `Checkbox` hint sits directly under its label.** `Checkbox` hint and error text no longer leave a 7px gap below the label row; they sit flush under it, exactly as a `CheckboxGroup` or `RadioGroup` choice hint does, so a lone Checkbox and a grouped choice read the same (`KF-X8F2K5`).
|
|
116
124
|
- **`ColorPicker` hue track is a fixed rainbow.** In HSL and HSB the hue slider now always paints the full-saturation, full-brightness rainbow instead of the hues at the current saturation and brightness, so a dark or nearly gray color still shows which hue each position picks. Its thumb still shows the current color, every other channel and the opacity track keep their live preview, and the rainbow follows the writing direction like every other track (`KF-2AX5T7`).
|
|
@@ -157,6 +165,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
157
165
|
|
|
158
166
|
### Fixed
|
|
159
167
|
|
|
168
|
+
- **A toggle `ListHeader`'s disclosure arrow lines up with its rows' trailing icons.** The arrow was centered in a 24px layer, 3px inside the trailing content edge of the `ListItem` rows below it. The layer now hugs the 18px arrow, so it ends on the toggle's 1px border + 8px padding, the same inset as a row's trailing icon, at standard and compact density (`KF-HZKKK9`).
|
|
169
|
+
- **UI doctor KUI-L401 honors view-scoped exceptions from app entries.** A declared application entry keeps each component use's source file when checking missing wiring, so a narrow exception on one view does not move to the entry or suppress another view's warning (`KF-5X91JH`).
|
|
160
170
|
- **Live Markdown editor at phone width.** The editor and preview stack into full-width, independently scrolling panes on narrow screens; tablet and desktop keep the side-by-side layout (`KF-HR730P`).
|
|
161
171
|
- **UI doctor KUI-L401 respects `ChoiceChips` modes.** Radio and toggle modes no longer require `wireChoiceChips`; listbox and dynamic modes still do. Entry-point wiring remains recognized when bundle entries are declared in `.kerf-ui-profile.json` (`KF-KCM28K`, `KF-CYYR43`).
|
|
162
172
|
- **Site audit accepts the patched DOMPurify release.** The documentation site's direct dependency and lockfile now use DOMPurify 3.4.17, resolving the reported sanitizer advisories while keeping the audit policy and Markdown editor behavior intact (`KF-VB4EXK`).
|
package/ai/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kerfjs",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.123",
|
|
4
4
|
"description": "Tiny reactive UI framework — fine-grained signals + DOM morphing + JSX. Apply the smallest possible cut to update your DOM.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"lint": "npm run lint:eslint && npm run format:check",
|
|
144
144
|
"typecheck": "node node_modules/typescript7/bin/tsc --noEmit",
|
|
145
145
|
"check": "node scripts/check-guidance-integrity.mjs --record-pass -- node scripts/run-check-steps.mjs check:core",
|
|
146
|
-
"push": "
|
|
146
|
+
"push": "node scripts/push.mjs",
|
|
147
147
|
"check:core": "npm run lint && npm run typecheck && node scripts/check-doc-test-inventory.mjs && node scripts/check-doc-api-coverage.mjs && node scripts/check-doc-site-tickets.mjs && node scripts/check-cdn-versions.mjs && node scripts/check-dev-warn-docs.mjs && node scripts/check-skill-freshness.mjs && node scripts/check-design-rule-5.mjs && node scripts/check-feature-coverage.mjs && node scripts/sync-lockstep-versions.mjs --check && node scripts/sync-scaffold-catalog-schema.mjs --check && node scripts/check-ai-bundle.mjs && npm test && npm run build && node scripts/check-bundle-size.mjs && node scripts/check-doc-api-signatures.mjs && vitest run --config vitest.config.dist.ts && vitest run --config vitest.config.dist-full.ts && node node_modules/typescript7/bin/tsc -p tests/dist/jsx-typing/tsconfig.json && node scripts/check-packed-jsx-typing.mjs && node node_modules/typescript7/bin/tsc -p site/src/examples/complete/tsconfig.json && node node_modules/typescript7/bin/tsc -p tests/dist/scaffold-typing/tsconfig.json && node scripts/check-docs-examples.mjs && node scripts/check-package-gates.mjs",
|
|
148
148
|
"check:docs:examples": "node scripts/check-docs-examples.mjs",
|
|
149
149
|
"check:full": "npm run check && npm run --silent check:audit && playwright test",
|
package/setup/cli.mjs
CHANGED
|
@@ -33,7 +33,8 @@ Options:
|
|
|
33
33
|
Use shared workspace guidance, e.g. AGENTS.md
|
|
34
34
|
--core | --ui Choose a mode when it cannot be detected
|
|
35
35
|
--resolve <id>=<choice>
|
|
36
|
-
Resolve
|
|
36
|
+
Resolve a conflict with keep or kerf, or decline a
|
|
37
|
+
value proposal with skip (repeatable)
|
|
37
38
|
--write Apply the displayed plan (default is dry-run)
|
|
38
39
|
--yes Required with --write in non-interactive use
|
|
39
40
|
--offline Forbid registry access during dependency installation
|
|
@@ -54,7 +55,7 @@ Options:
|
|
|
54
55
|
const resolutions = {};
|
|
55
56
|
for (const entry of takeAll('--resolve')) {
|
|
56
57
|
const index = entry.lastIndexOf('=');
|
|
57
|
-
if (index < 1) throw new Error('--resolve requires <id>=keep|kerf.');
|
|
58
|
+
if (index < 1) throw new Error('--resolve requires <id>=keep|kerf|skip.');
|
|
58
59
|
const id = entry.slice(0, index);
|
|
59
60
|
const choice = entry.slice(index + 1);
|
|
60
61
|
if (id in resolutions && resolutions[id] !== choice)
|
package/setup/index.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ export interface KerfSetupPlan {
|
|
|
20
20
|
mode: 'core' | 'ui';
|
|
21
21
|
setupVersion: string;
|
|
22
22
|
actions: SetupAction[];
|
|
23
|
+
proposalIds: string[];
|
|
23
24
|
conflicts: SetupConflict[];
|
|
24
25
|
generatedPaths: string[];
|
|
25
26
|
}
|
|
@@ -29,7 +30,7 @@ export function planKerfSetup(options?: {
|
|
|
29
30
|
mode?: 'core' | 'ui';
|
|
30
31
|
version?: string;
|
|
31
32
|
guidanceSource?: string;
|
|
32
|
-
resolutions?: Record<string, 'keep' | 'kerf'>;
|
|
33
|
+
resolutions?: Record<string, 'keep' | 'kerf' | 'skip'>;
|
|
33
34
|
}): Promise<KerfSetupPlan>;
|
|
34
35
|
export function formatSetupPlan(plan: KerfSetupPlan): string;
|
|
35
36
|
export function applyKerfSetup(
|
package/setup/index.mjs
CHANGED
|
@@ -133,7 +133,7 @@ function validateSetupState(state) {
|
|
|
133
133
|
)
|
|
134
134
|
throw new Error(`Invalid setup state for package ${key}.`);
|
|
135
135
|
for (const resolution of Object.values(value.resolutions ?? {}))
|
|
136
|
-
if (!['keep', 'kerf'].includes(resolution))
|
|
136
|
+
if (!['keep', 'kerf', 'skip'].includes(resolution))
|
|
137
137
|
throw new Error(`Invalid persisted resolution for package ${key}.`);
|
|
138
138
|
for (const item of Object.values(value.managed ?? {}))
|
|
139
139
|
if (!item || !/^[a-f0-9]{64}$/.test(item.sha256 ?? ''))
|
|
@@ -429,6 +429,7 @@ function reconcileValue({
|
|
|
429
429
|
managedAfter,
|
|
430
430
|
resolutions,
|
|
431
431
|
activeConflictIds,
|
|
432
|
+
activeProposalIds,
|
|
432
433
|
knownResolutionIds,
|
|
433
434
|
}) {
|
|
434
435
|
knownResolutionIds.add(id);
|
|
@@ -436,7 +437,8 @@ function reconcileValue({
|
|
|
436
437
|
const previouslyManaged = managedBefore[id]?.sha256 === hashValue(current);
|
|
437
438
|
const divergent = key in target && current !== value && !previouslyManaged;
|
|
438
439
|
if (divergent) activeConflictIds.add(id);
|
|
439
|
-
const resolution =
|
|
440
|
+
const resolution =
|
|
441
|
+
resolutions[id] === 'skip' && divergent ? undefined : resolutions[id];
|
|
440
442
|
if (divergent && !resolution) {
|
|
441
443
|
conflicts.push({
|
|
442
444
|
id,
|
|
@@ -445,6 +447,13 @@ function reconcileValue({
|
|
|
445
447
|
return;
|
|
446
448
|
}
|
|
447
449
|
if (divergent && resolution === 'keep') return;
|
|
450
|
+
if (!divergent && hashValue(current) !== hashValue(value)) {
|
|
451
|
+
activeProposalIds.add(id);
|
|
452
|
+
if (resolution === 'skip') {
|
|
453
|
+
if (previouslyManaged) managedAfter[id] = managedBefore[id];
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
448
457
|
target[key] = value;
|
|
449
458
|
managedAfter[id] = { sha256: hashValue(value) };
|
|
450
459
|
}
|
|
@@ -573,17 +582,7 @@ async function installedVersion(directory, name) {
|
|
|
573
582
|
}
|
|
574
583
|
|
|
575
584
|
function mergeProfile(current, recommended, context) {
|
|
576
|
-
if (current === undefined) {
|
|
577
|
-
for (const key of ['$schema', 'schemaVersion', 'scope'])
|
|
578
|
-
context.managedAfter[`.kerf-ui-profile.json#${key}`] = {
|
|
579
|
-
sha256: hashValue(recommended[key]),
|
|
580
|
-
};
|
|
581
|
-
const local = recommended.catalogs[0];
|
|
582
|
-
context.managedAfter[`.kerf-ui-profile.json#catalogs.${local.package}`] = {
|
|
583
|
-
sha256: hashValue(local),
|
|
584
|
-
};
|
|
585
|
-
return recommended;
|
|
586
|
-
}
|
|
585
|
+
if (current === undefined) current = {};
|
|
587
586
|
const idPrefix = '.kerf-ui-profile.json';
|
|
588
587
|
if (!current || typeof current !== 'object' || Array.isArray(current)) {
|
|
589
588
|
context.knownResolutionIds.add(idPrefix);
|
|
@@ -627,20 +626,33 @@ function mergeProfile(current, recommended, context) {
|
|
|
627
626
|
const id = `.kerf-ui-profile.json#catalogs.${local.package}`;
|
|
628
627
|
context.knownResolutionIds.add(id);
|
|
629
628
|
if (!existing) {
|
|
630
|
-
|
|
631
|
-
context.
|
|
629
|
+
context.activeProposalIds.add(id);
|
|
630
|
+
if (context.resolutions[id] !== 'skip') {
|
|
631
|
+
output.catalogs.push(local);
|
|
632
|
+
context.managedAfter[id] = { sha256: hashValue(local) };
|
|
633
|
+
}
|
|
632
634
|
} else {
|
|
633
635
|
const previouslyManaged =
|
|
634
636
|
context.managedBefore[id]?.sha256 === hashValue(existing);
|
|
635
637
|
const divergent =
|
|
636
638
|
JSON.stringify(existing) !== JSON.stringify(local) && !previouslyManaged;
|
|
637
639
|
if (divergent) context.activeConflictIds.add(id);
|
|
638
|
-
if (
|
|
640
|
+
if (
|
|
641
|
+
divergent &&
|
|
642
|
+
(!context.resolutions[id] || context.resolutions[id] === 'skip')
|
|
643
|
+
)
|
|
639
644
|
context.conflicts.push({
|
|
640
645
|
id,
|
|
641
646
|
message: 'existing catalog declaration differs',
|
|
642
647
|
});
|
|
643
648
|
else if (!divergent || context.resolutions[id] === 'kerf') {
|
|
649
|
+
if (hashValue(existing) !== hashValue(local)) {
|
|
650
|
+
context.activeProposalIds.add(id);
|
|
651
|
+
if (context.resolutions[id] === 'skip') {
|
|
652
|
+
context.managedAfter[id] = context.managedBefore[id];
|
|
653
|
+
return output;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
644
656
|
output.catalogs[output.catalogs.indexOf(existing)] = local;
|
|
645
657
|
context.managedAfter[id] = { sha256: hashValue(local) };
|
|
646
658
|
}
|
|
@@ -715,6 +727,7 @@ export async function planKerfSetup({
|
|
|
715
727
|
const managedAfter = {};
|
|
716
728
|
const knownResolutionIds = new Set();
|
|
717
729
|
const activeConflictIds = new Set();
|
|
730
|
+
const activeProposalIds = new Set();
|
|
718
731
|
const context = {
|
|
719
732
|
conflicts,
|
|
720
733
|
managedBefore,
|
|
@@ -722,6 +735,7 @@ export async function planKerfSetup({
|
|
|
722
735
|
resolutions,
|
|
723
736
|
knownResolutionIds,
|
|
724
737
|
activeConflictIds,
|
|
738
|
+
activeProposalIds,
|
|
725
739
|
};
|
|
726
740
|
const addAction = async (path, value, kind = 'write') => {
|
|
727
741
|
const before = await readText(path);
|
|
@@ -910,7 +924,7 @@ export async function planKerfSetup({
|
|
|
910
924
|
...context,
|
|
911
925
|
resolutions: {
|
|
912
926
|
...resolutions,
|
|
913
|
-
[id]: resolutions['kerfjs-version'],
|
|
927
|
+
[id]: requestedResolutions[id] ?? resolutions['kerfjs-version'],
|
|
914
928
|
},
|
|
915
929
|
}
|
|
916
930
|
: context;
|
|
@@ -936,7 +950,7 @@ export async function planKerfSetup({
|
|
|
936
950
|
...context,
|
|
937
951
|
});
|
|
938
952
|
for (const [key, configuredPath] of Object.entries(
|
|
939
|
-
nextManifest.kerfComponentCatalog,
|
|
953
|
+
nextManifest.kerfComponentCatalog ?? {},
|
|
940
954
|
))
|
|
941
955
|
if (
|
|
942
956
|
typeof configuredPath !== 'string' ||
|
|
@@ -1169,69 +1183,83 @@ export async function planKerfSetup({
|
|
|
1169
1183
|
throw new Error(
|
|
1170
1184
|
'UI setup requires package.json name for catalog identity.',
|
|
1171
1185
|
);
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
return relative.startsWith('.') ? relative : `./${relative}`;
|
|
1184
|
-
};
|
|
1185
|
-
const profile = mergeProfile(
|
|
1186
|
-
currentProfile,
|
|
1187
|
-
profileTemplate(
|
|
1188
|
-
nextManifest.name,
|
|
1189
|
-
profileCatalogPath(nextManifest.kerfComponentCatalog.output),
|
|
1190
|
-
nextManifest.kerfComponentCatalog.selectionOutput
|
|
1191
|
-
? profileCatalogPath(
|
|
1192
|
-
nextManifest.kerfComponentCatalog.selectionOutput,
|
|
1193
|
-
)
|
|
1194
|
-
: undefined,
|
|
1195
|
-
),
|
|
1196
|
-
context,
|
|
1197
|
-
);
|
|
1198
|
-
await addAction(profilePath, stableJson(profile), 'json');
|
|
1199
|
-
const metadataPath = resolve(
|
|
1200
|
-
selected.directory,
|
|
1201
|
-
nextManifest.kerfComponentCatalog.source,
|
|
1202
|
-
);
|
|
1203
|
-
if (nextManifest.kerfComponentCatalog.selectionOutput) {
|
|
1204
|
-
const metadata = await readJson(metadataPath);
|
|
1205
|
-
if (
|
|
1206
|
-
!metadata ||
|
|
1207
|
-
typeof metadata.description !== 'string' ||
|
|
1208
|
-
!metadata.description.trim()
|
|
1209
|
-
)
|
|
1210
|
-
throw new Error(
|
|
1211
|
-
`${portable(root, metadataPath)}: selectionOutput requires an authored metadata source with a nonempty description. Add the source and description before running setup.`,
|
|
1186
|
+
if (nextManifest.kerfComponentCatalog !== undefined) {
|
|
1187
|
+
const profilePath = resolve(root, '.kerf-ui-profile.json');
|
|
1188
|
+
const currentProfileSource = await readText(profilePath);
|
|
1189
|
+
const currentProfile =
|
|
1190
|
+
currentProfileSource === null
|
|
1191
|
+
? undefined
|
|
1192
|
+
: JSON.parse(currentProfileSource);
|
|
1193
|
+
const profileCatalogPath = (configuredPath) => {
|
|
1194
|
+
const relative = portable(
|
|
1195
|
+
root,
|
|
1196
|
+
resolve(selected.directory, configuredPath),
|
|
1212
1197
|
);
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1198
|
+
return relative.startsWith('.') ? relative : `./${relative}`;
|
|
1199
|
+
};
|
|
1200
|
+
const profile = mergeProfile(
|
|
1201
|
+
currentProfile,
|
|
1202
|
+
profileTemplate(
|
|
1203
|
+
nextManifest.name,
|
|
1204
|
+
profileCatalogPath(nextManifest.kerfComponentCatalog.output),
|
|
1205
|
+
nextManifest.kerfComponentCatalog.selectionOutput
|
|
1206
|
+
? profileCatalogPath(
|
|
1207
|
+
nextManifest.kerfComponentCatalog.selectionOutput,
|
|
1208
|
+
)
|
|
1209
|
+
: undefined,
|
|
1223
1210
|
),
|
|
1211
|
+
context,
|
|
1224
1212
|
);
|
|
1213
|
+
await addAction(profilePath, stableJson(profile), 'json');
|
|
1214
|
+
const metadataPath = resolve(
|
|
1215
|
+
selected.directory,
|
|
1216
|
+
nextManifest.kerfComponentCatalog.source,
|
|
1217
|
+
);
|
|
1218
|
+
if (nextManifest.kerfComponentCatalog.selectionOutput) {
|
|
1219
|
+
const metadata = await readJson(metadataPath);
|
|
1220
|
+
if (
|
|
1221
|
+
!metadata ||
|
|
1222
|
+
typeof metadata.description !== 'string' ||
|
|
1223
|
+
!metadata.description.trim()
|
|
1224
|
+
)
|
|
1225
|
+
throw new Error(
|
|
1226
|
+
`${portable(root, metadataPath)}: selectionOutput requires an authored metadata source with a nonempty description. Add the source and description before running setup.`,
|
|
1227
|
+
);
|
|
1228
|
+
} else if (!(await exists(metadataPath)))
|
|
1229
|
+
await addAction(metadataPath, stableJson(metadataTemplate()), 'json');
|
|
1230
|
+
if (
|
|
1231
|
+
nextManifest.scripts['catalog:generate'] &&
|
|
1232
|
+
dependencies(nextManifest)['create-kerf-component']
|
|
1233
|
+
) {
|
|
1234
|
+
generatedPaths.push(
|
|
1235
|
+
resolve(selected.directory, nextManifest.kerfComponentCatalog.output),
|
|
1236
|
+
);
|
|
1237
|
+
if (nextManifest.kerfComponentCatalog.selectionOutput)
|
|
1238
|
+
generatedPaths.push(
|
|
1239
|
+
resolve(
|
|
1240
|
+
selected.directory,
|
|
1241
|
+
nextManifest.kerfComponentCatalog.selectionOutput,
|
|
1242
|
+
),
|
|
1243
|
+
);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1225
1246
|
}
|
|
1226
1247
|
|
|
1227
1248
|
for (const [id, resolution] of Object.entries(requestedResolutions)) {
|
|
1228
|
-
if (!['keep', 'kerf'].includes(resolution))
|
|
1229
|
-
throw new Error(`Resolution ${id} must be keep or
|
|
1249
|
+
if (!['keep', 'kerf', 'skip'].includes(resolution))
|
|
1250
|
+
throw new Error(`Resolution ${id} must be keep, kerf, or skip.`);
|
|
1230
1251
|
if (!knownResolutionIds.has(id))
|
|
1231
1252
|
throw new Error(`Unknown resolution id ${id}.`);
|
|
1232
|
-
if (
|
|
1253
|
+
if (resolution === 'skip' && activeConflictIds.has(id))
|
|
1233
1254
|
throw new Error(
|
|
1234
|
-
`
|
|
1255
|
+
`Resolution ${id} cannot skip a conflict; choose keep or kerf.`,
|
|
1256
|
+
);
|
|
1257
|
+
if (
|
|
1258
|
+
!activeConflictIds.has(id) &&
|
|
1259
|
+
!(resolution !== 'keep' && activeProposalIds.has(id))
|
|
1260
|
+
)
|
|
1261
|
+
throw new Error(
|
|
1262
|
+
`Stale resolution id ${id}; there is no applicable conflict or proposal.`,
|
|
1235
1263
|
);
|
|
1236
1264
|
}
|
|
1237
1265
|
const manager = await packageManagerInfo(root);
|
|
@@ -1264,8 +1292,12 @@ export async function planKerfSetup({
|
|
|
1264
1292
|
...(guidanceSource ? { guidanceSource } : {}),
|
|
1265
1293
|
managed: managedAfter,
|
|
1266
1294
|
resolutions: Object.fromEntries(
|
|
1267
|
-
[...activeConflictIds]
|
|
1268
|
-
.filter(
|
|
1295
|
+
[...new Set([...activeConflictIds, ...activeProposalIds])]
|
|
1296
|
+
.filter(
|
|
1297
|
+
(id) =>
|
|
1298
|
+
(activeConflictIds.has(id) && resolutions[id] === 'keep') ||
|
|
1299
|
+
(activeProposalIds.has(id) && resolutions[id] === 'skip'),
|
|
1300
|
+
)
|
|
1269
1301
|
.map((id) => [id, resolutions[id]]),
|
|
1270
1302
|
),
|
|
1271
1303
|
},
|
|
@@ -1283,6 +1315,9 @@ export async function planKerfSetup({
|
|
|
1283
1315
|
mode,
|
|
1284
1316
|
setupVersion,
|
|
1285
1317
|
actions,
|
|
1318
|
+
proposalIds: [...activeProposalIds].filter(
|
|
1319
|
+
(id) => resolutions[id] !== 'skip',
|
|
1320
|
+
),
|
|
1286
1321
|
conflicts,
|
|
1287
1322
|
generatedPaths,
|
|
1288
1323
|
};
|
|
@@ -1354,6 +1389,8 @@ export function formatSetupPlan(plan) {
|
|
|
1354
1389
|
lines.push(
|
|
1355
1390
|
`CONFLICT ${conflict.id}: ${conflict.message} (use --resolve ${conflict.id}=keep|kerf)`,
|
|
1356
1391
|
);
|
|
1392
|
+
for (const id of plan.proposalIds ?? [])
|
|
1393
|
+
lines.push(`PROPOSAL ${id} (use --resolve ${id}=skip to decline)`);
|
|
1357
1394
|
if (!plan.actions.length && !plan.conflicts.length) lines.push('No changes.');
|
|
1358
1395
|
lines.push('AI guidance: .claude/skills/kerf-app/SKILL.md');
|
|
1359
1396
|
if (plan.mode === 'ui') {
|
|
@@ -1511,7 +1548,7 @@ export async function applyKerfSetup(
|
|
|
1511
1548
|
? { env: { ...process.env, YARN_ENABLE_NETWORK: '0' } }
|
|
1512
1549
|
: {}),
|
|
1513
1550
|
});
|
|
1514
|
-
if (plan.mode === 'ui') {
|
|
1551
|
+
if (plan.mode === 'ui' && plan.generatedPaths?.length) {
|
|
1515
1552
|
for (const path of plan.generatedPaths ?? [])
|
|
1516
1553
|
await validateGeneratedPath(path);
|
|
1517
1554
|
await runner(plan.packageManager, ['run', 'catalog:generate'], {
|