lintpage 0.5.1 → 0.5.2
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 +65 -2
- package/dist/cli.cjs +11 -11
- package/dist/cli.mjs +13 -13
- package/dist/formatter-AOdVjmxi.cjs +7 -0
- package/dist/formatter-yk86KB59.mjs +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +25 -2
- package/dist/index.d.mts +25 -2
- package/dist/index.mjs +1 -1
- package/package.json +14 -14
- package/dist/formatter-Dfpq4zwm.cjs +0 -5
- package/dist/formatter-sNOxAPld.mjs +0 -5
|
@@ -0,0 +1,7 @@
|
|
|
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(``)),e.vercelDeployment&&(n.push(l.default.dim(` vercel: ${e.vercelDeployment.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)=>g(t.severity)-g(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 e.vercelDeployment&&(n.push(l.default.dim(` ${h(e.vercelDeployment.downgraded)}`)),n.push(``)),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`Vercel deployment URL: the X-Robots-Tag noindex header (${e.join(`, `)}) was reported as info, because Vercel adds it to deployment URLs to keep them out of search results. If this URL is your production domain, set a severity for x-robots-tag in your config (for example CRITICAL) to restore the check; otherwise audit your production domain to check its indexing.`}function g(e){return e===`CRITICAL`?3:e===`WARNING`?2:1}function _(e){return JSON.stringify(e,null,2)}const v={CRITICAL:`error`,WARNING:`warning`,INFO:`notice`};function y(e){return e.replace(/%/g,`%25`).replace(/\r/g,`%0D`).replace(/\n/g,`%0A`)}function b(e){return y(e).replace(/:/g,`%3A`).replace(/,/g,`%2C`)}function x(e){try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}}function S(e,t=!1,n=!1){let r=[],i=x(e.url),a=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),o=y(`${e.url} — ${a}`);if(r.push(`::notice title=LintPage Verdict::${o}`),e.localhost){let{host:t,notRun:n,downgraded:i}=e.localhost,a=i.length?`. ${i.length} downgraded to info: ${i.join(`, `)}`:``;r.push(`::notice title=LintPage Localhost::${y(`${n.length} ${n.length===1?`check`:`checks`} not run against ${t}: ${n.join(`, `)}${a}`)}`)}e.vercelDeployment&&r.push(`::notice title=LintPage Vercel::${y(h(e.vercelDeployment.downgraded))}`);for(let a of e.results){if(t&&a.severity!==`CRITICAL`&&!(n&&a.severity===`WARNING`))continue;let e=v[a.severity],o=b(`[${a.ruleId}] ${a.ruleName} (${i})`),s=y(a.message);r.push(`::${e} title=${o}::${s}`)}return r.join(`
|
|
4
|
+
`)}function C(e,t){return`::error title=${b(`LintPage (${x(e)})`)}::${y(`The audit could not run: ${t}`)}`}const w={FAIL:`Deploy blocked`,"AI-FAIL":`AI visibility fail`,PASS:`Ready to ship`},T={CRITICAL:`Critical`,WARNING:`Warning`,INFO:`Info`};function E(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch{return e}}function D(e){let t=e.replace(/[\r\n]+/g,` `);return(t.length>300?`${t.slice(0,300)}...`:t).replace(/[!-/:-@[-`{-~]/g,`\\$&`)}function O(e){let t={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},n=[`### LintPage: ${D(x(e.url))}`,``,`| Verdict | Score | Critical | Warnings | Info |`,`|---|---|---|---|---|`,`| **${w[e.overallStatus]}** | ${e.score} | ${t.crit} | ${t.warn} | ${t.info} |`,``];if(e.finalUrl&&n.push(`Redirected to ${D(E(e.finalUrl))}`,``),e.localhost){let{notRun:t,downgraded:r}=e.localhost;n.push(`Localhost mode: ${t.length} ${t.length===1?`check`:`checks`} not run, ${r.length} downgraded to info.`,``)}e.vercelDeployment&&n.push(h(e.vercelDeployment.downgraded),``);let r=[...e.results].sort((e,t)=>g(t.severity)-g(e.severity)),i=r.slice(0,10);if(i.length>0){n.push(`| Severity | Check | Finding |`,`|---|---|---|`);for(let e of i)n.push(`| ${T[e.severity]} | ${D(`[${e.ruleId}] ${e.ruleName}`)} | ${D(e.message)} |`);n.push(``),r.length>i.length&&n.push(`${r.length-i.length} more in the job log.`,``)}else n.push(`No issues found.`,``);return n.join(`
|
|
5
|
+
`)}function k(e,t){return[`### LintPage: ${D(x(e))}`,``,`The audit could not run: ${D(t)}`,``].join(`
|
|
6
|
+
`)}function A(e,t,n,r=!1){switch(t){case`json`:return _(e);case`github`:return S(e,n,r);default:return m(e,n)}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return A}});
|
|
7
|
+
//# sourceMappingURL=formatter-AOdVjmxi.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 c=[],l={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 c.push(` ${e.red.bold(`${l.crit} critical`)} ${e.yellow(`${l.warn} ${l.warn===1?`warning`:`warnings`}`)} ${e.blue(`${l.info} info`)}`),c.push(``),t.localhost&&(c.push(e.dim(` localhost: ${t.localhost.notRun.length} not run, ${t.localhost.downgraded.length} downgraded`)),c.push(``)),t.vercelDeployment&&(c.push(e.dim(` vercel: ${t.vercelDeployment.downgraded.length} downgraded`)),c.push(``)),c.join(`
|
|
2
|
+
`);if(c.push(``),t.results.length===0)c.push(e.green(` No issues found.`)),c.push(``);else{let n=[...t.results].sort((e,t)=>s(t.severity)-s(e.severity));n.forEach((t,i)=>{let a=r[t.severity],o=`${t.category.toLowerCase()}/${t.ruleId}`;c.push(`${a} ${e.bold(o)} — ${t.message}`),t.fix&&c.push(` ${e.dim(t.fix)}`),i<n.length-1&&c.push(``)}),c.push(``)}let u=i(l,t.overallStatus),d=t.overallStatus===`FAIL`?e.red.bold:t.overallStatus===`AI-FAIL`?e.yellow.bold:e.green.bold;if(c.push(d(u)),c.push(``),t.localhost){let{host:n,notRun:r,downgraded:i}=t.localhost,a=r.length===1;c.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.`)),c.push(``)}return t.vercelDeployment&&(c.push(e.dim(` ${o(t.vercelDeployment.downgraded)}`)),c.push(``)),l.crit>0&&(c.push(e.dim(` Want these fixed for you? Free 30-min call with the LintPage team: ${n(`cli`,t.url)}`)),c.push(``)),c.join(`
|
|
3
|
+
`)}function o(e){return`Vercel deployment URL: the X-Robots-Tag noindex header (${e.join(`, `)}) was reported as info, because Vercel adds it to deployment URLs to keep them out of search results. If this URL is your production domain, set a severity for x-robots-tag in your config (for example CRITICAL) to restore the check; otherwise audit your production domain to check its indexing.`}function s(e){return e===`CRITICAL`?3:e===`WARNING`?2:1}function c(e){return JSON.stringify(e,null,2)}const l={CRITICAL:`error`,WARNING:`warning`,INFO:`notice`};function u(e){return e.replace(/%/g,`%25`).replace(/\r/g,`%0D`).replace(/\n/g,`%0A`)}function d(e){return u(e).replace(/:/g,`%3A`).replace(/,/g,`%2C`)}function f(e){try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}}function p(e,t=!1,n=!1){let r=[],a=f(e.url),s=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),c=u(`${e.url} — ${s}`);if(r.push(`::notice title=LintPage Verdict::${c}`),e.localhost){let{host:t,notRun:n,downgraded:i}=e.localhost,a=i.length?`. ${i.length} downgraded to info: ${i.join(`, `)}`:``;r.push(`::notice title=LintPage Localhost::${u(`${n.length} ${n.length===1?`check`:`checks`} not run against ${t}: ${n.join(`, `)}${a}`)}`)}e.vercelDeployment&&r.push(`::notice title=LintPage Vercel::${u(o(e.vercelDeployment.downgraded))}`);for(let i of e.results){if(t&&i.severity!==`CRITICAL`&&!(n&&i.severity===`WARNING`))continue;let e=l[i.severity],o=d(`[${i.ruleId}] ${i.ruleName} (${a})`),s=u(i.message);r.push(`::${e} title=${o}::${s}`)}return r.join(`
|
|
4
|
+
`)}function m(e,t){return`::error title=${d(`LintPage (${f(e)})`)}::${u(`The audit could not run: ${t}`)}`}const h={FAIL:`Deploy blocked`,"AI-FAIL":`AI visibility fail`,PASS:`Ready to ship`},g={CRITICAL:`Critical`,WARNING:`Warning`,INFO:`Info`};function _(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch{return e}}function v(e){let t=e.replace(/[\r\n]+/g,` `);return(t.length>300?`${t.slice(0,300)}...`:t).replace(/[!-/:-@[-`{-~]/g,`\\$&`)}function y(e){let t={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},n=[`### LintPage: ${v(f(e.url))}`,``,`| Verdict | Score | Critical | Warnings | Info |`,`|---|---|---|---|---|`,`| **${h[e.overallStatus]}** | ${e.score} | ${t.crit} | ${t.warn} | ${t.info} |`,``];if(e.finalUrl&&n.push(`Redirected to ${v(_(e.finalUrl))}`,``),e.localhost){let{notRun:t,downgraded:r}=e.localhost;n.push(`Localhost mode: ${t.length} ${t.length===1?`check`:`checks`} not run, ${r.length} downgraded to info.`,``)}e.vercelDeployment&&n.push(o(e.vercelDeployment.downgraded),``);let r=[...e.results].sort((e,t)=>s(t.severity)-s(e.severity)),i=r.slice(0,10);if(i.length>0){n.push(`| Severity | Check | Finding |`,`|---|---|---|`);for(let e of i)n.push(`| ${g[e.severity]} | ${v(`[${e.ruleId}] ${e.ruleName}`)} | ${v(e.message)} |`);n.push(``),r.length>i.length&&n.push(`${r.length-i.length} more in the job log.`,``)}else n.push(`No issues found.`,``);return n.join(`
|
|
5
|
+
`)}function b(e,t){return[`### LintPage: ${v(f(e))}`,``,`The audit could not run: ${v(t)}`,``].join(`
|
|
6
|
+
`)}function x(e,t,n,r=!1){switch(t){case`json`:return c(e);case`github`:return p(e,n,r);default:return a(e,n)}}export{y as a,b as i,p as n,c as o,m as r,a as s,x as t};
|
|
7
|
+
//# sourceMappingURL=formatter-yk86KB59.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-AOdVjmxi.cjs`);exports.format=e.t,exports.formatGithub=e.n,exports.formatJson=e.o,exports.formatText=e.s;
|
package/dist/index.d.cts
CHANGED
|
@@ -895,6 +895,19 @@ interface PageResult {
|
|
|
895
895
|
max: number;
|
|
896
896
|
deductionPercent: number;
|
|
897
897
|
}>;
|
|
898
|
+
/**
|
|
899
|
+
* Where the page fetch ended up after redirects, when that differs from
|
|
900
|
+
* `url`. Absent when the page did not redirect or could not be fetched.
|
|
901
|
+
*/
|
|
902
|
+
finalUrl?: string;
|
|
903
|
+
/**
|
|
904
|
+
* Present when the CLI audited a Vercel deployment URL and reported a
|
|
905
|
+
* finding at a lower severity because Vercel, not the site, caused it (for
|
|
906
|
+
* example the `X-Robots-Tag: noindex` Vercel sends on deployment URLs).
|
|
907
|
+
*/
|
|
908
|
+
vercelDeployment?: {
|
|
909
|
+
downgraded: string[];
|
|
910
|
+
};
|
|
898
911
|
/**
|
|
899
912
|
* Present when the audit ran against a loopback origin. `notRun` are rules
|
|
900
913
|
* that could not reach it; `downgraded` ran but were reported at a lower
|
|
@@ -911,8 +924,18 @@ interface PageResult {
|
|
|
911
924
|
type Format = 'text' | 'json' | 'github';
|
|
912
925
|
declare function formatText(result: PageResult, quiet: boolean): string;
|
|
913
926
|
declare function formatJson(result: PageResult): string;
|
|
914
|
-
|
|
915
|
-
|
|
927
|
+
/**
|
|
928
|
+
* GitHub workflow commands: the verdict notice, the localhost notice (on a
|
|
929
|
+
* loopback audit) and the Vercel notice (when Vercel's noindex was reported as
|
|
930
|
+
* info) first, then one annotation per finding. Notices go first so a
|
|
931
|
+
* per-step annotation limit drops findings rather than the verdict.
|
|
932
|
+
*
|
|
933
|
+
* `quiet` keeps only the findings that decide the exit code: CRITICAL ones,
|
|
934
|
+
* plus warnings when `failOnWarning` is set, so a run that fails always shows
|
|
935
|
+
* why. All three notices are always kept.
|
|
936
|
+
*/
|
|
937
|
+
declare function formatGithub(result: PageResult, quiet?: boolean, failOnWarning?: boolean): string;
|
|
938
|
+
declare function format(result: PageResult, fmt: Format, quiet: boolean, failOnWarning?: boolean): string;
|
|
916
939
|
//#endregion
|
|
917
940
|
export { type Format, format, formatGithub, formatJson, formatText };
|
|
918
941
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -895,6 +895,19 @@ interface PageResult {
|
|
|
895
895
|
max: number;
|
|
896
896
|
deductionPercent: number;
|
|
897
897
|
}>;
|
|
898
|
+
/**
|
|
899
|
+
* Where the page fetch ended up after redirects, when that differs from
|
|
900
|
+
* `url`. Absent when the page did not redirect or could not be fetched.
|
|
901
|
+
*/
|
|
902
|
+
finalUrl?: string;
|
|
903
|
+
/**
|
|
904
|
+
* Present when the CLI audited a Vercel deployment URL and reported a
|
|
905
|
+
* finding at a lower severity because Vercel, not the site, caused it (for
|
|
906
|
+
* example the `X-Robots-Tag: noindex` Vercel sends on deployment URLs).
|
|
907
|
+
*/
|
|
908
|
+
vercelDeployment?: {
|
|
909
|
+
downgraded: string[];
|
|
910
|
+
};
|
|
898
911
|
/**
|
|
899
912
|
* Present when the audit ran against a loopback origin. `notRun` are rules
|
|
900
913
|
* that could not reach it; `downgraded` ran but were reported at a lower
|
|
@@ -911,8 +924,18 @@ interface PageResult {
|
|
|
911
924
|
type Format = 'text' | 'json' | 'github';
|
|
912
925
|
declare function formatText(result: PageResult, quiet: boolean): string;
|
|
913
926
|
declare function formatJson(result: PageResult): string;
|
|
914
|
-
|
|
915
|
-
|
|
927
|
+
/**
|
|
928
|
+
* GitHub workflow commands: the verdict notice, the localhost notice (on a
|
|
929
|
+
* loopback audit) and the Vercel notice (when Vercel's noindex was reported as
|
|
930
|
+
* info) first, then one annotation per finding. Notices go first so a
|
|
931
|
+
* per-step annotation limit drops findings rather than the verdict.
|
|
932
|
+
*
|
|
933
|
+
* `quiet` keeps only the findings that decide the exit code: CRITICAL ones,
|
|
934
|
+
* plus warnings when `failOnWarning` is set, so a run that fails always shows
|
|
935
|
+
* why. All three notices are always kept.
|
|
936
|
+
*/
|
|
937
|
+
declare function formatGithub(result: PageResult, quiet?: boolean, failOnWarning?: boolean): string;
|
|
938
|
+
declare function format(result: PageResult, fmt: Format, quiet: boolean, failOnWarning?: boolean): string;
|
|
916
939
|
//#endregion
|
|
917
940
|
export { type Format, format, formatGithub, formatJson, formatText };
|
|
918
941
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e,o as t,s as n,t as r}from"./formatter-yk86KB59.mjs";export{r as format,e as formatGithub,t as formatJson,n as formatText};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lintpage",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "CLI for LintPage — audit website SEO, accessibility, and performance",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
"bin",
|
|
25
25
|
"!dist/**/*.map"
|
|
26
26
|
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsdown",
|
|
29
|
-
"test": "vitest run",
|
|
30
|
-
"test:watch": "vitest",
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"clean": "rm -rf dist"
|
|
33
|
-
},
|
|
34
27
|
"dependencies": {
|
|
35
28
|
"cac": "^6.7.14",
|
|
36
29
|
"chalk": "^5.4.1",
|
|
37
30
|
"jsdom": "^26.1.0"
|
|
38
31
|
},
|
|
39
32
|
"devDependencies": {
|
|
40
|
-
"@lintpage/core": "workspace:*",
|
|
41
|
-
"@lintpage/pro": "workspace:*",
|
|
42
|
-
"@lintpage/shared": "workspace:*",
|
|
43
|
-
"@lintpage/tsconfig": "workspace:*",
|
|
44
33
|
"tsdown": "^0.21.4",
|
|
45
34
|
"typescript": "^5",
|
|
46
|
-
"vitest": "^4.0.18"
|
|
35
|
+
"vitest": "^4.0.18",
|
|
36
|
+
"@lintpage/core": "0.1.0",
|
|
37
|
+
"@lintpage/pro": "0.1.0",
|
|
38
|
+
"@lintpage/tsconfig": "0.0.0",
|
|
39
|
+
"@lintpage/shared": "0.1.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsdown",
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"test:watch": "vitest",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"clean": "rm -rf dist"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|