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

Fix nested package.json generation in Rollup config (#734)

authored by kitten.sh and committed by

GitHub 8d99559b 7cf15a46

+18 -42
+6
.changeset/wicked-shirts-sell.md
··· 1 + --- 2 + '@urql/exchange-graphcache': patch 3 + '@urql/core': patch 4 + --- 5 + 6 + Fix nested package path for @urql/core/internal and @urql/exchange-graphcache/extras
+1
exchanges/graphcache/.gitignore
··· 1 + /extras
-21
exchanges/graphcache/extras/package.json
··· 1 - { 2 - "name": "urql-exchange-graphcache-extras", 3 - "private": true, 4 - "main": "../dist/urql-exchange-graphcache-extras", 5 - "module": "../dist/urql-exchange-graphcache-extras.mjs", 6 - "types": "../dist/types/extras/index.d.ts", 7 - "source": "../src/extras/index.ts", 8 - "exports": { 9 - ".": { 10 - "import": "../dist/urql-exchange-graphcache-extras.mjs", 11 - "require": "../dist/urql-exchange-graphcache-extras.js", 12 - "types": "../dist/types/extras/index.d.ts", 13 - "source": "../src/extras/index.ts" 14 - } 15 - }, 16 - "dependencies": { 17 - "@urql/core": ">=1.11.0", 18 - "@urql/exchange-populate": ">=0.1.6", 19 - "wonka": "^4.0.9" 20 - } 21 - }
+1
packages/core/.gitignore
··· 1 + /internal
-19
packages/core/internal/package.json
··· 1 - { 2 - "name": "urql-core-internal", 3 - "private": true, 4 - "main": "../dist/urql-core-internal", 5 - "module": "../dist/urql-core-internal.mjs", 6 - "types": "../dist/types/internal/index.d.ts", 7 - "source": "../src/internal/index.ts", 8 - "exports": { 9 - ".": { 10 - "import": "../dist/urql-core-internal.mjs", 11 - "require": "../dist/urql-core-internal.js", 12 - "types": "../dist/types/internal/index.d.ts", 13 - "source": "../src/internal/index.ts" 14 - } 15 - }, 16 - "dependencies": { 17 - "wonka": "^4.0.9" 18 - } 19 - }
+10 -2
scripts/rollup/config.js
··· 1 1 import genPackageJson from 'rollup-plugin-generate-package-json'; 2 - import { relative, join } from 'path'; 2 + import { relative, join, dirname, basename } from 'path'; 3 3 import { makePlugins } from './plugins'; 4 4 import * as settings from './settings'; 5 5 ··· 14 14 baseContents: { 15 15 name: source.name, 16 16 private: true, 17 - main: join(rel, source.main), 17 + main: join(rel, dirname(source.main), basename(source.main, '.js')), 18 18 module: join(rel, source.module), 19 19 types: join(rel, source.types), 20 20 source: join(rel, source.source), 21 + exports: { 22 + '.': { 23 + import: join(rel, source.module), 24 + require: join(rel, source.main), 25 + types: join(rel, source.types), 26 + source: join(rel, source.source), 27 + } 28 + } 21 29 } 22 30 })); 23 31 }