@graphql-codegen/add 3.0.0 → 3.1.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.
@@ -22,4 +22,3 @@ const index = { plugin };
22
22
 
23
23
  exports.default = index;
24
24
  exports.plugin = plugin;
25
- //# sourceMappingURL=index.cjs.js.map
@@ -18,4 +18,3 @@ const index = { plugin };
18
18
 
19
19
  export default index;
20
20
  export { plugin };
21
- //# sourceMappingURL=index.esm.js.map
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@graphql-codegen/add",
3
- "version": "3.0.0",
3
+ "version": "3.1.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"
7
7
  },
8
8
  "dependencies": {
9
- "@graphql-codegen/plugin-helpers": "^2.0.0",
9
+ "@graphql-codegen/plugin-helpers": "^2.1.0",
10
10
  "tslib": "~2.3.0"
11
11
  },
12
12
  "repository": {
@@ -15,10 +15,20 @@
15
15
  "directory": "packages/plugins/other/add"
16
16
  },
17
17
  "license": "MIT",
18
- "main": "index.cjs.js",
19
- "module": "index.esm.js",
18
+ "main": "index.js",
19
+ "module": "index.mjs",
20
20
  "typings": "index.d.ts",
21
21
  "typescript": {
22
22
  "definition": "index.d.ts"
23
+ },
24
+ "exports": {
25
+ ".": {
26
+ "require": "./index.js",
27
+ "import": "./index.mjs"
28
+ },
29
+ "./*": {
30
+ "require": "./*.js",
31
+ "import": "./*.mjs"
32
+ }
23
33
  }
24
34
  }
package/index.cjs.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../dist/plugins/other/add/src/config.js","../../../dist/plugins/other/add/src/index.js"],"sourcesContent":["export const VALID_PLACEMENTS = ['prepend', 'content', 'append'];\n//# sourceMappingURL=config.js.map","import { VALID_PLACEMENTS } from './config';\nexport const plugin = async (schema, documents, config) => {\n const placement = config.placement || 'prepend';\n const content = config.content;\n if (!VALID_PLACEMENTS.includes(placement)) {\n throw Error(`Configuration provided for 'add' plugin is invalid: value of 'placement' field is not valid (valid values are: ${VALID_PLACEMENTS.join(', ')})`);\n }\n if (!content) {\n throw Error(`Configuration provided for 'add' plugin is invalid: \"content\" is missing!`);\n }\n return {\n content: null,\n [placement]: Array.isArray(content) ? content : [content],\n };\n};\nexport default { plugin };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AAAO,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;;ACCpD,MAAC,MAAM,GAAG,OAAO,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK;AAC3D,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC;AACpD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACnC,IAAI,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AAC/C,QAAQ,MAAM,KAAK,CAAC,CAAC,+GAA+G,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtK,KAAK;AACL,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,MAAM,KAAK,CAAC,CAAC,yEAAyE,CAAC,CAAC,CAAC;AACjG,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,IAAI;AACrB,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC;AACjE,KAAK,CAAC;AACN,EAAE;AACF,cAAe,EAAE,MAAM,EAAE;;;;;"}
package/index.esm.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../dist/plugins/other/add/src/config.js","../../../dist/plugins/other/add/src/index.js"],"sourcesContent":["export const VALID_PLACEMENTS = ['prepend', 'content', 'append'];\n//# sourceMappingURL=config.js.map","import { VALID_PLACEMENTS } from './config';\nexport const plugin = async (schema, documents, config) => {\n const placement = config.placement || 'prepend';\n const content = config.content;\n if (!VALID_PLACEMENTS.includes(placement)) {\n throw Error(`Configuration provided for 'add' plugin is invalid: value of 'placement' field is not valid (valid values are: ${VALID_PLACEMENTS.join(', ')})`);\n }\n if (!content) {\n throw Error(`Configuration provided for 'add' plugin is invalid: \"content\" is missing!`);\n }\n return {\n content: null,\n [placement]: Array.isArray(content) ? content : [content],\n };\n};\nexport default { plugin };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;;ACCpD,MAAC,MAAM,GAAG,OAAO,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK;AAC3D,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC;AACpD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACnC,IAAI,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AAC/C,QAAQ,MAAM,KAAK,CAAC,CAAC,+GAA+G,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtK,KAAK;AACL,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,MAAM,KAAK,CAAC,CAAC,yEAAyE,CAAC,CAAC,CAAC;AACjG,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,IAAI;AACrB,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC;AACjE,KAAK,CAAC;AACN,EAAE;AACF,cAAe,EAAE,MAAM,EAAE;;;;;"}