@contentful/experience-design-system-cli 2.26.7-dev-build-ccb2aff.0 → 2.26.7-dev-build-8206e92.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.26.7-dev-build-ccb2aff.0",
3
+ "version": "2.26.7-dev-build-8206e92.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,13 @@
1
+ import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
2
+ type ReviewJsonComponent = {
3
+ key: string;
4
+ entry: CDFComponentEntry;
5
+ };
6
+ /**
7
+ * Builds the exact JSON string rendered by the read-only review panel.
8
+ *
9
+ * The FieldEditor intentionally continues to use the unfiltered component
10
+ * definition so toggling the panel never changes what an operator can save.
11
+ */
12
+ export declare function getReviewJsonPanelValue(selected: ReviewJsonComponent | null, showHiddenProps: boolean): string;
13
+ export {};
package/dist/src/index.js CHANGED
@@ -8554,6 +8554,66 @@ function applyDbMigrations(db) {
8554
8554
  if (!rawPropColNames.has("source_end_line")) {
8555
8555
  db.exec("ALTER TABLE raw_props ADD COLUMN source_end_line INTEGER");
8556
8556
  }
8557
+ const rawPropsDdl = db.prepare(`SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'raw_props'`).get();
8558
+ if (rawPropsDdl && !rawPropsDdl.sql.includes(`'unattached'`)) {
8559
+ db.exec("PRAGMA foreign_keys = OFF");
8560
+ try {
8561
+ db.exec("BEGIN");
8562
+ try {
8563
+ db.exec(`
8564
+ CREATE TABLE raw_props__new (
8565
+ session_id TEXT NOT NULL,
8566
+ component_id TEXT NOT NULL,
8567
+ name TEXT NOT NULL,
8568
+ type TEXT NOT NULL,
8569
+ required INTEGER NOT NULL CHECK (required IN (0, 1)),
8570
+ category TEXT CHECK (category IN ('content', 'design', 'state')),
8571
+ default_value TEXT,
8572
+ description TEXT,
8573
+ token_reference TEXT,
8574
+ position INTEGER NOT NULL,
8575
+ cdf_type TEXT,
8576
+ cdf_category TEXT CHECK (cdf_category IN ('content', 'design', 'state', 'unattached')),
8577
+ cdf_token_kind TEXT,
8578
+ rationale TEXT,
8579
+ source_start_line INTEGER,
8580
+ source_end_line INTEGER,
8581
+ PRIMARY KEY (session_id, component_id, name),
8582
+ FOREIGN KEY (session_id, component_id) REFERENCES raw_components(session_id, component_id) ON DELETE CASCADE
8583
+ );
8584
+
8585
+ INSERT INTO raw_props__new
8586
+ (session_id, component_id, name, type, required, category, default_value,
8587
+ description, token_reference, position, cdf_type, cdf_category, cdf_token_kind,
8588
+ rationale, source_start_line, source_end_line)
8589
+ SELECT
8590
+ session_id, component_id, name, type, required, category, default_value,
8591
+ description, token_reference, position, cdf_type, cdf_category, cdf_token_kind,
8592
+ rationale, source_start_line, source_end_line
8593
+ FROM raw_props;
8594
+
8595
+ DROP TABLE raw_props;
8596
+ ALTER TABLE raw_props__new RENAME TO raw_props;
8597
+ CREATE INDEX IF NOT EXISTS idx_raw_props_session ON raw_props(session_id, component_id);
8598
+
8599
+ -- Rows written by a pre-migration exclude_prop still say cdf_type = 'excluded'
8600
+ -- with cdf_category = NULL. Backfill them into the new unattached shape so an
8601
+ -- in-flight local session doesn't end up with an unprintable half-migrated row.
8602
+ UPDATE raw_props
8603
+ SET cdf_category = 'unattached',
8604
+ cdf_type = CASE WHEN type = 'boolean' THEN 'boolean' ELSE 'string' END,
8605
+ required = 0
8606
+ WHERE cdf_type = 'excluded';
8607
+ `);
8608
+ db.exec("COMMIT");
8609
+ } catch (e) {
8610
+ db.exec("ROLLBACK");
8611
+ throw e;
8612
+ }
8613
+ } finally {
8614
+ db.exec("PRAGMA foreign_keys = ON");
8615
+ }
8616
+ }
8557
8617
  if (!rawCompColNames.has("reject_reason")) {
8558
8618
  db.exec("ALTER TABLE raw_components ADD COLUMN reject_reason TEXT");
8559
8619
  }
@@ -8739,7 +8799,12 @@ function applyToolCalls(db, sessionId2, componentId, componentName, calls, incom
8739
8799
  WHERE session_id = ? AND component_id = ? AND name = ?`
8740
8800
  );
8741
8801
  const clearProp = db.prepare(
8742
- `UPDATE raw_props SET cdf_type = 'excluded', cdf_category = NULL, cdf_token_kind = NULL, rationale = ?
8802
+ `UPDATE raw_props
8803
+ SET cdf_type = CASE WHEN type = 'boolean' THEN 'boolean' ELSE 'string' END,
8804
+ cdf_category = 'unattached',
8805
+ cdf_token_kind = NULL,
8806
+ required = 0,
8807
+ rationale = ?
8743
8808
  WHERE session_id = ? AND component_id = ? AND name = ?`
8744
8809
  );
8745
8810
  const deleteAllowedValues = db.prepare(
@@ -9338,7 +9403,7 @@ function loadCDFComponents(db, sessionId2) {
9338
9403
  `SELECT component_id, name, required, default_value, description,
9339
9404
  cdf_type, cdf_category, cdf_token_kind, position
9340
9405
  FROM raw_props
9341
- WHERE session_id = ? AND cdf_type IS NOT NULL AND cdf_type != 'excluded'
9406
+ WHERE session_id = ? AND cdf_type IS NOT NULL
9342
9407
  ORDER BY component_id, position`
9343
9408
  ).all(sessionId2);
9344
9409
  const allowedValues = db.prepare(
@@ -21308,6 +21373,27 @@ var init_merge_ai_decisions = __esm({
21308
21373
  }
21309
21374
  });
21310
21375
 
21376
+ // packages/experience-design-system-cli/src/import/tui/steps/review-json-panel.ts
21377
+ function getReviewJsonPanelValue(selected, showHiddenProps) {
21378
+ if (!selected) return "";
21379
+ const entry = showHiddenProps ? selected.entry : {
21380
+ ...selected.entry,
21381
+ $properties: Object.fromEntries(
21382
+ Object.entries(selected.entry.$properties ?? {}).filter(
21383
+ ([, definition]) => !HIDDEN_PROP_CATEGORIES.has(definition.$category)
21384
+ )
21385
+ )
21386
+ };
21387
+ return JSON.stringify({ [selected.key]: entry }, null, 2);
21388
+ }
21389
+ var HIDDEN_PROP_CATEGORIES;
21390
+ var init_review_json_panel = __esm({
21391
+ "packages/experience-design-system-cli/src/import/tui/steps/review-json-panel.ts"() {
21392
+ "use strict";
21393
+ HIDDEN_PROP_CATEGORIES = /* @__PURE__ */ new Set(["state", "unattached"]);
21394
+ }
21395
+ });
21396
+
21311
21397
  // packages/experience-design-system-cli/src/analyze/cycle-view.ts
21312
21398
  function computeCycleView(components) {
21313
21399
  const filtered = components.filter((c2) => c2.status !== "rejected");
@@ -23600,6 +23686,7 @@ function GenerateReviewStep({
23600
23686
  const [showFinalize, setShowFinalize] = useState26(false);
23601
23687
  const [showQuit, setShowQuit] = useState26(false);
23602
23688
  const [showJson, setShowJson] = useState26(false);
23689
+ const [showHiddenProps, setShowHiddenProps] = useState26(false);
23603
23690
  const [draftValue, setDraftValue] = useState26("");
23604
23691
  const [saveError, setSaveError] = useState26(null);
23605
23692
  const [finalizeError, setFinalizeError] = useState26(initialFinalizeError);
@@ -24549,7 +24636,7 @@ function GenerateReviewStep({
24549
24636
  }
24550
24637
  if (!sidebarFocused && showJson) {
24551
24638
  const current = components[selectedIdx];
24552
- const currentJson = current ? JSON.stringify({ [current.key]: current.entry }, null, 2) : "";
24639
+ const currentJson = getReviewJsonPanelValue(current ?? null, showHiddenProps);
24553
24640
  const totalLines = currentJson.split("\n").length;
24554
24641
  const maxOffset = Math.max(0, totalLines - PANEL_HEIGHT);
24555
24642
  if (input === "g" && !key.ctrl) {
@@ -24686,6 +24773,12 @@ function GenerateReviewStep({
24686
24773
  pendingGRef.current = false;
24687
24774
  return;
24688
24775
  }
24776
+ if (input === "H") {
24777
+ setShowHiddenProps((prev) => !prev);
24778
+ setJsonScrollOffset(0);
24779
+ pendingGRef.current = false;
24780
+ return;
24781
+ }
24689
24782
  if (key.return) {
24690
24783
  const current = components[selectedIdx];
24691
24784
  if (!current) return;
@@ -24786,6 +24879,7 @@ function GenerateReviewStep({
24786
24879
  }
24787
24880
  const selected = components[selectedIdx] ?? null;
24788
24881
  const selectedJson = selected ? JSON.stringify({ [selected.key]: selected.entry }, null, 2) : "";
24882
+ const visibleJsonPanelValue = getReviewJsonPanelValue(selected, showHiddenProps);
24789
24883
  const isEmpty2 = (c2) => Object.keys(c2.entry.$properties).length === 0 && Object.keys(c2.entry.$slots ?? {}).length === 0;
24790
24884
  const emptyCount = components.filter(isEmpty2).length;
24791
24885
  const cycleParticipantSet = cycleView.structural;
@@ -25107,7 +25201,7 @@ function GenerateReviewStep({
25107
25201
  JsonPanel,
25108
25202
  {
25109
25203
  label: "GENERATED DEFINITION (read-only)",
25110
- value: selectedJson,
25204
+ value: visibleJsonPanelValue,
25111
25205
  scrollOffset: jsonScrollOffset,
25112
25206
  width: panelWidth,
25113
25207
  height: PANEL_HEIGHT,
@@ -25200,6 +25294,7 @@ function GenerateReviewStep({
25200
25294
  legendEntry("[P]", "component rationale", panelOpen === "component-rationale"),
25201
25295
  legendEntry("[s]", "source", panelOpen === "source"),
25202
25296
  legendEntry("[J]", showJson ? "hide JSON" : "show JSON", showJson),
25297
+ legendEntry("[H]", showHiddenProps ? "hide state/unattached" : "show state/unattached", showHiddenProps),
25203
25298
  breakingChanges.length > 0 && legendEntry("[b]", "see breaking changes", breakingPanel.isOpen),
25204
25299
  removedComponents.length > 0 && legendEntry("[d]", removedBannerCollapsed ? "show removed" : "hide removed", !removedBannerCollapsed),
25205
25300
  legendEntry("[/]", "search", searchOpen || searchQuery.length > 0),
@@ -25230,6 +25325,7 @@ var init_GenerateReviewStep = __esm({
25230
25325
  "packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx"() {
25231
25326
  "use strict";
25232
25327
  init_theme();
25328
+ init_review_json_panel();
25233
25329
  init_GroupedSidebar();
25234
25330
  init_composite_closure();
25235
25331
  init_slot_graph();
@@ -25380,6 +25476,7 @@ function AtomicGenerateReviewStep({
25380
25476
  const [showFinalize, setShowFinalize] = useState27(false);
25381
25477
  const [showQuit, setShowQuit] = useState27(false);
25382
25478
  const [showJson, setShowJson] = useState27(false);
25479
+ const [showHiddenProps, setShowHiddenProps] = useState27(false);
25383
25480
  const [draftValue, setDraftValue] = useState27("");
25384
25481
  const [saveError, setSaveError] = useState27(null);
25385
25482
  const [finalizeError, setFinalizeError] = useState27(initialFinalizeError);
@@ -25743,7 +25840,7 @@ function AtomicGenerateReviewStep({
25743
25840
  }
25744
25841
  if (!sidebarFocused && showJson) {
25745
25842
  const current = components[selectedIdx];
25746
- const currentJson = current ? JSON.stringify({ [current.key]: current.entry }, null, 2) : "";
25843
+ const currentJson = getReviewJsonPanelValue(current ?? null, showHiddenProps);
25747
25844
  const totalLines = currentJson.split("\n").length;
25748
25845
  const maxOffset = Math.max(0, totalLines - PANEL_HEIGHT2);
25749
25846
  if (input === "g" && !key.ctrl) {
@@ -25799,6 +25896,12 @@ function AtomicGenerateReviewStep({
25799
25896
  pendingGRef.current = false;
25800
25897
  return;
25801
25898
  }
25899
+ if (input === "H") {
25900
+ setShowHiddenProps((prev) => !prev);
25901
+ setJsonScrollOffset(0);
25902
+ pendingGRef.current = false;
25903
+ return;
25904
+ }
25802
25905
  if (key.upArrow || input === "k") {
25803
25906
  setSelectedIdx((prev) => {
25804
25907
  const newIdx = Math.max(0, prev - 1);
@@ -25831,6 +25934,7 @@ function AtomicGenerateReviewStep({
25831
25934
  }
25832
25935
  const selected = components[selectedIdx] ?? null;
25833
25936
  const selectedJson = selected ? JSON.stringify({ [selected.key]: selected.entry }, null, 2) : "";
25937
+ const visibleJsonPanelValue = getReviewJsonPanelValue(selected, showHiddenProps);
25834
25938
  const isEmpty2 = (c2) => Object.keys(c2.entry.$properties).length === 0;
25835
25939
  const emptyCount = components.filter(isEmpty2).length;
25836
25940
  const sidebarItems = components.map((c2) => ({
@@ -26006,7 +26110,7 @@ function AtomicGenerateReviewStep({
26006
26110
  JsonPanel,
26007
26111
  {
26008
26112
  label: "GENERATED DEFINITION (read-only)",
26009
- value: selectedJson,
26113
+ value: visibleJsonPanelValue,
26010
26114
  scrollOffset: jsonScrollOffset,
26011
26115
  width: panelWidth,
26012
26116
  height: PANEL_HEIGHT2,
@@ -26046,7 +26150,7 @@ function AtomicGenerateReviewStep({
26046
26150
  ),
26047
26151
  saveError && /* @__PURE__ */ jsx48(Text47, { color: PALETTE.error, children: "\u2717 " + saveError }),
26048
26152
  /* @__PURE__ */ jsxs47(Text47, { dimColor: true, children: [
26049
- sidebarFocused ? " [a] accept [r] reject [A] accept all [i] prop rationale [I] component rationale [s] source [J] " + (showJson ? "hide JSON" : "show JSON") + " [^z] undo [^y] redo [^r] reload [F] finalize [e/Tab] focus panel" + (livePreview && removedComponents.length > 0 ? " [d] removed list" : "") + " [q] quit" : showJson ? " [j/k] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list (edit fields)",
26153
+ sidebarFocused ? " [a] accept [r] reject [A] accept all [i] prop rationale [I] component rationale [s] source [J] " + (showJson ? "hide JSON" : "show JSON") + " [H] " + (showHiddenProps ? "hide state/unattached" : "show state/unattached") + " [^z] undo [^y] redo [^r] reload [F] finalize [e/Tab] focus panel" + (livePreview && removedComponents.length > 0 ? " [d] removed list" : "") + " [q] quit" : showJson ? " [j/k] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list (edit fields)",
26050
26154
  livePreviewHook.status === "running" && /* @__PURE__ */ jsx48(Text47, { children: ` ${livePreviewSpinner} live preview` }),
26051
26155
  livePreviewHook.disabled && /* @__PURE__ */ jsx48(Text47, { children: " \xB7 live preview disabled" })
26052
26156
  ] })
@@ -26093,6 +26197,7 @@ var init_AtomicGenerateReviewStep = __esm({
26093
26197
  init_useFinalizePreview();
26094
26198
  init_scroll_offset();
26095
26199
  init_theme();
26200
+ init_review_json_panel();
26096
26201
  VISIBLE_COUNT3 = 20;
26097
26202
  PANEL_HEIGHT2 = 22;
26098
26203
  }
@@ -31347,7 +31452,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
31347
31452
  const allOk = failed.length === 0;
31348
31453
  const cachedNote = cachedResults.length > 0 ? c.dim(` (${cachedResults.length} cached)`) : "";
31349
31454
  process.stderr.write(
31350
- (allOk ? c.green("\u2713") : c.yellow("\u26A0")) + ` ${generated.length + cachedResults.length}/${componentResults.length} components` + cachedNote + c.dim(` ${totalClassified} classified, ${totalExcluded} excluded`) + "\n"
31455
+ (allOk ? c.green("\u2713") : c.yellow("\u26A0")) + ` ${generated.length + cachedResults.length}/${componentResults.length} components` + cachedNote + c.dim(` ${totalClassified} classified, ${totalExcluded} unattached`) + "\n"
31351
31456
  );
31352
31457
  process.stdout.write(`renamed-slots: ${totalRenamedSlots}
31353
31458
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.26.7-dev-build-ccb2aff.0",
3
+ "version": "2.26.7-dev-build-8206e92.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "svelte": "^5.56.4",
40
40
  "ts-morph": "^27.0.2",
41
41
  "typescript": "^5.9.3",
42
- "@contentful/experience-design-system-types": "2.26.7-dev-build-ccb2aff.0"
42
+ "@contentful/experience-design-system-types": "2.26.7-dev-build-8206e92.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@tsconfig/node24": "^24.0.4",
@@ -51,9 +51,9 @@
51
51
  "ink-testing-library": "^4.0.0",
52
52
  "typescript-eslint": "^8.67.0",
53
53
  "vitest": "^4.0.16",
54
- "@contentful/experience-design-system-extraction": "2.26.7-dev-build-ccb2aff.0",
55
- "@contentful/experience-design-system-generation": "2.26.7-dev-build-ccb2aff.0",
56
- "@contentful/experience-design-system-client": "2.26.7-dev-build-ccb2aff.0"
54
+ "@contentful/experience-design-system-client": "2.26.7-dev-build-8206e92.0",
55
+ "@contentful/experience-design-system-extraction": "2.26.7-dev-build-8206e92.0",
56
+ "@contentful/experience-design-system-generation": "2.26.7-dev-build-8206e92.0"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",