Skip to content

📻 yarn monorepo structure with nextjs, styled-components and storybook

Notifications You must be signed in to change notification settings

mmendesas/stereo

Repository files navigation

Stereo

An example of a monorepo structure with nextjs, lerna and yarn monorepo.

Getting started

This project shows a simple use case with monorepo structure. It has a home page made with ssr and a shareable components package inside project core.

Prerequisites

You need to have the last version of node in yor machine

Avaiable Scripts

In the project directory, you can see the follow structure:

stereo/

  • In the root folder you can run one of these scripts:
    • yarn - installs all the dependencies
    • yarn build - build every package
    • yarn bootstrap - bootstrap the packages, Installs all of their dependencies and links any cross-dependencies.
    • yarn storybook:start - start the storybook to view all components locally locahost:5555
    • yarn test - Launches the test runner through all packages.
    • yarn coverage - run coverage through all packages

stereo/packages/core

  • Inside the design package you can run:
    • yarn build - will build this currently package and create the /lib folder

stereo/packages/home

  • Inside the home ssr app, you can run one of the nextjs methods:
    • yarn dev - start a dev-server with hot-reloading

Tips and Tricks

  • yarn add --dev -W package - Use this command inside /stereo to install package in workspace. After that you only need to add it in your package dependency.

Built With

  • 🐉 Lerna  - The Monorepo manager
  • 📦 Yarn Workspaces  -  Sane multi-package management
  • 🚀 React  -  JavaScript library for user interfaces
  • 💅 styled-components  -  CSS in JS elegance
  • 🛠 Babel  -  Compiles next-gen JavaScript
  • 📖 Storybook - UI Component Environment
  • 🃏 Jest  -  Unit/Snapshot Testing
  • 📦 NextJS - The React Framework

Author

License

This project is licensed under the MIT License

About

📻 yarn monorepo structure with nextjs, styled-components and storybook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published