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)

Changed files
+18 -42
.changeset
exchanges
graphcache
packages
core
scripts
rollup
+6
.changeset/wicked-shirts-sell.md
···
+
---
+
'@urql/exchange-graphcache': patch
+
'@urql/core': patch
+
---
+
+
Fix nested package path for @urql/core/internal and @urql/exchange-graphcache/extras
+1
exchanges/graphcache/.gitignore
···
+
/extras
-21
exchanges/graphcache/extras/package.json
···
-
{
-
"name": "urql-exchange-graphcache-extras",
-
"private": true,
-
"main": "../dist/urql-exchange-graphcache-extras",
-
"module": "../dist/urql-exchange-graphcache-extras.mjs",
-
"types": "../dist/types/extras/index.d.ts",
-
"source": "../src/extras/index.ts",
-
"exports": {
-
".": {
-
"import": "../dist/urql-exchange-graphcache-extras.mjs",
-
"require": "../dist/urql-exchange-graphcache-extras.js",
-
"types": "../dist/types/extras/index.d.ts",
-
"source": "../src/extras/index.ts"
-
}
-
},
-
"dependencies": {
-
"@urql/core": ">=1.11.0",
-
"@urql/exchange-populate": ">=0.1.6",
-
"wonka": "^4.0.9"
-
}
-
}
+1
packages/core/.gitignore
···
+
/internal
-19
packages/core/internal/package.json
···
-
{
-
"name": "urql-core-internal",
-
"private": true,
-
"main": "../dist/urql-core-internal",
-
"module": "../dist/urql-core-internal.mjs",
-
"types": "../dist/types/internal/index.d.ts",
-
"source": "../src/internal/index.ts",
-
"exports": {
-
".": {
-
"import": "../dist/urql-core-internal.mjs",
-
"require": "../dist/urql-core-internal.js",
-
"types": "../dist/types/internal/index.d.ts",
-
"source": "../src/internal/index.ts"
-
}
-
},
-
"dependencies": {
-
"wonka": "^4.0.9"
-
}
-
}
+10 -2
scripts/rollup/config.js
···
import genPackageJson from 'rollup-plugin-generate-package-json';
-
import { relative, join } from 'path';
+
import { relative, join, dirname, basename } from 'path';
import { makePlugins } from './plugins';
import * as settings from './settings';
···
baseContents: {
name: source.name,
private: true,
-
main: join(rel, source.main),
+
main: join(rel, dirname(source.main), basename(source.main, '.js')),
module: join(rel, source.module),
types: join(rel, source.types),
source: join(rel, source.source),
+
exports: {
+
'.': {
+
import: join(rel, source.module),
+
require: join(rel, source.main),
+
types: join(rel, source.types),
+
source: join(rel, source.source),
+
}
+
}
}
}));
}