@cms-lab/cli 1.2.2 → 1.2.3
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 +8 -4
- package/dist/bin.js +1 -1
- package/dist/{chunk-SVTBRARJ.js → chunk-M5O5QRR3.js} +13 -4
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ cms-lab init --cms strapi --router pages
|
|
|
14
14
|
cms-lab doctor
|
|
15
15
|
cms-lab doctor --debug --verbose 2
|
|
16
16
|
cms-lab scan --report
|
|
17
|
+
cms-lab scan --report --share-report
|
|
17
18
|
cms-lab scan --markdown
|
|
18
19
|
cms-lab scan --junit
|
|
19
20
|
cms-lab scan --slack-webhook "$CMS_LAB_SLACK_WEBHOOK"
|
|
@@ -52,10 +53,13 @@ unless `--include-sensitive-output` is passed explicitly.
|
|
|
52
53
|
CI strictness can be raised with `--fail-on warning`, `--max-warnings <count>`,
|
|
53
54
|
`--max-info <count>`, or `--strict`.
|
|
54
55
|
|
|
55
|
-
Exports include local HTML (`--report`),
|
|
56
|
-
(`--
|
|
57
|
-
(`--slack-webhook <url>`).
|
|
58
|
-
|
|
56
|
+
Exports include local HTML (`--report`), share-safe local HTML
|
|
57
|
+
(`--report --share-report`), Markdown (`--markdown`), JUnit XML (`--junit`),
|
|
58
|
+
and redacted Slack incoming webhook summaries (`--slack-webhook <url>`).
|
|
59
|
+
Share-safe HTML redacts CMS source IDs and local project paths while keeping
|
|
60
|
+
diagnostic codes, severity, route paths, and field paths visible. Slack
|
|
61
|
+
notifications send counts and diagnostic codes only, never raw CMS payloads,
|
|
62
|
+
local paths, or webhook URLs.
|
|
59
63
|
|
|
60
64
|
`cms-lab agent-context` writes safe handoff files so coding agents can read the
|
|
61
65
|
cms-lab docs, package links, route mappings, and safe project facts before
|
package/dist/bin.js
CHANGED
|
@@ -565,7 +565,7 @@ var noColor = {
|
|
|
565
565
|
// src/index.ts
|
|
566
566
|
async function runCli(argv, dependencies = {}) {
|
|
567
567
|
let exitCode = 0;
|
|
568
|
-
const program = new Command().name("cms-lab").description("Catch CMS bugs before deploy.").version("1.2.
|
|
568
|
+
const program = new Command().name("cms-lab").description("Catch CMS bugs before deploy.").version("1.2.3").exitOverride().configureOutput({
|
|
569
569
|
writeOut: (text) => writeStdout(dependencies, text),
|
|
570
570
|
writeErr: (text) => writeStderr(dependencies, text)
|
|
571
571
|
});
|
|
@@ -597,6 +597,9 @@ Examples:
|
|
|
597
597
|
).option(
|
|
598
598
|
"--report [path]",
|
|
599
599
|
"Write an HTML report. Defaults to .cms-lab/report.html"
|
|
600
|
+
).option(
|
|
601
|
+
"--share-report",
|
|
602
|
+
"Redact CMS source IDs and local project paths in the HTML report"
|
|
600
603
|
).option(
|
|
601
604
|
"--markdown [path]",
|
|
602
605
|
"Write a Markdown summary. Defaults to .cms-lab/summary.md"
|
|
@@ -809,7 +812,9 @@ async function runScan(options, dependencies) {
|
|
|
809
812
|
});
|
|
810
813
|
const status = exitCode === 0 ? "passed" : "failed";
|
|
811
814
|
const endReport = debug.time("exports", 2);
|
|
812
|
-
await maybeWriteReport(options.report, result, cwd
|
|
815
|
+
await maybeWriteReport(options.report, result, cwd, {
|
|
816
|
+
share: Boolean(options.shareReport)
|
|
817
|
+
});
|
|
813
818
|
await maybeWriteMarkdown(options.markdown, result, status, cwd);
|
|
814
819
|
await maybeWriteJUnit(options.junit, result, cwd);
|
|
815
820
|
const slackSent = await maybePostSlack({
|
|
@@ -1504,13 +1509,17 @@ function exitCodeForResult(result, options) {
|
|
|
1504
1509
|
function thresholdExceeded(result, maxWarnings, maxInfo) {
|
|
1505
1510
|
return maxWarnings !== void 0 && result.summary.warnings > maxWarnings || maxInfo !== void 0 && result.summary.info > maxInfo;
|
|
1506
1511
|
}
|
|
1507
|
-
async function maybeWriteReport(report, result, cwd) {
|
|
1512
|
+
async function maybeWriteReport(report, result, cwd, options = {}) {
|
|
1508
1513
|
if (!report) {
|
|
1509
1514
|
return;
|
|
1510
1515
|
}
|
|
1511
1516
|
const path = reportPathFromOption(report, cwd);
|
|
1512
1517
|
await mkdir(dirname(path), { recursive: true });
|
|
1513
|
-
await writeFile(
|
|
1518
|
+
await writeFile(
|
|
1519
|
+
path,
|
|
1520
|
+
renderHtmlReport(result, { privacy: options.share ? "share" : "full" }),
|
|
1521
|
+
"utf8"
|
|
1522
|
+
);
|
|
1514
1523
|
}
|
|
1515
1524
|
function reportPathFromOption(report, cwd) {
|
|
1516
1525
|
return resolve(
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cms-lab/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Catch CMS bugs before deploy.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"commander": "^14.0.2",
|
|
49
49
|
"picocolors": "^1.1.1",
|
|
50
|
-
"@cms-lab/contentful": "1.2.
|
|
51
|
-
"@cms-lab/
|
|
52
|
-
"@cms-lab/
|
|
53
|
-
"@cms-lab/
|
|
54
|
-
"@cms-lab/
|
|
55
|
-
"@cms-lab/
|
|
56
|
-
"@cms-lab/
|
|
57
|
-
"@cms-lab/
|
|
58
|
-
"@cms-lab/
|
|
50
|
+
"@cms-lab/contentful": "1.2.3",
|
|
51
|
+
"@cms-lab/core": "1.2.3",
|
|
52
|
+
"@cms-lab/prismic": "1.2.3",
|
|
53
|
+
"@cms-lab/reporter": "1.2.3",
|
|
54
|
+
"@cms-lab/sanity": "1.2.3",
|
|
55
|
+
"@cms-lab/strapi": "1.2.3",
|
|
56
|
+
"@cms-lab/next": "1.2.3",
|
|
57
|
+
"@cms-lab/wordpress": "1.2.3",
|
|
58
|
+
"@cms-lab/directus": "1.2.3"
|
|
59
59
|
},
|
|
60
60
|
"author": "Afaq Rashid",
|
|
61
61
|
"scripts": {
|