Skip to content

Commit 6d8c89f

Browse files
authored
Merge branch 'main' into codex/add-nextjs-registerlogin-demo
2 parents ba10419 + f02718f commit 6d8c89f

30 files changed

Lines changed: 1064 additions & 338 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@zitadel/cli": patch
3+
"@zitadel/sdk-nuxt": patch
4+
---
5+
6+
Allow fresh app scaffolding after `zitadel start` creates local runtime ignore files, and load Nuxt runtime config through the Nuxt virtual imports module.

.github/instructions/consumer-journey.instructions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ gate, not as a demo-app e2e suite.
1010
- CI must consume the current workflow's GoReleaser image and npm package
1111
tarballs. Do not replace this with public npm packages for Zitadel packages.
1212
- The journey must exercise the customer local runtime flow through `npx`:
13-
`doctor`, `start`, then `setup --framework next --server local` with
13+
`doctor`, `start`, then
14+
`setup --framework <next|nuxt|react|vue|angular> --server local` with
1415
`--non-interactive --json`.
1516
- Produce package artifacts with `corepack pnpm --dir <package> pack` and keep
1617
tarball verification for required package presence plus unresolved
@@ -19,14 +20,14 @@ gate, not as a demo-app e2e suite.
1920
design tokens must not be uploaded or published to Verdaccio.
2021
- Keep Verdaccio proxying npmjs for third-party dependencies while publishing
2122
Zitadel tarballs under both `alpha` and `latest`.
22-
- Keep generated Next.js apps outside the repo and use `npm` inside the
23-
generated app to match the documented consumer path.
23+
- Keep generated apps outside the repo and use `npm` inside the generated app to
24+
match the documented consumer path.
2425
- Preserve the CLI setup JSON contract: `--non-interactive --json` must parse
2526
from stdout and return `status: "ok"`.
2627
- Browser tests should run serially with one worker, use `localhost` for
2728
WebAuthn, and require passkey coverage in CI. `JOURNEY_ENABLE_PASSKEY=0` is
2829
only a local debugging escape hatch.
2930
- Failure artifacts should include Playwright output/report, doctor/start/setup
3031
JSON and stderr, local runtime metadata/logs, metadata, generated app package
31-
manifests, Verdaccio logs, and Next logs. Do not upload generated
32+
manifests, Verdaccio logs, and generated app logs. Do not upload generated
3233
`node_modules` or `.next`.

.github/workflows/ci.yml

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ jobs:
229229
retention-days: 7
230230

231231
go-smoke-test-embedded-postgres:
232+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
232233
runs-on: depot-ubuntu-24.04-4
233234
timeout-minutes: 15
234235
needs: [goreleaser-snapshot]
@@ -335,6 +336,7 @@ jobs:
335336
node scripts/check-changeset-required.mjs --base "origin/${{ github.base_ref }}"
336337
337338
quickstart-smoke:
339+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
338340
runs-on: depot-ubuntu-24.04-4
339341
timeout-minutes: 20
340342
needs: [goreleaser-snapshot]
@@ -423,6 +425,7 @@ jobs:
423425
fi
424426
425427
node-e2e:
428+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
426429
runs-on: depot-ubuntu-24.04-4
427430
timeout-minutes: 15
428431
steps:
@@ -548,9 +551,14 @@ jobs:
548551
retention-days: 7
549552

550553
consumer-journey-e2e:
554+
name: consumer-journey-e2e (${{ matrix.framework }})
551555
runs-on: depot-ubuntu-24.04-4
552556
timeout-minutes: 35
553557
needs: [goreleaser-snapshot, npm-pack-smoke]
558+
strategy:
559+
fail-fast: false
560+
matrix:
561+
framework: [next, nuxt, react, vue, angular]
554562
steps:
555563
- uses: actions/checkout@v6
556564

@@ -667,38 +675,52 @@ jobs:
667675
docker image inspect -f '{{.Os}}/{{.Architecture}}' "$(cat goreleaser-dist/nextgen-image.tag)" | grep -q '^linux/amd64$'
668676
echo "ZITADEL_LOCAL_IMAGE=$(cat goreleaser-dist/nextgen-image.tag)" >> "$GITHUB_ENV"
669677
670-
- name: Prepare fresh Next.js app
678+
- name: Prepare fresh ${{ matrix.framework }} app
671679
id: prepare-app
672680
env:
681+
JOURNEY_APP_URL: http://localhost:3000
682+
JOURNEY_FRAMEWORK: ${{ matrix.framework }}
673683
JOURNEY_REGISTRY_URL: http://127.0.0.1:4873
674-
JOURNEY_WORK_DIR: ${{ runner.temp }}/zitadel-cli-journey
675-
run: node apps/cli-journey-e2e/scripts/prepare-next-app.mjs
684+
JOURNEY_WORK_DIR: ${{ runner.temp }}/zitadel-cli-journey-${{ matrix.framework }}
685+
run: node apps/cli-journey-e2e/scripts/prepare-app.mjs
676686

677-
- name: Start generated Next.js app
687+
- name: Start generated ${{ matrix.framework }} app
678688
run: |
679689
cd "$JOURNEY_APP_DIR"
680-
npm run dev -- --hostname localhost --port 3000 > "$RUNNER_TEMP/next-app.log" 2>&1 &
681-
echo "NEXT_APP_PID=$!" >> "$GITHUB_ENV"
690+
APP_LOG="$RUNNER_TEMP/${{ matrix.framework }}-app.log"
691+
case "${{ matrix.framework }}" in
692+
next)
693+
npm run dev -- --hostname localhost --port 3000 > "$APP_LOG" 2>&1 &
694+
;;
695+
*)
696+
npm run dev -- --host localhost --port 3000 > "$APP_LOG" 2>&1 &
697+
;;
698+
esac
699+
echo "JOURNEY_APP_PID=$!" >> "$GITHUB_ENV"
682700
for _ in $(seq 1 90); do
683701
if curl -fsS http://localhost:3000/login >/dev/null; then
684702
exit 0
685703
fi
686704
sleep 1
687705
done
688-
echo "::error::timed out waiting for generated Next.js app"
689-
cat "$RUNNER_TEMP/next-app.log"
706+
echo "::error::timed out waiting for generated ${{ matrix.framework }} app"
707+
cat "$APP_LOG"
690708
exit 1
691709
692710
- name: Run consumer journey Playwright tests
711+
env:
712+
JOURNEY_FRAMEWORK: ${{ matrix.framework }}
713+
JOURNEY_PLAYWRIGHT_OUTPUT_DIR: apps/cli-journey-e2e/test-output/playwright/${{ matrix.framework }}/output
714+
JOURNEY_PLAYWRIGHT_REPORT_DIR: apps/cli-journey-e2e/test-output/playwright/${{ matrix.framework }}/report
693715
run: >-
694716
corepack pnpm --filter @zitadel/cli-journey-e2e
695717
exec playwright test --config playwright.config.mts
696718
697719
- name: Collect diagnostics
698720
if: failure()
699721
run: |
700-
DIAG_DIR="$RUNNER_TEMP/consumer-journey-diagnostics"
701-
APP_DIR="$RUNNER_TEMP/zitadel-cli-journey/myapp"
722+
DIAG_DIR="$RUNNER_TEMP/consumer-journey-diagnostics-${{ matrix.framework }}"
723+
APP_DIR="$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/myapp"
702724
mkdir -p "$DIAG_DIR/generated-app"
703725
if [ -d "$APP_DIR" ]; then
704726
(
@@ -711,15 +733,15 @@ jobs:
711733
> "$DIAG_DIR/logs.json" 2> "$DIAG_DIR/logs.stderr.log"
712734
) || true
713735
fi
714-
cp "$RUNNER_TEMP/next-app.log" "$DIAG_DIR/" 2>/dev/null || true
736+
cp "$RUNNER_TEMP/${{ matrix.framework }}-app.log" "$DIAG_DIR/" 2>/dev/null || true
715737
cp "$RUNNER_TEMP/verdaccio.log" "$DIAG_DIR/" 2>/dev/null || true
716-
cp "$RUNNER_TEMP/zitadel-cli-journey/doctor.json" "$DIAG_DIR/" 2>/dev/null || true
717-
cp "$RUNNER_TEMP/zitadel-cli-journey/doctor.stderr.log" "$DIAG_DIR/" 2>/dev/null || true
718-
cp "$RUNNER_TEMP/zitadel-cli-journey/start.json" "$DIAG_DIR/" 2>/dev/null || true
719-
cp "$RUNNER_TEMP/zitadel-cli-journey/start.stderr.log" "$DIAG_DIR/" 2>/dev/null || true
720-
cp "$RUNNER_TEMP/zitadel-cli-journey/setup.json" "$DIAG_DIR/" 2>/dev/null || true
721-
cp "$RUNNER_TEMP/zitadel-cli-journey/setup.stderr.log" "$DIAG_DIR/" 2>/dev/null || true
722-
cp "$RUNNER_TEMP/zitadel-cli-journey/metadata.json" "$DIAG_DIR/" 2>/dev/null || true
738+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/doctor.json" "$DIAG_DIR/" 2>/dev/null || true
739+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/doctor.stderr.log" "$DIAG_DIR/" 2>/dev/null || true
740+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/start.json" "$DIAG_DIR/" 2>/dev/null || true
741+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/start.stderr.log" "$DIAG_DIR/" 2>/dev/null || true
742+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/setup.json" "$DIAG_DIR/" 2>/dev/null || true
743+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/setup.stderr.log" "$DIAG_DIR/" 2>/dev/null || true
744+
cp "$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/metadata.json" "$DIAG_DIR/" 2>/dev/null || true
723745
cp "$APP_DIR/.zitadel/local/runtime.json" "$DIAG_DIR/runtime.json" 2>/dev/null || true
724746
cp "$APP_DIR/package.json" "$DIAG_DIR/generated-app/" 2>/dev/null || true
725747
cp "$APP_DIR/package-lock.json" "$DIAG_DIR/generated-app/" 2>/dev/null || true
@@ -728,19 +750,19 @@ jobs:
728750
if: failure()
729751
uses: actions/upload-artifact@v7
730752
with:
731-
name: consumer-journey-diagnostics
753+
name: consumer-journey-diagnostics-${{ matrix.framework }}
732754
path: |
733-
apps/cli-journey-e2e/test-output/playwright/report/**
734-
apps/cli-journey-e2e/test-output/playwright/output/**
735-
${{ runner.temp }}/consumer-journey-diagnostics/**
755+
apps/cli-journey-e2e/test-output/playwright/${{ matrix.framework }}/report/**
756+
apps/cli-journey-e2e/test-output/playwright/${{ matrix.framework }}/output/**
757+
${{ runner.temp }}/consumer-journey-diagnostics-${{ matrix.framework }}/**
736758
if-no-files-found: ignore
737759
retention-days: 7
738760

739761
- name: Tear down consumer journey services
740762
if: always()
741763
run: |
742-
if [ -n "${NEXT_APP_PID:-}" ]; then kill "$NEXT_APP_PID" 2>/dev/null || true; fi
743-
APP_DIR="$RUNNER_TEMP/zitadel-cli-journey/myapp"
764+
if [ -n "${JOURNEY_APP_PID:-}" ]; then kill "$JOURNEY_APP_PID" 2>/dev/null || true; fi
765+
APP_DIR="$RUNNER_TEMP/zitadel-cli-journey-${{ matrix.framework }}/myapp"
744766
if [ -d "$APP_DIR" ]; then
745767
(
746768
cd "$APP_DIR"
@@ -773,11 +795,17 @@ jobs:
773795
steps:
774796
- name: Check CI gate results
775797
env:
798+
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
776799
NEEDS_JSON: ${{ toJson(needs) }}
777800
run: |
778801
node <<'NODE'
779802
const needs = JSON.parse(process.env.NEEDS_JSON);
780803
const allowedSkipped = new Set(["changeset-check"]);
804+
if (process.env.IS_PULL_REQUEST === "true") {
805+
allowedSkipped.add("go-smoke-test-embedded-postgres");
806+
allowedSkipped.add("quickstart-smoke");
807+
allowedSkipped.add("node-e2e");
808+
}
781809
const failed = Object.entries(needs).filter(([name, job]) => {
782810
if (job.result === "success") return false;
783811
if (job.result === "skipped" && allowedSkipped.has(name)) return false;

AGENTS.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ Secrets").
4545
- `apps/demo-next-e2e/` and `apps/demo-nuxt-e2e/` are the Playwright projects
4646
that exercise each demo through real framework middleware against the
4747
api-mock TCP server.
48-
- `apps/cli-journey-e2e/` contains the fresh Next.js consumer journey
49-
Playwright project. It installs local package tarballs through a temporary
50-
registry and verifies CLI setup plus real registration/login flows.
48+
- `apps/cli-journey-e2e/` contains the fresh consumer journey Playwright
49+
project for every CLI-supported framework. It installs local package tarballs
50+
through a temporary registry and verifies CLI setup plus real
51+
registration/login flows.
5152
- `packages/components/` contains shared Lit components.
5253
- `packages/sdk-core/`, `packages/sdk-next/`, `packages/sdk-nuxt/`,
5354
`packages/sdk-react/`, `packages/sdk-vue/`, and `packages/sdk-angular/`
@@ -130,9 +131,9 @@ signaled and cleaned up directly.
130131
startup, then runs `go run .`. Direct `go run .` callers must sync the embed
131132
folders themselves or disable both embedded UI surfaces.
132133

133-
End-to-end tests are **opt-in locally** — they're not part of the
134-
default `run-many -t lint,typecheck,build,test` invocation because they
135-
boot real dev servers and need browsers installed:
134+
Checked-in demo end-to-end tests are **opt-in locally** and main-only in CI.
135+
They are not part of the default `run-many -t lint,typecheck,build,test`
136+
invocation because they boot real dev servers and need browsers installed:
136137

137138
```sh
138139
corepack pnpm exec playwright install
@@ -148,20 +149,22 @@ corepack pnpm run journey
148149
This runner requires Docker for Verdaccio and the CLI-managed local runtime. By
149150
default it builds a local runtime image, ensures the Playwright Chromium
150151
browsers are installed, builds and packs local npm packages with pnpm, creates
151-
an empty app directory outside the repo, runs `npx @zitadel/cli@alpha doctor`,
152-
`start`, and `setup --framework next --server local`, starts the generated app
153-
on `localhost`, and runs Playwright with one worker. Use
154-
`-- --image <docker-tag>` to reuse an existing local runtime image.
152+
empty app directories outside the repo, runs `npx @zitadel/cli@alpha doctor`,
153+
`start`, and `setup --framework <id> --server local`, starts the generated apps
154+
on `localhost`, and runs Playwright with one worker per framework journey. Use
155+
`-- --framework next` to run one framework and `-- --image <docker-tag>` to
156+
reuse an existing local runtime image.
155157

156158
Use `corepack pnpm run journey` for deterministic CI-style proof of the
157159
fresh-app path. Use `corepack pnpm run cli -- ...` for manual browser or agent
158160
experiments against the same local package train.
159161

160-
In CI the dedicated `node-e2e` job (in `.github/workflows/ci.yml`) gates merges
161-
on the checked-in demo integrations. The separate `consumer-journey-e2e` job is
162-
the fresh-app quality gate: it consumes the current workflow's GoReleaser image
163-
and npm package artifacts instead of public Zitadel packages. Browsers are
164-
cached on the runner to reduce install cost.
162+
In CI the `consumer-journey-e2e` matrix is the required PR runtime gate: it
163+
consumes the current workflow's GoReleaser image and npm package artifacts
164+
instead of public Zitadel packages. The checked-in demo integrations
165+
(`node-e2e`), raw binary embedded-postgres smoke, and documented quick-start
166+
compose smoke run on pushes to `main` as release-surface confidence checks.
167+
Browsers are cached on the runner to reduce install cost.
165168

166169
## Testing Layers
167170

@@ -331,7 +334,7 @@ Standard commands are documented in root `AGENTS.md` → **Local Checks** and
331334

332335
- **Fast local checks:** `corepack pnpm run check`
333336
- **Full local checks:** `corepack pnpm run check -- --full`
334-
- **E2E:** `corepack pnpm nx run-many -t e2e -p @zitadel/demo-next-e2e,@zitadel/demo-nuxt-e2e`
337+
- **Demo E2E (manual/main-only):** `corepack pnpm run check -- --only node:e2e`
335338
- **Consumer journey E2E:** `corepack pnpm run journey`
336339

337340
### Running demo apps manually

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ corepack pnpm run journey
153153
This opt-in check ensures the Playwright Chromium browsers are installed, builds
154154
the local npm packages, publishes them to a temporary Verdaccio registry, runs
155155
`npx @zitadel/cli@alpha doctor`, `start`, and
156-
`setup --framework next --server local` in an empty app directory, starts the
157-
generated app, and verifies registration/login journeys.
156+
`setup --framework <id> --server local` in fresh app directories for every
157+
supported framework, starts the generated apps, and verifies registration/login
158+
journeys. Use `corepack pnpm run journey -- --framework next` to run only the
159+
Next.js journey.
158160

159161
Use `corepack pnpm run journey` for deterministic CI-style proof. Use
160162
`corepack pnpm run cli -- ...` when you want to drive the same local package

apps/cli-journey-e2e/AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ These instructions apply to `apps/cli-journey-e2e/**`. Defer to the root
55

66
## Purpose
77

8-
This project protects the customer local setup journey. Tests must exercise a
9-
fresh app directory that runs the CLI local runtime path (`doctor`, `start`,
10-
`setup --server local`) before starting the generated Next.js app. It must not
11-
test the checked-in demo apps.
8+
This project protects the customer local setup journey across every supported
9+
CLI framework. Tests must exercise a fresh app directory that runs the CLI local
10+
runtime path (`doctor`, `start`, `setup --server local`) before starting the
11+
generated app. It must not test the checked-in demo apps.
1212

1313
## Maintenance Rules
1414

@@ -20,8 +20,8 @@ test the checked-in demo apps.
2020
- CI must install Zitadel packages from current workflow tarballs through the
2121
temporary Verdaccio registry, not from public npm.
2222
- CI must run `npx @zitadel/cli@alpha doctor`, `start`, and
23-
`setup --framework next --server local` from the fresh app directory with
24-
`--non-interactive --json`.
23+
`setup --framework <next|nuxt|react|vue|angular> --server local` from the
24+
fresh app directory with `--non-interactive --json`.
2525
- Pack and upload only the public packages:
2626
`@zitadel/cli`, `@zitadel/api`, `@zitadel/components`,
2727
`@zitadel/sdk-core`, `@zitadel/sdk-next`, `@zitadel/sdk-nuxt`,

0 commit comments

Comments
 (0)