mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-29 05:16:34 +00:00
# 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
156 lines
4.5 KiB
JSON
156 lines
4.5 KiB
JSON
{
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"targets": {
|
|
"prod": {
|
|
"description": "Runs the Next.js Login application in production mode from the standalone build",
|
|
"continuous": true,
|
|
"dependsOn": [
|
|
"build"
|
|
],
|
|
"defaultConfiguration": "default",
|
|
"configurations": {
|
|
"default": {},
|
|
"test-login-integration": {}
|
|
}
|
|
},
|
|
"dev": {
|
|
"description": "Runs the Next.js Login application in development mode with hot-reloading",
|
|
"continuous": true,
|
|
"dependsOn": [
|
|
"^build"
|
|
]
|
|
},
|
|
"build": {
|
|
"description": "Builds the Next.js Login application in standalone mode for production",
|
|
"cache": true,
|
|
"dependsOn": [
|
|
"^build"
|
|
],
|
|
"inputs": [
|
|
"default",
|
|
"{workspaceRoot}/pnpm-lock.yaml",
|
|
"!{projectRoot}/.env.*",
|
|
"!{projectRoot}/.local.env",
|
|
"!{projectRoot}/integration/**/*",
|
|
"!{projectRoot}/acceptance/**/*",
|
|
"!{projectRoot}/cypress.config.ts"
|
|
],
|
|
"outputs": [
|
|
"{projectRoot}/.next/standalone"
|
|
]
|
|
},
|
|
"build-vercel": {
|
|
"description": "Builds the Next.js Login application for Vercel deployment",
|
|
"cache": true,
|
|
"dependsOn": [
|
|
"^build"
|
|
],
|
|
"inputs": [
|
|
"default",
|
|
"{workspaceRoot}/pnpm-lock.yaml",
|
|
"!{projectRoot}/.env.*",
|
|
"!{projectRoot}/.local.env",
|
|
"!{projectRoot}/integration/**/*",
|
|
"!{projectRoot}/acceptance/**/*",
|
|
"!{projectRoot}/cypress.config.ts"
|
|
],
|
|
"outputs": [
|
|
"{projectRoot}/.next",
|
|
"!{projectRoot}/.next/cache",
|
|
"!{projectRoot}/.next/standalone"
|
|
]
|
|
},
|
|
"lint": {
|
|
"description": "Runs all linters",
|
|
"dependsOn": [
|
|
"lint-check-*"
|
|
]
|
|
},
|
|
"lint-check-prettier": {
|
|
"description": "Checks code formatting with Prettier",
|
|
"cache": true,
|
|
"inputs": [
|
|
"default"
|
|
]
|
|
},
|
|
"lint-check-next": {
|
|
"description": "Runs Next.js specific lint checks",
|
|
"cache": true,
|
|
"inputs": [
|
|
"default"
|
|
]
|
|
},
|
|
"test": {
|
|
"description": "Runs all tests (unit and integration)",
|
|
"dependsOn": [
|
|
"test-unit",
|
|
"test-integration"
|
|
]
|
|
},
|
|
"test-unit": {
|
|
"description": "Runs unit tests using Vitest",
|
|
"dependsOn": [
|
|
"^build"
|
|
]
|
|
},
|
|
"test-integration-run-login": {
|
|
"description": "Runs the Login application under test. It has its own target, separate from test-integration, because it's a continuous task.",
|
|
"dependsOn": [
|
|
"build"
|
|
],
|
|
"continuous": true,
|
|
"command": "nx run @zitadel/login:prod:test-login-integration --excludeTaskDependencies"
|
|
},
|
|
"test-integration": {
|
|
"description": "Runs integration tests using Cypress against a running Login and a mocked API",
|
|
"dependsOn": [
|
|
"test-integration-run-login",
|
|
"@zitadel/login-api-mock:build",
|
|
"@zitadel/login-api-mock:serve"
|
|
],
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "{projectRoot}",
|
|
"parallel": false,
|
|
"commands": [
|
|
"pnpm cypress install",
|
|
"pnpm wait-on --verbose --interval 2000 --simultaneous 1 --timeout 30m \"tcp:${API_MOCK_STUBS_HOST}:22220\" \"http-get://localhost:3001/ui/v2/login/verify?userId=221394658884845598&code=abc\"",
|
|
"DISPLAY='' pnpm cypress run --headless",
|
|
"nx run @zitadel/login:test-integration-stop"
|
|
]
|
|
},
|
|
"inputs": [
|
|
"default",
|
|
"{workspaceRoot}/pnpm-lock.yaml",
|
|
"!{projectRoot}/acceptance/**/*",
|
|
{ "env": "LOGIN_BASE_URL" }
|
|
]
|
|
},
|
|
"test-integration-stop": {
|
|
"description": "Stops the gRPC mock container used for integration tests.",
|
|
"command": "nx run @zitadel/login-api-mock:down"
|
|
},
|
|
"pack": {
|
|
"description": "Packages the standalone Login application build into an archive",
|
|
"dependsOn": [
|
|
"build"
|
|
],
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"parallel": false,
|
|
"env": {
|
|
"STANDALONE_DIR": "{projectRoot}/.next/standalone",
|
|
"PACK_DIR": "{workspaceRoot}/.artifacts/pack"
|
|
},
|
|
"commands": [
|
|
"mkdir -p ${PACK_DIR}",
|
|
"tar -czvf ${PACK_DIR}/zitadel-login-standalone.tar.gz -C ${STANDALONE_DIR} ."
|
|
]
|
|
},
|
|
"cache": true,
|
|
"outputs": [
|
|
"{workspaceRoot}/.artifacts/pack/zitadel-login-*.tar.gz"
|
|
]
|
|
}
|
|
}
|
|
} |