Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@lerna/run-lifecycle
Advanced tools
@lerna/run-lifecycle is a package that allows you to run lifecycle scripts for npm packages within a Lerna-managed monorepo. It helps in executing pre-defined scripts like preinstall, install, postinstall, prepublish, publish, postpublish, etc., across multiple packages in a monorepo setup.
Run Predefined Lifecycle Scripts
This feature allows you to run predefined lifecycle scripts like preinstall, install, postinstall, etc., for a given package. The code sample demonstrates how to run the 'preinstall' script for a package.
const { runLifecycle } = require('@lerna/run-lifecycle');
async function runScript(pkg, script) {
await runLifecycle(pkg, script, {
stdio: 'inherit',
});
}
const pkg = { name: 'my-package', location: '/path/to/package' };
runScript(pkg, 'preinstall');
Custom Script Execution
This feature allows you to run custom scripts defined in the package.json of a given package. The code sample demonstrates how to run a custom script named 'custom-script' for a package.
const { runLifecycle } = require('@lerna/run-lifecycle');
async function runCustomScript(pkg, script) {
await runLifecycle(pkg, script, {
stdio: 'inherit',
scriptShell: '/bin/bash',
});
}
const pkg = { name: 'my-package', location: '/path/to/package' };
runCustomScript(pkg, 'custom-script');
npm-lifecycle is a package that provides the functionality to run lifecycle scripts for npm packages. It is similar to @lerna/run-lifecycle but is not specifically designed for monorepo setups managed by Lerna. It can be used for individual npm packages.
Yarn is a package manager that also supports running lifecycle scripts for packages. While it is not a direct replacement for @lerna/run-lifecycle, it provides similar functionalities in terms of script execution and can be used in monorepo setups with Yarn Workspaces.
pnpm is another package manager that supports running lifecycle scripts. It is known for its efficient handling of node_modules and can be used in monorepo setups. Like Yarn, it provides similar functionalities but is not specifically tailored for Lerna-managed monorepos.
@lerna/run-lifecycle
An internal Lerna tool
You probably shouldn't, at least directly.
Install lerna for access to the lerna
CLI.
3.0.0 (2018-08-10)
npm pack
experience (627cfc2)npm pack
before npm publish
(8d80b2c)lerna version
from of lerna publish
(#1522) (8b97394), closes #277 #936 #956 #961 #1056 #1118 #1385 #1483 #1494changed: The package names emitted to stdout are no longer prefixed by a "- ", and private packages are no longer displayed by default.
list: The default output of lerna ls
no longer shows version strings or private packages.
The new alias lerna la
resembles the old output, with the addition of relative path to the package
The new alias lerna ll
is a shortcut for the new --long
option
A new --parseable
option has been added to aid magical piping incantations
--preid
now defaults to "alpha" during prereleases:The previous default for this option was undefined, which led to an awkward "1.0.1-0" result when passed to semver.inc()
.
The new default "alpha" yields a much more useful "1.0.1-alpha.0" result. Any previous prerelease ID will be preserved, just as it was before.
--no-verify
is no longer passed to git commit
by default, but controlled by the new --commit-hooks
option:
The previous behavior was too overzealous, and the new option operates exactly like the corresponding npm version option of the same name.
As long as your pre-commit hooks are properly scoped to ignore changes in package.json files, this change should not affect you. If that is not the case, you may pass --no-commit-hooks
to restore the previous behavior.
<a name="3.0.0-rc.0"></a>
FAQs
An internal Lerna tool
The npm package @lerna/run-lifecycle receives a total of 415,667 weekly downloads. As such, @lerna/run-lifecycle popularity was classified as popular.
We found that @lerna/run-lifecycle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.