cerebral / classy-ui

An automatically optimized design system
MIT License
176 stars 13 forks source link

Lerna support #40

Closed CodingDive closed 4 years ago

CodingDive commented 4 years ago

Hey, thank you so much for this library. I finally decided to use it and am currently setting it up! 😍

I have a project directory like this.

root
├── packages
│   ├── Client
│   ├── DesignSystem

Ideally, I'd like to put the classy-ui.config.js file into the root folder and share it between the Client and the design system. They both will be using classy-ui.

As far as I'm aware, this won't work at the moment but could be supported by either adding three classy-ui config files, extending the two configs of the Client and DesignSystem with the root one, or simply by adding a relative classy-ui config path for the package.json.

What do you think?

CodingDive commented 4 years ago

I found this code snippet by @christianalfoni in discord. It will require me to create multiple classy-ui.config.js files but I'm completely fine with this.

const libraryConfig = require('my-library/classy-ui.config.js')

module.exports = {
  ...libraryConfig,
  // You can add custom stuff for the project
}

Maybe we can add it to the docs for writing a library.

christianalfoni commented 4 years ago

Hi there @CodingDive ,

Yeah, I think this approach is the best, as it gives most flexibility without having to add anything new 😄

Let me know if you get into any issues!

I update the docs a bit to hopefully make this more clear 😄