mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:17:35 +00:00
chore: 🚀 Migrate monorepo from Yarn to pnpm + Turbo integration + Configuration cleanup (#10165)
This PR modernizes the ZITADEL monorepo build system by migrating from Yarn to pnpm, introducing Turbo for improved build orchestration, and cleaning up configuration inconsistencies across all apps and packages. ### 🎯 Key Improvements #### 📦 **Package Manager Migration (Yarn → pnpm)** - **Performance**: Faster installs with pnpm's efficient symlink-based node_modules structure - **Disk space**: Significant reduction in disk usage through content-addressable storage - **Lockfile**: More reliable dependency resolution with pnpm-lock.yaml - **Workspace support**: Better monorepo dependency management #### ⚡ **Turbo Integration** - **Build orchestration**: Dependency-aware task execution across the monorepo - **Intelligent caching**: Dramatically faster builds on CI/CD and local development - **Parallel execution**: Optimal task scheduling based on dependency graphs - **Vercel optimization**: Enhanced build performance and caching on Vercel deployments #### 🧹 **Configuration Cleanup & Unification** - **Removed config packages**: Eliminated `@zitadel/*-config` packages and inlined configurations - **Simplified dependencies**: Reduced complexity in package.json files across all apps - **Consistent tooling**: Unified prettier, ESLint, and TypeScript configurations - **Standalone support**: Improved prepare-standalone.js script for subtree deployments ### 📋 Detailed Changes #### **🔧 Build System & Dependencies** - ✅ Updated all package.json scripts to use `pnpm` instead of `yarn` - ✅ Replaced `yarn.lock` with pnpm-lock.yaml and regenerated dependencies - ✅ Added Turbo configuration (turbo.json) to root and individual packages - ✅ Configured proper dependency chains: `@zitadel/proto#generate` → `@zitadel/client#build` → `console#build` - ✅ Added missing `@bufbuild/protobuf` dependency to console app for TypeScript compilation #### **🚀 CI/CD & Workflows** - ✅ Updated all GitHub Actions workflows to use `pnpm/action-setup@v4` - ✅ Migrated build processes to use Turbo with directory-based filters (`--filter=./console`) - ✅ **New**: Added `docs.yml` workflow for building documentation locally (helpful for contributors without Vercel access) - ✅ Fixed dependency resolution issues in lint workflows - ✅ Ensured proto generation always runs before builds and linting #### **📚 Documentation & Proto Generation** - ✅ **Robust plugin management**: Enhanced plugin-download.sh with retry logic and error handling - ✅ **Vercel compatibility**: Fixed protoc-gen-connect-openapi plugin availability in Vercel builds - ✅ **API docs generation**: Resolved Docusaurus build errors with OpenAPI plugin configuration - ✅ **Type safety**: Improved TypeScript type extraction patterns in Angular components #### **🛠️ Developer Experience** - ✅ Updated all README files to reference pnpm commands - ✅ Improved Makefile targets to use Turbo for consistent builds - ✅ Enhanced standalone build process for login app subtree deployments - ✅ Added debug utilities for troubleshooting build issues #### **🗂️ File Structure & Cleanup** - ✅ Removed obsolete configuration packages and their references - ✅ Cleaned up Docker files to remove non-existent package copies - ✅ Updated workspace references and import paths - ✅ Streamlined turbo.json configurations across all packages ### 🎉 Benefits 1. **⚡ Faster Builds**: Turbo's caching and parallel execution significantly reduce build times 2. **🔄 Better Caching**: Improved cache hits on Vercel and CI/CD environments 3. **🛠️ Simplified Maintenance**: Unified tooling and configuration management 4. **📈 Developer Productivity**: Faster local development with optimized dependency resolution 5. **🚀 Enhanced CI/CD**: More reliable and faster automated builds and deployments 6. **📖 Better Documentation**: Comprehensive build documentation and troubleshooting guides ### 🧪 Testing - ✅ All apps build successfully with new pnpm + Turbo setup - ✅ Proto generation works correctly across console, login, and docs - ✅ GitHub Actions workflows pass with new configuration - ✅ Vercel deployments work with enhanced plugin management - ✅ Local development workflow verified and documented This migration sets a solid foundation for future development while maintaining backward compatibility and improving the overall developer experience. --------- Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
@@ -2,45 +2,84 @@
|
||||
|
||||
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.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# From the repository root
|
||||
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:
|
||||
|
||||
```bash
|
||||
# Development server with live reload
|
||||
pnpm turbo dev --filter=zitadel-docs
|
||||
|
||||
# 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
|
||||
```
|
||||
|
||||
## 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`.
|
||||
|
||||
If you are introducing new APIs (gRPC), you need to add a new entry to `docusaurus.config.js` under the `plugins` section.
|
||||
|
||||
## Installation
|
||||
## Build Process
|
||||
|
||||
Install dependencies with
|
||||
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
then run
|
||||
|
||||
```
|
||||
yarn generate
|
||||
```
|
||||
The documentation build process automatically:
|
||||
|
||||
1. **Downloads required protoc plugins** - Ensures `protoc-gen-connect-openapi` is available
|
||||
2. **Generates gRPC documentation** - Creates API docs from proto files
|
||||
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
|
||||
|
||||
Start a local development server with
|
||||
### Standard Development
|
||||
|
||||
```
|
||||
yarn start
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Start development server
|
||||
pnpm start
|
||||
```
|
||||
|
||||
When working on the API docs, run a local development server with
|
||||
### API Documentation Development
|
||||
|
||||
```
|
||||
yarn start:api
|
||||
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
|
||||
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
|
||||
|
Reference in New Issue
Block a user