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 <[email protected]>
Co-authored-by: Tim Möhlmann <[email protected]>
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Elio Bischof
2025-10-08 10:27:02 +02:00
committed by GitHub
co-authored by Florian Forster Tim Möhlmann Copilot
parent e47acaeef2
commit f69a6ed4f3
236 changed files with 5708 additions and 6549 deletions
+12 -59
View File
@@ -2,44 +2,30 @@
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
The documentation is part of the ZITADEL monorepo and uses **pnpm** and **Turbo** for development and build processes.
The documentation is part of the ZITADEL monorepo and uses **pnpm** and **Nx** for development and build processes.
## Quick Start
Run the following commands from the repositorys root directory to install all dependencies needed.
Using Corepack makes sure you have the pnpm version intalled that is declared in [](../package.json).
```bash
# From the repository root
corepack enable
pnpm install
# Start development server (with Turbo)
pnpm turbo dev --filter=zitadel-docs
# Or start directly from docs directory
cd docs && pnpm start
```
The site will be available at http://localhost:3000
## Available Scripts
All scripts can be run from the repository root using Turbo:
Start a docs server
```bash
# Development server with live reload
pnpm turbo dev --filter=zitadel-docs
# Start development server with live-reloading
pnpm nx run @zitadel/docs:dev
# Build for production
pnpm turbo build --filter=zitadel-docs
# Generate API documentation and configuration docs
pnpm turbo generate --filter=zitadel-docs
# Lint and fix code
pnpm turbo lint --filter=zitadel-docs
# Serve production build locally
cd docs && pnpm serve
# Or serve a production build
pnpm nx run @zitadel/docs:start
```
The site will be available at http://localhost:3100
## Add new Sites to existing Topics
To add a new site to the already existing structure simply save the `md` file into the corresponding folder and append the sites id int the file `sidebars.js`.
@@ -55,36 +41,3 @@ The documentation build process automatically:
3. **Generates API documentation** - Creates OpenAPI specification docs
4. **Copies configuration files** - Includes configuration examples
5. **Builds the Docusaurus site** - Generates the final static site
## Local Development
### Standard Development
```bash
# Install dependencies
pnpm install
# Start development server
pnpm start
```
### API Documentation Development
When working on the API docs, run a local development server with:
```bash
pnpm start:api
```
## Container Image
If you just want to start docusaurus locally without installing node you can fallback to our container image.
Execute the following commands from the repository root to build and start a local version of ZITADEL
```shell
docker build -f docs/Dockerfile . -t zitadel-docs
```
```shell
docker run -p 8080:8080 zitadel-docs
```
@@ -106,7 +106,7 @@ services:
db:
restart: unless-stopped
image: postgres:17-alpine
image: postgres:17
environment:
PGUSER: postgres
POSTGRES_PASSWORD: postgres
+10 -15
View File
@@ -1,29 +1,24 @@
{
"name": "zitadel-docs",
"version": "0.0.0",
"name": "@zitadel/docs",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"dev": "docusaurus start",
"start": "docusaurus start",
"start:api": "pnpm run generate && docusaurus start",
"build": "pnpm run ensure-plugins && pnpm run generate && docusaurus build",
"dev": "docusaurus start --port 3100",
"prod": "docusaurus serve --port 3100",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"ensure-plugins": "if [ ! -f \"protoc-gen-connect-openapi/protoc-gen-connect-openapi\" ]; then sh ./plugin-download.sh; fi",
"debug-plugins": "echo \"PWD: $(pwd)\" && echo \"Plugin file exists: $(test -f protoc-gen-connect-openapi/protoc-gen-connect-openapi && echo 'yes' || echo 'no')\" && echo \"Plugin executable: $(test -x protoc-gen-connect-openapi/protoc-gen-connect-openapi && echo 'yes' || echo 'no')\" && ls -la protoc-gen-connect-openapi/ || echo 'Plugin directory not found'",
"generate": "pnpm run generate:grpc && pnpm run generate:apidocs && pnpm run generate:configdocs",
"generate:grpc": "pnpm run ensure-plugins && buf generate ../proto",
"generate:apidocs": "docusaurus gen-api-docs all",
"generate:configdocs": "cp -r ../cmd/defaults.yaml ./docs/self-hosting/manage/configure/ && cp -r ../cmd/setup/steps.yaml ./docs/self-hosting/manage/configure/",
"generate:re-gen": "yarn generate:clean-all && pnpm generate",
"generate:clean-all": "docusaurus clean-api-docs all",
"generate-grpc": "buf generate ../proto",
"generate-apidocs": "docusaurus gen-api-docs all",
"generate-configdocs": "cp -r ../cmd/defaults.yaml ../cmd/setup/steps.yaml ./docs/self-hosting/manage/configure/",
"generate-re-gen": "yarn generate:clean-all && pnpm generate",
"generate-clean-all": "docusaurus clean-api-docs all",
"postinstall": "sh ./plugin-download.sh",
"clean": "rm -rf node_modules .artifacts .docusaurus .turbo protoc-gen-connect-openapi docs/apis/resources"
"clean": "rm -rf node_modules .artifacts .docusaurus protoc-gen-connect-openapi docs/apis/resources"
},
"dependencies": {
"@bufbuild/buf": "^1.14.0",
+75
View File
@@ -0,0 +1,75 @@
{
"$schema": "../node_modules/nx/schemas/project-schema.json",
"targets": {
"ensure-plugins": {
"description": "Downloads the connectRPC plugin to generate OpenAPI documentation from protobuf definitions",
"inputs": [
"{projectRoot}/plugin-download.sh"
],
"outputs": [
"{projectRoot}/protoc-gen-connect-openapi/protoc-gen-connect-openapi"
],
"cache": true
},
"generate-grpc": {
"description": "Generates OpenAPI specifications from protobuf definitions for API endpoints",
"dependsOn": [
"ensure-plugins"
],
"outputs": [
"{projectRoot}/.artifacts/openapi",
"{projectRoot}/.artifacts/openapi3"
],
"cache": true
},
"generate-apidocs": {
"description": "Generates API documentation from OpenAPI specifications for API endpoints",
"dependsOn": [
"generate-grpc"
],
"outputs": [
"{projectRoot}/docs/api"
],
"cache": true
},
"generate-configdocs": {
"description": "Copies default configuration files and setup steps to the documentation site",
"inputs": [
"{workspaceRoot}/cmd/defaults.yaml",
"{workspaceRoot}/cmd/setup/steps.yaml"
],
"outputs": [
"{projectRoot}/docs/self-hosting/manage/configure/defaults.yaml",
"{projectRoot}/docs/self-hosting/manage/configure/steps.yaml"
],
"cache": true
},
"generate": {
"description": "Runs all documentation generation targets",
"dependsOn": [
"generate-apidocs",
"generate-configdocs"
]
},
"build": {
"description": "Builds the documentation site using Docusaurus",
"outputs": [
"{projectRoot}/build"
]
},
"prod": {
"description": "Runs the documentation site in production mode",
"continuous": true,
"dependsOn": [
"build"
]
},
"dev": {
"description": "Runs the documentation site in development mode with hot-reloading",
"continuous": true,
"dependsOn": [
"generate"
]
}
}
}
-45
View File
@@ -1,45 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"generate": {
"dependsOn": ["^generate"],
"outputs": ["docs/api/**", "docs/self-hosting/manage/configure/*.yaml"],
"cache": true
},
"generate:grpc": {
"dependsOn": ["^generate"],
"outputs": ["docs/api/**"],
"cache": true
},
"generate:apidocs": {
"dependsOn": ["generate:grpc"],
"outputs": ["docs/api/**"],
"cache": true
},
"generate:configdocs": {
"outputs": ["docs/self-hosting/manage/configure/*.yaml"],
"cache": true
},
"build": {
"dependsOn": ["generate"],
"outputs": ["build/**"],
"cache": true
},
"dev": {
"dependsOn": ["generate"],
"cache": false,
"persistent": true
},
"start": {
"dependsOn": ["generate"],
"cache": false,
"persistent": true
},
"start:api": {
"dependsOn": ["generate"],
"cache": false,
"persistent": true
}
}
}
+2
View File
@@ -1,4 +1,6 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"buildCommand": "pnpm nx run @zitadel/docs:build",
"github": {
"enabled": true
},