GithubHelp home page GithubHelp logo

frontend / storybox Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 7.99 MB

Storybook-Tailwind distribution for Styleguide projects

Home Page: https://frontend-storybox.vercel.app/

License: MIT License

JavaScript 12.52% HTML 3.79% CSS 1.92% TypeScript 47.81% MDX 33.96%
postcss react storybook tailwindcss typescript

storybox's People

Contributors

seb-graf avatar yago avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

storybox's Issues

Vite build system

Drop Webpack in favor of Vite/Rollup:

  • Use Vite builder for Storybook
  • Refactor src/modules/* build system to use Vite

`styles.css` is not found on storybook build

When building the styleguide, storybook doesn't find the styles.css. Might have been introduced by 1.0.3

Steps to reproduce:

  1. Install a brand new styleguide with npx frontend-storybox@latest
  2. Build the styleguide with yarn build:styleguide
  3. Serve the styleguide with npx http-server storybook-static/
  4. Notice the styles are not active on the styleguide and the http-server outputs this error:
[2021-10-13T08:25:50.192Z]  "GET /styles.css" Error (404): "Not found"

Storybook 7

  • Updates Storybook dependencies
  • Refactoring to use CSF3 (+ MDX)

๐Ÿ’ก If it's easier, start from a blank base to re-setup the Storybook project.

Alpine.js

Find a way to make possible using Alpine.js JS logic in our React documented components as clean as possible. This way, we will be able to use it more often instead of clanky vanilla js.

Icon sprite

  • Refactor the Icon and Icons component to use an external SVG sprite file and svg-sprite module (f.ex "icons:build": "svg-sprite -s --symbol-inline --symbol-dest public --symbol-sprite icons.svg src/assets/icons/*.svg",)
  • Add default documentation page using IconGallery

Placeholder images

Add placeholder generation script and documentation. Something like:

 "images:build": "npx zx bin/generate-image.mjs",

and for bin/generate-image.mjs

#!/usr/bin/env zx

/* Require:
 * - ImageMagick (https://imagemagick.org/)
 * - rename (for macOS https://formulae.brew.sh/formula/rename)
 *
 * More on image sizes/formats for the web on https://antistatique.github.io/placeholders/
 */

const widths = [140, 480, 640, 800, 1080, 2000, 3000];
const ratios = ['original'];
const formats = [
  ['jpg', 65],
]

await $`rm -rf ./public/placeholders`;
await $`mkdir -p ./public/placeholders`;
await $`mkdir -p ./public/placeholders/tmp`;

for (const ratio of ratios) {
  await $`mkdir -p ./public/placeholders/tmp/${ratio}`;

  for (const width of widths) {
    const path = `./public/placeholders/tmp/${ratio}/${width}`;
    await $`mkdir -p ${path}`;

    for (const format of formats) {
      const [ext, quality] = format;

      await $`mogrify -format ${ext} -quality ${quality} -resize ${width} -gravity Center -pointsize ${width * 0.05} -fill '#ffffff80' -annotate 0 'โ€‚${width}px - ${ext.toUpperCase()}โ€‚' -path ${path} src/assets/placeholders/*.jpg`;
      await $`rename -s .${ext} '_${width}.${ext}' ${path}/*`;

      await $`mv ${path}/*.${ext} ./public/placeholders/`;
    }
  }

}

await $`rm -rf ./public/placeholders/tmp`;

Module builds fail with upgraded version of `ts-loader`

After successfully migrating to 1.0.2 following the guide instructions, the build command fails with these errors:

ERROR in ./src/modules/slider-vanilla.tsx
Module build failed (from ./node_modules/ts-loader/index.js):
TypeError: loaderContext.getOptions is not a function
    at getLoaderOptions (/Users/nelson/work/theodora-base-theme/styleguide/node_modules/ts-loader/dist/index.js:91:41)
    at Object.loader (/Users/nelson/work/theodora-base-theme/styleguide/node_modules/ts-loader/dist/index.js:14:21)

ERROR in ./src/modules/header-vanilla.tsx
Module build failed (from ./node_modules/ts-loader/index.js):
TypeError: loaderContext.getOptions is not a function
    at getLoaderOptions (/Users/nelson/work/theodora-base-theme/styleguide/node_modules/ts-loader/dist/index.js:91:41)
    at Object.loader (/Users/nelson/work/theodora-base-theme/styleguide/node_modules/ts-loader/dist/index.js:14:21)

Might be related to TypeStrong/ts-loader#595

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.