langium-zod 0.5.2 → 0.5.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.
Files changed (49) hide show
  1. package/dist/api.d.ts +116 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +116 -0
  4. package/dist/api.js.map +1 -1
  5. package/dist/cli.d.ts +76 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +77 -10
  8. package/dist/cli.js.map +1 -1
  9. package/dist/config.d.ts +126 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +15 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/conformance.d.ts.map +1 -1
  14. package/dist/conformance.js.map +1 -1
  15. package/dist/di.d.ts +154 -0
  16. package/dist/di.d.ts.map +1 -1
  17. package/dist/di.js +98 -0
  18. package/dist/di.js.map +1 -1
  19. package/dist/errors.d.ts +62 -0
  20. package/dist/errors.d.ts.map +1 -1
  21. package/dist/errors.js +62 -0
  22. package/dist/errors.js.map +1 -1
  23. package/dist/extractor.d.ts +83 -0
  24. package/dist/extractor.d.ts.map +1 -1
  25. package/dist/extractor.js +91 -3
  26. package/dist/extractor.js.map +1 -1
  27. package/dist/generator.d.ts +81 -0
  28. package/dist/generator.d.ts.map +1 -1
  29. package/dist/generator.js +99 -14
  30. package/dist/generator.js.map +1 -1
  31. package/dist/index.d.ts +23 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +23 -0
  34. package/dist/index.js.map +1 -1
  35. package/dist/projection.d.ts.map +1 -1
  36. package/dist/projection.js.map +1 -1
  37. package/dist/recursion-detector.d.ts +66 -0
  38. package/dist/recursion-detector.d.ts.map +1 -1
  39. package/dist/recursion-detector.js +66 -0
  40. package/dist/recursion-detector.js.map +1 -1
  41. package/dist/ref-utils.d.ts +79 -0
  42. package/dist/ref-utils.d.ts.map +1 -1
  43. package/dist/ref-utils.js +79 -0
  44. package/dist/ref-utils.js.map +1 -1
  45. package/dist/type-mapper.d.ts.map +1 -1
  46. package/dist/type-mapper.js.map +1 -1
  47. package/dist/types.d.ts +163 -0
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +5 -4
package/dist/api.d.ts CHANGED
@@ -1,4 +1,120 @@
1
1
  import type { ZodGeneratorConfig } from './config.js';
2
2
  export type PublicZodGeneratorConfig = ZodGeneratorConfig;
3
+ /**
4
+ * Main entry point for programmatic Zod schema generation from a Langium grammar.
5
+ *
6
+ * Accepts a {@link ZodGeneratorConfig} that specifies either a parsed Langium
7
+ * `Grammar` object or a pre-built {@link AstTypesLike} descriptor, then runs the
8
+ * full extraction → projection → code-generation pipeline and returns the
9
+ * generated TypeScript source as a string. When `config.outputPath` is set the
10
+ * result is also written to disk. Conformance artifacts are generated when
11
+ * `config.conformance` is provided.
12
+ *
13
+ * @remarks
14
+ * This is the primary API for most consumers. It combines {@link extractTypeDescriptors},
15
+ * {@link detectRecursiveTypes}, and {@link generateZodCode} into a single call. Use the
16
+ * lower-level functions directly only when you need fine-grained control over individual
17
+ * pipeline stages (e.g. to inspect descriptors before code generation, or to cache
18
+ * extraction results across multiple code-generation runs).
19
+ *
20
+ * The function is synchronous and writes to disk only when `config.outputPath` is set.
21
+ * It does not shell out or spawn child processes.
22
+ *
23
+ * **Config option decision tree:**
24
+ * - Does your grammar have recursive rules (e.g. `Expression: ... | left=Expression`)? →
25
+ * no action needed; cycle detection is automatic. If you run a custom pipeline, pass the
26
+ * *full* (unprojected) descriptor set to `detectRecursiveTypes` first.
27
+ * - Does your grammar have cross-references (`ref:` properties)? →
28
+ * if you need runtime ref-text validation in a live language server, enable
29
+ * `crossRefValidation: true` and use the emitted `create*Schema()` factories.
30
+ * Otherwise leave it off — unconstrained `ReferenceSchema` is lighter and sufficient for
31
+ * batch/offline validation.
32
+ * - Do you want to strip Langium internal bookkeeping fields (`$container`, `$document`,
33
+ * `$cstNode`, etc.)? → set `stripInternals: true`. These fields are never meaningful
34
+ * in a validation context and inflate the generated schema.
35
+ * - Do you need form labels and descriptions driven by the grammar? → enable `formMetadata: true`.
36
+ * Only properties whose grammar rule has a JSDoc/grammar comment get a `description`; every
37
+ * property gets a humanized `title` regardless.
38
+ * - Are you using Zod 4's `z.looseObject`? → the default `objectStyle: 'loose'` emits
39
+ * `z.looseObject(...)`. Switch to `objectStyle: 'strict'` + `.strict()` on the schema only
40
+ * when you need hard rejection of unknown properties (e.g. strict API request validation).
41
+ *
42
+ * @param config - Generator configuration including the grammar or AST types,
43
+ * optional output path, include/exclude filters, projection, and feature flags.
44
+ * @returns The generated TypeScript source containing all Zod schema exports.
45
+ * @throws {@link ZodGeneratorError} when required configuration is missing, when
46
+ * `conformance` is enabled without `outputPath`, or when a grammar property type
47
+ * cannot be mapped to a Zod schema.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * import { createLangiumGrammarServices } from 'langium/grammar';
52
+ * import { NodeFileSystem } from 'langium/node';
53
+ * import { generateZodSchemas } from 'langium-zod';
54
+ *
55
+ * const { grammar } = createLangiumGrammarServices(NodeFileSystem);
56
+ * // assume `parsedGrammar` is a Grammar node obtained from Langium
57
+ * const source = generateZodSchemas({
58
+ * grammar: parsedGrammar,
59
+ * outputPath: 'src/generated/zod-schemas.ts',
60
+ * stripInternals: true,
61
+ * });
62
+ * console.log(source); // TypeScript source with Zod schema exports
63
+ * ```
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // Using a pre-built AstTypesLike descriptor (skips grammar parsing)
68
+ * import { generateZodSchemas } from 'langium-zod';
69
+ * import { collectAst } from 'langium/grammar';
70
+ *
71
+ * const astTypes = collectAst(myGrammar);
72
+ * const source = generateZodSchemas({ astTypes });
73
+ * ```
74
+ *
75
+ * @useWhen
76
+ * - You have a parsed Langium `Grammar` object and want Zod schemas as a TypeScript string.
77
+ * - You are integrating langium-zod into a build pipeline (Vite plugin, codegen script, etc.).
78
+ * - You need conformance artifacts (type-guard files) alongside the schema output.
79
+ * - You want to write generated schemas to disk in a single call.
80
+ *
81
+ * @avoidWhen
82
+ * - You only need to inspect the intermediate type descriptors without generating code —
83
+ * use {@link extractTypeDescriptors} directly instead.
84
+ * - You are running inside the Langium DI container — prefer {@link DefaultZodSchemaGenerator}
85
+ * which injects services automatically.
86
+ * - You want to generate schemas for only a subset of types at runtime — pass `include`/`exclude`
87
+ * in the config rather than post-processing the output.
88
+ *
89
+ * @never
90
+ * - NEVER omit both `grammar` and `astTypes` — the function throws {@link ZodGeneratorError}
91
+ * immediately. BECAUSE there is no default grammar source and no way to recover silently.
92
+ * FIX: provide at least `{ grammar: parsedGrammar }` or `{ astTypes: collectAst(grammar) }`.
93
+ * - NEVER enable `conformance` without setting `outputPath` — the function will throw before
94
+ * writing any output. BECAUSE the conformance module needs to derive a sibling output path
95
+ * from the schema file's directory. FIX: always set `outputPath` when `conformance` is truthy.
96
+ * - NEVER pass a `Grammar[]` array when grammars share type names across files without
97
+ * verifying that Langium's `collectAst()` merges them correctly. BECAUSE duplicate type names
98
+ * will silently overwrite each other in the type map, producing truncated schemas.
99
+ * FIX: run `collectAst` separately and inspect the merged map before generation.
100
+ * - NEVER call with `crossRefValidation: true` on grammars with no cross-reference properties —
101
+ * it emits dead `create*Schema` factory functions that add noise without benefit.
102
+ * FIX: only enable `crossRefValidation` when your grammar has at least one `ref:` property.
103
+ * - NEVER remove the `// @ts-nocheck` comment from generated output files. BECAUSE the
104
+ * getter-based recursive property syntax (emitted for self-referential types) is not always
105
+ * accepted by TypeScript's strict object-literal type checker — removing the comment causes
106
+ * immediate TS build failures in grammars with recursive rules. FIX: treat generated files as
107
+ * opaque artifacts; place any hand-written extensions in a separate file that imports the schema.
108
+ * - NEVER commit generated schemas as the sole copy of your schema logic. BECAUSE any grammar
109
+ * edit (new rule, renamed property, changed cardinality) produces stale schemas that pass
110
+ * TypeScript but fail at Zod validation runtime. FIX: wire `langium-zod generate` as a
111
+ * pre-build or CI step so schema freshness is enforced automatically.
112
+ *
113
+ * @category Generation
114
+ * @see {@link extractTypeDescriptors}
115
+ * @see {@link detectRecursiveTypes}
116
+ * @see {@link generateZodCode}
117
+ * @see {@link ZodGeneratorConfig}
118
+ */
3
119
  export declare function generateZodSchemas(config: ZodGeneratorConfig): string;
4
120
  //# sourceMappingURL=api.d.ts.map
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAStD,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAS1D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAgGrE"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAStD,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAS1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmHG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAkGrE"}
package/dist/api.js CHANGED
@@ -13,6 +13,122 @@ function resolveAstTypes(astTypes) {
13
13
  unions: astTypes.unions ?? []
14
14
  };
15
15
  }
16
+ /**
17
+ * Main entry point for programmatic Zod schema generation from a Langium grammar.
18
+ *
19
+ * Accepts a {@link ZodGeneratorConfig} that specifies either a parsed Langium
20
+ * `Grammar` object or a pre-built {@link AstTypesLike} descriptor, then runs the
21
+ * full extraction → projection → code-generation pipeline and returns the
22
+ * generated TypeScript source as a string. When `config.outputPath` is set the
23
+ * result is also written to disk. Conformance artifacts are generated when
24
+ * `config.conformance` is provided.
25
+ *
26
+ * @remarks
27
+ * This is the primary API for most consumers. It combines {@link extractTypeDescriptors},
28
+ * {@link detectRecursiveTypes}, and {@link generateZodCode} into a single call. Use the
29
+ * lower-level functions directly only when you need fine-grained control over individual
30
+ * pipeline stages (e.g. to inspect descriptors before code generation, or to cache
31
+ * extraction results across multiple code-generation runs).
32
+ *
33
+ * The function is synchronous and writes to disk only when `config.outputPath` is set.
34
+ * It does not shell out or spawn child processes.
35
+ *
36
+ * **Config option decision tree:**
37
+ * - Does your grammar have recursive rules (e.g. `Expression: ... | left=Expression`)? →
38
+ * no action needed; cycle detection is automatic. If you run a custom pipeline, pass the
39
+ * *full* (unprojected) descriptor set to `detectRecursiveTypes` first.
40
+ * - Does your grammar have cross-references (`ref:` properties)? →
41
+ * if you need runtime ref-text validation in a live language server, enable
42
+ * `crossRefValidation: true` and use the emitted `create*Schema()` factories.
43
+ * Otherwise leave it off — unconstrained `ReferenceSchema` is lighter and sufficient for
44
+ * batch/offline validation.
45
+ * - Do you want to strip Langium internal bookkeeping fields (`$container`, `$document`,
46
+ * `$cstNode`, etc.)? → set `stripInternals: true`. These fields are never meaningful
47
+ * in a validation context and inflate the generated schema.
48
+ * - Do you need form labels and descriptions driven by the grammar? → enable `formMetadata: true`.
49
+ * Only properties whose grammar rule has a JSDoc/grammar comment get a `description`; every
50
+ * property gets a humanized `title` regardless.
51
+ * - Are you using Zod 4's `z.looseObject`? → the default `objectStyle: 'loose'` emits
52
+ * `z.looseObject(...)`. Switch to `objectStyle: 'strict'` + `.strict()` on the schema only
53
+ * when you need hard rejection of unknown properties (e.g. strict API request validation).
54
+ *
55
+ * @param config - Generator configuration including the grammar or AST types,
56
+ * optional output path, include/exclude filters, projection, and feature flags.
57
+ * @returns The generated TypeScript source containing all Zod schema exports.
58
+ * @throws {@link ZodGeneratorError} when required configuration is missing, when
59
+ * `conformance` is enabled without `outputPath`, or when a grammar property type
60
+ * cannot be mapped to a Zod schema.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * import { createLangiumGrammarServices } from 'langium/grammar';
65
+ * import { NodeFileSystem } from 'langium/node';
66
+ * import { generateZodSchemas } from 'langium-zod';
67
+ *
68
+ * const { grammar } = createLangiumGrammarServices(NodeFileSystem);
69
+ * // assume `parsedGrammar` is a Grammar node obtained from Langium
70
+ * const source = generateZodSchemas({
71
+ * grammar: parsedGrammar,
72
+ * outputPath: 'src/generated/zod-schemas.ts',
73
+ * stripInternals: true,
74
+ * });
75
+ * console.log(source); // TypeScript source with Zod schema exports
76
+ * ```
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * // Using a pre-built AstTypesLike descriptor (skips grammar parsing)
81
+ * import { generateZodSchemas } from 'langium-zod';
82
+ * import { collectAst } from 'langium/grammar';
83
+ *
84
+ * const astTypes = collectAst(myGrammar);
85
+ * const source = generateZodSchemas({ astTypes });
86
+ * ```
87
+ *
88
+ * @useWhen
89
+ * - You have a parsed Langium `Grammar` object and want Zod schemas as a TypeScript string.
90
+ * - You are integrating langium-zod into a build pipeline (Vite plugin, codegen script, etc.).
91
+ * - You need conformance artifacts (type-guard files) alongside the schema output.
92
+ * - You want to write generated schemas to disk in a single call.
93
+ *
94
+ * @avoidWhen
95
+ * - You only need to inspect the intermediate type descriptors without generating code —
96
+ * use {@link extractTypeDescriptors} directly instead.
97
+ * - You are running inside the Langium DI container — prefer {@link DefaultZodSchemaGenerator}
98
+ * which injects services automatically.
99
+ * - You want to generate schemas for only a subset of types at runtime — pass `include`/`exclude`
100
+ * in the config rather than post-processing the output.
101
+ *
102
+ * @never
103
+ * - NEVER omit both `grammar` and `astTypes` — the function throws {@link ZodGeneratorError}
104
+ * immediately. BECAUSE there is no default grammar source and no way to recover silently.
105
+ * FIX: provide at least `{ grammar: parsedGrammar }` or `{ astTypes: collectAst(grammar) }`.
106
+ * - NEVER enable `conformance` without setting `outputPath` — the function will throw before
107
+ * writing any output. BECAUSE the conformance module needs to derive a sibling output path
108
+ * from the schema file's directory. FIX: always set `outputPath` when `conformance` is truthy.
109
+ * - NEVER pass a `Grammar[]` array when grammars share type names across files without
110
+ * verifying that Langium's `collectAst()` merges them correctly. BECAUSE duplicate type names
111
+ * will silently overwrite each other in the type map, producing truncated schemas.
112
+ * FIX: run `collectAst` separately and inspect the merged map before generation.
113
+ * - NEVER call with `crossRefValidation: true` on grammars with no cross-reference properties —
114
+ * it emits dead `create*Schema` factory functions that add noise without benefit.
115
+ * FIX: only enable `crossRefValidation` when your grammar has at least one `ref:` property.
116
+ * - NEVER remove the `// @ts-nocheck` comment from generated output files. BECAUSE the
117
+ * getter-based recursive property syntax (emitted for self-referential types) is not always
118
+ * accepted by TypeScript's strict object-literal type checker — removing the comment causes
119
+ * immediate TS build failures in grammars with recursive rules. FIX: treat generated files as
120
+ * opaque artifacts; place any hand-written extensions in a separate file that imports the schema.
121
+ * - NEVER commit generated schemas as the sole copy of your schema logic. BECAUSE any grammar
122
+ * edit (new rule, renamed property, changed cardinality) produces stale schemas that pass
123
+ * TypeScript but fail at Zod validation runtime. FIX: wire `langium-zod generate` as a
124
+ * pre-build or CI step so schema freshness is enforced automatically.
125
+ *
126
+ * @category Generation
127
+ * @see {@link extractTypeDescriptors}
128
+ * @see {@link detectRecursiveTypes}
129
+ * @see {@link generateZodCode}
130
+ * @see {@link ZodGeneratorConfig}
131
+ */
16
132
  export function generateZodSchemas(config) {
17
133
  let rawAstTypes;
18
134
  if (config.astTypes) {
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,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,EACjB,MAAM,CAAC,WAAW,CAAC,UAAU,CAC9B,CAAC;QACF,MAAM,WAAW,GAAG,yBAAyB,CAAC;YAC5C,gBAAgB,EAAE,MAAM,CAAC,UAAU;YACnC,qBAAqB;YACrB,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY;YAC7C,eAAe;YACf,WAAW,EAAE,2BAA2B,CAAC;gBACvC,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,cAAc,EAAE,MAAM,CAAC,cAAc;aACtC,CAAC;YACF,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC,CAAC;QAEH,KAAK,MAAM,WAAW,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,oDAAoD,WAAW,aAAa,CAAC,CAAC;QAC7F,CAAC;QAED,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/D,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,uBAAuB,CAC9B,QAAsB,EACtB,MAA0B;IAE1B,MAAM,WAAW,GAAG,sBAAsB,CAAC,QAAQ,EAAE;QACnD,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -10,14 +10,90 @@ export interface LangiumZodConfig extends Omit<ZodGeneratorConfig, 'grammar' | '
10
10
  /** Explicit output path. Overrides derived path from langium-config.json `out` field. */
11
11
  outputPath?: string;
12
12
  }
13
+ /**
14
+ * Merges CLI `--include` / `--exclude` flag values with the base filter from a
15
+ * user config file, producing a deduplicated, conflict-free filter pair.
16
+ *
17
+ * CLI arguments take precedence over the config file values. Any name that appears
18
+ * in both `include` and `exclude` is removed from `include` so that the exclude
19
+ * list is authoritative.
20
+ *
21
+ * @param base - Baseline include/exclude arrays from the user's
22
+ * `langium-zod.config.js`, used when the corresponding CLI flag is absent.
23
+ * @param includeArg - Raw comma-separated string from `--include`, or `undefined`
24
+ * when the flag was not passed.
25
+ * @param excludeArg - Raw comma-separated string from `--exclude`, or `undefined`
26
+ * when the flag was not passed.
27
+ * @returns A resolved `{ include, exclude }` pair ready to merge into the
28
+ * generator config.
29
+ */
13
30
  export declare function resolveFilterOverrides(base: Pick<LangiumZodConfig, 'include' | 'exclude'>, includeArg?: string, excludeArg?: string): Pick<LangiumZodConfig, 'include' | 'exclude'>;
31
+ /**
32
+ * Returns the subset of `requested` names that are not present in
33
+ * `availableTypeNames`.
34
+ *
35
+ * Used to surface warnings when the user's `--include` or `--exclude` list
36
+ * references type names that do not exist in the parsed grammar, helping catch
37
+ * typos before generation runs.
38
+ *
39
+ * @param requested - The type names requested by the user (include or exclude
40
+ * list). Returns an empty array immediately when this is `undefined` or empty.
41
+ * @param availableTypeNames - All type names present in the parsed Langium grammar
42
+ * (both interface types and union/datatype rule types).
43
+ * @returns An array of names from `requested` that are absent from
44
+ * `availableTypeNames`.
45
+ */
14
46
  export declare function getUnknownFilterNames(requested: string[] | undefined, availableTypeNames: string[]): string[];
47
+ /**
48
+ * Options accepted by the programmatic {@link generate} function.
49
+ *
50
+ * Allows the core generation logic to be invoked directly from other tools or
51
+ * scripts without going through the CLI argument parser.
52
+ */
15
53
  export interface GenerateOptions {
16
54
  /** Absolute path to langium-config.json */
17
55
  langiumConfigPath: string;
18
56
  /** Merged generator config (from user's langium-zod.config.js + CLI flags) */
19
57
  config?: LangiumZodConfig;
20
58
  }
59
+ /**
60
+ * Programmatic entry point for the `langium-zod generate` command.
61
+ *
62
+ * Loads `langium-config.json` from `opts.langiumConfigPath`, resolves the grammar
63
+ * file path, parses the grammar with Langium services (including eager import
64
+ * loading so cross-file references link correctly), then calls
65
+ * {@link generateZodSchemas} with the merged configuration. Prints a success
66
+ * message to stdout when generation completes.
67
+ *
68
+ * @param opts - {@link GenerateOptions} specifying the langium config path and
69
+ * optional pre-merged generator config.
70
+ * @throws `Error` when the langium-config.json or grammar file cannot be found, or
71
+ * when the config defines no languages.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * import { generate } from 'langium-zod';
76
+ * import { resolve } from 'node:path';
77
+ *
78
+ * await generate({
79
+ * langiumConfigPath: resolve(process.cwd(), 'langium-config.json'),
80
+ * config: {
81
+ * outputPath: 'src/generated/zod-schemas.ts',
82
+ * stripInternals: true,
83
+ * },
84
+ * });
85
+ * // Prints: ✓ Generated Zod schemas → src/generated/zod-schemas.ts
86
+ * ```
87
+ */
21
88
  export declare function generate(opts: GenerateOptions): Promise<void>;
89
+ /**
90
+ * CLI entry point executed when the `langium-zod` binary is invoked directly.
91
+ *
92
+ * Parses `process.argv`, resolves `langium-config.json`, loads an optional
93
+ * `langium-zod.config.js` from the same directory, merges all CLI flag overrides
94
+ * (--out, --include, --exclude, --projection, --strip-internals, --conformance,
95
+ * --cross-ref-validation), then delegates to {@link generate}. Exits the process
96
+ * with code 1 on error.
97
+ */
22
98
  export declare function main(): Promise<void>;
23
99
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQtD,kEAAkE;AAClE,MAAM,WAAW,gBAChB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IACrE;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAuCD,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,S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S,EAC/B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,MAAM,EAAE,CAOV;AAyED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAuFnE;AAMD;;;;;;;;GAQG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAiG1C"}
package/dist/cli.js CHANGED
@@ -39,6 +39,23 @@ function getArgValue(args, flag) {
39
39
  }
40
40
  return value;
41
41
  }
42
+ /**
43
+ * Merges CLI `--include` / `--exclude` flag values with the base filter from a
44
+ * user config file, producing a deduplicated, conflict-free filter pair.
45
+ *
46
+ * CLI arguments take precedence over the config file values. Any name that appears
47
+ * in both `include` and `exclude` is removed from `include` so that the exclude
48
+ * list is authoritative.
49
+ *
50
+ * @param base - Baseline include/exclude arrays from the user's
51
+ * `langium-zod.config.js`, used when the corresponding CLI flag is absent.
52
+ * @param includeArg - Raw comma-separated string from `--include`, or `undefined`
53
+ * when the flag was not passed.
54
+ * @param excludeArg - Raw comma-separated string from `--exclude`, or `undefined`
55
+ * when the flag was not passed.
56
+ * @returns A resolved `{ include, exclude }` pair ready to merge into the
57
+ * generator config.
58
+ */
42
59
  export function resolveFilterOverrides(base, includeArg, excludeArg) {
43
60
  const includeFromCli = includeArg === undefined ? undefined : parseCsvList(includeArg);
44
61
  const excludeFromCli = excludeArg === undefined ? undefined : parseCsvList(excludeArg);
@@ -56,11 +73,24 @@ function warnUnknownFilterNames(filterName, requested, availableTypeNames) {
56
73
  if (unknown.length === 0) {
57
74
  return;
58
75
  }
59
- const availableList = availableTypeNames.length > 0
60
- ? availableTypeNames.join(', ')
61
- : '(none)';
76
+ const availableList = availableTypeNames.length > 0 ? availableTypeNames.join(', ') : '(none)';
62
77
  console.warn(`Warning: Unknown ${filterName} type name(s): ${unknown.join(', ')}. Available types: ${availableList}`);
63
78
  }
79
+ /**
80
+ * Returns the subset of `requested` names that are not present in
81
+ * `availableTypeNames`.
82
+ *
83
+ * Used to surface warnings when the user's `--include` or `--exclude` list
84
+ * references type names that do not exist in the parsed grammar, helping catch
85
+ * typos before generation runs.
86
+ *
87
+ * @param requested - The type names requested by the user (include or exclude
88
+ * list). Returns an empty array immediately when this is `undefined` or empty.
89
+ * @param availableTypeNames - All type names present in the parsed Langium grammar
90
+ * (both interface types and union/datatype rule types).
91
+ * @returns An array of names from `requested` that are absent from
92
+ * `availableTypeNames`.
93
+ */
64
94
  export function getUnknownFilterNames(requested, availableTypeNames) {
65
95
  if (!requested || requested.length === 0) {
66
96
  return [];
@@ -128,6 +158,35 @@ async function eagerLoad(document, documents, visited = new Set()) {
128
158
  }
129
159
  }
130
160
  }
161
+ /**
162
+ * Programmatic entry point for the `langium-zod generate` command.
163
+ *
164
+ * Loads `langium-config.json` from `opts.langiumConfigPath`, resolves the grammar
165
+ * file path, parses the grammar with Langium services (including eager import
166
+ * loading so cross-file references link correctly), then calls
167
+ * {@link generateZodSchemas} with the merged configuration. Prints a success
168
+ * message to stdout when generation completes.
169
+ *
170
+ * @param opts - {@link GenerateOptions} specifying the langium config path and
171
+ * optional pre-merged generator config.
172
+ * @throws `Error` when the langium-config.json or grammar file cannot be found, or
173
+ * when the config defines no languages.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * import { generate } from 'langium-zod';
178
+ * import { resolve } from 'node:path';
179
+ *
180
+ * await generate({
181
+ * langiumConfigPath: resolve(process.cwd(), 'langium-config.json'),
182
+ * config: {
183
+ * outputPath: 'src/generated/zod-schemas.ts',
184
+ * stripInternals: true,
185
+ * },
186
+ * });
187
+ * // Prints: ✓ Generated Zod schemas → src/generated/zod-schemas.ts
188
+ * ```
189
+ */
131
190
  export async function generate(opts) {
132
191
  const { langiumConfigPath } = opts;
133
192
  const userConfig = opts.config ?? {};
@@ -177,7 +236,7 @@ export async function generate(opts) {
177
236
  await eagerLoad(entryDocument, langiumDocuments);
178
237
  // Build (parse + link) all loaded documents
179
238
  await documentBuilder.build(langiumDocuments.all.toArray(), {
180
- validation: false,
239
+ validation: false
181
240
  });
182
241
  const grammar = entryDocument.parseResult.value;
183
242
  const availableTypeNames = [
@@ -193,13 +252,22 @@ export async function generate(opts) {
193
252
  generateZodSchemas({
194
253
  grammar,
195
254
  outputPath,
196
- ...restConfig,
255
+ ...restConfig
197
256
  });
198
257
  console.log(`✓ Generated Zod schemas → ${outputPath}`);
199
258
  }
200
259
  // ────────────────────────────────────────────────────────────────────────────
201
260
  // CLI entry point
202
261
  // ────────────────────────────────────────────────────────────────────────────
262
+ /**
263
+ * CLI entry point executed when the `langium-zod` binary is invoked directly.
264
+ *
265
+ * Parses `process.argv`, resolves `langium-config.json`, loads an optional
266
+ * `langium-zod.config.js` from the same directory, merges all CLI flag overrides
267
+ * (--out, --include, --exclude, --projection, --strip-internals, --conformance,
268
+ * --cross-ref-validation), then delegates to {@link generate}. Exits the process
269
+ * with code 1 on error.
270
+ */
203
271
  export async function main() {
204
272
  const args = process.argv.slice(2);
205
273
  if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
@@ -231,10 +299,7 @@ export async function main() {
231
299
  // ── Load optional langium-zod.config.js ──────────────────────────────────
232
300
  const configDir = dirname(langiumConfigPath);
233
301
  let userConfig = {};
234
- for (const candidate of [
235
- 'langium-zod.config.js',
236
- 'langium-zod.config.mjs',
237
- ]) {
302
+ for (const candidate of ['langium-zod.config.js', 'langium-zod.config.mjs']) {
238
303
  const candidatePath = join(configDir, candidate);
239
304
  if (existsSync(candidatePath)) {
240
305
  const mod = await import(pathToFileURL(candidatePath).href);
@@ -269,7 +334,9 @@ export async function main() {
269
334
  ...userConfig,
270
335
  conformance: {
271
336
  astTypesPath: astTypesFlagValue ? resolve(process.cwd(), astTypesFlagValue) : undefined,
272
- outputPath: conformanceOutFlagValue ? resolve(process.cwd(), conformanceOutFlagValue) : undefined
337
+ outputPath: conformanceOutFlagValue
338
+ ? resolve(process.cwd(), conformanceOutFlagValue)
339
+ : undefined
273
340
  }
274
341
  };
275
342
  }
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AA0BvD,SAAS,YAAY,CAAC,KAAa;IAClC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,SAAS;QACV,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,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