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

fix(workspace): Fix regression causing malformed d.ts output (#2870)

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

authored by

Jovi De Croock
Phil Pluckthun
and committed by
GitHub
6a4072fa bd59d34a

+125 -247
+10
.changeset/brown-doors-tan.md
··· 1 + --- 2 + '@urql/exchange-graphcache': patch 3 + '@urql/exchange-execute': patch 4 + '@urql/core': patch 5 + 'next-urql': patch 6 + '@urql/svelte': patch 7 + '@urql/vue': patch 8 + --- 9 + 10 + Fix type-generation, with a change in TS/Rollup the type generation took the paths as src and resolved them into the types dir
+1 -1
.github/workflows/ci.yml
··· 94 94 run: pnpm install --frozen-lockfile --prefer-offline 95 95 96 96 - name: Build 97 - run: pnpm -F urql build 97 + run: pnpm -F @urql/core build && pnpm -F urql build 98 98 99 99 - name: e2e tests 🧪 100 100 uses: cypress-io/github-action@v4
+1
exchanges/auth/package.json
··· 55 55 "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" 56 56 }, 57 57 "devDependencies": { 58 + "@urql/core": "workspace:@urql/core@*", 58 59 "graphql": "^16.0.0" 59 60 }, 60 61 "publishConfig": {
+1 -12
exchanges/auth/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "target": "es2019", 7 - "paths": { 8 - "urql": ["../../packages/react-urql/src"], 9 - "*-urql": ["../../packages/*-urql/src"], 10 - "@urql/exchange-*": ["../../exchanges/*/src"], 11 - "@urql/core/*": ["../../packages/core/src/*"], 12 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 13 - } 14 - } 3 + "include": ["src"] 15 4 }
+1
exchanges/context/package.json
··· 54 54 "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" 55 55 }, 56 56 "devDependencies": { 57 + "@urql/core": "workspace:@urql/core@*", 57 58 "graphql": "^16.0.0" 58 59 }, 59 60 "publishConfig": {
+1 -11
exchanges/context/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/execute/package.json
··· 55 55 "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" 56 56 }, 57 57 "devDependencies": { 58 + "@urql/core": "workspace:@urql/core@*", 58 59 "graphql": "^16.0.0" 59 60 }, 60 61 "publishConfig": {
+1 -11
exchanges/execute/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1 -1
exchanges/graphcache/default-storage/package.json
··· 16 16 "./package.json": "./package.json" 17 17 }, 18 18 "dependencies": { 19 - "@urql/core": ">=3.0.5", 19 + "@urql/core": ">=3.1.0", 20 20 "wonka": "^6.0.0" 21 21 } 22 22 }
+4 -3
exchanges/graphcache/package.json
··· 70 70 }, 71 71 "devDependencies": { 72 72 "@cypress/react": "^7.0.1", 73 - "@urql/exchange-execute": "*", 74 - "@urql/introspection": "*", 73 + "@urql/core": "workspace:@urql/core@*", 74 + "@urql/exchange-execute": "workspace:@urql/exchange-execute@*", 75 + "@urql/introspection": "workspace:@urql/introspection@*", 75 76 "cypress": "^11.1.0", 76 77 "graphql": "^16.0.0", 77 78 "react": "^17.0.1", 78 79 "react-dom": "^17.0.1", 79 - "urql": "*" 80 + "urql": "workspace:urql@*" 80 81 }, 81 82 "publishConfig": { 82 83 "access": "public"
+1
exchanges/graphcache/src/cacheExchange.ts
··· 111 111 112 112 // This registers queries with the data layer to ensure commutativity 113 113 const prepareForwardedOperation = (operation: Operation) => { 114 + operation.context.bakka + {}; 114 115 if (operation.kind === 'query') { 115 116 // Pre-reserve the position of the result layer 116 117 reserveLayer(store.data, operation.key);
+1 -11
exchanges/graphcache/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/multipart-fetch/package.json
··· 54 54 "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" 55 55 }, 56 56 "devDependencies": { 57 + "@urql/core": "workspace:@urql/core@*", 57 58 "graphql": "^16.0.0" 58 59 }, 59 60 "publishConfig": {
+1 -11
exchanges/multipart-fetch/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/persisted-fetch/package.json
··· 53 53 "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" 54 54 }, 55 55 "devDependencies": { 56 + "@urql/core": "workspace:@urql/core@*", 56 57 "graphql": "^16.0.0" 57 58 }, 58 59 "publishConfig": {
+1 -11
exchanges/persisted-fetch/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/populate/package.json
··· 53 53 "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" 54 54 }, 55 55 "devDependencies": { 56 + "@urql/core": "workspace:@urql/core@*", 56 57 "graphql": "^16.0.0" 57 58 }, 58 59 "publishConfig": {
+1 -11
exchanges/populate/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/refocus/package.json
··· 48 48 "prepublishOnly": "run-s clean build" 49 49 }, 50 50 "devDependencies": { 51 + "@urql/core": "workspace:@urql/core@*", 51 52 "@types/react": "^17.0.4", 52 53 "graphql": "^16.0.0" 53 54 },
+1 -11
exchanges/refocus/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/request-policy/package.json
··· 47 47 "prepublishOnly": "run-s clean build" 48 48 }, 49 49 "devDependencies": { 50 + "@urql/core": "workspace:@urql/core@*", 50 51 "graphql": "^16.0.0" 51 52 }, 52 53 "peerDependencies": {
+1 -11
exchanges/request-policy/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
exchanges/retry/package.json
··· 47 47 "prepublishOnly": "run-s clean build" 48 48 }, 49 49 "devDependencies": { 50 + "@urql/core": "workspace:@urql/core@*", 50 51 "graphql": "^16.0.0" 51 52 }, 52 53 "peerDependencies": {
+1 -11
exchanges/retry/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1 -11
packages/core/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1 -11
packages/introspection/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+2
packages/next-urql/package.json
··· 31 31 "prepublishOnly": "run-s clean build" 32 32 }, 33 33 "devDependencies": { 34 + "@urql/core": "workspace:@urql/core@*", 35 + "urql": "workspace:urql@*", 34 36 "@types/enzyme": "^3.10.3", 35 37 "@types/enzyme-adapter-react-16": "^1.0.5", 36 38 "@types/node-fetch": "^2.5.4",
+1 -11
packages/next-urql/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
packages/preact-urql/package.json
··· 48 48 "prepublishOnly": "run-s clean build" 49 49 }, 50 50 "devDependencies": { 51 + "@urql/core": "workspace:@urql/core@*", 51 52 "@testing-library/preact": "^2.0.0", 52 53 "graphql": "^16.0.0", 53 54 "preact": "^10.5.5"
+1 -11
packages/preact-urql/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
packages/react-urql/package.json
··· 46 46 "@testing-library/react-hooks": "^5.1.2", 47 47 "@types/react": "^17.0.4", 48 48 "@types/react-test-renderer": "^17.0.1", 49 + "@urql/core": "workspace:@urql/core@*", 49 50 "cypress": "^11.1.0", 50 51 "graphql": "^16.0.0", 51 52 "react": "^17.0.1",
+6 -3
packages/react-urql/src/context.ts
··· 5 5 // but not to error catastrophically if someone is just playing around 6 6 const defaultClient = createClient({ url: '/graphql' }); 7 7 8 - export const Context = createContext<Client>(defaultClient); 9 - export const Provider = Context.Provider; 10 - export const Consumer = Context.Consumer; 8 + export const Context: import('react').Context<Client> = createContext( 9 + defaultClient 10 + ); 11 + export const Provider: import('react').Provider<Client> = Context.Provider; 12 + export const Consumer: import('react').Consumer<Client> = Context.Consumer; 13 + 11 14 Context.displayName = 'UrqlContext'; 12 15 13 16 let hasWarnedAboutDefault = false;
+1 -11
packages/react-urql/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+2 -1
packages/storage-rn/package.json
··· 53 53 "@react-native-community/netinfo": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" 54 54 }, 55 55 "devDependencies": { 56 - "@urql/exchange-graphcache": "*", 56 + "@urql/core": "workspace:@urql/core@*", 57 + "@urql/exchange-graphcache": "workspace:@urql/exchange-graphcache@*", 57 58 "@react-native-async-storage/async-storage": "^1.15.5", 58 59 "@react-native-community/netinfo": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" 59 60 },
+1 -11
packages/storage-rn/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+3 -2
packages/storybook-addon/package.json
··· 48 48 "@storybook/preact": ">=6.0.28", 49 49 "@storybook/react": ">=6.0.28", 50 50 "@types/webpack-env": "^1.15.3", 51 + "@urql/core": "workspace:@urql/core@*", 51 52 "@urql/devtools": "^2.0.2", 52 - "@urql/preact": ">=3.0.0", 53 + "@urql/preact": "workspace:@urql/preact@*", 53 54 "graphql": "^16.0.0", 54 55 "preact": "^10.5.5", 55 56 "react": "^17.0.2", 56 57 "react-dom": "^17.0.2", 57 58 "react-is": "^17.0.2", 58 59 "typescript": ">=4.7.3", 59 - "urql": ">=3.0.0", 60 + "urql": "workspace:urql@*", 60 61 "webpack": ">=4.4.6", 61 62 "wonka": "^6.0.0" 62 63 },
+1 -11
packages/storybook-addon/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
packages/svelte-urql/package.json
··· 56 56 "wonka": "^6.0.0" 57 57 }, 58 58 "devDependencies": { 59 + "@urql/core": "workspace:@urql/core@*", 59 60 "graphql": "^16.0.0", 60 61 "svelte": "^3.20.0" 61 62 },
+1 -11
packages/svelte-urql/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+1
packages/vue-urql/package.json
··· 48 48 "prepublishOnly": "run-s clean build" 49 49 }, 50 50 "devDependencies": { 51 + "@urql/core": "workspace:@urql/core@*", 51 52 "graphql": "^16.0.0", 52 53 "vue": "^3.0.11" 53 54 },
+1 -11
packages/vue-urql/tsconfig.json
··· 1 1 { 2 2 "extends": "../../tsconfig.json", 3 - "include": ["src"], 4 - "compilerOptions": { 5 - "baseUrl": "./", 6 - "paths": { 7 - "urql": ["../../packages/react-urql/src"], 8 - "*-urql": ["../../packages/*-urql/src"], 9 - "@urql/exchange-*": ["../../exchanges/*/src"], 10 - "@urql/core/*": ["../../packages/core/src/*"], 11 - "@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"] 12 - } 13 - } 3 + "include": ["src"] 14 4 }
+12 -6
pnpm-lock.yaml
··· 155 155 specifiers: 156 156 '@cypress/react': ^7.0.1 157 157 '@urql/core': '>=3.1.0' 158 - '@urql/exchange-execute': '*' 159 - '@urql/introspection': '*' 158 + '@urql/exchange-execute': workspace:@urql/exchange-execute@* 159 + '@urql/introspection': workspace:@urql/introspection@* 160 160 cypress: ^11.1.0 161 161 graphql: ^16.0.0 162 162 react: ^17.0.2 163 163 react-dom: ^17.0.2 164 - urql: '*' 164 + urql: workspace:urql@* 165 165 wonka: ^6.1.2 166 166 dependencies: 167 167 '@urql/core': link:../../packages/core ··· 268 268 '@types/node-fetch': ^2.5.4 269 269 '@types/react': ^17.0.39 270 270 '@types/react-dom': ^17.0.3 271 + '@urql/core': workspace:@urql/core@* 271 272 enzyme: ^3.11.0 272 273 enzyme-adapter-react-16: ^1.15.2 273 274 graphql: ^16.0.0 ··· 276 277 react-dom: ^17.0.2 277 278 react-is: ^17.0.2 278 279 react-ssr-prepass: ^1.4.0 280 + urql: workspace:urql@* 279 281 dependencies: 280 282 react-ssr-prepass: 1.4.0_react@17.0.2 281 283 devDependencies: ··· 284 286 '@types/node-fetch': 2.5.10 285 287 '@types/react': 17.0.52 286 288 '@types/react-dom': 17.0.18 289 + '@urql/core': link:../core 287 290 enzyme: 3.11.0 288 291 enzyme-adapter-react-16: 1.15.6_7ltvq4e2railvf5uya4ffxpe2a 289 292 graphql: 16.0.1 ··· 291 294 react: 17.0.2 292 295 react-dom: 17.0.2_react@17.0.2 293 296 react-is: 17.0.2 297 + urql: link:../react-urql 294 298 295 299 packages/preact-urql: 296 300 specifiers: ··· 421 425 specifiers: 422 426 '@react-native-async-storage/async-storage': ^1.15.5 423 427 '@react-native-community/netinfo': ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 424 - '@urql/exchange-graphcache': '*' 428 + '@urql/core': workspace:@urql/core@* 429 + '@urql/exchange-graphcache': workspace:@urql/exchange-graphcache@* 425 430 devDependencies: 426 431 '@react-native-async-storage/async-storage': 1.15.5 427 432 '@react-native-community/netinfo': 6.0.0 433 + '@urql/core': link:../core 428 434 '@urql/exchange-graphcache': link:../../exchanges/graphcache 429 435 430 436 packages/storybook-addon: ··· 436 442 '@types/webpack-env': ^1.15.3 437 443 '@urql/core': ^3.0.0 438 444 '@urql/devtools': '>=2.0.0' 439 - '@urql/preact': '>=3.0.0' 445 + '@urql/preact': workspace:@urql/preact@* 440 446 graphql: ^16.0.0 441 447 preact: ^10.5.5 442 448 react: ^17.0.2 443 449 react-dom: ^17.0.2 444 450 react-is: ^17.0.2 445 451 typescript: '>=4.7.3' 446 - urql: '>=3.0.0' 452 + urql: workspace:urql@* 447 453 webpack: '>=4.4.6' 448 454 wonka: ^6.1.2 449 455 dependencies:
+29 -11
scripts/rollup/cleanup-plugin.mjs
··· 1 1 import { transformSync as transform } from '@babel/core'; 2 2 import { createFilter } from '@rollup/pluginutils'; 3 + import { posix as path } from 'path'; 4 + 5 + import * as settings from './settings.mjs'; 3 6 4 7 function removeEmptyImports({ types: t }) { 5 8 return { ··· 22 25 }; 23 26 } 24 27 25 - function cleanup(opts = {}) { 26 - const filter = createFilter(opts.include, opts.exclude, { 27 - resolve: false 28 - }); 28 + function cleanup() { 29 + const jsFilter = createFilter(/.m?js$/, null, { resolve: false }); 30 + const dtsFilter = createFilter(/\.d\.ts(\.map)?$/, null, { resolve: false }); 29 31 30 32 return { 31 33 name: "cleanup", 32 34 33 35 renderChunk(code, chunk) { 34 - if (!filter(chunk.fileName)) { 35 - return null; 36 + if (jsFilter(chunk.fileName)) { 37 + return transform(code, { 38 + plugins: [removeEmptyImports], 39 + babelrc: false 40 + }); 36 41 } 42 + }, 37 43 38 - return transform(code, { 39 - plugins: [removeEmptyImports], 40 - babelrc: false 41 - }); 42 - } 44 + generateBundle(_options, bundle) { 45 + const basePath = path.relative( 46 + path.resolve(settings.cwd, '../..'), 47 + path.join(settings.cwd, 'src'), 48 + ); 49 + 50 + for (const fileName in bundle) { 51 + if (!dtsFilter(fileName)) { 52 + continue; 53 + } else if (fileName.startsWith(basePath)) { 54 + const targetPath = fileName.slice(basePath.length + 1); 55 + bundle[fileName].fileName = path.join('types', targetPath);; 56 + } else { 57 + delete bundle[fileName]; 58 + } 59 + } 60 + }, 43 61 }; 44 62 } 45 63
+6 -2
scripts/rollup/plugins.mjs
··· 36 36 } : {}, 37 37 }), 38 38 typescript({ 39 - useTsconfigDeclarationDir: true, 39 + clean: true, 40 40 tsconfigOverride: { 41 41 exclude: [ 42 + 'src/**/*.spec.ts', 43 + 'src/**/*.spec.tsx', 42 44 'src/**/*.test.ts', 43 45 'src/**/*.test.tsx', 44 46 'src/**/test-utils/*' 45 47 ], 46 48 compilerOptions: { 49 + rootDir: path.resolve(settings.cwd, '../..'), 47 50 sourceMap: true, 48 51 noEmit: false, 52 + noResolve: true, 49 53 declaration: true, 50 54 declarationDir: settings.types, 51 55 target: 'esnext', ··· 91 95 'process.env.NODE_ENV': JSON.stringify('production') 92 96 }), 93 97 cjsCheck({ extension }), 94 - cleanup({ extension, maintainImports: settings.name === 'urql-introspection' }), 98 + cleanup(), 95 99 isProduction ? terserMinified : (extension !== '.js' ? terserPretty : null), 96 100 isProduction && settings.isAnalyze && visualizer({ 97 101 filename: path.resolve(settings.cwd, 'node_modules/.cache/analyze.html'),
+16 -7
tsconfig.json
··· 2 2 "compilerOptions": { 3 3 "baseUrl": "./", 4 4 "paths": { 5 - "urql": ["packages/react-urql/src"], 6 - "*-urql": ["packages/*-urql/src"], 7 - "@urql/exchange-*": ["exchanges/*/src"], 8 - "@urql/core/*": ["packages/core/src/*"], 9 - "@urql/*": ["packages/*-urql/src", "packages/*/src"] 5 + "urql": ["node_modules/urql/src", "packages/react-urql/src"], 6 + "*-urql": ["node_modules/*-urql/src", "packages/*-urql/src"], 7 + "@urql/exchange-*": [ 8 + "node_modules/@urql/exchange-*/src", 9 + "exchanges/*/src" 10 + ], 11 + "@urql/core/*": ["node_modules/@urql/core/src/*", "packages/core/src/*"], 12 + "@urql/devtools": ["node_modules/@urql/devtools"], 13 + "@urql/*": [ 14 + "node_modules/@urql/*/src", 15 + "packages/*-urql/src", 16 + "packages/*/src" 17 + ] 10 18 }, 11 19 "esModuleInterop": true, 12 20 "isolatedModules": true, ··· 28 36 "**/e2e-tests", 29 37 "**/examples", 30 38 "**/dist", 31 - "scripts", 32 - "node_modules" 39 + "**/node_modules", 40 + "node_modules", 41 + "scripts" 33 42 ] 34 43 }