Upgrade Relay to v20.1.1 and unify compiler config

Consolidate the two per-app relay configs (console and trust)
into a single multi-project relay.config.json at the repo root
with three projects: core, iam, and trust. Bump all relay
packages from v19 to v20.1.1 and move relay-compiler to the
root devDependencies. Replace per-workspace relay scripts with
a single root-level npm run relay command and update the
GNUmakefile, CI workflows, and docs accordingly.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-14 15:59:11 +04:00
parent f08abf3be2
commit 74d7d3ff25
14 changed files with 82 additions and 91 deletions

View File

@@ -27,14 +27,13 @@ jobs:
with:
go: "false"
- run: "npm --workspace @probo/emails run build"
- run: "npm run relay"
- name: "Build console"
run: |
npm --workspace @probo/console run relay
npm --workspace @probo/console run check
NODE_ENV=production npm --workspace @probo/console run build
- name: "Build trust"
run: |
npm --workspace @probo/trust run relay
npm --workspace @probo/trust run check
NODE_ENV=production npm --workspace @probo/trust run build
- uses: "actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f" # v7
@@ -305,9 +304,7 @@ jobs:
go: "false"
- uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
- name: "Generate Relay artifacts"
run: |
npm --workspace @probo/console run relay
npm --workspace @probo/trust run relay
run: npm run relay
- name: "Run eslint"
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -24,14 +24,13 @@ jobs:
with:
go: "false"
- run: "npm --workspace @probo/emails run build"
- run: "npm run relay"
- name: "Build console"
run: |
npm --workspace @probo/console run relay
npm --workspace @probo/console run check
NODE_ENV=production npm --workspace @probo/console run build
- name: "Build trust"
run: |
npm --workspace @probo/trust run relay
npm --workspace @probo/trust run check
NODE_ENV=production npm --workspace @probo/trust run build
- uses: "actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f" # v7

View File

@@ -221,17 +221,19 @@ bin/probod-bootstrap:
@probo/emails:
$(NPM) --workspace $@ run build
.PHONY: relay
relay:
$(NPM) run relay
.PHONY: @probo/console
@probo/console: NODE_ENV=production
@probo/console:
$(NPM) --workspace $@ run relay
@probo/console: relay
$(NPM) --workspace $@ run check
$(NPM) --workspace $@ run build
.PHONY: @probo/trust
@probo/trust: NODE_ENV=production
@probo/trust:
$(NPM) --workspace $@ run relay
@probo/trust: relay
$(NPM) --workspace $@ run check
$(NPM) --workspace $@ run build
@@ -244,8 +246,7 @@ generate: pkg/server/api/connect/v1/schema/schema.go \
pkg/server/api/trust/v1/types/types.go \
pkg/server/api/mcp/v1/server/server.go \
pkg/server/api/mcp/v1/types/types.go
$(NPM) --workspace @probo/console run relay
$(NPM) --workspace @probo/trust run relay
$(NPM) run relay
pkg/server/api/connect/v1/schema/schema.go \
pkg/server/api/connect/v1/types/types.go \

View File

@@ -8,7 +8,7 @@ React 19 + Vite + TypeScript + Relay + TailwindCSS. Port 5173.
|---------|---------|
| `npm run dev` | Start dev server (port 5173) |
| `npm run build` | Production build |
| `npx relay-compiler` | Regenerate Relay artifacts |
| `npm run relay` (from repo root) | Regenerate Relay artifacts |
## Routes

View File

@@ -5,9 +5,6 @@
"type": "module",
"scripts": {
"dev": "vite --port 5173",
"relay-clean": "find src -type d -name \"__generated__\" -exec rm -rf {} +",
"relay-compile": "npx relay-compiler",
"relay": "npm run relay-clean && npm run relay-compile",
"build": "tsc -b && vite build",
"lint": "eslint . --concurrency 4",
"check": "tsc --noEmit -p tsconfig.app.json",
@@ -33,9 +30,9 @@
"react-error-boundary": "^6.0.0",
"react-hook-form": "^7.56.4",
"react-pdf": "^10.3.0",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.12.0",
"relay-runtime": "^19.0.0",
"relay-runtime": "^20.1.1",
"use-debounce": "^10.0.5",
"usehooks-ts": "^3.1.1",
"zod": "^3.25.17"
@@ -48,12 +45,11 @@
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@types/react-relay": "^18.2.1",
"@types/relay-runtime": "^19.0.1",
"@types/relay-runtime": "^20.1.1",
"@vitejs/plugin-react": "^5.1.4",
"babel-plugin-relay": "^19.0.0",
"babel-plugin-relay": "^20.1.1",
"eslint": "^9.39.2",
"graphql": "^16.11.0",
"relay-compiler": "^19.0.0",
"tailwindcss": "^4.1.7",
"typescript": "~5.8.3",
"vite": "^7.3.2"

View File

@@ -5,7 +5,6 @@
"type": "module",
"scripts": {
"dev": "vite --port 5174",
"relay": "find src -type d -name \"__generated__\" -exec rm -rf {} + && npx relay-compiler ./relay.config.json",
"build": "tsc -b && vite build",
"lint": "eslint . --concurrency 2",
"check": "tsc --noEmit -p tsconfig.app.json",
@@ -24,9 +23,9 @@
"react-error-boundary": "^6.0.0",
"react-hook-form": "^7.56.4",
"react-pdf": "^10.3.0",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.12.0",
"relay-runtime": "^19.0.0",
"relay-runtime": "^20.1.1",
"usehooks-ts": "^3.1.1",
"zod": "^3.25.71"
},
@@ -38,12 +37,11 @@
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@types/react-relay": "^18.2.1",
"@types/relay-runtime": "^19.0.1",
"@types/relay-runtime": "^20.1.1",
"@vitejs/plugin-react": "^5.1.4",
"babel-plugin-relay": "^19.0.0",
"babel-plugin-relay": "^20.1.1",
"eslint": "^9.39.2",
"graphql": "^16.11.0",
"relay-compiler": "^19.0.0",
"tailwindcss": "^4.1.7",
"typescript": "~5.8.3",
"vite": "^7.3.2"

View File

@@ -1,7 +0,0 @@
{
"src": "./src",
"schema": "../../pkg/server/api/trust/v1/schema.graphql",
"language": "typescript",
"eagerEsModules": true,
"noFutureProofEnums": true
}

View File

@@ -15,11 +15,11 @@ Configured in `apps/console/src/environments.ts`. Each has its own store with 1-
## Relay compiler
Config lives in `apps/console/relay.config.json` with two projects (`core`, `iam`) mapped to different source directories and schemas. Generated files go into `__generated__/` directories.
Config lives in `relay.config.json` at the repo root with three projects (`core`, `iam`, `trust`) mapped to different source directories and schemas. Generated files go into `__generated__/` directories.
```sh
npm run relay # clean + compile
npm run relay-compile # compile only
npm run relay # clean + compile (from repo root)
npm run relay-compile # compile only (from repo root)
```
Custom scalar mappings: `Datetime → string`, `GID → string`, `CursorKey → string`, `Duration → string`, `BigInt → number`, `EmailAddr → string`.

60
package-lock.json generated
View File

@@ -14,6 +14,7 @@
"react-dom": "^19.2.1"
},
"devDependencies": {
"relay-compiler": "^20.1.1",
"turbo": "^2.5.3"
},
"engines": {
@@ -44,9 +45,9 @@
"react-error-boundary": "^6.0.0",
"react-hook-form": "^7.56.4",
"react-pdf": "^10.3.0",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.12.0",
"relay-runtime": "^19.0.0",
"relay-runtime": "^20.1.1",
"use-debounce": "^10.0.5",
"usehooks-ts": "^3.1.1",
"zod": "^3.25.17"
@@ -59,12 +60,11 @@
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@types/react-relay": "^18.2.1",
"@types/relay-runtime": "^19.0.1",
"@types/relay-runtime": "^20.1.1",
"@vitejs/plugin-react": "^5.1.4",
"babel-plugin-relay": "^19.0.0",
"babel-plugin-relay": "^20.1.1",
"eslint": "^9.39.2",
"graphql": "^16.11.0",
"relay-compiler": "^19.0.0",
"tailwindcss": "^4.1.7",
"typescript": "~5.8.3",
"vite": "^7.3.2"
@@ -86,9 +86,9 @@
"react-error-boundary": "^6.0.0",
"react-hook-form": "^7.56.4",
"react-pdf": "^10.3.0",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.12.0",
"relay-runtime": "^19.0.0",
"relay-runtime": "^20.1.1",
"usehooks-ts": "^3.1.1",
"zod": "^3.25.71"
},
@@ -100,12 +100,11 @@
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@types/react-relay": "^18.2.1",
"@types/relay-runtime": "^19.0.1",
"@types/relay-runtime": "^20.1.1",
"@vitejs/plugin-react": "^5.1.4",
"babel-plugin-relay": "^19.0.0",
"babel-plugin-relay": "^20.1.1",
"eslint": "^9.39.2",
"graphql": "^16.11.0",
"relay-compiler": "^19.0.0",
"tailwindcss": "^4.1.7",
"typescript": "~5.8.3",
"vite": "^7.3.2"
@@ -6677,9 +6676,9 @@
}
},
"node_modules/@types/relay-runtime": {
"version": "19.0.3",
"resolved": "https://registry.npmjs.org/@types/relay-runtime/-/relay-runtime-19.0.3.tgz",
"integrity": "sha512-pvpWWQq5e9KeESF8klQaP2igLLhr2bRd3XxVCxNpGElsPQiP6Mejr59RT9/OGY3O3i8jAGGQsshVe0QCQDbxNg==",
"version": "20.1.1",
"resolved": "https://registry.npmjs.org/@types/relay-runtime/-/relay-runtime-20.1.1.tgz",
"integrity": "sha512-loM2iJteknnJcsxrynmBVb7pIDkSkJUuCMnAa/oDFcrvaxkDvq8iy0J2UshMdDy14iJJocDblXeAu7c6Q1+Ucw==",
"dev": true,
"license": "MIT"
},
@@ -7928,9 +7927,9 @@
}
},
"node_modules/babel-plugin-relay": {
"version": "19.0.0",
"resolved": "https://registry.npmjs.org/babel-plugin-relay/-/babel-plugin-relay-19.0.0.tgz",
"integrity": "sha512-7K0UnVyagSgzexy28KcEGu18/ms8wgJd2AufZshiKEaZXH/5XwtK2sh+6wKj/8U7xTGSudBuze39Se+CxSlxsw==",
"version": "20.1.1",
"resolved": "https://registry.npmjs.org/babel-plugin-relay/-/babel-plugin-relay-20.1.1.tgz",
"integrity": "sha512-BWlqLPiHbxZTxlyng2rVgsZCwztHNje7H8FR4c+UKy3ErQJBG6BKLr9vUdeR7mAZCH2v0sOAxNhG6zR1FrWjAg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -16474,16 +16473,16 @@
}
},
"node_modules/react-relay": {
"version": "19.0.0",
"resolved": "https://registry.npmjs.org/react-relay/-/react-relay-19.0.0.tgz",
"integrity": "sha512-OaUISVLUTjfBL1tGBtmt3eDZC+KFnP4QIHq0HDacm7ntiZPgAt+udYs3zapuc8hN65wlRruaLKrWc6P/ZQRlSg==",
"version": "20.1.1",
"resolved": "https://registry.npmjs.org/react-relay/-/react-relay-20.1.1.tgz",
"integrity": "sha512-pwl7wHHXCOx32dOg4TVNkhVojgGVvOBMo9pcMGeM1BIFYvmwGauKTtBB+qr5buXHGooCL8TXjMVg+ZLizIsbeQ==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.25.0",
"fbjs": "^3.0.2",
"invariant": "^2.2.4",
"nullthrows": "^1.1.1",
"relay-runtime": "19.0.0"
"relay-runtime": "20.1.1"
},
"peerDependencies": {
"react": "^16.9.0 || ^17 || ^18 || ^19"
@@ -16704,9 +16703,9 @@
}
},
"node_modules/relay-compiler": {
"version": "19.0.0",
"resolved": "https://registry.npmjs.org/relay-compiler/-/relay-compiler-19.0.0.tgz",
"integrity": "sha512-DwyNWPUkzdggT3oBuNTS18bL6KCU3Sg/oSW/q+pqOQNHLo+RUZOWAx44ALy5XoBrsXjQVBr0EiNqJ4A8G1skOw==",
"version": "20.1.1",
"resolved": "https://registry.npmjs.org/relay-compiler/-/relay-compiler-20.1.1.tgz",
"integrity": "sha512-J/FFFLS/3vnbDkyQMw8l3Ev7dNHXMgC1RAs0fITz4Q63TFPOw142knKxY1Mm5ZZBABkAs9g2JghXaqM+phwTxw==",
"dev": true,
"license": "MIT",
"bin": {
@@ -16714,9 +16713,9 @@
}
},
"node_modules/relay-runtime": {
"version": "19.0.0",
"resolved": "https://registry.npmjs.org/relay-runtime/-/relay-runtime-19.0.0.tgz",
"integrity": "sha512-uQqizN6d/7ZkTm2C0sTUAFfHk65BQEFLkfp0IBsXPTsXLL3fAJ2iHkemA621vuphtiKsF06C5ZKxypmC5lduFg==",
"version": "20.1.1",
"resolved": "https://registry.npmjs.org/relay-runtime/-/relay-runtime-20.1.1.tgz",
"integrity": "sha512-N98ZkkyuIHdXmHaPuljihM1QbFYXATF0gxA0CESFphszsQzXs9A/zZloVfzdOI/xg3B3CfM/5nozvIoeTDIcfw==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.25.0",
@@ -18187,7 +18186,6 @@
"os": [
"darwin"
],
"peer": true,
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
@@ -19706,9 +19704,9 @@
},
"peerDependencies": {
"react": "^19.2.1",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.10.0",
"relay-runtime": "^19.0.0"
"relay-runtime": "^20.1.1"
}
},
"packages/routes": {
@@ -19721,9 +19719,9 @@
},
"peerDependencies": {
"react": "^19.2.1",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.10.0",
"relay-runtime": "^19.0.0"
"relay-runtime": "^20.1.1"
}
},
"packages/tsconfig": {

View File

@@ -14,9 +14,12 @@
"dev": "turbo run dev",
"lint": "turbo run lint",
"check": "turbo run check",
"relay": "turbo run relay"
"relay-clean": "find apps -type d -name __generated__ -exec rm -rf {} +",
"relay-compile": "npx relay-compiler",
"relay": "npm run relay-clean && npm run relay-compile"
},
"devDependencies": {
"relay-compiler": "^20.1.1",
"turbo": "^2.5.3"
},
"graphql": {

View File

@@ -17,9 +17,9 @@
},
"peerDependencies": {
"react": "^19.2.1",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.10.0",
"relay-runtime": "^19.0.0"
"relay-runtime": "^20.1.1"
},
"dependencies": {
"graphql": "^16.12.0"

View File

@@ -16,8 +16,8 @@
},
"peerDependencies": {
"react": "^19.2.1",
"react-relay": "^19.0.0",
"react-relay": "^20.1.1",
"react-router": "^7.10.0",
"relay-runtime": "^19.0.0"
"relay-runtime": "^20.1.1"
}
}

View File

@@ -1,10 +1,29 @@
{
"root": "../..",
"root": ".",
"sources": {
"apps/console/src/pages/iam": "iam",
"apps/console/src": "core",
"apps/trust/src": "trust"
},
"projects": {
"core": {
"schema": "pkg/server/api/console/v1/schema.graphql",
"language": "typescript",
"noFutureProofEnums": true,
"output": "apps/console/src/__generated__/core",
"relativizeJsModulePaths": false,
"customScalarTypes": {
"Datetime": "string",
"GID": "string",
"CursorKey": "string",
"Duration": "string",
"BigInt": "number",
"EmailAddr": "string"
}
},
"iam": {
"schema": "pkg/server/api/connect/v1/schema.graphql",
"language": "typescript",
"eagerEsModules": true,
"noFutureProofEnums": true,
"output": "apps/console/src/__generated__/iam",
"relativizeJsModulePaths": false,
@@ -17,25 +36,15 @@
"EmailAddr": "string"
}
},
"core": {
"schema": "pkg/server/api/console/v1/schema.graphql",
"trust": {
"schema": "pkg/server/api/trust/v1/schema.graphql",
"language": "typescript",
"eagerEsModules": true,
"noFutureProofEnums": true,
"output": "apps/console/src/__generated__/core",
"relativizeJsModulePaths": false,
"customScalarTypes": {
"Datetime": "string",
"GID": "string",
"CursorKey": "string",
"Duration": "string",
"BigInt": "number",
"EmailAddr": "string"
}
}
},
"sources": {
"apps/console/src/pages/iam": "iam",
"apps/console/src": "core"
}
}

View File

@@ -16,9 +16,6 @@
"dev": {
"cache": false,
"persistent": true
},
"relay": {
"cache": false
}
}
}