Skip to content
/ Monorepo-Template Public template

This is a Monorepo template for react, node and normal javascript library components.

License

Notifications You must be signed in to change notification settings

RSMuthu/Monorepo-Template

Repository files navigation

Monorepo Template

This is a monorepo template which holds library components built off react, plain js or nodejs.
This is more of an accumulation of my few learning in past few weeks.
All the common and dev dependencies are pulled out to the rootdir of monorepo to leverage those dependencies from the packages while few majors (like, react & react-dom) are set as peer-dependencies.
Most necesary scripts have also been added along with the monorepo template to facilitate ci/cd workflows. React peer dependencies are set to v17.0.2 and not the latest v18 as it would more amendment to my base template

Recommended Node version: v16.11+ (for es13 specification features)

Package Creation

Showing the images for react package creation alone. The other types of packages can be created in similar way.

Package creation

Created Package Structure

Features available in this template

  • lerna setup for monorepo & workspace management
  • lerna task execution via nx (for effective lerna task execution)
  • Babel setup (for ecmascript)
  • Linters (eslint & stylelint - standard configs and few of my personal likings)
  • unit testing Jest (setup on both package level and repo level)
  • code coverage + threshold validation via nyc & Jest
  • Storybook for UI components (along with feature for attaching figma or adobe design)
  • Custom package creation command for this monorepo template.
  • Webpack5 bundler made to handle different scenarios of packages
  • semver versioning through version bump based on commit message
  • commit message enforced via commitlint to conventional commit standards
  • Git hooks setup via husky (pre-commit & commit-msg)
  • Basic Proxy registry (along with uplink) setup with verdaccio

Future plans

  • Update react to latest v18 for its latest features
  • add Vuejs compatibility to this monorepo template
  • add a custom storybook framework for supporting both vuejs & reactjs together on storybook bundling
  • add clean github workflows to the monorepo template