ssqch 0.12.0 → 0.13.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.
Files changed (130) hide show
  1. package/bundled/completions/bash +66 -8
  2. package/bundled/completions/elvish +23 -4
  3. package/bundled/completions/fish +36 -25
  4. package/bundled/completions/powershell +25 -4
  5. package/bundled/completions/zsh +44 -10
  6. package/bundled/docs/agents.md +2 -2
  7. package/bundled/docs/build-summary.md +1 -1
  8. package/bundled/docs/comparing-builds.md +2 -2
  9. package/bundled/docs/configuring.md +3 -6
  10. package/bundled/docs/deploying.md +1 -1
  11. package/bundled/docs/field-guide.md +4 -4
  12. package/bundled/docs/github-pages.md +1 -0
  13. package/bundled/docs/index.md +1 -1
  14. package/bundled/docs/install.md +1 -1
  15. package/bundled/docs/known-gaps.md +1 -1
  16. package/bundled/docs/markdown.md +8 -12
  17. package/bundled/docs/nav.yml +5 -1
  18. package/bundled/docs/netlify.md +4 -2
  19. package/bundled/docs/patrol.md +48 -0
  20. package/bundled/docs/plugins.md +6 -6
  21. package/bundled/docs/robots.md +72 -0
  22. package/bundled/docs/seo.md +2 -38
  23. package/bundled/docs/serving-markdown.md +142 -0
  24. package/bundled/docs/template-languages.md +1 -1
  25. package/bundled/docs/templates.md +1 -1
  26. package/bundled/docs/trailheads/from-hugo.md +5 -3
  27. package/bundled/docs/trailheads/from-jekyll.md +54 -13
  28. package/bundled/docs/trailheads/from-mkdocs.md +15 -12
  29. package/bundled/docs/trailheads/from-vitepress.md +13 -11
  30. package/bundled/docs/trailheads.md +3 -3
  31. package/bundled/docs/where-values-come-from.md +5 -5
  32. package/bundled/docs/writing-plugins.md +69 -0
  33. package/bundled/ssqch.d.ts +111 -43
  34. package/bundled/starter/engines/index.edge +1 -0
  35. package/bundled/starter/engines/index.ejs +1 -0
  36. package/bundled/starter/engines/index.hbs +1 -0
  37. package/bundled/starter/engines/index.liquid +1 -0
  38. package/bundled/starter/engines/layout.edge +7 -0
  39. package/bundled/starter/engines/layout.ejs +4 -0
  40. package/bundled/starter/engines/layout.hbs +4 -0
  41. package/bundled/starter/engines/layout.liquid +4 -0
  42. package/bundled/starter/src/_data/site.json +1 -0
  43. package/bundled/starter/src/_includes/layout.jinja +4 -0
  44. package/bundled/starter/src/index.jinja +1 -0
  45. package/bundled/starter/ssqch.config.js +14 -1
  46. package/bundled/starter-docs/engines/edge/base.edge +7 -0
  47. package/bundled/starter-docs/engines/edge/doc.edge +4 -0
  48. package/bundled/starter-docs/engines/ejs/base.ejs +4 -0
  49. package/bundled/starter-docs/engines/ejs/doc.ejs +4 -0
  50. package/bundled/starter-docs/engines/hbs/base.hbs +4 -0
  51. package/bundled/starter-docs/engines/hbs/doc.hbs +3 -0
  52. package/bundled/starter-docs/engines/liquid/base.liquid +4 -0
  53. package/bundled/starter-docs/engines/liquid/doc.liquid +4 -0
  54. package/bundled/starter-docs/src/_data/site.json +1 -0
  55. package/bundled/starter-docs/src/_includes/base.jinja +4 -0
  56. package/bundled/starter-docs/src/_includes/doc.jinja +4 -0
  57. package/bundled/starter-docs/src/assets/docs.css +4 -0
  58. package/bundled/starter-docs/src/assets/docs.js +17 -0
  59. package/bundled/starter-docs/ssqch.config.js +14 -1
  60. package/lib/assets.js +9 -9
  61. package/lib/chunk-25WERNDD.js +112 -0
  62. package/lib/{chunk-4ZMNLWE4.js → chunk-2BJFGKOE.js} +2 -2
  63. package/lib/chunk-2FKYWYAB.js +268 -0
  64. package/lib/{chunk-M2BBE2C3.js → chunk-3ZTRIO6O.js} +18 -17
  65. package/lib/{chunk-57HLSKZS.js → chunk-4AZFCSGJ.js} +2 -2
  66. package/lib/{chunk-ULQHJ4TS.js → chunk-55WXDGO4.js} +3 -3
  67. package/lib/{chunk-JX43SJHU.js → chunk-6FY77I4M.js} +24 -22
  68. package/lib/{chunk-RY3KLUQ3.js → chunk-6OUCRDYI.js} +267 -202
  69. package/lib/{chunk-EVFNYUTR.js → chunk-6U5VIQVY.js} +5 -5
  70. package/lib/{chunk-N3IZ44XY.js → chunk-7U5GWTEH.js} +88 -54
  71. package/lib/{chunk-VTYQ3JKL.js → chunk-AIJNG6MJ.js} +2 -2
  72. package/lib/{chunk-IIBZPHAW.js → chunk-C2Q7JKFI.js} +8 -8
  73. package/lib/{chunk-6CSH757V.js → chunk-DFJFHULZ.js} +33 -8
  74. package/lib/{chunk-XVV7JJK7.js → chunk-ENWDM2RW.js} +40 -39
  75. package/lib/{chunk-JUALMFW3.js → chunk-ER72RPD6.js} +1 -1
  76. package/lib/{chunk-RFREB3SI.js → chunk-F3JPNFCZ.js} +7 -7
  77. package/lib/{chunk-LLOA3QXV.js → chunk-FENJHLNM.js} +3 -2
  78. package/lib/{chunk-UU43WIZG.js → chunk-FJML7INB.js} +4 -2
  79. package/lib/{chunk-IZCF4UH3.js → chunk-FQZDUDFK.js} +1 -1
  80. package/lib/{chunk-GVHQ37JE.js → chunk-GSNRAGKQ.js} +10 -5
  81. package/lib/{chunk-L2IY4P6O.js → chunk-GU7BBYWB.js} +3 -3
  82. package/lib/{chunk-RGYJQYW3.js → chunk-HDKU6LRI.js} +32 -5
  83. package/lib/{chunk-IQUGLVZY.js → chunk-K5WZ2VYK.js} +4 -4
  84. package/lib/{chunk-JVT5ZRRH.js → chunk-OOKBXQAY.js} +5 -5
  85. package/lib/{chunk-MOLTDO5A.js → chunk-SNQOHNXE.js} +1 -1
  86. package/lib/{chunk-Z3XH4KWX.js → chunk-SPIFZBIW.js} +1 -1
  87. package/lib/{chunk-FNNXRVSU.js → chunk-T5IUI7W7.js} +10 -10
  88. package/lib/{chunk-5HEZ3WUQ.js → chunk-TGSVSG2G.js} +2 -2
  89. package/lib/{chunk-3GROJ3TY.js → chunk-U2KEMVXO.js} +24 -17
  90. package/lib/{chunk-4B3N44SN.js → chunk-UHRBPZ4A.js} +3 -3
  91. package/lib/{chunk-GWWA5Y3X.js → chunk-ULCT3PAV.js} +1 -1
  92. package/lib/{chunk-7RGEWDLF.js → chunk-UZNUS7RP.js} +10 -8
  93. package/lib/{chunk-DZ5F5XSI.js → chunk-V3G2QGL3.js} +10 -105
  94. package/lib/{chunk-DOHOKUGB.js → chunk-VILOEVK7.js} +50 -26
  95. package/lib/{chunk-DXMDXHV7.js → chunk-WGAIE3DD.js} +15 -14
  96. package/lib/{chunk-G3RFQDKO.js → chunk-WUCRAV36.js} +8 -6
  97. package/lib/{chunk-52ROOMBZ.js → chunk-XYAWJTHM.js} +9 -9
  98. package/lib/{chunk-L3K7MMFC.js → chunk-YA23NDMW.js} +2 -2
  99. package/lib/{chunk-R7PBREXL.js → chunk-YNJNMQWU.js} +8 -5
  100. package/lib/{chunk-AK7ZKSZP.js → chunk-ZMG25MXF.js} +17 -16
  101. package/lib/cli.js +56 -34
  102. package/lib/elements.js +9 -9
  103. package/lib/from-hugo.js +36 -0
  104. package/lib/from-jekyll.js +41 -0
  105. package/lib/from-mkdocs.js +49 -0
  106. package/lib/from-vitepress.js +49 -0
  107. package/lib/image.js +10 -10
  108. package/lib/links.js +9 -9
  109. package/lib/llms.js +521 -47
  110. package/lib/minify.js +10 -10
  111. package/lib/redirects.js +9 -9
  112. package/lib/robots.js +87 -0
  113. package/lib/rss.js +22 -12
  114. package/lib/sass.js +10 -10
  115. package/lib/sitemap.js +22 -33
  116. package/lib/ssqch.js +5 -5
  117. package/lib/vue.js +14 -13
  118. package/package.json +21 -1
  119. package/types/from-hugo.d.ts +5 -0
  120. package/types/from-jekyll.d.ts +11 -0
  121. package/types/from-mkdocs.d.ts +11 -0
  122. package/types/from-vitepress.d.ts +5 -0
  123. package/types/index.d.ts +45 -29
  124. package/types/llms.d.ts +12 -8
  125. package/types/robots.d.ts +13 -0
  126. package/types/sass.d.ts +1 -1
  127. package/types/sitemap.d.ts +3 -5
  128. package/wasm/markdown.wasm +0 -0
  129. /package/lib/{chunk-JX43SJHU.js.LEGAL.txt → chunk-6FY77I4M.js.LEGAL.txt} +0 -0
  130. /package/lib/{chunk-R7PBREXL.js.LEGAL.txt → chunk-YNJNMQWU.js.LEGAL.txt} +0 -0
package/lib/cli.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ BUILDER
5
+ } from "./chunk-ER72RPD6.js";
3
6
  import {
4
7
  Printed,
5
8
  UsageError,
6
9
  parse
7
10
  } from "./chunk-RIAOXEXC.js";
8
- import {
9
- BUILDER
10
- } from "./chunk-JUALMFW3.js";
11
11
  import {
12
12
  DEFAULT_ENGINE
13
- } from "./chunk-LLOA3QXV.js";
13
+ } from "./chunk-FENJHLNM.js";
14
14
  import {
15
15
  VERSION
16
16
  } from "./chunk-AD3HAW3W.js";
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-DDV6JEC2.js";
26
26
  import {
27
27
  describeThrown
28
- } from "./chunk-57HLSKZS.js";
28
+ } from "./chunk-4AZFCSGJ.js";
29
29
  import {
30
30
  prettyJson,
31
31
  quoted
@@ -50,7 +50,7 @@ import {
50
50
  toJson2,
51
51
  warn,
52
52
  warning
53
- } from "./chunk-R7PBREXL.js";
53
+ } from "./chunk-YNJNMQWU.js";
54
54
  import {
55
55
  isDir,
56
56
  relative
@@ -107,11 +107,11 @@ var COMMANDS = [
107
107
  afterHelp: 'The blueprint is named after the page\'s folder (_blueprints/posts.md for posts/), then `default`.\nIts body is copied as it is; only front matter keys are filled in. Nothing is overwritten.\n\n ssqch new posts/pine-cones.md\n ssqch new posts --title "Pine cones" (named like the other pages in posts/)\n ssqch new docs/guides/install.md --set order=3 --set draft=true'
108
108
  },
109
109
  {
110
- name: "inspect",
111
- about: "Show where a page comes from, and which level of the data cascade set each value",
110
+ name: "trace",
111
+ about: "Follow a page's tracks: where it comes from, and which level of the data cascade set each value",
112
112
  options: [{ long: "field", value: "NAME", help: "One field of its data, in full, with every level that set it (a dotted path reaches inside: hero.alt)" }, FORMAT],
113
113
  positionals: [{ name: "PAGE", help: "The page: its URL (/about/), or its template's path", required: true }],
114
- afterHelp: "The site is read as a build reads it, up to rendering: beforeBuild hooks run (data can depend on them),\nbut no page is rendered or written, and afterBuild hooks don't run. Standard output is only the report.\n\n ssqch inspect /guides/install/\n ssqch inspect src/guides/install.md --field title\n ssqch inspect /guides/install/ --field hero.alt --format json"
114
+ afterHelp: "The site is read as a build reads it, up to rendering: beforeBuild hooks run (data can depend on them),\nbut no page is rendered or written, and afterBuild hooks don't run. Standard output is only the report.\n\n ssqch trace /guides/install/\n ssqch trace src/guides/install.md --field title\n ssqch trace /guides/install/ --field hero.alt --format json"
115
115
  },
116
116
  {
117
117
  name: "completions",
@@ -145,6 +145,13 @@ var COMMANDS = [
145
145
  positionals: [{ name: "DIR", help: "The build folder (default: the site's output folder)", required: false, path: true }],
146
146
  afterHelp: "It reads a build folder, so build first:\n\n ssqch build\n ssqch footprint (the site's output folder)\n ssqch footprint dist-before (any build)\n ssqch footprint --top 20 --format json"
147
147
  },
148
+ {
149
+ name: "patrol",
150
+ about: "Check a build for what agents and crawlers read: robots.txt, the sitemap, llms.txt, Markdown copies, headings and descriptions",
151
+ options: [FORMAT],
152
+ positionals: [{ name: "DIR", help: "The build folder (default: the site's output folder)", required: false, path: true }],
153
+ afterHelp: "It reads a build folder, any generator's, so build first:\n\n ssqch build\n ssqch patrol (the site's output folder)\n ssqch patrol _site (another generator's build, before a move)\n ssqch patrol --format json\n\nEach warning has a code (`ssqch docs \"what patrol checks\"` says what each means). Exits with 0 when it found nothing, 1 when\nit warned, and 2 on an error."
154
+ },
148
155
  {
149
156
  name: "init",
150
157
  about: "Create a starter site (config, layout, five posts, data and editor types)",
@@ -358,29 +365,30 @@ async function main(argv) {
358
365
  `);
359
366
  return 1;
360
367
  }
361
- if (command === "baseline") return (await import("./chunk-RFREB3SI.js")).runBaseline({ root: value("root") ?? ".", command: cli.positionals.join(" "), from: value("from") ?? "_site", runs: Number(value("runs") ?? "3"), commit: value("commit"), to: value("to") ?? ".cache/ssqch/baseline/ref", link: [cli.options.link ?? []].flat(), patch: value("patch"), copyInstalls: flag("copy-installs"), quiet: flag("quiet") });
362
- if (command === "scout") return (await import("./chunk-N3IZ44XY.js")).runScout(cli.positionals[0] ?? ".", { from: value("from"), format: value("format") === "json" ? "json" : "text", writeDraft: flag("write-draft"), patch: value("patch"), compare: flag("compare") ? value("reference") ?? "" : void 0 });
368
+ if (command === "baseline") return (await import("./chunk-F3JPNFCZ.js")).runBaseline({ root: value("root") ?? ".", command: cli.positionals.join(" "), from: value("from") ?? "_site", runs: Number(value("runs") ?? "3"), commit: value("commit"), to: value("to") ?? ".cache/ssqch/baseline/ref", link: [cli.options.link ?? []].flat(), patch: value("patch"), copyInstalls: flag("copy-installs"), quiet: flag("quiet") });
369
+ if (command === "scout") return (await import("./chunk-7U5GWTEH.js")).runScout(cli.positionals[0] ?? ".", { from: value("from"), format: value("format") === "json" ? "json" : "text", writeDraft: flag("write-draft"), patch: value("patch"), compare: flag("compare") ? value("reference") ?? "" : void 0 });
363
370
  switch (command) {
364
371
  case "init":
365
- return (await import("./chunk-VTYQ3JKL.js")).runInit({ dir: cli.positionals[0] ?? ".", starter: value("starter") ?? "site", engine: value("engine") ?? DEFAULT_ENGINE, quiet: flag("quiet") });
372
+ return (await import("./chunk-AIJNG6MJ.js")).runInit({ dir: cli.positionals[0] ?? ".", starter: value("starter") ?? "site", engine: value("engine") ?? DEFAULT_ENGINE, quiet: flag("quiet") });
366
373
  case "capabilities":
367
- return (await import("./chunk-FNNXRVSU.js")).runCapabilities(format, CAPABILITY_ORDER);
374
+ return (await import("./chunk-T5IUI7W7.js")).runCapabilities(format, CAPABILITY_ORDER);
368
375
  case "docs":
369
- return (await import("./chunk-3GROJ3TY.js")).runDocs(GRAMMAR, { query: cli.positionals, from: value("from"), format });
376
+ return (await import("./chunk-U2KEMVXO.js")).runDocs(GRAMMAR, { query: cli.positionals, from: value("from"), format });
370
377
  case "sighting":
371
- return (await import("./chunk-M2BBE2C3.js")).runSighting(path.resolve(value("root") ?? "."));
378
+ return (await import("./chunk-3ZTRIO6O.js")).runSighting(path.resolve(value("root") ?? "."));
372
379
  case "completions": {
373
380
  process.stdout.write(bundled(`completions/${cli.positionals[0]}`));
374
381
  return 0;
375
382
  }
376
383
  case "types": {
377
384
  routeConsole();
378
- return (await import("./chunk-52ROOMBZ.js")).runTypes({ root: value("root"), out: value("out") ?? "ssqch.d.ts" });
385
+ return (await import("./chunk-XYAWJTHM.js")).runTypes({ root: value("root"), out: value("out") ?? "ssqch.d.ts" });
379
386
  }
380
387
  }
381
388
  const many = (name) => Array.isArray(cli.options[name]) ? cli.options[name] : typeof cli.options[name] === "string" ? [cli.options[name]] : [];
382
389
  const top = Number(value("top") ?? "5");
383
390
  if (command === "diff") return runDiff(cli.positionals, { exact: flag("exact"), ignore: many("ignore"), only: many("only"), exclude: many("exclude"), ungrouped: flag("ungrouped"), text: flag("text"), lines: Number(value("lines") ?? "10"), format });
391
+ if (command === "patrol" && cli.positionals[0] !== void 0) return runPatrol(cli.positionals[0], cli.positionals[0], format);
384
392
  if (command === "footprint" && cli.positionals[0] !== void 0) {
385
393
  try {
386
394
  await runFootprint(cli.positionals[0], cli.positionals[0], top, format);
@@ -391,8 +399,8 @@ async function main(argv) {
391
399
  return 1;
392
400
  }
393
401
  }
394
- const inspecting = command === "inspect";
395
- if (inspecting) capture();
402
+ const tracing = command === "trace";
403
+ if (tracing) capture();
396
404
  const serving = command === "serve";
397
405
  const given = value("env") ?? process.env.SSQCH_ENV ?? process.env.NODE_ENV;
398
406
  const env = (given === void 0 ? void 0 : parseEnvironment(given)) ?? (serving ? "development" : "production");
@@ -401,15 +409,15 @@ async function main(argv) {
401
409
  const root = path.resolve(value("root") ?? ".");
402
410
  siteRoot = root;
403
411
  routeConsole();
404
- const makeConfig = async () => (await import("./chunk-7RGEWDLF.js")).loadConfig({ root, rootGiven: value("root") ?? ".", env, serving, quiet: flag("quiet") || inspecting, verbose: flag("verbose"), profile: command === "build" && flag("profile"), output: value("output"), base: value("base") });
412
+ const makeConfig = async () => (await import("./chunk-UZNUS7RP.js")).loadConfig({ root, rootGiven: value("root") ?? ".", env, serving, quiet: flag("quiet") || tracing, verbose: flag("verbose"), profile: command === "build" && flag("profile"), output: value("output"), base: value("base") });
405
413
  if (command === "new") return newPage(makeConfig, root, { path: cli.positionals[0], title: value("title"), date: value("date"), blueprint: value("blueprint"), set: cli.options.set ?? [], format });
406
414
  if (serving) {
407
- if (building) return (await import("./chunk-DXMDXHV7.js")).runBuilder(building, makeConfig, root);
415
+ if (building) return (await import("./chunk-WGAIE3DD.js")).runBuilder(building, makeConfig, root);
408
416
  const readyFile = value("ready-file") === void 0 ? void 0 : path.resolve(value("ready-file"));
409
417
  const options = { port: Number(value("port") ?? "8080"), readyFile, quiet: flag("quiet") };
410
418
  if (!flag("built")) {
411
419
  try {
412
- return await (await import("./chunk-6CSH757V.js")).serve(argv, options);
420
+ return await (await import("./chunk-DFJFHULZ.js")).serve(argv, options);
413
421
  } catch (e) {
414
422
  printError("error:", e, "build", new Locator(root));
415
423
  return 1;
@@ -423,7 +431,7 @@ async function main(argv) {
423
431
  return 1;
424
432
  }
425
433
  try {
426
- return await (await import("./chunk-6CSH757V.js")).serveBuilt(config2, options);
434
+ return await (await import("./chunk-DFJFHULZ.js")).serveBuilt(config2, options);
427
435
  } catch (e) {
428
436
  printError("error:", e, "build", locatorOf(config2));
429
437
  return 1;
@@ -443,16 +451,17 @@ async function main(argv) {
443
451
  return 1;
444
452
  }
445
453
  try {
446
- if (inspecting) {
447
- await runInspect(config, cli.positionals[0], value("field"), format);
454
+ if (tracing) {
455
+ await runTrace(config, cli.positionals[0], value("field"), format);
448
456
  return 0;
449
457
  }
458
+ if (command === "patrol") return runPatrol(shownDir(config, config.output), shownOutput(config), format);
450
459
  if (command === "footprint") {
451
460
  const dirs = dirsOf(config);
452
461
  await runFootprint(shownDir(config, config.output), shownOutput(config), top, format);
453
462
  return 0;
454
463
  }
455
- const [{ build }, { summary, profileText }] = await Promise.all([import("./chunk-AK7ZKSZP.js"), import("./chunk-L2IY4P6O.js")]);
464
+ const [{ build }, { summary, profileText }] = await Promise.all([import("./chunk-ZMG25MXF.js"), import("./chunk-GU7BBYWB.js")]);
456
465
  const report = await build(config);
457
466
  if (!config.quiet) process.stdout.write(summary(config, report));
458
467
  if (report.profile) process.stdout.write(profileText(report.profile));
@@ -471,7 +480,7 @@ async function newPage(makeConfig, root, command) {
471
480
  return 1;
472
481
  }
473
482
  try {
474
- (await import("./chunk-IIBZPHAW.js")).runNew(config, command);
483
+ (await import("./chunk-C2Q7JKFI.js")).runNew(config, command);
475
484
  return 0;
476
485
  } catch (e) {
477
486
  printError("error:", e, "build", locatorOf(config));
@@ -481,12 +490,12 @@ async function newPage(makeConfig, root, command) {
481
490
  var checkFormat = (format) => {
482
491
  if (format !== "text" && format !== "json") bail(`--format ${format}: use text or json`);
483
492
  };
484
- async function runInspect(config, target, name, format) {
493
+ async function runTrace(config, target, name, format) {
485
494
  checkFormat(format);
486
- const { field, fieldText, inspect, inspectionJson, inspectionText } = await import("./chunk-XVV7JJK7.js");
495
+ const { field, fieldText, trace, traceJson, traceText } = await import("./chunk-ENWDM2RW.js");
487
496
  let report;
488
497
  try {
489
- report = await inspect(config, target);
498
+ report = await trace(config, target);
490
499
  } finally {
491
500
  for (const found of takeWarnings()) process.stderr.write(`warn: ${found.message}
492
501
  `);
@@ -496,14 +505,14 @@ async function runInspect(config, target, name, format) {
496
505
  one = field(report, name);
497
506
  if (!one) bail(`${report.url ?? report.inputPath} has no \`${name.split(".")[0]}\` in its data (it has: ${report.fields.map((f) => f.name).join(", ")})`);
498
507
  }
499
- if (format === "json") process.stdout.write(prettyJson(inspectionJson(report, one)) + "\n");
500
- else process.stdout.write(one ? fieldText(one) : inspectionText(report));
508
+ if (format === "json") process.stdout.write(prettyJson(traceJson(report, one)) + "\n");
509
+ else process.stdout.write(one ? fieldText(one) : traceText(report));
501
510
  }
502
511
  async function runDiff(dirs, options) {
503
512
  const [before, after] = dirs;
504
513
  try {
505
514
  checkFormat(options.format);
506
- const [{ rustRegExp }, { globProblem, globToRegExp }, { compare, compareRuns, diffJson, diffText, isSame, runsJson, runsText }] = await Promise.all([import("./chunk-IAFM5ITE.js"), import("./chunk-5HEZ3WUQ.js"), import("./chunk-G3RFQDKO.js")]);
515
+ const [{ rustRegExp }, { globProblem, globToRegExp }, { compare, compareRuns, diffJson, diffText, isSame, runsJson, runsText }] = await Promise.all([import("./chunk-IAFM5ITE.js"), import("./chunk-TGSVSG2G.js"), import("./chunk-WUCRAV36.js")]);
507
516
  const ignore = options.ignore.map((pattern) => {
508
517
  try {
509
518
  return rustRegExp(pattern, "g");
@@ -546,9 +555,22 @@ async function runDiff(dirs, options) {
546
555
  return 2;
547
556
  }
548
557
  }
558
+ async function runPatrol(dir, shown, format) {
559
+ try {
560
+ checkFormat(format);
561
+ const { patrol, patrolJson, patrolText } = await import("./chunk-2FKYWYAB.js");
562
+ const report = patrol(dir);
563
+ process.stdout.write(format === "json" ? JSON.stringify(patrolJson(report, shown), null, 2) + "\n" : patrolText(report, shown));
564
+ return report.findings.length ? 1 : 0;
565
+ } catch (e) {
566
+ process.stderr.write(`${red("error:")} ${describeThrown(e, process.cwd())}
567
+ `);
568
+ return 2;
569
+ }
570
+ }
549
571
  async function runFootprint(dir, shown, top, format) {
550
572
  checkFormat(format);
551
- const { footprintJson, footprintText, measure } = await import("./chunk-JVT5ZRRH.js");
573
+ const { footprintJson, footprintText, measure } = await import("./chunk-OOKBXQAY.js");
552
574
  const measured = await measure(dir);
553
575
  if (format === "json") process.stdout.write(JSON.stringify(footprintJson(measured, shown, top), null, 2) + "\n");
554
576
  else process.stdout.write(footprintText(measured, shown, top));
@@ -572,7 +594,7 @@ async function buildJson(makeConfig, root, env) {
572
594
  const dirs = dirsOf(config);
573
595
  out.output = shownOutput(config);
574
596
  try {
575
- const report = await (await import("./chunk-AK7ZKSZP.js")).build(config);
597
+ const report = await (await import("./chunk-ZMG25MXF.js")).build(config);
576
598
  out.durationMs = ms(report.durationMs);
577
599
  out.pages = { written: report.pagesWritten, templates: report.templates, bytes: report.pageBytes, new: report.pagesNew ?? null, gone: report.pagesGone ?? null };
578
600
  out.copied = { files: report.filesCopied, unchanged: report.filesUnchanged, bytes: report.passthroughBytes };
package/lib/elements.js CHANGED
@@ -2,30 +2,30 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  Options
5
- } from "./chunk-MOLTDO5A.js";
5
+ } from "./chunk-SNQOHNXE.js";
6
6
  import {
7
7
  BUILTINS,
8
8
  debugString,
9
9
  rewriteHtml,
10
10
  withBase
11
- } from "./chunk-DOHOKUGB.js";
12
- import "./chunk-GWWA5Y3X.js";
11
+ } from "./chunk-VILOEVK7.js";
12
+ import "./chunk-ULCT3PAV.js";
13
13
  import {
14
14
  count
15
- } from "./chunk-EVFNYUTR.js";
15
+ } from "./chunk-6U5VIQVY.js";
16
16
  import "./chunk-AD3HAW3W.js";
17
17
  import "./chunk-YCOTX2VM.js";
18
18
  import "./chunk-DDV6JEC2.js";
19
- import "./chunk-RY3KLUQ3.js";
19
+ import "./chunk-6OUCRDYI.js";
20
+ import "./chunk-SPIFZBIW.js";
20
21
  import "./chunk-FVZ5JBRI.js";
21
- import "./chunk-Z3XH4KWX.js";
22
- import "./chunk-UU43WIZG.js";
23
- import "./chunk-57HLSKZS.js";
22
+ import "./chunk-FJML7INB.js";
23
+ import "./chunk-4AZFCSGJ.js";
24
24
  import "./chunk-CMUWRPSQ.js";
25
25
  import {
26
26
  bail,
27
27
  context
28
- } from "./chunk-R7PBREXL.js";
28
+ } from "./chunk-YNJNMQWU.js";
29
29
  import {
30
30
  compareText,
31
31
  displayPath,
@@ -0,0 +1,36 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ Options
5
+ } from "./chunk-SNQOHNXE.js";
6
+ import {
7
+ BUILTINS
8
+ } from "./chunk-VILOEVK7.js";
9
+ import "./chunk-ULCT3PAV.js";
10
+ import "./chunk-6U5VIQVY.js";
11
+ import "./chunk-AD3HAW3W.js";
12
+ import "./chunk-YCOTX2VM.js";
13
+ import "./chunk-DDV6JEC2.js";
14
+ import {
15
+ applyMarkdownOptions
16
+ } from "./chunk-6OUCRDYI.js";
17
+ import "./chunk-SPIFZBIW.js";
18
+ import "./chunk-FVZ5JBRI.js";
19
+ import "./chunk-FJML7INB.js";
20
+ import "./chunk-4AZFCSGJ.js";
21
+ import "./chunk-CMUWRPSQ.js";
22
+ import "./chunk-YNJNMQWU.js";
23
+ import "./chunk-VJWQSYEG.js";
24
+ import "./chunk-I3PS26CI.js";
25
+
26
+ // src/modules/from-hugo.ts
27
+ function fromHugo(options = {}) {
28
+ return { name: "fromHugo", builtin: "ssqch/from-hugo", options };
29
+ }
30
+ BUILTINS.set("ssqch/from-hugo", (config, given) => {
31
+ new Options(given, []);
32
+ if (!config.markdownGiven.has("shortcodes")) applyMarkdownOptions(config.markdown, { shortcodes: "hugo" }, "module");
33
+ });
34
+ export {
35
+ fromHugo
36
+ };
@@ -0,0 +1,41 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ Options
5
+ } from "./chunk-SNQOHNXE.js";
6
+ import {
7
+ BUILTINS
8
+ } from "./chunk-VILOEVK7.js";
9
+ import "./chunk-ULCT3PAV.js";
10
+ import "./chunk-6U5VIQVY.js";
11
+ import "./chunk-AD3HAW3W.js";
12
+ import "./chunk-YCOTX2VM.js";
13
+ import "./chunk-DDV6JEC2.js";
14
+ import {
15
+ applyMarkdownOptions
16
+ } from "./chunk-6OUCRDYI.js";
17
+ import "./chunk-SPIFZBIW.js";
18
+ import "./chunk-FVZ5JBRI.js";
19
+ import "./chunk-FJML7INB.js";
20
+ import "./chunk-4AZFCSGJ.js";
21
+ import "./chunk-CMUWRPSQ.js";
22
+ import "./chunk-YNJNMQWU.js";
23
+ import "./chunk-VJWQSYEG.js";
24
+ import "./chunk-I3PS26CI.js";
25
+
26
+ // src/modules/from-jekyll.ts
27
+ function fromJekyll(options = {}) {
28
+ return { name: "fromJekyll", builtin: "ssqch/from-jekyll", options };
29
+ }
30
+ var KRAMDOWN_DEFAULTS = { htmlMarkdown: "kramdown", headingIds: "kramdown", smartPunctuation: true, autolinks: false };
31
+ BUILTINS.set("ssqch/from-jekyll", (config, given) => {
32
+ const o = new Options(given, ["templates", "kramdown"]);
33
+ if (o.bool("kramdown") ?? true) {
34
+ const own = Object.fromEntries(Object.entries(KRAMDOWN_DEFAULTS).filter(([key]) => !config.markdownGiven.has(key)));
35
+ if (Object.keys(own).length) applyMarkdownOptions(config.markdown, own, "module");
36
+ }
37
+ if (o.bool("templates") ?? true) config.jekyllTemplates = true;
38
+ });
39
+ export {
40
+ fromJekyll
41
+ };
@@ -0,0 +1,49 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ Options
5
+ } from "./chunk-SNQOHNXE.js";
6
+ import {
7
+ BUILTINS,
8
+ addMkdocsTheme,
9
+ debugString
10
+ } from "./chunk-VILOEVK7.js";
11
+ import "./chunk-ULCT3PAV.js";
12
+ import "./chunk-6U5VIQVY.js";
13
+ import "./chunk-AD3HAW3W.js";
14
+ import "./chunk-YCOTX2VM.js";
15
+ import "./chunk-DDV6JEC2.js";
16
+ import {
17
+ applyMarkdownOptions
18
+ } from "./chunk-6OUCRDYI.js";
19
+ import "./chunk-SPIFZBIW.js";
20
+ import "./chunk-FVZ5JBRI.js";
21
+ import "./chunk-FJML7INB.js";
22
+ import "./chunk-4AZFCSGJ.js";
23
+ import "./chunk-CMUWRPSQ.js";
24
+ import {
25
+ bail
26
+ } from "./chunk-YNJNMQWU.js";
27
+ import "./chunk-VJWQSYEG.js";
28
+ import "./chunk-I3PS26CI.js";
29
+
30
+ // src/modules/from-mkdocs.ts
31
+ function fromMkdocs(options = {}) {
32
+ return { name: "fromMkdocs", builtin: "ssqch/from-mkdocs", options };
33
+ }
34
+ var MKDOCS_DEFAULTS = { dialect: "python-markdown", admonitions: "mkdocs", tabs: "mkdocs", headingIds: "python-markdown", sourceLinks: "relative" };
35
+ function mkdocsTemplates(config, file) {
36
+ config.mkdocsTemplates = file;
37
+ addMkdocsTheme(config);
38
+ }
39
+ BUILTINS.set("ssqch/from-mkdocs", (config, given) => {
40
+ const o = new Options(given, ["config", "templates"]);
41
+ const file = o.string("config") ?? "mkdocs.yml";
42
+ if (file.trim() === "") bail(`config must be the path of an mkdocs.yml, like "docs/mkdocs.yml" (got ${debugString(file)})`);
43
+ const own = Object.fromEntries(Object.entries(MKDOCS_DEFAULTS).filter(([key]) => !config.markdownGiven.has(key)));
44
+ if (Object.keys(own).length) applyMarkdownOptions(config.markdown, own, "module");
45
+ if (o.bool("templates")) mkdocsTemplates(config, file);
46
+ });
47
+ export {
48
+ fromMkdocs
49
+ };
@@ -0,0 +1,49 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ Options
5
+ } from "./chunk-SNQOHNXE.js";
6
+ import {
7
+ BUILTINS
8
+ } from "./chunk-VILOEVK7.js";
9
+ import "./chunk-ULCT3PAV.js";
10
+ import "./chunk-6U5VIQVY.js";
11
+ import "./chunk-AD3HAW3W.js";
12
+ import "./chunk-YCOTX2VM.js";
13
+ import "./chunk-DDV6JEC2.js";
14
+ import {
15
+ VITEPRESS_HOOKS,
16
+ addMarkdownSteps,
17
+ applyMarkdownOptions,
18
+ vitepressAfter,
19
+ vitepressBefore
20
+ } from "./chunk-6OUCRDYI.js";
21
+ import "./chunk-SPIFZBIW.js";
22
+ import "./chunk-FVZ5JBRI.js";
23
+ import "./chunk-FJML7INB.js";
24
+ import "./chunk-4AZFCSGJ.js";
25
+ import "./chunk-CMUWRPSQ.js";
26
+ import "./chunk-YNJNMQWU.js";
27
+ import "./chunk-VJWQSYEG.js";
28
+ import "./chunk-I3PS26CI.js";
29
+
30
+ // src/modules/from-vitepress.ts
31
+ function vitepressMarkdown() {
32
+ const hooks = {};
33
+ for (const [name, hook] of Object.entries(VITEPRESS_HOOKS)) hooks[name] = (value, context) => hook(value, { htmlUrls: context.urls === "html" });
34
+ return { before: vitepressBefore, after: vitepressAfter, hooks };
35
+ }
36
+ var VITEPRESS_DEFAULTS = { headingIds: "vitepress", autolinks: "email" };
37
+ function fromVitepress(options = {}) {
38
+ return { name: "fromVitepress", builtin: "ssqch/from-vitepress", options };
39
+ }
40
+ BUILTINS.set("ssqch/from-vitepress", (config, given) => {
41
+ new Options(given, []);
42
+ addMarkdownSteps(config.markdown.steps, 'plugin "fromVitepress"', vitepressMarkdown());
43
+ const own = Object.fromEntries(Object.entries(VITEPRESS_DEFAULTS).filter(([key]) => !config.markdownGiven.has(key)));
44
+ if (Object.keys(own).length) applyMarkdownOptions(config.markdown, own, "module");
45
+ config.vitepress = true;
46
+ });
47
+ export {
48
+ fromVitepress
49
+ };
package/lib/image.js CHANGED
@@ -4,21 +4,21 @@ import {
4
4
  image,
5
5
  imagePlugin,
6
6
  imageUrl
7
- } from "./chunk-ULQHJ4TS.js";
8
- import "./chunk-MOLTDO5A.js";
9
- import "./chunk-DOHOKUGB.js";
10
- import "./chunk-GWWA5Y3X.js";
11
- import "./chunk-EVFNYUTR.js";
7
+ } from "./chunk-55WXDGO4.js";
8
+ import "./chunk-SNQOHNXE.js";
9
+ import "./chunk-VILOEVK7.js";
10
+ import "./chunk-ULCT3PAV.js";
11
+ import "./chunk-6U5VIQVY.js";
12
12
  import "./chunk-AD3HAW3W.js";
13
13
  import "./chunk-YCOTX2VM.js";
14
14
  import "./chunk-DDV6JEC2.js";
15
- import "./chunk-RY3KLUQ3.js";
15
+ import "./chunk-6OUCRDYI.js";
16
+ import "./chunk-SPIFZBIW.js";
16
17
  import "./chunk-FVZ5JBRI.js";
17
- import "./chunk-Z3XH4KWX.js";
18
- import "./chunk-UU43WIZG.js";
19
- import "./chunk-57HLSKZS.js";
18
+ import "./chunk-FJML7INB.js";
19
+ import "./chunk-4AZFCSGJ.js";
20
20
  import "./chunk-CMUWRPSQ.js";
21
- import "./chunk-R7PBREXL.js";
21
+ import "./chunk-YNJNMQWU.js";
22
22
  import "./chunk-VJWQSYEG.js";
23
23
  import "./chunk-I3PS26CI.js";
24
24
  export {
package/lib/links.js CHANGED
@@ -2,30 +2,30 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  Options
5
- } from "./chunk-MOLTDO5A.js";
5
+ } from "./chunk-SNQOHNXE.js";
6
6
  import {
7
7
  BUILTINS,
8
8
  rewriteHtml
9
- } from "./chunk-DOHOKUGB.js";
10
- import "./chunk-GWWA5Y3X.js";
9
+ } from "./chunk-VILOEVK7.js";
10
+ import "./chunk-ULCT3PAV.js";
11
11
  import {
12
12
  count
13
- } from "./chunk-EVFNYUTR.js";
13
+ } from "./chunk-6U5VIQVY.js";
14
14
  import "./chunk-AD3HAW3W.js";
15
15
  import "./chunk-YCOTX2VM.js";
16
16
  import {
17
17
  dirsOf
18
18
  } from "./chunk-DDV6JEC2.js";
19
- import "./chunk-RY3KLUQ3.js";
19
+ import "./chunk-6OUCRDYI.js";
20
+ import "./chunk-SPIFZBIW.js";
20
21
  import {
21
22
  closest,
22
23
  closestPathFinder
23
24
  } from "./chunk-FVZ5JBRI.js";
24
- import "./chunk-Z3XH4KWX.js";
25
25
  import {
26
26
  TRAIL_GOES_COLD
27
- } from "./chunk-UU43WIZG.js";
28
- import "./chunk-57HLSKZS.js";
27
+ } from "./chunk-FJML7INB.js";
28
+ import "./chunk-4AZFCSGJ.js";
29
29
  import "./chunk-CMUWRPSQ.js";
30
30
  import {
31
31
  Diagnostics,
@@ -34,7 +34,7 @@ import {
34
34
  isCapturing,
35
35
  warn,
36
36
  warning
37
- } from "./chunk-R7PBREXL.js";
37
+ } from "./chunk-YNJNMQWU.js";
38
38
  import {
39
39
  compareText
40
40
  } from "./chunk-VJWQSYEG.js";