0.6.0 • Published 12 months ago

@loopback/monorepo v0.6.0

Weekly downloads
189
License
MIT
Repository
github
Last release
12 months ago

@loopback/monorepo

This module contains a set of common scripts to maintain a lerna monorepo.

  • script-util: common utility functions for lerna
  • check-package-locks: check if package-lock.json files has local packages.
  • rebuild-package-locks: rebuild package-lock.json files for all packages or packages matching given scopes.
  • run-lerna: run lerna command with LERNA_ROOT_PATH environment variable set to the root path of the monorepo
  • config-lerna-scopes: return a list of scope names for conventional commits.
  • update-package-deps: update package dependencies to match versions of local packages.
  • update-package-json: update package.json files for all packages based on metadata from the root package.json for the monorepo
  • update-ts-project-refs: update tsconfig.json with TypeScript project references based on the dependency graph.

Basic use

To use @loopback/monorepo for your lerna monorepo, run the following command to add @loopback/monorepo as a dev dependency to the root project.

npm i @loopback/monorepo --save-dev

The following commands are exposed by @loopback/monorepo.

  • lb-run-lerna: run lerna command with LERNA_ROOT_PATH environment variable set to the root path of the monorepo

  • lb-check-package-locks: check if package-lock.json files has local packages.

  • lb-rebuild-package-locks: rebuild package-lock.json files for all packages or packages matching given scopes.

  • lb-update-package-deps: update package dependencies to match versions of local packages.

  • lb-update-package-json: update package.json files for all packages based on metadata from the root package.json for the monorepo.

  • lb-update-ts-project-refs: update tsconfig.json with TypeScript project references based on the dependency graph.

These commands can be invoked using npx:

npx lb-update-ts-project-refs
npx lb-rebuild-package-locks

The --dry-run option can be used to preview changes without applying them.

npx lb-update-ts-project-refs --dry-run

To access such scripts programmatically:

const {
  checkPackageLocks,
  configLernaScopes,
  runLerna,
  updatePackageDeps,
  updatePackageJson,
  updateTsProjectRefs,
  getPackages,
  loadLernaRepo,
  runMain,
} = require('@loopback/monorepo');

Contributions

Tests

run npm test from the root folder.

Contributors

See all contributors.

License

MIT

0.6.0

12 months ago

0.5.10

1 year ago

0.5.9

1 year ago

0.5.8

1 year ago

0.5.7

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.1

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago