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.

Add package.json checker and LICENSE copying with files entries

+185 -10
+3
.gitignore
··· 7 7 coverage/ 8 8 package-lock.json 9 9 .DS_Store 10 + 11 + packages/*/LICENSE 12 + exchanges/*/LICENSE
+17 -5
exchanges/graphcache/package.json
··· 25 25 "source": "src/index.ts", 26 26 "exports": { 27 27 ".": { 28 - "import": "dist/urql-core.esm.js", 29 - "require": "dist/urql-core.cjs.js", 28 + "import": "dist/urql-exchange-graphcache.esm.js", 29 + "require": "dist/urql-exchange-graphcache.cjs.js", 30 30 "types": "dist/types/index.d.ts", 31 31 "source": "src/index.ts" 32 32 }, 33 33 "./extras": { 34 - "import": "dist/urql-core-extras.esm.js", 35 - "require": "dist/urql-core-extras.cjs.js", 34 + "import": "dist/urql-exchange-graphcache-extras.esm.js", 35 + "require": "dist/urql-exchange-graphcache-extras.cjs.js", 36 36 "types": "dist/types/extras/index.d.ts", 37 37 "source": "src/extras/index.ts" 38 38 } 39 39 }, 40 + "files": [ 41 + "LICENSE", 42 + "CHANGELOG.md", 43 + "README.md", 44 + "dist/", 45 + "extras/" 46 + ], 40 47 "scripts": { 41 - "build": "rollup -c ../../scripts/rollup/config.js" 48 + "test": "jest", 49 + "clean": "rimraf dist extras", 50 + "check": "tsc --noEmit", 51 + "build": "rollup -c ../../scripts/rollup/config.js", 52 + "prepare": "../../scripts/prepare/index.js", 53 + "prepublishOnly": "run-s clean test build" 42 54 }, 43 55 "jest": { 44 56 "preset": "../../scripts/jest/preset"
+6
package.json
··· 4 4 "packages/*", 5 5 "exchanges/*" 6 6 ], 7 + "scripts": { 8 + "test": "jest", 9 + "check": "tsc --noEmit", 10 + "lint": "eslint ." 11 + }, 7 12 "jest": { 8 13 "projects": [ 9 14 "<rootDir>/packages/*", ··· 56 61 "graphql": "^14.6.0", 57 62 "graphql-tag": "^2.10.1", 58 63 "husky": "^4.2.1", 64 + "invariant": "^2.2.4", 59 65 "jest": "^25.1.0", 60 66 "jest-watch-yarn-workspaces": "^1.1.0", 61 67 "lint-staged": "^10.0.7",
+11 -1
packages/core/package.json
··· 22 22 "module": "dist/urql-core.esm.js", 23 23 "types": "dist/types/index.d.ts", 24 24 "source": "src/index.ts", 25 + "files": [ 26 + "LICENSE", 27 + "README.md", 28 + "dist/" 29 + ], 25 30 "scripts": { 26 - "build": "rollup -c ../../scripts/rollup/config.js" 31 + "test": "jest", 32 + "clean": "rimraf dist", 33 + "check": "tsc --noEmit", 34 + "build": "rollup -c ../../scripts/rollup/config.js", 35 + "prepare": "../../scripts/prepare/index.js", 36 + "prepublishOnly": "run-s clean test build" 27 37 }, 28 38 "jest": { 29 39 "preset": "../../scripts/jest/preset"
+12 -1
packages/preact-urql/package.json
··· 23 23 "module": "dist/urql-preact.esm.js", 24 24 "types": "dist/types/index.d.ts", 25 25 "source": "src/index.ts", 26 + "files": [ 27 + "LICENSE", 28 + "CHANGELOG.md", 29 + "README.md", 30 + "dist/" 31 + ], 26 32 "scripts": { 27 - "build": "rollup -c ../../scripts/rollup/config.js" 33 + "test": "jest", 34 + "clean": "rimraf dist", 35 + "check": "tsc --noEmit", 36 + "build": "rollup -c ../../scripts/rollup/config.js", 37 + "prepare": "../../scripts/prepare/index.js", 38 + "prepublishOnly": "run-s clean test build" 28 39 }, 29 40 "jest": { 30 41 "preset": "../../scripts/jest/preset"
+13 -1
packages/react-urql/package.json
··· 23 23 "module": "dist/urql.esm.js", 24 24 "types": "dist/types/index.d.ts", 25 25 "source": "src/index.ts", 26 + "files": [ 27 + "LICENSE", 28 + "CHANGELOG.md", 29 + "README.md", 30 + "core/", 31 + "dist/" 32 + ], 26 33 "scripts": { 27 - "build": "rollup -c ../../scripts/rollup/config.js" 34 + "test": "jest", 35 + "clean": "rimraf dist", 36 + "check": "tsc --noEmit", 37 + "build": "rollup -c ../../scripts/rollup/config.js", 38 + "prepare": "../../scripts/prepare/index.js", 39 + "prepublishOnly": "run-s clean test build" 28 40 }, 29 41 "jest": { 30 42 "preset": "../../scripts/jest/preset"
+12 -1
packages/svelte-urql/package.json
··· 24 24 "module": "dist/urql-svelte.esm.js", 25 25 "types": "dist/types/index.d.ts", 26 26 "source": "src/index.ts", 27 + "files": [ 28 + "LICENSE", 29 + "CHANGELOG.md", 30 + "README.md", 31 + "dist/" 32 + ], 27 33 "scripts": { 28 - "build": "rollup -c ../../scripts/rollup/config.js" 34 + "test": "jest", 35 + "clean": "rimraf dist", 36 + "check": "tsc --noEmit", 37 + "build": "rollup -c ../../scripts/rollup/config.js", 38 + "prepare": "../../scripts/prepare/index.js", 39 + "prepublishOnly": "run-s clean test build" 29 40 }, 30 41 "jest": { 31 42 "preset": "../../scripts/jest/preset"
+103
scripts/prepare/index.js
··· 1 + #!/usr/bin/env node 2 + 3 + const invariant = require('invariant'); 4 + const path = require('path'); 5 + const fs = require('fs'); 6 + 7 + const cwd = process.cwd(); 8 + const workspaceRoot = path.resolve(__dirname, '../../'); 9 + const pkg = require(path.resolve(cwd, 'package.json')); 10 + 11 + const normalize = name => name 12 + .replace(/[@\s\/\.]+/g, ' ') 13 + .trim() 14 + .replace(/\s+/, '-') 15 + .toLowerCase(); 16 + 17 + const name = normalize(pkg.name); 18 + 19 + invariant( 20 + path.normalize(cwd) !== path.normalize(workspaceRoot), 21 + 'prepare-pkg must be run in a package.' 22 + ); 23 + 24 + invariant( 25 + fs.existsSync(pkg.source || 'src/index.ts'), 26 + 'package.json:source must exist' 27 + ); 28 + 29 + invariant( 30 + path.normalize(pkg.main) === `dist/${name}.cjs.js`, 31 + 'package.json:main path must be valid' 32 + ); 33 + 34 + invariant( 35 + path.normalize(pkg.module) === `dist/${name}.esm.js`, 36 + 'package.json:module path must be valid' 37 + ); 38 + 39 + invariant( 40 + path.normalize(pkg.types) === 'dist/types/' 41 + + path.relative('src', pkg.source || 'src/index.ts') 42 + .replace(/\.ts$/, '.d.ts'), 43 + 'package.json:types path must be valid' 44 + ); 45 + 46 + invariant( 47 + path.normalize(pkg.repository.directory) === 48 + path.relative(workspaceRoot, cwd), 49 + 'package.json:repository.directory path is invalid' 50 + ); 51 + 52 + invariant( 53 + pkg.sideEffects === false, 54 + 'package.json:sideEffects must be false' 55 + ); 56 + 57 + invariant( 58 + pkg.license === 'MIT', 59 + 'package.json:license must be "MIT"' 60 + ); 61 + 62 + invariant( 63 + Array.isArray(pkg.files) && 64 + pkg.files.some(x => path.normalize(x) === 'dist/') && 65 + pkg.files.some(x => path.normalize(x) === 'LICENSE'), 66 + 'package.json:files must include "dist" and "LICENSE"' 67 + ); 68 + 69 + if (pkg.exports) { 70 + invariant(!!pkg.exports['.'], 'package.json:exports must have a "." entry'); 71 + 72 + for (const key in pkg.exports) { 73 + const entry = pkg.exports[key]; 74 + const entryName = normalize(key); 75 + const bundleName = entryName ? `${name}-${entryName}` : name; 76 + 77 + invariant( 78 + fs.existsSync(entry.source), 79 + `package.json:exports["${key}"].source must exist` 80 + ); 81 + 82 + invariant( 83 + path.normalize(entry.require) === `dist/${bundleName}.cjs.js`, 84 + `package.json:exports["${key}"].require must be valid` 85 + ); 86 + 87 + invariant( 88 + path.normalize(entry.import) === `dist/${bundleName}.esm.js`, 89 + `package.json:exports["${key}"].import must be valid` 90 + ); 91 + 92 + invariant( 93 + path.normalize(entry.types) === 'dist/types/' 94 + + path.relative('src', entry.source).replace(/\.ts$/, '.d.ts'), 95 + 'package.json:types path must be valid' 96 + ); 97 + } 98 + } 99 + 100 + fs.copyFileSync( 101 + path.resolve(workspaceRoot, 'LICENSE'), 102 + path.resolve(cwd, 'LICENSE'), cwd 103 + );
+8 -1
yarn.lock
··· 2454 2454 has "^1.0.3" 2455 2455 side-channel "^1.0.2" 2456 2456 2457 + invariant@^2.2.4: 2458 + version "2.2.4" 2459 + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" 2460 + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== 2461 + dependencies: 2462 + loose-envify "^1.0.0" 2463 + 2457 2464 ip-regex@^2.1.0: 2458 2465 version "2.1.0" 2459 2466 resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" ··· 3444 3451 dependencies: 3445 3452 "@sinonjs/commons" "^1.7.0" 3446 3453 3447 - loose-envify@^1.1.0, loose-envify@^1.4.0: 3454 + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: 3448 3455 version "1.4.0" 3449 3456 resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" 3450 3457 integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==