Skip to content

Commit e0dc41a

Browse files
authored
Preset to migrate to Client Preset (#375)
1 parent b43896e commit e0dc41a

63 files changed

Lines changed: 2930 additions & 17 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/curvy-dolls-dream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@eddeee888/gcg-operation-location-migration': patch
3+
---
4+
5+
Add base preset to migrate to co-location and Server Preset

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
outputs:
1717
affected-typescript-resolver-files: ${{ steps.affected.outputs.typescript-resolver-files }}
1818
affected-typescript-resolver-files-e2e: ${{ steps.affected.outputs.typescript-resolver-files-e2e }}
19+
affected-operation-location-migration: ${{ steps.affected.outputs.operation-location-migration }}
20+
affected-operation-location-migration-e2e: ${{ steps.affected.outputs.operation-location-migration-e2e }}
1921
steps:
2022
- name: Check out repository
2123
uses: actions/checkout@v4
@@ -37,14 +39,26 @@ jobs:
3739
run: |
3840
echo "typescript-resolver-files=$(./tools/ci/bin/check-affected.sh lib typescript-resolver-files origin/master)" >> $GITHUB_OUTPUT
3941
echo "typescript-resolver-files-e2e=$(./tools/ci/bin/check-affected.sh lib typescript-resolver-files-e2e origin/master)" >> $GITHUB_OUTPUT
42+
echo "operation-location-migration=$(./tools/ci/bin/check-affected.sh lib operation-location-migration origin/master)" >> $GITHUB_OUTPUT
43+
echo "operation-location-migration-e2e=$(./tools/ci/bin/check-affected.sh lib operation-location-migration-e2e origin/master)" >> $GITHUB_OUTPUT
4044
cat $GITHUB_OUTPUT
4145
4246
typescript-resolver-files:
4347
needs: precheck
4448
if: ${{ needs.precheck.outputs.affected-typescript-resolver-files == 'true' }}
45-
uses: ./.github/workflows/typescript-resolver-files.yml
49+
uses: ./.github/workflows/projects/typescript-resolver-files.yml
4650

4751
typescript-resolver-files-e2e:
4852
needs: precheck
4953
if: ${{ needs.precheck.outputs.affected-typescript-resolver-files == 'true' || needs.precheck.outputs.affected-typescript-resolver-files-e2e == 'true' }}
50-
uses: ./.github/workflows/typescript-resolver-files-e2e.yml
54+
uses: ./.github/workflows/projects/typescript-resolver-files-e2e.yml
55+
56+
operation-location-migration:
57+
needs: precheck
58+
if: ${{ needs.precheck.outputs.affected-operation-location-migration == 'true' }}
59+
uses: ./.github/workflows/projects/operation-location-migration.yml
60+
61+
operation-location-migration-e2e:
62+
needs: precheck
63+
if: ${{ needs.precheck.outputs.affected-operation-location-migration == 'true' || needs.precheck.outputs.affected-operation-location-migration-e2e == 'true' }}
64+
uses: ./.github/workflows/projects/operation-location-migration-e2e.yml
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
workflow_call:
3+
4+
env:
5+
node-version: '22.x'
6+
7+
jobs:
8+
operation-location-migration-e2e:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-22.04] # TODO: test with windows
12+
node-version: [18.x, 20.x, 22.x]
13+
runs-on: ${{ matrix.os }}
14+
defaults:
15+
run:
16+
shell: bash
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: yarn
28+
cache-dependency-path: '**/yarn.lock'
29+
30+
- name: Install deps
31+
run: yarn install --prefer-offline
32+
33+
- name: e2e
34+
run: yarn nx e2e operation-location-migration-e2e
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
workflow_call:
3+
4+
env:
5+
node-version: '22.x'
6+
7+
jobs:
8+
operation-location-migration:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-22.04, windows-latest]
12+
node-version: [18.x, 20.x, 22.x]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
cache: yarn
23+
cache-dependency-path: '**/yarn.lock'
24+
25+
- name: Install deps
26+
run: yarn install --prefer-offline
27+
28+
- name: Lint
29+
run: yarn nx lint operation-location-migration
30+
31+
- name: Test
32+
run: yarn nx test operation-location-migration
33+
34+
- name: Build
35+
run: yarn nx build operation-location-migration

.github/workflows/typescript-resolver-files-e2e.yml renamed to .github/workflows/projects/typescript-resolver-files-e2e.yml

File renamed without changes.
File renamed without changes.

nx.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
"{projectRoot}/package.json"
3737
]
3838
}
39+
},
40+
"@nx/js:swc": {
41+
"cache": true,
42+
"dependsOn": ["^build"],
43+
"inputs": ["production", "^production"]
3944
}
4045
},
4146
"namedInputs": {
@@ -57,5 +62,13 @@
5762
"workspaceLayout": {
5863
"appsDir": "packages",
5964
"libsDir": "packages"
60-
}
65+
},
66+
"plugins": [
67+
{
68+
"plugin": "@nx/eslint/plugin",
69+
"options": {
70+
"targetName": "eslint:lint"
71+
}
72+
}
73+
]
6174
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
"@eslint/eslintrc": "3.3.1",
1717
"@graphql-codegen/add": "5.0.3",
1818
"@graphql-codegen/cli": "5.0.4",
19+
"@graphql-codegen/near-operation-file-preset": "3.1.0",
1920
"@graphql-codegen/plugin-helpers": "5.1.0",
2021
"@graphql-codegen/schema-ast": "4.1.0",
2122
"@graphql-codegen/typescript": "4.1.3",
23+
"@graphql-codegen/typescript-react-apollo": "4.3.3",
2224
"@graphql-codegen/typescript-resolvers": "4.4.2",
2325
"@graphql-tools/merge": "9.0.4",
2426
"@nx/devkit": "21.3.1",
@@ -30,8 +32,10 @@
3032
"@nx/plugin": "21.3.1",
3133
"@nx/workspace": "21.3.1",
3234
"@swc-node/register": "1.9.2",
35+
"@swc/cli": "~0.6.0",
3336
"@swc/core": "1.5.7",
3437
"@swc/helpers": "0.5.12",
38+
"@swc/jest": "~0.2.38",
3539
"@types/jest": "30.0.0",
3640
"@types/micromatch": "4.0.6",
3741
"@types/node": "22.0.3",
@@ -50,6 +54,7 @@
5054
"ts-jest": "29.1.0",
5155
"ts-morph": "22.0.0",
5256
"ts-node": "10.9.1",
57+
"tsx": "4.20.3",
5358
"typescript": "5.8.3",
5459
"typescript-eslint": "8.37.0"
5560
},
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# operation-location-migration-e2e
2+
3+
```bash
4+
nx e2e operation-location-migration-e2e
5+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import baseConfig from '../../eslint.config.mjs';
2+
3+
export default [...baseConfig];

0 commit comments

Comments
 (0)