@principal-ai/quality-lens-cli 0.1.8 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1030,7 +1030,7 @@ jobs:
1030
1030
  name: quality-lens-results-\${{ github.sha }}
1031
1031
  path: results.json
1032
1032
  if-no-files-found: warn
1033
- `,ylr={eslint:["eslint"],typescript:["typescript"],jest:["jest"],prettier:["prettier"],knip:["knip"],alexandria:["@principal-ai/alexandria"]};async function vlr(p){let{spawn:c}=await import("child_process");return new Promise(_=>{let g=c(p,["--version"],{shell:!0,stdio:"ignore"});g.on("close",S=>_(S===0)),g.on("error",()=>_(!1))})}async function Dlr(p,c){let{spawn:_}=await import("child_process"),g=[];for(let S of p){let w=ylr[S];if(w)for(let z of w)await vlr(`npx ${z}`)||g.push(z)}if(g.length===0){console.log("All required dependencies are already installed.");return}return console.log(`Installing missing dependencies: ${g.join(", ")}`),new Promise((S,w)=>{let z=_("npm",["install","--save-dev",...g],{cwd:c,shell:!0,stdio:"inherit"});z.on("close",ne=>{ne===0?S():w(new Error(`npm install failed with code ${ne}`))}),z.on("error",w)})}async function G_t(p){let c=await $_t(p,"");return new Roe().build({files:c,rootPath:p})}async function $_t(p,c){let _=[],g=await kk.readdir(p,{withFileTypes:!0});for(let S of g){if(blr(S.name))continue;let w=z4.join(p,S.name),z=c?`${c}/${S.name}`:S.name;if(S.isDirectory()){let ne=await $_t(w,z);_.push(...ne)}else S.isFile()&&_.push(z)}return _}function blr(p){return["node_modules",".git",".next",".nuxt","dist","build","coverage",".turbo",".cache"].includes(p)||p.startsWith(".")}async function Clr(p){let c=new oG,_=new Ioe,g=new woe,S=new Loe;try{let w=z4.resolve(p.path);console.log(`Scanning repository: ${w}`);let z=await G_t(w),ne=await c.extractPackages(z,w);ne.length===0&&(console.warn("No packages found in repository"),process.exit(1)),console.log(`Found ${ne.length} package(s)`);let de=p.lenses?p.lenses.split(",").map(X=>X.trim()):null,be=new Set;for(let X of ne)X.packageData.availableCommands?.filter(Ke=>!(!Ke.isLensCommand||de&&!de.includes(Ke.lensId||"")))?.forEach(Ke=>{Ke.lensId&&be.add(Ke.lensId)});p.install&&be.size>0&&(console.log(`
1033
+ `,ylr={eslint:["eslint"],typescript:["typescript"],jest:["jest"],prettier:["prettier"],knip:["knip"],alexandria:["@principal-ai/alexandria-cli"]};async function vlr(p){let{spawn:c}=await import("child_process");return new Promise(_=>{let g=c(p,["--version"],{shell:!0,stdio:"ignore"});g.on("close",S=>_(S===0)),g.on("error",()=>_(!1))})}async function Dlr(p,c){let{spawn:_}=await import("child_process"),g=[];for(let S of p){let w=ylr[S];if(w)for(let z of w)await vlr(`npx ${z}`)||g.push(z)}if(g.length===0){console.log("All required dependencies are already installed.");return}return console.log(`Installing missing dependencies: ${g.join(", ")}`),new Promise((S,w)=>{let z=_("npm",["install","--save-dev",...g],{cwd:c,shell:!0,stdio:"inherit"});z.on("close",ne=>{ne===0?S():w(new Error(`npm install failed with code ${ne}`))}),z.on("error",w)})}async function G_t(p){let c=await $_t(p,"");return new Roe().build({files:c,rootPath:p})}async function $_t(p,c){let _=[],g=await kk.readdir(p,{withFileTypes:!0});for(let S of g){if(blr(S.name))continue;let w=z4.join(p,S.name),z=c?`${c}/${S.name}`:S.name;if(S.isDirectory()){let ne=await $_t(w,z);_.push(...ne)}else S.isFile()&&_.push(z)}return _}function blr(p){return["node_modules",".git",".next",".nuxt","dist","build","coverage",".turbo",".cache"].includes(p)||p.startsWith(".")}async function Clr(p){let c=new oG,_=new Ioe,g=new woe,S=new Loe;try{let w=z4.resolve(p.path);console.log(`Scanning repository: ${w}`);let z=await G_t(w),ne=await c.extractPackages(z,w);ne.length===0&&(console.warn("No packages found in repository"),process.exit(1)),console.log(`Found ${ne.length} package(s)`);let de=p.lenses?p.lenses.split(",").map(X=>X.trim()):null,be=new Set;for(let X of ne)X.packageData.availableCommands?.filter(Ke=>!(!Ke.isLensCommand||de&&!de.includes(Ke.lensId||"")))?.forEach(Ke=>{Ke.lensId&&be.add(Ke.lensId)});p.install&&be.size>0&&(console.log(`
1034
1034
  Installing dependencies for lenses...`),await Dlr(Array.from(be),w),console.log(""));let Ee=[];for(let X of ne){let ut=X.packageData.availableCommands?.filter(Ke=>!(!Ke.isLensCommand||de&&!de.includes(Ke.lensId||"")));if(!ut||ut.length===0){console.log(`Skipping ${X.packageData.name} (no lens commands)`);continue}console.log(`
1035
1035
  Running lenses for ${X.packageData.name}...`);for(let Ke of ut){console.log(` - ${Ke.lensId}: ${Ke.name}`);try{let We=await _.executeTool({repoPath:w,packageLayer:X,packageCommand:Ke});Ee.push({package:X.packageData.name,packagePath:X.packageData.path,lens:Ke.lensId||"unknown",command:Ke.name,result:We,timestamp:Date.now()}),console.log(` ${We.success?"\u2713":"\u2717"} ${We.success?"Success":"Failed"} (${We.duration}ms)`)}catch(We){console.error(` \u2717 Error: ${We.message}`),Ee.push({package:X.packageData.name,packagePath:X.packageData.path,lens:Ke.lensId||"unknown",command:Ke.name,error:We.message,timestamp:Date.now()})}}}if(p.format==="json"){let X=g.format(Ee);p.output?(await kk.writeFile(p.output,X,"utf-8"),console.log(`
1036
1036
  Results written to: ${p.output}`)):console.log(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principal-ai/quality-lens-cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "CLI tool for running quality lenses on codebases in CI/CD pipelines",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",