Skip to content

Commit

Permalink
remove peerDependency on graphql 14 (#11231)
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored Sep 20, 2023
1 parent 4cdcb91 commit 217c59e
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,24 @@ jobs:
command: npm run test --workspace=<< parameters.framework >>
working_directory: integration-tests

TestPeerDepTypes:
parameters:
externalPackage:
type: string
docker:
- image: cimg/node:20.6.1
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
working_directory: integration-tests/peerdeps-tsc
command: |
npm install
npm install @apollo/client@/tmp/workspace/apollo-client.tgz
npm install << parameters.externalPackage >>
npm test
workflows:
Build and Test:
jobs:
Expand All @@ -109,3 +127,17 @@ workflows:
- vite
- vite-swc
# -browser-esm would need a package publish to npm/CDNs
- TestPeerDepTypes:
name: Test external types for << matrix.externalPackage >>
requires:
- BuildTarball
matrix:
parameters:
externalPackage:
- "graphql@15"
- "graphql@16"
- "graphql@^17.0.0-alpha"
- "@types/[email protected] @types/[email protected]"
- "@types/react@17 @types/react-dom@17"
- "@types/react@18 @types/react-dom@18"
- "typescript@next"
5 changes: 5 additions & 0 deletions integration-tests/peerdeps-tsc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# explicitly avoiding to check in this one
# so we run this test always with the latest version
package-lock.json
dist
node_modules
20 changes: 20 additions & 0 deletions integration-tests/peerdeps-tsc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "peerdeps-tsc",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"graphql": "^16.0.0",
"graphql-ws": "^5.5.5",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"subscriptions-transport-ws": "^0.11.0",
"typescript": "latest"
}
}
1 change: 1 addition & 0 deletions integration-tests/peerdeps-tsc/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "@apollo/client";
17 changes: 17 additions & 0 deletions integration-tests/peerdeps-tsc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./dist",
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": false,
"types": ["react", "react-dom"],
"lib": ["es2018", "dom"]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"npm": "^7.20.3 || ^8.0.0 || ^9.0.0"
},
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
"graphql": "^15.0.0 || ^16.0.0",
"graphql-ws": "^5.5.5",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
Expand Down

0 comments on commit 217c59e

Please sign in to comment.