New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pmnps-plugin

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

pmnps-plugin

This is a project to define plugin interfaces

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm standard

pmnps-plugin

pmnps is a monorepo tool, it uses npm workspaces to manage packages and platforms. This project is created to define plugin interfaces to pmnps.

Install

$ npm install pmnps-plugin --save-dev

How to define a plugin

In pmnps@2.0.0, it will open refresh action for plugins, so, we can add a plugin to it.

import {Project,Tools} from 'pmnps-plugin';

export default (proj:Project,tool:Tools)=>{
    return {
        // declare which action you want add plugin to.
        refresh: {
            // run before `refresh action`
            async before(){
                const {
                    // package.json object in root
                    root:rootPackageJson,
                    // package.json objects in every package, it is an array.
                    packages:packagePackageJsons,
                    // package.json objects in every platforms, it is an array.
                    platforms:platformPackageJsons
                } = await proj.packageJsons();
                // do things......
                tool.message.warn('Something is in danger');
                tool.message.info('Every thing is ok');
                return true; // return false will stop the action
            },
            // run after `refresh action`
            async after(){
                const {
                    root:rootPackageJson,
                    packages:packagePackageJsons,
                    platforms:platformPackageJsons
                } = await proj.packageJsons();
                // do things......
                tool.message.warn('Something is in danger');
                tool.message.info('Every thing is ok');
                return true; // return false will stop the action
            }
        }
    }
}

How to use plugin

Config the .pmnpsrc.json file.

{
    "workspace":"workspace",
    "git":true,
    "lock":true,
    "plugins":[
        "my-pmnps-plugin"
    ]
}

Finally

This document is not a complete one, we will complete it at pmnps@2.1.0.

Keywords

FAQs

Package last updated on 19 Jul 2022

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