@rankcli/cli 0.0.5 → 0.0.6
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/dist/index.js +32 -7
- package/dist/index.mjs +33 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -932,25 +932,50 @@ async function apply(options) {
|
|
|
932
932
|
const frameworkResult = await (0, import_agent_runtime2.detectFramework)({ cwd });
|
|
933
933
|
const framework = frameworkResult.success ? frameworkResult.data : { name: "Unknown", metaPattern: "html-head" };
|
|
934
934
|
console.log(` Framework: ${framework.name}`);
|
|
935
|
+
const isPaidUser = isLoggedIn();
|
|
935
936
|
console.log(`
|
|
936
937
|
\u{1F50D} Analyzing ${url}...`);
|
|
937
|
-
|
|
938
|
+
if (isPaidUser) {
|
|
939
|
+
console.log(" Running full audit (200+ checks)...");
|
|
940
|
+
} else {
|
|
941
|
+
console.log(" Running basic analysis (login for full 200+ checks)");
|
|
942
|
+
}
|
|
943
|
+
let issues;
|
|
944
|
+
let score;
|
|
945
|
+
let auditResult = null;
|
|
938
946
|
try {
|
|
939
|
-
|
|
947
|
+
if (isPaidUser) {
|
|
948
|
+
auditResult = await (0, import_agent_runtime2.runAuditWithFixes)({
|
|
949
|
+
url,
|
|
950
|
+
generateFixes: true
|
|
951
|
+
});
|
|
952
|
+
issues = auditResult.report.issues.map((issue) => ({
|
|
953
|
+
severity: issue.severity,
|
|
954
|
+
category: issue.category,
|
|
955
|
+
code: issue.code,
|
|
956
|
+
message: issue.title,
|
|
957
|
+
impact: issue.description || void 0
|
|
958
|
+
}));
|
|
959
|
+
score = auditResult.score;
|
|
960
|
+
} else {
|
|
961
|
+
const analysis = await (0, import_agent_runtime2.runDirectAnalysis)(url);
|
|
962
|
+
issues = analysis.issues;
|
|
963
|
+
score = analysis.score;
|
|
964
|
+
}
|
|
940
965
|
} catch (error) {
|
|
941
966
|
console.log(`
|
|
942
967
|
\u274C Analysis failed: ${error instanceof Error ? error.message : "Unknown error"}
|
|
943
968
|
`);
|
|
944
969
|
return;
|
|
945
970
|
}
|
|
946
|
-
console.log(` Score: ${
|
|
947
|
-
console.log(` Issues found: ${
|
|
948
|
-
if (
|
|
971
|
+
console.log(` Score: ${score}/100`);
|
|
972
|
+
console.log(` Issues found: ${issues.length}`);
|
|
973
|
+
if (issues.length === 0) {
|
|
949
974
|
console.log("\n\u2705 No issues found! Your site looks great.\n");
|
|
950
975
|
return;
|
|
951
976
|
}
|
|
952
977
|
console.log("\n\u{1F527} Generating fixes...");
|
|
953
|
-
const fixes = await (0, import_agent_runtime2.generateFixes)(
|
|
978
|
+
const fixes = await (0, import_agent_runtime2.generateFixes)(issues, {
|
|
954
979
|
cwd,
|
|
955
980
|
url,
|
|
956
981
|
framework
|
|
@@ -1884,7 +1909,7 @@ async function fetchAndSaveSubscription() {
|
|
|
1884
1909
|
}
|
|
1885
1910
|
|
|
1886
1911
|
// src/version.ts
|
|
1887
|
-
var VERSION = "0.0.
|
|
1912
|
+
var VERSION = "0.0.6";
|
|
1888
1913
|
|
|
1889
1914
|
// src/index.ts
|
|
1890
1915
|
var program = new import_commander.Command();
|
package/dist/index.mjs
CHANGED
|
@@ -854,6 +854,7 @@ import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync
|
|
|
854
854
|
import { join as join3 } from "path";
|
|
855
855
|
import {
|
|
856
856
|
runDirectAnalysis,
|
|
857
|
+
runAuditWithFixes,
|
|
857
858
|
generateFixes,
|
|
858
859
|
applyFixes,
|
|
859
860
|
detectFramework as detectFramework3
|
|
@@ -915,25 +916,50 @@ async function apply(options) {
|
|
|
915
916
|
const frameworkResult = await detectFramework3({ cwd });
|
|
916
917
|
const framework = frameworkResult.success ? frameworkResult.data : { name: "Unknown", metaPattern: "html-head" };
|
|
917
918
|
console.log(` Framework: ${framework.name}`);
|
|
919
|
+
const isPaidUser = isLoggedIn();
|
|
918
920
|
console.log(`
|
|
919
921
|
\u{1F50D} Analyzing ${url}...`);
|
|
920
|
-
|
|
922
|
+
if (isPaidUser) {
|
|
923
|
+
console.log(" Running full audit (200+ checks)...");
|
|
924
|
+
} else {
|
|
925
|
+
console.log(" Running basic analysis (login for full 200+ checks)");
|
|
926
|
+
}
|
|
927
|
+
let issues;
|
|
928
|
+
let score;
|
|
929
|
+
let auditResult = null;
|
|
921
930
|
try {
|
|
922
|
-
|
|
931
|
+
if (isPaidUser) {
|
|
932
|
+
auditResult = await runAuditWithFixes({
|
|
933
|
+
url,
|
|
934
|
+
generateFixes: true
|
|
935
|
+
});
|
|
936
|
+
issues = auditResult.report.issues.map((issue) => ({
|
|
937
|
+
severity: issue.severity,
|
|
938
|
+
category: issue.category,
|
|
939
|
+
code: issue.code,
|
|
940
|
+
message: issue.title,
|
|
941
|
+
impact: issue.description || void 0
|
|
942
|
+
}));
|
|
943
|
+
score = auditResult.score;
|
|
944
|
+
} else {
|
|
945
|
+
const analysis = await runDirectAnalysis(url);
|
|
946
|
+
issues = analysis.issues;
|
|
947
|
+
score = analysis.score;
|
|
948
|
+
}
|
|
923
949
|
} catch (error) {
|
|
924
950
|
console.log(`
|
|
925
951
|
\u274C Analysis failed: ${error instanceof Error ? error.message : "Unknown error"}
|
|
926
952
|
`);
|
|
927
953
|
return;
|
|
928
954
|
}
|
|
929
|
-
console.log(` Score: ${
|
|
930
|
-
console.log(` Issues found: ${
|
|
931
|
-
if (
|
|
955
|
+
console.log(` Score: ${score}/100`);
|
|
956
|
+
console.log(` Issues found: ${issues.length}`);
|
|
957
|
+
if (issues.length === 0) {
|
|
932
958
|
console.log("\n\u2705 No issues found! Your site looks great.\n");
|
|
933
959
|
return;
|
|
934
960
|
}
|
|
935
961
|
console.log("\n\u{1F527} Generating fixes...");
|
|
936
|
-
const fixes = await generateFixes(
|
|
962
|
+
const fixes = await generateFixes(issues, {
|
|
937
963
|
cwd,
|
|
938
964
|
url,
|
|
939
965
|
framework
|
|
@@ -1896,7 +1922,7 @@ async function fetchAndSaveSubscription() {
|
|
|
1896
1922
|
}
|
|
1897
1923
|
|
|
1898
1924
|
// src/version.ts
|
|
1899
|
-
var VERSION = "0.0.
|
|
1925
|
+
var VERSION = "0.0.6";
|
|
1900
1926
|
|
|
1901
1927
|
// src/index.ts
|
|
1902
1928
|
var program = new Command();
|