From ce98c44fcf27cb650315419efa13104488e42c21 Mon Sep 17 00:00:00 2001 From: BilalG1 Date: Mon, 1 Jun 2026 10:50:46 -0700 Subject: [PATCH] fix(hexclave): rename leftover @stackframe/stack-shared imports in template providers (#1525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why the build fails on `origin/dev` The `Lint & build` workflow fails at the **Build** step, in `@hexclave/lovable-react-18-example`'s `vite build`: ``` [vite]: Rollup failed to resolve import "@stackframe/stack-shared/dist/utils/globals" from ".../packages/react/dist/esm/providers/stack-context.js". ``` (failing run: [job 78596906597](https://github.com/hexclave/stack-auth/actions/runs/26665187298/job/78596906597)) ### Root cause PR 3 (`feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring`, #1482) renamed `@stackframe/stack-shared` → `@hexclave/shared` and **deleted the dual-publish wiring**, so `@stackframe/stack-shared` is no longer a resolvable package. Two `packages/template/src` provider files were missed in that rename: - `packages/template/src/providers/stack-context.tsx` - `packages/template/src/providers/translation-provider-client.tsx` `packages/react` ships only `package.json`; its `src`/`dist` are **generated** from `packages/template/src` by `generate-sdks`, which copies import specifiers verbatim. So the stale `@stackframe/stack-shared` import propagated into `packages/react/dist`. The `@hexclave/react` build itself **succeeds** because tsdown/rolldown externalizes the import (it never has to resolve it). The failure only surfaces downstream, when `lovable-react-18-example` bundles `@hexclave/react` with Vite/Rollup and tries to actually resolve `@stackframe/stack-shared` — a package that no longer exists. ## Fix Point both imports at the renamed package, matching the convention already used by sibling files (e.g. `stack-provider-client.tsx`, `common.ts`): ```diff -import { createGlobal } from "@stackframe/stack-shared/dist/utils/globals"; +import { createGlobal } from "@hexclave/shared/dist/utils/globals"; ``` ## Verification Reproduced and confirmed the fix locally: 1. Edited the two template files. 2. `pnpm -w run generate-sdks` → generated `packages/react/src` now imports `@hexclave/shared/dist/utils/globals`. 3. `pnpm --filter @hexclave/react run build` → `dist/esm/providers/stack-context.js` now imports `@hexclave/shared` ✔ 4. `pnpm --filter @hexclave/lovable-react-18-example run build` → **`✓ built`** (previously failed at this exact step). --- ## Summary by cubic Rename leftover imports from `@stackframe/stack-shared` to `@hexclave/shared` in the template providers to fix downstream build failures. This unblocks Vite/Rollup consumers (e.g., `@hexclave/lovable-react-18-example`) by resolving `createGlobal` from the correct package. Written for commit 15901edb2bc4c104ccba1917b18cdf17b7c569ff. Summary will update on new commits. Review in cubic ## Summary by CodeRabbit * **Chores** * Updated internal module dependencies across provider configurations. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/hexclave/stack-auth/pull/1525?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) --- packages/template/src/providers/stack-context.tsx | 2 +- packages/template/src/providers/translation-provider-client.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/template/src/providers/stack-context.tsx b/packages/template/src/providers/stack-context.tsx index 289da0fd2..4e1fed420 100644 --- a/packages/template/src/providers/stack-context.tsx +++ b/packages/template/src/providers/stack-context.tsx @@ -1,7 +1,7 @@ "use client"; import React from "react"; -import { createGlobal } from "@stackframe/stack-shared/dist/utils/globals"; +import { createGlobal } from "@hexclave/shared/dist/utils/globals"; import type { StackClientApp } from "../lib/stack-app/apps/interfaces/client-app"; type StackContextValue = { diff --git a/packages/template/src/providers/translation-provider-client.tsx b/packages/template/src/providers/translation-provider-client.tsx index 693b6f570..e6593772c 100644 --- a/packages/template/src/providers/translation-provider-client.tsx +++ b/packages/template/src/providers/translation-provider-client.tsx @@ -1,7 +1,7 @@ "use client"; import React from "react"; -import { createGlobal } from "@stackframe/stack-shared/dist/utils/globals"; +import { createGlobal } from "@hexclave/shared/dist/utils/globals"; type TranslationContextValue = { quetzalKeys: Map,