@contentful/experience-design-system-cli 2.32.1-dev-build-d28a6f8.0 → 2.32.1-dev-build-413e3a3.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.32.1-dev-build-d28a6f8.0",
3
+ "version": "2.32.1-dev-build-413e3a3.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/dist/src/index.js CHANGED
@@ -8557,9 +8557,9 @@ var init_component_id = __esm({
8557
8557
  }
8558
8558
  });
8559
8559
 
8560
- // packages/experience-design-system-cli/src/session/core/cdf/server-type-map.ts
8561
- function mapServerTypeToCdfType(serverType) {
8562
- switch (serverType.toLowerCase()) {
8560
+ // packages/experience-design-system-cli/src/session/core/cdf/contentful-type-map.ts
8561
+ function mapContentfulTypeToCdfType(contentfulType) {
8562
+ switch (contentfulType.toLowerCase()) {
8563
8563
  case "string":
8564
8564
  case "text":
8565
8565
  return "string";
@@ -8580,17 +8580,17 @@ function mapServerTypeToCdfType(serverType) {
8580
8580
  return "string";
8581
8581
  }
8582
8582
  }
8583
- function resolveCdfCategory(serverCategory, propName, contentProps, designProps) {
8584
- if (serverCategory && VALID_CATEGORIES2.includes(serverCategory)) {
8585
- return serverCategory;
8583
+ function resolveCdfCategory(contentfulCategory, propName, contentProps, designProps) {
8584
+ if (contentfulCategory && VALID_CATEGORIES2.includes(contentfulCategory)) {
8585
+ return contentfulCategory;
8586
8586
  }
8587
8587
  if (contentProps.has(propName)) return "content";
8588
8588
  if (designProps.has(propName)) return "design";
8589
8589
  return "state";
8590
8590
  }
8591
8591
  var VALID_CATEGORIES2;
8592
- var init_server_type_map = __esm({
8593
- "packages/experience-design-system-cli/src/session/core/cdf/server-type-map.ts"() {
8592
+ var init_contentful_type_map = __esm({
8593
+ "packages/experience-design-system-cli/src/session/core/cdf/contentful-type-map.ts"() {
8594
8594
  "use strict";
8595
8595
  VALID_CATEGORIES2 = ["content", "design", "state"];
8596
8596
  }
@@ -10369,7 +10369,7 @@ function seedCDFFromPreviewResponse(db, sessionId2, removedItems) {
10369
10369
  const contentProps = new Set(item.contentProperties);
10370
10370
  const designProps = new Set(item.designProperties);
10371
10371
  for (const [propName, propSummary] of Object.entries(item.fullProperties)) {
10372
- const cdfType = mapServerTypeToCdfType(propSummary.type);
10372
+ const cdfType = mapContentfulTypeToCdfType(propSummary.type);
10373
10373
  const cdfCategory = resolveCdfCategory(propSummary.category, propName, contentProps, designProps);
10374
10374
  const result = updateStmt.run(cdfType, cdfCategory, sessionId2, localComponent.component_id, propName);
10375
10375
  totalSeeded += Number(result.changes);
@@ -10400,7 +10400,7 @@ function seedDefaultsFromChangedItems(db, sessionId2, changedItems) {
10400
10400
  const result2 = updateDefaultStmt.run(defaultStr, sessionId2, localComponent.component_id, propName);
10401
10401
  totalSeeded += Number(result2.changes);
10402
10402
  }
10403
- const cdfType = mapServerTypeToCdfType(propSummary.type);
10403
+ const cdfType = mapContentfulTypeToCdfType(propSummary.type);
10404
10404
  const cdfCategory = resolveCdfCategory(propSummary.category, propName, contentProps, designProps);
10405
10405
  const result = updateCDFStmt.run(cdfType, cdfCategory, sessionId2, localComponent.component_id, propName);
10406
10406
  totalSeeded += Number(result.changes);
@@ -10764,7 +10764,7 @@ var init_db = __esm({
10764
10764
  "use strict";
10765
10765
  init_source_excerpt();
10766
10766
  init_component_id();
10767
- init_server_type_map();
10767
+ init_contentful_type_map();
10768
10768
  init_group_by();
10769
10769
  init_read();
10770
10770
  init_write();
@@ -10774,7 +10774,7 @@ var init_db = __esm({
10774
10774
  init_component_id();
10775
10775
  init_input_hash();
10776
10776
  init_input_hash2();
10777
- init_server_type_map();
10777
+ init_contentful_type_map();
10778
10778
  SCHEMA = `
10779
10779
  PRAGMA journal_mode = WAL;
10780
10780
  PRAGMA foreign_keys = ON;
@@ -0,0 +1,15 @@
1
+ export type CdfCategory = 'content' | 'design' | 'state';
2
+ /**
3
+ * Translate a Contentful CMA type name into the CLI's internal CDF type name.
4
+ * The vocabularies overlap but differ (e.g. Contentful "symbol" → CDF "enum",
5
+ * Contentful "text" → CDF "string"). Unknown inputs default to "string".
6
+ */
7
+ export declare function mapContentfulTypeToCdfType(contentfulType: string): string;
8
+ /**
9
+ * Decide which CDF category (`content` | `design` | `state`) a prop belongs to.
10
+ *
11
+ * Trusts a valid Contentful-provided category when present. Otherwise, falls
12
+ * back to per-component prop-name classification (contentProperties /
13
+ * designProperties from the same Contentful response), defaulting to `state`.
14
+ */
15
+ export declare function resolveCdfCategory(contentfulCategory: string | null | undefined, propName: string, contentProps: Set<string>, designProps: Set<string>): CdfCategory;
@@ -9,7 +9,7 @@ import { type SessionResolution } from './services/session-resolver.js';
9
9
  export { deriveComponentId } from './core/components/component-id.js';
10
10
  export { computeComponentInputHash } from './core/components/input-hash.js';
11
11
  export { computeTokenInputHash } from './core/tokens/input-hash.js';
12
- export { mapServerTypeToCdfType, resolveCdfCategory } from './core/cdf/server-type-map.js';
12
+ export { mapContentfulTypeToCdfType, resolveCdfCategory } from './core/cdf/contentful-type-map.js';
13
13
  export type StepStatus = 'pending' | 'complete' | 'failed' | 'interrupted';
14
14
  export type CommandName = 'analyze extract' | 'analyze select' | 'generate components' | 'generate tokens' | 'generate edit' | 'apply preview' | 'apply select' | 'apply push' | 'print components' | 'print tokens' | 'map tokens' | 'fetch existing entities' | 'import';
15
15
  export interface SessionRow {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.32.1-dev-build-d28a6f8.0",
3
+ "version": "2.32.1-dev-build-413e3a3.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,8 +40,8 @@
40
40
  "svelte": "^5.56.4",
41
41
  "ts-morph": "^27.0.2",
42
42
  "typescript": "^5.9.3",
43
- "@contentful/experience-design-system-cli-v2": "2.32.1-dev-build-d28a6f8.0",
44
- "@contentful/experience-design-system-types": "2.32.1-dev-build-d28a6f8.0"
43
+ "@contentful/experience-design-system-cli-v2": "2.32.1-dev-build-413e3a3.0",
44
+ "@contentful/experience-design-system-types": "2.32.1-dev-build-413e3a3.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@tsconfig/node24": "^24.0.4",
@@ -53,9 +53,9 @@
53
53
  "ink-testing-library": "^4.0.0",
54
54
  "typescript-eslint": "^8.67.0",
55
55
  "vitest": "^4.0.16",
56
- "@contentful/experience-design-system-client": "2.32.1-dev-build-d28a6f8.0",
57
- "@contentful/experience-design-system-generation": "2.32.1-dev-build-d28a6f8.0",
58
- "@contentful/experience-design-system-extraction": "2.32.1-dev-build-d28a6f8.0"
56
+ "@contentful/experience-design-system-client": "2.32.1-dev-build-413e3a3.0",
57
+ "@contentful/experience-design-system-extraction": "2.32.1-dev-build-413e3a3.0",
58
+ "@contentful/experience-design-system-generation": "2.32.1-dev-build-413e3a3.0"
59
59
  },
60
60
  "repository": {
61
61
  "type": "git",
@@ -1,3 +0,0 @@
1
- export type CdfCategory = 'content' | 'design' | 'state';
2
- export declare function mapServerTypeToCdfType(serverType: string): string;
3
- export declare function resolveCdfCategory(serverCategory: string | null | undefined, propName: string, contentProps: Set<string>, designProps: Set<string>): CdfCategory;