diffwiki-core 0.15.0 → 0.16.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 CHANGED
@@ -2652,21 +2652,25 @@ var import_node_path14 = __toESM(require("path"), 1);
2652
2652
  init_collections();
2653
2653
  init_errors();
2654
2654
  var BUDGETS = {
2655
- recipe: { min: 300, max: 1e3 },
2656
- "recipe-steps": { min: 500, max: 1500 },
2655
+ recipe: { min: 50, max: 1e3 },
2656
+ "recipe-steps": { min: 100, 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 }
2660
+ architecture: { min: 1e3, max: 6e3 },
2661
+ // Index pages: headings + bullet links only, no prose.
2662
+ "collection-index": { min: 100, max: 500 }
2661
2663
  };
2662
2664
  function estimateTokens(body) {
2663
2665
  return Math.ceil(body.trim().length / 4);
2664
2666
  }
2665
2667
  function inferShape(tags, body) {
2666
2668
  const t = new Set(tags.map((x) => x.toLowerCase()));
2669
+ if (t.has("collection-index")) return "collection-index";
2667
2670
  if (t.has("guide")) return "guide";
2668
2671
  if (t.has("reference")) return "reference";
2669
2672
  if (t.has("architecture")) return "architecture";
2673
+ if (t.has("recipe-with-steps")) return "recipe-steps";
2670
2674
  if (/^###\s+Step\b/im.test(body)) return "recipe-steps";
2671
2675
  return "recipe";
2672
2676
  }
@@ -2691,19 +2695,21 @@ function lintArticle(article) {
2691
2695
  }
2692
2696
  const hasRefsSection = /^##\s+References\b/im.test(body);
2693
2697
  const hasInlineLink = /\]\([^)]+\)/.test(body);
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
- });
2698
+ if (shape !== "collection-index") {
2699
+ if (!hasRefsSection && !hasInlineLink) {
2700
+ findings.push({
2701
+ level: "error",
2702
+ rule: "no-references",
2703
+ message: "has no ## References section and no inline links"
2704
+ });
2705
+ }
2706
+ if ((shape === "guide" || shape === "architecture") && !hasRefsSection) {
2707
+ findings.push({
2708
+ level: "warn",
2709
+ rule: "missing-references-section",
2710
+ message: `${shape} should end with a ## References section`
2711
+ });
2712
+ }
2707
2713
  }
2708
2714
  if (tokens > budget.max) {
2709
2715
  findings.push({
package/dist/index.js CHANGED
@@ -1806,21 +1806,25 @@ 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: 300, max: 1e3 },
1810
- "recipe-steps": { min: 500, max: 1500 },
1809
+ recipe: { min: 50, max: 1e3 },
1810
+ "recipe-steps": { min: 100, 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 }
1814
+ architecture: { min: 1e3, max: 6e3 },
1815
+ // Index pages: headings + bullet links only, no prose.
1816
+ "collection-index": { min: 100, max: 500 }
1815
1817
  };
1816
1818
  function estimateTokens(body) {
1817
1819
  return Math.ceil(body.trim().length / 4);
1818
1820
  }
1819
1821
  function inferShape(tags, body) {
1820
1822
  const t = new Set(tags.map((x) => x.toLowerCase()));
1823
+ if (t.has("collection-index")) return "collection-index";
1821
1824
  if (t.has("guide")) return "guide";
1822
1825
  if (t.has("reference")) return "reference";
1823
1826
  if (t.has("architecture")) return "architecture";
1827
+ if (t.has("recipe-with-steps")) return "recipe-steps";
1824
1828
  if (/^###\s+Step\b/im.test(body)) return "recipe-steps";
1825
1829
  return "recipe";
1826
1830
  }
@@ -1845,19 +1849,21 @@ function lintArticle(article) {
1845
1849
  }
1846
1850
  const hasRefsSection = /^##\s+References\b/im.test(body);
1847
1851
  const hasInlineLink = /\]\([^)]+\)/.test(body);
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
- });
1852
+ if (shape !== "collection-index") {
1853
+ if (!hasRefsSection && !hasInlineLink) {
1854
+ findings.push({
1855
+ level: "error",
1856
+ rule: "no-references",
1857
+ message: "has no ## References section and no inline links"
1858
+ });
1859
+ }
1860
+ if ((shape === "guide" || shape === "architecture") && !hasRefsSection) {
1861
+ findings.push({
1862
+ level: "warn",
1863
+ rule: "missing-references-section",
1864
+ message: `${shape} should end with a ## References section`
1865
+ });
1866
+ }
1861
1867
  }
1862
1868
  if (tokens > budget.max) {
1863
1869
  findings.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffwiki-core",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Core configuration, registry, and article management for diffwiki",
5
5
  "license": "MIT",
6
6
  "type": "module",