diffwiki-core 0.15.0-rc.202608040914.07e70ce → 0.15.0
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.cjs +16 -21
- package/dist/index.js +16 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2652,21 +2652,18 @@ var import_node_path14 = __toESM(require("path"), 1);
|
|
|
2652
2652
|
init_collections();
|
|
2653
2653
|
init_errors();
|
|
2654
2654
|
var BUDGETS = {
|
|
2655
|
-
recipe: { min:
|
|
2656
|
-
"recipe-steps": { min:
|
|
2655
|
+
recipe: { min: 300, max: 1e3 },
|
|
2656
|
+
"recipe-steps": { min: 500, max: 1500 },
|
|
2657
2657
|
guide: { min: 1500, max: 5e3 },
|
|
2658
2658
|
reference: { min: 300, max: 2e3 },
|
|
2659
2659
|
// Generic fallback budget for a bare `architecture` tag (no dedicated template).
|
|
2660
|
-
architecture: { min: 1e3, max: 6e3 }
|
|
2661
|
-
// Index pages: headings + bullet links only, no prose.
|
|
2662
|
-
"collection-index": { min: 100, max: 500 }
|
|
2660
|
+
architecture: { min: 1e3, max: 6e3 }
|
|
2663
2661
|
};
|
|
2664
2662
|
function estimateTokens(body) {
|
|
2665
2663
|
return Math.ceil(body.trim().length / 4);
|
|
2666
2664
|
}
|
|
2667
2665
|
function inferShape(tags, body) {
|
|
2668
2666
|
const t = new Set(tags.map((x) => x.toLowerCase()));
|
|
2669
|
-
if (t.has("collection-index")) return "collection-index";
|
|
2670
2667
|
if (t.has("guide")) return "guide";
|
|
2671
2668
|
if (t.has("reference")) return "reference";
|
|
2672
2669
|
if (t.has("architecture")) return "architecture";
|
|
@@ -2694,21 +2691,19 @@ function lintArticle(article) {
|
|
|
2694
2691
|
}
|
|
2695
2692
|
const hasRefsSection = /^##\s+References\b/im.test(body);
|
|
2696
2693
|
const hasInlineLink = /\]\([^)]+\)/.test(body);
|
|
2697
|
-
if (
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
});
|
|
2711
|
-
}
|
|
2694
|
+
if (!hasRefsSection && !hasInlineLink) {
|
|
2695
|
+
findings.push({
|
|
2696
|
+
level: "error",
|
|
2697
|
+
rule: "no-references",
|
|
2698
|
+
message: "has no ## References section and no inline links"
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
if ((shape === "guide" || shape === "architecture") && !hasRefsSection) {
|
|
2702
|
+
findings.push({
|
|
2703
|
+
level: "warn",
|
|
2704
|
+
rule: "missing-references-section",
|
|
2705
|
+
message: `${shape} should end with a ## References section`
|
|
2706
|
+
});
|
|
2712
2707
|
}
|
|
2713
2708
|
if (tokens > budget.max) {
|
|
2714
2709
|
findings.push({
|
package/dist/index.js
CHANGED
|
@@ -1806,21 +1806,18 @@ async function appendPluginDiagnostics(out, config) {
|
|
|
1806
1806
|
import fs12 from "fs/promises";
|
|
1807
1807
|
import path11 from "path";
|
|
1808
1808
|
var BUDGETS = {
|
|
1809
|
-
recipe: { min:
|
|
1810
|
-
"recipe-steps": { min:
|
|
1809
|
+
recipe: { min: 300, max: 1e3 },
|
|
1810
|
+
"recipe-steps": { min: 500, max: 1500 },
|
|
1811
1811
|
guide: { min: 1500, max: 5e3 },
|
|
1812
1812
|
reference: { min: 300, max: 2e3 },
|
|
1813
1813
|
// Generic fallback budget for a bare `architecture` tag (no dedicated template).
|
|
1814
|
-
architecture: { min: 1e3, max: 6e3 }
|
|
1815
|
-
// Index pages: headings + bullet links only, no prose.
|
|
1816
|
-
"collection-index": { min: 100, max: 500 }
|
|
1814
|
+
architecture: { min: 1e3, max: 6e3 }
|
|
1817
1815
|
};
|
|
1818
1816
|
function estimateTokens(body) {
|
|
1819
1817
|
return Math.ceil(body.trim().length / 4);
|
|
1820
1818
|
}
|
|
1821
1819
|
function inferShape(tags, body) {
|
|
1822
1820
|
const t = new Set(tags.map((x) => x.toLowerCase()));
|
|
1823
|
-
if (t.has("collection-index")) return "collection-index";
|
|
1824
1821
|
if (t.has("guide")) return "guide";
|
|
1825
1822
|
if (t.has("reference")) return "reference";
|
|
1826
1823
|
if (t.has("architecture")) return "architecture";
|
|
@@ -1848,21 +1845,19 @@ function lintArticle(article) {
|
|
|
1848
1845
|
}
|
|
1849
1846
|
const hasRefsSection = /^##\s+References\b/im.test(body);
|
|
1850
1847
|
const hasInlineLink = /\]\([^)]+\)/.test(body);
|
|
1851
|
-
if (
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
});
|
|
1865
|
-
}
|
|
1848
|
+
if (!hasRefsSection && !hasInlineLink) {
|
|
1849
|
+
findings.push({
|
|
1850
|
+
level: "error",
|
|
1851
|
+
rule: "no-references",
|
|
1852
|
+
message: "has no ## References section and no inline links"
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
if ((shape === "guide" || shape === "architecture") && !hasRefsSection) {
|
|
1856
|
+
findings.push({
|
|
1857
|
+
level: "warn",
|
|
1858
|
+
rule: "missing-references-section",
|
|
1859
|
+
message: `${shape} should end with a ## References section`
|
|
1860
|
+
});
|
|
1866
1861
|
}
|
|
1867
1862
|
if (tokens > budget.max) {
|
|
1868
1863
|
findings.push({
|