Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: Replace CJS Rollup check with rollup-plugin-cjs-check (#2851)

authored by

Phil Pluckthun and committed by
GitHub
7bae3743 e354e604

+15 -43
+1
package.json
··· 92 92 "react-is": "^17.0.2", 93 93 "rimraf": "^3.0.2", 94 94 "rollup": "^3.3.0", 95 + "rollup-plugin-cjs-check": "^1.0.2", 95 96 "rollup-plugin-generate-package-json": "^3.2.0", 96 97 "rollup-plugin-tsconfig-paths": "^1.4.0", 97 98 "rollup-plugin-typescript2": "0.34.1",
+13
pnpm-lock.yaml
··· 53 53 react-is: ^17.0.2 54 54 rimraf: ^3.0.2 55 55 rollup: ^3.3.0 56 + rollup-plugin-cjs-check: ^1.0.2 56 57 rollup-plugin-generate-package-json: ^3.2.0 57 58 rollup-plugin-tsconfig-paths: ^1.4.0 58 59 rollup-plugin-typescript2: 0.34.1 ··· 105 106 react-is: 17.0.2 106 107 rimraf: 3.0.2 107 108 rollup: 3.3.0 109 + rollup-plugin-cjs-check: 1.0.2_rollup@3.3.0 108 110 rollup-plugin-generate-package-json: 3.2.0_rollup@3.3.0 109 111 rollup-plugin-tsconfig-paths: 1.4.0_6annma2bj33shm6er7hwi5u4z4 110 112 rollup-plugin-typescript2: 0.34.1_6annma2bj33shm6er7hwi5u4z4 ··· 14065 14067 dependencies: 14066 14068 hash-base: 3.1.0 14067 14069 inherits: 2.0.4 14070 + 14071 + /rollup-plugin-cjs-check/1.0.2_rollup@3.3.0: 14072 + resolution: {integrity: sha512-q5DuMiYTXoMlLIHeTDdTYQrN+v/AdjEyVZnfkdvX1NnS4jQP1fwSuOr29WS4pB/4lnF1D7Annp62/27aZUyTyQ==} 14073 + engines: {node: '>=14.0.0'} 14074 + peerDependencies: 14075 + rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 14076 + dependencies: 14077 + '@rollup/pluginutils': 5.0.2_rollup@3.3.0 14078 + cjs-module-lexer: 1.2.2 14079 + rollup: 3.3.0 14080 + dev: true 14068 14081 14069 14082 /rollup-plugin-generate-package-json/3.2.0_rollup@3.3.0: 14070 14083 resolution: {integrity: sha512-+Kq1kFVr+maxW/mZB+E+XuaieCXVZqjl2tNU9k3TtAMs3NOaeREa5sRHy67qKDmcnFtZZukIQ3dFCcnV+r0xyw==}
-42
scripts/rollup/cjs-check-plugin.mjs
··· 1 - import { parse, init } from 'cjs-module-lexer'; 2 - import { createFilter } from '@rollup/pluginutils'; 3 - 4 - function cleanup(opts = {}) { 5 - const filter = createFilter(opts.include, opts.exclude, { 6 - resolve: false 7 - }); 8 - 9 - return { 10 - name: "cjs-check", 11 - 12 - async renderChunk(code, chunk) { 13 - if (opts.extension !== '.js') { 14 - return null; 15 - } else if (!filter(chunk.fileName)) { 16 - return null; 17 - } 18 - 19 - await init() 20 - const output = parse(code); 21 - 22 - let hasMissing = false; 23 - for (const mod of chunk.exports) { 24 - if (mod[0] == '*' && !output.reexports.includes(mod.slice(1))) { 25 - hasMissing = true; 26 - console.error(`Missing Module Re-Export: ${mod.slice(1)}`) 27 - } else if (mod[0] != '*' && !output.exports.includes(mod)) { 28 - hasMissing = true; 29 - console.error(`Missing Module Export: ${mod}`) 30 - } 31 - } 32 - 33 - if (hasMissing) { 34 - throw new Error('cjs-module-lexer did not agree with Rollup\'s exports.'); 35 - } 36 - 37 - return null; 38 - } 39 - }; 40 - } 41 - 42 - export default cleanup;
+1 -1
scripts/rollup/plugins.mjs
··· 10 10 import babel from '@rollup/plugin-babel'; 11 11 import visualizer from 'rollup-plugin-visualizer'; 12 12 import terser from '@rollup/plugin-terser'; 13 + import cjsCheck from 'rollup-plugin-cjs-check'; 13 14 14 15 import cleanup from './cleanup-plugin.mjs' 15 - import cjsCheck from './cjs-check-plugin.mjs' 16 16 import babelPluginTransformPipe from '../babel/transform-pipe.mjs'; 17 17 import babelPluginTransformInvariant from '../babel/transform-invariant-warning.mjs'; 18 18 import babelPluginTransformDebugTarget from '../babel/transform-debug-target.mjs';