UNPKG

@ycmd/commands

Version:

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

9 lines (7 loc) 2.14 kB
import { existsSync } from 'node:fs'; import { join } from 'node:path'; import { isCI, isDev, createCommand, shellParallel, readJson, findBin, shell } 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={isSilent:!!+process.env.YCMD_SILENT||isCI,isBail:isCI,isProd:!!+process.env.YCMD_PROD||!isDev,isCjs:!0,libDir:"lib",cjsDir:"cjs"};var Y=createCommand({command:"test:uvu [-w][-s][-b]",describe:"run Uvu tests on the project",builder:s=>s.options({watch:t.watch,silent:t.silent,bail:t.bail}),async main({isRoot:s,ctx:i,argv:l,cwd:r,log:n}){if(s){await shellParallel("ycmd test:uvu",{ctx:i,argv:l});return}let b=join(r,"package.json");if(!((await readJson(b))?.uvu||existsSync(join(r,"tests")))){n.debug("[skip] uvu rc in package.json or tests folder not found - uvu skiped");return}let{silent:a=o.isSilent,watch:m=!1,bail:y=o.isBail}=l,e=`${findBin("uvu")} tests -i fixtures`;(e+=" -r tsm"),a&&(e+=" --quiet --silent"),y&&(e+=" --bail"),m&&(e=`watchlist src tests -- ${e}`),shell(e,{ctx:i,silence:a?"all":!1}).catch(async h=>{if(!a)throw h;n.error("Error while running",e),await shell(e,{ctx:i});});}}); export { Y as default }; //# sourceMappingURL=out.js.map //# sourceMappingURL=test-uvu.js.map