Coder Social home page Coder Social logo

designsystem's Introduction

Design System setup react and styled-components

setting a multiple monorepo mechanism with lerna and yarn workspaces.

Lerna setup

npx lerna init

This Command will generate a package.json and lerna.json file.

Setup the workspaces in the package.json and tell Lerna to use yarn as the npmClient. Also set the version to independent so we can enforce semver for each package.

// package.json
{
  "name": "root",
  "private": true,
  "workspaces": ["packages/*"],
  "devDependencies": {
    "lerna": "^3.22.1"
  }
}
// lerna.json
{
  "packages": ["packages/*"],
  "npmClient": "yarn",
  "useWorkspaces": true,
  "version": "independent"
}

Babel setup

yarn add --dev -W @babel/cli @babel/core @babel/preset-react @babel/preset-env [email protected] babel-loader babel-plugin-styled-components webpack

Storybook setup

yarn add --dev -W @storybook/react @storybook/addon-docs @storybook/preset-create-react-app

Reactjs

yarn add --dev -W react react-dom styled-components

TODO: Rollup

Debating to todo this!

yarn add --dev -W rollup @rollup/plugin-babel @babel/preset-typescript @babel/core @rollup/plugin-node-resolve rollup-plugin-peer-deps-external

import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel'
import pkg from './package.json';
import path from 'path'

import analyze from 'rollup-plugin-analyzer'

import external from 'rollup-plugin-peer-deps-external'

const extensions = ['.ts', '.tsx']
const PACKAGE_ROOT =  './packages/**/*/index.js'

const wd = path.resolve(__dirname, 'packages/button/src/index.js' )
console.log('wd: ', wd);

export default {
    input: wd, //'./src/index.ts',
    plugins: [
        external(),
        // Allows node_modules resolution
        resolve({ extensions }),

        // Compile TypeScript/JavaScript files
        babel({ extensions, include: ['src/**/*'], babelHelpers: 'bundled' }),
        analyze({ limit: 0 }),
    ],

    output: [
        // Only exporting es modules
        {
            file: pkg.module,
            format: 'es',
        },
    ],
}

designsystem's People

Contributors

fitfab avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.