Storybook-Tailwind distribution for Styleguide projects
If you're just too lazy to read the README 😏👉 bun x frontend-storybox@latest
Currently provides:
- 🌊 Tailwind
- 🔺 PostCSS
- 📚 Storybook
- ⚛️ React as a template engine
- 🟦 TypeScript
First you need to kick off the generator:
$ mkdir new-styleguide && cd new-styleguide
$ bun x frontend-storybox@latestIf you want a good ESLint/Prettier/Cypress/Jest config, you can use the Antistatique Frontend Development Configuration as so:
$ bun x antistatique-frontend@latest # Uncheck storybook and check stylelint, obviously
$ git checkout tsconfig.jsonYou need to have the following tools installed globally on your environment:
- 🥟 Bun >= 1.0.13 - Runtime & Dependency manager
To install the project:
bun install -yStart the following commands in parallel (with nicer output):
$ bun run tailwind:start
$ bun run storybook:startOR (with uglier output)
$ bun run startAnd here are all the available commands:
bun run clean: Purge build packages cachebun run tailwind:build: Build Production Tailwind projectbun run tailwind:start: Start Tailwind development modebun run storybook:start: Start Storybookbun run storybook:build: Build Storybook static deliverablebun run modules:start: Build modules and watch for changesbun run modules:build: Build modulesbun run start: Start all development processesbun run build: Build all deliverablesbun run build:assets: Build all deliverablesbun run build:styleguide: Build styleguide for deploymentbun run generate: Generate new component (selectBlankfor ease)bun run icons:build: Build the icons spritebun run images:build: Build the placeholders images using ImageMagick
To deliver your styleguide, simply hit the following command:
$ bun run buildIn ./public, it will output you a CSS folder that includes a styles.css with your custom CSS and the *purged Tailwind utilities.
It will also take all the modules available in ./src/modules/ and create independent bundles (without React and ReactDOM) that can be used as widgets. Check the ./src/modules/test-module.tsx example.
*
You can easily (and freely) deploy your styleguide on Netlify.
Choose the following options:
- Build command:
bun run build:styleguide - Publish directory:
storybook-static/