@graphitation/graphql-codegen-supermassive-schema-extraction-plugin 1.2.0 → 2.0.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/.eslintcache +1 -1
- package/CHANGELOG.md +20 -2
- package/README.md +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -17
- package/lib/index.js.map +3 -3
- package/lib/index.mjs +11 -7
- package/lib/index.mjs.map +2 -2
- package/package.json +6 -7
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/mnt/vss/_work/1/s/packages/graphql-codegen-supermassive-schema-extraction-plugin/src/index.ts":"1"},{"size":
|
|
1
|
+
[{"/mnt/vss/_work/1/s/packages/graphql-codegen-supermassive-schema-extraction-plugin/src/index.ts":"1"},{"size":1175,"mtime":1702983541949,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"a2ehab","/mnt/vss/_work/1/s/packages/graphql-codegen-supermassive-schema-extraction-plugin/src/index.ts",[],[]]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @graphitation/graphql-codegen-supermassive-schema-extraction-plugin
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue,
|
|
3
|
+
This log was last generated on Tue, 19 Dec 2023 11:03:51 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.0.0
|
|
8
|
+
|
|
9
|
+
Tue, 19 Dec 2023 11:03:51 GMT
|
|
10
|
+
|
|
11
|
+
### Major changes
|
|
12
|
+
|
|
13
|
+
- Update graphql-codegen-supermassive-schema-extraction-plugin for usage with supermassive v3 (vladimir.razuvaev@gmail.com)
|
|
14
|
+
- Bump @graphitation/supermassive to v3.2.7
|
|
15
|
+
|
|
16
|
+
## 1.2.1
|
|
17
|
+
|
|
18
|
+
Thu, 21 Sep 2023 06:28:45 GMT
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- Add exports entry for types to package.json (sverre.johansen@gmail.com)
|
|
23
|
+
- Bump @graphitation/supermassive-extractors to v2.2.1
|
|
24
|
+
|
|
7
25
|
## 1.2.0
|
|
8
26
|
|
|
9
|
-
Tue, 20 Jun 2023 11:38:
|
|
27
|
+
Tue, 20 Jun 2023 11:38:47 GMT
|
|
10
28
|
|
|
11
29
|
### Minor changes
|
|
12
30
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Custom GraphQL codegen plugins
|
|
2
2
|
|
|
3
|
-
## supermassive-
|
|
3
|
+
## graphql-codegen-supermassive-schema-extraction-plugin
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Encodes type definitions into compact schema format of Supermassive V3.
|
|
6
|
+
|
|
7
|
+
Output file contains JSON, which is faster than JS literal: https://v8.dev/blog/cost-of-javascript-2019#json
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF,KAAK,YAAY,GAAG,6BAA6B,GAAG;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,YAAY,CAS/C,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,gBAAgB,CAAC,YAAY,CAWnD,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var __async = (__this, __arguments, generator) => {
|
|
30
20
|
return new Promise((resolve, reject) => {
|
|
@@ -52,21 +42,22 @@ __export(src_exports, {
|
|
|
52
42
|
validate: () => validate
|
|
53
43
|
});
|
|
54
44
|
module.exports = __toCommonJS(src_exports);
|
|
55
|
-
var import_typescript = __toESM(require("typescript"));
|
|
56
45
|
var import_graphql2 = require("graphql");
|
|
57
|
-
var
|
|
46
|
+
var import_supermassive = require("@graphitation/supermassive");
|
|
58
47
|
var import_path = require("path");
|
|
59
48
|
const plugin = (schema) => {
|
|
60
|
-
const
|
|
61
|
-
|
|
49
|
+
const schemaAST = (0, import_graphql2.parse)((0, import_graphql2.printSchema)(schema));
|
|
50
|
+
const typeDefs = (0, import_supermassive.mergeSchemaDefinitions)(
|
|
51
|
+
{ types: {} },
|
|
52
|
+
(0, import_supermassive.encodeASTSchema)(schemaAST)
|
|
62
53
|
);
|
|
63
|
-
const
|
|
64
|
-
|
|
54
|
+
return `export const definitions = JSON.parse('${JSON.stringify(typeDefs)}');
|
|
55
|
+
`;
|
|
65
56
|
};
|
|
66
57
|
const validate = (schema, documents, config, outputFile) => __async(void 0, null, function* () {
|
|
67
58
|
if ((0, import_path.extname)(outputFile) !== ".ts" && (0, import_path.extname)(outputFile) !== ".tsx") {
|
|
68
59
|
throw new Error(
|
|
69
|
-
`Plugin "supermassive-
|
|
60
|
+
`Plugin "graphql-codegen-supermassive-schema-extraction-plugin" requires extension to be ".ts" or ".tsx"!`
|
|
70
61
|
);
|
|
71
62
|
}
|
|
72
63
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n Types,\n PluginValidateFn,\n PluginFunction,\n} from \"@graphql-codegen/plugin-helpers\";\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["import_graphql"
|
|
4
|
+
"sourcesContent": ["import {\n Types,\n PluginValidateFn,\n PluginFunction,\n} from \"@graphql-codegen/plugin-helpers\";\nimport { GraphQLSchema } from \"graphql\";\nimport { printSchema, parse } from \"graphql\";\nimport {\n encodeASTSchema,\n mergeSchemaDefinitions,\n} from \"@graphitation/supermassive\";\nimport { extname } from \"path\";\nimport { RawClientSideBasePluginConfig } from \"@graphql-codegen/visitor-plugin-common\";\n\ntype PluginConfig = RawClientSideBasePluginConfig & {\n files: string[];\n};\n\nexport const plugin: PluginFunction<PluginConfig> = (schema: GraphQLSchema) => {\n const schemaAST = parse(printSchema(schema));\n const typeDefs = mergeSchemaDefinitions(\n { types: {} },\n encodeASTSchema(schemaAST),\n );\n\n return `export const definitions = JSON.parse('${JSON.stringify(typeDefs)}');\n`;\n};\n\nexport const validate: PluginValidateFn<PluginConfig> = async (\n schema: GraphQLSchema,\n documents: Types.DocumentFile[],\n config,\n outputFile: string,\n) => {\n if (extname(outputFile) !== \".ts\" && extname(outputFile) !== \".tsx\") {\n throw new Error(\n `Plugin \"graphql-codegen-supermassive-schema-extraction-plugin\" requires extension to be \".ts\" or \".tsx\"!`,\n );\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAAA,kBAAmC;AACnC,0BAGO;AACP,kBAAwB;AAOjB,MAAM,SAAuC,CAAC,WAA0B;AAC7E,QAAM,gBAAY,2BAAM,6BAAY,MAAM,CAAC;AAC3C,QAAM,eAAW;AAAA,IACf,EAAE,OAAO,CAAC,EAAE;AAAA,QACZ,qCAAgB,SAAS;AAAA,EAC3B;AAEA,SAAO,0CAA0C,KAAK,UAAU,QAAQ;AAAA;AAE1E;AAEO,MAAM,WAA2C,CACtD,QACA,WACA,QACA,eACG;AACH,UAAI,qBAAQ,UAAU,MAAM,aAAS,qBAAQ,UAAU,MAAM,QAAQ;AACnE,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["import_graphql"]
|
|
7
7
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -20,21 +20,25 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// src/index.ts
|
|
23
|
-
import ts from "typescript";
|
|
24
23
|
import { printSchema, parse } from "graphql";
|
|
25
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
encodeASTSchema,
|
|
26
|
+
mergeSchemaDefinitions
|
|
27
|
+
} from "@graphitation/supermassive";
|
|
26
28
|
import { extname } from "path";
|
|
27
29
|
var plugin = (schema) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
+
const schemaAST = parse(printSchema(schema));
|
|
31
|
+
const typeDefs = mergeSchemaDefinitions(
|
|
32
|
+
{ types: {} },
|
|
33
|
+
encodeASTSchema(schemaAST)
|
|
30
34
|
);
|
|
31
|
-
const
|
|
32
|
-
|
|
35
|
+
return `export const definitions = JSON.parse('${JSON.stringify(typeDefs)}');
|
|
36
|
+
`;
|
|
33
37
|
};
|
|
34
38
|
var validate = (schema, documents, config, outputFile) => __async(void 0, null, function* () {
|
|
35
39
|
if (extname(outputFile) !== ".ts" && extname(outputFile) !== ".tsx") {
|
|
36
40
|
throw new Error(
|
|
37
|
-
`Plugin "supermassive-
|
|
41
|
+
`Plugin "graphql-codegen-supermassive-schema-extraction-plugin" requires extension to be ".ts" or ".tsx"!`
|
|
38
42
|
);
|
|
39
43
|
}
|
|
40
44
|
});
|
package/lib/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n Types,\n PluginValidateFn,\n PluginFunction,\n} from \"@graphql-codegen/plugin-helpers\";\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;
|
|
4
|
+
"sourcesContent": ["import {\n Types,\n PluginValidateFn,\n PluginFunction,\n} from \"@graphql-codegen/plugin-helpers\";\nimport { GraphQLSchema } from \"graphql\";\nimport { printSchema, parse } from \"graphql\";\nimport {\n encodeASTSchema,\n mergeSchemaDefinitions,\n} from \"@graphitation/supermassive\";\nimport { extname } from \"path\";\nimport { RawClientSideBasePluginConfig } from \"@graphql-codegen/visitor-plugin-common\";\n\ntype PluginConfig = RawClientSideBasePluginConfig & {\n files: string[];\n};\n\nexport const plugin: PluginFunction<PluginConfig> = (schema: GraphQLSchema) => {\n const schemaAST = parse(printSchema(schema));\n const typeDefs = mergeSchemaDefinitions(\n { types: {} },\n encodeASTSchema(schemaAST),\n );\n\n return `export const definitions = JSON.parse('${JSON.stringify(typeDefs)}');\n`;\n};\n\nexport const validate: PluginValidateFn<PluginConfig> = async (\n schema: GraphQLSchema,\n documents: Types.DocumentFile[],\n config,\n outputFile: string,\n) => {\n if (extname(outputFile) !== \".ts\" && extname(outputFile) !== \".tsx\") {\n throw new Error(\n `Plugin \"graphql-codegen-supermassive-schema-extraction-plugin\" requires extension to be \".ts\" or \".tsx\"!`,\n );\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,aAAa,aAAa;AACnC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AAOjB,IAAM,SAAuC,CAAC,WAA0B;AAC7E,QAAM,YAAY,MAAM,YAAY,MAAM,CAAC;AAC3C,QAAM,WAAW;AAAA,IACf,EAAE,OAAO,CAAC,EAAE;AAAA,IACZ,gBAAgB,SAAS;AAAA,EAC3B;AAEA,SAAO,0CAA0C,KAAK,UAAU,QAAQ;AAAA;AAE1E;AAEO,IAAM,WAA2C,CACtD,QACA,WACA,QACA,eACG;AACH,MAAI,QAAQ,UAAU,MAAM,SAAS,QAAQ,UAAU,MAAM,QAAQ;AACnE,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphitation/graphql-codegen-supermassive-schema-extraction-plugin",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"main": "./lib/index",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -17,15 +17,13 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@graphql-codegen/plugin-helpers": "^1.18.2",
|
|
19
19
|
"@types/jest": "^26.0.22",
|
|
20
|
-
"monorepo-scripts": "*"
|
|
21
|
-
"typescript": "^4.9.5"
|
|
20
|
+
"monorepo-scripts": "*"
|
|
22
21
|
},
|
|
23
22
|
"peerDependencies": {
|
|
24
|
-
"@graphql-codegen/plugin-helpers": ">= 1.18.0 < 2"
|
|
25
|
-
"typescript": "^4.3.0"
|
|
23
|
+
"@graphql-codegen/plugin-helpers": ">= 1.18.0 < 2"
|
|
26
24
|
},
|
|
27
25
|
"dependencies": {
|
|
28
|
-
"@graphitation/supermassive
|
|
26
|
+
"@graphitation/supermassive": "^3.0.0",
|
|
29
27
|
"graphql": "^15.0.0"
|
|
30
28
|
},
|
|
31
29
|
"sideEffects": false,
|
|
@@ -36,7 +34,8 @@
|
|
|
36
34
|
"exports": {
|
|
37
35
|
".": {
|
|
38
36
|
"import": "./lib/index.mjs",
|
|
39
|
-
"require": "./lib/index.js"
|
|
37
|
+
"require": "./lib/index.js",
|
|
38
|
+
"types": "./lib/index.d.ts"
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
}
|