UNPKG

@ycmd/commands

Version:

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

9 lines (7 loc) 2.02 kB
import { readdir } from 'node:fs/promises'; import { join } from 'node:path'; import { createCommand, pnpmRecursive, shell, readJson } from 'ycmd'; var t={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 O=createCommand({command:"prepack",describe:"prepare package for publishing",builder:a=>a.options({prod:t.prod,silent:t.silent,dir:{...t.dist,describe:"Specify the tmp directory for operation",default:".release"}}),async main({isRoot:a,ctx:i,cwd:e,argv:o,log:p}){if(a){await pnpmRecursive("run prepack --prod --silent",{ctx:i,argv:o});return}let{cleanPublish:d}=await import('clean-publish-fix'),{dir:s=".release",silent:c}=o;await shell("rm -rf .release",{ctx:i,silence:!0});let f=await readdir(e),r=await readJson(join(e,"package.json")),l=[];if(r?.files?.length){let n=r.files;n.push("package.json"),l=f.filter(u=>!n.includes(u));}await d({cwd:e,tempDir:s,files:l,cleanDocs:!0,cleanComments:!0,withoutPublish:!0,fields:["//","///","////","private"]}),c||p.debug("prepack >",s,{cwd:e});}}); export { O as default }; //# sourceMappingURL=out.js.map //# sourceMappingURL=prepack.js.map