Skip to content

vnscriptkid/Lerna-StoryBook-Typescript-Boilerplate

Repository files navigation

Setup

Add a new Component

  • lerna create package-name
  • Mimic config from the Button component package

└─── lib/ : Keep code that has been built

└─── src/ : Keep all the code in development

└───────── │ *.story.tsx : File used by StoryBook

└───────── │ ...

└─── README.md

└─── tsconfig.json : Copy from Button example

└─── package.json : Add "scripts": { "tsc": "tsc" } "main" field points to entry point (Run when we call require('lib-name')) "name": is 'lib-name' above. Use pattern: @vmodev/button

  • Add a new dependency to package

    • Move to the package
    • Case 1: Install local dependency

    lerna add @vmodev/button --scope=@vmodev/form Explain: Create a symlink from form package to button package inside our monorepo import Button from '@vmodev/button'

    • Case 2: Install external dependency:

    lerna add @react-google-maps/api --scope=@vmodev/googlemap

    • Case 3: A common dependency like React (used by all packages)

    yarn add React --dev -W

  • lerna run tsc : Run tsc in all packages and Build code from /src to /lib

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published