@remkoj/optimizely-graph-functions 6.0.0-pre7 → 6.0.0-pre8
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DocumentAstPluginOptions = {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const graphql_1 = require("graphql");
|
|
4
|
+
/**
|
|
5
|
+
* @type { import('@graphql-codegen/plugin-helpers').PluginFunction<{}, string> }
|
|
6
|
+
*/
|
|
7
|
+
const plugin = async (schema, documents) => {
|
|
8
|
+
return "\n" + documents.map(document => document.document ? (0, graphql_1.print)(document.document) : undefined).filter(Boolean).join("\n\n");
|
|
9
|
+
};
|
|
10
|
+
const validate = (schema, documents, config, output, allPlugins, pluginContext) => {
|
|
11
|
+
if (documents.filter(d => d.document).length < 1)
|
|
12
|
+
throw new Error("Document-AST requires at least one document that can be printend");
|
|
13
|
+
};
|
|
14
|
+
module.exports = { plugin, validate };
|
|
15
|
+
//# sourceMappingURL=document-ast-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-ast-plugin.js","sourceRoot":"","sources":["../src/document-ast-plugin.ts"],"names":[],"mappings":";;AACA,qCAAqF;AAMrF;;GAEG;AACH,MAAM,MAAM,GAAqD,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAC3F,OAAO,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,eAAK,EAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAChI,CAAC,CAAA;AAED,MAAM,QAAQ,GAA+C,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE;IAC5H,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAA;AACvF,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,QAAQ,EAA6C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragments.cms13.js","sourceRoot":"","sources":["../../src/documents/fragments.cms13.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb;;;;;;EAMA;IACA;;;;;EAKA;IACA;;EAEA;IACA;;EAEA;IACA;;EAEA;IACA
|
|
1
|
+
{"version":3,"file":"fragments.cms13.js","sourceRoot":"","sources":["../../src/documents/fragments.cms13.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb;;;;;;EAMA;IACA;;;;;EAKA;IACA;;EAEA;IACA;;EAEA;IACA;;EAEA;IACA;;;;EAIA;IACA;;;;;EAKA;IACA;;;;;;;;;EASA;IACA;;EAEA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA;IACA;;;;;;;;;;EAUA;IACA;;;;;EAKA;IACA;;;;;;;EAOA;CACD,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,8 +20,19 @@ export type TransformOptions = {
|
|
|
20
20
|
recursion?: boolean;
|
|
21
21
|
};
|
|
22
22
|
export type Injection = {
|
|
23
|
+
/**
|
|
24
|
+
* The fragment to inject the matching fragments. Matching is configured by
|
|
25
|
+
* `nameRegex` and `pathRegex`, if neither is provided, nothing will be
|
|
26
|
+
* injected.
|
|
27
|
+
*/
|
|
23
28
|
into: string;
|
|
29
|
+
/**
|
|
30
|
+
* A Regex used to match the fragment names that must be injected.
|
|
31
|
+
*/
|
|
24
32
|
nameRegex?: string;
|
|
33
|
+
/**
|
|
34
|
+
* A Regex used to match the files from which the fragments must be injected.
|
|
35
|
+
*/
|
|
25
36
|
pathRegex?: string;
|
|
26
37
|
};
|
|
27
38
|
export type IntoMatchType = {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
|
|
4
4
|
"author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
|
|
5
5
|
"homepage": "https://github.com/remkoj/optimizely-dxp-clients",
|
|
6
|
-
"version": "6.0.0-
|
|
6
|
+
"version": "6.0.0-pre8",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"type": "commonjs",
|
|
9
9
|
"description": "GraphQL Codegen preset for Optimizely Graph",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
46
|
-
"@remkoj/optimizely-graph-client": "6.0.0-
|
|
46
|
+
"@remkoj/optimizely-graph-client": "6.0.0-pre8",
|
|
47
47
|
"@types/node": "^22.16.4",
|
|
48
48
|
"graphql-request": "^7.2.0",
|
|
49
49
|
"graphql-tag": "^2.12.6",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@graphql-codegen/typescript": "^4.1.6",
|
|
57
57
|
"@graphql-codegen/typescript-graphql-request": "^6.3.0",
|
|
58
58
|
"@graphql-codegen/typescript-operations": "^4.6.1",
|
|
59
|
-
"@remkoj/optimizely-graph-client": "^6.0.0-
|
|
59
|
+
"@remkoj/optimizely-graph-client": "^6.0.0-pre8",
|
|
60
60
|
"graphql": "^16.11.0",
|
|
61
61
|
"graphql-sock": "^1.0.1",
|
|
62
62
|
"tslib": "^2.8.1"
|