lintpage 0.4.1 → 0.5.1
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/README.md +25 -0
- package/dist/cli.cjs +99 -4
- package/dist/cli.mjs +99 -4
- package/dist/formatter-Dfpq4zwm.cjs +5 -0
- package/dist/formatter-sNOxAPld.mjs +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +882 -0
- package/dist/index.d.mts +882 -0
- package/dist/index.mjs +1 -1
- package/package.json +5 -3
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.mjs.map +0 -1
- package/dist/formatter-BFKK5Mks.cjs +0 -5
- package/dist/formatter-BFKK5Mks.cjs.map +0 -1
- package/dist/formatter-CuMgo6fc.mjs +0 -5
- package/dist/formatter-CuMgo6fc.mjs.map +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`chalk`);l=c(l);function u(e){let t=0,n=``;for(let r of e){let e=encodeURIComponent(r).length;if(t+e>255)break;t+=e,n+=r}return n}function d(e,t,n){let r=new URLSearchParams({utm_source:`lintpage`,utm_medium:e,utm_campaign:`fix-it`});return t&&r.set(`utm_content`,u(t)),n&&r.set(`utm_term`,`scan_${n}`),`https://calendly.com/bludesksoft/30min?${r.toString()}`}const f={CRITICAL:l.default.red.bold(`✗`),WARNING:l.default.yellow(`⚠`),INFO:l.default.blue(`ℹ`)};function p(e,t){let n=`${e.warn} ${e.warn===1?`warning`:`warnings`}`;return t===`FAIL`?`DEPLOY BLOCKED · ${e.crit} critical · ${n} · ${e.info} info`:t===`AI-FAIL`?`AI VISIBILITY FAIL · ${e.crit} AI critical · ${n} · ${e.info} info`:`READY TO SHIP · ${n} · ${e.info} info`}function m(e,t){let n=[],r={crit:e.results.filter(e=>e.severity===`CRITICAL`).length,warn:e.results.filter(e=>e.severity===`WARNING`).length,info:e.results.filter(e=>e.severity===`INFO`).length};if(t)return n.push(` ${l.default.red.bold(`${r.crit} critical`)} ${l.default.yellow(`${r.warn} ${r.warn===1?`warning`:`warnings`}`)} ${l.default.blue(`${r.info} info`)}`),n.push(``),e.localhost&&(n.push(l.default.dim(` localhost: ${e.localhost.notRun.length} not run, ${e.localhost.downgraded.length} downgraded`)),n.push(``)),n.join(`
|
|
2
|
+
`);if(n.push(``),e.results.length===0)n.push(l.default.green(` No issues found.`)),n.push(``);else{let t=[...e.results].sort((e,t)=>h(t.severity)-h(e.severity));t.forEach((e,r)=>{let i=f[e.severity],a=`${e.category.toLowerCase()}/${e.ruleId}`;n.push(`${i} ${l.default.bold(a)} — ${e.message}`),e.fix&&n.push(` ${l.default.dim(e.fix)}`),r<t.length-1&&n.push(``)}),n.push(``)}let i=p(r,e.overallStatus),a=e.overallStatus===`FAIL`?l.default.red.bold:e.overallStatus===`AI-FAIL`?l.default.yellow.bold:l.default.green.bold;if(n.push(a(i)),n.push(``),e.localhost){let{host:t,notRun:r,downgraded:i}=e.localhost,a=r.length===1;n.push(l.default.dim(` localhost mode (${t}): ${r.length} ${a?`check`:`checks`} not run (${a?`it needs`:`they need`} a public origin), ${i.length} downgraded to info.`)),n.push(``)}return r.crit>0&&(n.push(l.default.dim(` Want these fixed for you? Free 30-min call with the LintPage team: ${d(`cli`,e.url)}`)),n.push(``)),n.join(`
|
|
3
|
+
`)}function h(e){return e===`CRITICAL`?3:e===`WARNING`?2:1}function g(e){return JSON.stringify(e,null,2)}const _={CRITICAL:`error`,WARNING:`warning`,INFO:`notice`};function v(e){return e.replace(/%/g,`%25`).replace(/\r/g,`%0D`).replace(/\n/g,`%0A`).replace(/:/g,`%3A`).replace(/,/g,`%2C`)}function y(e){let t=[];for(let n of e.results){let e=_[n.severity],r=v(`[${n.ruleId}] ${n.ruleName}`),i=v(n.message);t.push(`::${e} title=${r}::${i}`)}let n=p({crit:e.results.filter(e=>e.severity===`CRITICAL`).length,warn:e.results.filter(e=>e.severity===`WARNING`).length,info:e.results.filter(e=>e.severity===`INFO`).length},e.overallStatus),r=v(`${e.url} — ${n}`);if(t.push(`::notice title=LintPage Verdict::${r}`),e.localhost){let{host:n,notRun:r,downgraded:i}=e.localhost,a=i.length?`. ${i.length} downgraded to info: ${i.join(`, `)}`:``;t.push(`::notice title=LintPage Localhost::${v(`${r.length} ${r.length===1?`check`:`checks`} not run against ${n}: ${r.join(`, `)}${a}`)}`)}return t.join(`
|
|
4
|
+
`)}function b(e,t,n){switch(t){case`json`:return g(e);case`github`:return y(e);default:return m(e,n)}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
|
|
5
|
+
//# sourceMappingURL=formatter-Dfpq4zwm.cjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import e from"chalk";function t(e){let t=0,n=``;for(let r of e){let e=encodeURIComponent(r).length;if(t+e>255)break;t+=e,n+=r}return n}function n(e,n,r){let i=new URLSearchParams({utm_source:`lintpage`,utm_medium:e,utm_campaign:`fix-it`});return n&&i.set(`utm_content`,t(n)),r&&i.set(`utm_term`,`scan_${r}`),`https://calendly.com/bludesksoft/30min?${i.toString()}`}const r={CRITICAL:e.red.bold(`✗`),WARNING:e.yellow(`⚠`),INFO:e.blue(`ℹ`)};function i(e,t){let n=`${e.warn} ${e.warn===1?`warning`:`warnings`}`;return t===`FAIL`?`DEPLOY BLOCKED · ${e.crit} critical · ${n} · ${e.info} info`:t===`AI-FAIL`?`AI VISIBILITY FAIL · ${e.crit} AI critical · ${n} · ${e.info} info`:`READY TO SHIP · ${n} · ${e.info} info`}function a(t,a){let s=[],c={crit:t.results.filter(e=>e.severity===`CRITICAL`).length,warn:t.results.filter(e=>e.severity===`WARNING`).length,info:t.results.filter(e=>e.severity===`INFO`).length};if(a)return s.push(` ${e.red.bold(`${c.crit} critical`)} ${e.yellow(`${c.warn} ${c.warn===1?`warning`:`warnings`}`)} ${e.blue(`${c.info} info`)}`),s.push(``),t.localhost&&(s.push(e.dim(` localhost: ${t.localhost.notRun.length} not run, ${t.localhost.downgraded.length} downgraded`)),s.push(``)),s.join(`
|
|
2
|
+
`);if(s.push(``),t.results.length===0)s.push(e.green(` No issues found.`)),s.push(``);else{let n=[...t.results].sort((e,t)=>o(t.severity)-o(e.severity));n.forEach((t,i)=>{let a=r[t.severity],o=`${t.category.toLowerCase()}/${t.ruleId}`;s.push(`${a} ${e.bold(o)} — ${t.message}`),t.fix&&s.push(` ${e.dim(t.fix)}`),i<n.length-1&&s.push(``)}),s.push(``)}let l=i(c,t.overallStatus),u=t.overallStatus===`FAIL`?e.red.bold:t.overallStatus===`AI-FAIL`?e.yellow.bold:e.green.bold;if(s.push(u(l)),s.push(``),t.localhost){let{host:n,notRun:r,downgraded:i}=t.localhost,a=r.length===1;s.push(e.dim(` localhost mode (${n}): ${r.length} ${a?`check`:`checks`} not run (${a?`it needs`:`they need`} a public origin), ${i.length} downgraded to info.`)),s.push(``)}return c.crit>0&&(s.push(e.dim(` Want these fixed for you? Free 30-min call with the LintPage team: ${n(`cli`,t.url)}`)),s.push(``)),s.join(`
|
|
3
|
+
`)}function o(e){return e===`CRITICAL`?3:e===`WARNING`?2:1}function s(e){return JSON.stringify(e,null,2)}const c={CRITICAL:`error`,WARNING:`warning`,INFO:`notice`};function l(e){return e.replace(/%/g,`%25`).replace(/\r/g,`%0D`).replace(/\n/g,`%0A`).replace(/:/g,`%3A`).replace(/,/g,`%2C`)}function u(e){let t=[];for(let n of e.results){let e=c[n.severity],r=l(`[${n.ruleId}] ${n.ruleName}`),i=l(n.message);t.push(`::${e} title=${r}::${i}`)}let n=i({crit:e.results.filter(e=>e.severity===`CRITICAL`).length,warn:e.results.filter(e=>e.severity===`WARNING`).length,info:e.results.filter(e=>e.severity===`INFO`).length},e.overallStatus),r=l(`${e.url} — ${n}`);if(t.push(`::notice title=LintPage Verdict::${r}`),e.localhost){let{host:n,notRun:r,downgraded:i}=e.localhost,a=i.length?`. ${i.length} downgraded to info: ${i.join(`, `)}`:``;t.push(`::notice title=LintPage Localhost::${l(`${r.length} ${r.length===1?`check`:`checks`} not run against ${n}: ${r.join(`, `)}${a}`)}`)}return t.join(`
|
|
4
|
+
`)}function d(e,t,n){switch(t){case`json`:return s(e);case`github`:return u(e);default:return a(e,n)}}export{a as i,u as n,s as r,d as t};
|
|
5
|
+
//# sourceMappingURL=formatter-sNOxAPld.mjs.map
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./formatter-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./formatter-Dfpq4zwm.cjs`);exports.format=e.t,exports.formatGithub=e.n,exports.formatJson=e.r,exports.formatText=e.i;
|