diff --git a/packages/graphql/README.md b/packages/graphql/README.md index 3b08d2a67..15e920849 100644 --- a/packages/graphql/README.md +++ b/packages/graphql/README.md @@ -13,7 +13,7 @@ ## Requirements -This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v10.0.0+) and Rollup v1.20.0+. +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. ## Install diff --git a/packages/graphql/package.json b/packages/graphql/package.json index ee6a4bc77..350da1530 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -13,8 +13,16 @@ "author": "rollup", "homepage": "https://github.com/rollup/plugins/tree/master/packages/graphql#readme", "bugs": "https://github.com/rollup/plugins/issues", - "main": "dist/index.js", - "module": "dist/index.es.js", + "main": "./dist/cjs/index.js", + "module": "./dist/es/index.js", + "exports": { + "import": "./dist/es/index.js", + "types": "./types/index.d.ts", + "default": "./dist/cjs/index.js" + }, + "engines": { + "node": ">=14.0.0" + }, "scripts": { "build": "rollup -c", "ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov", @@ -32,6 +40,7 @@ }, "files": [ "dist", + "!dist/**/*.map", "types", "README.md", "LICENSE" @@ -46,22 +55,25 @@ ], "peerDependencies": { "graphql": ">=0.9.0", - "rollup": "^1.20.0 || ^2.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } }, "dependencies": { - "@rollup/pluginutils": "^4.0.0", - "graphql-tag": "^2.2.2" + "@rollup/pluginutils": "^4.2.1", + "graphql-tag": "^2.12.6" }, "devDependencies": { "@rollup/plugin-buble": "^0.21.3", - "graphql": "^14.1.1", - "rollup": "^2.67.3" + "graphql": "^16.6.0", + "rollup": "^3.0.0-7" }, - "types": "types/index.d.ts", + "types": "./types/index.d.ts", "ava": { - "babel": { - "compileEnhancements": false - }, + "workerThreads": false, "files": [ "!**/fixtures/**", "!**/helpers/**", diff --git a/packages/graphql/rollup.config.js b/packages/graphql/rollup.config.js deleted file mode 100644 index dc0bbeb24..000000000 --- a/packages/graphql/rollup.config.js +++ /dev/null @@ -1,13 +0,0 @@ -import buble from '@rollup/plugin-buble'; - -import pkg from './package.json'; - -export default { - input: 'src/index.js', - external: [...Object.keys(pkg.dependencies), 'os'], - output: [ - { file: pkg.main, format: 'cjs', sourcemap: true, exports: 'auto' }, - { file: pkg.module, format: 'es', sourcemap: true } - ], - plugins: [buble()] -}; diff --git a/packages/graphql/rollup.config.mjs b/packages/graphql/rollup.config.mjs new file mode 100644 index 000000000..2703badd4 --- /dev/null +++ b/packages/graphql/rollup.config.mjs @@ -0,0 +1,14 @@ +import { readFileSync } from 'fs'; + +import buble from '@rollup/plugin-buble'; + +import { createConfig } from '../../shared/rollup.config.mjs'; + +export default { + ...createConfig({ + pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')), + external: ['graphql-tag/loader'] + }), + input: 'src/index.js', + plugins: [buble()] +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f605a4f4c..691858a02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -271,17 +271,17 @@ importers: packages/graphql: specifiers: '@rollup/plugin-buble': ^0.21.3 - '@rollup/pluginutils': ^4.0.0 - graphql: ^14.1.1 - graphql-tag: ^2.2.2 - rollup: ^2.67.3 + '@rollup/pluginutils': ^4.2.1 + graphql: ^16.6.0 + graphql-tag: ^2.12.6 + rollup: ^3.0.0-7 dependencies: '@rollup/pluginutils': 4.2.1 - graphql-tag: 2.12.6_graphql@14.7.0 + graphql-tag: 2.12.6_graphql@16.6.0 devDependencies: - '@rollup/plugin-buble': 0.21.3_rollup@2.79.1 - graphql: 14.7.0 - rollup: 2.79.1 + '@rollup/plugin-buble': 0.21.3_rollup@3.0.0-7 + graphql: 16.6.0 + rollup: 3.0.0-7 packages/html: specifiers: @@ -2001,6 +2001,18 @@ packages: rollup: 2.79.1 dev: true + /@rollup/plugin-buble/0.21.3_rollup@3.0.0-7: + resolution: {integrity: sha512-Iv8cCuFPnMdqV4pcyU+OrfjOfagPArRQ1PyQjx5KgHk3dARedI+8PNTLSMpJts0lQJr8yF2pAU4GxpxCBJ9HYw==} + engines: {node: '>= 8.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0 + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@3.0.0-7 + '@types/buble': 0.19.2 + buble: 0.20.0 + rollup: 3.0.0-7 + dev: true + /@rollup/plugin-commonjs/11.1.0_rollup@2.79.1: resolution: {integrity: sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA==} engines: {node: '>= 8.0.0'} @@ -4760,21 +4772,19 @@ packages: /grapheme-splitter/1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - /graphql-tag/2.12.6_graphql@14.7.0: + /graphql-tag/2.12.6_graphql@16.6.0: resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} engines: {node: '>=10'} peerDependencies: graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: - graphql: 14.7.0 + graphql: 16.6.0 tslib: 2.4.0 dev: false - /graphql/14.7.0: - resolution: {integrity: sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA==} - engines: {node: '>= 6.x'} - dependencies: - iterall: 1.3.0 + /graphql/16.6.0: + resolution: {integrity: sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} /hard-rejection/2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} @@ -5322,9 +5332,6 @@ packages: istanbul-lib-report: 3.0.0 dev: true - /iterall/1.3.0: - resolution: {integrity: sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==} - /js-sdsl/4.1.4: resolution: {integrity: sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==}