chore: rehaul DevX (#10571)

# Which Problems Are Solved

Replaces Turbo by Nx and lays the foundation for the next CI
improvements. It enables using Nx Cloud to speed the up the pipelines
that affect any node package.
It streamlines the dev experience for frontend and backend developers by
providing the following commands:

| Task | Command | Notes |
|------|---------|--------|
| **Production** | `nx run PROJECT:prod` | Production server |
| **Develop** | `nx run PROJECT:dev` | Hot reloading development server
|
| **Test** | `nx run PROJECT:test` | Run all tests |
| **Lint** | `nx run PROJECT:lint` | Check code style |
| **Lint Fix** | `nx run PROJECT:lint-fix` | Auto-fix style issues |

The following values can be used for PROJECT:

- @zitadel/zitadel (root commands)
- @zitadel/api,
- @zitadel/login,
- @zitadel/console,
- @zitadel/docs,
- @zitadel/client
- @zitadel/proto

The project names and folders are streamlined:

| Old Folder | New Folder |
| --- | --- |
| ./e2e | ./tests/functional-ui |
| ./load-test | ./benchmark |
| ./build/zitadel | ./apps/api |
| ./console | ./apps/console (postponed so the PR is reviewable) |

Also, all references to the TypeScript repo are removed so we can
archive it.

# How the Problems Are Solved

- Ran `npx nx@latest init`
- Replaced all turbo.json by project.json and fixed the target configs
- Removed Turbo dependency
- All JavaScript related code affected by a PRs changes is
quality-checked using the `nx affected` command
- We move PR checks that are runnable using Nx into the `check`
workflow. For workflows where we don't use Nx, yet, we restore
previously built dependency artifacts from Nx.
- We only use a single and easy to understand dev container
- The CONTRIBUTING.md is streamlined
- The setup with a generated client pat is orchestrated with Nx
- Everything related to the TypeScript repo is updated or removed. A
**Deploy with Vercel** button is added to the docs and the
CONTRIBUTING.md.

# Additional Changes

- NPM package names have a consistent pattern.
- Docker bake is removed. The login container is built and released like
the core container.
- The integration tests build the login container before running, so
they don't rely on the login container action anymore. This fixes
consistently failing checks on PRs from forks.
- The docs build in GitHub actions is removed, as we already build on
Vercel.

# Additional Context

- Internal discussion:
https://zitadel.slack.com/archives/C087ADF8LRX/p1756277884928169
- Workflow dispatch test:
https://github.com/zitadel/zitadel/actions/runs/17760122959

---------

Co-authored-by: Florian Forster <florian@zitadel.com>
Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit f69a6ed4f3)

# Conflicts:
#	.github/workflows/build.yml
#	.github/workflows/console.yml
#	.github/workflows/core.yml
#	CONTRIBUTING.md
#	Makefile
#	backend/v3/storage/database/events_testing/events_test.go
#	backend/v3/storage/database/events_testing/id_provider_instance_test.go
#	backend/v3/storage/database/events_testing/instance_test.go
#	console/README.md
#	console/package.json
#	internal/api/grpc/group/v2/integration_test/query_test.go
#	pnpm-lock.yaml
This commit is contained in:
Elio Bischof
2025-10-08 10:27:02 +02:00
committed by Livio Spring
parent 8a3b5848dc
commit 37acd2a9d9
232 changed files with 2311 additions and 36748 deletions

View File

@@ -1,4 +1,2 @@
src/proto
node_modules
dist
.turbo

View File

@@ -1,7 +1,6 @@
{
"packageManager": "pnpm@10.13.1",
"name": "@zitadel/client",
"version": "1.3.1",
"license": "MIT",
"publishConfig": {
"access": "public"
@@ -67,11 +66,10 @@
"sideEffects": false,
"scripts": {
"build": "tsup",
"lint": "pnpm run '/^lint:check:.*$/'",
"lint:check:eslint": "eslint 'src/**/*.ts*'",
"lint:check:knip": "knip",
"test:unit": "vitest --run",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
"lint-check-eslint": "eslint 'src/**/*.ts*'",
"lint-check-knip": "knip",
"test-unit": "vitest --run",
"clean": "rm -rf node_modules dist"
},
"dependencies": {
"@bufbuild/protobuf": "^2.2.2",

View File

@@ -0,0 +1,43 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"namedInputs": {
"sources": ["{projectRoot}/src/**/*"]
},
"targets": {
"test": {
"description": "Tests the TypeScript client library. It is an alias for test-unit.",
"dependsOn": [
"test-unit"
]
},
"lint": {
"description": "Runs all linters",
"dependsOn": [
"lint-*"
]
},
"lint-check-eslint": {
"description": "Checks code formatting with ESLint",
"inputs": [
"default"
],
"cache": true
},
"lint-check-knip": {
"description": "Checks for unused dependencies with knip",
"inputs": [
"default"
],
"cache": true
},
"build": {
"description": "Builds the TypeScript client library",
"inputs": [
"default",
"{workspaceRoot}/pnpm-lock.yaml"
],
"outputs": ["{projectRoot}/dist"],
"dependsOn": ["^generate"]
}
}
}

View File

@@ -1,9 +0,0 @@
{
"extends": ["//"],
"tasks": {
"build": {
"outputs": ["dist/**"],
"dependsOn": ["@zitadel/proto#generate"]
}
}
}

View File

@@ -1,6 +1,6 @@
node_modules
.turbo
.nx
*.log
.DS_Store
buf.gen.yaml
turbo.json
nx.json

View File

@@ -1,7 +1,6 @@
{
"packageManager": "pnpm@10.13.1",
"name": "@zitadel/proto",
"version": "1.3.1",
"license": "MIT",
"publishConfig": {
"access": "public"
@@ -79,7 +78,7 @@
"sideEffects": false,
"scripts": {
"generate": "buf generate ../../proto",
"clean": "rm -rf zitadel .turbo node_modules google protoc-gen-openapiv2 validate cjs types es"
"clean": "rm -rf zitadel node_modules google protoc-gen-openapiv2 validate cjs types es"
},
"dependencies": {
"@bufbuild/protobuf": "^2.6.1"

View File

@@ -0,0 +1,17 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"targets": {
"generate": {
"inputs": [
"default",
"{workspaceRoot}/pnpm-lock.yaml",
"{workspaceRoot}/proto/**/*"
],
"outputs": [
"{projectRoot}/cjs",
"{projectRoot}/es",
"{projectRoot}/types"
]
}
}
}

View File

@@ -1,16 +0,0 @@
{
"extends": ["//"],
"tasks": {
"generate": {
"outputs": [
"zitadel/**",
"google/**",
"validate/**",
"protoc-gen-openapiv2/**",
"cjs/**",
"es/**",
"types/**"
]
}
}
}