Skip to content

oss-rar/common

Repository files navigation

Common packages

Example monorepo project with minimal setup for shared/common packages

Styleguide available in gh-pages. https://oss-rar.github.io/common/

Goals

  • Minimal configuration
  • Easy local development / testing experience
  • Packages include:
  • Packages should run in all evergreen browsers. IE 11 excluded. If anyone consuming these packages need to provide support for IE11 or other older browsers they need to include these packages in their transpilation process
  • Minimum dependencies (You can use tools like bundlephobia to check package size before adding to the library).

Example output:

  // package.json
  "esnext": "dist-src/index.js",
  "types": "dist-types/index.d.ts",
  "module": "dist-web/index.js",
// Publish-ready pkg folder
pkg
├── dist-src
   └── index.js
├── dist-types
   └── index.d.ts
└── package.json

Using

Commands

Install

  npm i // install local dependencies

Bootstrap

  npm run bootstrap // the same as lerna bootstrap (install all dependencies)

Build

  npm run build // build all the packages (excludes documentation)
  npm run docz:build // build documentation

Extra

  npm run nuke // removes all node_modules and force install of new packages

Development

For documentation:

  npm i // install local dependencies
  npm run bootstrap // the same as lerna bootstrap (install all dependencies)
  npm run docz:dev // runs docz in local development

For components:

  npm i // install local dependencies
  npm run bootstrap // the same as lerna bootstrap (install all dependencies)
  cd packages/... // go to your project
  npm run dev // runs the code in localhost for quick prototyping

Publishing

  npm run version // bump version of packages changed since the last release (using conventional-commits / Semver)
  npm run version:prerelease // release current changes as prerelease versions
  npm run version:graduate // graduate prerelease versioned packages to stable versions
  npm run publish -- --registry=REGISTRY_URL // publishes the packages to `REGISTRY_URL`