@contentful/experience-design-system-types 2.2.1 → 2.5.2-dev-build-eebccad.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/README.md CHANGED
@@ -1,25 +1,50 @@
1
1
  # @contentful/experience-design-system-types
2
2
 
3
- Shared TypeScript types for the Contentful Experience Design System import pipeline. Covers the two file formats consumers provide (CDF for components, DTCG for tokens) and the contract types for the Design System Sources API.
3
+ Shared TypeScript types, Zod schemas, and JSON schema validators for the Contentful Experience Design System import pipeline.
4
4
 
5
- ## Modules
5
+ This package is a bundled dependency of `@contentful/experience-design-system-cli`. You generally don't need to install it directly — the CLI brings it in. Use it when you want to validate or generate CDF/DTCG files in your own tooling.
6
+
7
+ ## Formats
6
8
 
7
9
  ### CDF — Component Definition Format
8
10
 
9
- Types and validation for `.cdf.json` component definition files that describe a design system's component library. Exports `validateCDF`, `CDF_V1_SCHEMA_URL`, `CDF_PROPERTY_TYPES`, `CDFComponentEntry`, `CDFPropertyDefinition`, `CDFValidationError`.
11
+ Typed and validated structure for `.cdf.json` component definition files that describe a design system's component library.
12
+
13
+ **Exports:** `validateCDF`, `CDF_V1_SCHEMA_URL`, `CDF_PROPERTY_TYPES`, `CDFComponentEntry`, `CDFPropertyDefinition`, `CDFValidationError`
10
14
 
11
15
  ### DTCG — Design Token Community Group
12
16
 
13
- Types for `.tokens.json` files in the [W3C DTCG format](https://tr.designtokens.org/format/) that describe a design system's token library. Exports `DESIGN_TOKEN_TYPES`, `DesignTokenType`, `DTCGTokenEntry`, `DTCGTokenGroup`, `DTCGTokenNode`, `DTCGTokenGroupNode`.
17
+ Types for `.tokens.json` files following the [W3C DTCG format](https://tr.designtokens.org/format/) that describe a design system's token library.
18
+
19
+ **Exports:** `DESIGN_TOKEN_TYPES`, `DesignTokenType`, `DTCGTokenEntry`, `DTCGTokenGroup`, `DTCGTokenNode`, `DTCGTokenGroupNode`
14
20
 
15
21
  ### Sources API — Manifest
16
22
 
17
- Request body sent to both the preview and apply endpoints. Exports `ManifestPayload`.
23
+ Request body sent to both the preview and apply endpoints.
24
+
25
+ **Exports:** `ManifestPayload`
18
26
 
19
27
  ### Sources API — Preview
20
28
 
21
- Response types for the Sources API preview endpoint, which returns a diff of what will change before committing. Exports `ServerPreviewResponse`, `EntityDiffGroup`, `ChangedEntity`, `BreakingChange`, `ChangeClassification`, `DownstreamImpact`, and entity summary types (`ComponentTypeSummary`, `DesignTokenSummary`, `TaxonomySummary`, `PropertySummary`).
29
+ Response types for the Sources API preview endpoint, which returns a diff of what will change before committing.
30
+
31
+ **Exports:** `ServerPreviewResponse`, `EntityDiffGroup`, `ChangedEntity`, `BreakingChange`, `ChangeClassification`, `DownstreamImpact`, `ComponentTypeSummary`, `DesignTokenSummary`, `TaxonomySummary`, `PropertySummary`
22
32
 
23
33
  ### Sources API — Apply
24
34
 
25
- Response types for the Sources API apply endpoint, which runs the async import operation. Exports `ApplyOperationResponse`, `ApplyOperationItem`, `ApplyOperationItemError`, `ApplyOperationStatus`, `ApplyGateError`.
35
+ Response types for the Sources API apply endpoint, which runs the async import operation.
36
+
37
+ **Exports:** `ApplyOperationResponse`, `ApplyOperationItem`, `ApplyOperationItemError`, `ApplyOperationStatus`, `ApplyGateError`
38
+
39
+ ## Development
40
+
41
+ ```bash
42
+ # Build
43
+ pnpm -F @contentful/experience-design-system-types build
44
+
45
+ # Test
46
+ pnpm -F @contentful/experience-design-system-types test
47
+
48
+ # Typecheck
49
+ pnpm -F @contentful/experience-design-system-types typecheck
50
+ ```
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-types",
3
- "version": "2.2.1",
3
+ "version": "2.5.2-dev-build-eebccad.0",
4
4
  "type": "module",
5
5
  "module": "./dist/src/index.js",
6
6
  "main": "./dist/src/index.js",
@@ -1,3 +1,5 @@
1
+ import type { CDFComponentEntry } from '../../cdf/index.js';
2
+ import type { DTCGTokenEntry } from '../../dtcg/index.js';
1
3
  export interface BreakingChange {
2
4
  propertyId: string;
3
5
  reason: 'removed' | 'added_required_no_default' | 'type_changed' | 'validation_narrowed';
@@ -48,7 +50,7 @@ export interface EntityDiffGroup<TCurrent, TProposed> {
48
50
  removed: TCurrent[];
49
51
  }
50
52
  export interface ServerPreviewResponse {
51
- components: EntityDiffGroup<ComponentTypeSummary, Record<string, unknown>>;
52
- tokens: EntityDiffGroup<DesignTokenSummary, Record<string, unknown>>;
53
- taxonomies: EntityDiffGroup<TaxonomySummary, Record<string, unknown>>;
53
+ components: EntityDiffGroup<ComponentTypeSummary, CDFComponentEntry>;
54
+ tokens: EntityDiffGroup<DesignTokenSummary, DTCGTokenEntry>;
55
+ taxonomies: EntityDiffGroup<TaxonomySummary, TaxonomySummary>;
54
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-types",
3
- "version": "2.2.1",
3
+ "version": "2.5.2-dev-build-eebccad.0",
4
4
  "type": "module",
5
5
  "module": "./dist/src/index.js",
6
6
  "main": "./dist/src/index.js",