chore: pnpm, local generate, turbo everything

This commit is contained in:
Max Peintner
2025-07-03 15:33:53 +02:00
parent 8c39779533
commit 2fe151da6c
22 changed files with 31968 additions and 26337 deletions

View File

@@ -1,6 +1,6 @@
name: Build console
on:
on:
workflow_call:
inputs:
node_version:
@@ -13,7 +13,7 @@ on:
cache_key:
value: ${{ jobs.build.outputs.cache_key }}
cache_path:
value: ${{ jobs.build.outputs.cache_path }}
value: ${{ jobs.build.outputs.cache_path }}
env:
cache_path: console/dist/console
@@ -25,38 +25,31 @@ jobs:
cache_path: ${{ env.cache_path }}
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
uses: actions/cache/restore@v4
timeout-minutes: 1
continue-on-error: true
id: cache
with:
key: console-${{ hashFiles('console', 'proto', '!console/dist') }}
restore-keys: |
console-
path: ${{ env.cache_path }}
-
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
version: ${{ inputs.buf_version }}
-
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: 'yarn'
cache-dependency-path: console/yarn.lock
-
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: make console_build
-
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ${{ env.cache_path }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
timeout-minutes: 1
continue-on-error: true
id: cache
with:
key: console-${{ hashFiles('console', 'proto', '!console/dist') }}
restore-keys: |
console-
path: ${{ env.cache_path }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
version: ${{ inputs.buf_version }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: make console_build
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ${{ env.cache_path }}
key: ${{ steps.cache.outputs.cache-primary-key }}

View File

@@ -20,7 +20,6 @@ on:
type: string
jobs:
lint-skip:
name: lint skip
runs-on: ubuntu-latest
@@ -36,64 +35,52 @@ jobs:
continue-on-error: true
if: ${{ github.event_name == 'pull_request' }}
steps:
-
uses: actions/checkout@v4
-
uses: bufbuild/buf-setup-action@v1
with:
version: ${{ inputs.buf_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: lint
uses: bufbuild/buf-lint-action@v1
-
uses: bufbuild/buf-breaking-action@v1
with:
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.base_ref }}"
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1
with:
version: ${{ inputs.buf_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: lint
uses: bufbuild/buf-lint-action@v1
- uses: bufbuild/buf-breaking-action@v1
with:
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.base_ref }}"
console:
if: ${{ github.event_name == 'pull_request' }}
name: console
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: 'yarn'
cache-dependency-path: console/yarn.lock
-
run: cd console && yarn install
-
name: lint
run: make console_lint
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- run: corepack enable pnpm && pnpm install --filter=console
- name: lint
run: make console_lint
core:
name: core
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
-
uses: actions/cache/restore@v4
timeout-minutes: 1
name: restore core
with:
path: ${{ inputs.core_cache_path }}
key: ${{ inputs.core_cache_key }}
fail-on-cache-miss: true
-
uses: golangci/golangci-lint-action@v6
with:
version: ${{ inputs.go_lint_version }}
github-token: ${{ github.token }}
only-new-issues: true
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- uses: actions/cache/restore@v4
timeout-minutes: 1
name: restore core
with:
path: ${{ inputs.core_cache_path }}
key: ${{ inputs.core_cache_key }}
fail-on-cache-miss: true
- uses: golangci/golangci-lint-action@v6
with:
version: ${{ inputs.go_lint_version }}
github-token: ${{ github.token }}
only-new-issues: true

6
.gitignore vendored
View File

@@ -83,7 +83,11 @@ go.work.sum
.netlify
load-test/node_modules
load-test/yarn-error.log
load-test/pnpm-debug.log
load-test/dist
load-test/output/*
.vercel
# Turbo
.turbo/
**/.turbo/

2
.npmrc Normal file
View File

@@ -0,0 +1,2 @@
auto-install-peers = true
ignore-scripts = "postman-code-generators"

View File

@@ -304,7 +304,7 @@ Using [Docker Compose](https://docs.docker.com/compose/), you run [PostgreSQL](h
You use the ZITADEL container as backend for your console.
The console is run in your [Node](https://nodejs.org/en/about/) environment using [a local development server for Angular](https://angular.io/cli/serve#ng-serve), so you have fast feedback about your changes.
We use angular-eslint/Prettier for linting/formatting, so please run `yarn lint:fix` before committing. (VSCode users, check out [this ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [this Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to fix lint and formatting issues in development)
We use angular-eslint/Prettier for linting/formatting, so please run `pnpm lint:fix` before committing. (VSCode users, check out [this ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [this Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to fix lint and formatting issues in development)
Once you are happy with your changes, you run end-to-end tests and tear everything down.
@@ -352,16 +352,16 @@ You can run the local console development server now.
```bash
# Install npm dependencies
yarn install
pnpm install
# Generate source files from Protos
yarn generate
pnpm generate
# Start the server
yarn start
pnpm start
# If you don't want to develop against http://localhost:8080, you can use another environment
ENVIRONMENT_JSON_URL=https://my-cloud-instance-abcdef.zitadel.cloud/ui/console/assets/environment.json yarn start
ENVIRONMENT_JSON_URL=https://my-cloud-instance-abcdef.zitadel.cloud/ui/console/assets/environment.json pnpm start
```
Navigate to http://localhost:4200/.
@@ -371,7 +371,7 @@ Open another shell.
```bash
# Reformat your console code
yarn lint:fix
pnpm lint:fix
# Change to the e2e directory
cd .. && cd e2e/
@@ -449,7 +449,8 @@ You may edit the texts in these files or create a new file for additional langua
Please make sure that the languages within the files remain in their own language, e.g. German must always be `Deutsch.
If you have added support for a new language, please also ensure that it is added in the list of languages in all the other language files.
You also have to add some changes to the following files:
You also have to add some changes to the following files:
- [Register Local File](./console/src/app/app.module.ts)
- [Add Supported Language](./console/src/app/utils/language.ts)
- [Customized Text Docs](./docs/docs/guides/manage/customize/texts.md)

View File

@@ -96,18 +96,17 @@ console_move:
.PHONY: console_dependencies
console_dependencies:
cd console && \
yarn install --immutable
pnpm install
.PHONY: console_client
console_client:
cd console && \
yarn generate
pnpm generate
.PHONY: console_build
console_build: console_dependencies console_client
cd console && \
yarn build
pnpm build
.PHONY: clean
clean:
@@ -166,7 +165,7 @@ core_integration_test: core_integration_server_start core_integration_test_packa
.PHONY: console_lint
console_lint:
cd console && \
yarn lint
pnpm lint
.PHONY: core_lint
core_lint:

View File

@@ -107,10 +107,11 @@ FROM node:20-buster AS console-deps
WORKDIR /zitadel/console
COPY console/package.json .
COPY console/yarn.lock .
COPY pnpm-lock.yaml .
COPY pnpm-workspace.yaml .
COPY console/package.json console/
RUN yarn install --frozen-lockfile
RUN corepack enable pnpm && pnpm install --frozen-lockfile --filter=console
# #######################################
# generate console client
@@ -127,7 +128,7 @@ COPY console/package.json .
COPY console/buf.*.yaml .
COPY proto ../proto
RUN yarn generate
RUN pnpm generate
# #######################################
# Gather all console files
@@ -145,7 +146,7 @@ COPY console/tsconfig* .
# Build console
# #######################################
FROM console-gathered AS console
RUN yarn build
RUN pnpm build
# ##############################################################################
# build the executable
@@ -264,7 +265,7 @@ FROM console-gathered AS lint-console
COPY console/.eslintrc.js .
COPY console/.prettier* .
RUN yarn lint
RUN pnpm lint
# #######################################
# core

2
console/.gitignore vendored
View File

@@ -36,7 +36,7 @@ speed-measure-plugin*.json
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
pnpm-debug.log
testem.log
/typings

View File

@@ -5,7 +5,7 @@
"ng": "ng",
"start": "node prebuild.development.js && ng serve",
"build": "ng build --configuration production --base-href=/ui/console/",
"prelint": "npm run generate",
"prelint": "pnpm run generate",
"lint": "ng lint && prettier --check src",
"lint:fix": "prettier --write src",
"generate": "buf generate ../proto --include-imports --include-wkt"
@@ -31,8 +31,8 @@
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-brands-svg-icons": "^6.7.2",
"@ngx-translate/core": "^15.0.0",
"@zitadel/client": "1.2.0",
"@zitadel/proto": "1.2.0",
"@zitadel/client": "workspace:*",
"@zitadel/proto": "workspace:*",
"angular-oauth2-oidc": "^15.0.1",
"angularx-qrcode": "^16.0.2",
"buffer": "^6.0.3",

File diff suppressed because it is too large Load Diff

3
docs/.gitignore vendored
View File

@@ -24,6 +24,5 @@ docs/apis/resources
package-lock.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.vercel

View File

@@ -13,34 +13,33 @@ If you are introducing new APIs (gRPC), you need to add a new entry to `docusaur
Install dependencies with
```
yarn install
pnpm install
```
then run
then run
```
yarn generate
pnpm generate
```
## Local Development
Start a local development server with
```
yarn start
pnpm start
```
When working on the API docs, run a local development server with
When working on the API docs, run a local development server with
```
yarn start:api
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

View File

@@ -5,19 +5,19 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"start:api": "yarn run generate && docusaurus start",
"build": "yarn run generate && docusaurus build",
"start:api": "pnpm run generate && docusaurus start",
"build": "pnpm run generate && 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",
"generate": "yarn run generate:grpc && yarn run generate:apidocs && yarn run generate:configdocs",
"generate": "pnpm run generate:grpc && pnpm run generate:apidocs && pnpm run generate:configdocs",
"generate:grpc": "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 && yarn generate",
"generate:re-gen": "pnpm generate:clean-all && pnpm generate",
"generate:clean-all": "docusaurus clean-api-docs all"
},
"dependencies": {
@@ -62,5 +62,5 @@
"@docusaurus/types": "^3.8.1",
"tailwindcss": "^3.2.4"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -30,11 +30,6 @@
"version-packages": "pnpm exec changeset version",
"release": "pnpm exec turbo run build --filter=login^... && pnpm exec changeset publish"
},
"pnpm": {
"overrides": {
"@typescript-eslint/parser": "^7.9.0"
}
},
"devDependencies": {
"@changesets/cli": "^2.29.2",
"@vitejs/plugin-react": "^4.4.1",

View File

@@ -14,7 +14,7 @@
],
"sideEffects": false,
"scripts": {
"generate": "pnpm exec buf generate https://github.com/zitadel/zitadel.git --path ./proto/zitadel",
"generate": "pnpm exec buf generate ../../../proto --path ../../../proto/zitadel",
"clean": "rm -rf zitadel .turbo node_modules google protoc-gen-openapiv2 validate"
},
"dependencies": {

View File

@@ -1,51 +1,12 @@
{
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"globalDependencies": ["**/.env.*local"],
"globalEnv": [
"DEBUG",
"VERCEL_URL",
"EMAIL_VERIFICATION",
"AUDIENCE",
"SYSTEM_USER_ID",
"SYSTEM_USER_PRIVATE_KEY",
"ZITADEL_API_URL",
"ZITADEL_SERVICE_USER_TOKEN",
"NEXT_PUBLIC_BASE_PATH",
"CUSTOM_REQUEST_HEADERS",
"NODE_ENV"
],
"extends": ["//"],
"tasks": {
"generate": {
"cache": true
},
"build": {},
"build:login:standalone": {},
"build:client:standalone": {},
"test": {},
"start": {},
"start:built": {},
"test:unit": {},
"test:unit:standalone": {},
"test:integration": {},
"test:integration:setup": {
"with": ["dev"]
},
"test:acceptance:setup": {},
"test:acceptance:setup:dev": {
"with": ["dev"]
},
"test:watch": {
"persistent": true
},
"lint": {},
"lint:fix": {},
"dev": {
"cache": false,
"persistent": true
},
"clean": {
"cache": false
}
}
}

59
package.json Normal file
View File

@@ -0,0 +1,59 @@
{
"packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7",
"private": true,
"name": "zitadel-monorepo",
"scripts": {
"generate": "pnpm exec turbo run generate",
"build": "pnpm exec turbo run build",
"build:client:standalone": "pnpm exec turbo run build:client:standalone",
"build:login:standalone": "pnpm exec turbo run build:login:standalone",
"build:packages": "pnpm exec turbo run build --filter=./login/packages/*",
"build:apps": "pnpm exec turbo run build --filter=./login/apps/*",
"build:console": "pnpm exec turbo run build --filter=console",
"test": "pnpm exec turbo run test",
"start": "pnpm exec turbo run start",
"start:built": "pnpm exec turbo run start:built",
"test:unit": "pnpm exec turbo run test:unit -- --passWithNoTests",
"test:unit:standalone": "pnpm exec turbo run test:unit:standalone -- --passWithNoTests",
"test:integration": "cd login/apps/login-test-integration && pnpm test:integration",
"test:integration:setup": "NODE_ENV=test pnpm exec turbo run test:integration:setup",
"test:acceptance": "cd login/apps/login-test-acceptance && pnpm test:acceptance",
"test:acceptance:setup": "cd login/apps/login-test-acceptance && pnpm test:acceptance:setup",
"test:watch": "pnpm exec turbo run test:watch",
"dev": "pnpm exec turbo run dev --no-cache --continue",
"dev:local": "pnpm test:acceptance:setup",
"dev:console": "pnpm exec turbo run start --filter=console",
"lint": "pnpm exec turbo run lint",
"lint:fix": "pnpm exec turbo run lint:fix",
"clean": "pnpm exec turbo run clean && rm -rf node_modules",
"format:fix": "pnpm exec prettier --write \"**/*.{ts,tsx,md}\"",
"format": "pnpm exec prettier --check \"**/*.{ts,tsx,md}\"",
"changeset": "pnpm exec changeset",
"version-packages": "pnpm exec changeset version",
"release": "pnpm exec turbo run build --filter=login^... && pnpm exec changeset publish"
},
"pnpm": {
"overrides": {
"@typescript-eslint/parser": "^8.35.1"
}
},
"devDependencies": {
"@changesets/cli": "^2.29.2",
"@eslint/compat": "^1.3.1",
"@eslint/eslintrc": "^3.3.1",
"@vitejs/plugin-react": "^4.4.1",
"@zitadel/eslint-config": "workspace:*",
"@zitadel/prettier-config": "workspace:*",
"axios": "^1.8.4",
"dotenv": "^16.5.0",
"dotenv-cli": "^8.0.0",
"eslint": "9.30.1",
"prettier": "^3.5.3",
"prettier-plugin-organize-imports": "^4.1.0",
"tsup": "^8.4.0",
"turbo": "2.5.0",
"typescript": "^5.8.3",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.1.2"
}
}

31740
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

6
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,6 @@
packages:
- "console"
- "docs"
- "login"
- "login/apps/*"
- "login/packages/*"

51
turbo.json Normal file
View File

@@ -0,0 +1,51 @@
{
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"globalDependencies": ["**/.env.*local"],
"globalEnv": [
"DEBUG",
"VERCEL_URL",
"EMAIL_VERIFICATION",
"AUDIENCE",
"SYSTEM_USER_ID",
"SYSTEM_USER_PRIVATE_KEY",
"ZITADEL_API_URL",
"ZITADEL_SERVICE_USER_TOKEN",
"NEXT_PUBLIC_BASE_PATH",
"CUSTOM_REQUEST_HEADERS",
"NODE_ENV"
],
"tasks": {
"generate": {
"cache": true
},
"build": {},
"build:login:standalone": {},
"build:client:standalone": {},
"test": {},
"start": {},
"start:built": {},
"test:unit": {},
"test:unit:standalone": {},
"test:integration": {},
"test:integration:setup": {
"with": ["dev"]
},
"test:acceptance:setup": {},
"test:acceptance:setup:dev": {
"with": ["dev"]
},
"test:watch": {
"persistent": true
},
"lint": {},
"lint:fix": {},
"dev": {
"cache": false,
"persistent": true
},
"clean": {
"cache": false
}
}
}