UNPKG

@ycmd/commands

Version:

LSK.js CLI Creds is the easiest way to manage GitHub / Gitlab secrets and credentials

8 lines (6 loc) 2.48 kB
import { pick, omitNull } from '@lsk4/algos'; import { createCommand, shell, getCwdInfo } from 'ycmd'; var l={watch:{alias:"w",describe:"monitor files for changes",type:"boolean",default:!1},prod:{alias:"p",describe:"enable code optimization for production",type:"boolean",default:!1},silent:{alias:["s","q","quiet"],describe:"run in silent mode, show errors only",type:"boolean",default:!1},exec:{alias:"e",describe:"executes after compilation",type:["boolean","string"],default:!1},dry:{alias:["d","dry-run","without-publish"],describe:"run in dry mode, without publishing",type:"boolean",default:!1},dist:{describe:"specify the output directory",type:"string"},force:{alias:["f"],describe:"force to run",type:"boolean",default:!1},dts:{describe:"generate dts files",type:"boolean",default:!0},yes:{alias:["y"],describe:"automatically say yes to all prompts",type:"boolean",default:!1},bail:{alias:"b",describe:"stop running after the first failure",type:"boolean",default:!1},clean:{alias:"c",describe:"clean the output directory before building",type:"boolean",default:!1}};var I=createCommand({command:"release [-y][-p][-s][-d]",describe:"run release process",builder:e=>e.options({yes:l.yes,prod:l.prod,silent:l.silent,dry:l.dry}),async main({ctx:e,argv:t,isRoot:c,cwd:r}){let {yes:y,prod:n,silent:d}=t,{dry:b}=t,s=pick(t,["prod","silent"]);if(c){let i={...process.env,...omitNull({YCMD_SILENT:d?"1":null,YCMD_PROD:n?"1":null})};await shell("ycmd build",{ctx:e,argv:s,env:i}),await shell("ycmd test",{ctx:e,argv:s,env:i}),await shell("ycmd prepack",{ctx:e,argv:s,env:i}),await shell("ycmd version",{ctx:e,argv:{...s,yes:y},env:i}),await shell("ycmd publish",{ctx:e,argv:{...s,dry:b},env:i}),await shell("ycmd clean",{ctx:e,env:i});return}let o={...process.env,...omitNull({YCMD_SILENT:d?"1":null,YCMD_PROD:n?"1":null})},{isLib:h,isNext:g}=await getCwdInfo({cwd:r});if(h)await shell("pnpm run build",{ctx:e,argv:s,env:o}),await shell("pnpm run test",{ctx:e,argv:s,env:o}),await shell("npm version prerelease --preid alpha"),await shell("ycmd prepack",{ctx:e,argv:s}),await shell("ycmd publish",{ctx:e,argv:s});else if(g){await shell('pnpm -F "." deploy .release',{ctx:e,argv:s});let i=`${r}/.release`;await shell("npm run build",{ctx:e,argv:s,cwd:i,env:o});}else await shell("pnpm run build",{ctx:e,argv:s,env:o}),await shell('pnpm -F "." deploy .release',{ctx:e,argv:s});}}); export { I as default }; //# sourceMappingURL=out.js.map //# sourceMappingURL=release.js.map