Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/export-validation-from-subpaths.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"brand-shell": minor
---

Export `validateBrandDetails` and `validateBrandTheme` from `brand-shell/vue` and `brand-shell/web`.

Previously these were only available from the `brand-shell` root, which is the React bundle. Non-React consumers (Vue, Svelte, web components) that imported validation functions from the root would cause Vite to load the React adapter and fail with a `react/jsx-runtime` error.

**Migration for Vue/Svelte/web-component apps:**

```diff
- import { validateBrandDetails, validateBrandTheme } from 'brand-shell'
+ import { validateBrandDetails, validateBrandTheme } from 'brand-shell/vue' // Vue
+ import { validateBrandDetails, validateBrandTheme } from 'brand-shell/web' // Svelte / vanilla
```
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
run: bun install --frozen-lockfile && bun run build

- name: Pack
run: bun pack
run: bun pm pack

- name: Install react-npm starter
run: bun install --cwd starters/react-npm
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const DEFAULT_DETAILS: BrandDetails = {
linkedin: "https://linkedin.com/in/example",
github: "https://github.com/example",
twitter: "https://x.com/example",
gmail: "hello@example.com",
email: "hello@example.com",
tagline: "One shared brand shell across frameworks.",
};

Expand Down Expand Up @@ -91,11 +91,11 @@ import "brand-shell/default.css";

<BrandHeader :details="details" :theme="theme" />
<BrandFooter :details="details" :theme="theme" />`,
svelte: `import { brandShell } from "brand-shell/svelte";
svelte: `import { BrandHeader, BrandFooter } from "brand-shell/svelte";
import "brand-shell/default.css";

<brand-header use:brandShell={{ details, theme }} />
<brand-footer use:brandShell={{ details, theme }} />`,
<BrandHeader {details} {theme} />
<BrandFooter {details} {theme} />`,
web: `import { applyBrandShellProps, registerBrandShellElements } from "brand-shell/web";
import "brand-shell/default.css";

Expand Down
1 change: 1 addition & 0 deletions src/vue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { assertValidBrandDetails, assertValidBrandTheme, shouldValidateInDev } f
import { applyBrandShellProps, registerBrandShellElements, type BrandShellElementLike, type LinkFactoryOptions } from "../web";

export type { BrandDetails, BrandTheme } from "../core";
export { validateBrandDetails, validateBrandTheme } from "../core";
export type { LinkFactoryOptions } from "../web";

export interface BrandShellVueProps {
Expand Down
1 change: 1 addition & 0 deletions src/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from "../core";

export type { BrandAction, BrandDetails, BrandNavLink, BrandTheme } from "../core";
export { validateBrandDetails, validateBrandTheme } from "../core";

const SVG_NS = "http://www.w3.org/2000/svg";

Expand Down