diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e9da69b..72ffce5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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 diff --git a/examples/app-dir-experiments/package.json b/examples/app-dir-experiments/package.json index ae873e12..abb8c058 100644 --- a/examples/app-dir-experiments/package.json +++ b/examples/app-dir-experiments/package.json @@ -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", diff --git a/examples/hack-the-supergraph-ssr/package.json b/examples/hack-the-supergraph-ssr/package.json index 55cfd1b4..b4b1fd0a 100644 --- a/examples/hack-the-supergraph-ssr/package.json +++ b/examples/hack-the-supergraph-ssr/package.json @@ -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", diff --git a/examples/polls-demo/package.json b/examples/polls-demo/package.json index 0726314a..5e92e561 100644 --- a/examples/polls-demo/package.json +++ b/examples/polls-demo/package.json @@ -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", diff --git a/integration-test/experimental-react/package.json b/integration-test/experimental-react/package.json index 5c88a032..675ce058 100644 --- a/integration-test/experimental-react/package.json +++ b/integration-test/experimental-react/package.json @@ -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", diff --git a/integration-test/jest/package.json b/integration-test/jest/package.json index 8462a01e..00f4e76b 100644 --- a/integration-test/jest/package.json +++ b/integration-test/jest/package.json @@ -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", diff --git a/integration-test/nextjs/package.json b/integration-test/nextjs/package.json index f2224b97..d2459cf5 100644 --- a/integration-test/nextjs/package.json +++ b/integration-test/nextjs/package.json @@ -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", diff --git a/integration-test/package.json b/integration-test/package.json index 0bd19be6..f6e1d0c8 100644 --- a/integration-test/package.json +++ b/integration-test/package.json @@ -2,7 +2,6 @@ "name": "@integration-test/root", "packageManager": "yarn@4.1.0", "resolutions": { - "@apollo/client": "0.0.0-pr-11617-20240227102358", "@apollo/client-react-streaming": "exec:./shared/build-client-react-streaming.cjs", "@apollo/experimental-nextjs-app-support": "exec:./shared/build-experimental-nextjs-app-support.cjs" }, diff --git a/integration-test/vite-streaming/package.json b/integration-test/vite-streaming/package.json index fd55cc5d..0bfa3078 100644 --- a/integration-test/vite-streaming/package.json +++ b/integration-test/vite-streaming/package.json @@ -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", diff --git a/integration-test/vitest/package.json b/integration-test/vitest/package.json index d647e3de..96aa2ba6 100644 --- a/integration-test/vitest/package.json +++ b/integration-test/vitest/package.json @@ -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", diff --git a/integration-test/yarn.lock b/integration-test/yarn.lock index a4af321f..22b18208 100644 --- a/integration-test/yarn.lock +++ b/integration-test/yarn.lock @@ -44,9 +44,9 @@ __metadata: languageName: node linkType: hard -"@apollo/client@npm:0.0.0-pr-11617-20240227102358": - version: 0.0.0-pr-11617-20240227102358 - resolution: "@apollo/client@npm:0.0.0-pr-11617-20240227102358" +"@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" @@ -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" @@ -77,7 +77,7 @@ __metadata: optional: true subscriptions-transport-ws: optional: true - checksum: 10/0189a24d832ef14a408a0a3dd5e15d416ed4c223aa9aca21c80774beb60ff7303242242f688c684a20df0166ba95f4c92708dfe7badc0ab12dabe63232616483 + checksum: 10/8455e8fe6a2a757bff9c814aec0c152543a920587a4a4278acf44c86f373d4923e4f48912aa88582504d8a56cd6e305656d8f290d8d1357834ec83e63c0b9592 languageName: node linkType: hard @@ -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" @@ -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" @@ -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" @@ -2065,7 +2065,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" @@ -2089,7 +2089,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" @@ -7342,9 +7342,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: "*" @@ -7353,7 +7353,7 @@ __metadata: optional: true react: optional: true - checksum: 10/a7536eaeb47ba46bc29fa050c7cbf80860809689c893c6177664efbbdca641a1996185ea6602fb76473f0e2b145c1f3e9c27a5e738054d69809b6c39046fe269 + checksum: 10/3897c93270836159406529e0fa983bf4a11c07d2efc5c8f6bdfd7f6821d3b84a30d911c3f3b9c689948739e6955c5835c8dd9d91579150bec5092f356c0d91df languageName: node linkType: hard diff --git a/package.json b/package.json index 9ca176bd..8ef268c3 100644 --- a/package.json +++ b/package.json @@ -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", "react@18.2.0": "18.3.0-canary-60a927d04-20240113", "react-dom@18.2.0": "18.3.0-canary-60a927d04-20240113", "superjson": "1.13.3" diff --git a/packages/client-react-streaming/package.json b/packages/client-react-streaming/package.json index 6dbcfc58..ffdf633a 100644 --- a/packages/client-react-streaming/package.json +++ b/packages/client-react-streaming/package.json @@ -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", diff --git a/packages/experimental-nextjs-app-support/package.json b/packages/experimental-nextjs-app-support/package.json index 315c7380..fa352e98 100644 --- a/packages/experimental-nextjs-app-support/package.json +++ b/packages/experimental-nextjs-app-support/package.json @@ -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", diff --git a/scripts/test-matrix.js b/scripts/test-matrix.js new file mode 100644 index 00000000..f04c0552 --- /dev/null +++ b/scripts/test-matrix.js @@ -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"]'); +} diff --git a/yarn.lock b/yarn.lock index 922791eb..4a897766 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,7 +49,7 @@ __metadata: version: 0.0.0-use.local resolution: "@apollo/client-react-streaming@workspace:packages/client-react-streaming" dependencies: - "@apollo/client": "npm:3.9.1" + "@apollo/client": "npm:^3.9.6" "@arethetypeswrong/cli": "npm:0.13.6" "@testing-library/react": "npm:^14.2.1" "@total-typescript/shoehorn": "npm:0.1.1" @@ -82,9 +82,9 @@ __metadata: languageName: unknown linkType: soft -"@apollo/client@npm:0.0.0-pr-11617-20240227102358": - version: 0.0.0-pr-11617-20240227102358 - resolution: "@apollo/client@npm:0.0.0-pr-11617-20240227102358" +"@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" @@ -94,7 +94,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" @@ -115,7 +115,7 @@ __metadata: optional: true subscriptions-transport-ws: optional: true - checksum: 10/0189a24d832ef14a408a0a3dd5e15d416ed4c223aa9aca21c80774beb60ff7303242242f688c684a20df0166ba95f4c92708dfe7badc0ab12dabe63232616483 + checksum: 10/8455e8fe6a2a757bff9c814aec0c152543a920587a4a4278acf44c86f373d4923e4f48912aa88582504d8a56cd6e305656d8f290d8d1357834ec83e63c0b9592 languageName: node linkType: hard @@ -123,7 +123,7 @@ __metadata: version: 0.0.0-use.local resolution: "@apollo/experimental-nextjs-app-support@workspace:packages/experimental-nextjs-app-support" dependencies: - "@apollo/client": "npm:3.9.1" + "@apollo/client": "npm:^3.9.6" "@apollo/client-react-streaming": "workspace:*" "@arethetypeswrong/cli": "npm:0.13.6" "@testing-library/react": "npm:^14.2.1" @@ -5316,7 +5316,7 @@ __metadata: version: 0.0.0-use.local resolution: "apollo-next-13-demo@workspace:examples/polls-demo" 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" "@graphql-codegen/cli": "npm:3.3.1" @@ -5349,7 +5349,7 @@ __metadata: version: 0.0.0-use.local resolution: "app-dir@workspace:examples/app-dir-experiments" 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" @@ -8683,7 +8683,7 @@ __metadata: version: 0.0.0-use.local resolution: "hack-the-supergraph-ssr@workspace:examples/hack-the-supergraph-ssr" dependencies: - "@apollo/client": "npm:^3.9.1" + "@apollo/client": "npm:^3.9.6" "@apollo/experimental-nextjs-app-support": "workspace:^" "@apollo/space-kit": "npm:^9.11.0" "@chakra-ui/next-js": "npm:^2.1.2" @@ -10339,6 +10339,7 @@ __metadata: dependencies: monorepo: "link:." prettier: "npm:^3.0.0" + semver: "npm:^7.6.0" languageName: unknown linkType: soft @@ -11679,9 +11680,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: "*" @@ -11690,7 +11691,7 @@ __metadata: optional: true react: optional: true - checksum: 10/a7536eaeb47ba46bc29fa050c7cbf80860809689c893c6177664efbbdca641a1996185ea6602fb76473f0e2b145c1f3e9c27a5e738054d69809b6c39046fe269 + checksum: 10/3897c93270836159406529e0fa983bf4a11c07d2efc5c8f6bdfd7f6821d3b84a30d911c3f3b9c689948739e6955c5835c8dd9d91579150bec5092f356c0d91df languageName: node linkType: hard @@ -12127,7 +12128,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.0.0": +"semver@npm:^7.0.0, semver@npm:^7.6.0": version: 7.6.0 resolution: "semver@npm:7.6.0" dependencies: