Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

context-bootstrap

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

context-bootstrap

Bootstrap project for creating a new context with Lerna in place

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Overview

Bootstrap project for creating a new context — monorepo with multiple packages inside.

This could be useful when you:

  1. want to isolate projects with the same business scope;
  2. want to make your life easier managing dependencies.

For this purpose this bootstrap use Lerna.

Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and npm.

Development

  • By default Lerna has "version": "independent" setup (check lerna.json for it). It allows to increment package versions independently of each other.

  • All the packages located under /packages folder by default. You can change it by specifying "packages": ["packages/*"] within lerna.json.

Basic workflow example:

  • Add new package to /packages or simply create a new one by running npm init within /packages/${YOUR_PACKAGE_NAME}.

  • yarn lerna bootstrap — bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies. Run it instead of yarn install every time you add new package to /packages.

  • git commit -m "Changed something very important"

  • yarn lerna publish

Some additions:

  • yarn lerna version --conventional-commits — will create a newer version for all the packages with the history of changes and store it as part of the project. Example: https://github.com/taxfix/context-bootstrap/blob/master/packages/taxfix-lerna-test-1/CHANGELOG.md. Be aware that this command automatically pushes the changes;

  • yarn lerna version --conventional-commits --no-push — the same but without pushing changes. This you have to accomplish manually;

  • yarn lerna publish from-git --yes — this will identify packages tagged by lerna version and publish them to npm.

This is useful in CI scenarios where you wish to manually increment versions, but have the package contents themselves consistently published by an automated process.

Other useful commands:

  • yarn lerna diff — diff all packages or a single package since the last release;
  • yarn lerna link — symlink together all Lerna packages that are dependencies of each other in the current Lerna repo;
  • yarn lerna ls --json — show packges information in JSON format.

Live examples

Feel free to play around with the real examples within this repo (check /packages folder).

FAQs

Package last updated on 29 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc