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

danger-plugin-lerna

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger-plugin-lerna - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

8

dist/plugin.js

@@ -23,3 +23,4 @@ "use strict";

emoji = ':rocket:',
noPublishMessage
noPublishMessage,
formatSuccessMessage
} = {}) => {

@@ -42,2 +43,7 @@ const cwd = process.cwd();

changed.forEach(pkg => {
if (formatSuccessMessage) {
message(formatSuccessMessage(emoji, pkg));
return;
}
message(`${emoji} A new version of the \`${pkg.name}\` package will be published.`);

@@ -44,0 +50,0 @@ });

2

package.json
{
"name": "danger-plugin-lerna",
"version": "1.0.1",
"version": "1.1.0",
"description": "Reports which packages in a lerna mono-repo will be published.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -38,5 +38,20 @@ # danger-plugin-lerna

| name | description |
|-------------------|-------------------------------------------------------------|
| `emoji` | An emoji to prepend to the success message |
| `noPublishMessage`| An optional message to show if there is nothing to publish. |
| name | description |
|-----------------------|-------------------------------------------------------------|
| `emoji` | An emoji to prepend to the success message |
| `noPublishMessage` | A message to show if there is nothing to publish. |
| `formatSuccessMessage`| A function to format the success message. |
**Example:**
```js
import lerna from 'danger-plugin-lerna';
schedule(lerna({
emoji: ':thinking:',
noPublishMessage: 'No new package versions will be published',
formatSuccessMessage(emoji, pkg) {
return `${emoji} My custom message about the ${pkg.name} package`;
}
}));
```

@@ -13,2 +13,3 @@ import { getPackages } from '@lerna/project';

noPublishMessage,
formatSuccessMessage,
} = {}) => {

@@ -32,2 +33,7 @@ const cwd = process.cwd();

changed.forEach((pkg) => {
if (formatSuccessMessage) {
message(formatSuccessMessage(emoji, pkg));
return;
}
message(`${emoji} A new version of the \`${pkg.name}\` package will be published.`);

@@ -34,0 +40,0 @@ });

@@ -125,3 +125,27 @@ import mockFs from 'mock-fs';

});
it('adds custom formatting to the success message', async () => {
Object.assign(danger, {
github: {
pr: {},
},
});
collectUpdates.mockReturnValue([
{
name: 'package-one',
},
]);
await lernaPlugin({
formatSuccessMessage(emoji, pkg) {
return `${emoji} My custom message about the ${pkg.name} package.`;
},
});
expect(message).toHaveBeenCalledWith(
':rocket: My custom message about the package-one package.',
);
});
});
});
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