mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-31 15:37:49 +00:00
Removes Font Awesome entirely
### Changes
- All ~1,000 icon call sites now import Lucide components directly from
`lucide-react` (`<PlayIcon className="..." />`); no FA packages, tokens,
or `fa*` identifiers remain anywhere.
- New `@storyteller/icons` lib holds the pieces Lucide doesn't ship:
`DynamicIcon` for runtime-chosen icons (`icon={loading ?
LoaderCircleIcon : SaveIcon}`), 11 brand logos (Discord, TikTok, ...) as
inlined CC BY 4.0 paths, and HD/SD quality badges drawn in Lucide's
stroke style.
- Global `.lucide { display: inline-block; width/height: 1.2em }` rule
in each app stylesheet: keeps icons font-relative like FA (1.2em
compensates Lucide's 24px-viewBox/20px-grid padding) and undoes Tailwind
preflight's `svg { display: block }`. Explicit `w-*`/`size-*` utilities
still win.
- FA-only props migrated: `spin` → `animate-spin`, FA size strings → em
values.
- Dropped `@fortawesome/*` + `@awesome.me` kit deps, both `.npmrc`
files, and
the FA rule in `shared-vite-config.ts` (now externalizes
`lucide-react`).
60 lines
1.4 KiB
TypeScript
60 lines
1.4 KiB
TypeScript
/**
|
|
* Shared Vite configuration for library builds.
|
|
*
|
|
* This ensures that:
|
|
* 1. React is always externalized (peer dependency)
|
|
* 2. @preact/signals-* packages are externalized to prevent duplicate state
|
|
* 3. @storyteller/* workspace packages are externalized so libraries don't bundle each other
|
|
*
|
|
* Without this, stateful modules like signals get bundled multiple times,
|
|
* causing state isolation issues in production builds.
|
|
*/
|
|
|
|
/**
|
|
* Returns true if the given module ID should be externalized during library builds.
|
|
*/
|
|
export function isExternal(id: string): boolean {
|
|
// Always externalize React
|
|
if (
|
|
id === 'react' ||
|
|
id === 'react-dom' ||
|
|
id === 'react/jsx-runtime' ||
|
|
id.startsWith('react/') ||
|
|
id.startsWith('react-dom/')
|
|
) {
|
|
return true;
|
|
}
|
|
|
|
// Other react libraries
|
|
if (
|
|
id === 'react-hot-toast' ||
|
|
id === 'react-router-dom' ||
|
|
id.startsWith('react-')
|
|
) {
|
|
return true;
|
|
}
|
|
|
|
// Externalize @preact/signals to prevent duplicate signal state
|
|
if (id.startsWith('@preact/signals')) {
|
|
return true;
|
|
}
|
|
|
|
// Other important libraries
|
|
if (
|
|
id === 'konva' ||
|
|
id === 'three' ||
|
|
id === 'zustand' ||
|
|
id === 'wavesurfer.js' ||
|
|
id === 'lucide-react'
|
|
) {
|
|
return true;
|
|
}
|
|
|
|
// Externalize all workspace packages so libraries don't bundle each other
|
|
if (id.startsWith('@storyteller/') || id.startsWith('@frontend/')) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|