Skip to content

feat(chat-ui): @fuzefront/chat-ui design-system chat frontend + shell integration - #90

Merged
izzywdev merged 2 commits into
masterfrom
feat/chat-ui-final
Jun 22, 2026
Merged

feat(chat-ui): @fuzefront/chat-ui design-system chat frontend + shell integration#90
izzywdev merged 2 commits into
masterfrom
feat/chat-ui-final

Conversation

@izzywdev

Copy link
Copy Markdown
Owner

Re-opened from #79 (which hit a stuck GitHub CONFLICTING mergeability cache despite behind_by:0). Same commit, fresh branch for a clean mergeability/CI computation. Chat-ui consumed via file: deps + tsconfig dist; CI builds chat-client+chat-ui before frontend type-check/bundle; ignoreDeprecations for tsup DTS (TS 6.0.3 baseUrl); linux lockfiles.

🤖 Generated with Claude Code

… integration

Squashed onto current master to clear a stale GitHub CONFLICTING flag (compare
showed behind_by=0; merge-commit history confused mergeability). Net content
unchanged: chat-ui package consumed via file: deps + tsconfig dist paths, CI builds
chat-client+chat-ui before frontend type-check/bundle, ignoreDeprecations for tsup
DTS (TS 6.0.3 baseUrl), linux-regenerated lockfiles.
@github-actions

Copy link
Copy Markdown
Contributor

CI Fix — branch claude-auto-fix-ci-feat/chat-ui-final-27972100553

Root cause: @fuzefront/chat-client compiles to CommonJS via plain tsc. Rollup (inside Vite) resolves it to packages/chat-client/dist/index.js and attempts static analysis. The TypeScript-compiled CJS barrel uses the __exportStar helper, which Rollup cannot statically introspect — so named exports like ChatServiceClient appear missing, producing:

"ChatServiceClient" is not exported by "../packages/chat-client/dist/index.js"

Fix (4 lines in frontend/vite.config.ts): Added a Vite resolve.alias for @fuzefront/chat-client pointing to its TypeScript source (packages/chat-client/src/index.ts). This matches the existing pattern for @fuzefront/identity-ui and @fuzefront/i18n. Vite processes the TS source natively, bypassing the CJS intermediary.

The fix has been pushed to claude-auto-fix-ci-feat/chat-ui-final-27972100553. Please merge or cherry-pick commit 4ade3a3 into this PR to unblock CI.

🤖 Generated with Claude Code

…named exports

vite build failed: 'ChatServiceClient is not exported by chat-client/dist/index.js'.
Plain tsc emitted CJS (__exportStar(require())) which rollup can't statically
analyse. Switch chat-client to tsup dual-build (esm+cjs+dts) + exports map; the ESM
output keeps 'export { ChatServiceClient }' static. +ignoreDeprecations for the
tsup DTS step (TS 6.0.3 baseUrl). Verified ESM export in a container.
@github-actions

Copy link
Copy Markdown
Contributor

CI Failure Analysis: Playwright sign-in flow

Root cause: The e2e.yml job was missing a build step for @fuzefront/chat-client and @fuzefront/chat-ui before building the frontend.

What's happening

frontend/package.json depends on @fuzefront/chat-ui (added in this PR):

"@fuzefront/chat-ui": "file:../packages/chat-ui"

packages/chat-ui/package.json resolves only from dist/:

"main": "dist/index.cjs",
"module": "dist/index.js"

Vite has no source alias for @fuzefront/chat-ui in vite.config.ts (unlike identity-ui and i18n which are aliased to their source). So when the frontend build runs, Vite tries to load packages/chat-ui/dist/index.js, which doesn't exist — the package was never built.

ci.yml already handles this correctly:

- name: Build @fuzefront/chat-client + chat-ui (for frontend type-check)
  run: |
    npm run -w @fuzefront/chat-client build
    npm run -w @fuzefront/chat-ui build

But e2e.yml (the failing "Playwright sign-in flow" job) is missing this step before its "Build & preview frontend" step.

The PostgreSQL FATAL: database "fuzeinfra" does not exist errors in the logs are from the pg_isready -U fuzeinfra health check (no -d flag, so pg connects to a DB named after the user). These are benign log noise — the actual failure is the frontend build crashing.

Fix

Add the following step to e2e.yml before the "Build & preview frontend" step:

# @fuzefront/chat-ui (and its dep chat-client) are resolved from their dist/
# directories (no vite source alias) — build them before the frontend bundle.
- name: Build @fuzefront/chat-client + chat-ui (frontend deps)
  run: |
    npm run -w @fuzefront/chat-client build
    npm run -w @fuzefront/chat-ui build

I prepared this fix in branch claude-auto-fix-ci-feat/chat-ui-final-27972111977 but the GitHub App token used for this automated fix lacks the workflows permission needed to push .github/workflows/ changes. Please apply the one-line addition manually or grant the app workflows write permission.

@izzywdev
izzywdev merged commit c6d05b2 into master Jun 22, 2026
15 of 19 checks passed
@izzywdev
izzywdev deleted the feat/chat-ui-final branch June 22, 2026 17:51
@github-actions

Copy link
Copy Markdown
Contributor

CI Fix — Node.js 24 ESM resolution crash

Root cause: The "Playwright sign-in flow / Build & start backend" step fails because shared/dist/kafka/index.js was compiled with module: esnext, producing bare ESM re-exports (export * from './types'). GitHub Actions silently upgraded the runner to Node.js 24 (Node 20 is now deprecated on GHA). Node.js 24 detects export * syntax and switches to ESM module loading, which requires explicit .js extensions on relative imports — but there are none, so it throws ERR_MODULE_NOT_FOUND.

Fix: tsconfig.kafka.json already declares module: "commonjs" for the kafka sub-tree. The dist just wasn't built from it. Rebuilt with tsc -p tsconfig.kafka.json; all 13 shared/dist/kafka/ JS files now emit CJS require() calls, which have no extension requirements.

Branch with fix: claude-auto-fix-ci-feat/chat-ui-final-27972667578 (commit 912e8ee)

To merge the fix into this PR:

git fetch origin claude-auto-fix-ci-feat/chat-ui-final-27972667578
git merge origin/claude-auto-fix-ci-feat/chat-ui-final-27972667578

(A PR from that branch targeting feat/chat-ui-final could not be auto-created due to Actions permissions.)

izzywdev pushed a commit that referenced this pull request Jun 22, 2026
…rt resolution

Mirror the proven @fuzefront/chat-client fix (#90): billing-ui keeps
@fuzefront/billing-client external, so the host vite/rollup bundle must
statically resolve its named exports. Plain tsc emitted CJS __exportStar(require())
-> 'X is not exported' at host build. tsup emits static ESM re-exports + .d.ts +
.cjs. Adds module/exports map + tsup devDep; tsconfig ignoreDeprecations '6.0'
(TS 6.0.3 baseUrl escalation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
izzywdev added a commit that referenced this pull request Jun 23, 2026
…caffold (#92)

* feat(secrets): credential-free seal-secret.sh + fuzefront-secrets SealedSecret scaffold

seal-secret.sh <KEY>: hidden-prompt → fetch current public cert from FuzeInfra
(stable URL; handles key rotation) → kubeseal --cert --merge-into the manifest
IN PLACE (preserves other keys). Per-repo scope hard-coded (fuzefront/
fuzefront-secrets), --scope/--cert/--in/--manifest overrides. No kubeconfig: only
the public cert is needed to seal; FuzeInfra holds the decrypt key.

Manifest is the SHARED app secret (Authentik/Permit/DB/OAuth/messaging/LLM +
billing) — documented full key inventory + loud warning never to sync it empty
(would clobber live keys). Populate every key via the script before Argo-wiring.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(secrets): ASCII-only comments in sealed manifest (avoid cp1252/tool encoding issues)

* refactor(secrets): per-service billing-secrets (least privilege) instead of shared blob

Billing's 3 sensitive keys (STRIPE_SECRET_KEY/STRIPE_WEBHOOK_SECRET/
BILLING_INTERNAL_TOKEN) now live in their OWN SealedSecret 'billing-secrets';
billing-service Deployment references it (DB_PASSWORD/PERMIT_API_KEY stay shared in
fuzefront-secrets). A compromised billing pod can't read Authentik/SMTP/OAuth/LLM
secrets, and sealing/rotating billing keys can't clobber other services. Dropped
the shared-secret scaffold (operator-owned). seal-secret.sh defaults to scope
fuzefront/billing-secrets and is marked an interim copy (canonical tool + cert URL +
methodology owned by FuzeInfra, delegated separately).

* feat(billing): enable + complete billing deploy (ingress carve-out, billing_svc role, DB, secrets)

- values: complete billingService (dbUser=billing_svc, secretName=billing-secrets,
  meterFlushIntervalSec, permitPdpUrl, dbBootstrap) — template referenced these but
  they were undefined (billing never actually deployed).
- billing-db-bootstrap Job (pre-install, idempotent): creates least-privilege
  billing_svc role + 'billing' schema + grants via psql as the superuser. billing-
  service self-migrates its schema on boot as billing_svc.
- ingress carve-out: ONLY /api/v1/billing/webhooks/stripe is public (Exact match,
  Stripe-signature verified); rest of /api/v1/billing stays internal.
- billing-secrets gains BILLING_DB_PASSWORD (billing_svc's password); STRIPE/BILLING
  env always render (dropped the Helm-values guards — SealedSecret provides them).
- values-prod: billingService.enabled=true (fixed a duplicate-key bug that clobbered
  it — billingService was declared twice; merged node-2 affinity into one block).
- Verified: helm lint clean + helm template renders all billing artifacts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* build(billing-client): tsup dual-build (ESM+CJS) for host static export resolution

Mirror the proven @fuzefront/chat-client fix (#90): billing-ui keeps
@fuzefront/billing-client external, so the host vite/rollup bundle must
statically resolve its named exports. Plain tsc emitted CJS __exportStar(require())
-> 'X is not exported' at host build. tsup emits static ESM re-exports + .d.ts +
.cjs. Adds module/exports map + tsup devDep; tsconfig ignoreDeprecations '6.0'
(TS 6.0.3 baseUrl escalation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(deploy): lock path-based service URL convention (/api/v1/<svc>, internal-by-default)

Decision: path-based routing under the single app host, not per-service
subdomains (one cert, no DNS churn, same-origin/no-CORS, shared cookies).
Services internal-only by default; ingress carves out only public paths
(billing's Stripe webhook); browser-facing APIs go through host-backend proxy
with the service's internal token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: AppHub Developer <developer@apphub.dev>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant