Socket
Socket
Sign inDemoInstall

@qiwi/semrel-plugin-creator

Package Overview
Dependencies
10
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @qiwi/semrel-plugin-creator

Semrel plugin creator


Version published
Weekly downloads
539
decreased by-20.03%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

@qiwi/semrel-plugin-creator

Semrel plugin creator

Install

yarn add @qiwi/semrel-plugin-creator

Usage

import {createPlugin} from '@qiwi/semrel-plugin-creator'

const handler = async ({step, pluginConfig, context, name}) => {
  if (step === 'prepare') {
    pluginConfig.foo = 'bar'
  }

  if (step === 'publish') {
    await doSomething()
  }
}

const plugin = createPlugin({
  handler,
  name: 'plugin-name',
  include: ['prepare', 'publish']
})

API

export type TPluginHandlerContext = {
  pluginConfig: TPluginConfig
  stepConfig: TPluginConfig
  stepConfigs: TStepConfigs
  context: TSemrelContext
  step: TReleaseStep
}

export type TPluginFactoryOptionsNormalized = {
  handler: TReleaseHandler
  name?: string
  include: TReleaseStep[]
  exclude: TReleaseStep[]
  require: TReleaseStep[]
}

export type TPluginFactoryOptions = Partial<TPluginFactoryOptionsNormalized>

export type TReleaseHandler = (context: TPluginHandlerContext) => Promise<any>

export type TPluginFactory = (
  handler: TPluginFactoryOptions | TReleaseHandler,
) => TPlugin

FAQs

Last updated on 31 Oct 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc