graphql-codegen-registry 0.0.1 → 0.0.2

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.
@@ -3,8 +3,44 @@ const preset = { buildGeneratesSection: async (options) => {
3
3
  return [{
4
4
  filename: options.baseOutputDir,
5
5
  plugins: [
6
- { typescript: {} },
7
- { "typescript-operations": {} },
6
+ { typescript: {
7
+ avoidOptionals: {
8
+ field: true,
9
+ object: true,
10
+ inputValue: false,
11
+ defaultValue: false
12
+ },
13
+ defaultScalarType: "never",
14
+ enumsAsConst: true,
15
+ preResolveTypes: false,
16
+ strictScalars: true,
17
+ useTypeImports: true
18
+ } },
19
+ { "typescript-operations": {
20
+ avoidOptionals: {
21
+ field: true,
22
+ object: true,
23
+ inputValue: false,
24
+ defaultValue: false
25
+ },
26
+ defaultScalarType: "never",
27
+ enumsAsConst: true,
28
+ exportFragmentSpreadSubTypes: true,
29
+ inlineFragmentTypes: "combine",
30
+ operationResultSuffix: "Result",
31
+ operationVariablesSuffix: "Variables",
32
+ preResolveTypes: false,
33
+ skipTypename: true,
34
+ strictScalars: true,
35
+ useTypeImports: true
36
+ } },
37
+ { "typed-document-node": {
38
+ documentVariableSuffix: "Document",
39
+ operationResultSuffix: "Result",
40
+ operationVariablesSuffix: "Variables",
41
+ optimizeDocumentNode: true,
42
+ useTypeImports: true
43
+ } },
8
44
  { "graphql-codegen-registry/plugin": {} }
9
45
  ],
10
46
  pluginMap: options.pluginMap,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/preset/index.ts"],"sourcesContent":["import type { Types } from \"@graphql-codegen/plugin-helpers\";\n\nexport type RegistryConfig = {};\n\nconst preset: Types.OutputPreset<RegistryConfig> = {\n buildGeneratesSection: async (options) => {\n const plugins: Types.ConfiguredPlugin[] = [\n {\n typescript: {},\n },\n {\n \"typescript-operations\": {},\n },\n { \"graphql-codegen-registry/plugin\": {} },\n ];\n\n return [\n {\n filename: options.baseOutputDir,\n plugins,\n pluginMap: options.pluginMap,\n config: options.config,\n documents: options.documents,\n schema: options.schema,\n schemaAst: options.schemaAst,\n },\n ];\n },\n};\n\nexport default preset;\n"],"mappings":";AAIA,MAAM,SAA6C,EACjD,uBAAuB,OAAO,YAAY;AAWxC,QAAO,CACL;EACE,UAAU,QAAQ;EAClB,SAbsC;GACxC,EACE,YAAY,EAAE,EACf;GACD,EACE,yBAAyB,EAAE,EAC5B;GACD,EAAE,mCAAmC,EAAE,EAAE;GAC1C;EAMG,WAAW,QAAQ;EACnB,QAAQ,QAAQ;EAChB,WAAW,QAAQ;EACnB,QAAQ,QAAQ;EAChB,WAAW,QAAQ;EACpB,CACF;GAEJ"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/preset/index.ts"],"sourcesContent":["import type { Types } from \"@graphql-codegen/plugin-helpers\";\n\nexport type RegistryConfig = {};\n\nconst preset: Types.OutputPreset<RegistryConfig> = {\n buildGeneratesSection: async (options) => {\n const plugins: Types.ConfiguredPlugin[] = [\n {\n typescript: {\n avoidOptionals: {\n field: true,\n object: true,\n inputValue: false,\n defaultValue: false,\n },\n defaultScalarType: \"never\",\n enumsAsConst: true,\n preResolveTypes: false,\n strictScalars: true,\n useTypeImports: true,\n },\n },\n {\n \"typescript-operations\": {\n avoidOptionals: {\n field: true,\n object: true,\n inputValue: false,\n defaultValue: false,\n },\n defaultScalarType: \"never\",\n enumsAsConst: true,\n exportFragmentSpreadSubTypes: true,\n inlineFragmentTypes: \"combine\",\n operationResultSuffix: \"Result\",\n operationVariablesSuffix: \"Variables\",\n preResolveTypes: false,\n skipTypename: true,\n strictScalars: true,\n useTypeImports: true,\n },\n },\n {\n \"typed-document-node\": {\n documentVariableSuffix: \"Document\",\n operationResultSuffix: \"Result\",\n operationVariablesSuffix: \"Variables\",\n optimizeDocumentNode: true,\n useTypeImports: true,\n },\n },\n {\n \"graphql-codegen-registry/plugin\": {},\n },\n ];\n\n return [\n {\n filename: options.baseOutputDir,\n plugins,\n pluginMap: options.pluginMap,\n config: options.config,\n documents: options.documents,\n schema: options.schema,\n schemaAst: options.schemaAst,\n },\n ];\n },\n};\n\nexport default preset;\n"],"mappings":";AAIA,MAAM,SAA6C,EACjD,uBAAuB,OAAO,YAAY;AAmDxC,QAAO,CACL;EACE,UAAU,QAAQ;EAClB,SArDsC;GACxC,EACE,YAAY;IACV,gBAAgB;KACd,OAAO;KACP,QAAQ;KACR,YAAY;KACZ,cAAc;KACf;IACD,mBAAmB;IACnB,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IACjB,EACF;GACD,EACE,yBAAyB;IACvB,gBAAgB;KACd,OAAO;KACP,QAAQ;KACR,YAAY;KACZ,cAAc;KACf;IACD,mBAAmB;IACnB,cAAc;IACd,8BAA8B;IAC9B,qBAAqB;IACrB,uBAAuB;IACvB,0BAA0B;IAC1B,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,gBAAgB;IACjB,EACF;GACD,EACE,uBAAuB;IACrB,wBAAwB;IACxB,uBAAuB;IACvB,0BAA0B;IAC1B,sBAAsB;IACtB,gBAAgB;IACjB,EACF;GACD,EACE,mCAAmC,EAAE,EACtC;GACF;EAMG,WAAW,QAAQ;EACnB,QAAQ,QAAQ;EAChB,WAAW,QAAQ;EACnB,QAAQ,QAAQ;EAChB,WAAW,QAAQ;EACpB,CACF;GAEJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql-codegen-registry",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Type-safe operations registry and validation for GraphQL Codegen.",
5
5
  "homepage": "https://github.com/lewebsimple/graphql-codegen-registry#readme",
6
6
  "bugs": {
@@ -32,23 +32,31 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@graphql-codegen/plugin-helpers": "^6.1.0"
35
+ "@graphql-codegen/plugin-helpers": "^6.1.0",
36
+ "es-toolkit": "^1.45.0"
36
37
  },
37
38
  "devDependencies": {
39
+ "@graphql-codegen/core": "^5.0.0",
40
+ "@graphql-codegen/typed-document-node": "^6.1.6",
38
41
  "@graphql-codegen/typescript": "^5.0.8",
39
42
  "@graphql-codegen/typescript-operations": "^5.0.8",
43
+ "@graphql-typed-document-node/core": "^3.2.0",
40
44
  "@types/node": "^25.3.3",
41
45
  "changelogen": "^0.6.2",
46
+ "graphql": "^16.13.0",
42
47
  "husky": "^9.1.7",
43
48
  "lint-staged": "^16.3.1",
44
49
  "oxfmt": "^0.36.0",
45
50
  "oxlint": "^1.51.0",
46
51
  "rolldown": "1.0.0-rc.5",
47
- "typescript": "^5.9.3"
52
+ "typescript": "^5.9.3",
53
+ "vitest": "^4.0.18"
48
54
  },
49
55
  "peerDependencies": {
50
- "@graphql-codegen/typescript": "^5.0.0",
51
- "@graphql-codegen/typescript-operations": "^5.0.0"
56
+ "@graphql-codegen/typed-document-node": "^6.1.6",
57
+ "@graphql-codegen/typescript": "^5.0.8",
58
+ "@graphql-codegen/typescript-operations": "^5.0.8",
59
+ "@graphql-typed-document-node/core": "^3.2.0"
52
60
  },
53
61
  "lint-staged": {
54
62
  "*.{ts,json,md}": [
@@ -66,6 +74,8 @@
66
74
  "build": "rolldown --config ./rolldown.config.ts && tsc",
67
75
  "format": "oxfmt .",
68
76
  "lint": "oxlint . --fix",
69
- "release": "pnpm lint && pnpm build && changelogen --release --push && pnpm publish"
77
+ "release": "pnpm lint && pnpm test &&pnpm build && changelogen --release --push && pnpm publish",
78
+ "test": "vitest run",
79
+ "test:watch": "vitest"
70
80
  }
71
81
  }