Skip to content

Commit

Permalink
update Apollo Client version to 3.9.6 (#236)
Browse files Browse the repository at this point in the history
* update Apollo Client version to 3.9.6

* run "next" steps only if next>latest

* run `yarn install` for matrix step

* adjust
  • Loading branch information
phryneas authored Mar 8, 2024
1 parent f875ac1 commit f823d31
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 46 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,33 @@ on:
- "yarn.lock"
workflow_dispatch:
jobs:
matrix:
name: Determine if the `next` tag is higher than the `latest` tag
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.matrix }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "yarn"
- run: yarn install --immutable
- name: Calculate Matrix
id: version
run: yarn matrix | tee $GITHUB_OUTPUT

test:
name: Unit Tests
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
needs: matrix
if: |
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["latest", "next"]
version: ${{ fromJson(needs.matrix.outputs.version) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -33,12 +52,13 @@ jobs:
- run: yarn workspaces foreach --all --include "@apollo/*" run test | tee $GITHUB_STEP_SUMMARY; exit ${PIPESTATUS[0]}
packageShapes:
name: Test Bundles
needs: matrix
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["latest", "next"]
version: ${{ fromJson(needs.matrix.outputs.version) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -50,12 +70,13 @@ jobs:
- run: yarn workspaces foreach --all --include "@apollo/*" run test-bundle | tee $GITHUB_STEP_SUMMARY; exit ${PIPESTATUS[0]}
tests_playwright:
name: Integration Tests
needs: matrix
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["latest", "next"]
version: ${{ fromJson(needs.matrix.outputs.version) }}
defaults:
run:
working-directory: ./integration-test
Expand Down
2 changes: 1 addition & 1 deletion examples/app-dir-experiments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "next lint"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/experimental-nextjs-app-support": "workspace:^",
"@apollo/server": "^4.9.5",
"@as-integrations/next": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/hack-the-supergraph-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "next lint"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/experimental-nextjs-app-support": "workspace:^",
"@apollo/space-kit": "^9.11.0",
"@chakra-ui/next-js": "^2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/polls-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"codegen": "graphql-codegen --config codegen.ts"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/experimental-nextjs-app-support": "workspace:^",
"@apollo/server": "^4.9.5",
"@types/node": "18.16.3",
Expand Down
2 changes: 1 addition & 1 deletion integration-test/experimental-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "yarn playwright test"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/client-react-streaming": "*",
"compression": "^1.7.4",
"express": "^4.18.2",
Expand Down
2 changes: 1 addition & 1 deletion integration-test/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"test": "jest"
},
"dependencies": {
"@apollo/client": "^3.9.5",
"@apollo/client": "^3.9.6",
"@apollo/client-react-streaming": "workspace:*",
"@apollo/experimental-nextjs-app-support": "workspace:*",
"@graphql-tools/schema": "^10.0.3",
Expand Down
2 changes: 1 addition & 1 deletion integration-test/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "yarn playwright test"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/experimental-nextjs-app-support": "workspace:*",
"@apollo/server": "^4.9.5",
"@as-integrations/next": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion integration-test/vite-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "yarn playwright test"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/client-react-streaming": "*",
"compression": "^1.7.4",
"express": "^4.18.2",
Expand Down
2 changes: 1 addition & 1 deletion integration-test/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"test": "vitest"
},
"dependencies": {
"@apollo/client": "^3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/experimental-nextjs-app-support": "*",
"@graphql-tools/schema": "^10.0.3",
"graphql-tag": "^2.12.6",
Expand Down
28 changes: 14 additions & 14 deletions integration-test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ __metadata:
languageName: node
linkType: hard

"@apollo/client@npm:^3.9.1, @apollo/client@npm:^3.9.5":
version: 3.9.5
resolution: "@apollo/client@npm:3.9.5"
"@apollo/client@npm:^3.9.6":
version: 3.9.6
resolution: "@apollo/client@npm:3.9.6"
dependencies:
"@graphql-typed-document-node/core": "npm:^3.1.1"
"@wry/caches": "npm:^1.0.0"
Expand All @@ -56,7 +56,7 @@ __metadata:
hoist-non-react-statics: "npm:^3.3.2"
optimism: "npm:^0.18.0"
prop-types: "npm:^15.7.2"
rehackt: "npm:0.0.5"
rehackt: "npm:0.0.6"
response-iterator: "npm:^0.2.6"
symbol-observable: "npm:^4.0.0"
ts-invariant: "npm:^0.10.3"
Expand All @@ -77,7 +77,7 @@ __metadata:
optional: true
subscriptions-transport-ws:
optional: true
checksum: 10/359b980928fe476c14b38b81aa3713fb6ef525d902caa67e218b7393d76f88433a1dad1b515908ab10bfe7ddec68461f5fbb3dc53bdd6ce185ab57984e7c9028
checksum: 10/8455e8fe6a2a757bff9c814aec0c152543a920587a4a4278acf44c86f373d4923e4f48912aa88582504d8a56cd6e305656d8f290d8d1357834ec83e63c0b9592
languageName: node
linkType: hard

Expand Down Expand Up @@ -1979,7 +1979,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@integration-test/experimental-react@workspace:experimental-react"
dependencies:
"@apollo/client": "npm:^3.9.1"
"@apollo/client": "npm:^3.9.6"
"@apollo/client-react-streaming": "npm:*"
"@playwright/test": "npm:^1.39.0"
"@tsconfig/vite-react": "npm:^3.0.0"
Expand All @@ -2003,7 +2003,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@integration-test/jest@workspace:jest"
dependencies:
"@apollo/client": "npm:^3.9.5"
"@apollo/client": "npm:^3.9.6"
"@apollo/client-react-streaming": "workspace:*"
"@apollo/experimental-nextjs-app-support": "workspace:*"
"@babel/core": "npm:^7.24.0"
Expand All @@ -2026,7 +2026,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@integration-test/nextjs@workspace:nextjs"
dependencies:
"@apollo/client": "npm:^3.9.1"
"@apollo/client": "npm:^3.9.6"
"@apollo/experimental-nextjs-app-support": "workspace:*"
"@apollo/server": "npm:^4.9.5"
"@as-integrations/next": "npm:^3.0.0"
Expand Down Expand Up @@ -2064,7 +2064,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@integration-test/vite-streaming@workspace:vite-streaming"
dependencies:
"@apollo/client": "npm:^3.9.1"
"@apollo/client": "npm:^3.9.6"
"@apollo/client-react-streaming": "npm:*"
"@playwright/test": "npm:^1.39.0"
"@tsconfig/vite-react": "npm:^3.0.0"
Expand All @@ -2088,7 +2088,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@integration-test/vitest@workspace:vitest"
dependencies:
"@apollo/client": "npm:^3.9.1"
"@apollo/client": "npm:^3.9.6"
"@apollo/experimental-nextjs-app-support": "npm:*"
"@graphql-tools/schema": "npm:^10.0.3"
"@testing-library/jest-dom": "npm:^6.4.2"
Expand Down Expand Up @@ -7330,9 +7330,9 @@ __metadata:
languageName: node
linkType: hard

"rehackt@npm:0.0.5":
version: 0.0.5
resolution: "rehackt@npm:0.0.5"
"rehackt@npm:0.0.6":
version: 0.0.6
resolution: "rehackt@npm:0.0.6"
peerDependencies:
"@types/react": "*"
react: "*"
Expand All @@ -7341,7 +7341,7 @@ __metadata:
optional: true
react:
optional: true
checksum: 10/a7536eaeb47ba46bc29fa050c7cbf80860809689c893c6177664efbbdca641a1996185ea6602fb76473f0e2b145c1f3e9c27a5e738054d69809b6c39046fe269
checksum: 10/3897c93270836159406529e0fa983bf4a11c07d2efc5c8f6bdfd7f6821d3b84a30d911c3f3b9c689948739e6955c5835c8dd9d91579150bec5092f356c0d91df
languageName: node
linkType: hard

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
"main": "package.json",
"dependencies": {
"monorepo": "link:.",
"prettier": "^3.0.0"
"prettier": "^3.0.0",
"semver": "^7.6.0"
},
"scripts": {
"verify-package-json": "node ./scripts/verify-package-json.mjs",
"verify-package-shape": "node ./scripts/verify-package-shape.mjs"
"verify-package-shape": "node ./scripts/verify-package-shape.mjs",
"matrix": "node ./scripts/test-matrix.js"
},
"resolutions": {
"@apollo/client": "0.0.0-pr-11617-20240227102358",
"[email protected]": "18.3.0-canary-60a927d04-20240113",
"[email protected]": "18.3.0-canary-60a927d04-20240113",
"superjson": "1.13.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/client-react-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"lint": "eslint --ext .ts,.tsx src"
},
"devDependencies": {
"@apollo/client": "3.9.1",
"@apollo/client": "^3.9.6",
"@arethetypeswrong/cli": "0.13.6",
"@testing-library/react": "^14.2.1",
"@total-typescript/shoehorn": "0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/experimental-nextjs-app-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"lint": "eslint --ext .ts,.tsx ."
},
"devDependencies": {
"@apollo/client": "3.9.1",
"@apollo/client": "^3.9.6",
"@apollo/client-react-streaming": "workspace:*",
"@arethetypeswrong/cli": "0.13.6",
"@testing-library/react": "^14.2.1",
Expand Down
17 changes: 17 additions & 0 deletions scripts/test-matrix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { execFileSync } = require("node:child_process");
const semver = require("semver");

const tags = execFileSync("npm", ["dist-tag", "ls", "@apollo/client"], {
encoding: "utf-8",
}).toString();

// @ts-ignore
let latest = tags.match(/latest: (.*)/)[1];
// @ts-ignore
let next = tags.match(/next: (.*)/)[1];

if (semver.gt(next, latest)) {
console.log('matrix=["next","latest"]');
} else {
console.log('matrix=["latest"]');
}
Loading

0 comments on commit f823d31

Please sign in to comment.