This README explains how to build the library, consume the package locally or from a tarball, and run Storybook for local component development.
- Node.js (14+ recommended)
- bun
- Ensure peerDependencies (React, ReactDOM, etc.) required by the package are installed in the consuming project
-
"peerDependencies": { "react": "18", "react-dom": "18", "@phosphor-icons/react": "2", "frosted-ui": "0.0.1" },
-
- "build" — builds component library artifacts
- "storybook" — spins up local Storybook instance
- "generate" — scaffolds a component package via Plop
-
Run the generator:
bun run generate -
Choose the component layer (atom / molecule / compound) and provide the component name.
-
Opt in or out of the optional files (types, CSS module, Storybook story) when prompted.
The generator creates the selected files under lib/<layer>/<Component>/ and appends an export to the relevant lib/<layer>/index.ts. Regenerate is safe — existing files or exports are skipped.
- Clone and enter the repo:
git clone <repo-url>
cd <directoy-cloned-into>
- Install dependencies:
bun install
Build the library
- Standard build (run the script defined in package.json):
bun run build - Verify output in
lib/and that package.jsonmain/module/typespoint to the built files.
- From the package root:
bun pack
This produces <package-name>-<version>.tgz (scoped names become a tarball named without the scope). 2. In the consumer project:
bun add /full/path/to/@deeptrust-deep-ui-1.2.3.tgz
- Import as usual:
import { Button } from '@deeptrust/deep-ui';- In DeepUI repo:
bun link
- In the consumer project:
bun link @deeptrust/deep-ui
- When testing changes, rebuild DeepUI (
bun run build).
- Use package.json dependency like:
"dependencies": { "@deeptrust/deep-ui": "file:../your-DeepUI-directory" } - Then run install in consumer project (
bun install).
-
Start Storybook (dev server):
bun run storybookDefault port: 6006 (open http://localhost:6006)
-
Build Storybook (static output):
bun run build:storybookOutput in
storybook-static/.