@graphql-codegen/add 3.1.2-alpha-4a7e799f2.0 → 3.1.2-alpha-2ada7b533.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/cjs/config.js
ADDED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const VALID_PLACEMENTS = ['prepend', 'content', 'append'];
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.plugin = void 0;
|
|
4
|
+
const config_js_1 = require("./config.js");
|
|
7
5
|
const plugin = async (schema, documents, config) => {
|
|
8
6
|
const placement = config.placement || 'prepend';
|
|
9
|
-
const content = config
|
|
10
|
-
if (!VALID_PLACEMENTS.includes(placement)) {
|
|
11
|
-
throw Error(`Configuration provided for 'add' plugin is invalid: value of 'placement' field is not valid (valid values are: ${VALID_PLACEMENTS.join(', ')})`);
|
|
7
|
+
const { content } = config;
|
|
8
|
+
if (!config_js_1.VALID_PLACEMENTS.includes(placement)) {
|
|
9
|
+
throw Error(`Configuration provided for 'add' plugin is invalid: value of 'placement' field is not valid (valid values are: ${config_js_1.VALID_PLACEMENTS.join(', ')})`);
|
|
12
10
|
}
|
|
13
11
|
if (!content) {
|
|
14
12
|
throw Error(`Configuration provided for 'add' plugin is invalid: "content" is missing!`);
|
|
@@ -18,7 +16,5 @@ const plugin = async (schema, documents, config) => {
|
|
|
18
16
|
[placement]: Array.isArray(content) ? content : [content],
|
|
19
17
|
};
|
|
20
18
|
};
|
|
21
|
-
const index = { plugin };
|
|
22
|
-
|
|
23
|
-
exports.default = index;
|
|
24
19
|
exports.plugin = plugin;
|
|
20
|
+
exports.default = { plugin: exports.plugin };
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
package/esm/config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VALID_PLACEMENTS = ['prepend', 'content', 'append'];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const plugin = async (schema, documents, config) => {
|
|
1
|
+
import { VALID_PLACEMENTS } from './config.js';
|
|
2
|
+
export const plugin = async (schema, documents, config) => {
|
|
4
3
|
const placement = config.placement || 'prepend';
|
|
5
|
-
const content = config
|
|
4
|
+
const { content } = config;
|
|
6
5
|
if (!VALID_PLACEMENTS.includes(placement)) {
|
|
7
6
|
throw Error(`Configuration provided for 'add' plugin is invalid: value of 'placement' field is not valid (valid values are: ${VALID_PLACEMENTS.join(', ')})`);
|
|
8
7
|
}
|
|
@@ -14,7 +13,4 @@ const plugin = async (schema, documents, config) => {
|
|
|
14
13
|
[placement]: Array.isArray(content) ? content : [content],
|
|
15
14
|
};
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export default index;
|
|
20
|
-
export { plugin };
|
|
16
|
+
export default { plugin };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/add",
|
|
3
|
-
"version": "3.1.2-alpha-
|
|
3
|
+
"version": "3.1.2-alpha-2ada7b533.0",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for adding custom content to your output file",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "2.
|
|
10
|
-
"tslib": "~2.
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^2.5.0-alpha-2ada7b533.0",
|
|
10
|
+
"tslib": "~2.4.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -15,21 +15,28 @@
|
|
|
15
15
|
"directory": "packages/plugins/other/add"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
|
-
"main": "index.js",
|
|
19
|
-
"module": "index.
|
|
20
|
-
"typings": "index.d.ts",
|
|
18
|
+
"main": "cjs/index.js",
|
|
19
|
+
"module": "esm/index.js",
|
|
20
|
+
"typings": "typings/index.d.ts",
|
|
21
21
|
"typescript": {
|
|
22
|
-
"definition": "index.d.ts"
|
|
22
|
+
"definition": "typings/index.d.ts"
|
|
23
23
|
},
|
|
24
|
+
"type": "module",
|
|
24
25
|
"exports": {
|
|
25
|
-
"./package.json": "./package.json",
|
|
26
26
|
".": {
|
|
27
|
-
"require":
|
|
28
|
-
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./typings/index.d.ts",
|
|
29
|
+
"default": "./cjs/index.js"
|
|
30
|
+
},
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./typings/index.d.ts",
|
|
33
|
+
"default": "./esm/index.js"
|
|
34
|
+
},
|
|
35
|
+
"default": {
|
|
36
|
+
"types": "./typings/index.d.ts",
|
|
37
|
+
"default": "./esm/index.js"
|
|
38
|
+
}
|
|
29
39
|
},
|
|
30
|
-
"
|
|
31
|
-
"require": "./*.js",
|
|
32
|
-
"import": "./*.mjs"
|
|
33
|
-
}
|
|
40
|
+
"./package.json": "./package.json"
|
|
34
41
|
}
|
|
35
|
-
}
|
|
42
|
+
}
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginFunction, Types } from '@graphql-codegen/plugin-helpers';
|
|
2
|
-
import { AddPluginConfig } from './config';
|
|
2
|
+
import { AddPluginConfig } from './config.js';
|
|
3
3
|
export declare const plugin: PluginFunction<AddPluginConfig>;
|
|
4
4
|
declare const _default: {
|
|
5
5
|
plugin: PluginFunction<AddPluginConfig, Types.PluginOutput>;
|