mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
## Stack Auth → Hexclave rename — PR 5 (internal symbols, paths,
packages, brand strings)
PR 5 finishes the **internal / non-wire** half of the Stack→Hexclave
rename. It only touches things where nothing outside the repo depends on
the exact name: internal symbols, file/dir names, the
`@stackframe/template` package, and residual brand strings. Plan +
progress are in `HEXCLAVE-RENAME-PR5-PLAN.md`.
Every step was verified green (`pnpm typecheck` + `pnpm lint`, 28/28)
and committed as its own checkpoint, then a fan-out of review agents
audited all commits and the findings were fixed.
### What changed
- **Internal symbols** (`@hexclave/shared`, `packages/template`, apps):
`stack*`/`Stack*` → `hexclave*`/`Hexclave*` — incl.
`stackGlobalsSymbol`, the `_Stack*AppImpl` classes,
`stackAppInternalsSymbol`, `StackContext`, `getStackStripe`, etc. The
`stack*App` local-variable convention
(`stackServerApp`/`stackClientApp`/…) was renamed across 175
source/example/doc files.
- **File renames**: `hexclave-handler/provider/context.tsx`,
`backend/hexclave.tsx`, `internal-tool/hexclave.ts`,
`hexclave-app-internals.ts`.
- **Directory renames**: `lib/hexclave-app`, `hexclave-companion`,
`[...hexclave]` route segment, `skills/hexclave`,
`dashboard/src/hexclave`, and the package dirs
**`packages/{next,shared,ui,sc,cli}`** (dropping the `stack-` prefix to
match the `@hexclave/*` npm names).
- **Packages**: `@stackframe/template` → `@hexclave/template`; **deleted
`packages/init-stack`** (onboarding lives in `@hexclave/cli init`; the
published npm package is untouched).
- **Brand strings**: reworded `Stack Auth`/`Stack dashboard` prose in
code + docs-mintlify, renamed `hexclave-app.mdx`/`use-hexclave-app.mdx`
with redirects, regenerated OpenAPI, updated coupled e2e assertions;
`doctor`/`init` now prefer `hexclave.config.ts`.
### Intentionally kept (verified, not oversights)
Wire/compat identifiers (`x-stack-*` headers, `stack-*` cookies,
`STACK_*` env names, `*.stack-auth.com`, `stackauth_`, `ask_stack_auth`,
query params), public `Stack*` SDK aliases, crypto/JWT/vault
domain-separation tags, `*-brand-sentinel`s, the
`Symbol.for("StackAuth--…")` string, `_stack_sync_metadata`, Postgres
`stackframe` / docker image names, the `stack-auth-logo*.svg` (used by
the rebrand modal), and `migration.mdx` / "formerly known as Stack Auth"
notes. False positives (Phosphor `StackIcon`/`StackSimple`, `TanStack`,
`OrbStack`, `stackable`/`Stacked` charts) left alone.
### Review pass
Six review agents audited all commits. Found + fixed one real bug — a
build script (`bundle-type-definitions.ts`) hardcoded the old
`lib/stack-app` glob path (not an import, so typecheck/lint were blind),
silently emptying the dashboard AI type bundle — plus stale comments, a
dead CI env var, and stale `.gitignore`/`.dockerignore` entries.
Cross-cutting audit confirmed **zero wire-compat identifiers were
accidentally renamed**.
### ⚠️ Verification note
`typecheck` + `lint` are fully green locally. The **e2e suite was not
run** (needs a live backend+DB), so the brand-string assertion +
OpenAPI-regen changes are verified by grep/codegen only — please let CI
exercise e2e to confirm.
### Base-branch note
This branch was forked from the local-only `cl/friendly-lewin-72293f`
(not on origin, no separate PR), so this PR against `dev` also carries
that branch's ~11 preceding Hexclave-rename commits (config-file rename,
env-var dual-read, AI setup-prompt rebrand). If those should land
separately, re-parent before merge.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Finishes the internal Stack Auth → Hexclave rename and cleans up
remaining stragglers, including dev-tool and prompt copy. All changes
are internal-only; public/wire APIs remain unchanged. Re-merged `dev`
and resolved the payments create-purchase-url conflict.
- **Refactors**
- Internal symbols: stack*/Stack* → hexclave*/Hexclave* (e.g.,
`getHexclaveServerApp` via `@/hexclave`, `getHexclaveStripe`,
`hexclaveAppInternalsSymbol`, `hexclaveSchemaInfo`, Prisma
`__hexclave_*`, `data-hexclave-handler-page`, Stripe mock
`hexclavePortPrefix`).
- Files/dirs: moved to `lib/hexclave-app`; handler route
`[...hexclave]`; backend entry `src/hexclave.tsx`; dashboard internals
`hexclave-app-internals`; companion `hexclave-companion`; dropped
`stack-` prefix across package dirs
(`packages/{shared,ui,sc,cli,next}`); workflows/emulator paths now
`packages/cli`; Quetzal codegen env at `packages/next/.env.local`.
- Packages/docs: `@stackframe/template` → `@hexclave/template`; removed
`packages/init-stack`; regenerated OpenAPI and updated docs
slugs/redirects for hexclave-app/use-hexclave-app.
- Brand strings/prompts: reworded remaining “Stack” dashboard strings to
Hexclave; updated dev-tool copy and prompts; `doctor/init` now prefer
`hexclave.config.ts`. Kept all wire-compat identifiers and public
aliases (`x-stack-*`, `stack-*` cookies, `STACK_*` env,
`*.stack-auth.com`, `Stack*` SDK names).
- Rebased/merged onto latest `dev`: retained `@hexclave/template`, kept
`src` in published files, refreshed setup-prompt imports and docs JSON,
adopted 1.0.5 version bumps, and re-merged `dev` again (resolved
`create-purchase-url` with `getHexclaveStripe`).
- **Bug Fixes**
- Restored dashboard AI type bundle by pointing the glob to
`packages/template/src/lib/hexclave-app`.
- Addressed rename leftovers: updated lingering `@/stack` imports and
CSS selector, fixed schema/meta and port-prefix expansions, and aligned
emulator commands to `packages/cli`.
- CI/build: removed a dead env var and stale ignore entries; fixed
Docker by renaming `STACK_SKIP_TEMPLATE_GENERATION` →
`HEXCLAVE_SKIP_TEMPLATE_GENERATION`.
<sup>Written for commit 3c1af3bff3.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/hexclave/hexclave/pull/1547?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
193 lines
7.4 KiB
YAML
193 lines
7.4 KiB
YAML
name: Runs E2E API Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
|
|
|
|
jobs:
|
|
build:
|
|
name: E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }})
|
|
runs-on: ubicloud-standard-8
|
|
env:
|
|
NODE_ENV: test
|
|
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
|
|
STACK_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"
|
|
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
|
|
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [22.x]
|
|
freestyle-mode: [mock, prod]
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
|
|
|
|
# Even just starting the Docker Compose as a daemon is slow because we have to download and build the images
|
|
# so, we run it in the background
|
|
- name: Start Docker Compose in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: docker compose -f docker/dependencies/docker.compose.yaml up --pull always -d &
|
|
# we don't need to wait on anything, just need to start the daemon
|
|
wait-on: /dev/null
|
|
tail: true
|
|
wait-for: 3s
|
|
log-output-if: true
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Create .env.test.local file for apps/backend
|
|
run: cp apps/backend/.env.development apps/backend/.env.test.local
|
|
|
|
- name: Override Freestyle API key for prod mode
|
|
if: matrix.freestyle-mode == 'prod'
|
|
run: |
|
|
echo "STACK_FREESTYLE_API_KEY=${{ secrets.STACK_FREESTYLE_REAL_API_KEY }}" >> apps/backend/.env.test.local
|
|
|
|
- name: Create .env.test.local file for apps/dashboard
|
|
run: cp apps/dashboard/.env.development apps/dashboard/.env.test.local
|
|
|
|
- name: Create .env.test.local file for apps/e2e
|
|
run: cp apps/e2e/.env.development apps/e2e/.env.test.local
|
|
|
|
- name: Create .env.test.local file for docs
|
|
run: cp docs/.env.development docs/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/cjs-test
|
|
run: cp examples/cjs-test/.env.development examples/cjs-test/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/demo
|
|
run: cp examples/demo/.env.development examples/demo/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/docs-examples
|
|
run: cp examples/docs-examples/.env.development examples/docs-examples/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/e-commerce
|
|
run: cp examples/e-commerce/.env.development examples/e-commerce/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/middleware
|
|
run: cp examples/middleware/.env.development examples/middleware/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/supabase
|
|
run: cp examples/supabase/.env.development examples/supabase/.env.test.local
|
|
|
|
- name: Create .env.test.local file for examples/convex
|
|
run: cp examples/convex/.env.development examples/convex/.env.test.local
|
|
|
|
- name: Create .env.test.local file for apps/internal-tool
|
|
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Wait on Postgres
|
|
run: pnpm run wait-until-postgres-is-ready:pg_isready
|
|
|
|
- name: Wait on Inbucket
|
|
run: pnpm exec wait-on tcp:localhost:8129
|
|
|
|
- name: Wait on Svix
|
|
run: pnpm exec wait-on tcp:localhost:8113
|
|
|
|
- name: Wait on QStash
|
|
run: pnpm exec wait-on tcp:localhost:8125
|
|
|
|
- name: Wait on ClickHouse
|
|
run: pnpm exec wait-on http://localhost:8136/ping
|
|
|
|
- name: Initialize database
|
|
run: pnpm run db:init
|
|
|
|
- name: Start stack-backend in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: pnpm run start:backend --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start stack-mcp in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: pnpm run start:mcp --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8144/health
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start stack-dashboard in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: pnpm run start:dashboard --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8101
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start mock-oauth-server in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: pnpm run start:mock-oauth-server --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start run-email-queue in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: pnpm -C apps/backend run run-email-queue --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
- name: Start run-cron-jobs in background
|
|
uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
|
|
with:
|
|
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
|
|
wait-on: |
|
|
http://localhost:8102
|
|
tail: true
|
|
wait-for: 30s
|
|
log-output-if: true
|
|
|
|
- name: Wait 10 seconds
|
|
run: sleep 10
|
|
|
|
- name: Run tests
|
|
run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} ${{ matrix.freestyle-mode == 'prod' && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' && 'mail' || '' }}
|
|
|
|
- name: Run tests again (attempt 1)
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
|
run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
|
|
|
|
- name: Run tests again (attempt 2)
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
|
run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
|
|
|
|
- name: Verify data integrity
|
|
run: pnpm run verify-data-integrity --no-bail
|
|
|
|
- name: Print Docker Compose logs
|
|
if: always()
|
|
run: docker compose -f docker/dependencies/docker.compose.yaml logs
|