@graphitation/graphql-codegen-supermassive-schema-extraction-plugin 1.1.0 → 1.1.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.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +18 -2
- package/lib/index.js +15 -3
- package/lib/index.mjs +6 -2
- package/package.json +2 -2
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/mnt/vss/_work/1/s/packages/graphql-codegen-supermassive-schema-extraction-plugin/src/index.ts":"1"},{"size":1174,"mtime":
|
|
1
|
+
[{"/mnt/vss/_work/1/s/packages/graphql-codegen-supermassive-schema-extraction-plugin/src/index.ts":"1"},{"size":1174,"mtime":1680603722473,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"15useu0","/mnt/vss/_work/1/s/packages/graphql-codegen-supermassive-schema-extraction-plugin/src/index.ts",[]]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @graphitation/graphql-codegen-supermassive-schema-extraction-plugin
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 04 Apr 2023 10:29:00 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.1.2
|
|
8
|
+
|
|
9
|
+
Tue, 04 Apr 2023 10:29:00 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @graphitation/supermassive-extractors to v2.1.0
|
|
14
|
+
|
|
15
|
+
## 1.1.1
|
|
16
|
+
|
|
17
|
+
Fri, 25 Nov 2022 15:30:59 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Hotfix: dependencies fixed after the supermassive split (jakubvejr@microsoft.com)
|
|
22
|
+
|
|
7
23
|
## 1.1.0
|
|
8
24
|
|
|
9
|
-
Mon, 21 Nov 2022 14:11
|
|
25
|
+
Mon, 21 Nov 2022 14:12:11 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -16,7 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
17
|
}
|
|
17
18
|
return to;
|
|
18
19
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
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
|
+
));
|
|
20
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
29
|
var __async = (__this, __arguments, generator) => {
|
|
22
30
|
return new Promise((resolve, reject) => {
|
|
@@ -49,12 +57,16 @@ var import_graphql2 = require("graphql");
|
|
|
49
57
|
var import_supermassive_extractors = require("@graphitation/supermassive-extractors");
|
|
50
58
|
var import_path = require("path");
|
|
51
59
|
const plugin = (schema) => {
|
|
52
|
-
const tsContents = (0, import_supermassive_extractors.extractImplicitTypesToTypescript)(
|
|
60
|
+
const tsContents = (0, import_supermassive_extractors.extractImplicitTypesToTypescript)(
|
|
61
|
+
(0, import_graphql2.parse)((0, import_graphql2.printSchema)(schema))
|
|
62
|
+
);
|
|
53
63
|
const printer = import_typescript.default.createPrinter();
|
|
54
64
|
return printer.printNode(import_typescript.default.EmitHint.SourceFile, tsContents, tsContents);
|
|
55
65
|
};
|
|
56
66
|
const validate = (schema, documents, config, outputFile) => __async(void 0, null, function* () {
|
|
57
67
|
if ((0, import_path.extname)(outputFile) !== ".ts" && (0, import_path.extname)(outputFile) !== ".tsx") {
|
|
58
|
-
throw new Error(
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Plugin "supermassive-typed-document-node" requires extension to be ".ts" or ".tsx"!`
|
|
70
|
+
);
|
|
59
71
|
}
|
|
60
72
|
});
|
package/lib/index.mjs
CHANGED
|
@@ -25,13 +25,17 @@ import { printSchema, parse } from "graphql";
|
|
|
25
25
|
import { extractImplicitTypesToTypescript } from "@graphitation/supermassive-extractors";
|
|
26
26
|
import { extname } from "path";
|
|
27
27
|
var plugin = (schema) => {
|
|
28
|
-
const tsContents = extractImplicitTypesToTypescript(
|
|
28
|
+
const tsContents = extractImplicitTypesToTypescript(
|
|
29
|
+
parse(printSchema(schema))
|
|
30
|
+
);
|
|
29
31
|
const printer = ts.createPrinter();
|
|
30
32
|
return printer.printNode(ts.EmitHint.SourceFile, tsContents, tsContents);
|
|
31
33
|
};
|
|
32
34
|
var validate = (schema, documents, config, outputFile) => __async(void 0, null, function* () {
|
|
33
35
|
if (extname(outputFile) !== ".ts" && extname(outputFile) !== ".tsx") {
|
|
34
|
-
throw new Error(
|
|
36
|
+
throw new Error(
|
|
37
|
+
`Plugin "supermassive-typed-document-node" requires extension to be ".ts" or ".tsx"!`
|
|
38
|
+
);
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
41
|
export {
|
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": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"main": "./lib/index",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"just": "monorepo-scripts"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@graphitation/supermassive-extractors": "*",
|
|
19
18
|
"@graphql-codegen/plugin-helpers": "^1.18.2",
|
|
20
19
|
"@types/jest": "^26.0.22",
|
|
21
20
|
"monorepo-scripts": "*"
|
|
@@ -24,6 +23,7 @@
|
|
|
24
23
|
"@graphql-codegen/plugin-helpers": ">= 1.18.0 < 2"
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
26
|
+
"@graphitation/supermassive-extractors": "^2.1.0",
|
|
27
27
|
"typescript": "^4.4.3 <4.5.0"
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|