@formspec/cli 0.1.0-alpha.8 → 0.1.0-alpha.9
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 +50 -37
- package/dist/__tests__/analyzer.test.d.ts +4 -1
- package/dist/__tests__/analyzer.test.d.ts.map +1 -1
- package/dist/__tests__/analyzer.test.js +5 -104
- package/dist/__tests__/analyzer.test.js.map +1 -1
- package/dist/__tests__/codegen.test.d.ts +4 -1
- package/dist/__tests__/codegen.test.d.ts.map +1 -1
- package/dist/__tests__/codegen.test.js +30 -484
- package/dist/__tests__/codegen.test.js.map +1 -1
- package/dist/__tests__/edge-cases.test.d.ts +5 -7
- package/dist/__tests__/edge-cases.test.d.ts.map +1 -1
- package/dist/__tests__/edge-cases.test.js +6 -373
- package/dist/__tests__/edge-cases.test.js.map +1 -1
- package/dist/__tests__/fixtures/edge-cases.d.ts.map +1 -1
- package/dist/__tests__/fixtures/edge-cases.js.map +1 -1
- package/dist/__tests__/integration.test.js +29 -18
- package/dist/__tests__/integration.test.js.map +1 -1
- package/dist/index.js +38 -18
- package/dist/index.js.map +1 -1
- package/dist/output/writer.d.ts +5 -5
- package/dist/output/writer.d.ts.map +1 -1
- package/dist/output/writer.js +13 -13
- package/dist/output/writer.js.map +1 -1
- package/dist/runtime/formspec-loader.d.ts.map +1 -1
- package/dist/runtime/formspec-loader.js +1 -3
- package/dist/runtime/formspec-loader.js.map +1 -1
- package/package.json +4 -4
- package/dist/analyzer/class-analyzer.d.ts +0 -75
- package/dist/analyzer/class-analyzer.d.ts.map +0 -1
- package/dist/analyzer/class-analyzer.js +0 -151
- package/dist/analyzer/class-analyzer.js.map +0 -1
- package/dist/analyzer/decorator-extractor.d.ts +0 -87
- package/dist/analyzer/decorator-extractor.d.ts.map +0 -1
- package/dist/analyzer/decorator-extractor.js +0 -193
- package/dist/analyzer/decorator-extractor.js.map +0 -1
- package/dist/analyzer/program.d.ts +0 -37
- package/dist/analyzer/program.d.ts.map +0 -1
- package/dist/analyzer/program.js +0 -89
- package/dist/analyzer/program.js.map +0 -1
- package/dist/analyzer/type-converter.d.ts +0 -97
- package/dist/analyzer/type-converter.d.ts.map +0 -1
- package/dist/analyzer/type-converter.js +0 -360
- package/dist/analyzer/type-converter.js.map +0 -1
- package/dist/codegen/index.d.ts +0 -76
- package/dist/codegen/index.d.ts.map +0 -1
- package/dist/codegen/index.js +0 -558
- package/dist/codegen/index.js.map +0 -1
- package/dist/generators/class-schema.d.ts +0 -43
- package/dist/generators/class-schema.d.ts.map +0 -1
- package/dist/generators/class-schema.js +0 -61
- package/dist/generators/class-schema.js.map +0 -1
- package/dist/generators/method-schema.d.ts +0 -57
- package/dist/generators/method-schema.d.ts.map +0 -1
- package/dist/generators/method-schema.js +0 -108
- package/dist/generators/method-schema.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests for the codegen type generation functions.
|
|
2
|
+
* Tests for the codegen type generation functions (imported from @formspec/build).
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive codegen tests are in @formspec/build.
|
|
5
|
+
* This file verifies the CLI can access the codegen API.
|
|
3
6
|
*/
|
|
4
7
|
import { describe, it, expect } from "vitest";
|
|
5
|
-
import { generateCodegenOutput
|
|
6
|
-
// =============================================================================
|
|
7
|
-
// Test Helpers
|
|
8
|
-
// =============================================================================
|
|
8
|
+
import { generateCodegenOutput } from "@formspec/build";
|
|
9
9
|
function createTypeMetadata(overrides = {}) {
|
|
10
10
|
return {
|
|
11
11
|
type: "string",
|
|
@@ -21,485 +21,31 @@ function createDecoratedClassInfo(overrides = {}) {
|
|
|
21
21
|
...overrides,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
age: createTypeMetadata({ type: "number", optional: true }),
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
53
|
-
expect(output).toContain("name: string;");
|
|
54
|
-
expect(output).toContain("age?: number | undefined;");
|
|
55
|
-
});
|
|
56
|
-
it("generates correct schema type for nullable fields", () => {
|
|
57
|
-
const cls = createDecoratedClassInfo({
|
|
58
|
-
name: "UserForm",
|
|
59
|
-
typeMetadata: {
|
|
60
|
-
middleName: createTypeMetadata({ type: "string", nullable: true }),
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
64
|
-
expect(output).toContain("middleName: string | null;");
|
|
65
|
-
});
|
|
66
|
-
it("generates correct schema type for nullable and optional fields", () => {
|
|
67
|
-
const cls = createDecoratedClassInfo({
|
|
68
|
-
name: "UserForm",
|
|
69
|
-
typeMetadata: {
|
|
70
|
-
nickname: createTypeMetadata({
|
|
71
|
-
type: "string",
|
|
72
|
-
nullable: true,
|
|
73
|
-
optional: true,
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
78
|
-
expect(output).toContain("nickname?: string | null | undefined;");
|
|
79
|
-
});
|
|
80
|
-
it("generates correct schema type for enum fields", () => {
|
|
81
|
-
const cls = createDecoratedClassInfo({
|
|
82
|
-
name: "UserForm",
|
|
83
|
-
typeMetadata: {
|
|
84
|
-
country: createTypeMetadata({
|
|
85
|
-
type: "enum",
|
|
86
|
-
values: ["us", "ca", "uk"],
|
|
87
|
-
}),
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
91
|
-
expect(output).toContain('country: "us" | "ca" | "uk";');
|
|
92
|
-
});
|
|
93
|
-
it("generates correct schema type for array fields", () => {
|
|
94
|
-
const cls = createDecoratedClassInfo({
|
|
95
|
-
name: "UserForm",
|
|
96
|
-
typeMetadata: {
|
|
97
|
-
tags: createTypeMetadata({
|
|
98
|
-
type: "array",
|
|
99
|
-
itemType: { type: "string" },
|
|
100
|
-
}),
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
104
|
-
expect(output).toContain("tags: string[];");
|
|
105
|
-
});
|
|
106
|
-
it("generates correct schema type for array of nullable items", () => {
|
|
107
|
-
const cls = createDecoratedClassInfo({
|
|
108
|
-
name: "UserForm",
|
|
109
|
-
typeMetadata: {
|
|
110
|
-
values: createTypeMetadata({
|
|
111
|
-
type: "array",
|
|
112
|
-
itemType: { type: "string", nullable: true },
|
|
113
|
-
}),
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
117
|
-
expect(output).toContain("values: (string | null)[];");
|
|
118
|
-
});
|
|
119
|
-
it("generates correct schema type for object fields", () => {
|
|
120
|
-
const cls = createDecoratedClassInfo({
|
|
121
|
-
name: "UserForm",
|
|
122
|
-
typeMetadata: {
|
|
123
|
-
address: createTypeMetadata({
|
|
124
|
-
type: "object",
|
|
125
|
-
properties: {
|
|
126
|
-
street: { type: "string" },
|
|
127
|
-
city: { type: "string" },
|
|
128
|
-
zip: { type: "string", optional: true },
|
|
129
|
-
},
|
|
130
|
-
}),
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
134
|
-
expect(output).toContain("address: { street: string; city: string; zip?: string | undefined };");
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
describe("property key escaping", () => {
|
|
138
|
-
it("escapes property names with special characters", () => {
|
|
139
|
-
const cls = createDecoratedClassInfo({
|
|
140
|
-
name: "TestForm",
|
|
141
|
-
typeMetadata: {
|
|
142
|
-
"user-name": createTypeMetadata({ type: "string" }),
|
|
143
|
-
"field with spaces": createTypeMetadata({ type: "string" }),
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
147
|
-
expect(output).toContain('"user-name": string;');
|
|
148
|
-
expect(output).toContain('"field with spaces": string;');
|
|
149
|
-
});
|
|
150
|
-
it("escapes reserved words", () => {
|
|
151
|
-
const cls = createDecoratedClassInfo({
|
|
152
|
-
name: "TestForm",
|
|
153
|
-
typeMetadata: {
|
|
154
|
-
class: createTypeMetadata({ type: "string" }),
|
|
155
|
-
function: createTypeMetadata({ type: "string" }),
|
|
156
|
-
import: createTypeMetadata({ type: "string" }),
|
|
157
|
-
},
|
|
158
|
-
});
|
|
159
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
160
|
-
expect(output).toContain('"class": string;');
|
|
161
|
-
expect(output).toContain('"function": string;');
|
|
162
|
-
expect(output).toContain('"import": string;');
|
|
163
|
-
});
|
|
164
|
-
it("does not escape valid identifiers in schema types", () => {
|
|
165
|
-
const cls = createDecoratedClassInfo({
|
|
166
|
-
name: "TestForm",
|
|
167
|
-
typeMetadata: {
|
|
168
|
-
firstName: createTypeMetadata({ type: "string" }),
|
|
169
|
-
_private: createTypeMetadata({ type: "string" }),
|
|
170
|
-
$dollar: createTypeMetadata({ type: "string" }),
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
174
|
-
// Extract just the schema type section
|
|
175
|
-
const schemaRegex = /export type TestFormSchema = \{[\s\S]*?\};/;
|
|
176
|
-
const schemaMatch = schemaRegex.exec(output);
|
|
177
|
-
expect(schemaMatch).not.toBeNull();
|
|
178
|
-
if (!schemaMatch)
|
|
179
|
-
throw new Error("Schema section not found");
|
|
180
|
-
const schemaSection = schemaMatch[0];
|
|
181
|
-
// Should have unquoted identifiers in schema type
|
|
182
|
-
expect(schemaSection).toContain("firstName: string;");
|
|
183
|
-
expect(schemaSection).toContain("_private: string;");
|
|
184
|
-
expect(schemaSection).toContain("$dollar: string;");
|
|
185
|
-
// Should NOT have quotes in the schema type section
|
|
186
|
-
expect(schemaSection).not.toContain('"firstName"');
|
|
187
|
-
expect(schemaSection).not.toContain('"_private"');
|
|
188
|
-
expect(schemaSection).not.toContain('"$dollar"');
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
describe("typed accessor generation", () => {
|
|
192
|
-
it("generates element tuple type", () => {
|
|
193
|
-
const cls = createDecoratedClassInfo({
|
|
194
|
-
name: "UserForm",
|
|
195
|
-
typeMetadata: {
|
|
196
|
-
name: createTypeMetadata({ type: "string" }),
|
|
197
|
-
age: createTypeMetadata({ type: "number", optional: true }),
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
201
|
-
expect(output).toContain("export type UserFormElements = readonly [");
|
|
202
|
-
expect(output).toContain('{ readonly _field: "text"; readonly id: "name"; readonly required: true }');
|
|
203
|
-
expect(output).toContain('{ readonly _field: "number"; readonly id: "age"; readonly required: false }');
|
|
204
|
-
});
|
|
205
|
-
it("generates enum options in element type", () => {
|
|
206
|
-
const cls = createDecoratedClassInfo({
|
|
207
|
-
name: "UserForm",
|
|
208
|
-
typeMetadata: {
|
|
209
|
-
status: createTypeMetadata({
|
|
210
|
-
type: "enum",
|
|
211
|
-
values: ["active", "inactive"],
|
|
212
|
-
}),
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
216
|
-
expect(output).toContain('readonly options: readonly ["active", "inactive"]');
|
|
217
|
-
});
|
|
218
|
-
it("generates FormSpec type alias", () => {
|
|
219
|
-
const cls = createDecoratedClassInfo({
|
|
220
|
-
name: "UserForm",
|
|
221
|
-
typeMetadata: {
|
|
222
|
-
name: createTypeMetadata({ type: "string" }),
|
|
223
|
-
},
|
|
224
|
-
});
|
|
225
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
226
|
-
expect(output).toContain("export type UserFormFormSpec = { readonly elements: UserFormElements };");
|
|
227
|
-
});
|
|
228
|
-
it("generates typed accessor function", () => {
|
|
229
|
-
const cls = createDecoratedClassInfo({
|
|
230
|
-
name: "UserForm",
|
|
231
|
-
typeMetadata: {
|
|
232
|
-
name: createTypeMetadata({ type: "string" }),
|
|
233
|
-
},
|
|
234
|
-
});
|
|
235
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
236
|
-
expect(output).toContain("export function getUserFormFormSpec(): UserFormFormSpec {");
|
|
237
|
-
expect(output).toContain("return toFormSpec(UserForm) as unknown as UserFormFormSpec;");
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
describe("multiple classes", () => {
|
|
241
|
-
it("generates types for multiple classes", () => {
|
|
242
|
-
const classes = [
|
|
243
|
-
createDecoratedClassInfo({
|
|
244
|
-
name: "UserForm",
|
|
245
|
-
typeMetadata: { name: createTypeMetadata({ type: "string" }) },
|
|
246
|
-
}),
|
|
247
|
-
createDecoratedClassInfo({
|
|
248
|
-
name: "ProductForm",
|
|
249
|
-
sourcePath: "./product",
|
|
250
|
-
typeMetadata: { price: createTypeMetadata({ type: "number" }) },
|
|
251
|
-
}),
|
|
252
|
-
];
|
|
253
|
-
const output = generateCodegenOutput(classes, "/tmp/out.ts", "/tmp");
|
|
254
|
-
expect(output).toContain("export type UserFormSchema = {");
|
|
255
|
-
expect(output).toContain("export type ProductFormSchema = {");
|
|
256
|
-
expect(output).toContain("export function getUserFormFormSpec()");
|
|
257
|
-
expect(output).toContain("export function getProductFormFormSpec()");
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
describe("edge cases", () => {
|
|
261
|
-
it("handles empty enum values array", () => {
|
|
262
|
-
const cls = createDecoratedClassInfo({
|
|
263
|
-
name: "TestForm",
|
|
264
|
-
typeMetadata: {
|
|
265
|
-
status: createTypeMetadata({ type: "enum", values: [] }),
|
|
266
|
-
},
|
|
267
|
-
});
|
|
268
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
269
|
-
// Should fall back to string type
|
|
270
|
-
expect(output).toContain("status: string;");
|
|
271
|
-
});
|
|
272
|
-
it("handles unknown type", () => {
|
|
273
|
-
const cls = createDecoratedClassInfo({
|
|
274
|
-
name: "TestForm",
|
|
275
|
-
typeMetadata: {
|
|
276
|
-
data: createTypeMetadata({ type: "unknown" }),
|
|
277
|
-
},
|
|
278
|
-
});
|
|
279
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
280
|
-
expect(output).toContain("data: unknown;");
|
|
281
|
-
});
|
|
282
|
-
it("handles array without itemType", () => {
|
|
283
|
-
const cls = createDecoratedClassInfo({
|
|
284
|
-
name: "TestForm",
|
|
285
|
-
typeMetadata: {
|
|
286
|
-
items: createTypeMetadata({ type: "array" }),
|
|
287
|
-
},
|
|
288
|
-
});
|
|
289
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
290
|
-
expect(output).toContain("items: unknown[];");
|
|
291
|
-
});
|
|
292
|
-
it("handles object without properties", () => {
|
|
293
|
-
const cls = createDecoratedClassInfo({
|
|
294
|
-
name: "TestForm",
|
|
295
|
-
typeMetadata: {
|
|
296
|
-
data: createTypeMetadata({ type: "object" }),
|
|
297
|
-
},
|
|
298
|
-
});
|
|
299
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
300
|
-
expect(output).toContain("data: Record<string, unknown>;");
|
|
301
|
-
});
|
|
302
|
-
it("handles number enum values", () => {
|
|
303
|
-
const cls = createDecoratedClassInfo({
|
|
304
|
-
name: "TestForm",
|
|
305
|
-
typeMetadata: {
|
|
306
|
-
priority: createTypeMetadata({
|
|
307
|
-
type: "enum",
|
|
308
|
-
values: [1, 2, 3],
|
|
309
|
-
}),
|
|
310
|
-
},
|
|
311
|
-
});
|
|
312
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
313
|
-
expect(output).toContain("priority: 1 | 2 | 3;");
|
|
314
|
-
});
|
|
315
|
-
it("handles enum values with special characters (quotes, backslashes)", () => {
|
|
316
|
-
const cls = createDecoratedClassInfo({
|
|
317
|
-
name: "TestForm",
|
|
318
|
-
typeMetadata: {
|
|
319
|
-
weird: createTypeMetadata({
|
|
320
|
-
type: "enum",
|
|
321
|
-
values: ['foo"bar', "back\\slash", "new\nline"],
|
|
322
|
-
}),
|
|
323
|
-
},
|
|
324
|
-
});
|
|
325
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
326
|
-
// JSON.stringify escapes these properly
|
|
327
|
-
expect(output).toContain('"foo\\"bar"');
|
|
328
|
-
expect(output).toContain('"back\\\\slash"');
|
|
329
|
-
expect(output).toContain('"new\\nline"');
|
|
330
|
-
});
|
|
331
|
-
it("handles property names with special characters (quotes, newlines)", () => {
|
|
332
|
-
const cls = createDecoratedClassInfo({
|
|
333
|
-
name: "TestForm",
|
|
334
|
-
typeMetadata: {
|
|
335
|
-
'key"with"quotes': createTypeMetadata({ type: "string" }),
|
|
336
|
-
"key\nwith\nnewlines": createTypeMetadata({ type: "string" }),
|
|
337
|
-
},
|
|
338
|
-
});
|
|
339
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
340
|
-
// JSON.stringify escapes these properly
|
|
341
|
-
expect(output).toContain('"key\\"with\\"quotes": string;');
|
|
342
|
-
expect(output).toContain('"key\\nwith\\nnewlines": string;');
|
|
343
|
-
});
|
|
344
|
-
it("escapes additional reserved words (async, await, null, true, false)", () => {
|
|
345
|
-
const cls = createDecoratedClassInfo({
|
|
346
|
-
name: "TestForm",
|
|
347
|
-
typeMetadata: {
|
|
348
|
-
async: createTypeMetadata({ type: "string" }),
|
|
349
|
-
await: createTypeMetadata({ type: "string" }),
|
|
350
|
-
null: createTypeMetadata({ type: "string" }),
|
|
351
|
-
true: createTypeMetadata({ type: "boolean" }),
|
|
352
|
-
get: createTypeMetadata({ type: "string" }),
|
|
353
|
-
},
|
|
354
|
-
});
|
|
355
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
356
|
-
// Extract just the schema type section
|
|
357
|
-
const schemaRegex = /export type TestFormSchema = \{[\s\S]*?\};/;
|
|
358
|
-
const schemaMatch = schemaRegex.exec(output);
|
|
359
|
-
expect(schemaMatch).not.toBeNull();
|
|
360
|
-
if (!schemaMatch)
|
|
361
|
-
throw new Error("Schema section not found");
|
|
362
|
-
const schemaSection = schemaMatch[0];
|
|
363
|
-
expect(schemaSection).toContain('"async": string;');
|
|
364
|
-
expect(schemaSection).toContain('"await": string;');
|
|
365
|
-
expect(schemaSection).toContain('"null": string;');
|
|
366
|
-
expect(schemaSection).toContain('"true": boolean;');
|
|
367
|
-
expect(schemaSection).toContain('"get": string;');
|
|
368
|
-
});
|
|
369
|
-
it("handles deeply nested objects (3+ levels)", () => {
|
|
370
|
-
const cls = createDecoratedClassInfo({
|
|
371
|
-
name: "NestedForm",
|
|
372
|
-
typeMetadata: {
|
|
373
|
-
data: createTypeMetadata({
|
|
374
|
-
type: "object",
|
|
375
|
-
properties: {
|
|
376
|
-
level1: {
|
|
377
|
-
type: "object",
|
|
378
|
-
properties: {
|
|
379
|
-
level2: {
|
|
380
|
-
type: "object",
|
|
381
|
-
properties: {
|
|
382
|
-
value: { type: "string" },
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
}),
|
|
389
|
-
},
|
|
390
|
-
});
|
|
391
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
392
|
-
expect(output).toContain("data: { level1: { level2: { value: string } } };");
|
|
393
|
-
});
|
|
394
|
-
it("handles arrays of objects with nested properties", () => {
|
|
395
|
-
const cls = createDecoratedClassInfo({
|
|
396
|
-
name: "ArrayForm",
|
|
397
|
-
typeMetadata: {
|
|
398
|
-
items: createTypeMetadata({
|
|
399
|
-
type: "array",
|
|
400
|
-
itemType: {
|
|
401
|
-
type: "object",
|
|
402
|
-
properties: {
|
|
403
|
-
nested: {
|
|
404
|
-
type: "object",
|
|
405
|
-
properties: {
|
|
406
|
-
value: { type: "number" },
|
|
407
|
-
},
|
|
408
|
-
},
|
|
409
|
-
},
|
|
410
|
-
},
|
|
411
|
-
}),
|
|
412
|
-
},
|
|
413
|
-
});
|
|
414
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
415
|
-
expect(output).toContain("items: { nested: { value: number } }[];");
|
|
416
|
-
});
|
|
417
|
-
});
|
|
418
|
-
describe("negative tests and error handling", () => {
|
|
419
|
-
it("handles empty class list", () => {
|
|
420
|
-
const output = generateCodegenOutput([], "/tmp/out.ts", "/tmp");
|
|
421
|
-
// Should still generate valid structure with no class-specific code
|
|
422
|
-
expect(output).toContain("Auto-generated by FormSpec CLI");
|
|
423
|
-
expect(output).toContain('import { toFormSpec } from "@formspec/decorators";');
|
|
424
|
-
expect(output).toContain("// Type Metadata Patches");
|
|
425
|
-
expect(output).toContain("// Inferred Schema Types");
|
|
426
|
-
});
|
|
427
|
-
it("handles class with no fields", () => {
|
|
428
|
-
const cls = createDecoratedClassInfo({
|
|
429
|
-
name: "EmptyForm",
|
|
430
|
-
typeMetadata: {},
|
|
431
|
-
});
|
|
432
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
433
|
-
// Should generate empty schema type
|
|
434
|
-
expect(output).toContain("export type EmptyFormSchema = {");
|
|
435
|
-
// Elements should be empty tuple
|
|
436
|
-
expect(output).toContain("export type EmptyFormElements = readonly [");
|
|
437
|
-
});
|
|
438
|
-
it("handles optional nullable array of objects", () => {
|
|
439
|
-
const cls = createDecoratedClassInfo({
|
|
440
|
-
name: "ComplexForm",
|
|
441
|
-
typeMetadata: {
|
|
442
|
-
items: createTypeMetadata({
|
|
443
|
-
type: "array",
|
|
444
|
-
optional: true,
|
|
445
|
-
nullable: true,
|
|
446
|
-
itemType: {
|
|
447
|
-
type: "object",
|
|
448
|
-
properties: {
|
|
449
|
-
id: { type: "string" },
|
|
450
|
-
},
|
|
451
|
-
},
|
|
452
|
-
}),
|
|
453
|
-
},
|
|
454
|
-
});
|
|
455
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
456
|
-
expect(output).toContain("items?: { id: string }[] | null | undefined;");
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
describe("unexported class detection", () => {
|
|
460
|
-
it("should track isExported status", () => {
|
|
461
|
-
const exportedClass = createDecoratedClassInfo({
|
|
462
|
-
name: "ExportedForm",
|
|
463
|
-
isExported: true,
|
|
464
|
-
typeMetadata: { name: createTypeMetadata({ type: "string" }) },
|
|
465
|
-
});
|
|
466
|
-
const unexportedClass = createDecoratedClassInfo({
|
|
467
|
-
name: "UnexportedForm",
|
|
468
|
-
isExported: false,
|
|
469
|
-
typeMetadata: { name: createTypeMetadata({ type: "string" }) },
|
|
470
|
-
});
|
|
471
|
-
expect(exportedClass.isExported).toBe(true);
|
|
472
|
-
expect(unexportedClass.isExported).toBe(false);
|
|
473
|
-
});
|
|
474
|
-
});
|
|
475
|
-
describe("imports and structure", () => {
|
|
476
|
-
it("imports toFormSpec from decorators", () => {
|
|
477
|
-
const cls = createDecoratedClassInfo({
|
|
478
|
-
name: "TestForm",
|
|
479
|
-
typeMetadata: { name: createTypeMetadata({ type: "string" }) },
|
|
480
|
-
});
|
|
481
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
482
|
-
expect(output).toContain('import { toFormSpec } from "@formspec/decorators";');
|
|
483
|
-
});
|
|
484
|
-
it("includes section separators", () => {
|
|
485
|
-
const cls = createDecoratedClassInfo({
|
|
486
|
-
name: "TestForm",
|
|
487
|
-
typeMetadata: { name: createTypeMetadata({ type: "string" }) },
|
|
488
|
-
});
|
|
489
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
490
|
-
expect(output).toContain("// Type Metadata Patches");
|
|
491
|
-
expect(output).toContain("// Inferred Schema Types");
|
|
492
|
-
expect(output).toContain("// Type-Safe FormSpec Accessors");
|
|
493
|
-
});
|
|
494
|
-
it("includes header comment with usage instructions", () => {
|
|
495
|
-
const cls = createDecoratedClassInfo({
|
|
496
|
-
name: "TestForm",
|
|
497
|
-
typeMetadata: { name: createTypeMetadata({ type: "string" }) },
|
|
498
|
-
});
|
|
499
|
-
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
500
|
-
expect(output).toContain("Auto-generated by FormSpec CLI");
|
|
501
|
-
expect(output).toContain("DO NOT EDIT");
|
|
502
|
-
});
|
|
24
|
+
describe("generateCodegenOutput (from @formspec/build)", () => {
|
|
25
|
+
it("generates correct schema type for primitive fields", () => {
|
|
26
|
+
const cls = createDecoratedClassInfo({
|
|
27
|
+
name: "UserForm",
|
|
28
|
+
typeMetadata: {
|
|
29
|
+
name: createTypeMetadata({ type: "string" }),
|
|
30
|
+
age: createTypeMetadata({ type: "number" }),
|
|
31
|
+
active: createTypeMetadata({ type: "boolean" }),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
35
|
+
expect(output).toContain("export type UserFormSchema = {");
|
|
36
|
+
expect(output).toContain("name: string;");
|
|
37
|
+
expect(output).toContain("age: number;");
|
|
38
|
+
expect(output).toContain("active: boolean;");
|
|
39
|
+
});
|
|
40
|
+
it("generates typed accessor function", () => {
|
|
41
|
+
const cls = createDecoratedClassInfo({
|
|
42
|
+
name: "UserForm",
|
|
43
|
+
typeMetadata: {
|
|
44
|
+
name: createTypeMetadata({ type: "string" }),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
const output = generateCodegenOutput([cls], "/tmp/out.ts", "/tmp");
|
|
48
|
+
expect(output).toContain("export function getUserFormFormSpec(): UserFormFormSpec {");
|
|
503
49
|
});
|
|
504
50
|
});
|
|
505
51
|
//# sourceMappingURL=codegen.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.test.js","sourceRoot":"","sources":["../../src/__tests__/codegen.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,IAAI,qBAAqB,GAG9C,MAAM,qBAAqB,CAAC;AAE7B,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,SAAS,kBAAkB,CAAC,YAAmC,EAAE;IAC/D,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAC/B,YAAyC,EAAE;IAE3C,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,aAAa;QACzB,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,IAAI;QAChB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC5D,MAAM,GAAG,GAAG,wBAAwB,CAAC;gBACnC,IAAI,EAAE,UAAU;gBAChB,YAAY,EAAE;oBACZ,IAAI,EAAE,kBAAkB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;oBAC5C,GAAG,EAAE,kBAAkB,C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AC;QAEnE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,2DAA2D,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Edge case and negative tests for CLI components.
|
|
2
|
+
* Edge case and negative tests for CLI-specific components.
|
|
3
3
|
*
|
|
4
4
|
* Tests cover:
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* - Array edge cases
|
|
8
|
-
* - Object edge cases
|
|
9
|
-
* - Error handling for file I/O
|
|
5
|
+
* - isFormSpec detection edge cases
|
|
6
|
+
* - File I/O error handling (output writer)
|
|
10
7
|
* - FormSpec loading failures
|
|
11
|
-
*
|
|
8
|
+
*
|
|
9
|
+
* Note: Analysis and generation edge cases are tested in @formspec/build.
|
|
12
10
|
*/
|
|
13
11
|
export {};
|
|
14
12
|
//# sourceMappingURL=edge-cases.test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-cases.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/edge-cases.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"edge-cases.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/edge-cases.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|