@toolproof-core/genesis 1.0.50 → 1.0.52

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.
@@ -1,83 +1,83 @@
1
- export function stripAnchors<T>(schema: T): T {
2
- const seen = new WeakMap<object, unknown>();
3
-
4
- function walk(node: unknown): unknown {
5
- if (!node || typeof node !== 'object') return node;
6
-
7
- const existing = seen.get(node as object);
8
- if (existing) return existing;
9
-
10
- if (Array.isArray(node)) {
11
- const out: unknown[] = [];
12
- seen.set(node, out);
13
- for (const item of node) out.push(walk(item));
14
- return out;
15
- }
16
-
17
- const out: Record<string, unknown> = {};
18
- seen.set(node as object, out);
19
-
20
- for (const [key, value] of Object.entries(node as Record<string, unknown>)) {
21
- if (key === '$anchor') continue;
22
- out[key] = walk(value);
23
- }
24
-
25
- return out;
26
- }
27
-
28
- return walk(schema) as T;
29
- }
30
-
31
- export function normalizeAnchorsToPointers<T>(input: T): T {
32
- if (!input || typeof input !== 'object') return input;
33
-
34
- const root = JSON.parse(JSON.stringify(input)) as { $defs?: Record<string, unknown> };
35
- const defs: Record<string, unknown> = root.$defs && typeof root.$defs === 'object' ? root.$defs : {};
36
- const anchorToDef: Record<string, string> = {};
37
-
38
- for (const [defName, defValue] of Object.entries(defs)) {
39
- if (!anchorToDef[defName]) {
40
- anchorToDef[defName] = defName;
41
- }
42
-
43
- if (!defValue || typeof defValue !== 'object') continue;
44
-
45
- const envelope = defValue as { projectionSchema?: { $anchor?: unknown }; $anchor?: unknown };
46
- const projectionSchema = envelope.projectionSchema;
47
- if (projectionSchema && typeof projectionSchema === 'object') {
48
- const anchor = projectionSchema.$anchor;
49
- if (typeof anchor === 'string' && !anchorToDef[anchor]) {
50
- anchorToDef[anchor] = defName;
51
- }
52
- } else {
53
- const anchor = envelope.$anchor;
54
- if (typeof anchor === 'string' && !anchorToDef[anchor]) {
55
- anchorToDef[anchor] = defName;
56
- }
57
- }
58
- }
59
-
60
- function walk(node: unknown): void {
61
- if (Array.isArray(node)) {
62
- for (const item of node) walk(item);
63
- return;
64
- }
65
- if (!node || typeof node !== 'object') return;
66
-
67
- const obj = node as { $ref?: unknown } & Record<string, unknown>;
68
- if (typeof obj.$ref === 'string' && obj.$ref.startsWith('#') && !obj.$ref.startsWith('#/')) {
69
- const anchor = obj.$ref.slice(1);
70
- const defName = anchorToDef[anchor];
71
- if (defName) {
72
- obj.$ref = `#/$defs/${defName}`;
73
- }
74
- }
75
-
76
- for (const value of Object.values(obj)) {
77
- walk(value);
78
- }
79
- }
80
-
81
- walk(root);
82
- return root as T;
1
+ export function stripAnchors<T>(schema: T): T {
2
+ const seen = new WeakMap<object, unknown>();
3
+
4
+ function walk(node: unknown): unknown {
5
+ if (!node || typeof node !== 'object') return node;
6
+
7
+ const existing = seen.get(node as object);
8
+ if (existing) return existing;
9
+
10
+ if (Array.isArray(node)) {
11
+ const out: unknown[] = [];
12
+ seen.set(node, out);
13
+ for (const item of node) out.push(walk(item));
14
+ return out;
15
+ }
16
+
17
+ const out: Record<string, unknown> = {};
18
+ seen.set(node as object, out);
19
+
20
+ for (const [key, value] of Object.entries(node as Record<string, unknown>)) {
21
+ if (key === '$anchor') continue;
22
+ out[key] = walk(value);
23
+ }
24
+
25
+ return out;
26
+ }
27
+
28
+ return walk(schema) as T;
29
+ }
30
+
31
+ export function normalizeAnchorsToPointers<T>(input: T): T {
32
+ if (!input || typeof input !== 'object') return input;
33
+
34
+ const root = JSON.parse(JSON.stringify(input)) as { $defs?: Record<string, unknown> };
35
+ const defs: Record<string, unknown> = root.$defs && typeof root.$defs === 'object' ? root.$defs : {};
36
+ const anchorToDef: Record<string, string> = {};
37
+
38
+ for (const [defName, defValue] of Object.entries(defs)) {
39
+ if (!anchorToDef[defName]) {
40
+ anchorToDef[defName] = defName;
41
+ }
42
+
43
+ if (!defValue || typeof defValue !== 'object') continue;
44
+
45
+ const envelope = defValue as { projectionSchema?: { $anchor?: unknown }; $anchor?: unknown };
46
+ const projectionSchema = envelope.projectionSchema;
47
+ if (projectionSchema && typeof projectionSchema === 'object') {
48
+ const anchor = projectionSchema.$anchor;
49
+ if (typeof anchor === 'string' && !anchorToDef[anchor]) {
50
+ anchorToDef[anchor] = defName;
51
+ }
52
+ } else {
53
+ const anchor = envelope.$anchor;
54
+ if (typeof anchor === 'string' && !anchorToDef[anchor]) {
55
+ anchorToDef[anchor] = defName;
56
+ }
57
+ }
58
+ }
59
+
60
+ function walk(node: unknown): void {
61
+ if (Array.isArray(node)) {
62
+ for (const item of node) walk(item);
63
+ return;
64
+ }
65
+ if (!node || typeof node !== 'object') return;
66
+
67
+ const obj = node as { $ref?: unknown } & Record<string, unknown>;
68
+ if (typeof obj.$ref === 'string' && obj.$ref.startsWith('#') && !obj.$ref.startsWith('#/')) {
69
+ const anchor = obj.$ref.slice(1);
70
+ const defName = anchorToDef[anchor];
71
+ if (defName) {
72
+ obj.$ref = `#/$defs/${defName}`;
73
+ }
74
+ }
75
+
76
+ for (const value of Object.values(obj)) {
77
+ walk(value);
78
+ }
79
+ }
80
+
81
+ walk(root);
82
+ return root as T;
83
83
  }
@@ -1,17 +1,17 @@
1
- import * as path from 'node:path';
2
-
3
- export function generateShimContent(jsonFile: string, variableName: string): string {
4
- return `import ${variableName} from './${jsonFile}' with { type: 'json' };\nexport default ${variableName};\n`;
5
- }
6
-
7
- export function getShimsForFiles(jsonFiles: string[], variableName: string): Record<string, string> {
8
- const shims: Record<string, string> = {};
9
-
10
- for (const jsonFile of jsonFiles) {
11
- const baseName = path.basename(jsonFile, '.json');
12
- const tsFile = `${baseName}.ts`;
13
- shims[tsFile] = generateShimContent(jsonFile, variableName);
14
- }
15
-
16
- return shims;
1
+ import * as path from 'node:path';
2
+
3
+ export function generateShimContent(jsonFile: string, variableName: string): string {
4
+ return `import ${variableName} from './${jsonFile}' with { type: 'json' };\nexport default ${variableName};\n`;
5
+ }
6
+
7
+ export function getShimsForFiles(jsonFiles: string[], variableName: string): Record<string, string> {
8
+ const shims: Record<string, string> = {};
9
+
10
+ for (const jsonFile of jsonFiles) {
11
+ const baseName = path.basename(jsonFile, '.json');
12
+ const tsFile = `${baseName}.ts`;
13
+ shims[tsFile] = generateShimContent(jsonFile, variableName);
14
+ }
15
+
16
+ return shims;
17
17
  }
@@ -1,114 +1,114 @@
1
- export function isObject(value: unknown): value is Record<string, unknown> {
2
- return value !== null && typeof value === 'object' && !Array.isArray(value);
3
- }
4
-
5
- export function deepClone<T>(value: T): T {
6
- if (Array.isArray(value)) return value.map((item) => deepClone(item)) as T;
7
- if (isObject(value)) {
8
- const out: Record<string, unknown> = {};
9
- for (const key of Object.keys(value)) out[key] = deepClone(value[key]);
10
- return out as T;
11
- }
12
- return value;
13
- }
14
-
15
- export function extractPointerDefName(ref: string): string | null {
16
- if (!ref || !ref.startsWith('#/')) return null;
17
- const parts = ref.slice(2).split('/');
18
- if (parts.length !== 2) return null;
19
- if (parts[0] !== '$defs') return null;
20
- const defName = parts[1];
21
- if (defName === undefined) return null;
22
- return defName.replace(/~1/g, '/').replace(/~0/g, '~');
23
- }
24
-
25
- export function collectLocalDefClosure(node: unknown, rootDefs: Record<string, unknown>): Set<string> {
26
- const needed = new Set<string>();
27
- const queue: string[] = [];
28
-
29
- function visit(value: unknown) {
30
- if (Array.isArray(value)) {
31
- for (const item of value) visit(item);
32
- return;
33
- }
34
- if (!isObject(value)) return;
35
-
36
- if (typeof value.$ref === 'string') {
37
- const name = extractPointerDefName(value.$ref);
38
- if (name && !needed.has(name)) {
39
- needed.add(name);
40
- queue.push(name);
41
- }
42
- }
43
-
44
- for (const nested of Object.values(value)) visit(nested);
45
- }
46
-
47
- visit(node);
48
-
49
- while (queue.length > 0) {
50
- const name = queue.shift();
51
- if (!name) continue;
52
- const def = rootDefs[name];
53
- if (def === undefined) continue;
54
- visit(def);
55
- }
56
-
57
- return needed;
58
- }
59
-
60
- export function extractStandaloneSchema(
61
- schemasDocument: { $defs?: Record<string, unknown> },
62
- name: string,
63
- ): { schema: unknown; warnings: string[] } {
64
- const rootDefs = schemasDocument.$defs;
65
- if (!rootDefs || typeof rootDefs !== 'object') {
66
- throw new Error('No $defs object found in schema document');
67
- }
68
-
69
- const target = rootDefs[name];
70
- if (target === undefined) {
71
- throw new Error(`Subschema named '${name}' not found under $defs in schema document`);
72
- }
73
-
74
- const needed = collectLocalDefClosure(target, rootDefs);
75
- const targetClone = deepClone(target);
76
- const defsOut: Record<string, unknown> = {};
77
- const warnings: string[] = [];
78
-
79
- for (const defName of needed) {
80
- if (defName === name) continue;
81
- const defSchema = rootDefs[defName];
82
- if (defSchema === undefined) {
83
- warnings.push(`Warning: referenced def '${defName}' missing in root $defs (skipped).`);
84
- continue;
85
- }
86
- defsOut[defName] = deepClone(defSchema);
87
- }
88
-
89
- const existingInner = isObject(targetClone) && isObject(targetClone.$defs)
90
- ? targetClone.$defs
91
- : {};
92
-
93
- if (isObject(targetClone)) {
94
- targetClone.$defs = { ...existingInner, ...defsOut };
95
- }
96
-
97
- return { schema: targetClone, warnings };
98
- }
99
-
100
- export function generateStandaloneSchemas(
101
- schemasDocument: { $defs?: Record<string, unknown> },
102
- names: string[],
103
- ): { standaloneSchemas: Record<string, unknown>; warnings: string[] } {
104
- const standaloneSchemas: Record<string, unknown> = {};
105
- const warnings: string[] = [];
106
-
107
- for (const name of names) {
108
- const result = extractStandaloneSchema(schemasDocument, name);
109
- standaloneSchemas[name] = result.schema;
110
- warnings.push(...result.warnings);
111
- }
112
-
113
- return { standaloneSchemas, warnings };
1
+ export function isObject(value: unknown): value is Record<string, unknown> {
2
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
3
+ }
4
+
5
+ export function deepClone<T>(value: T): T {
6
+ if (Array.isArray(value)) return value.map((item) => deepClone(item)) as T;
7
+ if (isObject(value)) {
8
+ const out: Record<string, unknown> = {};
9
+ for (const key of Object.keys(value)) out[key] = deepClone(value[key]);
10
+ return out as T;
11
+ }
12
+ return value;
13
+ }
14
+
15
+ export function extractPointerDefName(ref: string): string | null {
16
+ if (!ref || !ref.startsWith('#/')) return null;
17
+ const parts = ref.slice(2).split('/');
18
+ if (parts.length !== 2) return null;
19
+ if (parts[0] !== '$defs') return null;
20
+ const defName = parts[1];
21
+ if (defName === undefined) return null;
22
+ return defName.replace(/~1/g, '/').replace(/~0/g, '~');
23
+ }
24
+
25
+ export function collectLocalDefClosure(node: unknown, rootDefs: Record<string, unknown>): Set<string> {
26
+ const needed = new Set<string>();
27
+ const queue: string[] = [];
28
+
29
+ function visit(value: unknown) {
30
+ if (Array.isArray(value)) {
31
+ for (const item of value) visit(item);
32
+ return;
33
+ }
34
+ if (!isObject(value)) return;
35
+
36
+ if (typeof value.$ref === 'string') {
37
+ const name = extractPointerDefName(value.$ref);
38
+ if (name && !needed.has(name)) {
39
+ needed.add(name);
40
+ queue.push(name);
41
+ }
42
+ }
43
+
44
+ for (const nested of Object.values(value)) visit(nested);
45
+ }
46
+
47
+ visit(node);
48
+
49
+ while (queue.length > 0) {
50
+ const name = queue.shift();
51
+ if (!name) continue;
52
+ const def = rootDefs[name];
53
+ if (def === undefined) continue;
54
+ visit(def);
55
+ }
56
+
57
+ return needed;
58
+ }
59
+
60
+ export function extractStandaloneSchema(
61
+ schemasDocument: { $defs?: Record<string, unknown> },
62
+ name: string,
63
+ ): { schema: unknown; warnings: string[] } {
64
+ const rootDefs = schemasDocument.$defs;
65
+ if (!rootDefs || typeof rootDefs !== 'object') {
66
+ throw new Error('No $defs object found in schema document');
67
+ }
68
+
69
+ const target = rootDefs[name];
70
+ if (target === undefined) {
71
+ throw new Error(`Subschema named '${name}' not found under $defs in schema document`);
72
+ }
73
+
74
+ const needed = collectLocalDefClosure(target, rootDefs);
75
+ const targetClone = deepClone(target);
76
+ const defsOut: Record<string, unknown> = {};
77
+ const warnings: string[] = [];
78
+
79
+ for (const defName of needed) {
80
+ if (defName === name) continue;
81
+ const defSchema = rootDefs[defName];
82
+ if (defSchema === undefined) {
83
+ warnings.push(`Warning: referenced def '${defName}' missing in root $defs (skipped).`);
84
+ continue;
85
+ }
86
+ defsOut[defName] = deepClone(defSchema);
87
+ }
88
+
89
+ const existingInner = isObject(targetClone) && isObject(targetClone.$defs)
90
+ ? targetClone.$defs
91
+ : {};
92
+
93
+ if (isObject(targetClone)) {
94
+ targetClone.$defs = { ...existingInner, ...defsOut };
95
+ }
96
+
97
+ return { schema: targetClone, warnings };
98
+ }
99
+
100
+ export function generateStandaloneSchemas(
101
+ schemasDocument: { $defs?: Record<string, unknown> },
102
+ names: string[],
103
+ ): { standaloneSchemas: Record<string, unknown>; warnings: string[] } {
104
+ const standaloneSchemas: Record<string, unknown> = {};
105
+ const warnings: string[] = [];
106
+
107
+ for (const name of names) {
108
+ const result = extractStandaloneSchema(schemasDocument, name);
109
+ standaloneSchemas[name] = result.schema;
110
+ warnings.push(...result.warnings);
111
+ }
112
+
113
+ return { standaloneSchemas, warnings };
114
114
  }
@@ -1,28 +1,28 @@
1
- export function generateStandaloneTypeContent(name: string): string {
2
- const header = '// Auto-generated strict composite type. Do not edit.\n';
3
- const standaloneResourceTypeName = `${name}Resource`;
4
-
5
- const ts =
6
- `import type { ResourcePointer, ${name} as ProjectionSchema } from "../types.js";\n` +
7
- `export type ${standaloneResourceTypeName} = ResourcePointer & { projection: ProjectionSchema };\n`;
8
- return header + ts;
9
- }
10
-
11
- export function validateStandaloneSchemaForWarnings(schema: any): string[] {
12
- const warnings: string[] = [];
13
- if (schema?.$schema && schema.$schema !== 'https://json-schema.org/draft/2020-12/schema') {
14
- warnings.push(
15
- `Warning: schema $schema is '${String(schema.$schema)}', expected draft 2020-12. Proceeding anyway.`,
16
- );
17
- }
18
- return warnings;
19
- }
20
-
21
- export function generateStandaloneTypeArtifacts(name: string): { dtsFileName: string; jsFileName: string; dtsContent: string; jsContent: string } {
22
- return {
23
- dtsFileName: `${name}Resource.d.ts`,
24
- jsFileName: `${name}Resource.js`,
25
- dtsContent: generateStandaloneTypeContent(name),
26
- jsContent: 'export {}\n',
27
- };
1
+ export function generateStandaloneTypeContent(name: string): string {
2
+ const header = '// Auto-generated strict composite type. Do not edit.\n';
3
+ const standaloneResourceTypeName = `${name}Resource`;
4
+
5
+ const ts =
6
+ `import type { ResourcePointer, ${name} as ProjectionSchema } from "../types.js";\n` +
7
+ `export type ${standaloneResourceTypeName} = ResourcePointer & { projection: ProjectionSchema };\n`;
8
+ return header + ts;
9
+ }
10
+
11
+ export function validateStandaloneSchemaForWarnings(schema: any): string[] {
12
+ const warnings: string[] = [];
13
+ if (schema?.$schema && schema.$schema !== 'https://json-schema.org/draft/2020-12/schema') {
14
+ warnings.push(
15
+ `Warning: schema $schema is '${String(schema.$schema)}', expected draft 2020-12. Proceeding anyway.`,
16
+ );
17
+ }
18
+ return warnings;
19
+ }
20
+
21
+ export function generateStandaloneTypeArtifacts(name: string): { dtsFileName: string; jsFileName: string; dtsContent: string; jsContent: string } {
22
+ return {
23
+ dtsFileName: `${name}Resource.d.ts`,
24
+ jsFileName: `${name}Resource.js`,
25
+ dtsContent: generateStandaloneTypeContent(name),
26
+ jsContent: 'export {}\n',
27
+ };
28
28
  }
@@ -1,72 +1,72 @@
1
- import { jsonSchemaToZodExpressions, type JsonSchemaToZodWarning } from './zodCodegen.js';
2
-
3
- export type GeneratedZodModule = {
4
- fileName: string;
5
- content: string;
6
- warnings: JsonSchemaToZodWarning[];
7
- };
8
-
9
- function isValidIdentifier(name: string): boolean {
10
- return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
11
- }
12
-
13
- function toIdentifier(name: string): string {
14
- let out = name.replace(/[^A-Za-z0-9_]/g, '_');
15
- if (!/^[A-Za-z_]/.test(out)) out = `_${out}`;
16
- return out;
17
- }
18
-
19
- function emitHeader(name: string): string {
20
- return (
21
- `// Auto-generated from standalone schema '${name}'. Do not edit.\n` +
22
- `import { z } from 'zod/v4';\n\n`
23
- );
24
- }
25
-
26
- function emitModule(name: string, expressionsByName: Record<string, string>, warnings: JsonSchemaToZodWarning[]): string {
27
- const lines: string[] = [];
28
- lines.push(emitHeader(name));
29
-
30
- if (warnings.length > 0) {
31
- const warningsName = `${toIdentifier(name)}ZodGenerationWarnings`;
32
- lines.push(`export const ${warningsName} = ${JSON.stringify(warnings, null, 2)} as const;\n`);
33
- }
34
-
35
- const rootIdent = toIdentifier(name);
36
- const defNames = Object.keys(expressionsByName)
37
- .filter((schemaName) => schemaName !== name)
38
- .sort((a, b) => a.localeCompare(b));
39
-
40
- for (const schemaName of defNames) {
41
- const ident = toIdentifier(schemaName);
42
- if (!isValidIdentifier(ident)) {
43
- throw new Error(`Invalid generated identifier for schema '${schemaName}': '${ident}'`);
44
- }
45
- const expr = expressionsByName[schemaName];
46
- lines.push(`const ${ident}Schema: z.ZodTypeAny = z.lazy(() => ${expr});`);
47
- }
48
-
49
- lines.push('');
50
-
51
- const rootExpr = expressionsByName[name];
52
- lines.push(`export const ${rootIdent}Schema: z.ZodTypeAny = z.lazy(() => ${rootExpr});`);
53
-
54
- return lines.join('\n') + '\n';
55
- }
56
-
57
- export function generateStandaloneZodModule(name: string, standaloneSchema: unknown): GeneratedZodModule {
58
- const { expressionsByName, warnings } = jsonSchemaToZodExpressions(standaloneSchema, name);
59
- return {
60
- fileName: `${name}.ts`,
61
- content: emitModule(name, expressionsByName, warnings),
62
- warnings,
63
- };
64
- }
65
-
66
- export function generateStandaloneZodBarrel(names: string[]): string {
67
- const exports = names
68
- .slice()
69
- .sort((a, b) => a.localeCompare(b))
70
- .map((name) => `export { ${toIdentifier(name)}Schema } from './${name}.js';`);
71
- return `// Auto-generated barrel file. Do not edit.\n${exports.join('\n')}\n`;
1
+ import { jsonSchemaToZodExpressions, type JsonSchemaToZodWarning } from './zodCodegen.js';
2
+
3
+ export type GeneratedZodModule = {
4
+ fileName: string;
5
+ content: string;
6
+ warnings: JsonSchemaToZodWarning[];
7
+ };
8
+
9
+ function isValidIdentifier(name: string): boolean {
10
+ return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
11
+ }
12
+
13
+ function toIdentifier(name: string): string {
14
+ let out = name.replace(/[^A-Za-z0-9_]/g, '_');
15
+ if (!/^[A-Za-z_]/.test(out)) out = `_${out}`;
16
+ return out;
17
+ }
18
+
19
+ function emitHeader(name: string): string {
20
+ return (
21
+ `// Auto-generated from standalone schema '${name}'. Do not edit.\n` +
22
+ `import { z } from 'zod/v4';\n\n`
23
+ );
24
+ }
25
+
26
+ function emitModule(name: string, expressionsByName: Record<string, string>, warnings: JsonSchemaToZodWarning[]): string {
27
+ const lines: string[] = [];
28
+ lines.push(emitHeader(name));
29
+
30
+ if (warnings.length > 0) {
31
+ const warningsName = `${toIdentifier(name)}ZodGenerationWarnings`;
32
+ lines.push(`export const ${warningsName} = ${JSON.stringify(warnings, null, 2)} as const;\n`);
33
+ }
34
+
35
+ const rootIdent = toIdentifier(name);
36
+ const defNames = Object.keys(expressionsByName)
37
+ .filter((schemaName) => schemaName !== name)
38
+ .sort((a, b) => a.localeCompare(b));
39
+
40
+ for (const schemaName of defNames) {
41
+ const ident = toIdentifier(schemaName);
42
+ if (!isValidIdentifier(ident)) {
43
+ throw new Error(`Invalid generated identifier for schema '${schemaName}': '${ident}'`);
44
+ }
45
+ const expr = expressionsByName[schemaName];
46
+ lines.push(`const ${ident}Schema: z.ZodTypeAny = z.lazy(() => ${expr});`);
47
+ }
48
+
49
+ lines.push('');
50
+
51
+ const rootExpr = expressionsByName[name];
52
+ lines.push(`export const ${rootIdent}Schema: z.ZodTypeAny = z.lazy(() => ${rootExpr});`);
53
+
54
+ return lines.join('\n') + '\n';
55
+ }
56
+
57
+ export function generateStandaloneZodModule(name: string, standaloneSchema: unknown): GeneratedZodModule {
58
+ const { expressionsByName, warnings } = jsonSchemaToZodExpressions(standaloneSchema, name);
59
+ return {
60
+ fileName: `${name}.ts`,
61
+ content: emitModule(name, expressionsByName, warnings),
62
+ warnings,
63
+ };
64
+ }
65
+
66
+ export function generateStandaloneZodBarrel(names: string[]): string {
67
+ const exports = names
68
+ .slice()
69
+ .sort((a, b) => a.localeCompare(b))
70
+ .map((name) => `export { ${toIdentifier(name)}Schema } from './${name}.js';`);
71
+ return `// Auto-generated barrel file. Do not edit.\n${exports.join('\n')}\n`;
72
72
  }