@qlover/fe-release 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/release.js +50 -0
- package/dist/cjs/index.d.ts +123 -0
- package/dist/cjs/index.js +1 -0
- package/dist/es/index.d.ts +123 -0
- package/dist/es/index.js +1 -0
- package/package.json +61 -0
package/bin/release.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { release } from '../dist/es/index.js';
|
|
4
|
+
import releaseIt from 'release-it';
|
|
5
|
+
import { readFileSync } from 'fs';
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
|
|
8
|
+
function programArgs() {
|
|
9
|
+
const program = new Command();
|
|
10
|
+
program
|
|
11
|
+
.option(
|
|
12
|
+
'-d, --dry-run',
|
|
13
|
+
'Do not touch or write anything, but show the commands'
|
|
14
|
+
)
|
|
15
|
+
.option('-V, --verbose', 'Show more information')
|
|
16
|
+
.option('-P, --pull-request', 'Create a release PR')
|
|
17
|
+
.option(
|
|
18
|
+
'-p, --publish-path <publishPath>',
|
|
19
|
+
'The path of the package to release'
|
|
20
|
+
);
|
|
21
|
+
// parse arguments
|
|
22
|
+
program.parse();
|
|
23
|
+
|
|
24
|
+
return program.opts();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function main() {
|
|
28
|
+
const { dryRun, verbose, ...commandOptions } = programArgs();
|
|
29
|
+
|
|
30
|
+
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @type {import('@qlover/fe-release').ReleaseContextOptions['options']}
|
|
34
|
+
*/
|
|
35
|
+
const options = {
|
|
36
|
+
...commandOptions,
|
|
37
|
+
packageJson: packageJson,
|
|
38
|
+
releaseIt: releaseIt
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
await release({
|
|
42
|
+
dryRun,
|
|
43
|
+
verbose,
|
|
44
|
+
options
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
main().catch(() => {
|
|
49
|
+
process.exit(1);
|
|
50
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { FeReleaseConfig, FeScriptContext, ScriptsLogger, Shell } from '@qlover/scripts-context';
|
|
2
|
+
import { Env } from '@qlover/env-loader';
|
|
3
|
+
import { ExecutorContext, ExecutorPlugin } from '@qlover/fe-utils';
|
|
4
|
+
|
|
5
|
+
interface InitOptions {
|
|
6
|
+
token?: string;
|
|
7
|
+
repoName?: string;
|
|
8
|
+
authorName?: string;
|
|
9
|
+
}
|
|
10
|
+
interface PullRequestInterface {
|
|
11
|
+
init(params: InitOptions): Promise<unknown>;
|
|
12
|
+
mergePullRequest(params: unknown): Promise<unknown>;
|
|
13
|
+
mergePullRequest(params: unknown): Promise<unknown>;
|
|
14
|
+
getPullRequest(params: unknown): Promise<unknown>;
|
|
15
|
+
deleteBranch(params: unknown): Promise<unknown>;
|
|
16
|
+
addPullRequestLabels(params: unknown): Promise<unknown>;
|
|
17
|
+
createPullRequestLabel(params: unknown): Promise<unknown>;
|
|
18
|
+
createPullRequest(params: unknown): Promise<{
|
|
19
|
+
/**
|
|
20
|
+
* pr number
|
|
21
|
+
*/
|
|
22
|
+
number: number;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
getUserInfo(): Promise<{
|
|
26
|
+
repoName: string;
|
|
27
|
+
authorName: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface ExecutorReleaseContext extends ExecutorContext<ReleaseContext> {
|
|
32
|
+
returnValue: ReleaseReturnValue;
|
|
33
|
+
}
|
|
34
|
+
type ReleaseReturnValue = {
|
|
35
|
+
githubToken?: string;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
interface ReleaseOptions {
|
|
39
|
+
config: ReleaseContext;
|
|
40
|
+
path?: string;
|
|
41
|
+
mode?: string;
|
|
42
|
+
releaseBranch?: string;
|
|
43
|
+
releaseEnv?: string;
|
|
44
|
+
env?: Env;
|
|
45
|
+
packageJson?: Record<string, unknown>;
|
|
46
|
+
releaseIt?: ReleaseItInstanceType;
|
|
47
|
+
npmToken?: string;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
type ReleaseItInstanceOptions = Record<string, unknown>;
|
|
51
|
+
type ReleaseItInstanceResult = {
|
|
52
|
+
changelog: string;
|
|
53
|
+
version: string;
|
|
54
|
+
};
|
|
55
|
+
type ReleaseItInstanceType = (options: ReleaseItInstanceOptions) => Promise<ReleaseItInstanceResult>;
|
|
56
|
+
type DeepPartial<T> = {
|
|
57
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
58
|
+
};
|
|
59
|
+
interface ReleaseConfig extends FeReleaseConfig {
|
|
60
|
+
/**
|
|
61
|
+
* package.json
|
|
62
|
+
*/
|
|
63
|
+
packageJson?: Record<string, unknown>;
|
|
64
|
+
releaseIt?: ReleaseItInstanceType;
|
|
65
|
+
/**
|
|
66
|
+
* 是否发布一个PR
|
|
67
|
+
*/
|
|
68
|
+
pullRequest?: boolean;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
type ReleaseContextOptions = Partial<ReleaseContext>;
|
|
72
|
+
|
|
73
|
+
declare class ReleaseContext extends FeScriptContext<ReleaseConfig> {
|
|
74
|
+
protected readonly env: Env;
|
|
75
|
+
protected config: ReleaseConfig;
|
|
76
|
+
constructor(context: ReleaseContextOptions);
|
|
77
|
+
setConfig(config: DeepPartial<ReleaseConfig>): void;
|
|
78
|
+
getConfig(key: string | string[], defaultValue?: unknown): unknown;
|
|
79
|
+
getInitEnv(): Env;
|
|
80
|
+
getEnv(): Env;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type StepOption<T> = {
|
|
84
|
+
label: string;
|
|
85
|
+
task: () => Promise<T>;
|
|
86
|
+
};
|
|
87
|
+
declare abstract class Plugin implements ExecutorPlugin {
|
|
88
|
+
protected context: ReleaseContext;
|
|
89
|
+
abstract readonly pluginName: string;
|
|
90
|
+
readonly onlyOne = true;
|
|
91
|
+
constructor(context: ReleaseContext);
|
|
92
|
+
get logger(): ScriptsLogger;
|
|
93
|
+
get shell(): Shell;
|
|
94
|
+
getEnv(key: string, defaultValue?: string): string | undefined;
|
|
95
|
+
enabled(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* get reelase config
|
|
98
|
+
*
|
|
99
|
+
* feConfig.release
|
|
100
|
+
*/
|
|
101
|
+
getConfig(keys: string | string[], defaultValue?: unknown): unknown;
|
|
102
|
+
/**
|
|
103
|
+
* set release config
|
|
104
|
+
*/
|
|
105
|
+
setConfig(config: DeepPartial<ReleaseConfig>): void;
|
|
106
|
+
onBefore?(_context: ExecutorReleaseContext): void | Promise<void>;
|
|
107
|
+
onSuccess?(_context: ExecutorReleaseContext): void | Promise<void>;
|
|
108
|
+
onError?(_context: ExecutorReleaseContext): void | Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* run a step
|
|
111
|
+
*
|
|
112
|
+
* this will log the step and return the result of the task
|
|
113
|
+
*
|
|
114
|
+
* @param label - the label of the step
|
|
115
|
+
* @param task - the task to run
|
|
116
|
+
* @returns the result of the task
|
|
117
|
+
*/
|
|
118
|
+
step<T>({ label, task }: StepOption<T>): Promise<T>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare function release(context: ReleaseContextOptions): Promise<ReleaseReturnValue>;
|
|
122
|
+
|
|
123
|
+
export { type DeepPartial, type ExecutorReleaseContext, type InitOptions, Plugin, type PullRequestInterface, type ReleaseConfig, ReleaseContext, type ReleaseContextOptions, type ReleaseItInstanceOptions, type ReleaseItInstanceResult, type ReleaseItInstanceType, type ReleaseOptions, type ReleaseReturnValue, release };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t,e,r,n,i,o,u,a,s,c,f,l,h,g,p,v,b,d,y,m,w,_,R,P,O,j,E,N,k,x,C,B,A,I,T,S,$,q,z,F,U,L,M,V,G,D,H,K,W,J,Y,Q,X,Z,tt,et,rt,nt,it,ot,ut,at,st,ct,ft,lt,ht,gt,pt,vt,bt,dt,yt,mt,wt,_t,Rt,Pt,Ot,jt,Et,Nt,kt,xt,Ct,Bt,At,It,Tt,St,$t,qt,zt,Ft,Ut,Lt,Mt,Vt,Gt=require("@qlover/scripts-context"),Dt=require("@qlover/env-loader"),Ht=require("@qlover/fe-utils"),Kt=require("fs"),Wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yt(){if(e)return t;return e=1,t=function(){this.__data__=[],this.size=0}}function Qt(){if(n)return r;return n=1,r=function(t,e){return t===e||t!=t&&e!=e}}function Xt(){if(o)return i;o=1;var t=Qt();return i=function(e,r){for(var n=e.length;n--;)if(t(e[n][0],r))return n;return-1}}function Zt(){if(a)return u;a=1;var t=Xt(),e=Array.prototype.splice;return u=function(r){var n=this.__data__,i=t(n,r);return!(i<0)&&(i==n.length-1?n.pop():e.call(n,i,1),--this.size,!0)}}function te(){if(c)return s;c=1;var t=Xt();return s=function(e){var r=this.__data__,n=t(r,e);return n<0?void 0:r[n][1]}}function ee(){if(l)return f;l=1;var t=Xt();return f=function(e){return t(this.__data__,e)>-1}}function re(){if(g)return h;g=1;var t=Xt();return h=function(e,r){var n=this.__data__,i=t(n,e);return i<0?(++this.size,n.push([e,r])):n[i][1]=r,this}}function ne(){if(v)return p;v=1;var t=Yt(),e=Zt(),r=te(),n=ee(),i=re();function o(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,p=o}function ie(){if(d)return b;d=1;var t=ne();return b=function(){this.__data__=new t,this.size=0}}function oe(){if(m)return y;return m=1,y=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}}function ue(){if(_)return w;return _=1,w=function(t){return this.__data__.get(t)}}function ae(){if(P)return R;return P=1,R=function(t){return this.__data__.has(t)}}function se(){if(j)return O;j=1;var t="object"==typeof Wt&&Wt&&Wt.Object===Object&&Wt;return O=t}function ce(){if(N)return E;N=1;var t=se(),e="object"==typeof self&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return E=r}function fe(){if(x)return k;x=1;var t=ce().Symbol;return k=t}function le(){if(B)return C;B=1;var t=fe(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;return C=function(t){var e=r.call(t,i),o=t[i];try{t[i]=void 0;var u=!0}catch(t){}var a=n.call(t);return u&&(e?t[i]=o:delete t[i]),a}}function he(){if(I)return A;I=1;var t=Object.prototype.toString;return A=function(e){return t.call(e)}}function ge(){if(S)return T;S=1;var t=fe(),e=le(),r=he(),n=t?t.toStringTag:void 0;return T=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":n&&n in Object(t)?e(t):r(t)}}function pe(){if(q)return $;return q=1,$=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function ve(){if(F)return z;F=1;var t=ge(),e=pe();return z=function(r){if(!e(r))return!1;var n=t(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}function be(){if(L)return U;L=1;var t=ce()["__core-js_shared__"];return U=t}function de(){if(V)return M;V=1;var t,e=be(),r=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return M=function(t){return!!r&&r in t}}function ye(){if(D)return G;D=1;var t=Function.prototype.toString;return G=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}function me(){if(K)return H;K=1;var t=ve(),e=de(),r=pe(),n=ye(),i=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,a=o.toString,s=u.hasOwnProperty,c=RegExp("^"+a.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return H=function(o){return!(!r(o)||e(o))&&(t(o)?c:i).test(n(o))}}function we(){if(J)return W;return J=1,W=function(t,e){return null==t?void 0:t[e]}}function _e(){if(Q)return Y;Q=1;var t=me(),e=we();return Y=function(r,n){var i=e(r,n);return t(i)?i:void 0}}function Re(){if(Z)return X;Z=1;var t=_e()(ce(),"Map");return X=t}function Pe(){if(et)return tt;et=1;var t=_e()(Object,"create");return tt=t}function Oe(){if(nt)return rt;nt=1;var t=Pe();return rt=function(){this.__data__=t?t(null):{},this.size=0}}function je(){if(ot)return it;return ot=1,it=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}}function Ee(){if(at)return ut;at=1;var t=Pe(),e=Object.prototype.hasOwnProperty;return ut=function(r){var n=this.__data__;if(t){var i=n[r];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(n,r)?n[r]:void 0}}function Ne(){if(ct)return st;ct=1;var t=Pe(),e=Object.prototype.hasOwnProperty;return st=function(r){var n=this.__data__;return t?void 0!==n[r]:e.call(n,r)}}function ke(){if(lt)return ft;lt=1;var t=Pe();return ft=function(e,r){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=t&&void 0===r?"__lodash_hash_undefined__":r,this}}function xe(){if(gt)return ht;gt=1;var t=Oe(),e=je(),r=Ee(),n=Ne(),i=ke();function o(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,ht=o}function Ce(){if(vt)return pt;vt=1;var t=xe(),e=ne(),r=Re();return pt=function(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}}function Be(){if(dt)return bt;return dt=1,bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}}function Ae(){if(mt)return yt;mt=1;var t=Be();return yt=function(e,r){var n=e.__data__;return t(r)?n["string"==typeof r?"string":"hash"]:n.map}}function Ie(){if(_t)return wt;_t=1;var t=Ae();return wt=function(e){var r=t(this,e).delete(e);return this.size-=r?1:0,r}}function Te(){if(Pt)return Rt;Pt=1;var t=Ae();return Rt=function(e){return t(this,e).get(e)}}function Se(){if(jt)return Ot;jt=1;var t=Ae();return Ot=function(e){return t(this,e).has(e)}}function $e(){if(Nt)return Et;Nt=1;var t=Ae();return Et=function(e,r){var n=t(this,e),i=n.size;return n.set(e,r),this.size+=n.size==i?0:1,this}}function qe(){if(xt)return kt;xt=1;var t=Ce(),e=Ie(),r=Te(),n=Se(),i=$e();function o(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,kt=o}function ze(){if(Bt)return Ct;Bt=1;var t=ne(),e=Re(),r=qe();return Ct=function(n,i){var o=this.__data__;if(o instanceof t){var u=o.__data__;if(!e||u.length<199)return u.push([n,i]),this.size=++o.size,this;o=this.__data__=new r(u)}return o.set(n,i),this.size=o.size,this}}function Fe(){if(It)return At;It=1;var t=ne(),e=ie(),r=oe(),n=ue(),i=ae(),o=ze();function u(e){var r=this.__data__=new t(e);this.size=r.size}return u.prototype.clear=e,u.prototype.delete=r,u.prototype.get=n,u.prototype.has=i,u.prototype.set=o,At=u}function Ue(){if(St)return Tt;St=1;var t=_e(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();return Tt=e}function Le(){if(qt)return $t;qt=1;var t=Ue();return $t=function(e,r,n){"__proto__"==r&&t?t(e,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[r]=n}}function Me(){if(Ft)return zt;Ft=1;var t=Le(),e=Qt();return zt=function(r,n,i){(void 0!==i&&!e(r[n],i)||void 0===i&&!(n in r))&&t(r,n,i)}}function Ve(){if(Lt)return Ut;return Lt=1,Ut=function(t){return function(e,r,n){for(var i=-1,o=Object(e),u=n(e),a=u.length;a--;){var s=u[t?a:++i];if(!1===r(o[s],s,o))break}return e}}}function Ge(){if(Vt)return Mt;Vt=1;var t=Ve()();return Mt=t}var De,He,Ke,We,Je,Ye,Qe,Xe,Ze,tr,er,rr,nr,ir,or,ur,ar,sr,cr,fr,lr,hr,gr,pr,vr,br,dr,yr,mr,wr,_r,Rr,Pr,Or={exports:{}};function jr(){return De||(De=1,function(t,e){var r=ce(),n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n?r.Buffer:void 0,u=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=u?u(r):new t.constructor(r);return t.copy(n),n}}(Or,Or.exports)),Or.exports}function Er(){if(Ke)return He;Ke=1;var t=ce().Uint8Array;return He=t}function Nr(){if(Je)return We;Je=1;var t=Er();return We=function(e){var r=new e.constructor(e.byteLength);return new t(r).set(new t(e)),r}}function kr(){if(Qe)return Ye;Qe=1;var t=Nr();return Ye=function(e,r){var n=r?t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}}function xr(){if(Ze)return Xe;return Ze=1,Xe=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}}function Cr(){if(er)return tr;er=1;var t=pe(),e=Object.create,r=function(){function r(){}return function(n){if(!t(n))return{};if(e)return e(n);r.prototype=n;var i=new r;return r.prototype=void 0,i}}();return tr=r}function Br(){if(nr)return rr;return nr=1,rr=function(t,e){return function(r){return t(e(r))}}}function Ar(){if(or)return ir;or=1;var t=Br()(Object.getPrototypeOf,Object);return ir=t}function Ir(){if(ar)return ur;ar=1;var t=Object.prototype;return ur=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}}function Tr(){if(cr)return sr;cr=1;var t=Cr(),e=Ar(),r=Ir();return sr=function(n){return"function"!=typeof n.constructor||r(n)?{}:t(e(n))}}function Sr(){if(lr)return fr;return lr=1,fr=function(t){return null!=t&&"object"==typeof t}}function $r(){if(gr)return hr;gr=1;var t=ge(),e=Sr();return hr=function(r){return e(r)&&"[object Arguments]"==t(r)}}function qr(){if(vr)return pr;vr=1;var t=$r(),e=Sr(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,o=t(function(){return arguments}())?t:function(t){return e(t)&&n.call(t,"callee")&&!i.call(t,"callee")};return pr=o}function zr(){if(dr)return br;dr=1;var t=Array.isArray;return br=t}function Fr(){if(mr)return yr;mr=1;return yr=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function Ur(){if(_r)return wr;_r=1;var t=ve(),e=Fr();return wr=function(r){return null!=r&&e(r.length)&&!t(r)}}function Lr(){if(Pr)return Rr;Pr=1;var t=Ur(),e=Sr();return Rr=function(r){return e(r)&&t(r)}}var Mr,Vr,Gr,Dr,Hr,Kr,Wr,Jr,Yr,Qr={exports:{}};function Xr(){if(Vr)return Mr;return Vr=1,Mr=function(){return!1}}function Zr(){return Gr||(Gr=1,function(t,e){var r=ce(),n=Xr(),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,u=o&&o.exports===i?r.Buffer:void 0,a=(u?u.isBuffer:void 0)||n;t.exports=a}(Qr,Qr.exports)),Qr.exports}function tn(){if(Hr)return Dr;Hr=1;var t=ge(),e=Ar(),r=Sr(),n=Function.prototype,i=Object.prototype,o=n.toString,u=i.hasOwnProperty,a=o.call(Object);return Dr=function(n){if(!r(n)||"[object Object]"!=t(n))return!1;var i=e(n);if(null===i)return!0;var s=u.call(i,"constructor")&&i.constructor;return"function"==typeof s&&s instanceof s&&o.call(s)==a}}function en(){if(Wr)return Kr;Wr=1;var t=ge(),e=Fr(),r=Sr(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,Kr=function(i){return r(i)&&e(i.length)&&!!n[t(i)]}}function rn(){if(Yr)return Jr;return Yr=1,Jr=function(t){return function(e){return t(e)}}}var nn,on,un,an,sn,cn,fn,ln,hn,gn,pn,vn,bn,dn,yn,mn,wn,_n,Rn,Pn,On,jn,En,Nn,kn,xn,Cn,Bn,An,In,Tn,Sn,$n,qn,zn,Fn,Un,Ln,Mn,Vn,Gn,Dn,Hn,Kn,Wn,Jn,Yn,Qn,Xn,Zn={exports:{}};function ti(){return nn||(nn=1,function(t,e){var r=se(),n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=u}(Zn,Zn.exports)),Zn.exports}function ei(){if(un)return on;un=1;var t=en(),e=rn(),r=ti(),n=r&&r.isTypedArray,i=n?e(n):t;return on=i}function ri(){if(sn)return an;return sn=1,an=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}function ni(){if(fn)return cn;fn=1;var t=Le(),e=Qt(),r=Object.prototype.hasOwnProperty;return cn=function(n,i,o){var u=n[i];r.call(n,i)&&e(u,o)&&(void 0!==o||i in n)||t(n,i,o)}}function ii(){if(hn)return ln;hn=1;var t=ni(),e=Le();return ln=function(r,n,i,o){var u=!i;i||(i={});for(var a=-1,s=n.length;++a<s;){var c=n[a],f=o?o(i[c],r[c],c,i,r):void 0;void 0===f&&(f=r[c]),u?e(i,c,f):t(i,c,f)}return i}}function oi(){if(pn)return gn;return pn=1,gn=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}}function ui(){if(bn)return vn;bn=1;var t=/^(?:0|[1-9]\d*)$/;return vn=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}}function ai(){if(yn)return dn;yn=1;var t=oi(),e=qr(),r=zr(),n=Zr(),i=ui(),o=ei(),u=Object.prototype.hasOwnProperty;return dn=function(a,s){var c=r(a),f=!c&&e(a),l=!c&&!f&&n(a),h=!c&&!f&&!l&&o(a),g=c||f||l||h,p=g?t(a.length,String):[],v=p.length;for(var b in a)!s&&!u.call(a,b)||g&&("length"==b||l&&("offset"==b||"parent"==b)||h&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||i(b,v))||p.push(b);return p}}function si(){if(wn)return mn;return wn=1,mn=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}}function ci(){if(Rn)return _n;Rn=1;var t=pe(),e=Ir(),r=si(),n=Object.prototype.hasOwnProperty;return _n=function(i){if(!t(i))return r(i);var o=e(i),u=[];for(var a in i)("constructor"!=a||!o&&n.call(i,a))&&u.push(a);return u}}function fi(){if(On)return Pn;On=1;var t=ai(),e=ci(),r=Ur();return Pn=function(n){return r(n)?t(n,!0):e(n)}}function li(){if(En)return jn;En=1;var t=ii(),e=fi();return jn=function(r){return t(r,e(r))}}function hi(){if(kn)return Nn;kn=1;var t=Me(),e=jr(),r=kr(),n=xr(),i=Tr(),o=qr(),u=zr(),a=Lr(),s=Zr(),c=ve(),f=pe(),l=tn(),h=ei(),g=ri(),p=li();return Nn=function(v,b,d,y,m,w,_){var R=g(v,d),P=g(b,d),O=_.get(P);if(O)t(v,d,O);else{var j=w?w(R,P,d+"",v,b,_):void 0,E=void 0===j;if(E){var N=u(P),k=!N&&s(P),x=!N&&!k&&h(P);j=P,N||k||x?u(R)?j=R:a(R)?j=n(R):k?(E=!1,j=e(P,!0)):x?(E=!1,j=r(P,!0)):j=[]:l(P)||o(P)?(j=R,o(R)?j=p(R):f(R)&&!c(R)||(j=i(P))):E=!1}E&&(_.set(P,j),m(j,P,y,w,_),_.delete(P)),t(v,d,j)}}}function gi(){if(Cn)return xn;Cn=1;var t=Fe(),e=Me(),r=Ge(),n=hi(),i=pe(),o=fi(),u=ri();return xn=function a(s,c,f,l,h){s!==c&&r(c,(function(r,o){if(h||(h=new t),i(r))n(s,c,o,f,a,l,h);else{var g=l?l(u(s,o),r,o+"",s,c,h):void 0;void 0===g&&(g=r),e(s,o,g)}}),o)},xn}function pi(){if(An)return Bn;return An=1,Bn=function(t){return t}}function vi(){if(Tn)return In;return Tn=1,In=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}}function bi(){if($n)return Sn;$n=1;var t=vi(),e=Math.max;return Sn=function(r,n,i){return n=e(void 0===n?r.length-1:n,0),function(){for(var o=arguments,u=-1,a=e(o.length-n,0),s=Array(a);++u<a;)s[u]=o[n+u];u=-1;for(var c=Array(n+1);++u<n;)c[u]=o[u];return c[n]=i(s),t(r,this,c)}},Sn}function di(){if(zn)return qn;return zn=1,qn=function(t){return function(){return t}}}function yi(){if(Un)return Fn;Un=1;var t=di(),e=Ue();return Fn=e?function(r,n){return e(r,"toString",{configurable:!0,enumerable:!1,value:t(n),writable:!0})}:pi()}function mi(){if(Mn)return Ln;Mn=1;var t=Date.now;return Ln=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}},Ln}function wi(){if(Gn)return Vn;Gn=1;var t=yi(),e=mi()(t);return Vn=e}function _i(){if(Hn)return Dn;Hn=1;var t=pi(),e=bi(),r=wi();return Dn=function(n,i){return r(e(n,i,t),n+"")}}function Ri(){if(Wn)return Kn;Wn=1;var t=Qt(),e=Ur(),r=ui(),n=pe();return Kn=function(i,o,u){if(!n(u))return!1;var a=typeof o;return!!("number"==a?e(u)&&r(o,u.length):"string"==a&&o in u)&&t(u[o],i)}}function Pi(){if(Yn)return Jn;Yn=1;var t=_i(),e=Ri();return Jn=function(r){return t((function(t,n){var i=-1,o=n.length,u=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(u=r.length>3&&"function"==typeof u?(o--,u):void 0,a&&e(n[0],n[1],a)&&(u=o<3?void 0:u,o=1),t=Object(t);++i<o;){var s=n[i];s&&r(t,s,i,u)}return t}))}}function Oi(){if(Xn)return Qn;Xn=1;var t=gi(),e=Pi()((function(e,r,n){t(e,r,n)}));return Qn=e}var ji,Ei,Ni,ki,xi,Ci,Bi,Ai,Ii,Ti,Si,$i,qi,zi,Fi,Ui,Li,Mi,Vi,Gi,Di,Hi,Ki,Wi,Ji=Jt(Oi());function Yi(){if(Ei)return ji;Ei=1;var t=ge(),e=Sr();return ji=function(r){return"symbol"==typeof r||e(r)&&"[object Symbol]"==t(r)}}function Qi(){if(ki)return Ni;ki=1;var t=zr(),e=Yi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return Ni=function(i,o){if(t(i))return!1;var u=typeof i;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=i&&!e(i))||(n.test(i)||!r.test(i)||null!=o&&i in Object(o))}}function Xi(){if(Ci)return xi;Ci=1;var t=qe();function e(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=n?n.apply(this,t):t[0],o=i.cache;if(o.has(e))return o.get(e);var u=r.apply(this,t);return i.cache=o.set(e,u)||o,u};return i.cache=new(e.Cache||t),i}return e.Cache=t,xi=e}function Zi(){if(Ai)return Bi;Ai=1;var t=Xi();return Bi=function(e){var r=t(e,(function(t){return 500===n.size&&n.clear(),t})),n=r.cache;return r}}function to(){if(Ti)return Ii;Ti=1;var t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,r=Zi()((function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(t,(function(t,r,i,o){n.push(i?o.replace(e,"$1"):r||t)})),n}));return Ii=r}function eo(){if($i)return Si;return $i=1,Si=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}}function ro(){if(zi)return qi;zi=1;var t=fe(),e=eo(),r=zr(),n=Yi(),i=t?t.prototype:void 0,o=i?i.toString:void 0;return qi=function t(i){if("string"==typeof i)return i;if(r(i))return e(i,t)+"";if(n(i))return o?o.call(i):"";var u=i+"";return"0"==u&&1/i==-1/0?"-0":u},qi}function no(){if(Ui)return Fi;Ui=1;var t=ro();return Fi=function(e){return null==e?"":t(e)}}function io(){if(Mi)return Li;Mi=1;var t=zr(),e=Qi(),r=to(),n=no();return Li=function(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}}function oo(){if(Gi)return Vi;Gi=1;var t=Yi();return Vi=function(e){if("string"==typeof e||t(e))return e;var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}}function uo(){if(Hi)return Di;Hi=1;var t=io(),e=oo();return Di=function(r,n){for(var i=0,o=(n=t(n,r)).length;null!=r&&i<o;)r=r[e(n[i++])];return i&&i==o?r:void 0}}function ao(){if(Wi)return Ki;Wi=1;var t=uo();return Ki=function(e,r,n){var i=null==e?void 0:t(e,r);return void 0===i?n:i}}var so,co,fo=Jt(ao());class lo extends Gt.FeScriptContext{env;config;constructor(t){super(t),this.config=Ji({},this.feConfig.release,this.options),this.env=this.getInitEnv()}setConfig(t){this.config=Ji(this.config,t)}getConfig(t,e){return fo(this.config,t,e)}getInitEnv(){return Dt.Env.searchEnv({logger:this.logger,preloadList:this.feConfig.envOrder})}getEnv(){return this.env}}class ho{context;onlyOne=!0;constructor(t){this.context=t}get logger(){return this.context.logger}get shell(){return this.context.shell}getEnv(t,e){return this.context.getEnv().get(t)??e}enabled(){return!0}getConfig(t,e){return this.context.getConfig(t,e)}setConfig(t){this.context.setConfig(t)}onBefore(t){}onSuccess(t){}onError(t){}async step({label:t,task:e}){this.logger.obtrusive(t);try{const r=await e();return this.logger.info(`${t} - success`),r}catch(t){throw this.logger.error(t),t}}}class go extends ho{pluginName="check-environment";constructor(t,e){if(super(t),!e)throw new Error("releaseIt is not required");this.hasReleaseIt(),this.hasGithubToken()}hasReleaseIt(){if("false"===this.getEnv("FE_RELEASE"))throw new Error("Skip Release");return!0}hasGithubToken(){const t=this.getEnv("GITHUB_TOKEN")||this.getEnv("PAT_TOKEN");if(!t)throw new Error("GITHUB_TOKEN or PAT_TOKEN environment variable is not set.");return this.setConfig({githubToken:t}),!0}onBefore(t){this.logger.verbose("CheckEnvironment onBefore")}}class po extends ho{releasePR;pluginName="create-release-pr";packageJson={};repoInfo;sourceBranch;get autoMergeReleasePR(){return this.getConfig("autoMergeReleasePR",!1)}dryRunPRNumber="999999";get releaseEnv(){return this.getConfig("releaseEnv")??this.getEnv("NODE_ENV")??"development"}constructor(t,e){super(t),this.releasePR=e,this.sourceBranch=this.getEnv("FE_RELEASE_BRANCH")??this.getEnv("FE_RELEASE_SOURCE_BRANCH")??"master"}async onBefore(){this.logger.verbose("CreateReleasePullRequest onBefore"),this.repoInfo=await this.releasePR.getUserInfo();const t=this.getConfig("githubToken");await this.releasePR.init({token:t}),this.packageJson=this.getConfig("packageJson")}async onSuccess(){const t=await this.step({label:"Create Changelog and Version",task:()=>this.createChangelogAndVersion()}),{tagName:e,releaseBranch:r}=await this.step({label:"Create Release Branch",task:()=>this.createReleaseBranch(t)}),n=await this.step({label:"Create Release PR",task:()=>this.createReleasePR(e,r,t)});if(this.autoMergeReleasePR)return await this.step({label:`Merge Release PR(${n})`,task:()=>this.autoMergePR(n,r)}),void await this.step({label:`Checked Release PR(${n})`,task:()=>this.checkedPullRequest(n,r)});this.logger.info(`Please manually merge PR(#${n}) and complete the publishing process afterwards`)}async autoMergePR(t,e){if(!t)return void this.logger.error("Failed to create Pull Request.",t);const r=this.getConfig("autoMergeType","squash");if(this.context.dryRun){const{repoName:n,authorName:i}=this.getRepoInfo();this.logger.info(`[DRY RUN] Would merge PR #${t} with method '${r}' in repo ${i}/${n}, branch ${e}`)}else await this.releasePR.mergePullRequest({pull_number:Number(t),merge_method:r})}async checkedPullRequest(t,e){try{await this.releasePR.getPullRequest({pull_number:Number(t)}),await this.releasePR.deleteBranch({ref:`heads/${e}`}),this.logger.info(`Branch ${e} has been deleted`)}catch(r){if(404===r.status)return void this.logger.warn(`PR #${t} or branch ${e} not found`);throw this.logger.error("Failed to check PR or delete branch",r),r}}async createReleaseBranch(t){const{tagName:e}=await this.checkTag(t),r=this.getReleaseBranch(e);return this.logger.verbose("PR SourceBranch is:",this.sourceBranch),this.logger.verbose("PR TargetBranch is:",r),await this.shell.exec(`git fetch origin ${this.sourceBranch}`),await this.shell.exec(`git merge origin/${this.sourceBranch}`),await this.shell.exec(`git checkout -b ${r}`),await this.shell.exec(`git push origin ${r}`),{tagName:e,releaseBranch:r}}getPkg(t){return fo(this.packageJson,t)}createChangelogAndVersion(){const t=this.getConfig("releaseIt");if(!t)throw new Error("releaseItInstance is not set");return t(this.getReleaseItChangelogOptions())}getReleaseItChangelogOptions(){return{ci:!0,increment:"patch",npm:{publish:!1},git:{requireCleanWorkingDir:!1,tag:!1,push:!1},github:{release:!1},verbose:!0,"dry-run":this.context.dryRun}}async checkTag(t){const e=fo(t,"version")||this.getPkg("version");if("string"!=typeof e)throw new Error("Tag name is not a string");return this.logger.verbose("Created Tag is:",e),{tagName:e}}getReleaseBranch(t){const e=this.getConfig("branchName","release-${tagName}");if("string"!=typeof e)throw new Error("Branch name template is not a string");return this.logger.verbose("Release Branch template is:",e),this.shell.format(e,{env:this.releaseEnv,branch:this.sourceBranch,tagName:t})}async createReleasePR(t,e,r){const n=this.getChangelogAndFeatures(r),i=await this.createReleasePRLabel();return this.getReleasePullRequest({tagName:t,releaseBranch:e,changelog:n,label:i})}async createReleasePRLabel(){const t=this.getConfig("label");if(!(t&&t.name&&t.description&&t.color))throw new Error("Label is not valid, skipping creation");if(this.context.dryRun)return this.logger.info("[DRY RUN] Would create PR label with:",t),t;try{const e=await this.releasePR.createPullRequestLabel({name:t.name,description:t.description,color:t.color.replace("#","")});return this.logger.debug("Create PR label Success",e),t}catch(e){if(422===e.status)return this.logger.warn(`Label ${t.name} already exists, skipping!`),t;throw this.logger.error("Create PR label Failed",e),e}}getChangelogAndFeatures(t){return t||this.logger.warn("No release-it output found, changelog might be incomplete"),fo(t,"changelog","No changelog")}async getReleasePullRequest(t){const e=this.getCreateReleasePROptions(t.tagName,t.releaseBranch,t.changelog);if(this.context.dryRun)return this.logger.info("[DRY RUN] Would create PR with:",{...e,labels:[t.label?.name]}),this.dryRunPRNumber;try{const r=await this.releasePR.createPullRequest(e),n=r.number;if(!n)throw new Error("CreateReleasePR Failed, prNumber is empty");if(this.logger.debug("Create PR Success",r),t.label?.name){const e=await this.releasePR.addPullRequestLabels({issue_number:n,labels:[t.label.name]});this.logger.debug("Add PR label Success",e)}return n.toString()}catch(t){if(422===t.status&&t.message.includes("already exists")){this.logger.warn("PR already exists");const e=t.message.match(/pull request #(\d+)/);return e?e[1]:""}throw this.logger.error("Failed to create PR",t),t}}getCreateReleasePROptions(t,e,r){return{title:this.getReleasePRTitle(t),body:this.getReleasePRBody({tagName:t,changelog:r}),base:this.sourceBranch,head:e}}getReleasePRTitle(t){const e=this.getConfig("PRTitle","Release ${env} ${pkgName} ${tagName}");return this.shell.format(e,{env:this.releaseEnv,branch:this.sourceBranch,tagName:t,pkgName:this.getPkg("name")})}getReleasePRBody({tagName:t,changelog:e}){const r=this.getConfig("PRBody","");return this.shell.format(r,{branch:this.sourceBranch,env:this.releaseEnv,tagName:t,changelog:e})}getRepoInfo(){if(!this.repoInfo)throw new Error("Repository information not initialized");return this.repoInfo}}function vo(){if(co)return so;co=1;var t=ge(),e=zr(),r=Sr();return so=function(n){return"string"==typeof n||!e(n)&&r(n)&&"[object String]"==t(n)}}var bo=Jt(vo());class yo{context;options;octokit;constructor(t,e={}){this.context=t,this.options=e}async init({token:t}){if(this.octokit)return this.octokit;if(!t)throw new Error("Github token is not set");const{repoName:e,authorName:r}=await this.getUserInfo();this.options.repoName=e,this.options.authorName=r;const{Octokit:n}=await import("@octokit/rest"),i=new n({auth:t});return this.octokit=i,i}getOctokit(){if(!this.octokit)throw new Error("Octokit is not initialized");return this.octokit}mergePullRequest(t){return this.getOctokit().rest.pulls.merge({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}getPullRequest(t){return this.getOctokit().rest.pulls.get({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}deleteBranch(t){return this.getOctokit().rest.git.deleteRef({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}addPullRequestLabels(t){return this.getOctokit().rest.issues.addLabels({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}async createPullRequestLabel(t){return await this.getOctokit().rest.issues.createLabel({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}async createPullRequest(t){const e=await this.getOctokit().rest.pulls.create({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""});return{...e.data,number:e.data.number}}async getUserInfo(){let t;try{t=(await this.context.shell.exec("git config --get remote.origin.url",{dryRun:!1})).trim()}catch(t){throw new Error("Failed to get git remote url. Please ensure this is a git repository with a valid remote.")}if(!t)throw new Error("Git remote URL is empty. Please set a valid GitHub remote URL.");this.context.logger.verbose("repoUrl: ",t);const e=t.match(/github\.com[:/]([^/]+)\/([^/.]+)(?:\.git)?$/);if(!e)throw new Error("Invalid GitHub repository URL format. Please ensure the remote URL is from GitHub.");const[,r,n]=e;if(!this.isValidString(r)||!this.isValidString(n))throw new Error("Failed to extract owner or repository name from GitHub URL");return{repoName:n,authorName:r}}isValidString(t){return!!t&&bo(t)}}var mo=Jt(pe());class wo extends ho{pluginName="publish-npm";_releaseItOutput;constructor(t){super(t),this.getIncrementVersion()}async onBefore(){this.logger.verbose("PublishNpm onBefore"),await this.checkNpmAuth(),await this.checkPublishPath()}async onSuccess(){const t=this.getPublishReleaseItOptions(this.context);await this.step({label:"Publish to NPM",task:()=>this.publish(t)})}async publish(t){this.logger.debug("Run release-it method",t);const e=this.getConfig("releaseItInstance");if(!e)throw new Error("releaseItInstance is not set");return this._releaseItOutput=await e(t),this._releaseItOutput}getPublishReleaseItOptions(t){return{ci:!0,npm:{publish:!0},git:{requireCleanWorkingDir:!1,requireUpstream:!1,changelog:!1},plugins:{"@release-it/conventional-changelog":{infile:!1}},"dry-run":t.dryRun,verbose:!0,increment:this.getIncrementVersion()}}getIncrementVersion(){const t=this.getConfig("packageJson");if(!mo(t))throw new Error("package.json is undefined");if(!("version"in t))throw new Error("package.json version is required");return t.version}async checkNpmAuth(){const t=this.getEnv("NPM_TOKEN");if(!t)throw new Error("NPM_TOKEN is not set.");this.setConfig({npmToken:t}),await this.shell.exec(`echo "//registry.npmjs.org/:_authToken=${t}" > .npmrc`)}async checkPublishPath(){const t=this.getPublishPath();this.switchToPublishPath(t),this.logger.debug("Current path:",t)}switchToPublishPath(t){t&&Kt.existsSync(t)&&(this.logger.debug("Switching to publish path:",t),process.chdir(t))}getPublishPath(){const t=this.getConfig("publishPath");return"string"==typeof t?t:process.cwd()}}exports.Plugin=ho,exports.ReleaseContext=lo,exports.release=function(t){const e=new lo(t),r=new Ht.AsyncExecutor;return function(t){const e=[];return e.push(new go(t,t.options.releaseIt)),t.options.pullRequest?e.push(new po(t,new yo(t))):e.push(new wo(t)),e}(e).forEach((t=>{r.use(t)})),r.exec(e,(({returnValue:t})=>Promise.resolve(t)))};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { FeReleaseConfig, FeScriptContext, ScriptsLogger, Shell } from '@qlover/scripts-context';
|
|
2
|
+
import { Env } from '@qlover/env-loader';
|
|
3
|
+
import { ExecutorContext, ExecutorPlugin } from '@qlover/fe-utils';
|
|
4
|
+
|
|
5
|
+
interface InitOptions {
|
|
6
|
+
token?: string;
|
|
7
|
+
repoName?: string;
|
|
8
|
+
authorName?: string;
|
|
9
|
+
}
|
|
10
|
+
interface PullRequestInterface {
|
|
11
|
+
init(params: InitOptions): Promise<unknown>;
|
|
12
|
+
mergePullRequest(params: unknown): Promise<unknown>;
|
|
13
|
+
mergePullRequest(params: unknown): Promise<unknown>;
|
|
14
|
+
getPullRequest(params: unknown): Promise<unknown>;
|
|
15
|
+
deleteBranch(params: unknown): Promise<unknown>;
|
|
16
|
+
addPullRequestLabels(params: unknown): Promise<unknown>;
|
|
17
|
+
createPullRequestLabel(params: unknown): Promise<unknown>;
|
|
18
|
+
createPullRequest(params: unknown): Promise<{
|
|
19
|
+
/**
|
|
20
|
+
* pr number
|
|
21
|
+
*/
|
|
22
|
+
number: number;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
getUserInfo(): Promise<{
|
|
26
|
+
repoName: string;
|
|
27
|
+
authorName: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface ExecutorReleaseContext extends ExecutorContext<ReleaseContext> {
|
|
32
|
+
returnValue: ReleaseReturnValue;
|
|
33
|
+
}
|
|
34
|
+
type ReleaseReturnValue = {
|
|
35
|
+
githubToken?: string;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
interface ReleaseOptions {
|
|
39
|
+
config: ReleaseContext;
|
|
40
|
+
path?: string;
|
|
41
|
+
mode?: string;
|
|
42
|
+
releaseBranch?: string;
|
|
43
|
+
releaseEnv?: string;
|
|
44
|
+
env?: Env;
|
|
45
|
+
packageJson?: Record<string, unknown>;
|
|
46
|
+
releaseIt?: ReleaseItInstanceType;
|
|
47
|
+
npmToken?: string;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
type ReleaseItInstanceOptions = Record<string, unknown>;
|
|
51
|
+
type ReleaseItInstanceResult = {
|
|
52
|
+
changelog: string;
|
|
53
|
+
version: string;
|
|
54
|
+
};
|
|
55
|
+
type ReleaseItInstanceType = (options: ReleaseItInstanceOptions) => Promise<ReleaseItInstanceResult>;
|
|
56
|
+
type DeepPartial<T> = {
|
|
57
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
58
|
+
};
|
|
59
|
+
interface ReleaseConfig extends FeReleaseConfig {
|
|
60
|
+
/**
|
|
61
|
+
* package.json
|
|
62
|
+
*/
|
|
63
|
+
packageJson?: Record<string, unknown>;
|
|
64
|
+
releaseIt?: ReleaseItInstanceType;
|
|
65
|
+
/**
|
|
66
|
+
* 是否发布一个PR
|
|
67
|
+
*/
|
|
68
|
+
pullRequest?: boolean;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
type ReleaseContextOptions = Partial<ReleaseContext>;
|
|
72
|
+
|
|
73
|
+
declare class ReleaseContext extends FeScriptContext<ReleaseConfig> {
|
|
74
|
+
protected readonly env: Env;
|
|
75
|
+
protected config: ReleaseConfig;
|
|
76
|
+
constructor(context: ReleaseContextOptions);
|
|
77
|
+
setConfig(config: DeepPartial<ReleaseConfig>): void;
|
|
78
|
+
getConfig(key: string | string[], defaultValue?: unknown): unknown;
|
|
79
|
+
getInitEnv(): Env;
|
|
80
|
+
getEnv(): Env;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type StepOption<T> = {
|
|
84
|
+
label: string;
|
|
85
|
+
task: () => Promise<T>;
|
|
86
|
+
};
|
|
87
|
+
declare abstract class Plugin implements ExecutorPlugin {
|
|
88
|
+
protected context: ReleaseContext;
|
|
89
|
+
abstract readonly pluginName: string;
|
|
90
|
+
readonly onlyOne = true;
|
|
91
|
+
constructor(context: ReleaseContext);
|
|
92
|
+
get logger(): ScriptsLogger;
|
|
93
|
+
get shell(): Shell;
|
|
94
|
+
getEnv(key: string, defaultValue?: string): string | undefined;
|
|
95
|
+
enabled(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* get reelase config
|
|
98
|
+
*
|
|
99
|
+
* feConfig.release
|
|
100
|
+
*/
|
|
101
|
+
getConfig(keys: string | string[], defaultValue?: unknown): unknown;
|
|
102
|
+
/**
|
|
103
|
+
* set release config
|
|
104
|
+
*/
|
|
105
|
+
setConfig(config: DeepPartial<ReleaseConfig>): void;
|
|
106
|
+
onBefore?(_context: ExecutorReleaseContext): void | Promise<void>;
|
|
107
|
+
onSuccess?(_context: ExecutorReleaseContext): void | Promise<void>;
|
|
108
|
+
onError?(_context: ExecutorReleaseContext): void | Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* run a step
|
|
111
|
+
*
|
|
112
|
+
* this will log the step and return the result of the task
|
|
113
|
+
*
|
|
114
|
+
* @param label - the label of the step
|
|
115
|
+
* @param task - the task to run
|
|
116
|
+
* @returns the result of the task
|
|
117
|
+
*/
|
|
118
|
+
step<T>({ label, task }: StepOption<T>): Promise<T>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare function release(context: ReleaseContextOptions): Promise<ReleaseReturnValue>;
|
|
122
|
+
|
|
123
|
+
export { type DeepPartial, type ExecutorReleaseContext, type InitOptions, Plugin, type PullRequestInterface, type ReleaseConfig, ReleaseContext, type ReleaseContextOptions, type ReleaseItInstanceOptions, type ReleaseItInstanceResult, type ReleaseItInstanceType, type ReleaseOptions, type ReleaseReturnValue, release };
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FeScriptContext as t}from"@qlover/scripts-context";import{Env as e}from"@qlover/env-loader";import{AsyncExecutor as r}from"@qlover/fe-utils";import{existsSync as n}from"fs";var i,o,u,a,s,c,f,l,h,g,p,v,b,d,y,m,w,_,R,P,O,j,E,N,k,x,C,B,I,T,A,$,S,q,z,U,F,L,M,V,G,D,H,K,W,J,Y,Q,X,Z,tt,et,rt,nt,it,ot,ut,at,st,ct,ft,lt,ht,gt,pt,vt,bt,dt,yt,mt,wt,_t,Rt,Pt,Ot,jt,Et,Nt,kt,xt,Ct,Bt,It,Tt,At,$t,St,qt,zt,Ut,Ft,Lt,Mt,Vt,Gt,Dt,Ht,Kt,Wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yt(){if(o)return i;return o=1,i=function(){this.__data__=[],this.size=0}}function Qt(){if(a)return u;return a=1,u=function(t,e){return t===e||t!=t&&e!=e}}function Xt(){if(c)return s;c=1;var t=Qt();return s=function(e,r){for(var n=e.length;n--;)if(t(e[n][0],r))return n;return-1}}function Zt(){if(l)return f;l=1;var t=Xt(),e=Array.prototype.splice;return f=function(r){var n=this.__data__,i=t(n,r);return!(i<0)&&(i==n.length-1?n.pop():e.call(n,i,1),--this.size,!0)}}function te(){if(g)return h;g=1;var t=Xt();return h=function(e){var r=this.__data__,n=t(r,e);return n<0?void 0:r[n][1]}}function ee(){if(v)return p;v=1;var t=Xt();return p=function(e){return t(this.__data__,e)>-1}}function re(){if(d)return b;d=1;var t=Xt();return b=function(e,r){var n=this.__data__,i=t(n,e);return i<0?(++this.size,n.push([e,r])):n[i][1]=r,this}}function ne(){if(m)return y;m=1;var t=Yt(),e=Zt(),r=te(),n=ee(),i=re();function o(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,y=o}function ie(){if(_)return w;_=1;var t=ne();return w=function(){this.__data__=new t,this.size=0}}function oe(){if(P)return R;return P=1,R=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}}function ue(){if(j)return O;return j=1,O=function(t){return this.__data__.get(t)}}function ae(){if(N)return E;return N=1,E=function(t){return this.__data__.has(t)}}function se(){if(x)return k;x=1;var t="object"==typeof Wt&&Wt&&Wt.Object===Object&&Wt;return k=t}function ce(){if(B)return C;B=1;var t=se(),e="object"==typeof self&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return C=r}function fe(){if(T)return I;T=1;var t=ce().Symbol;return I=t}function le(){if($)return A;$=1;var t=fe(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;return A=function(t){var e=r.call(t,i),o=t[i];try{t[i]=void 0;var u=!0}catch(t){}var a=n.call(t);return u&&(e?t[i]=o:delete t[i]),a}}function he(){if(q)return S;q=1;var t=Object.prototype.toString;return S=function(e){return t.call(e)}}function ge(){if(U)return z;U=1;var t=fe(),e=le(),r=he(),n=t?t.toStringTag:void 0;return z=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":n&&n in Object(t)?e(t):r(t)}}function pe(){if(L)return F;return L=1,F=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function ve(){if(V)return M;V=1;var t=ge(),e=pe();return M=function(r){if(!e(r))return!1;var n=t(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}function be(){if(D)return G;D=1;var t=ce()["__core-js_shared__"];return G=t}function de(){if(K)return H;K=1;var t,e=be(),r=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return H=function(t){return!!r&&r in t}}function ye(){if(J)return W;J=1;var t=Function.prototype.toString;return W=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}function me(){if(Q)return Y;Q=1;var t=ve(),e=de(),r=pe(),n=ye(),i=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,a=o.toString,s=u.hasOwnProperty,c=RegExp("^"+a.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Y=function(o){return!(!r(o)||e(o))&&(t(o)?c:i).test(n(o))}}function we(){if(Z)return X;return Z=1,X=function(t,e){return null==t?void 0:t[e]}}function _e(){if(et)return tt;et=1;var t=me(),e=we();return tt=function(r,n){var i=e(r,n);return t(i)?i:void 0}}function Re(){if(nt)return rt;nt=1;var t=_e()(ce(),"Map");return rt=t}function Pe(){if(ot)return it;ot=1;var t=_e()(Object,"create");return it=t}function Oe(){if(at)return ut;at=1;var t=Pe();return ut=function(){this.__data__=t?t(null):{},this.size=0}}function je(){if(ct)return st;return ct=1,st=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}}function Ee(){if(lt)return ft;lt=1;var t=Pe(),e=Object.prototype.hasOwnProperty;return ft=function(r){var n=this.__data__;if(t){var i=n[r];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(n,r)?n[r]:void 0}}function Ne(){if(gt)return ht;gt=1;var t=Pe(),e=Object.prototype.hasOwnProperty;return ht=function(r){var n=this.__data__;return t?void 0!==n[r]:e.call(n,r)}}function ke(){if(vt)return pt;vt=1;var t=Pe();return pt=function(e,r){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=t&&void 0===r?"__lodash_hash_undefined__":r,this}}function xe(){if(dt)return bt;dt=1;var t=Oe(),e=je(),r=Ee(),n=Ne(),i=ke();function o(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,bt=o}function Ce(){if(mt)return yt;mt=1;var t=xe(),e=ne(),r=Re();return yt=function(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}}function Be(){if(_t)return wt;return _t=1,wt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}}function Ie(){if(Pt)return Rt;Pt=1;var t=Be();return Rt=function(e,r){var n=e.__data__;return t(r)?n["string"==typeof r?"string":"hash"]:n.map}}function Te(){if(jt)return Ot;jt=1;var t=Ie();return Ot=function(e){var r=t(this,e).delete(e);return this.size-=r?1:0,r}}function Ae(){if(Nt)return Et;Nt=1;var t=Ie();return Et=function(e){return t(this,e).get(e)}}function $e(){if(xt)return kt;xt=1;var t=Ie();return kt=function(e){return t(this,e).has(e)}}function Se(){if(Bt)return Ct;Bt=1;var t=Ie();return Ct=function(e,r){var n=t(this,e),i=n.size;return n.set(e,r),this.size+=n.size==i?0:1,this}}function qe(){if(Tt)return It;Tt=1;var t=Ce(),e=Te(),r=Ae(),n=$e(),i=Se();function o(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,It=o}function ze(){if($t)return At;$t=1;var t=ne(),e=Re(),r=qe();return At=function(n,i){var o=this.__data__;if(o instanceof t){var u=o.__data__;if(!e||u.length<199)return u.push([n,i]),this.size=++o.size,this;o=this.__data__=new r(u)}return o.set(n,i),this.size=o.size,this}}function Ue(){if(qt)return St;qt=1;var t=ne(),e=ie(),r=oe(),n=ue(),i=ae(),o=ze();function u(e){var r=this.__data__=new t(e);this.size=r.size}return u.prototype.clear=e,u.prototype.delete=r,u.prototype.get=n,u.prototype.has=i,u.prototype.set=o,St=u}function Fe(){if(Ut)return zt;Ut=1;var t=_e(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();return zt=e}function Le(){if(Lt)return Ft;Lt=1;var t=Fe();return Ft=function(e,r,n){"__proto__"==r&&t?t(e,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[r]=n}}function Me(){if(Vt)return Mt;Vt=1;var t=Le(),e=Qt();return Mt=function(r,n,i){(void 0!==i&&!e(r[n],i)||void 0===i&&!(n in r))&&t(r,n,i)}}function Ve(){if(Dt)return Gt;return Dt=1,Gt=function(t){return function(e,r,n){for(var i=-1,o=Object(e),u=n(e),a=u.length;a--;){var s=u[t?a:++i];if(!1===r(o[s],s,o))break}return e}}}function Ge(){if(Kt)return Ht;Kt=1;var t=Ve()();return Ht=t}var De,He,Ke,We,Je,Ye,Qe,Xe,Ze,tr,er,rr,nr,ir,or,ur,ar,sr,cr,fr,lr,hr,gr,pr,vr,br,dr,yr,mr,wr,_r,Rr,Pr,Or={exports:{}};function jr(){return De||(De=1,t=Or,e=Or.exports,r=ce(),n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n?r.Buffer:void 0,u=o?o.allocUnsafe:void 0,t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=u?u(r):new t.constructor(r);return t.copy(n),n}),Or.exports;var t,e,r,n,i,o,u}function Er(){if(Ke)return He;Ke=1;var t=ce().Uint8Array;return He=t}function Nr(){if(Je)return We;Je=1;var t=Er();return We=function(e){var r=new e.constructor(e.byteLength);return new t(r).set(new t(e)),r}}function kr(){if(Qe)return Ye;Qe=1;var t=Nr();return Ye=function(e,r){var n=r?t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}}function xr(){if(Ze)return Xe;return Ze=1,Xe=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}}function Cr(){if(er)return tr;er=1;var t=pe(),e=Object.create,r=function(){function r(){}return function(n){if(!t(n))return{};if(e)return e(n);r.prototype=n;var i=new r;return r.prototype=void 0,i}}();return tr=r}function Br(){if(nr)return rr;return nr=1,rr=function(t,e){return function(r){return t(e(r))}}}function Ir(){if(or)return ir;or=1;var t=Br()(Object.getPrototypeOf,Object);return ir=t}function Tr(){if(ar)return ur;ar=1;var t=Object.prototype;return ur=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}}function Ar(){if(cr)return sr;cr=1;var t=Cr(),e=Ir(),r=Tr();return sr=function(n){return"function"!=typeof n.constructor||r(n)?{}:t(e(n))}}function $r(){if(lr)return fr;return lr=1,fr=function(t){return null!=t&&"object"==typeof t}}function Sr(){if(gr)return hr;gr=1;var t=ge(),e=$r();return hr=function(r){return e(r)&&"[object Arguments]"==t(r)}}function qr(){if(vr)return pr;vr=1;var t=Sr(),e=$r(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,o=t(function(){return arguments}())?t:function(t){return e(t)&&n.call(t,"callee")&&!i.call(t,"callee")};return pr=o}function zr(){if(dr)return br;dr=1;var t=Array.isArray;return br=t}function Ur(){if(mr)return yr;mr=1;return yr=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function Fr(){if(_r)return wr;_r=1;var t=ve(),e=Ur();return wr=function(r){return null!=r&&e(r.length)&&!t(r)}}function Lr(){if(Pr)return Rr;Pr=1;var t=Fr(),e=$r();return Rr=function(r){return e(r)&&t(r)}}var Mr,Vr,Gr,Dr,Hr,Kr,Wr,Jr,Yr,Qr={exports:{}};function Xr(){if(Vr)return Mr;return Vr=1,Mr=function(){return!1}}function Zr(){return Gr||(Gr=1,function(t,e){var r=ce(),n=Xr(),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,u=o&&o.exports===i?r.Buffer:void 0,a=(u?u.isBuffer:void 0)||n;t.exports=a}(Qr,Qr.exports)),Qr.exports}function tn(){if(Hr)return Dr;Hr=1;var t=ge(),e=Ir(),r=$r(),n=Function.prototype,i=Object.prototype,o=n.toString,u=i.hasOwnProperty,a=o.call(Object);return Dr=function(n){if(!r(n)||"[object Object]"!=t(n))return!1;var i=e(n);if(null===i)return!0;var s=u.call(i,"constructor")&&i.constructor;return"function"==typeof s&&s instanceof s&&o.call(s)==a}}function en(){if(Wr)return Kr;Wr=1;var t=ge(),e=Ur(),r=$r(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,Kr=function(i){return r(i)&&e(i.length)&&!!n[t(i)]}}function rn(){if(Yr)return Jr;return Yr=1,Jr=function(t){return function(e){return t(e)}}}var nn,on,un,an,sn,cn,fn,ln,hn,gn,pn,vn,bn,dn,yn,mn,wn,_n,Rn,Pn,On,jn,En,Nn,kn,xn,Cn,Bn,In,Tn,An,$n,Sn,qn,zn,Un,Fn,Ln,Mn,Vn,Gn,Dn,Hn,Kn,Wn,Jn,Yn,Qn,Xn,Zn={exports:{}};function ti(){return nn||(nn=1,t=Zn,e=Zn.exports,r=se(),n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}(),t.exports=u),Zn.exports;var t,e,r,n,i,o,u}function ei(){if(un)return on;un=1;var t=en(),e=rn(),r=ti(),n=r&&r.isTypedArray,i=n?e(n):t;return on=i}function ri(){if(sn)return an;return sn=1,an=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}function ni(){if(fn)return cn;fn=1;var t=Le(),e=Qt(),r=Object.prototype.hasOwnProperty;return cn=function(n,i,o){var u=n[i];r.call(n,i)&&e(u,o)&&(void 0!==o||i in n)||t(n,i,o)}}function ii(){if(hn)return ln;hn=1;var t=ni(),e=Le();return ln=function(r,n,i,o){var u=!i;i||(i={});for(var a=-1,s=n.length;++a<s;){var c=n[a],f=o?o(i[c],r[c],c,i,r):void 0;void 0===f&&(f=r[c]),u?e(i,c,f):t(i,c,f)}return i}}function oi(){if(pn)return gn;return pn=1,gn=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}}function ui(){if(bn)return vn;bn=1;var t=/^(?:0|[1-9]\d*)$/;return vn=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}}function ai(){if(yn)return dn;yn=1;var t=oi(),e=qr(),r=zr(),n=Zr(),i=ui(),o=ei(),u=Object.prototype.hasOwnProperty;return dn=function(a,s){var c=r(a),f=!c&&e(a),l=!c&&!f&&n(a),h=!c&&!f&&!l&&o(a),g=c||f||l||h,p=g?t(a.length,String):[],v=p.length;for(var b in a)!s&&!u.call(a,b)||g&&("length"==b||l&&("offset"==b||"parent"==b)||h&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||i(b,v))||p.push(b);return p}}function si(){if(wn)return mn;return wn=1,mn=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}}function ci(){if(Rn)return _n;Rn=1;var t=pe(),e=Tr(),r=si(),n=Object.prototype.hasOwnProperty;return _n=function(i){if(!t(i))return r(i);var o=e(i),u=[];for(var a in i)("constructor"!=a||!o&&n.call(i,a))&&u.push(a);return u}}function fi(){if(On)return Pn;On=1;var t=ai(),e=ci(),r=Fr();return Pn=function(n){return r(n)?t(n,!0):e(n)}}function li(){if(En)return jn;En=1;var t=ii(),e=fi();return jn=function(r){return t(r,e(r))}}function hi(){if(kn)return Nn;kn=1;var t=Me(),e=jr(),r=kr(),n=xr(),i=Ar(),o=qr(),u=zr(),a=Lr(),s=Zr(),c=ve(),f=pe(),l=tn(),h=ei(),g=ri(),p=li();return Nn=function(v,b,d,y,m,w,_){var R=g(v,d),P=g(b,d),O=_.get(P);if(O)t(v,d,O);else{var j=w?w(R,P,d+"",v,b,_):void 0,E=void 0===j;if(E){var N=u(P),k=!N&&s(P),x=!N&&!k&&h(P);j=P,N||k||x?u(R)?j=R:a(R)?j=n(R):k?(E=!1,j=e(P,!0)):x?(E=!1,j=r(P,!0)):j=[]:l(P)||o(P)?(j=R,o(R)?j=p(R):f(R)&&!c(R)||(j=i(P))):E=!1}E&&(_.set(P,j),m(j,P,y,w,_),_.delete(P)),t(v,d,j)}}}function gi(){if(Cn)return xn;Cn=1;var t=Ue(),e=Me(),r=Ge(),n=hi(),i=pe(),o=fi(),u=ri();return xn=function a(s,c,f,l,h){s!==c&&r(c,(function(r,o){if(h||(h=new t),i(r))n(s,c,o,f,a,l,h);else{var g=l?l(u(s,o),r,o+"",s,c,h):void 0;void 0===g&&(g=r),e(s,o,g)}}),o)},xn}function pi(){if(In)return Bn;return In=1,Bn=function(t){return t}}function vi(){if(An)return Tn;return An=1,Tn=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}}function bi(){if(Sn)return $n;Sn=1;var t=vi(),e=Math.max;return $n=function(r,n,i){return n=e(void 0===n?r.length-1:n,0),function(){for(var o=arguments,u=-1,a=e(o.length-n,0),s=Array(a);++u<a;)s[u]=o[n+u];u=-1;for(var c=Array(n+1);++u<n;)c[u]=o[u];return c[n]=i(s),t(r,this,c)}},$n}function di(){if(zn)return qn;return zn=1,qn=function(t){return function(){return t}}}function yi(){if(Fn)return Un;Fn=1;var t=di(),e=Fe();return Un=e?function(r,n){return e(r,"toString",{configurable:!0,enumerable:!1,value:t(n),writable:!0})}:pi()}function mi(){if(Mn)return Ln;Mn=1;var t=Date.now;return Ln=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}},Ln}function wi(){if(Gn)return Vn;Gn=1;var t=yi(),e=mi()(t);return Vn=e}function _i(){if(Hn)return Dn;Hn=1;var t=pi(),e=bi(),r=wi();return Dn=function(n,i){return r(e(n,i,t),n+"")}}function Ri(){if(Wn)return Kn;Wn=1;var t=Qt(),e=Fr(),r=ui(),n=pe();return Kn=function(i,o,u){if(!n(u))return!1;var a=typeof o;return!!("number"==a?e(u)&&r(o,u.length):"string"==a&&o in u)&&t(u[o],i)}}function Pi(){if(Yn)return Jn;Yn=1;var t=_i(),e=Ri();return Jn=function(r){return t((function(t,n){var i=-1,o=n.length,u=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(u=r.length>3&&"function"==typeof u?(o--,u):void 0,a&&e(n[0],n[1],a)&&(u=o<3?void 0:u,o=1),t=Object(t);++i<o;){var s=n[i];s&&r(t,s,i,u)}return t}))}}function Oi(){if(Xn)return Qn;Xn=1;var t=gi(),e=Pi()((function(e,r,n){t(e,r,n)}));return Qn=e}var ji,Ei,Ni,ki,xi,Ci,Bi,Ii,Ti,Ai,$i,Si,qi,zi,Ui,Fi,Li,Mi,Vi,Gi,Di,Hi,Ki,Wi,Ji=Jt(Oi());function Yi(){if(Ei)return ji;Ei=1;var t=ge(),e=$r();return ji=function(r){return"symbol"==typeof r||e(r)&&"[object Symbol]"==t(r)}}function Qi(){if(ki)return Ni;ki=1;var t=zr(),e=Yi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return Ni=function(i,o){if(t(i))return!1;var u=typeof i;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=i&&!e(i))||(n.test(i)||!r.test(i)||null!=o&&i in Object(o))}}function Xi(){if(Ci)return xi;Ci=1;var t=qe();function e(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=n?n.apply(this,t):t[0],o=i.cache;if(o.has(e))return o.get(e);var u=r.apply(this,t);return i.cache=o.set(e,u)||o,u};return i.cache=new(e.Cache||t),i}return e.Cache=t,xi=e}function Zi(){if(Ii)return Bi;Ii=1;var t=Xi();return Bi=function(e){var r=t(e,(function(t){return 500===n.size&&n.clear(),t})),n=r.cache;return r}}function to(){if(Ai)return Ti;Ai=1;var t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,r=Zi()((function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(t,(function(t,r,i,o){n.push(i?o.replace(e,"$1"):r||t)})),n}));return Ti=r}function eo(){if(Si)return $i;return Si=1,$i=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}}function ro(){if(zi)return qi;zi=1;var t=fe(),e=eo(),r=zr(),n=Yi(),i=t?t.prototype:void 0,o=i?i.toString:void 0;return qi=function t(i){if("string"==typeof i)return i;if(r(i))return e(i,t)+"";if(n(i))return o?o.call(i):"";var u=i+"";return"0"==u&&1/i==-1/0?"-0":u},qi}function no(){if(Fi)return Ui;Fi=1;var t=ro();return Ui=function(e){return null==e?"":t(e)}}function io(){if(Mi)return Li;Mi=1;var t=zr(),e=Qi(),r=to(),n=no();return Li=function(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}}function oo(){if(Gi)return Vi;Gi=1;var t=Yi();return Vi=function(e){if("string"==typeof e||t(e))return e;var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}}function uo(){if(Hi)return Di;Hi=1;var t=io(),e=oo();return Di=function(r,n){for(var i=0,o=(n=t(n,r)).length;null!=r&&i<o;)r=r[e(n[i++])];return i&&i==o?r:void 0}}function ao(){if(Wi)return Ki;Wi=1;var t=uo();return Ki=function(e,r,n){var i=null==e?void 0:t(e,r);return void 0===i?n:i}}var so,co,fo=Jt(ao());class lo extends t{env;config;constructor(t){super(t),this.config=Ji({},this.feConfig.release,this.options),this.env=this.getInitEnv()}setConfig(t){this.config=Ji(this.config,t)}getConfig(t,e){return fo(this.config,t,e)}getInitEnv(){return e.searchEnv({logger:this.logger,preloadList:this.feConfig.envOrder})}getEnv(){return this.env}}class ho{context;onlyOne=!0;constructor(t){this.context=t}get logger(){return this.context.logger}get shell(){return this.context.shell}getEnv(t,e){return this.context.getEnv().get(t)??e}enabled(){return!0}getConfig(t,e){return this.context.getConfig(t,e)}setConfig(t){this.context.setConfig(t)}onBefore(t){}onSuccess(t){}onError(t){}async step({label:t,task:e}){this.logger.obtrusive(t);try{const r=await e();return this.logger.info(`${t} - success`),r}catch(t){throw this.logger.error(t),t}}}class go extends ho{pluginName="check-environment";constructor(t,e){if(super(t),!e)throw new Error("releaseIt is not required");this.hasReleaseIt(),this.hasGithubToken()}hasReleaseIt(){if("false"===this.getEnv("FE_RELEASE"))throw new Error("Skip Release");return!0}hasGithubToken(){const t=this.getEnv("GITHUB_TOKEN")||this.getEnv("PAT_TOKEN");if(!t)throw new Error("GITHUB_TOKEN or PAT_TOKEN environment variable is not set.");return this.setConfig({githubToken:t}),!0}onBefore(t){this.logger.verbose("CheckEnvironment onBefore")}}class po extends ho{releasePR;pluginName="create-release-pr";packageJson={};repoInfo;sourceBranch;get autoMergeReleasePR(){return this.getConfig("autoMergeReleasePR",!1)}dryRunPRNumber="999999";get releaseEnv(){return this.getConfig("releaseEnv")??this.getEnv("NODE_ENV")??"development"}constructor(t,e){super(t),this.releasePR=e,this.sourceBranch=this.getEnv("FE_RELEASE_BRANCH")??this.getEnv("FE_RELEASE_SOURCE_BRANCH")??"master"}async onBefore(){this.logger.verbose("CreateReleasePullRequest onBefore"),this.repoInfo=await this.releasePR.getUserInfo();const t=this.getConfig("githubToken");await this.releasePR.init({token:t}),this.packageJson=this.getConfig("packageJson")}async onSuccess(){const t=await this.step({label:"Create Changelog and Version",task:()=>this.createChangelogAndVersion()}),{tagName:e,releaseBranch:r}=await this.step({label:"Create Release Branch",task:()=>this.createReleaseBranch(t)}),n=await this.step({label:"Create Release PR",task:()=>this.createReleasePR(e,r,t)});if(this.autoMergeReleasePR)return await this.step({label:`Merge Release PR(${n})`,task:()=>this.autoMergePR(n,r)}),void await this.step({label:`Checked Release PR(${n})`,task:()=>this.checkedPullRequest(n,r)});this.logger.info(`Please manually merge PR(#${n}) and complete the publishing process afterwards`)}async autoMergePR(t,e){if(!t)return void this.logger.error("Failed to create Pull Request.",t);const r=this.getConfig("autoMergeType","squash");if(this.context.dryRun){const{repoName:n,authorName:i}=this.getRepoInfo();this.logger.info(`[DRY RUN] Would merge PR #${t} with method '${r}' in repo ${i}/${n}, branch ${e}`)}else await this.releasePR.mergePullRequest({pull_number:Number(t),merge_method:r})}async checkedPullRequest(t,e){try{await this.releasePR.getPullRequest({pull_number:Number(t)}),await this.releasePR.deleteBranch({ref:`heads/${e}`}),this.logger.info(`Branch ${e} has been deleted`)}catch(r){if(404===r.status)return void this.logger.warn(`PR #${t} or branch ${e} not found`);throw this.logger.error("Failed to check PR or delete branch",r),r}}async createReleaseBranch(t){const{tagName:e}=await this.checkTag(t),r=this.getReleaseBranch(e);return this.logger.verbose("PR SourceBranch is:",this.sourceBranch),this.logger.verbose("PR TargetBranch is:",r),await this.shell.exec(`git fetch origin ${this.sourceBranch}`),await this.shell.exec(`git merge origin/${this.sourceBranch}`),await this.shell.exec(`git checkout -b ${r}`),await this.shell.exec(`git push origin ${r}`),{tagName:e,releaseBranch:r}}getPkg(t){return fo(this.packageJson,t)}createChangelogAndVersion(){const t=this.getConfig("releaseIt");if(!t)throw new Error("releaseItInstance is not set");return t(this.getReleaseItChangelogOptions())}getReleaseItChangelogOptions(){return{ci:!0,increment:"patch",npm:{publish:!1},git:{requireCleanWorkingDir:!1,tag:!1,push:!1},github:{release:!1},verbose:!0,"dry-run":this.context.dryRun}}async checkTag(t){const e=fo(t,"version")||this.getPkg("version");if("string"!=typeof e)throw new Error("Tag name is not a string");return this.logger.verbose("Created Tag is:",e),{tagName:e}}getReleaseBranch(t){const e=this.getConfig("branchName","release-${tagName}");if("string"!=typeof e)throw new Error("Branch name template is not a string");return this.logger.verbose("Release Branch template is:",e),this.shell.format(e,{env:this.releaseEnv,branch:this.sourceBranch,tagName:t})}async createReleasePR(t,e,r){const n=this.getChangelogAndFeatures(r),i=await this.createReleasePRLabel();return this.getReleasePullRequest({tagName:t,releaseBranch:e,changelog:n,label:i})}async createReleasePRLabel(){const t=this.getConfig("label");if(!(t&&t.name&&t.description&&t.color))throw new Error("Label is not valid, skipping creation");if(this.context.dryRun)return this.logger.info("[DRY RUN] Would create PR label with:",t),t;try{const e=await this.releasePR.createPullRequestLabel({name:t.name,description:t.description,color:t.color.replace("#","")});return this.logger.debug("Create PR label Success",e),t}catch(e){if(422===e.status)return this.logger.warn(`Label ${t.name} already exists, skipping!`),t;throw this.logger.error("Create PR label Failed",e),e}}getChangelogAndFeatures(t){return t||this.logger.warn("No release-it output found, changelog might be incomplete"),fo(t,"changelog","No changelog")}async getReleasePullRequest(t){const e=this.getCreateReleasePROptions(t.tagName,t.releaseBranch,t.changelog);if(this.context.dryRun)return this.logger.info("[DRY RUN] Would create PR with:",{...e,labels:[t.label?.name]}),this.dryRunPRNumber;try{const r=await this.releasePR.createPullRequest(e),n=r.number;if(!n)throw new Error("CreateReleasePR Failed, prNumber is empty");if(this.logger.debug("Create PR Success",r),t.label?.name){const e=await this.releasePR.addPullRequestLabels({issue_number:n,labels:[t.label.name]});this.logger.debug("Add PR label Success",e)}return n.toString()}catch(t){if(422===t.status&&t.message.includes("already exists")){this.logger.warn("PR already exists");const e=t.message.match(/pull request #(\d+)/);return e?e[1]:""}throw this.logger.error("Failed to create PR",t),t}}getCreateReleasePROptions(t,e,r){return{title:this.getReleasePRTitle(t),body:this.getReleasePRBody({tagName:t,changelog:r}),base:this.sourceBranch,head:e}}getReleasePRTitle(t){const e=this.getConfig("PRTitle","Release ${env} ${pkgName} ${tagName}");return this.shell.format(e,{env:this.releaseEnv,branch:this.sourceBranch,tagName:t,pkgName:this.getPkg("name")})}getReleasePRBody({tagName:t,changelog:e}){const r=this.getConfig("PRBody","");return this.shell.format(r,{branch:this.sourceBranch,env:this.releaseEnv,tagName:t,changelog:e})}getRepoInfo(){if(!this.repoInfo)throw new Error("Repository information not initialized");return this.repoInfo}}function vo(){if(co)return so;co=1;var t=ge(),e=zr(),r=$r();return so=function(n){return"string"==typeof n||!e(n)&&r(n)&&"[object String]"==t(n)}}var bo=Jt(vo());class yo{context;options;octokit;constructor(t,e={}){this.context=t,this.options=e}async init({token:t}){if(this.octokit)return this.octokit;if(!t)throw new Error("Github token is not set");const{repoName:e,authorName:r}=await this.getUserInfo();this.options.repoName=e,this.options.authorName=r;const{Octokit:n}=await import("@octokit/rest"),i=new n({auth:t});return this.octokit=i,i}getOctokit(){if(!this.octokit)throw new Error("Octokit is not initialized");return this.octokit}mergePullRequest(t){return this.getOctokit().rest.pulls.merge({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}getPullRequest(t){return this.getOctokit().rest.pulls.get({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}deleteBranch(t){return this.getOctokit().rest.git.deleteRef({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}addPullRequestLabels(t){return this.getOctokit().rest.issues.addLabels({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}async createPullRequestLabel(t){return await this.getOctokit().rest.issues.createLabel({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""})}async createPullRequest(t){const e=await this.getOctokit().rest.pulls.create({...t,owner:t.owner||this.options.authorName||"",repo:t.repo||this.options.repoName||""});return{...e.data,number:e.data.number}}async getUserInfo(){let t;try{t=(await this.context.shell.exec("git config --get remote.origin.url",{dryRun:!1})).trim()}catch(t){throw new Error("Failed to get git remote url. Please ensure this is a git repository with a valid remote.")}if(!t)throw new Error("Git remote URL is empty. Please set a valid GitHub remote URL.");this.context.logger.verbose("repoUrl: ",t);const e=t.match(/github\.com[:/]([^/]+)\/([^/.]+)(?:\.git)?$/);if(!e)throw new Error("Invalid GitHub repository URL format. Please ensure the remote URL is from GitHub.");const[,r,n]=e;if(!this.isValidString(r)||!this.isValidString(n))throw new Error("Failed to extract owner or repository name from GitHub URL");return{repoName:n,authorName:r}}isValidString(t){return!!t&&bo(t)}}var mo=Jt(pe());class wo extends ho{pluginName="publish-npm";_releaseItOutput;constructor(t){super(t),this.getIncrementVersion()}async onBefore(){this.logger.verbose("PublishNpm onBefore"),await this.checkNpmAuth(),await this.checkPublishPath()}async onSuccess(){const t=this.getPublishReleaseItOptions(this.context);await this.step({label:"Publish to NPM",task:()=>this.publish(t)})}async publish(t){this.logger.debug("Run release-it method",t);const e=this.getConfig("releaseItInstance");if(!e)throw new Error("releaseItInstance is not set");return this._releaseItOutput=await e(t),this._releaseItOutput}getPublishReleaseItOptions(t){return{ci:!0,npm:{publish:!0},git:{requireCleanWorkingDir:!1,requireUpstream:!1,changelog:!1},plugins:{"@release-it/conventional-changelog":{infile:!1}},"dry-run":t.dryRun,verbose:!0,increment:this.getIncrementVersion()}}getIncrementVersion(){const t=this.getConfig("packageJson");if(!mo(t))throw new Error("package.json is undefined");if(!("version"in t))throw new Error("package.json version is required");return t.version}async checkNpmAuth(){const t=this.getEnv("NPM_TOKEN");if(!t)throw new Error("NPM_TOKEN is not set.");this.setConfig({npmToken:t}),await this.shell.exec(`echo "//registry.npmjs.org/:_authToken=${t}" > .npmrc`)}async checkPublishPath(){const t=this.getPublishPath();this.switchToPublishPath(t),this.logger.debug("Current path:",t)}switchToPublishPath(t){t&&n(t)&&(this.logger.debug("Switching to publish path:",t),process.chdir(t))}getPublishPath(){const t=this.getConfig("publishPath");return"string"==typeof t?t:process.cwd()}}function _o(t){const e=new lo(t),n=new r;return function(t){const e=[];return e.push(new go(t,t.options.releaseIt)),t.options.pullRequest?e.push(new po(t,new yo(t))):e.push(new wo(t)),e}(e).forEach((t=>{n.use(t)})),n.exec(e,(({returnValue:t})=>Promise.resolve(t)))}export{ho as Plugin,lo as ReleaseContext,_o as release};
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qlover/fe-release",
|
|
3
|
+
"description": "A release front-end project tool",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"homepage": "",
|
|
8
|
+
"author": "qlover",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "./dist/es/index.js",
|
|
11
|
+
"module": "./dist/es/index.js",
|
|
12
|
+
"types": "./dist/es/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/es/index.js",
|
|
16
|
+
"require": "./dist/cjs/index.js",
|
|
17
|
+
"types": "./dist/es/index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./cjs/*": "./dist/cjs/*",
|
|
20
|
+
"./es/*": "./dist/es/*",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/qlover/fe-base.git",
|
|
26
|
+
"directory": ""
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"bin",
|
|
30
|
+
"dist",
|
|
31
|
+
"package.json",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"keywords": [
|
|
35
|
+
"scripts",
|
|
36
|
+
"release",
|
|
37
|
+
"fe-release"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"bin": {
|
|
43
|
+
"fe-release": "./bin/release.js"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "rollup -c",
|
|
47
|
+
"test": "jest",
|
|
48
|
+
"release": "node bin/release.js"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@qlover/fe-standard": "latest",
|
|
52
|
+
"@qlover/env-loader": "latest",
|
|
53
|
+
"commander": "^11.0.0",
|
|
54
|
+
"release-it": "^17.10.0"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@qlover/fe-utils": "latest",
|
|
58
|
+
"@qlover/scripts-context": "*",
|
|
59
|
+
"@octokit/rest": "^21.0.2"
|
|
60
|
+
}
|
|
61
|
+
}
|