@fabricorg/fabric-gen 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Deliver Phase 1 correctness and contracts: payload-bound idempotency with staged enforcement,
8
+ capture/replay authority evidence, bounded invocation provenance, capability execution and view usage
9
+ semantics, event-schema compatibility classification, and deterministic conformance plans.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+ - @fabricorg/compiler@1.0.0
15
+ - @fabricorg/gen-capability@0.3.0
16
+ - @fabricorg/gen-sdui@0.3.0
17
+ - @fabricorg/gen-conformance@0.1.0
18
+ - @fabricorg/gen-graphql@1.0.0
19
+ - @fabricorg/gen-prisma@1.0.0
20
+ - @fabricorg/gen-types@1.0.0
21
+ - @fabricorg/gen-docs@0.2.2
22
+ - @fabricorg/gen-events@0.2.2
23
+
24
+ ## 0.2.1
25
+
26
+ ### Patch Changes
27
+
28
+ - Close final uplift audit gaps: align Host 2.x documentation and migration evidence, surface every
29
+ compiler/generator API to LLM consumers, make memory outbox egress directly usable, sanitize relay
30
+ failures, validate complete archetype state maps, support recursive JSON Schema generation, reject
31
+ cross-platform path traversal, synchronize artifact version stamps, and include package licenses.
32
+ - Delete target-scoped stale artifacts during normal generation and reject non-object manifest input
33
+ with a stable diagnostic.
34
+ - Updated dependencies
35
+ - @fabricorg/compiler@0.2.1
36
+ - @fabricorg/gen-types@0.2.1
37
+ - @fabricorg/gen-events@0.2.1
38
+ - @fabricorg/gen-capability@0.2.1
39
+ - @fabricorg/gen-docs@0.2.1
40
+ - @fabricorg/gen-prisma@0.2.1
41
+ - @fabricorg/gen-graphql@0.2.1
42
+ - @fabricorg/gen-sdui@0.2.1
43
+
3
44
  ## 0.2.0
4
45
 
5
46
  ### Minor Changes
@@ -1,7 +1,5 @@
1
- #!/usr/bin/env node
2
-
3
1
  // index.ts
4
- import { mkdir, readFile, readdir, writeFile } from "fs/promises";
2
+ import { mkdir, readFile, readdir, rm, writeFile } from "fs/promises";
5
3
  import path from "path";
6
4
  import { compileManifestBundle, runGenerator } from "@fabricorg/compiler";
7
5
  import { capabilityGenerator } from "@fabricorg/gen-capability";
@@ -11,6 +9,7 @@ import { typesGenerator } from "@fabricorg/gen-types";
11
9
  import { prismaGenerator } from "@fabricorg/gen-prisma";
12
10
  import { graphqlGenerator } from "@fabricorg/gen-graphql";
13
11
  import { sduiGenerator } from "@fabricorg/gen-sdui";
12
+ import { conformanceGenerator } from "@fabricorg/gen-conformance";
14
13
  var GENERATOR_TARGETS = {
15
14
  types: typesGenerator,
16
15
  events: eventsGenerator,
@@ -18,11 +17,13 @@ var GENERATOR_TARGETS = {
18
17
  docs: docsGenerator,
19
18
  prisma: prismaGenerator,
20
19
  graphql: graphqlGenerator,
21
- sdui: sduiGenerator
20
+ sdui: sduiGenerator,
21
+ conformance: conformanceGenerator
22
22
  };
23
23
  var compareCanonicalStrings = (left, right) => left < right ? -1 : left > right ? 1 : 0;
24
24
  async function generateFromManifest(options) {
25
25
  const input = JSON.parse(await readFile(options.inputPath, "utf8"));
26
+ if (!input || typeof input !== "object" || Array.isArray(input)) throw new Error("Manifest input must be a JSON object.");
26
27
  const bundle = "modules" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };
27
28
  const ir = compileManifestBundle(bundle);
28
29
  const files = (await Promise.all(options.targets.map(async (name) => {
@@ -34,6 +35,7 @@ async function generateFromManifest(options) {
34
35
  const existing = await listFiles(options.outputDirectory);
35
36
  const selectedPrefixes = options.targets.map((target) => `${target}/`);
36
37
  const stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));
38
+ if (!options.check) await Promise.all(stale.map((file) => rm(path.join(options.outputDirectory, file), { force: true })));
37
39
  const changed = [];
38
40
  for (const file of files) {
39
41
  const target = path.join(options.outputDirectory, file.path);
@@ -69,4 +71,4 @@ export {
69
71
  GENERATOR_TARGETS,
70
72
  generateFromManifest
71
73
  };
72
- //# sourceMappingURL=chunk-OKPHRFAQ.js.map
74
+ //# sourceMappingURL=chunk-QOD7G4YK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import { mkdir, readFile, readdir, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { compileManifestBundle, runGenerator, type GeneratedFile, type GeneratorTarget } from \"@fabricorg/compiler\";\nimport { capabilityGenerator } from \"@fabricorg/gen-capability\";\nimport { docsGenerator } from \"@fabricorg/gen-docs\";\nimport { eventsGenerator } from \"@fabricorg/gen-events\";\nimport { typesGenerator } from \"@fabricorg/gen-types\";\nimport { prismaGenerator } from \"@fabricorg/gen-prisma\";\nimport { graphqlGenerator } from \"@fabricorg/gen-graphql\";\nimport { sduiGenerator } from \"@fabricorg/gen-sdui\";\nimport { conformanceGenerator } from \"@fabricorg/gen-conformance\";\n\nexport const GENERATOR_TARGETS: Record<string, GeneratorTarget> = {\n\ttypes: typesGenerator,\n\tevents: eventsGenerator,\n\tcapability: capabilityGenerator,\n\tdocs: docsGenerator,\n\tprisma: prismaGenerator,\n\tgraphql: graphqlGenerator,\n\tsdui: sduiGenerator,\n\tconformance: conformanceGenerator,\n};\nconst compareCanonicalStrings = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\n\nexport interface GenerateOptions { inputPath: string; outputDirectory: string; targets: string[]; check?: boolean; }\nexport interface GenerateResult { changed: string[]; stale: string[]; files: GeneratedFile[]; }\n\nexport async function generateFromManifest(options: GenerateOptions): Promise<GenerateResult> {\n\tconst input = JSON.parse(await readFile(options.inputPath, \"utf8\"));\n\tif (!input || typeof input !== \"object\" || Array.isArray(input)) throw new Error(\"Manifest input must be a JSON object.\");\n\tconst bundle = \"modules\" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };\n\tconst ir = compileManifestBundle(bundle);\n\tconst files = (await Promise.all(options.targets.map(async (name) => {\n\t\tconst target = GENERATOR_TARGETS[name];\n\t\tif (!target) throw new Error(`Unknown generator target \"${name}\".`);\n\t\treturn (await runGenerator(target, ir)).map((file) => ({ ...file, path: `${name}/${file.path}` }));\n\t}))).flat().sort((left, right) => compareCanonicalStrings(left.path, right.path));\n\tconst expected = new Set(files.map((file) => file.path));\n\tconst existing = await listFiles(options.outputDirectory);\n\tconst selectedPrefixes = options.targets.map((target) => `${target}/`);\n\tconst stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));\n\tif (!options.check) await Promise.all(stale.map((file) => rm(path.join(options.outputDirectory, file), { force: true })));\n\tconst changed: string[] = [];\n\tfor (const file of files) {\n\t\tconst target = path.join(options.outputDirectory, file.path);\n\t\tlet current: string | undefined;\n\t\ttry { current = await readFile(target, \"utf8\"); } catch { current = undefined; }\n\t\tif (current !== file.content) {\n\t\t\tchanged.push(file.path);\n\t\t\tif (!options.check) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, file.content, \"utf8\"); }\n\t\t}\n\t}\n\tif (options.check && (changed.length || stale.length)) throw new Error(`Generated artifacts drifted: ${[...changed, ...stale.map((file) => `stale:${file}`)].join(\", \")}`);\n\treturn { changed, stale, files };\n}\n\nasync function listFiles(directory: string, prefix = \"\"): Promise<string[]> {\n\tlet entries;\n\ttry { entries = await readdir(directory, { withFileTypes: true }); } catch { return []; }\n\tconst nested = await Promise.all(entries.map((entry) => entry.isDirectory() ? listFiles(path.join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]));\n\treturn nested.flat().sort();\n}\n"],"mappings":";AAAA,SAAS,OAAO,UAAU,SAAS,IAAI,iBAAiB;AACxD,OAAO,UAAU;AACjB,SAAS,uBAAuB,oBAA8D;AAC9F,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AA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GAAG,MAAM,GAAG,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC,CAAC;AAClL,SAAO,OAAO,KAAK,EAAE,KAAK;AAC3B;","names":[]}
package/dist/cli.cjs CHANGED
@@ -34,6 +34,7 @@ var import_gen_types = require("@fabricorg/gen-types");
34
34
  var import_gen_prisma = require("@fabricorg/gen-prisma");
35
35
  var import_gen_graphql = require("@fabricorg/gen-graphql");
36
36
  var import_gen_sdui = require("@fabricorg/gen-sdui");
37
+ var import_gen_conformance = require("@fabricorg/gen-conformance");
37
38
  var GENERATOR_TARGETS = {
38
39
  types: import_gen_types.typesGenerator,
39
40
  events: import_gen_events.eventsGenerator,
@@ -41,11 +42,13 @@ var GENERATOR_TARGETS = {
41
42
  docs: import_gen_docs.docsGenerator,
42
43
  prisma: import_gen_prisma.prismaGenerator,
43
44
  graphql: import_gen_graphql.graphqlGenerator,
44
- sdui: import_gen_sdui.sduiGenerator
45
+ sdui: import_gen_sdui.sduiGenerator,
46
+ conformance: import_gen_conformance.conformanceGenerator
45
47
  };
46
48
  var compareCanonicalStrings = (left, right) => left < right ? -1 : left > right ? 1 : 0;
47
49
  async function generateFromManifest(options) {
48
50
  const input = JSON.parse(await (0, import_promises.readFile)(options.inputPath, "utf8"));
51
+ if (!input || typeof input !== "object" || Array.isArray(input)) throw new Error("Manifest input must be a JSON object.");
49
52
  const bundle = "modules" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };
50
53
  const ir = (0, import_compiler.compileManifestBundle)(bundle);
51
54
  const files = (await Promise.all(options.targets.map(async (name) => {
@@ -57,6 +60,7 @@ async function generateFromManifest(options) {
57
60
  const existing = await listFiles(options.outputDirectory);
58
61
  const selectedPrefixes = options.targets.map((target) => `${target}/`);
59
62
  const stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));
63
+ if (!options.check) await Promise.all(stale.map((file) => (0, import_promises.rm)(import_node_path.default.join(options.outputDirectory, file), { force: true })));
60
64
  const changed = [];
61
65
  for (const file of files) {
62
66
  const target = import_node_path.default.join(options.outputDirectory, file.path);
package/dist/cli.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts","../cli.ts"],"sourcesContent":["import { mkdir, readFile, readdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { compileManifestBundle, runGenerator, type GeneratedFile, type GeneratorTarget } from \"@fabricorg/compiler\";\nimport { capabilityGenerator } from \"@fabricorg/gen-capability\";\nimport { docsGenerator } from \"@fabricorg/gen-docs\";\nimport { eventsGenerator } from \"@fabricorg/gen-events\";\nimport { typesGenerator } from \"@fabricorg/gen-types\";\nimport { prismaGenerator } from \"@fabricorg/gen-prisma\";\nimport { graphqlGenerator } from \"@fabricorg/gen-graphql\";\nimport { sduiGenerator } from \"@fabricorg/gen-sdui\";\n\nexport const GENERATOR_TARGETS: Record<string, GeneratorTarget> = {\n\ttypes: typesGenerator,\n\tevents: eventsGenerator,\n\tcapability: capabilityGenerator,\n\tdocs: docsGenerator,\n\tprisma: prismaGenerator,\n\tgraphql: graphqlGenerator,\n\tsdui: sduiGenerator,\n};\nconst compareCanonicalStrings = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\n\nexport interface GenerateOptions { inputPath: string; outputDirectory: string; targets: string[]; check?: boolean; }\nexport interface GenerateResult { changed: string[]; stale: string[]; files: GeneratedFile[]; }\n\nexport async function generateFromManifest(options: GenerateOptions): Promise<GenerateResult> {\n\tconst input = JSON.parse(await readFile(options.inputPath, \"utf8\"));\n\tconst bundle = \"modules\" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };\n\tconst ir = compileManifestBundle(bundle);\n\tconst files = (await Promise.all(options.targets.map(async (name) => {\n\t\tconst target = GENERATOR_TARGETS[name];\n\t\tif (!target) throw new Error(`Unknown generator target \"${name}\".`);\n\t\treturn (await runGenerator(target, ir)).map((file) => ({ ...file, path: `${name}/${file.path}` }));\n\t}))).flat().sort((left, right) => compareCanonicalStrings(left.path, right.path));\n\tconst expected = new Set(files.map((file) => file.path));\n\tconst existing = await listFiles(options.outputDirectory);\n\tconst selectedPrefixes = options.targets.map((target) => `${target}/`);\n\tconst stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));\n\tconst changed: string[] = [];\n\tfor (const file of files) {\n\t\tconst target = path.join(options.outputDirectory, file.path);\n\t\tlet current: string | undefined;\n\t\ttry { current = await readFile(target, \"utf8\"); } catch { current = undefined; }\n\t\tif (current !== file.content) {\n\t\t\tchanged.push(file.path);\n\t\t\tif (!options.check) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, file.content, \"utf8\"); }\n\t\t}\n\t}\n\tif (options.check && (changed.length || stale.length)) throw new Error(`Generated artifacts drifted: ${[...changed, ...stale.map((file) => `stale:${file}`)].join(\", \")}`);\n\treturn { changed, stale, files };\n}\n\nasync function listFiles(directory: string, prefix = \"\"): Promise<string[]> {\n\tlet entries;\n\ttry { entries = await readdir(directory, { withFileTypes: true }); } catch { return []; }\n\tconst nested = await Promise.all(entries.map((entry) => entry.isDirectory() ? listFiles(path.join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]));\n\treturn nested.flat().sort();\n}\n","import { generateFromManifest } from \"./index\";\n\nconst args = process.argv.slice(2);\nconst value = (flag: string): string | undefined => { const index = args.indexOf(flag); return index >= 0 ? args[index + 1] : undefined; };\nconst inputPath = value(\"--input\");\nconst outputDirectory = value(\"--out\");\nif (!inputPath || !outputDirectory) {\n\tconsole.error(\"Usage: fabric-gen --input manifest.json --out generated [--targets types,events,capability,docs] [--check]\");\n\tprocess.exitCode = 2;\n} else {\n\tgenerateFromManifest({ inputPath, outputDirectory, targets: (value(\"--targets\") ?? \"types,events,capability,docs\").split(\",\").filter(Boolean), check: args.includes(\"--check\") })\n\t\t.then((result) => console.log(`${args.includes(\"--check\") ? \"Checked\" : \"Generated\"} ${result.files.length} files.`))\n\t\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AAC,GAAG,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC,CAAC;AAClL,SAAO,OAAO,KAAK,EAAE,KAAK;AAC3B;;;ACvDA,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,QAAQ,CAAC,SAAqC;AAAE,QAAM,QAAQ,KAAK,QAAQ,IAAI;AAAG,SAAO,SAAS,IAAI,KAAK,QAAQ,CAAC,IAAI;AAAW;AACzI,IAAM,YAAY,MAAM,SAAS;AACjC,IAAM,kBAAkB,MAAM,OAAO;AACrC,IAAI,CAAC,aAAa,CAAC,iBAAiB;AACnC,UAAQ,MAAM,4GAA4G;AAC1H,UAAQ,WAAW;AACpB,OAAO;AACN,uBAAqB,EAAE,WAAW,iBAAiB,UAAU,MAAM,WAAW,KAAK,gCAAgC,MAAM,GAAG,EAAE,OAAO,OAAO,GAAG,OAAO,KAAK,SAAS,SAAS,EAAE,CAAC,EAC9K,KAAK,CAAC,WAAW,QAAQ,IAAI,GAAG,KAAK,SAAS,SAAS,IAAI,YAAY,WAAW,IAAI,OAAO,MAAM,MAAM,SAAS,CAAC,EACnH,MAAM,CAAC,UAAmB;AAAE,YAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAG,YAAQ,WAAW;AAAA,EAAG,CAAC;AAC7H;","names":["path"]}
1
+ {"version":3,"sources":["../index.ts","../cli.ts"],"sourcesContent":["import { mkdir, readFile, readdir, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { compileManifestBundle, runGenerator, type GeneratedFile, type GeneratorTarget } from \"@fabricorg/compiler\";\nimport { capabilityGenerator } from \"@fabricorg/gen-capability\";\nimport { docsGenerator } from \"@fabricorg/gen-docs\";\nimport { eventsGenerator } from \"@fabricorg/gen-events\";\nimport { typesGenerator } from \"@fabricorg/gen-types\";\nimport { prismaGenerator } from \"@fabricorg/gen-prisma\";\nimport { graphqlGenerator } from \"@fabricorg/gen-graphql\";\nimport { sduiGenerator } from \"@fabricorg/gen-sdui\";\nimport { conformanceGenerator } from \"@fabricorg/gen-conformance\";\n\nexport const GENERATOR_TARGETS: Record<string, GeneratorTarget> = {\n\ttypes: typesGenerator,\n\tevents: eventsGenerator,\n\tcapability: capabilityGenerator,\n\tdocs: docsGenerator,\n\tprisma: prismaGenerator,\n\tgraphql: graphqlGenerator,\n\tsdui: sduiGenerator,\n\tconformance: conformanceGenerator,\n};\nconst compareCanonicalStrings = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\n\nexport interface GenerateOptions { inputPath: string; outputDirectory: string; targets: string[]; check?: boolean; }\nexport interface GenerateResult { changed: string[]; stale: string[]; files: GeneratedFile[]; }\n\nexport async function generateFromManifest(options: GenerateOptions): Promise<GenerateResult> {\n\tconst input = JSON.parse(await readFile(options.inputPath, \"utf8\"));\n\tif (!input || typeof input !== \"object\" || Array.isArray(input)) throw new Error(\"Manifest input must be a JSON object.\");\n\tconst bundle = \"modules\" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };\n\tconst ir = compileManifestBundle(bundle);\n\tconst files = (await Promise.all(options.targets.map(async (name) => {\n\t\tconst target = GENERATOR_TARGETS[name];\n\t\tif (!target) throw new Error(`Unknown generator target \"${name}\".`);\n\t\treturn (await runGenerator(target, ir)).map((file) => ({ ...file, path: `${name}/${file.path}` }));\n\t}))).flat().sort((left, right) => compareCanonicalStrings(left.path, right.path));\n\tconst expected = new Set(files.map((file) => file.path));\n\tconst existing = await listFiles(options.outputDirectory);\n\tconst selectedPrefixes = options.targets.map((target) => `${target}/`);\n\tconst stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));\n\tif (!options.check) await Promise.all(stale.map((file) => rm(path.join(options.outputDirectory, file), { force: true })));\n\tconst changed: string[] = [];\n\tfor (const file of files) {\n\t\tconst target = path.join(options.outputDirectory, file.path);\n\t\tlet current: string | undefined;\n\t\ttry { current = await readFile(target, \"utf8\"); } catch { current = undefined; }\n\t\tif (current !== file.content) {\n\t\t\tchanged.push(file.path);\n\t\t\tif (!options.check) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, file.content, \"utf8\"); }\n\t\t}\n\t}\n\tif (options.check && (changed.length || stale.length)) throw new Error(`Generated artifacts drifted: ${[...changed, ...stale.map((file) => `stale:${file}`)].join(\", \")}`);\n\treturn { changed, stale, files };\n}\n\nasync function listFiles(directory: string, prefix = \"\"): Promise<string[]> {\n\tlet entries;\n\ttry { entries = await readdir(directory, { withFileTypes: true }); } catch { return []; }\n\tconst nested = await Promise.all(entries.map((entry) => entry.isDirectory() ? listFiles(path.join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]));\n\treturn nested.flat().sort();\n}\n","#!/usr/bin/env node\nimport { generateFromManifest } from \"./index\";\n\nconst args = process.argv.slice(2);\nconst value = (flag: string): string | undefined => { const index = args.indexOf(flag); return index >= 0 ? args[index + 1] : undefined; };\nconst inputPath = value(\"--input\");\nconst outputDirectory = value(\"--out\");\nif (!inputPath || !outputDirectory) {\n\tconsole.error(\"Usage: fabric-gen --input manifest.json --out generated [--targets types,events,capability,docs] [--check]\");\n\tprocess.exitCode = 2;\n} else {\n\tgenerateFromManifest({ inputPath, outputDirectory, targets: (value(\"--targets\") ?? \"types,events,capability,docs\").split(\",\").filter(Boolean), check: args.includes(\"--check\") })\n\t\t.then((result) => console.log(`${args.includes(\"--check\") ? \"Checked\" : \"Generated\"} ${result.files.length} files.`))\n\t\t.catch((error: unknown) => { console.error(error instanceof Error ? error.message : String(error)); process.exitCode = 1; });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAwD;AACxD,uBAAiB;AACjB,sBAA8F;AAC9F,4BAAoC;AACpC,sBAA8B;AAC9B,wBAAgC;AAChC,uBAA+B;AAC/B,wBAAgC;AAChC,yBAAiC;AACjC,sBAA8B;AAC9B,6BAAqC;AAE9B,IAAM,oBAAqD;AAAA,EACjE,OAAO;AAAA,EACP,QAAQ;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AAI,EAAE,CAAC,CAAC;AAClL,SAAO,OAAO,KAAK,EAAE,KAAK;AAC3B;;;AC1DA,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,QAAQ,CAAC,SAAqC;AAAE,QAAM,QAAQ,KAAK,QAAQ,IAAI;AAAG,SAAO,SAAS,IAAI,KAAK,QAAQ,CAAC,IAAI;AAAW;AACzI,IAAM,YAAY,MAAM,SAAS;AACjC,IAAM,kBAAkB,MAAM,OAAO;AACrC,IAAI,CAAC,aAAa,CAAC,iBAAiB;AACnC,UAAQ,MAAM,4GAA4G;AAC1H,UAAQ,WAAW;AACpB,OAAO;AACN,uBAAqB,EAAE,WAAW,iBAAiB,UAAU,MAAM,WAAW,KAAK,gCAAgC,MAAM,GAAG,EAAE,OAAO,OAAO,GAAG,OAAO,KAAK,SAAS,SAAS,EAAE,CAAC,EAC9K,KAAK,CAAC,WAAW,QAAQ,IAAI,GAAG,KAAK,SAAS,SAAS,IAAI,YAAY,WAAW,IAAI,OAAO,MAAM,MAAM,SAAS,CAAC,EACnH,MAAM,CAAC,UAAmB;AAAE,YAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAG,YAAQ,WAAW;AAAA,EAAG,CAAC;AAC7H;","names":["path"]}
package/dist/cli.d.cts CHANGED
@@ -1,2 +1 @@
1
-
2
- export { }
1
+ #!/usr/bin/env node
package/dist/cli.d.ts CHANGED
@@ -1,2 +1 @@
1
-
2
- export { }
1
+ #!/usr/bin/env node
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generateFromManifest
4
- } from "./chunk-OKPHRFAQ.js";
4
+ } from "./chunk-QOD7G4YK.js";
5
5
 
6
6
  // cli.ts
7
7
  var args = process.argv.slice(2);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli.ts"],"sourcesContent":["import { generateFromManifest } from \"./index\";\n\nconst args = process.argv.slice(2);\nconst value = (flag: string): string | undefined => { const index = args.indexOf(flag); return index >= 0 ? args[index + 1] : undefined; };\nconst inputPath = value(\"--input\");\nconst outputDirectory = value(\"--out\");\nif (!inputPath || !outputDirectory) {\n\tconsole.error(\"Usage: fabric-gen --input manifest.json --out generated [--targets types,events,capability,docs] [--check]\");\n\tprocess.exitCode = 2;\n} else {\n\tgenerateFromManifest({ inputPath, outputDirectory, targets: (value(\"--targets\") ?? \"types,events,capability,docs\").split(\",\").filter(Boolean), check: args.includes(\"--check\") })\n\t\t.then((result) => console.log(`${args.includes(\"--check\") ? \"Checked\" : \"Generated\"} ${result.files.length} files.`))\n\t\t.catch((error: unknown) => { console.error(error instanceof Error ? error.message : String(error)); process.exitCode = 1; });\n}\n"],"mappings":";;;;;;AAEA,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,QAAQ,CAAC,SAAqC;AAAE,QAAM,QAAQ,KAAK,QAAQ,IAAI;AAAG,SAAO,SAAS,IAAI,KAAK,QAAQ,CAAC,IAAI;AAAW;AACzI,IAAM,YAAY,MAAM,SAAS;AACjC,IAAM,kBAAkB,MAAM,OAAO;AACrC,IAAI,CAAC,aAAa,CAAC,iBAAiB;AACnC,UAAQ,MAAM,4GAA4G;AAC1H,UAAQ,WAAW;AACpB,OAAO;AACN,uBAAqB,EAAE,WAAW,iBAAiB,UAAU,MAAM,WAAW,KAAK,gCAAgC,MAAM,GAAG,EAAE,OAAO,OAAO,GAAG,OAAO,KAAK,SAAS,SAAS,EAAE,CAAC,EAC9K,KAAK,CAAC,WAAW,QAAQ,IAAI,GAAG,KAAK,SAAS,SAAS,IAAI,YAAY,WAAW,IAAI,OAAO,MAAM,MAAM,SAAS,CAAC,EACnH,MAAM,CAAC,UAAmB;AAAE,YAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAG,YAAQ,WAAW;AAAA,EAAG,CAAC;AAC7H;","names":[]}
1
+ {"version":3,"sources":["../cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { generateFromManifest } from \"./index\";\n\nconst args = process.argv.slice(2);\nconst value = (flag: string): string | undefined => { const index = args.indexOf(flag); return index >= 0 ? args[index + 1] : undefined; };\nconst inputPath = value(\"--input\");\nconst outputDirectory = value(\"--out\");\nif (!inputPath || !outputDirectory) {\n\tconsole.error(\"Usage: fabric-gen --input manifest.json --out generated [--targets types,events,capability,docs] [--check]\");\n\tprocess.exitCode = 2;\n} else {\n\tgenerateFromManifest({ inputPath, outputDirectory, targets: (value(\"--targets\") ?? \"types,events,capability,docs\").split(\",\").filter(Boolean), check: args.includes(\"--check\") })\n\t\t.then((result) => console.log(`${args.includes(\"--check\") ? \"Checked\" : \"Generated\"} ${result.files.length} files.`))\n\t\t.catch((error: unknown) => { console.error(error instanceof Error ? error.message : String(error)); process.exitCode = 1; });\n}\n"],"mappings":";;;;;;AAGA,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,QAAQ,CAAC,SAAqC;AAAE,QAAM,QAAQ,KAAK,QAAQ,IAAI;AAAG,SAAO,SAAS,IAAI,KAAK,QAAQ,CAAC,IAAI;AAAW;AACzI,IAAM,YAAY,MAAM,SAAS;AACjC,IAAM,kBAAkB,MAAM,OAAO;AACrC,IAAI,CAAC,aAAa,CAAC,iBAAiB;AACnC,UAAQ,MAAM,4GAA4G;AAC1H,UAAQ,WAAW;AACpB,OAAO;AACN,uBAAqB,EAAE,WAAW,iBAAiB,UAAU,MAAM,WAAW,KAAK,gCAAgC,MAAM,GAAG,EAAE,OAAO,OAAO,GAAG,OAAO,KAAK,SAAS,SAAS,EAAE,CAAC,EAC9K,KAAK,CAAC,WAAW,QAAQ,IAAI,GAAG,KAAK,SAAS,SAAS,IAAI,YAAY,WAAW,IAAI,OAAO,MAAM,MAAM,SAAS,CAAC,EACnH,MAAM,CAAC,UAAmB;AAAE,YAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAG,YAAQ,WAAW;AAAA,EAAG,CAAC;AAC7H;","names":[]}
package/dist/index.cjs CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  "use strict";
3
2
  var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
@@ -45,6 +44,7 @@ var import_gen_types = require("@fabricorg/gen-types");
45
44
  var import_gen_prisma = require("@fabricorg/gen-prisma");
46
45
  var import_gen_graphql = require("@fabricorg/gen-graphql");
47
46
  var import_gen_sdui = require("@fabricorg/gen-sdui");
47
+ var import_gen_conformance = require("@fabricorg/gen-conformance");
48
48
  var GENERATOR_TARGETS = {
49
49
  types: import_gen_types.typesGenerator,
50
50
  events: import_gen_events.eventsGenerator,
@@ -52,11 +52,13 @@ var GENERATOR_TARGETS = {
52
52
  docs: import_gen_docs.docsGenerator,
53
53
  prisma: import_gen_prisma.prismaGenerator,
54
54
  graphql: import_gen_graphql.graphqlGenerator,
55
- sdui: import_gen_sdui.sduiGenerator
55
+ sdui: import_gen_sdui.sduiGenerator,
56
+ conformance: import_gen_conformance.conformanceGenerator
56
57
  };
57
58
  var compareCanonicalStrings = (left, right) => left < right ? -1 : left > right ? 1 : 0;
58
59
  async function generateFromManifest(options) {
59
60
  const input = JSON.parse(await (0, import_promises.readFile)(options.inputPath, "utf8"));
61
+ if (!input || typeof input !== "object" || Array.isArray(input)) throw new Error("Manifest input must be a JSON object.");
60
62
  const bundle = "modules" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };
61
63
  const ir = (0, import_compiler.compileManifestBundle)(bundle);
62
64
  const files = (await Promise.all(options.targets.map(async (name) => {
@@ -68,6 +70,7 @@ async function generateFromManifest(options) {
68
70
  const existing = await listFiles(options.outputDirectory);
69
71
  const selectedPrefixes = options.targets.map((target) => `${target}/`);
70
72
  const stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));
73
+ if (!options.check) await Promise.all(stale.map((file) => (0, import_promises.rm)(import_node_path.default.join(options.outputDirectory, file), { force: true })));
71
74
  const changed = [];
72
75
  for (const file of files) {
73
76
  const target = import_node_path.default.join(options.outputDirectory, file.path);
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts"],"sourcesContent":["import { mkdir, readFile, readdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { compileManifestBundle, runGenerator, type GeneratedFile, type GeneratorTarget } from \"@fabricorg/compiler\";\nimport { capabilityGenerator } from \"@fabricorg/gen-capability\";\nimport { docsGenerator } from \"@fabricorg/gen-docs\";\nimport { eventsGenerator } from \"@fabricorg/gen-events\";\nimport { typesGenerator } from \"@fabricorg/gen-types\";\nimport { prismaGenerator } from \"@fabricorg/gen-prisma\";\nimport { graphqlGenerator } from \"@fabricorg/gen-graphql\";\nimport { sduiGenerator } from \"@fabricorg/gen-sdui\";\n\nexport const GENERATOR_TARGETS: Record<string, GeneratorTarget> = {\n\ttypes: typesGenerator,\n\tevents: eventsGenerator,\n\tcapability: capabilityGenerator,\n\tdocs: docsGenerator,\n\tprisma: prismaGenerator,\n\tgraphql: graphqlGenerator,\n\tsdui: sduiGenerator,\n};\nconst compareCanonicalStrings = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\n\nexport interface GenerateOptions { inputPath: string; outputDirectory: string; targets: string[]; check?: boolean; }\nexport interface GenerateResult { changed: string[]; stale: string[]; files: GeneratedFile[]; }\n\nexport async function generateFromManifest(options: GenerateOptions): Promise<GenerateResult> {\n\tconst input = JSON.parse(await readFile(options.inputPath, \"utf8\"));\n\tconst bundle = \"modules\" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };\n\tconst ir = compileManifestBundle(bundle);\n\tconst files = (await Promise.all(options.targets.map(async (name) => {\n\t\tconst target = GENERATOR_TARGETS[name];\n\t\tif (!target) throw new Error(`Unknown generator target \"${name}\".`);\n\t\treturn (await runGenerator(target, ir)).map((file) => ({ ...file, path: `${name}/${file.path}` }));\n\t}))).flat().sort((left, right) => compareCanonicalStrings(left.path, right.path));\n\tconst expected = new Set(files.map((file) => file.path));\n\tconst existing = await listFiles(options.outputDirectory);\n\tconst selectedPrefixes = options.targets.map((target) => `${target}/`);\n\tconst stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));\n\tconst changed: string[] = [];\n\tfor (const file of files) {\n\t\tconst target = path.join(options.outputDirectory, file.path);\n\t\tlet current: string | undefined;\n\t\ttry { current = await readFile(target, \"utf8\"); } catch { current = undefined; }\n\t\tif (current !== file.content) {\n\t\t\tchanged.push(file.path);\n\t\t\tif (!options.check) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, file.content, \"utf8\"); }\n\t\t}\n\t}\n\tif (options.check && (changed.length || stale.length)) throw new Error(`Generated artifacts drifted: ${[...changed, ...stale.map((file) => `stale:${file}`)].join(\", \")}`);\n\treturn { changed, stale, files };\n}\n\nasync function listFiles(directory: string, prefix = \"\"): Promise<string[]> {\n\tlet entries;\n\ttry { entries = await readdir(directory, { withFileTypes: true }); } catch { return []; }\n\tconst nested = await Promise.all(entries.map((entry) => entry.isDirectory() ? listFiles(path.join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]));\n\treturn nested.flat().sort();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoD;AACpD,uBAAiB;AACjB,sBAA8F;AAC9F,4BAAoC;AACpC,sBAA8B;AAC9B,wBAAgC;AAChC,uBAA+B;AAC/B,wBAAgC;AAChC,yBAAiC;AACjC,sBAA8B;AAEvB,IAAM,oBAAqD;AAAA,EACjE,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACP;AACA,IAAM,0BAA0B,CAAC,MAAc,UAA0B,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAKhH,eAAsB,qBAA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QAAQ,OAAO;AAAE,kBAAM,uBAAM,iBAAAA,QAAK,QAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;AAAG,kBAAM,2BAAU,QAAQ,KAAK,SAAS,MAAM;AAAA,MAAG;AAAA,IAC9H;AAAA,EACD;AACA,MAAI,QAAQ,UAAU,QAAQ,UAAU,MAAM,QAAS,OAAM,IAAI,MAAM,gCAAgC,CAAC,GAAG,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,SAAS,IAAI,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;AACzK,SAAO,EAAE,SAAS,OAAO,MAAM;AAChC;AAEA,eAAe,UAAU,WAAmB,SAAS,IAAuB;AAC3E,MAAI;AACJ,MAAI;AAAE,cAAU,UAAM,yBAAQ,WAAW,EAAE,eAAe,KAAK,CAAC;AAAA,EAAG,QAAQ;AAAE,WAAO,CAAC;AAAA,EAAG;AACxF,QAAM,SAAS,MAAM,QAAQ,IAAI,QAAQ,IAAI,CAAC,UAAU,MAAM,YAAY,IAAI,UAAU,iBAAAA,QAAK,KAAK,WAAW,MAAM,IAAI,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC,CAAC;AAClL,SAAO,OAAO,KAAK,EAAE,KAAK;AAC3B;","names":["path"]}
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import { mkdir, readFile, readdir, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { compileManifestBundle, runGenerator, type GeneratedFile, type GeneratorTarget } from \"@fabricorg/compiler\";\nimport { capabilityGenerator } from \"@fabricorg/gen-capability\";\nimport { docsGenerator } from \"@fabricorg/gen-docs\";\nimport { eventsGenerator } from \"@fabricorg/gen-events\";\nimport { typesGenerator } from \"@fabricorg/gen-types\";\nimport { prismaGenerator } from \"@fabricorg/gen-prisma\";\nimport { graphqlGenerator } from \"@fabricorg/gen-graphql\";\nimport { sduiGenerator } from \"@fabricorg/gen-sdui\";\nimport { conformanceGenerator } from \"@fabricorg/gen-conformance\";\n\nexport const GENERATOR_TARGETS: Record<string, GeneratorTarget> = {\n\ttypes: typesGenerator,\n\tevents: eventsGenerator,\n\tcapability: capabilityGenerator,\n\tdocs: docsGenerator,\n\tprisma: prismaGenerator,\n\tgraphql: graphqlGenerator,\n\tsdui: sduiGenerator,\n\tconformance: conformanceGenerator,\n};\nconst compareCanonicalStrings = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\n\nexport interface GenerateOptions { inputPath: string; outputDirectory: string; targets: string[]; check?: boolean; }\nexport interface GenerateResult { changed: string[]; stale: string[]; files: GeneratedFile[]; }\n\nexport async function generateFromManifest(options: GenerateOptions): Promise<GenerateResult> {\n\tconst input = JSON.parse(await readFile(options.inputPath, \"utf8\"));\n\tif (!input || typeof input !== \"object\" || Array.isArray(input)) throw new Error(\"Manifest input must be a JSON object.\");\n\tconst bundle = \"modules\" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };\n\tconst ir = compileManifestBundle(bundle);\n\tconst files = (await Promise.all(options.targets.map(async (name) => {\n\t\tconst target = GENERATOR_TARGETS[name];\n\t\tif (!target) throw new Error(`Unknown generator target \"${name}\".`);\n\t\treturn (await runGenerator(target, ir)).map((file) => ({ ...file, path: `${name}/${file.path}` }));\n\t}))).flat().sort((left, right) => compareCanonicalStrings(left.path, right.path));\n\tconst expected = new Set(files.map((file) => file.path));\n\tconst existing = await listFiles(options.outputDirectory);\n\tconst selectedPrefixes = options.targets.map((target) => `${target}/`);\n\tconst stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));\n\tif (!options.check) await Promise.all(stale.map((file) => rm(path.join(options.outputDirectory, file), { force: true })));\n\tconst changed: string[] = [];\n\tfor (const file of files) {\n\t\tconst target = path.join(options.outputDirectory, file.path);\n\t\tlet current: string | undefined;\n\t\ttry { current = await readFile(target, \"utf8\"); } catch { current = undefined; }\n\t\tif (current !== file.content) {\n\t\t\tchanged.push(file.path);\n\t\t\tif (!options.check) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, file.content, \"utf8\"); }\n\t\t}\n\t}\n\tif (options.check && (changed.length || stale.length)) throw new Error(`Generated artifacts drifted: ${[...changed, ...stale.map((file) => `stale:${file}`)].join(\", \")}`);\n\treturn { changed, stale, files };\n}\n\nasync function listFiles(directory: string, prefix = \"\"): Promise<string[]> {\n\tlet entries;\n\ttry { entries = await readdir(directory, { withFileTypes: true }); } catch { return []; }\n\tconst nested = await Promise.all(entries.map((entry) => entry.isDirectory() ? listFiles(path.join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]));\n\treturn nested.flat().sort();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAwD;AACxD,uBAAiB;AACjB,sBAA8F;AAC9F,4BAAoC;AACpC,sBAA8B;AAC9B,wBAAgC;AAChC,uBAA+B;AAC/B,wBAAgC;AAChC,yBAAiC;AACjC,sBAA8B;AAC9B,6BAAqC;AAE9B,IAAM,oBAAqD;AAAA,EACjE,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AACd;AACA,IAAM,0BAA0B,CAAC,MAAc,UAA0B,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAKhH,eAAsB,qBAAqB,SAAmD;AAC7F,QAAM,QAAQ,KAAK,MAAM,UAAM,0BAAS,QAAQ,WAAW,MAAM,CAAC;AAClE,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,OAAM,IAAI,MAAM,uCAAuC;AACxH,QAAM,SAAS,aAAa,QAAQ,QAAQ,EAAE,iBAAiB,MAAM,iBAAiB,SAAS,CAAC,KAAK,EAAE;AAC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AO;AAAE,kBAAM,uBAAM,iBAAAA,QAAK,QAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;AAAG,kBAAM,2BAAU,QAAQ,KAAK,SAAS,MAAM;AAAA,MAAG;AAAA,IAC9H;AAAA,EACD;AACA,MAAI,QAAQ,UAAU,QAAQ,UAAU,MAAM,QAAS,OAAM,IAAI,MAAM,gCAAgC,CAAC,GAAG,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,SAAS,IAAI,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;AACzK,SAAO,EAAE,SAAS,OAAO,MAAM;AAChC;AAEA,eAAe,UAAU,WAAmB,SAAS,IAAuB;AAC3E,MAAI;AACJ,MAAI;AAAE,cAAU,UAAM,yBAAQ,WAAW,EAAE,eAAe,KAAK,CAAC;AAAA,EAAG,QAAQ;AAAE,WAAO,CAAC;AAAA,EAAG;AACxF,QAAM,SAAS,MAAM,QAAQ,IAAI,QAAQ,IAAI,CAAC,UAAU,MAAM,YAAY,IAAI,UAAU,iBAAAA,QAAK,KAAK,WAAW,MAAM,IAAI,GAAG,GAAG,MAAM,GAAG,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC,CAAC;AAClL,SAAO,OAAO,KAAK,EAAE,KAAK;AAC3B;","names":["path"]}
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
- #!/usr/bin/env node
2
1
  import {
3
2
  GENERATOR_TARGETS,
4
3
  generateFromManifest
5
- } from "./chunk-OKPHRFAQ.js";
4
+ } from "./chunk-QOD7G4YK.js";
6
5
  export {
7
6
  GENERATOR_TARGETS,
8
7
  generateFromManifest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabricorg/fabric-gen",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Thin CLI for deterministic Fabric manifest generator targets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,21 +27,22 @@
27
27
  "CHANGELOG.md"
28
28
  ],
29
29
  "dependencies": {
30
- "@fabricorg/compiler": "^0.2.0",
31
- "@fabricorg/gen-capability": "^0.2.0",
32
- "@fabricorg/gen-docs": "^0.2.0",
33
- "@fabricorg/gen-events": "^0.2.0",
34
- "@fabricorg/gen-graphql": "^0.2.0",
35
- "@fabricorg/gen-prisma": "^0.2.0",
36
- "@fabricorg/gen-sdui": "^0.2.0",
37
- "@fabricorg/gen-types": "^0.2.0"
30
+ "@fabricorg/compiler": "^1.0.0",
31
+ "@fabricorg/gen-capability": "^0.3.0",
32
+ "@fabricorg/gen-docs": "^0.2.2",
33
+ "@fabricorg/gen-conformance": "^0.1.0",
34
+ "@fabricorg/gen-events": "^0.2.2",
35
+ "@fabricorg/gen-graphql": "^1.0.0",
36
+ "@fabricorg/gen-prisma": "^1.0.0",
37
+ "@fabricorg/gen-types": "^1.0.0",
38
+ "@fabricorg/gen-sdui": "^0.3.0"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@types/node": "^22.10.0",
41
42
  "tsup": "^8.5.0",
42
43
  "typescript": "^5.7.3",
43
44
  "vitest": "^4.1.5",
44
- "@fabricorg/platform": "^0.11.0"
45
+ "@fabricorg/platform": "^0.12.0"
45
46
  },
46
47
  "engines": {
47
48
  "node": ">=20"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../index.ts"],"sourcesContent":["import { mkdir, readFile, readdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { compileManifestBundle, runGenerator, type GeneratedFile, type GeneratorTarget } from \"@fabricorg/compiler\";\nimport { capabilityGenerator } from \"@fabricorg/gen-capability\";\nimport { docsGenerator } from \"@fabricorg/gen-docs\";\nimport { eventsGenerator } from \"@fabricorg/gen-events\";\nimport { typesGenerator } from \"@fabricorg/gen-types\";\nimport { prismaGenerator } from \"@fabricorg/gen-prisma\";\nimport { graphqlGenerator } from \"@fabricorg/gen-graphql\";\nimport { sduiGenerator } from \"@fabricorg/gen-sdui\";\n\nexport const GENERATOR_TARGETS: Record<string, GeneratorTarget> = {\n\ttypes: typesGenerator,\n\tevents: eventsGenerator,\n\tcapability: capabilityGenerator,\n\tdocs: docsGenerator,\n\tprisma: prismaGenerator,\n\tgraphql: graphqlGenerator,\n\tsdui: sduiGenerator,\n};\nconst compareCanonicalStrings = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\n\nexport interface GenerateOptions { inputPath: string; outputDirectory: string; targets: string[]; check?: boolean; }\nexport interface GenerateResult { changed: string[]; stale: string[]; files: GeneratedFile[]; }\n\nexport async function generateFromManifest(options: GenerateOptions): Promise<GenerateResult> {\n\tconst input = JSON.parse(await readFile(options.inputPath, \"utf8\"));\n\tconst bundle = \"modules\" in input ? input : { manifestVersion: input.manifestVersion, modules: [input] };\n\tconst ir = compileManifestBundle(bundle);\n\tconst files = (await Promise.all(options.targets.map(async (name) => {\n\t\tconst target = GENERATOR_TARGETS[name];\n\t\tif (!target) throw new Error(`Unknown generator target \"${name}\".`);\n\t\treturn (await runGenerator(target, ir)).map((file) => ({ ...file, path: `${name}/${file.path}` }));\n\t}))).flat().sort((left, right) => compareCanonicalStrings(left.path, right.path));\n\tconst expected = new Set(files.map((file) => file.path));\n\tconst existing = await listFiles(options.outputDirectory);\n\tconst selectedPrefixes = options.targets.map((target) => `${target}/`);\n\tconst stale = existing.filter((file) => selectedPrefixes.some((prefix) => file.startsWith(prefix)) && !expected.has(file));\n\tconst changed: string[] = [];\n\tfor (const file of files) {\n\t\tconst target = path.join(options.outputDirectory, file.path);\n\t\tlet current: string | undefined;\n\t\ttry { current = await readFile(target, \"utf8\"); } catch { current = undefined; }\n\t\tif (current !== file.content) {\n\t\t\tchanged.push(file.path);\n\t\t\tif (!options.check) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, file.content, \"utf8\"); }\n\t\t}\n\t}\n\tif (options.check && (changed.length || stale.length)) throw new Error(`Generated artifacts drifted: ${[...changed, ...stale.map((file) => `stale:${file}`)].join(\", \")}`);\n\treturn { changed, stale, files };\n}\n\nasync function listFiles(directory: string, prefix = \"\"): Promise<string[]> {\n\tlet entries;\n\ttry { entries = await readdir(directory, { withFileTypes: true }); } catch { return []; }\n\tconst nested = await Promise.all(entries.map((entry) => entry.isDirectory() ? listFiles(path.join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]));\n\treturn nested.flat().sort();\n}\n"],"mappings":";;;AAAA,SAAS,OAAO,UAAU,SAAS,iBAAiB;AACpD,OAAO,UAAU;AACjB,SAAS,uBAAuB,oBAA8D;AAC9F,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAEvB,IAAM,oBAAqD;AAAA,EACjE,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACP;AACA,IAAM,0BAA0B,CAAC,MAAc,UAA0B,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAKhH,eAAsB,qBAAqB,SAAmD;AAC7F,QAAM,QAAQ,KAAK,MAAM,MAAM,SAAS,QAAQ,WAAW,MAAM,CAAC;AAClE,QAAM,SAAS,aAAa,QAAQ,QAAQ,EAAE,iBAAiB,MAAM,iBAAiB,SAAS,CAAC,KAAK,EAAE;AACvG,QAAM,KAAK,sBAAsB,MAAM;AACvC,QAAM,SAAS,MAAM,QAAQ,IAAI,QAAQ,QAAQ,IAAI,OAAO,SAAS;AACpE,UAAM,SAAS,kBAAkB,IAAI;AACrC,QAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,6BAA6B,IAAI,IAAI;AAClE,YAAQ,MAAM,aAAa,QAAQ,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,MAAM,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EA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