Socket
Socket
Sign inDemoInstall

@qiwi/semrel-plugin-creator

Package Overview
Dependencies
49
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.4.0

13

CHANGELOG.md

@@ -0,1 +1,14 @@

# @qiwi/semrel-plugin-creator [1.4.0](https://github.com/qiwi/semantic-release-toolkit/compare/@qiwi/semrel-plugin-creator@1.3.1...@qiwi/semrel-plugin-creator@1.4.0) (2021-01-19)
### Bug Fixes
* **plugin-creator:** add missed semrel context fields ([c56b3e5](https://github.com/qiwi/semantic-release-toolkit/commit/c56b3e53435c98781656a3f0dbefbf983070eaca))
### Features
* **metabranch:** introduce metabranch plugin pkg ([a00c67d](https://github.com/qiwi/semantic-release-toolkit/commit/a00c67d0315939125bb55fb5d7e74fbc7a81f708))
* **plugin-creator:** use undefined as default step config ([96a2600](https://github.com/qiwi/semantic-release-toolkit/commit/96a26002ce866b0974df8d868fef847ad0dbb61d))
## @qiwi/semrel-plugin-creator [1.3.1](https://github.com/qiwi/semantic-release-toolkit/compare/@qiwi/semrel-plugin-creator@1.3.0...@qiwi/semrel-plugin-creator@1.3.1) (2021-01-07)

@@ -2,0 +15,0 @@

64

flow-typed/index.flow.js

@@ -46,7 +46,7 @@ /**

name?: string
) => TPluginConfig;
) => TPluginConfig | void;
declare export var getStepConfigs: (
context: TSemrelContext,
name?: string
) => { [key: TReleaseStep]: TPluginConfig, ... };
) => { [key: TReleaseStep]: TPluginConfig | void, ... };
declare export var createPlugin: TPluginFactory;

@@ -58,4 +58,26 @@ }

declare export type TSemrelContext = Context;
declare export type TReleaseType = "patch" | "minor" | "major";
declare export type TTag = {
version: string,
channel: string,
gitTag: string,
gitHead: string,
...
};
declare export type TBranch = {
channel?: string,
tags: string[],
type: string,
name: string,
range: string,
accept: TReleaseType[],
main: boolean,
...
};
declare export type TSemrelContext = Context & {
cwd: string,
branch?: TBranch,
branches: string[],
...
};
declare export type TPluginConfig = { [key: any]: any, ... };

@@ -79,3 +101,3 @@ declare export type TPluginMethod<T = void> = (

declare export type TStepConfigs = {
[key: TReleaseStep]: TPluginConfig,
[key: TReleaseStep]: TPluginConfig | void,
...

@@ -85,3 +107,3 @@ };

pluginConfig: TPluginConfig,
stepConfig: TPluginConfig,
stepConfig?: TPluginConfig,
stepConfigs: TStepConfigs,

@@ -155,7 +177,7 @@ context: TSemrelContext,

name?: string
) => TPluginConfig;
) => TPluginConfig | void;
declare export var getStepConfigs: (
context: TSemrelContext,
name?: string
) => { [key: TReleaseStep]: TPluginConfig, ... };
) => { [key: TReleaseStep]: TPluginConfig | void, ... };
declare export var createPlugin: TPluginFactory;

@@ -167,4 +189,26 @@ }

declare export type TSemrelContext = Context;
declare export type TReleaseType = "patch" | "minor" | "major";
declare export type TTag = {
version: string,
channel: string,
gitTag: string,
gitHead: string,
...
};
declare export type TBranch = {
channel?: string,
tags: string[],
type: string,
name: string,
range: string,
accept: TReleaseType[],
main: boolean,
...
};
declare export type TSemrelContext = Context & {
cwd: string,
branch?: TBranch,
branches: string[],
...
};
declare export type TPluginConfig = { [key: any]: any, ... };

@@ -188,3 +232,3 @@ declare export type TPluginMethod<T = void> = (

declare export type TStepConfigs = {
[key: TReleaseStep]: TPluginConfig,
[key: TReleaseStep]: TPluginConfig | void,
...

@@ -194,3 +238,3 @@ };

pluginConfig: TPluginConfig,
stepConfig: TPluginConfig,
stepConfig?: TPluginConfig,
stepConfigs: TStepConfigs,

@@ -197,0 +241,0 @@ context: TSemrelContext,

6

package.json
{
"name": "@qiwi/semrel-plugin-creator",
"version": "1.3.1",
"version": "1.4.0",
"private": false,

@@ -43,3 +43,3 @@ "publishConfig": {

"@types/semantic-release": "^17.2.0",
"@types/node": "^14.14.20",
"@types/node": "^14.14.21",
"read-pkg-up": "^7.0.1",

@@ -51,3 +51,3 @@ "lodash": "^4.17.20"

"@qiwi/semrel-testing-suite": "1.0.0",
"semantic-release": "^17.3.1",
"semantic-release": "^17.3.3",
"resolve-from": "^5.0.0",

@@ -54,0 +54,0 @@ "@types/execa": "^2.0.0"

@@ -12,5 +12,5 @@ import { TPluginConfig, TPluginFactory, TPluginFactoryOptions, TPluginFactoryOptionsNormalized, TReleaseHandler, TReleaseStep, TSemrelContext } from './interface';

export declare const normalizeOptions: (options: TReleaseHandler | TPluginFactoryOptions) => TPluginFactoryOptionsNormalized;
export declare const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig;
export declare const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig>;
export declare const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig | undefined;
export declare const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig | undefined>;
export declare const createPlugin: TPluginFactory;
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.createPlugin=exports.getStepConfigs=exports.getStepConfig=exports.normalizeOptions=exports.defaultOptions=exports.releaseSteps=void 0;var tslib_1=require("tslib"),lodash_1=require("lodash"),read_pkg_up_1=require("read-pkg-up");tslib_1.__exportStar(require("./interface"),exports),exports.releaseSteps=["verifyConditions","analyzeCommits","verifyRelease","generateNotes","prepare","publish","addChannel","success","fail"],exports.defaultOptions={include:exports.releaseSteps,exclude:[],require:[],handler:function(){return tslib_1.__awaiter(void 0,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){return[2]}))}))},name:String(null===(_c=null===(_b=read_pkg_up_1.sync({cwd:null===(_a=null===module||void 0===module?void 0:module.parent)||void 0===_a?void 0:_a.filename}))||void 0===_b?void 0:_b.packageJson)||void 0===_c?void 0:_c.name)};var normalizeOptions=function(e){var t="function"==typeof e?{handler:e}:e;return tslib_1.__assign(tslib_1.__assign({},exports.defaultOptions),t)};exports.normalizeOptions=normalizeOptions;var checkPrevSteps=function(e,t,r){var n=e.invoked,i=t.name,o=t.require;if(0!==o.length){var s=exports.releaseSteps.slice(0,exports.releaseSteps.indexOf(r)).find((function(e){return o.includes(e)&&!n.includes(e)}));if(s)throw new Error("plugin '"+i+"' requires "+s+" to be invoked before "+r)}},getStepConfig=function(e,t,r){var n;return void 0===r&&(r=""),lodash_1.castArray(null===(n=e.options)||void 0===n?void 0:n[t]).map((function(e){if(Array.isArray(e)){var t=tslib_1.__read(e,2),r=t[0],n=t[1];return tslib_1.__assign(tslib_1.__assign({},n),{path:r})}return e})).find((function(e){return(null==e?void 0:e.path)===r}))||{}};exports.getStepConfig=getStepConfig;var getStepConfigs=function(e,t){return void 0===t&&(t=""),exports.releaseSteps.reduce((function(r,n){return r[n]=exports.getStepConfig(e,n,t),r}),{})};exports.getStepConfigs=getStepConfigs;var metaContexts=new WeakMap,getMetaContext=function(e){var t=metaContexts.get(e);return t||(t={invoked:[]},metaContexts.set(e,t)),t},createPlugin=function(e){var t=exports.normalizeOptions(e),r=t.handler,n=t.include,i=t.exclude,o=t.name;return exports.releaseSteps.filter((function(e){return n.includes(e)&&!i.includes(e)})).reduce((function(e,n){return e[n]=function(e,i){var s=getMetaContext(i);checkPrevSteps(s,t,n),s.invoked.push(n);var a=exports.getStepConfigs(i,o),u=a[n];return r({pluginConfig:e,context:i,step:n,stepConfig:u,stepConfigs:a})},e}),{})};exports.createPlugin=createPlugin;
"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.createPlugin=exports.getStepConfigs=exports.getStepConfig=exports.normalizeOptions=exports.defaultOptions=exports.releaseSteps=void 0;var tslib_1=require("tslib"),lodash_1=require("lodash"),read_pkg_up_1=require("read-pkg-up");tslib_1.__exportStar(require("./interface"),exports),exports.releaseSteps=["verifyConditions","analyzeCommits","verifyRelease","generateNotes","prepare","publish","addChannel","success","fail"],exports.defaultOptions={include:exports.releaseSteps,exclude:[],require:[],handler:function(){return tslib_1.__awaiter(void 0,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){return[2]}))}))},name:String(null===(_c=null===(_b=read_pkg_up_1.sync({cwd:null===(_a=null===module||void 0===module?void 0:module.parent)||void 0===_a?void 0:_a.filename}))||void 0===_b?void 0:_b.packageJson)||void 0===_c?void 0:_c.name)};var normalizeOptions=function(e){var t="function"==typeof e?{handler:e}:e;return tslib_1.__assign(tslib_1.__assign({},exports.defaultOptions),t)};exports.normalizeOptions=normalizeOptions;var checkPrevSteps=function(e,t,r){var n=e.invoked,i=t.name,o=t.require;if(0!==o.length){var s=exports.releaseSteps.slice(0,exports.releaseSteps.indexOf(r)).find((function(e){return o.includes(e)&&!n.includes(e)}));if(s)throw new Error("plugin '"+i+"' requires "+s+" to be invoked before "+r)}},getStepConfig=function(e,t,r){var n;return void 0===r&&(r=""),lodash_1.castArray(null===(n=e.options)||void 0===n?void 0:n[t]).map((function(e){if(Array.isArray(e)){var t=tslib_1.__read(e,2),r=t[0],n=t[1];return tslib_1.__assign(tslib_1.__assign({},n),{path:r})}return e})).find((function(e){return(null==e?void 0:e.path)===r}))};exports.getStepConfig=getStepConfig;var getStepConfigs=function(e,t){return void 0===t&&(t=""),exports.releaseSteps.reduce((function(r,n){return r[n]=exports.getStepConfig(e,n,t),r}),{})};exports.getStepConfigs=getStepConfigs;var metaContexts=new WeakMap,getMetaContext=function(e){var t=metaContexts.get(e);return t||(t={invoked:[]},metaContexts.set(e,t)),t},createPlugin=function(e){var t=exports.normalizeOptions(e),r=t.handler,n=t.include,i=t.exclude,o=t.name;return exports.releaseSteps.filter((function(e){return n.includes(e)&&!i.includes(e)})).reduce((function(e,n){return e[n]=function(e,i){var s=getMetaContext(i);checkPrevSteps(s,t,n),s.invoked.push(n);var a=exports.getStepConfigs(i,o),u=a[n];return r({pluginConfig:e,context:i,step:n,stepConfig:u,stepConfigs:a})},e}),{})};exports.createPlugin=createPlugin;
import { Context } from 'semantic-release';
export declare type TSemrelContext = Context;
export declare type TReleaseType = 'patch' | 'minor' | 'major';
export declare type TTag = {
version: string;
channel: string;
gitTag: string;
gitHead: string;
};
export declare type TBranch = {
channel?: string;
tags: string[];
type: string;
name: string;
range: string;
accept: TReleaseType[];
main: boolean;
};
export declare type TSemrelContext = Context & {
cwd: string;
branch?: TBranch;
branches: string[];
};
export declare type TPluginConfig = Record<any, any>;

@@ -18,6 +37,6 @@ export declare type TPluginMethod<T = void> = (pluginConfig: TPluginConfig, context: TSemrelContext) => Promise<T>;

export declare type TReleaseStep = keyof TPlugin;
export declare type TStepConfigs = Record<TReleaseStep, TPluginConfig>;
export declare type TStepConfigs = Record<TReleaseStep, TPluginConfig | undefined>;
export declare type TPluginHandlerContext = {
pluginConfig: TPluginConfig;
stepConfig: TPluginConfig;
stepConfig?: TPluginConfig;
stepConfigs: TStepConfigs;

@@ -24,0 +43,0 @@ context: TSemrelContext;

@@ -12,5 +12,5 @@ import { TPluginConfig, TPluginFactory, TPluginFactoryOptions, TPluginFactoryOptionsNormalized, TReleaseHandler, TReleaseStep, TSemrelContext } from './interface';

export declare const normalizeOptions: (options: TReleaseHandler | TPluginFactoryOptions) => TPluginFactoryOptionsNormalized;
export declare const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig;
export declare const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig>;
export declare const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig | undefined;
export declare const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig | undefined>;
export declare const createPlugin: TPluginFactory;
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.createPlugin=exports.getStepConfigs=exports.getStepConfig=exports.normalizeOptions=exports.defaultOptions=exports.releaseSteps=void 0;const tslib_1=require("tslib"),lodash_1=require("lodash"),read_pkg_up_1=require("read-pkg-up");tslib_1.__exportStar(require("./interface"),exports),exports.releaseSteps=["verifyConditions","analyzeCommits","verifyRelease","generateNotes","prepare","publish","addChannel","success","fail"],exports.defaultOptions={include:exports.releaseSteps,exclude:[],require:[],handler:()=>tslib_1.__awaiter(void 0,void 0,void 0,(function*(){})),name:String(null===(_c=null===(_b=read_pkg_up_1.sync({cwd:null===(_a=null===module||void 0===module?void 0:module.parent)||void 0===_a?void 0:_a.filename}))||void 0===_b?void 0:_b.packageJson)||void 0===_c?void 0:_c.name)};const normalizeOptions=e=>{const t="function"==typeof e?{handler:e}:e;return Object.assign(Object.assign({},exports.defaultOptions),t)};exports.normalizeOptions=normalizeOptions;const checkPrevSteps=({invoked:e},{name:t,require:s},n)=>{if(0===s.length)return;const o=exports.releaseSteps.slice(0,exports.releaseSteps.indexOf(n)).find((t=>s.includes(t)&&!e.includes(t)));if(o)throw new Error(`plugin '${t}' requires ${o} to be invoked before ${n}`)},getStepConfig=(e,t,s="")=>{var n;return lodash_1.castArray(null===(n=e.options)||void 0===n?void 0:n[t]).map((e=>{if(Array.isArray(e)){const[t,s]=e;return Object.assign(Object.assign({},s),{path:t})}return e})).find((e=>(null==e?void 0:e.path)===s))||{}};exports.getStepConfig=getStepConfig;const getStepConfigs=(e,t="")=>exports.releaseSteps.reduce(((s,n)=>(s[n]=exports.getStepConfig(e,n,t),s)),{});exports.getStepConfigs=getStepConfigs;const metaContexts=new WeakMap,getMetaContext=e=>{let t=metaContexts.get(e);return t||(t={invoked:[]},metaContexts.set(e,t)),t},createPlugin=e=>{const t=exports.normalizeOptions(e),{handler:s,include:n,exclude:o,name:r}=t;return exports.releaseSteps.filter((e=>n.includes(e)&&!o.includes(e))).reduce(((e,n)=>(e[n]=(e,o)=>{const i=getMetaContext(o);checkPrevSteps(i,t,n),i.invoked.push(n);const p=exports.getStepConfigs(o,r),a=p[n];return s({pluginConfig:e,context:o,step:n,stepConfig:a,stepConfigs:p})},e)),{})};exports.createPlugin=createPlugin;
"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.createPlugin=exports.getStepConfigs=exports.getStepConfig=exports.normalizeOptions=exports.defaultOptions=exports.releaseSteps=void 0;const tslib_1=require("tslib"),lodash_1=require("lodash"),read_pkg_up_1=require("read-pkg-up");tslib_1.__exportStar(require("./interface"),exports),exports.releaseSteps=["verifyConditions","analyzeCommits","verifyRelease","generateNotes","prepare","publish","addChannel","success","fail"],exports.defaultOptions={include:exports.releaseSteps,exclude:[],require:[],handler:()=>tslib_1.__awaiter(void 0,void 0,void 0,(function*(){})),name:String(null===(_c=null===(_b=read_pkg_up_1.sync({cwd:null===(_a=null===module||void 0===module?void 0:module.parent)||void 0===_a?void 0:_a.filename}))||void 0===_b?void 0:_b.packageJson)||void 0===_c?void 0:_c.name)};const normalizeOptions=e=>{const t="function"==typeof e?{handler:e}:e;return Object.assign(Object.assign({},exports.defaultOptions),t)};exports.normalizeOptions=normalizeOptions;const checkPrevSteps=({invoked:e},{name:t,require:s},n)=>{if(0===s.length)return;const o=exports.releaseSteps.slice(0,exports.releaseSteps.indexOf(n)).find((t=>s.includes(t)&&!e.includes(t)));if(o)throw new Error(`plugin '${t}' requires ${o} to be invoked before ${n}`)},getStepConfig=(e,t,s="")=>{var n;return lodash_1.castArray(null===(n=e.options)||void 0===n?void 0:n[t]).map((e=>{if(Array.isArray(e)){const[t,s]=e;return Object.assign(Object.assign({},s),{path:t})}return e})).find((e=>(null==e?void 0:e.path)===s))};exports.getStepConfig=getStepConfig;const getStepConfigs=(e,t="")=>exports.releaseSteps.reduce(((s,n)=>(s[n]=exports.getStepConfig(e,n,t),s)),{});exports.getStepConfigs=getStepConfigs;const metaContexts=new WeakMap,getMetaContext=e=>{let t=metaContexts.get(e);return t||(t={invoked:[]},metaContexts.set(e,t)),t},createPlugin=e=>{const t=exports.normalizeOptions(e),{handler:s,include:n,exclude:o,name:r}=t;return exports.releaseSteps.filter((e=>n.includes(e)&&!o.includes(e))).reduce(((e,n)=>(e[n]=(e,o)=>{const i=getMetaContext(o);checkPrevSteps(i,t,n),i.invoked.push(n);const p=exports.getStepConfigs(o,r),a=p[n];return s({pluginConfig:e,context:o,step:n,stepConfig:a,stepConfigs:p})},e)),{})};exports.createPlugin=createPlugin;
import { Context } from 'semantic-release';
export declare type TSemrelContext = Context;
export declare type TReleaseType = 'patch' | 'minor' | 'major';
export declare type TTag = {
version: string;
channel: string;
gitTag: string;
gitHead: string;
};
export declare type TBranch = {
channel?: string;
tags: string[];
type: string;
name: string;
range: string;
accept: TReleaseType[];
main: boolean;
};
export declare type TSemrelContext = Context & {
cwd: string;
branch?: TBranch;
branches: string[];
};
export declare type TPluginConfig = Record<any, any>;

@@ -18,6 +37,6 @@ export declare type TPluginMethod<T = void> = (pluginConfig: TPluginConfig, context: TSemrelContext) => Promise<T>;

export declare type TReleaseStep = keyof TPlugin;
export declare type TStepConfigs = Record<TReleaseStep, TPluginConfig>;
export declare type TStepConfigs = Record<TReleaseStep, TPluginConfig | undefined>;
export declare type TPluginHandlerContext = {
pluginConfig: TPluginConfig;
stepConfig: TPluginConfig;
stepConfig?: TPluginConfig;
stepConfigs: TStepConfigs;

@@ -24,0 +43,0 @@ context: TSemrelContext;

@@ -74,3 +74,3 @@ import { castArray } from 'lodash'

name = '',
): TPluginConfig =>
): TPluginConfig | undefined =>
castArray(context.options?.[step])

@@ -86,3 +86,3 @@ .map((config) => {

})
.find((config) => config?.path === name) || {}
.find((config) => config?.path === name)

@@ -92,8 +92,11 @@ export const getStepConfigs = (

name = '',
): Record<TReleaseStep, TPluginConfig> =>
releaseSteps.reduce<Record<TReleaseStep, TPluginConfig>>((configs, step) => {
configs[step] = getStepConfig(context, step, name)
): Record<TReleaseStep, TPluginConfig | undefined> =>
releaseSteps.reduce<Record<TReleaseStep, TPluginConfig | undefined>>(
(configs, step) => {
configs[step] = getStepConfig(context, step, name)
return configs
}, {} as Record<TReleaseStep, TPluginConfig>)
return configs
},
{} as Record<TReleaseStep, TPluginConfig | undefined>,
)

@@ -100,0 +103,0 @@ const metaContexts: WeakMap<TSemrelContext, TPluginMetaContext> = new WeakMap()

import { Context } from 'semantic-release'
export type TSemrelContext = Context
export type TReleaseType = 'patch' | 'minor' | 'major'
export type TTag = {
version: string
channel: string
gitTag: string
gitHead: string
}
export type TBranch = {
channel?: string
tags: string[]
type: string
name: string
range: string
accept: TReleaseType[]
main: boolean
}
export type TSemrelContext = Context & {
cwd: string
branch?: TBranch
branches: string[]
}
export type TPluginConfig = Record<any, any>

@@ -28,7 +49,7 @@

export type TStepConfigs = Record<TReleaseStep, TPluginConfig>
export type TStepConfigs = Record<TReleaseStep, TPluginConfig | undefined>
export type TPluginHandlerContext = {
pluginConfig: TPluginConfig
stepConfig: TPluginConfig
stepConfig?: TPluginConfig
stepConfigs: TStepConfigs

@@ -35,0 +56,0 @@ context: TSemrelContext

@@ -17,4 +17,4 @@ // Generated by dts-bundle v0.7.4

export const normalizeOptions: (options: TReleaseHandler | TPluginFactoryOptions) => TPluginFactoryOptionsNormalized;
export const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig;
export const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig>;
export const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig | undefined;
export const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig | undefined>;
export const createPlugin: TPluginFactory;

@@ -25,4 +25,23 @@ }

import { Context } from 'semantic-release';
export type TSemrelContext = Context;
export type TReleaseType = 'patch' | 'minor' | 'major';
export type TTag = {
version: string;
channel: string;
gitTag: string;
gitHead: string;
};
export type TBranch = {
channel?: string;
tags: string[];
type: string;
name: string;
range: string;
accept: TReleaseType[];
main: boolean;
};
export type TSemrelContext = Context & {
cwd: string;
branch?: TBranch;
branches: string[];
};
export type TPluginConfig = Record<any, any>;

@@ -42,6 +61,6 @@ export type TPluginMethod<T = void> = (pluginConfig: TPluginConfig, context: TSemrelContext) => Promise<T>;

export type TReleaseStep = keyof TPlugin;
export type TStepConfigs = Record<TReleaseStep, TPluginConfig>;
export type TStepConfigs = Record<TReleaseStep, TPluginConfig | undefined>;
export type TPluginHandlerContext = {
pluginConfig: TPluginConfig;
stepConfig: TPluginConfig;
stepConfig?: TPluginConfig;
stepConfigs: TStepConfigs;

@@ -82,4 +101,4 @@ context: TSemrelContext;

export const normalizeOptions: (options: TReleaseHandler | TPluginFactoryOptions) => TPluginFactoryOptionsNormalized;
export const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig;
export const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig>;
export const getStepConfig: (context: TSemrelContext, step: TReleaseStep, name?: string) => TPluginConfig | undefined;
export const getStepConfigs: (context: TSemrelContext, name?: string) => Record<TReleaseStep, TPluginConfig | undefined>;
export const createPlugin: TPluginFactory;

@@ -90,4 +109,23 @@ }

import { Context } from 'semantic-release';
export type TSemrelContext = Context;
export type TReleaseType = 'patch' | 'minor' | 'major';
export type TTag = {
version: string;
channel: string;
gitTag: string;
gitHead: string;
};
export type TBranch = {
channel?: string;
tags: string[];
type: string;
name: string;
range: string;
accept: TReleaseType[];
main: boolean;
};
export type TSemrelContext = Context & {
cwd: string;
branch?: TBranch;
branches: string[];
};
export type TPluginConfig = Record<any, any>;

@@ -107,6 +145,6 @@ export type TPluginMethod<T = void> = (pluginConfig: TPluginConfig, context: TSemrelContext) => Promise<T>;

export type TReleaseStep = keyof TPlugin;
export type TStepConfigs = Record<TReleaseStep, TPluginConfig>;
export type TStepConfigs = Record<TReleaseStep, TPluginConfig | undefined>;
export type TPluginHandlerContext = {
pluginConfig: TPluginConfig;
stepConfig: TPluginConfig;
stepConfig?: TPluginConfig;
stepConfigs: TStepConfigs;

@@ -113,0 +151,0 @@ context: TSemrelContext;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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