@fabricorg/gen-graphql 0.2.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 ADDED
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add reviewed Prisma schema, federation GraphQL, and SDUI data-shape generator adapters.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - Updated dependencies
13
+ - Updated dependencies
14
+ - @fabricorg/platform@0.11.0
15
+ - @fabricorg/compiler@0.2.0
16
+
17
+ ## 0.1.0
18
+
19
+ - Add federated GraphQL SDL and governed resolver-seam generation.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fabric
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # `@fabricorg/gen-graphql`
2
+
3
+ Federation-ready GraphQL SDL and resolver contracts. Generated mutations point to governed Host
4
+ submission; they never call action handlers directly.
5
+
package/dist/index.cjs ADDED
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ graphqlGenerator: () => graphqlGenerator
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var pascal = (value) => value.split(/[-._/]/).filter(Boolean).map((part) => part[0]?.toUpperCase() + part.slice(1)).join("");
27
+ var gql = (schema) => {
28
+ const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
29
+ return type === "integer" ? "Int" : type === "number" ? "Float" : type === "boolean" ? "Boolean" : type === "string" ? "String" : "JSON";
30
+ };
31
+ var identifier = (value) => {
32
+ const normalized = value.replace(/[^_0-9A-Za-z]/g, "_");
33
+ return /^[_A-Za-z]/.test(normalized) ? normalized : `field_${normalized}`;
34
+ };
35
+ var graphqlGenerator = {
36
+ name: "@fabricorg/gen-graphql",
37
+ version: "0.1.0",
38
+ generate(ir) {
39
+ return ir.modules.flatMap((module2) => {
40
+ const types = module2.objectTypes.map((objectType) => {
41
+ const required = new Set(objectType.schema?.required ?? []);
42
+ const fields = Object.entries(objectType.schema?.properties ?? {}).map(
43
+ ([name, schema]) => ` ${identifier(name)}: ${gql(schema)}${required.has(name) ? "!" : ""}`
44
+ );
45
+ return [`type ${pascal(module2.namespace)}${objectType.type} @key(fields: "id") {`, " id: ID!", " tenantId: ID!", " spaceId: ID!", ...fields, "}"].join("\n");
46
+ });
47
+ const fieldName = (value) => {
48
+ const name = pascal(value);
49
+ return `${name[0]?.toLowerCase() ?? ""}${name.slice(1)}`;
50
+ };
51
+ const queryFields = module2.views.map((view) => ` ${fieldName(view.name)}: JSON!`);
52
+ const mutations = module2.actions.map((action) => ` ${fieldName(action.actionId)}(parameters: JSON!): GovernedActionSubmission!`);
53
+ const operationNames = [...module2.views.map((view) => fieldName(view.name)), ...module2.actions.map((action) => fieldName(action.actionId))];
54
+ if (new Set(operationNames).size !== operationNames.length) throw new Error(`Module "${module2.namespace}" produces colliding GraphQL operation names.`);
55
+ const content = [
56
+ `# Generated by ${graphqlGenerator.name}@${graphqlGenerator.version}`,
57
+ `# Manifest digest: ${ir.manifestDigest}`,
58
+ "scalar JSON",
59
+ "type GovernedActionSubmission { actionInvocationId: ID!, status: String! }",
60
+ ...types,
61
+ `type Query {
62
+ ${queryFields.length ? queryFields.join("\n") : " _fabric: Boolean!"}
63
+ }`,
64
+ `type Mutation {
65
+ ${mutations.length ? mutations.join("\n") : " _fabric: Boolean!"}
66
+ }`,
67
+ ""
68
+ ].join("\n\n");
69
+ const resolvers = [
70
+ "// Generated resolver seam. Authenticate first; derive actor and tenant server-side.",
71
+ `export const actionIds = ${JSON.stringify(Object.fromEntries(module2.actions.map((action) => [fieldName(action.actionId), action.actionId])), null, 2)} as const;`,
72
+ "// Each mutation resolver must call createGovernedActionHost().submitAction(); never call handlers directly.",
73
+ ""
74
+ ].join("\n");
75
+ return [{ path: `${module2.namespace}/schema.graphql`, content }, { path: `${module2.namespace}/resolver-contract.ts`, content: resolvers }];
76
+ });
77
+ }
78
+ };
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ graphqlGenerator
82
+ });
83
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import type { GeneratorTarget } from \"@fabricorg/compiler\";\nimport type { PortableJsonSchema } from \"@fabricorg/platform\";\n\nconst pascal = (value: string): string =>\n\tvalue.split(/[-._/]/).filter(Boolean).map((part) => part[0]?.toUpperCase() + part.slice(1)).join(\"\");\nconst gql = (schema: PortableJsonSchema): string => {\n\tconst type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n\treturn type === \"integer\" ? \"Int\" : type === \"number\" ? \"Float\" : type === \"boolean\" ? \"Boolean\" : type === \"string\" ? \"String\" : \"JSON\";\n};\nconst identifier = (value: string): string => {\n\tconst normalized = value.replace(/[^_0-9A-Za-z]/g, \"_\");\n\treturn /^[_A-Za-z]/.test(normalized) ? normalized : `field_${normalized}`;\n};\n\nexport const graphqlGenerator: GeneratorTarget = {\n\tname: \"@fabricorg/gen-graphql\",\n\tversion: \"0.1.0\",\n\tgenerate(ir) {\n\t\treturn ir.modules.flatMap((module) => {\n\t\t\tconst types = module.objectTypes.map((objectType) => {\n\t\t\t\tconst required = new Set(objectType.schema?.required ?? []);\n\t\t\t\tconst fields = Object.entries(objectType.schema?.properties ?? {}).map(\n\t\t\t\t\t([name, schema]) => ` ${identifier(name)}: ${gql(schema)}${required.has(name) ? \"!\" : \"\"}`,\n\t\t\t\t);\n\t\t\t\treturn [`type ${pascal(module.namespace)}${objectType.type} @key(fields: \"id\") {`, \" id: ID!\", \" tenantId: ID!\", \" spaceId: ID!\", ...fields, \"}\"].join(\"\\n\");\n\t\t\t});\n\t\t\tconst fieldName = (value: string): string => {\n\t\t\t\tconst name = pascal(value);\n\t\t\t\treturn `${name[0]?.toLowerCase() ?? \"\"}${name.slice(1)}`;\n\t\t\t};\n\t\t\tconst queryFields = module.views.map((view) => ` ${fieldName(view.name)}: JSON!`);\n\t\t\tconst mutations = module.actions.map((action) => ` ${fieldName(action.actionId)}(parameters: JSON!): GovernedActionSubmission!`);\n\t\t\tconst operationNames = [...module.views.map((view) => fieldName(view.name)), ...module.actions.map((action) => fieldName(action.actionId))];\n\t\t\tif (new Set(operationNames).size !== operationNames.length) throw new Error(`Module \"${module.namespace}\" produces colliding GraphQL operation names.`);\n\t\t\tconst content = [\n\t\t\t\t`# Generated by ${graphqlGenerator.name}@${graphqlGenerator.version}`,\n\t\t\t\t`# Manifest digest: ${ir.manifestDigest}`,\n\t\t\t\t\"scalar JSON\",\n\t\t\t\t\"type GovernedActionSubmission { actionInvocationId: ID!, status: String! }\",\n\t\t\t\t...types,\n\t\t\t\t`type Query {\\n${queryFields.length ? queryFields.join(\"\\n\") : \" _fabric: Boolean!\"}\\n}`,\n\t\t\t\t`type Mutation {\\n${mutations.length ? mutations.join(\"\\n\") : \" _fabric: Boolean!\"}\\n}`,\n\t\t\t\t\"\",\n\t\t\t].join(\"\\n\\n\");\n\t\t\tconst resolvers = [\n\t\t\t\t\"// Generated resolver seam. Authenticate first; derive actor and tenant server-side.\",\n\t\t\t\t`export const actionIds = ${JSON.stringify(Object.fromEntries(module.actions.map((action) => [fieldName(action.actionId), action.actionId])), null, 2)} as const;`,\n\t\t\t\t\"// Each mutation resolver must call createGovernedActionHost().submitAction(); never call handlers directly.\",\n\t\t\t\t\"\",\n\t\t\t].join(\"\\n\");\n\t\t\treturn [{ path: `${module.namespace}/schema.graphql`, content }, { path: `${module.namespace}/resolver-contract.ts`, content: resolvers }];\n\t\t});\n\t},\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,IAAM,SAAS,CAAC,UACf,MAAM,MAAM,QAAQ,EAAE,OAAO,OAAO,EAAE,IAAI,CAAC,SAAS,KAAK,CAAC,GAAG,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE;AACpG,IAAM,MAAM,CAAC,WAAuC;AACn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gDAAgD;AAChI,YAAM,iBAAiB,CAAC,GAAGA,QAAO,MAAM,IAAI,CAAC,SAAS,UAAU,KAAK,IAAI,CAAC,GAAG,GAAGA,QAAO,QAAQ,IAAI,CAAC,WAAW,UAAU,OAAO,QAAQ,CAAC,CAAC;AAC1I,UAAI,IAAI,IAAI,cAAc,EAAE,SAAS,eAAe,OAAQ,OAAM,IAAI,MAAM,WAAWA,QAAO,SAAS,+CAA+C;AACtJ,YAAM,UAAU;AAAA,QACf,kBAAkB,iBAAiB,IAAI,IAAI,iBAAiB,OAAO;AAAA,QACnE,sBAAsB,GAAG,cAAc;AAAA,QACvC;AAAA,QACA;AAAA,QACA,GAAG;AAAA,QACH;AAAA,EAAiB,YAAY,SAAS,YAAY,KAAK,IAAI,IAAI,qBAAqB;AAAA;AAAA,QACpF;AAAA,EAAoB,UAAU,SAAS,UAAU,KAAK,IAAI,IAAI,qBAAqB;AAAA;AAAA,QACnF;AAAA,MACD,EAAE,KAAK,MAAM;AACb,YAAM,YAAY;AAAA,QACjB;AAAA,QACA,4BAA4B,KAAK,UAAU,OAAO,YAAYA,QAAO,QAAQ,IAAI,CAAC,WAAW,CAAC,UAAU,OAAO,QAAQ,GAAG,OAAO,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAAA,QACtJ;AAAA,QACA;AAAA,MACD,EAAE,KAAK,IAAI;AACX,aAAO,CAAC,EAAE,MAAM,GAAGA,QAAO,SAAS,mBAAmB,QAAQ,GAAG,EAAE,MAAM,GAAGA,QAAO,SAAS,yBAAyB,SAAS,UAAU,CAAC;AAAA,IAC1I,CAAC;AAAA,EACF;AACD;","names":["module"]}
@@ -0,0 +1,5 @@
1
+ import { GeneratorTarget } from '@fabricorg/compiler';
2
+
3
+ declare const graphqlGenerator: GeneratorTarget;
4
+
5
+ export { graphqlGenerator };
@@ -0,0 +1,5 @@
1
+ import { GeneratorTarget } from '@fabricorg/compiler';
2
+
3
+ declare const graphqlGenerator: GeneratorTarget;
4
+
5
+ export { graphqlGenerator };
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ // index.ts
2
+ var pascal = (value) => value.split(/[-._/]/).filter(Boolean).map((part) => part[0]?.toUpperCase() + part.slice(1)).join("");
3
+ var gql = (schema) => {
4
+ const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
5
+ return type === "integer" ? "Int" : type === "number" ? "Float" : type === "boolean" ? "Boolean" : type === "string" ? "String" : "JSON";
6
+ };
7
+ var identifier = (value) => {
8
+ const normalized = value.replace(/[^_0-9A-Za-z]/g, "_");
9
+ return /^[_A-Za-z]/.test(normalized) ? normalized : `field_${normalized}`;
10
+ };
11
+ var graphqlGenerator = {
12
+ name: "@fabricorg/gen-graphql",
13
+ version: "0.1.0",
14
+ generate(ir) {
15
+ return ir.modules.flatMap((module) => {
16
+ const types = module.objectTypes.map((objectType) => {
17
+ const required = new Set(objectType.schema?.required ?? []);
18
+ const fields = Object.entries(objectType.schema?.properties ?? {}).map(
19
+ ([name, schema]) => ` ${identifier(name)}: ${gql(schema)}${required.has(name) ? "!" : ""}`
20
+ );
21
+ return [`type ${pascal(module.namespace)}${objectType.type} @key(fields: "id") {`, " id: ID!", " tenantId: ID!", " spaceId: ID!", ...fields, "}"].join("\n");
22
+ });
23
+ const fieldName = (value) => {
24
+ const name = pascal(value);
25
+ return `${name[0]?.toLowerCase() ?? ""}${name.slice(1)}`;
26
+ };
27
+ const queryFields = module.views.map((view) => ` ${fieldName(view.name)}: JSON!`);
28
+ const mutations = module.actions.map((action) => ` ${fieldName(action.actionId)}(parameters: JSON!): GovernedActionSubmission!`);
29
+ const operationNames = [...module.views.map((view) => fieldName(view.name)), ...module.actions.map((action) => fieldName(action.actionId))];
30
+ if (new Set(operationNames).size !== operationNames.length) throw new Error(`Module "${module.namespace}" produces colliding GraphQL operation names.`);
31
+ const content = [
32
+ `# Generated by ${graphqlGenerator.name}@${graphqlGenerator.version}`,
33
+ `# Manifest digest: ${ir.manifestDigest}`,
34
+ "scalar JSON",
35
+ "type GovernedActionSubmission { actionInvocationId: ID!, status: String! }",
36
+ ...types,
37
+ `type Query {
38
+ ${queryFields.length ? queryFields.join("\n") : " _fabric: Boolean!"}
39
+ }`,
40
+ `type Mutation {
41
+ ${mutations.length ? mutations.join("\n") : " _fabric: Boolean!"}
42
+ }`,
43
+ ""
44
+ ].join("\n\n");
45
+ const resolvers = [
46
+ "// Generated resolver seam. Authenticate first; derive actor and tenant server-side.",
47
+ `export const actionIds = ${JSON.stringify(Object.fromEntries(module.actions.map((action) => [fieldName(action.actionId), action.actionId])), null, 2)} as const;`,
48
+ "// Each mutation resolver must call createGovernedActionHost().submitAction(); never call handlers directly.",
49
+ ""
50
+ ].join("\n");
51
+ return [{ path: `${module.namespace}/schema.graphql`, content }, { path: `${module.namespace}/resolver-contract.ts`, content: resolvers }];
52
+ });
53
+ }
54
+ };
55
+ export {
56
+ graphqlGenerator
57
+ };
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import type { GeneratorTarget } from \"@fabricorg/compiler\";\nimport type { PortableJsonSchema } from \"@fabricorg/platform\";\n\nconst pascal = (value: string): string =>\n\tvalue.split(/[-._/]/).filter(Boolean).map((part) => part[0]?.toUpperCase() + part.slice(1)).join(\"\");\nconst gql = (schema: PortableJsonSchema): string => {\n\tconst type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n\treturn type === \"integer\" ? \"Int\" : type === \"number\" ? \"Float\" : type === \"boolean\" ? \"Boolean\" : type === \"string\" ? \"String\" : \"JSON\";\n};\nconst identifier = (value: string): string => {\n\tconst normalized = value.replace(/[^_0-9A-Za-z]/g, \"_\");\n\treturn /^[_A-Za-z]/.test(normalized) ? normalized : `field_${normalized}`;\n};\n\nexport const graphqlGenerator: GeneratorTarget = {\n\tname: \"@fabricorg/gen-graphql\",\n\tversion: \"0.1.0\",\n\tgenerate(ir) {\n\t\treturn ir.modules.flatMap((module) => {\n\t\t\tconst types = module.objectTypes.map((objectType) => {\n\t\t\t\tconst required = new Set(objectType.schema?.required ?? []);\n\t\t\t\tconst fields = Object.entries(objectType.schema?.properties ?? {}).map(\n\t\t\t\t\t([name, schema]) => ` ${identifier(name)}: ${gql(schema)}${required.has(name) ? \"!\" : \"\"}`,\n\t\t\t\t);\n\t\t\t\treturn [`type ${pascal(module.namespace)}${objectType.type} @key(fields: \"id\") {`, \" id: ID!\", \" tenantId: ID!\", \" spaceId: ID!\", ...fields, \"}\"].join(\"\\n\");\n\t\t\t});\n\t\t\tconst fieldName = (value: string): string => {\n\t\t\t\tconst name = pascal(value);\n\t\t\t\treturn `${name[0]?.toLowerCase() ?? \"\"}${name.slice(1)}`;\n\t\t\t};\n\t\t\tconst queryFields = module.views.map((view) => ` ${fieldName(view.name)}: JSON!`);\n\t\t\tconst mutations = module.actions.map((action) => ` ${fieldName(action.actionId)}(parameters: JSON!): GovernedActionSubmission!`);\n\t\t\tconst operationNames = [...module.views.map((view) => fieldName(view.name)), ...module.actions.map((action) => fieldName(action.actionId))];\n\t\t\tif (new Set(operationNames).size !== operationNames.length) throw new Error(`Module \"${module.namespace}\" produces colliding GraphQL operation names.`);\n\t\t\tconst content = [\n\t\t\t\t`# Generated by ${graphqlGenerator.name}@${graphqlGenerator.version}`,\n\t\t\t\t`# Manifest digest: ${ir.manifestDigest}`,\n\t\t\t\t\"scalar JSON\",\n\t\t\t\t\"type GovernedActionSubmission { actionInvocationId: ID!, status: String! }\",\n\t\t\t\t...types,\n\t\t\t\t`type Query {\\n${queryFields.length ? queryFields.join(\"\\n\") : \" _fabric: Boolean!\"}\\n}`,\n\t\t\t\t`type Mutation {\\n${mutations.length ? mutations.join(\"\\n\") : \" _fabric: Boolean!\"}\\n}`,\n\t\t\t\t\"\",\n\t\t\t].join(\"\\n\\n\");\n\t\t\tconst resolvers = [\n\t\t\t\t\"// Generated resolver seam. Authenticate first; derive actor and tenant server-side.\",\n\t\t\t\t`export const actionIds = ${JSON.stringify(Object.fromEntries(module.actions.map((action) => [fieldName(action.actionId), action.actionId])), null, 2)} as const;`,\n\t\t\t\t\"// Each mutation resolver must call createGovernedActionHost().submitAction(); never call handlers directly.\",\n\t\t\t\t\"\",\n\t\t\t].join(\"\\n\");\n\t\t\treturn [{ path: `${module.namespace}/schema.graphql`, content }, { path: `${module.namespace}/resolver-contract.ts`, content: resolvers }];\n\t\t});\n\t},\n};\n"],"mappings":";AAGA,IAAM,SAAS,CAAC,UACf,MAAM,MAAM,QAAQ,EAAE,OAAO,OAAO,EAAE,IAAI,CAAC,SAAS,KAAK,CAAC,GAAG,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE;AACpG,IAAM,MAAM,CAAC,WAAuC;AACnD,QAAM,OAAO,MAAM,QAAQ,OAAO,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO;AAClE,SAAO,SAAS,YAAY,QAAQ,SAAS,WAAW,UAAU,SAAS,YAAY,YAAY,SAAS,WAAW,WAAW;AACnI;AACA,IAAM,aAAa,CAAC,UAA0B;AAC7C,QAAM,aAAa,MAAM,QAAQ,kBAAkB,GAAG;AACtD,SAAO,aAAa,KAAK,UAAU,IAAI,aAAa,SAAS,UAAU;AACxE;AAEO,IAAM,mBAAoC;AAAA,EAChD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS,IAAI;AACZ,WAAO,GAAG,QAAQ,QAAQ,CAAC,WAAW;AACrC,YAAM,QAAQ,OAAO,YAAY,IAAI,CAAC,eAAe;AACpD,cAAM,WAAW,IAAI,IAAI,WAAW,QAAQ,YAAY,CAAC,CAAC;AAC1D,cAAM,SAAS,OAAO,QAAQ,WAAW,QAAQ,cAAc,CAAC,CAAC,EAAE;AAAA,UAClE,CAAC,CAAC,MAAM,MAAM,MAAM,KAAK,WAAW,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,SAAS,IAAI,IAAI,IAAI,MAAM,EAAE;AAAA,QAC1F;AACA,eAAO,CAAC,QAAQ,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AAC,CAAC;AAAA,QACtJ;AAAA,QACA;AAAA,MACD,EAAE,KAAK,IAAI;AACX,aAAO,CAAC,EAAE,MAAM,GAAG,OAAO,SAAS,mBAAmB,QAAQ,GAAG,EAAE,MAAM,GAAG,OAAO,SAAS,yBAAyB,SAAS,UAAU,CAAC;AAAA,IAC1I,CAAC;AAAA,EACF;AACD;","names":[]}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@fabricorg/gen-graphql",
3
+ "version": "0.2.0",
4
+ "description": "Federation-ready GraphQL contract generator for Fabric compiler IR.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.cjs",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "require": {
17
+ "types": "./dist/index.d.cts",
18
+ "default": "./dist/index.cjs"
19
+ }
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md",
25
+ "CHANGELOG.md"
26
+ ],
27
+ "dependencies": {
28
+ "@fabricorg/compiler": "^0.2.0",
29
+ "@fabricorg/platform": "^0.11.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^22.10.0",
33
+ "tsup": "^8.5.0",
34
+ "typescript": "^5.7.3",
35
+ "vitest": "^4.1.5"
36
+ },
37
+ "engines": {
38
+ "node": ">=20"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "scripts": {
44
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
45
+ "build": "tsup",
46
+ "type-check": "tsc --noEmit",
47
+ "test": "vitest run"
48
+ }
49
+ }