feat: implement @repo/brand package for centralized asset management and automated distribution to consuming apps
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# @repo/brand
|
||||
|
||||
This package serves as the single source of truth for our brand identity, containing static visual assets (logos, favicons) and brand information.
|
||||
|
||||
## 📁 Public Assets
|
||||
|
||||
Place your raw, static brand assets inside the `public/` directory:
|
||||
|
||||
- **`logo.png`** — Primary brand logo
|
||||
- **`favicon.svg`** — Browser favicon
|
||||
|
||||
### How Assets are Distributed
|
||||
|
||||
Due to monorepo constraints, frameworks like Vite or Next.js do not natively serve static assets from external packages. To solve this, these files are automatically copied into the consuming apps' `public/brand/` directories via the `scripts/copy-brand-assets.js` script.
|
||||
|
||||
This makes them directly available in the browser at:
|
||||
- `/brand/logo.png`
|
||||
- `/brand/favicon.svg`
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Usage in Consuming Apps
|
||||
|
||||
### 1. Automate the Copy Process
|
||||
To ensure the consuming app always has the latest brand assets, add the copy script to the app's `package.json` (e.g., in `apps/web/package.json`):
|
||||
|
||||
```json
|
||||
"scripts": {
|
||||
"copy:brand": "node ../../packages/brand/scripts/copy-brand-assets.js",
|
||||
"dev": "pnpm run copy:brand && vite --clearScreen false",
|
||||
"build": "pnpm run copy:brand && tsc && vite build"
|
||||
}
|
||||
Reference in New Issue
Block a user