@contentful/experience-design-system-types 2.28.1-dev-build-090b2d1.0 → 2.28.1-dev-build-2497ca0.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 +1 -1
- package/dist/src/cdf/index.d.ts +1 -1
- package/dist/src/cdf/index.js +1 -1
- package/dist/src/cdf/validate.d.ts +1 -9
- package/dist/src/cdf/validate.js +0 -33
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/src/cdf/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { validateCDF, parseCDFComponents
|
|
1
|
+
export { validateCDF, parseCDFComponents } from './validate.js';
|
|
2
2
|
export { CDF_V1_SCHEMA_URL } from './schema.js';
|
|
3
3
|
export { CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES } from './vocabularies.js';
|
|
4
4
|
export { CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, type CDFComponentEntry, type CDFPropertyDefinition, type CDFSlotDefinition, type CDFValidationError, } from './types.js';
|
package/dist/src/cdf/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { validateCDF, parseCDFComponents
|
|
1
|
+
export { validateCDF, parseCDFComponents } from './validate.js';
|
|
2
2
|
export { CDF_V1_SCHEMA_URL } from './schema.js';
|
|
3
3
|
export { CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES } from './vocabularies.js';
|
|
4
4
|
export { CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, } from './types.js';
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import type { CDFComponentEntry,
|
|
1
|
+
import type { CDFComponentEntry, CDFValidationResult } from './types.js';
|
|
2
2
|
export declare function parseCDFComponents(obj: Record<string, unknown>, prefix?: string): Array<{
|
|
3
3
|
key: string;
|
|
4
4
|
entry: CDFComponentEntry;
|
|
5
5
|
}>;
|
|
6
6
|
export declare function validateCDF(input: unknown): CDFValidationResult;
|
|
7
|
-
/**
|
|
8
|
-
* Enforces invariants the schema itself leaves optional but the generation
|
|
9
|
-
* skill promises: `$description` everywhere, and non-empty `$values` on enums.
|
|
10
|
-
*/
|
|
11
|
-
export declare function checkCDFComponentInvariants(components: Array<{
|
|
12
|
-
key: string;
|
|
13
|
-
entry: CDFComponentEntry;
|
|
14
|
-
}>): CDFValidationError[];
|
package/dist/src/cdf/validate.js
CHANGED
|
@@ -50,36 +50,3 @@ export function validateCDF(input) {
|
|
|
50
50
|
const components = parseCDFComponents(file);
|
|
51
51
|
return { valid: true, errors: [], components };
|
|
52
52
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Enforces invariants the schema itself leaves optional but the generation
|
|
55
|
-
* skill promises: `$description` everywhere, and non-empty `$values` on enums.
|
|
56
|
-
*/
|
|
57
|
-
export function checkCDFComponentInvariants(components) {
|
|
58
|
-
const errors = [];
|
|
59
|
-
for (const { key, entry } of components) {
|
|
60
|
-
if (!entry.$description) {
|
|
61
|
-
errors.push({
|
|
62
|
-
path: `/${key}/$description`,
|
|
63
|
-
message: `Component "${key}" is missing $description`,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
for (const [propName, prop] of Object.entries(entry.$properties ?? {})) {
|
|
67
|
-
if (!prop.$description) {
|
|
68
|
-
errors.push({
|
|
69
|
-
path: `/${key}/$properties/${propName}/$description`,
|
|
70
|
-
message: `Property "${propName}" on "${key}" is missing $description`,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (prop.$type === 'enum') {
|
|
74
|
-
const values = prop.$values;
|
|
75
|
-
if (!values || values.length === 0) {
|
|
76
|
-
errors.push({
|
|
77
|
-
path: `/${key}/$properties/${propName}/$values`,
|
|
78
|
-
message: `Property "${propName}" on "${key}" is $type "enum" but has no $values`,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return errors;
|
|
85
|
-
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { validateCDF, parseCDFComponents,
|
|
1
|
+
export { validateCDF, parseCDFComponents, CDF_V1_SCHEMA_URL, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, type CDFComponentEntry, type CDFPropertyDefinition, type CDFSlotDefinition, type CDFValidationError, } from './cdf/index.js';
|
|
2
2
|
export { DESIGN_TOKEN_TYPES, flattenDTCG, validateDTCG, DTCGTokenSchema, type DesignTokenType, type DTCGTokenEntry, type DTCGTokenGroup, type DTCGTokenNode, type DTCGTokenGroupNode, type DTCGValidationError, type DTCGValidationResult, } from './dtcg/index.js';
|
|
3
3
|
export type { BreakingChange, ChangeClassification, DownstreamImpact, PropertySummary, ComponentTypeSummary, DesignTokenSummary, TaxonomySummary, ChangedEntity, EntityDiffGroup, ServerPreviewResponse, } from './sources-api/preview/index.js';
|
|
4
4
|
export type { ApplyOperationStatus, ApplyOperationItemError, ApplyOperationItem, ApplyOperationResponse, ApplyGateError, } from './sources-api/apply/index.js';
|
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// CDF (Component Definition Format) exports
|
|
2
|
-
export { validateCDF, parseCDFComponents,
|
|
2
|
+
export { validateCDF, parseCDFComponents, CDF_V1_SCHEMA_URL, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, } from './cdf/index.js';
|
|
3
3
|
// DTCG (W3C Design Token Community Group)
|
|
4
4
|
export { DESIGN_TOKEN_TYPES, flattenDTCG, validateDTCG, DTCGTokenSchema, } from './dtcg/index.js';
|
|
5
5
|
export { buildManifest, buildFilteredManifest, stripUnsupportedSlotFields } from './sources-api/manifest/index.js';
|