chore(build): enhance proto caching and install binary plugins for improved performance, remove reliance on BSR (#11634)

This commit is contained in:
Florian Forster
2026-02-19 08:04:17 +00:00
committed by GitHub
parent 369b468720
commit 9dd2773e80
23 changed files with 363 additions and 125 deletions
+1 -1
View File
@@ -46,7 +46,7 @@
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/workspaces/zitadel/.artifacts/bin/linux/amd64"
},
"postStartCommand": "echo 'export PATH=\"${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH):$PATH\"' >> ~/.bashrc",
"postStartCommand": "npm install -g nx@21.6.9 && echo 'export PATH=\"${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH):$PATH\"' >> ~/.bashrc",
"customizations": {
"vscode": {
"extensions": [
+6 -3
View File
@@ -85,10 +85,13 @@ Run commands from the repository root.
- Known exception: `@zitadel/console` has no configured `test` target.
## Verified Common Targets
- `@zitadel/api`: `prod`, `build`, `generate`, `lint`, `test`, `test-unit`, `test-integration`
- `@zitadel/api`: `prod`, `build`, `generate`, `generate-install`, `lint`, `test`, `test-unit`, `test-integration`
- `@zitadel/login`: `dev`, `build`, `lint`, `test`, `test-unit`, `test-integration`
- `@zitadel/docs`: `dev`, `build`, `generate`, `check-links`, `check-types`, `test`, `lint`
- `@zitadel/console`: `dev`, `build`, `generate`, `lint`
- `@zitadel/docs`: `dev`, `build`, `generate`, `install-proto-plugins`, `check-links`, `check-types`, `test`, `lint`
- `@zitadel/console`: `dev`, `build`, `generate`, `install-proto-plugins`, `lint`
## Proto Plugin Binaries
All proto plugins are installed to `.artifacts/bin/<GOOS>/<GOARCH>/` and Nx-cached. `generate` targets wire up the correct install dependency and prepend `.artifacts/bin/` to `$PATH` — no manual install step is needed.
## PR Title Convention
+14 -1
View File
@@ -49,8 +49,9 @@ You can build and start any project with Nx commands.
| **Develop** | `pnpm nx run PROJECT:dev` | Development server | |
| **Generate** | `pnpm nx run PROJECT:generate` | Generate .gitignored files | |
| **Generate Go Files** | `pnpm nx run @zitadel/api:generate-go` | Regenerate checked-in files | This is needed to generate files using [Stringer](https://pkg.go.dev/golang.org/x/tools/cmd/stringer), [Enumer](https://github.com/dmarkham/enumer) or [gomock](https://github.com/uber-go/mock) |
| **Install Proto Plugins** | `pnpm nx run @zitadel/api:generate-install` | Install proto toolchain | Installs Go-based plugins (protoc-gen-go, connect-go, …) to `.artifacts/bin/`. Run automatically by `generate` targets; Nx caches the outputs. |
| **Test - Unit** | `pnpm nx run PROJECT:test-unit` | Run unit tests | |
| **Test - Integration** | `pnpm nx run PROJECT:test-integration` | Run integration tests | Learn mnore about how to [debug API integration tests](#run-api-integration-tests) |
| **Test - Integration** | `pnpm nx run PROJECT:test-integration` | Run integration tests | Learn more about how to [debug API integration tests](#run-api-integration-tests) |
| **Test - Integration Stop** | `pnpm nx run PROJECT:test-integration-stop` | Stop integration containers | |
| **Test - Functional UI** | `pnpm nx run @zitadel/functional-ui:test` | Run functional UI tests | Learn more about how to [develop the Management Console and opening the interactive Test Suite](#pass-management-console-quality-checks) |
| **Test - Functional UI Stop** | `pnpm nx run @zitadel/functional-ui:stop` | Run functional UI containers | |
@@ -578,6 +579,18 @@ pnpm nx run @zitadel/proto:generate # Regenerate after proto changes
pnpm nx run @zitadel/client:build # Build after changes
```
### Proto Plugin Convention
All binary proto plugins are installed to `.artifacts/bin/<GOOS>/<GOARCH>/` and declared as Nx target outputs, making them eligible for Nx remote cache.
| Scope | Target | Installs |
|---|---|---|
| `@zitadel/api` | `generate-install` | Go-based plugins: `buf`, `protoc-gen-go`, `protoc-gen-connect-go`, `protoc-gen-openapiv2`, `protoc-gen-validate`, `protoc-gen-authoption`, … |
| `@zitadel/console` | `install-proto-plugins` | `protoc-gen-grpc-web`, `protoc-gen-js`, `protoc-gen-openapiv2` (pre-built binaries, no Go required) |
| `@zitadel/docs` | `install-proto-plugins` | `protoc-gen-connect-openapi` (pre-built binary, no Go required) |
`generate` targets depend on the appropriate install targets and prepend `.artifacts/bin/` to `$PATH` automatically. Running `pnpm nx run PROJECT:generate` is sufficient — no manual plugin installation needed.
### Contribute to Docs
Project documentation is located under [./apps/docs](./apps/docs).
+2
View File
@@ -12,6 +12,7 @@ The **API App** (`apps/api`) is the Nx application target for building and runni
- **Run API (prod profile)**: `pnpm nx run @zitadel/api:prod`
- **Build**: `pnpm nx run @zitadel/api:build`
- **Generate (all)**: `pnpm nx run @zitadel/api:generate`
- **Install Proto Plugins**: `pnpm nx run @zitadel/api:generate-install` — installs all Go-based proto plugins (`buf`, `protoc-gen-go`, `protoc-gen-connect-go`, `protoc-gen-openapiv2`, `protoc-gen-validate`, `protoc-gen-authoption`, etc.) to `.artifacts/bin/$(GOOS)/$(GOARCH)/`. Output is Nx-cached; only reruns when plugin versions or local protoc sources change.
- **Lint**: `pnpm nx run @zitadel/api:lint`
- **Test (all)**: `pnpm nx run @zitadel/api:test`
- **Test (unit)**: `pnpm nx run @zitadel/api:test-unit`
@@ -20,3 +21,4 @@ The **API App** (`apps/api`) is the Nx application target for building and runni
## Generation Notes
- `@zitadel/api:generate` can update generated, tracked files (stubs/assets/statik). Run it intentionally.
- API changes in `proto/` often require regenerating API, package, and docs artifacts.
- Proto plugins are installed to `.artifacts/bin/` — do not commit these binaries; they are declared as Nx outputs and restored from cache.
-1
View File
@@ -261,7 +261,6 @@
"GOBIN=${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH) go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.22.0",
"GOBIN=${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH) go install github.com/envoyproxy/protoc-gen-validate@v1.1.0",
"GOBIN=${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH) go install connectrpc.com/connect/cmd/protoc-gen-connect-go@v1.18.1",
"GOBIN=${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH) go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.35.1",
"GOBIN=${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH) go install ./internal/protoc/protoc-gen-authoption",
"GOBIN=${PWD}/.artifacts/bin/$(go env GOOS)/$(go env GOARCH) go install ./internal/protoc/protoc-gen-zitadel"
]
+1 -1
View File
@@ -1,6 +1,6 @@
version: v2
plugins:
- remote: buf.build/community/sudorandom-connect-openapi:v0.19.1
- local: protoc-gen-connect-openapi
out: .
opt:
- format=json
@@ -12,7 +12,7 @@ import { FileText, Folder, Link as LinkIcon } from 'lucide-react';
<Cards>
<Card title="B2b" href="/guides/solution-scenarios/b2b" icon={<FileText />} />
<Card title="Common Settings" href="/guides/solution-scenarios/configurations" icon={<FileText />} />
<Card title="Configurations" href="/guides/solution-scenarios/configurations" icon={<FileText />} />
<Card title="Saas" href="/guides/solution-scenarios/saas" icon={<FileText />} />
<Card title="B2c" href="/guides/solution-scenarios/b2c" icon={<FileText />} />
<Card title="Frontend Calling Backend API" href="/guides/solution-scenarios/frontend-calling-backend-API" icon={<FileText />} />
-1
View File
@@ -49,7 +49,6 @@
"zod": "^4.3.6"
},
"devDependencies": {
"@bufbuild/buf": "^1.65.0",
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^10.0.1",
"@tailwindcss/postcss": "^4.1.18",
+23 -3
View File
@@ -63,24 +63,44 @@
"generate-proto-docs": {
"executor": "nx:run-commands",
"options": {
"command": "pnpm generate:proto-docs",
"command": "bash -c 'GOOS=$(uname -s | tr \"[:upper:]\" \"[:lower:]\"); GOARCH=$(uname -m); GOARCH=${GOARCH/x86_64/amd64}; GOARCH=${GOARCH/aarch64/arm64}; PATH=\"${PWD}/../../.artifacts/bin/${GOOS}/${GOARCH}:$PATH\" pnpm generate:proto-docs'",
"cwd": "apps/docs"
},
"dependsOn": [
"fetch-remote-content"
"fetch-remote-content",
"install-proto-plugins"
],
"outputs": [
"{projectRoot}/openapi"
],
"cache": true,
"inputs": [
"default",
"{projectRoot}/scripts/generate-proto-docs.mjs",
"{projectRoot}/buf.gen.yaml",
"{workspaceRoot}/proto/**/*",
{
"dependentTasksOutputFiles": "apps/docs/content/versions.json"
},
{
"dependentTasksOutputFiles": ".artifacts/bin/*/*/protoc-gen-connect-openapi"
}
]
},
"install-proto-plugins": {
"executor": "nx:run-commands",
"options": {
"command": "bash ./apps/docs/scripts/install-proto-plugins.sh"
},
"cache": true,
"inputs": [
{ "runtime": "uname -s" },
{ "runtime": "uname -m" },
"{projectRoot}/scripts/install-proto-plugins.sh"
],
"outputs": [
"{workspaceRoot}/.artifacts/bin/*/*/protoc-gen-connect-openapi"
]
},
"generate-api-reference": {
"executor": "nx:run-commands",
"options": {
+84
View File
@@ -0,0 +1,84 @@
#!/usr/bin/env bash
# Downloads protoc-gen-connect-openapi for docs OpenAPI generation.
# Must be run from the workspace root.
# Supports Linux (including WSL2) and macOS only.
#
# WHY a binary download instead of "go install":
# This script runs as an Nx target that docs/generate-proto-docs depends on.
# Docs OpenAPI generation happens both in CI (has Go) and on Vercel
# (Node.js-only, no Go). Using a pre-built binary means Vercel never needs a
# Go toolchain. Nx remote cache means the download is skipped on repeated runs.
#
# WHY uname instead of "go env GOOS/GOARCH":
# Same reason — this script must work without Go present.
set -euo pipefail
# ── VERSIONS & CHECKSUMS ────────────────────────────────────────────────────
# To upgrade: update VERSION and the SHA256_<os>_<arch> vars below.
# Note: macOS ships a universal binary, so darwin_amd64 and darwin_arm64 share
# the same tarball and checksum.
CONNECT_OPENAPI_VERSION="0.25.2"
# checksums from upstream checksums.txt
CONNECT_OPENAPI_SHA256_linux_amd64="90821ab96f16747dc5a4ab93900a6bc6b968d63f47553a08274dc594301bced3"
CONNECT_OPENAPI_SHA256_linux_arm64="9726418d7af55f87e3bbb2a4fa6233016b200caf5a285ce1c6e6428ef225536d"
CONNECT_OPENAPI_SHA256_darwin_amd64="a6bc3d87b4caaa7048d22fe0f45e3b5e778b4b209f84a836b3335fb2fd14b588"
CONNECT_OPENAPI_SHA256_darwin_arm64="a6bc3d87b4caaa7048d22fe0f45e3b5e778b4b209f84a836b3335fb2fd14b588"
# ── HELPERS ──────────────────────────────────────────────────────────────────
verify_sha256() {
local file="$1" expected="$2"
local actual
if command -v sha256sum &>/dev/null; then
actual=$(sha256sum "$file" | cut -d' ' -f1)
else
actual=$(shasum -a 256 "$file" | cut -d' ' -f1)
fi
if [ "$actual" != "$expected" ]; then
echo "ERROR: SHA256 mismatch for $(basename "$file")" >&2
echo " expected: $expected" >&2
echo " actual: $actual" >&2
exit 1
fi
}
# ── PLATFORM DETECTION ───────────────────────────────────────────────────────
_uname_os=$(uname -s | tr '[:upper:]' '[:lower:]')
_uname_arch=$(uname -m)
case "$_uname_os" in
linux) GOOS="linux" ;;
darwin) GOOS="darwin" ;;
*) echo "Unsupported OS: $_uname_os" >&2; exit 1 ;;
esac
case "$_uname_arch" in
x86_64) GOARCH="amd64" ;;
aarch64 | arm64) GOARCH="arm64" ;;
*) echo "Unsupported arch: $_uname_arch" >&2; exit 1 ;;
esac
BIN_DIR="${PWD}/.artifacts/bin/${GOOS}/${GOARCH}"
mkdir -p "$BIN_DIR"
TMP=$(mktemp -d "${TMPDIR:-/tmp}/zitadel-docs-proto-plugins.XXXXXX")
trap 'rm -rf "$TMP"' EXIT
# ── INSTALL ───────────────────────────────────────────────────────────────────
# ----- protoc-gen-connect-openapi (sudorandom/protoc-gen-connect-openapi) -----
# macOS ships a single universal ("all") tarball for both amd64 and arm64.
case "$GOOS" in
linux) OAI_ARCH="$GOARCH" ;;
darwin) OAI_ARCH="all" ;;
esac
sha256_var="CONNECT_OPENAPI_SHA256_${GOOS}_${GOARCH}"
echo "Downloading protoc-gen-connect-openapi v${CONNECT_OPENAPI_VERSION} (${GOOS}/${OAI_ARCH})..."
curl -fsSL \
"https://github.com/sudorandom/protoc-gen-connect-openapi/releases/download/v${CONNECT_OPENAPI_VERSION}/protoc-gen-connect-openapi_${CONNECT_OPENAPI_VERSION}_${GOOS}_${OAI_ARCH}.tar.gz" \
-o "${TMP}/oai.tar.gz"
verify_sha256 "${TMP}/oai.tar.gz" "${!sha256_var}"
tar -xzf "${TMP}/oai.tar.gz" -C "${TMP}" protoc-gen-connect-openapi
install -m 755 "${TMP}/protoc-gen-connect-openapi" "${BIN_DIR}/protoc-gen-connect-openapi"
echo "protoc-gen-connect-openapi installed to ${BIN_DIR}"
-1
View File
@@ -45,7 +45,6 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.28.6",
"@bufbuild/buf": "^1.64.0",
"@faker-js/faker": "^9.9.0",
"@otplib/core": "^12.0.1",
"@otplib/plugin-crypto": "^12.0.1",
+2 -1
View File
@@ -18,6 +18,7 @@ The **Management Console** (`console/`) is the administrative interface for ZITA
- **Dev Server**: `pnpm nx run @zitadel/console:dev`
- **Build**: `pnpm nx run @zitadel/console:build`
- **Lint**: `pnpm nx run @zitadel/console:lint`
- **Generate**: `pnpm nx run @zitadel/console:generate`
- **Generate**: `pnpm nx run @zitadel/console:generate` — runs `buf generate` to produce TypeScript/JS proto stubs in `src/app/proto/generated/`. Automatically depends on `install-proto-plugins`.
- **Install Proto Plugins**: `pnpm nx run @zitadel/console:install-proto-plugins` — downloads `protoc-gen-grpc-web` v1.5.0, `protoc-gen-js` v3.21.4, and `protoc-gen-openapiv2` v2.22.0 pre-built binaries to `.artifacts/bin/`. No Go toolchain required. Output is Nx-cached.
- **Test**: The `@zitadel/console` project currently has no `test` target configured in Nx.
- **Functional UI Tests**: Use `pnpm nx run @zitadel/functional-ui:test` (see `tests/functional-ui/AGENTS.md`).
+3 -3
View File
@@ -3,12 +3,12 @@ version: v1
managed:
enabled: true
plugins:
- plugin: buf.build/protocolbuffers/js:v3.21.4
- plugin: js
out: src/app/proto/generated
opt: import_style=commonjs,binary
- plugin: buf.build/grpc/web:v1.5.0
- plugin: grpc-web
out: src/app/proto/generated
opt: import_style=typescript,mode=grpcweb
- plugin: buf.build/grpc-ecosystem/openapiv2:v2.27.4
- plugin: openapiv2
out: src/app/proto/generated
opt: allow_delete_body
-1
View File
@@ -68,7 +68,6 @@
"@angular/cli": "^20.3.15",
"@angular/compiler-cli": "^20.3.16",
"@angular/language-service": "^20.3.16",
"@bufbuild/buf": "^1.64.0",
"@types/file-saver": "^2.0.7",
"@types/google-protobuf": "~3.15.12",
"@types/jasmine": "~5.1.15",
+27 -1
View File
@@ -17,14 +17,40 @@
},
"generate": {
"description": "Generates code from protobuf definitions for API v1 endpoints",
"executor": "nx:run-commands",
"options": {
"command": "bash -c 'PATH=\"${PWD}/../.artifacts/bin/$(go env GOOS)/$(go env GOARCH):$PATH\" pnpm exec buf generate ../proto --include-imports --include-wkt'",
"cwd": "console"
},
"dependsOn": ["install-proto-plugins"],
"inputs": [
"{workspaceRoot}/proto/**/*",
"{projectRoot}/buf.gen.yaml",
"{projectRoot}/package.json",
"{workspaceRoot}/pnpm-lock.yaml"
"{workspaceRoot}/pnpm-lock.yaml",
{ "dependentTasksOutputFiles": ".artifacts/bin/*/*/protoc-gen-js" },
{ "dependentTasksOutputFiles": ".artifacts/bin/*/*/protoc-gen-grpc-web" },
{ "dependentTasksOutputFiles": ".artifacts/bin/*/*/protoc-gen-openapiv2" }
],
"outputs": ["{projectRoot}/src/app/proto/generated"]
},
"install-proto-plugins": {
"executor": "nx:run-commands",
"options": {
"command": "bash ./console/scripts/install-proto-plugins.sh"
},
"cache": true,
"inputs": [
{ "runtime": "uname -s" },
{ "runtime": "uname -m" },
"{projectRoot}/scripts/install-proto-plugins.sh"
],
"outputs": [
"{workspaceRoot}/.artifacts/bin/*/*/protoc-gen-grpc-web",
"{workspaceRoot}/.artifacts/bin/*/*/protoc-gen-js",
"{workspaceRoot}/.artifacts/bin/*/*/protoc-gen-openapiv2"
]
},
"build": {
"description": "Builds the Management Console for production",
"inputs": [
+126
View File
@@ -0,0 +1,126 @@
#!/usr/bin/env bash
# Downloads protoc-gen-grpc-web, protoc-gen-js, and protoc-gen-openapiv2
# for console protobuf generation.
# Must be run from the workspace root.
# Supports Linux (including WSL2) and macOS only.
#
# WHY binary downloads instead of BSR remote plugins:
# Using locally installed binaries avoids a network call to buf.build on every
# cache miss and removes the dependency on BSR availability during CI builds.
# Nx caches the outputs, so the downloads only happen when versions change.
#
# WHY uname instead of "go env GOOS/GOARCH":
# Keeps the script dependency-free (no Go toolchain required).
set -euo pipefail
# ── VERSIONS & CHECKSUMS ────────────────────────────────────────────────────
# To upgrade a plugin: update the VERSION and all four SHA256_<os>_<arch> vars.
GRPC_WEB_VERSION="1.5.0"
# checksums from upstream .sha256 sidecar files
GRPC_WEB_SHA256_linux_amd64="2e6e074497b221045a14d5a54e9fc910945bfdd1198b12b9fc23686a95671d64"
GRPC_WEB_SHA256_linux_arm64="522e958568cdeabdd20ef3c97394fc067ff8e374a728c08b7410bf5de8f57783"
GRPC_WEB_SHA256_darwin_amd64="1fa3ef92194d06c03448a5cba82759e9773e43d8b188866a1f1d4fc23bb1ecb7"
GRPC_WEB_SHA256_darwin_arm64="a12b759629b943ebac5528f58fac5039d9aa2fb7abb9e9684d1b481b35afbfc6"
PROTOC_GEN_JS_VERSION="3.21.4"
# checksums of release tarballs (this release ships no upstream checksum file)
PROTOC_GEN_JS_SHA256_linux_amd64="c57ba4130471c642462fcf98c844a3c933f6c4708b9fddc859900fd2a2e72a45"
PROTOC_GEN_JS_SHA256_linux_arm64="86194b1c6baee994bb06d162887b9edace6b32a8ed971eac07fdf5d2470c6937"
PROTOC_GEN_JS_SHA256_darwin_amd64="9bfa23630fb2fd99c0328d247f91a454b4d4a2276dd4953af0a052430554510d"
PROTOC_GEN_JS_SHA256_darwin_arm64="308b3713bc6f2147c8622d0dbb82b2ffcb2e25860c89d763ea00c2d768589989"
OPENAPIV2_VERSION="2.22.0"
# checksums from grpc-gateway_${OPENAPIV2_VERSION}_checksums.txt
OPENAPIV2_SHA256_linux_amd64="72a6fc6a6d130189c549a6d88cbdef407d3ed1c95ab101ffb3d223d8b3778c90"
OPENAPIV2_SHA256_linux_arm64="4921799b8d80dde5f8cb89817d3ae04dee1e2560e141fd0fc79a2e544cc63178"
OPENAPIV2_SHA256_darwin_amd64="14c95d1305a81822cd17ef750cfe71e8471728eba19068e9142a70a6cbaf5847"
OPENAPIV2_SHA256_darwin_arm64="dc215925f49912d53a443107879d91898b56699e5b8bc4ed0d7b9ba94939dd86"
# ── HELPERS ──────────────────────────────────────────────────────────────────
verify_sha256() {
local file="$1" expected="$2"
local actual
if command -v sha256sum &>/dev/null; then
actual=$(sha256sum "$file" | cut -d' ' -f1)
else
actual=$(shasum -a 256 "$file" | cut -d' ' -f1)
fi
if [ "$actual" != "$expected" ]; then
echo "ERROR: SHA256 mismatch for $(basename "$file")" >&2
echo " expected: $expected" >&2
echo " actual: $actual" >&2
exit 1
fi
}
# ── PLATFORM DETECTION ───────────────────────────────────────────────────────
_uname_os=$(uname -s | tr '[:upper:]' '[:lower:]')
_uname_arch=$(uname -m)
case "$_uname_os" in
linux) GOOS="linux" ;;
darwin) GOOS="darwin" ;;
*) echo "Unsupported OS: $_uname_os" >&2; exit 1 ;;
esac
case "$_uname_arch" in
x86_64) GOARCH="amd64" ;;
aarch64 | arm64) GOARCH="arm64" ;;
*) echo "Unsupported arch: $_uname_arch" >&2; exit 1 ;;
esac
BIN_DIR="${PWD}/.artifacts/bin/${GOOS}/${GOARCH}"
mkdir -p "$BIN_DIR"
TMP=$(mktemp -d "${TMPDIR:-/tmp}/zitadel-console-proto-plugins.XXXXXX")
trap 'rm -rf "$TMP"' EXIT
# ── INSTALL ───────────────────────────────────────────────────────────────────
# ----- protoc-gen-grpc-web (grpc/grpc-web) -----
case "$GOARCH" in
amd64) WEB_ARCH="x86_64" ;;
arm64) WEB_ARCH="aarch64" ;;
esac
sha256_var="GRPC_WEB_SHA256_${GOOS}_${GOARCH}"
echo "Downloading protoc-gen-grpc-web v${GRPC_WEB_VERSION} (${GOOS}/${WEB_ARCH})..."
curl -fsSL \
"https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-${GOOS}-${WEB_ARCH}" \
-o "${TMP}/protoc-gen-grpc-web"
verify_sha256 "${TMP}/protoc-gen-grpc-web" "${!sha256_var}"
install -m 755 "${TMP}/protoc-gen-grpc-web" "${BIN_DIR}/protoc-gen-grpc-web"
# ----- protoc-gen-js (protocolbuffers/protobuf-javascript) -----
# Note: macOS asset uses "osx"; ARM uses "aarch_64" (underscore, not hyphen).
case "$GOOS" in
linux) JS_OS="linux" ;;
darwin) JS_OS="osx" ;;
esac
case "$GOARCH" in
amd64) JS_ARCH="x86_64" ;;
arm64) JS_ARCH="aarch_64" ;;
esac
sha256_var="PROTOC_GEN_JS_SHA256_${GOOS}_${GOARCH}"
echo "Downloading protoc-gen-js v${PROTOC_GEN_JS_VERSION} (${JS_OS}/${JS_ARCH})..."
curl -fsSL \
"https://github.com/protocolbuffers/protobuf-javascript/releases/download/v${PROTOC_GEN_JS_VERSION}/protobuf-javascript-${PROTOC_GEN_JS_VERSION}-${JS_OS}-${JS_ARCH}.tar.gz" \
-o "${TMP}/p.tar.gz"
verify_sha256 "${TMP}/p.tar.gz" "${!sha256_var}"
tar -xzf "${TMP}/p.tar.gz" -C "${TMP}"
install -m 755 "${TMP}/bin/protoc-gen-js" "${BIN_DIR}/protoc-gen-js"
# ----- protoc-gen-openapiv2 (grpc-ecosystem/grpc-gateway) -----
case "$GOARCH" in
amd64) OAI2_ARCH="x86_64" ;;
arm64) OAI2_ARCH="arm64" ;;
esac
sha256_var="OPENAPIV2_SHA256_${GOOS}_${GOARCH}"
echo "Downloading protoc-gen-openapiv2 v${OPENAPIV2_VERSION} (${GOOS}/${OAI2_ARCH})..."
curl -fsSL \
"https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${OPENAPIV2_VERSION}/protoc-gen-openapiv2-v${OPENAPIV2_VERSION}-${GOOS}-${OAI2_ARCH}" \
-o "${TMP}/protoc-gen-openapiv2"
verify_sha256 "${TMP}/protoc-gen-openapiv2" "${!sha256_var}"
install -m 755 "${TMP}/protoc-gen-openapiv2" "${BIN_DIR}/protoc-gen-openapiv2"
echo "Console proto plugins installed to ${BIN_DIR}"
+1 -1
View File
@@ -5,7 +5,7 @@
"libsDir": "packages"
},
"tui": {
"enabled": false
"enabled": true
},
"namedInputs": {
"default": [
+1
View File
@@ -13,6 +13,7 @@
"clean:all": "pnpm run clean && rm -rf .nx node_modules"
},
"devDependencies": {
"@bufbuild/buf": "^1.65.0",
"@changesets/cli": "^2.29.8",
"nx": "21.6.9",
"shiki": "^3.21.0",
-1
View File
@@ -79,7 +79,6 @@
"jose": "^5.10.0"
},
"devDependencies": {
"@bufbuild/buf": "^1.64.0",
"@bufbuild/protocompile": "^0.0.1",
"@types/node": "^24.10.9",
"@typescript-eslint/eslint-plugin": "^8.54.0",
+4 -4
View File
@@ -2,22 +2,22 @@ version: v2
managed:
enabled: true
plugins:
- remote: buf.build/bufbuild/es:v2.11.0
- local: protoc-gen-es
out: es
include_imports: true
opt:
- target=js
- json_types=true
- import_extension=js
- remote: buf.build/bufbuild/es:v2.11.0
- local: protoc-gen-es
out: cjs
include_imports: true
opt:
- target=js
- json_types=true
- import_extension=js
- js_import_style=legacy_commonjs
- remote: buf.build/bufbuild/es:v2.11.0
- js_import_style=legacy_commonjs
- local: protoc-gen-es
out: types
include_imports: true
opt:
+2 -2
View File
@@ -76,14 +76,14 @@
},
"sideEffects": false,
"scripts": {
"generate": "buf generate ../../proto",
"generate": "pnpm exec buf generate ../../proto",
"clean": "rm -rf zitadel node_modules google protoc-gen-openapiv2 validate cjs types es"
},
"dependencies": {
"@bufbuild/protobuf": "^2.11.0"
},
"devDependencies": {
"@bufbuild/buf": "^1.64.0",
"@bufbuild/protoc-gen-es": "^2.11.0",
"glob": "^11.1.0"
}
}
+7 -1
View File
@@ -2,8 +2,14 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"targets": {
"generate": {
"executor": "nx:run-commands",
"options": {
"command": "pnpm exec buf generate ../../proto",
"cwd": "packages/zitadel-proto"
},
"inputs": [
"default",
"{projectRoot}/buf.gen.yaml",
"{projectRoot}/package.json",
"{workspaceRoot}/pnpm-lock.yaml",
"{workspaceRoot}/proto/**/*"
],
+58 -97
View File
@@ -12,6 +12,9 @@ importers:
.:
devDependencies:
'@bufbuild/buf':
specifier: ^1.65.0
version: 1.65.0
'@changesets/cli':
specifier: ^2.29.8
version: 2.29.8(@types/node@25.2.3)
@@ -106,9 +109,6 @@ importers:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
'@bufbuild/buf':
specifier: ^1.65.0
version: 1.65.0
'@eslint/eslintrc':
specifier: ^3.3.3
version: 3.3.3
@@ -251,9 +251,6 @@ importers:
'@babel/eslint-parser':
specifier: ^7.28.6
version: 7.28.6(@babel/core@7.28.4)(eslint@8.57.1)
'@bufbuild/buf':
specifier: ^1.64.0
version: 1.64.0
'@faker-js/faker':
specifier: ^9.9.0
version: 9.9.0
@@ -558,9 +555,6 @@ importers:
'@angular/language-service':
specifier: ^20.3.16
version: 20.3.16
'@bufbuild/buf':
specifier: ^1.64.0
version: 1.64.0
'@types/file-saver':
specifier: ^2.0.7
version: 2.0.7
@@ -658,12 +652,9 @@ importers:
specifier: ^5.10.0
version: 5.10.0
devDependencies:
'@bufbuild/buf':
specifier: ^1.64.0
version: 1.64.0
'@bufbuild/protocompile':
specifier: ^0.0.1
version: 0.0.1(@bufbuild/buf@1.64.0)
version: 0.0.1(@bufbuild/buf@1.65.0)
'@types/node':
specifier: ^24.10.9
version: 24.10.9
@@ -695,9 +686,9 @@ importers:
specifier: ^2.11.0
version: 2.11.0
devDependencies:
'@bufbuild/buf':
specifier: ^1.64.0
version: 1.64.0
'@bufbuild/protoc-gen-es':
specifier: ^2.11.0
version: 2.11.0(@bufbuild/protobuf@2.11.0)
glob:
specifier: ^11.1.0
version: 11.1.0
@@ -1237,95 +1228,48 @@ packages:
'@balena/dockerignore@1.0.2':
resolution: {integrity: sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==}
'@bufbuild/buf-darwin-arm64@1.64.0':
resolution: {integrity: sha512-wv4WJ/ho9Jt4b/3SuwrzCa7r68yvOSMhnpztPivu75CMF+btZijWYjc/Wt6JkOYbGmsXAlSzyANXZaQM9KCm8g==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
'@bufbuild/buf-darwin-arm64@1.65.0':
resolution: {integrity: sha512-2U8CHjW1ysINYKwIPcc4WAiQPxe91RIjNtjpg+RC9rP0aZ7TpGm5MTMY5l3sN4drtmKdb9rBs3bMQsMNhSc90A==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
'@bufbuild/buf-darwin-x64@1.64.0':
resolution: {integrity: sha512-2idJ/x94DzsYbiuLticvevXNiTXeCv/WjO7NYcwo8WXOIBHdGKK6nfoEAa4DMSo2qv/u3O2Q9sublQ+LYmITkw==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
'@bufbuild/buf-darwin-x64@1.65.0':
resolution: {integrity: sha512-aMqfc6pQC4L9dZpSD61XCEpPWKEtb1rXDPkK0/tzrfTWodnbaJ/elNoxsCGzbZVSMFeAdomUpXmSMrk8ALfWWw==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
'@bufbuild/buf-linux-aarch64@1.64.0':
resolution: {integrity: sha512-954Tg1LKjPHNOuOBJH57SDnvHYBFf3NSWccu8bqBcXcRpdebnRiNCDWPGDhXqXXPfLnAbTYMyOdh+D4KsYsygw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
'@bufbuild/buf-linux-aarch64@1.65.0':
resolution: {integrity: sha512-gzqvY4PLRQ7g0+RlE9g+OL/6yPd5szG7e3Wd5bgjJzfKaQerNiQWaGyPLdcRsIM/WxJhT5e5lG8OrrWHwgQ9Ig==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
'@bufbuild/buf-linux-armv7@1.64.0':
resolution: {integrity: sha512-RDPQK+qMXuA2TV8jvzrGUFR1m+cJ32crxPHXgqmHSd+/LneUdNB/U0euhm94rNP8Xr3EbcMTBQ0kwajF4ZeeKg==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
'@bufbuild/buf-linux-armv7@1.65.0':
resolution: {integrity: sha512-RpYFuPr9MKniD+WNfDgCclyvMu+/w9kK41OWr9sNnbS2BorujskwPiY0iTf5j+8+n/MeAnLIGlyC36+vUB/wIw==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
'@bufbuild/buf-linux-x64@1.64.0':
resolution: {integrity: sha512-PONSa1DorjkMASu9EYtd6ckgMQC5MSHi9aY5CqWwV5hl262A43k2qt3EbYCClyGdNjC+Vu8Av9Blfd91Yg5kRw==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
'@bufbuild/buf-linux-x64@1.65.0':
resolution: {integrity: sha512-0j06h1uKCXlOtrlNcTBkURazT+AwMNvuVxgJsYeUDnSliN05QS7LnBzPOwKg76ariSqlLo+QXk9eNtdhgVjYOg==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
'@bufbuild/buf-win32-arm64@1.64.0':
resolution: {integrity: sha512-nBEr7udVctBq0TIoCWkoI1BCcwDynKW9u1bX27/0QUnIySm9bgS5AeMyhuWsXKka+kHjR/fMf3tHlP2a5o85ag==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
'@bufbuild/buf-win32-arm64@1.65.0':
resolution: {integrity: sha512-KBFsQ3iEityUuLTUCoXAO6ZTGUXWljSjK4upqofsYCb4OJeSeVguD7b09efkQt9ymKsXBt5wQicsRdkMJy/VEA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
'@bufbuild/buf-win32-x64@1.64.0':
resolution: {integrity: sha512-5dwpWxLRCLKQ3xsrmRs8lGO2lL6mVCKRlgvGDj5PCMy9+BmqmwHtPAYMj+nUtqQqUNnax4oADeIfliMmeUXd7g==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
'@bufbuild/buf-win32-x64@1.65.0':
resolution: {integrity: sha512-vJYzHjncSLdy4sPDW8kLqUldHh6Vucg6KabAflm7CDj29lU/HydV8T+nOVsXkoRMUf4+H/qy8WjnSMEtRkaogA==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
'@bufbuild/buf@1.64.0':
resolution: {integrity: sha512-MC9Zj+pUQsKLEQrsBPmV3CuECYUSD2n82WUcLMu6f49LwSMtKg887B5vPADsf2yMM+6N1LjYHHLb3fN4R1ZGyg==}
engines: {node: '>=12'}
hasBin: true
'@bufbuild/buf@1.65.0':
resolution: {integrity: sha512-IQmIBB2CGbJAwx1NkuAWMuj4QGPnZ8mujbf4ckx9t6KI9EzfUzql1OyKi9qPrxlLAciI+kBIyPDQ2MIvXTxWUg==}
engines: {node: '>=12'}
@@ -1334,11 +1278,24 @@ packages:
'@bufbuild/protobuf@2.11.0':
resolution: {integrity: sha512-sBXGT13cpmPR5BMgHE6UEEfEaShh5Ror6rfN3yEK5si7QVrtZg8LEPQb0VVhiLRUslD2yLnXtnRzG035J/mZXQ==}
'@bufbuild/protoc-gen-es@2.11.0':
resolution: {integrity: sha512-VzQuwEQDXipbZ1soWUuAWm1Z0C3B/IDWGeysnbX6ogJ6As91C2mdvAND/ekQ4YIWgen4d5nqLfIBOWLqCCjYUA==}
engines: {node: '>=20'}
hasBin: true
peerDependencies:
'@bufbuild/protobuf': 2.11.0
peerDependenciesMeta:
'@bufbuild/protobuf':
optional: true
'@bufbuild/protocompile@0.0.1':
resolution: {integrity: sha512-cOTMtjcWLcbjF17dPYgeMtVC5jZyS0bSjz3jy8kDPjOgjgSYMD2u2It7w8aCc2z23hTPIKl/2SNdMnz0Jzu3Xg==}
peerDependencies:
'@bufbuild/buf': ^1.22.0
'@bufbuild/protoplugin@2.11.0':
resolution: {integrity: sha512-lyZVNFUHArIOt4W0+dwYBe5GBwbKzbOy8ObaloEqsw9Mmiwv2O48TwddDoHN4itylC+BaEGqFdI1W8WQt2vWJQ==}
'@bugsnag/browser@8.6.0':
resolution: {integrity: sha512-7UGqTGnQqXUQ09gOlWbDTFUSbeLIIrP+hML3kTOq8Zdc8nP/iuOEflXGLV2TxWBWW8xIUPc928caFPr9EcaDuw==}
@@ -5404,6 +5361,11 @@ packages:
resolution: {integrity: sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript/vfs@1.6.4':
resolution: {integrity: sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==}
peerDependencies:
typescript: '*'
'@ungap/structured-clone@1.3.0':
resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
@@ -11422,6 +11384,11 @@ packages:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
hasBin: true
typescript@5.9.2:
resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==}
engines: {node: '>=14.17'}
@@ -12799,58 +12766,27 @@ snapshots:
'@balena/dockerignore@1.0.2': {}
'@bufbuild/buf-darwin-arm64@1.64.0':
optional: true
'@bufbuild/buf-darwin-arm64@1.65.0':
optional: true
'@bufbuild/buf-darwin-x64@1.64.0':
optional: true
'@bufbuild/buf-darwin-x64@1.65.0':
optional: true
'@bufbuild/buf-linux-aarch64@1.64.0':
optional: true
'@bufbuild/buf-linux-aarch64@1.65.0':
optional: true
'@bufbuild/buf-linux-armv7@1.64.0':
optional: true
'@bufbuild/buf-linux-armv7@1.65.0':
optional: true
'@bufbuild/buf-linux-x64@1.64.0':
optional: true
'@bufbuild/buf-linux-x64@1.65.0':
optional: true
'@bufbuild/buf-win32-arm64@1.64.0':
optional: true
'@bufbuild/buf-win32-arm64@1.65.0':
optional: true
'@bufbuild/buf-win32-x64@1.64.0':
optional: true
'@bufbuild/buf-win32-x64@1.65.0':
optional: true
'@bufbuild/buf@1.64.0':
optionalDependencies:
'@bufbuild/buf-darwin-arm64': 1.64.0
'@bufbuild/buf-darwin-x64': 1.64.0
'@bufbuild/buf-linux-aarch64': 1.64.0
'@bufbuild/buf-linux-armv7': 1.64.0
'@bufbuild/buf-linux-x64': 1.64.0
'@bufbuild/buf-win32-arm64': 1.64.0
'@bufbuild/buf-win32-x64': 1.64.0
'@bufbuild/buf@1.65.0':
optionalDependencies:
'@bufbuild/buf-darwin-arm64': 1.65.0
@@ -12863,12 +12799,28 @@ snapshots:
'@bufbuild/protobuf@2.11.0': {}
'@bufbuild/protocompile@0.0.1(@bufbuild/buf@1.64.0)':
'@bufbuild/protoc-gen-es@2.11.0(@bufbuild/protobuf@2.11.0)':
dependencies:
'@bufbuild/buf': 1.64.0
'@bufbuild/protoplugin': 2.11.0
optionalDependencies:
'@bufbuild/protobuf': 2.11.0
transitivePeerDependencies:
- supports-color
'@bufbuild/protocompile@0.0.1(@bufbuild/buf@1.65.0)':
dependencies:
'@bufbuild/buf': 1.65.0
'@bufbuild/protobuf': 2.11.0
fflate: 0.8.2
'@bufbuild/protoplugin@2.11.0':
dependencies:
'@bufbuild/protobuf': 2.11.0
'@typescript/vfs': 1.6.4(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
'@bugsnag/browser@8.6.0':
dependencies:
'@bugsnag/core': 8.6.0
@@ -17467,6 +17419,13 @@ snapshots:
'@typescript-eslint/types': 8.56.0
eslint-visitor-keys: 5.0.0
'@typescript/vfs@1.6.4(typescript@5.4.5)':
dependencies:
debug: 4.4.3(supports-color@8.1.1)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
'@ungap/structured-clone@1.3.0': {}
'@unhead/dom@1.11.20':
@@ -21192,7 +21151,7 @@ snapshots:
jest-worker@27.5.1:
dependencies:
'@types/node': 24.10.9
'@types/node': 25.2.3
merge-stream: 2.0.0
supports-color: 8.1.1
@@ -24938,6 +24897,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
typescript@5.4.5: {}
typescript@5.9.2: {}
typescript@5.9.3: {}