@squiz/dxp-cli-next 5.19.0-develop.3 → 5.19.0-develop.4
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.
|
@@ -16,7 +16,7 @@ export declare class ComponentDefinition {
|
|
|
16
16
|
copyMockedUriFiles(copyDir: string): Promise<void>;
|
|
17
17
|
}
|
|
18
18
|
export declare const BasicDefinition: z.ZodIntersection<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
19
|
-
type: z.ZodLiteral<"server"
|
|
19
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"server">>>;
|
|
20
20
|
mainFunction: z.ZodString;
|
|
21
21
|
functions: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
22
22
|
name: z.ZodString;
|
|
@@ -35,7 +35,7 @@ export declare const BasicDefinition: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
|
35
35
|
entry: string;
|
|
36
36
|
}[]>;
|
|
37
37
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
38
|
-
type: z.ZodLiteral<"server"
|
|
38
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"server">>>;
|
|
39
39
|
mainFunction: z.ZodString;
|
|
40
40
|
functions: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
41
41
|
name: z.ZodString;
|
|
@@ -54,7 +54,7 @@ export declare const BasicDefinition: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
|
54
54
|
entry: string;
|
|
55
55
|
}[]>;
|
|
56
56
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
57
|
-
type: z.ZodLiteral<"server"
|
|
57
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"server">>>;
|
|
58
58
|
mainFunction: z.ZodString;
|
|
59
59
|
functions: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
60
60
|
name: z.ZodString;
|
|
@@ -133,7 +133,7 @@ class ComponentDefinition {
|
|
|
133
133
|
exports.ComponentDefinition = ComponentDefinition;
|
|
134
134
|
const ServerDefinition = zod_1.z
|
|
135
135
|
.object({
|
|
136
|
-
type: zod_1.z.literal('server'),
|
|
136
|
+
type: zod_1.z.literal('server').optional().default('server'),
|
|
137
137
|
mainFunction: zod_1.z.string(),
|
|
138
138
|
functions: zod_1.z
|
|
139
139
|
.array(zod_1.z.object({
|
|
@@ -147,6 +147,15 @@ describe('cmp > utils > definitions', () => {
|
|
|
147
147
|
extraProperty: 'my-extra-property',
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
|
+
test('manifest does not require "type" property and defaults to server definition', () => {
|
|
151
|
+
var _a;
|
|
152
|
+
const manifest = createManifest({
|
|
153
|
+
type: undefined,
|
|
154
|
+
});
|
|
155
|
+
const result = definitions_1.BasicDefinition.safeParse(manifest);
|
|
156
|
+
expect(result.success).toBe(true);
|
|
157
|
+
expect((_a = result.data) === null || _a === void 0 ? void 0 : _a.type).toBe('server');
|
|
158
|
+
});
|
|
150
159
|
});
|
|
151
160
|
describe('ComponentDefinition.load()', () => {
|
|
152
161
|
/////////////////
|