Skip to content

Commit

Permalink
fix(workspace): Fix regression causing malformed d.ts output (#2870)
Browse files Browse the repository at this point in the history
Co-authored-by: Phil Pluckthun <[email protected]>
  • Loading branch information
JoviDeCroock and kitten authored Dec 9, 2022
1 parent bd59d34 commit 6a4072f
Show file tree
Hide file tree
Showing 45 changed files with 125 additions and 247 deletions.
10 changes: 10 additions & 0 deletions .changeset/brown-doors-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@urql/exchange-graphcache': patch
'@urql/exchange-execute': patch
'@urql/core': patch
'next-urql': patch
'@urql/svelte': patch
'@urql/vue': patch
---

Fix type-generation, with a change in TS/Rollup the type generation took the paths as src and resolved them into the types dir
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build
run: pnpm -F urql build
run: pnpm -F @urql/core build && pnpm -F urql build

- name: e2e tests 🧪
uses: cypress-io/github-action@v4
Expand Down
1 change: 1 addition & 0 deletions exchanges/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"publishConfig": {
Expand Down
13 changes: 1 addition & 12 deletions exchanges/auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"target": "es2019",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"publishConfig": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/context/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/execute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"publishConfig": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/execute/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
2 changes: 1 addition & 1 deletion exchanges/graphcache/default-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@urql/core": ">=3.0.5",
"@urql/core": ">=3.1.0",
"wonka": "^6.0.0"
}
}
7 changes: 4 additions & 3 deletions exchanges/graphcache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@
},
"devDependencies": {
"@cypress/react": "^7.0.1",
"@urql/exchange-execute": "*",
"@urql/introspection": "*",
"@urql/core": "workspace:@urql/core@*",
"@urql/exchange-execute": "workspace:@urql/exchange-execute@*",
"@urql/introspection": "workspace:@urql/introspection@*",
"cypress": "^11.1.0",
"graphql": "^16.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"urql": "*"
"urql": "workspace:urql@*"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 1 addition & 0 deletions exchanges/graphcache/src/cacheExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const cacheExchange = <C extends Partial<CacheExchangeOpts>>(

// This registers queries with the data layer to ensure commutativity
const prepareForwardedOperation = (operation: Operation) => {
operation.context.bakka + {};
if (operation.kind === 'query') {
// Pre-reserve the position of the result layer
reserveLayer(store.data, operation.key);
Expand Down
12 changes: 1 addition & 11 deletions exchanges/graphcache/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/multipart-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"publishConfig": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/multipart-fetch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/persisted-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"publishConfig": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/persisted-fetch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/populate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"publishConfig": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/populate/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/refocus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"prepublishOnly": "run-s clean build"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"@types/react": "^17.0.4",
"graphql": "^16.0.0"
},
Expand Down
12 changes: 1 addition & 11 deletions exchanges/refocus/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/request-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"prepublishOnly": "run-s clean build"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"peerDependencies": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/request-policy/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions exchanges/retry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"prepublishOnly": "run-s clean build"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"graphql": "^16.0.0"
},
"peerDependencies": {
Expand Down
12 changes: 1 addition & 11 deletions exchanges/retry/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
12 changes: 1 addition & 11 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
12 changes: 1 addition & 11 deletions packages/introspection/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
2 changes: 2 additions & 0 deletions packages/next-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"prepublishOnly": "run-s clean build"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"urql": "workspace:urql@*",
"@types/enzyme": "^3.10.3",
"@types/enzyme-adapter-react-16": "^1.0.5",
"@types/node-fetch": "^2.5.4",
Expand Down
12 changes: 1 addition & 11 deletions packages/next-urql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions packages/preact-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"prepublishOnly": "run-s clean build"
},
"devDependencies": {
"@urql/core": "workspace:@urql/core@*",
"@testing-library/preact": "^2.0.0",
"graphql": "^16.0.0",
"preact": "^10.5.5"
Expand Down
12 changes: 1 addition & 11 deletions packages/preact-urql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"urql": ["../../packages/react-urql/src"],
"*-urql": ["../../packages/*-urql/src"],
"@urql/exchange-*": ["../../exchanges/*/src"],
"@urql/core/*": ["../../packages/core/src/*"],
"@urql/*": ["../../packages/*-urql/src", "../../packages/*/src"]
}
}
"include": ["src"]
}
1 change: 1 addition & 0 deletions packages/react-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@testing-library/react-hooks": "^5.1.2",
"@types/react": "^17.0.4",
"@types/react-test-renderer": "^17.0.1",
"@urql/core": "workspace:@urql/core@*",
"cypress": "^11.1.0",
"graphql": "^16.0.0",
"react": "^17.0.1",
Expand Down
9 changes: 6 additions & 3 deletions packages/react-urql/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import { Client, createClient } from '@urql/core';
// but not to error catastrophically if someone is just playing around
const defaultClient = createClient({ url: '/graphql' });

export const Context = createContext<Client>(defaultClient);
export const Provider = Context.Provider;
export const Consumer = Context.Consumer;
export const Context: import('react').Context<Client> = createContext(
defaultClient
);
export const Provider: import('react').Provider<Client> = Context.Provider;
export const Consumer: import('react').Consumer<Client> = Context.Consumer;

Context.displayName = 'UrqlContext';

let hasWarnedAboutDefault = false;
Expand Down
Loading

0 comments on commit 6a4072f

Please sign in to comment.