Skip to content

Commit

Permalink
Repository overall cleanup - dependency updates, migration of configs…
Browse files Browse the repository at this point in the history
… etc (#3532)

* chore(deps): update dependency eslint to v9

* Fix ESLint

* Update eslint config

* No need for a huge matrix for fed compat

* Cleanup

* Update dependencies

* Go

* Bump more

* Go

* chore(dependencies): updated changesets for modified dependencies

* Go

* Hmm'

* chore(dependencies): updated changesets for modified dependencies

* Bump envelop-auth

* Fix website build

* chore(dependencies): updated changesets for modified dependencies

* Prettier

* Ignore husky

* Prettier

* Remove leaks

* Fix

* Fix

* Patch Jest leak detector for Node 20

* ESLint needs more memory

* Hmm

* More details in the changeset

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent bcf7040 commit 57e7701
Show file tree
Hide file tree
Showing 137 changed files with 11,095 additions and 6,073 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-yoga/apollo-managed-federation": patch
---
dependencies updates:
- Updated dependency [`@graphql-tools/federation@^3.0.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/federation/v/3.0.0) (from `2.1.0`, in `dependencies`)
- Added dependency [`@whatwg-node/disposablestack@^0.0.5` ↗︎](https://www.npmjs.com/package/@whatwg-node/disposablestack/v/0.0.5) (to `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-yoga_plugin-jwt-3532-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-yoga/plugin-jwt": patch
---
dependencies updates:
- Updated dependency [`graphql@^15.2.0 || ^16.0.0` ↗︎](https://www.npmjs.com/package/graphql/v/15.2.0) (from `^16.5.0`, in `peerDependencies`)
7 changes: 7 additions & 0 deletions .changeset/eleven-crews-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-yoga/typed-event-target': patch
---

Improve typings for `TypedEventTarget<TEvent>`, so `addEventListener` and `removeEventListener` methods now expect `type` to be the `type` property of `TEvent`, and `dispatchEvent` expects to get `TEvent`.


11 changes: 11 additions & 0 deletions .changeset/late-monkeys-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@graphql-yoga/apollo-managed-federation': minor
---

`supergraphManager` option is not available anymore, you can pass `SupergraphManager` directly to
the plugin instead;

```diff
- useManagedFederation({ supergraphManager })
+ useManagedFederation(supergraphManager)
```
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ examples/apollo-federation-compatibility/src/resolvers-types.ts
**/.next
**/.bob
**/.svelte-kit
**/e2e
**/benchmark
**/examples
*.js
183 changes: 32 additions & 151 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
cancel-in-progress: true

jobs:
typecheck:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -45,14 +45,23 @@ jobs:
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key: ${{ runner.os }}-pnpm-store-graphql-v16-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-graphql-v16-
- name: Install Dependencies
run: pnpm i --no-frozen-lockfile # no frozen-lockfile because we change the resolutions

- name: Prettier
run: pnpm prettier:check

- name: Lint
run: pnpm lint
env:
DEBUG: 'eslint:*'
NODE_OPTIONS: '--max-old-space-size=8192'
NODE_NO_WARNINGS: true

- name: Build Packages
run: pnpm build

Expand All @@ -62,19 +71,16 @@ jobs:
- name: Test ESM & CJS exports integrity
run: pnpm bob check

- name: Prettier
run: pnpm prettier:check

- name: eslint
run: pnpm lint
- name: ESM Integration test
run: pnpm --filter example-node-esm run test

unit:
name: unit / nodejs v${{ matrix.node-version }} / graphql v${{ matrix.graphql-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
graphql-version: ['15.8.0', '16.6.0']
graphql-version: ['15.8.0', '16.9.0']
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand All @@ -96,7 +102,6 @@ jobs:
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key:
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
hashFiles('**/pnpm-lock.yaml') }}
Expand All @@ -119,6 +124,20 @@ jobs:
max_attempts: 3
command: pnpm run test --ci

- name: Run Unit Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: pnpm run test --ci

- name: Run Leak Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: pnpm run test:unit:leaks --ci

integration:
name: integration / nodejs v${{ matrix.node-version }} / graphql v${{ matrix.graphql-version }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -147,7 +166,6 @@ jobs:
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key:
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
hashFiles('**/pnpm-lock.yaml') }}
Expand All @@ -163,130 +181,42 @@ jobs:
- name: Build Packages
run: pnpm build

- name: Run Tests
- name: Run Integration Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: pnpm test:integration --ci

leaks:
name: leaks / nodejs v${{ matrix.node-version }} / graphql v${{ matrix.graphql-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 22]
graphql-version: ['15.8.0', '16.6.0']
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
uses: pnpm/[email protected]

- name: Get pnpm store path
id: pnpm-store
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache pnpm
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key:
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
- name: Set GraphQL Version
run: node scripts/override-graphql-version.js ${{ matrix.graphql-version }}

- name: Install Dependencies
run: pnpm i --no-frozen-lockfile # no frozen-lockfile because we change the resolutions

- name: Build Packages
run: pnpm build

- name: Run Tests
- name: Run Leak Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: pnpm test:leaks --ci
command: pnpm test:integration:leaks --ci

esm:
apollo-federation-compatibility:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'

- name: Install pnpm
uses: pnpm/[email protected]

- name: Get pnpm store path
id: pnpm-store
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache pnpm
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key: ${{ runner.os }}-pnpm-store-graphql-v16-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-graphql-v16-
- name: Install Dependencies
run: pnpm i --no-frozen-lockfile # no frozen-lockfile because we change the resolutions

- name: Build Packages
run: pnpm build

- name: Run Tests
run: pnpm --filter example-node-esm run test

apollo-federation-compatibility:
strategy:
matrix:
node-version: [18, 20, 22]
graphql-version: ['15.8.0', '16.6.0']
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/[email protected]
- name: Get pnpm store path
id: pnpm-store
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key:
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
- name: Install Dependencies
run: pnpm i --no-frozen-lockfile
- name: Build Packages
Expand All @@ -309,54 +239,6 @@ jobs:
failOnRequired: true
debug: true

# TODO: have the example and packages use singleton nestjs dependencies
# but without using .pnpmfile.cjs because it causes issues with renovate: https://github.com/dotansimha/graphql-yoga/pull/2622
# nestjs-apollo-federation-compatibility:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v3
# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# - name: Install pnpm
# uses: pnpm/[email protected]
# - name: Get pnpm store path
# id: pnpm-store
# run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
# - name: Cache pnpm
# uses: actions/cache@v3
# with:
# path: |
# ${{ steps.pnpm-store.outputs.PATH }}
# **/node_modules
# key: ${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
# - name: Install Dependencies
# run: pnpm i
# - name: Build Packages
# run: pnpm build
# - name: Bundle NestJS Apollo Federation Subgraph Example
# run: pnpm --filter=example-nestjs-apollo-federation-compatibility build
# - name: Install Rover
# run: curl -sSL https://rover.apollo.dev/nix/v0.11.1 | sh
# - name: Add Rover to PATH
# run: echo "$HOME/.rover/bin" >> $GITHUB_PATH
# - name: Apollo Federation Subgraph Compatibility
# uses: apollographql/federation-subgraph-compatibility@v1
# with:
# workingDirectory: examples/nestjs-apollo-federation-compatibility
# compose: docker-compose.yaml
# schema: schema.graphql
# path: /graphql
# # no token = no comment
# # token: ${{ secrets.GITHUB_TOKEN }}
# failOnWarning: true
# failOnRequired: true
# debug: true

e2e:
strategy:
fail-fast: false
Expand Down Expand Up @@ -393,7 +275,6 @@ jobs:
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key: ${{ runner.os }}-pnpm-store-graphql-v16-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-graphql-v16-
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
with:
path: |
${{ steps.pnpm-store.outputs.PATH }}
**/node_modules
key: ${{ runner.os }}-pnpm-store-graphql-v16-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-graphql-v16-
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ website/src/pages/v3/_meta.js
website/src/lib/v3-get-static-props.ts
website/src/pages/v4/_meta.js
website/src/lib/v4-get-static-props.ts

.husky/
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@envelop/graphql-jit": "8.0.4",
"@faker-js/faker": "9.2.0",
"@graphql-yoga/plugin-response-cache": "workspace:*",
"graphql": "16.6.0",
"graphql": "16.9.0",
"graphql-yoga": "workspace:*",
"uWebSockets.js": "uNetworking/uWebSockets.js#semver:^20"
},
Expand Down
2 changes: 1 addition & 1 deletion benchmark/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"moduleResolution": "node16"
},
"include": ["./start-server.ts"],
"exclude": []
"exclude": ["**/node_modules"]
}
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@pulumi/docker": "4.5.3",
"@pulumi/pulumi": "3.116.1",
"@types/node": "22.9.0",
"tsx": "^3.12.7",
"tsx": "4.19.2",
"typescript": "5.7.2"
}
}
14 changes: 0 additions & 14 deletions e2e/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Output } from '@pulumi/pulumi';
import { OutputValue, Stack } from '@pulumi/pulumi/automation';

// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export type DeploymentConfiguration<TProgramOutput = {}> = {
prerequisites?: (stack: Stack) => Promise<void>;
config?: (stack: Stack) => Promise<void>;
Expand Down
Loading

0 comments on commit 57e7701

Please sign in to comment.