ssqch 0.11.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 (138) hide show
  1. package/bundled/completions/bash +67 -9
  2. package/bundled/completions/elvish +24 -4
  3. package/bundled/completions/fish +37 -25
  4. package/bundled/completions/powershell +26 -4
  5. package/bundled/completions/zsh +45 -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 +7 -4
  9. package/bundled/docs/configuring.md +7 -12
  10. package/bundled/docs/deploying.md +1 -1
  11. package/bundled/docs/field-guide.md +4 -4
  12. package/bundled/docs/github-pages.md +2 -1
  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 +11 -13
  17. package/bundled/docs/nav.yml +6 -1
  18. package/bundled/docs/netlify.md +4 -2
  19. package/bundled/docs/patrol.md +48 -0
  20. package/bundled/docs/plugins.md +6 -4
  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 +2 -1
  25. package/bundled/docs/templates.md +2 -1
  26. package/bundled/docs/trailheads/from-component-frameworks.md +9 -10
  27. package/bundled/docs/trailheads/from-hugo.md +5 -3
  28. package/bundled/docs/trailheads/from-jekyll.md +54 -13
  29. package/bundled/docs/trailheads/from-mkdocs.md +15 -12
  30. package/bundled/docs/trailheads/from-vitepress.md +142 -0
  31. package/bundled/docs/trailheads.md +5 -5
  32. package/bundled/docs/where-values-come-from.md +5 -5
  33. package/bundled/docs/writing-plugins.md +69 -0
  34. package/bundled/ssqch.d.ts +150 -34
  35. package/bundled/starter/engines/index.edge +1 -0
  36. package/bundled/starter/engines/index.ejs +1 -0
  37. package/bundled/starter/engines/index.hbs +1 -0
  38. package/bundled/starter/engines/index.liquid +1 -0
  39. package/bundled/starter/engines/layout.edge +7 -0
  40. package/bundled/starter/engines/layout.ejs +4 -0
  41. package/bundled/starter/engines/layout.hbs +4 -0
  42. package/bundled/starter/engines/layout.liquid +4 -0
  43. package/bundled/starter/src/_data/site.json +1 -0
  44. package/bundled/starter/src/_includes/layout.jinja +4 -0
  45. package/bundled/starter/src/index.jinja +1 -0
  46. package/bundled/starter/ssqch.config.js +14 -1
  47. package/bundled/starter-docs/engines/edge/base.edge +7 -0
  48. package/bundled/starter-docs/engines/edge/doc.edge +4 -0
  49. package/bundled/starter-docs/engines/ejs/base.ejs +4 -0
  50. package/bundled/starter-docs/engines/ejs/doc.ejs +4 -0
  51. package/bundled/starter-docs/engines/hbs/base.hbs +4 -0
  52. package/bundled/starter-docs/engines/hbs/doc.hbs +3 -0
  53. package/bundled/starter-docs/engines/liquid/base.liquid +4 -0
  54. package/bundled/starter-docs/engines/liquid/doc.liquid +4 -0
  55. package/bundled/starter-docs/src/_data/site.json +1 -0
  56. package/bundled/starter-docs/src/_includes/base.jinja +4 -0
  57. package/bundled/starter-docs/src/_includes/doc.jinja +4 -0
  58. package/bundled/starter-docs/src/assets/docs.css +4 -0
  59. package/bundled/starter-docs/src/assets/docs.js +17 -0
  60. package/bundled/starter-docs/ssqch.config.js +14 -1
  61. package/lib/assets.js +13 -11
  62. package/lib/chunk-25WERNDD.js +112 -0
  63. package/lib/{chunk-H5K2ZE7B.js → chunk-2BJFGKOE.js} +13 -5
  64. package/lib/chunk-2FKYWYAB.js +268 -0
  65. package/lib/{chunk-LJOURBYT.js → chunk-3ZTRIO6O.js} +21 -19
  66. package/lib/{chunk-IOBC665M.js → chunk-4AZFCSGJ.js} +5 -3
  67. package/lib/{chunk-HWW5NCVJ.js → chunk-4Q6WMTER.js} +1 -1
  68. package/lib/{chunk-V2FSMOFX.js → chunk-55WXDGO4.js} +3 -3
  69. package/lib/{chunk-ZR3JYLFB.js → chunk-6FY77I4M.js} +331 -58
  70. package/lib/{chunk-JC54PHIT.js → chunk-6OUCRDYI.js} +514 -141
  71. package/lib/{chunk-ERAIEV3O.js → chunk-6U5VIQVY.js} +9 -7
  72. package/lib/{chunk-Z5OP43HU.js → chunk-7U5GWTEH.js} +455 -94
  73. package/lib/{chunk-CMJ7X5WW.js → chunk-AIJNG6MJ.js} +3 -2
  74. package/lib/{chunk-3K237XAX.js → chunk-C2Q7JKFI.js} +12 -10
  75. package/lib/{chunk-GS5B3CBW.js → chunk-DDV6JEC2.js} +1 -1
  76. package/lib/{chunk-A75EVUJX.js → chunk-DFJFHULZ.js} +47 -20
  77. package/lib/{chunk-KZZS4W2V.js → chunk-ENWDM2RW.js} +45 -42
  78. package/lib/{chunk-I3HYKEEW.js → chunk-ER72RPD6.js} +3 -3
  79. package/lib/chunk-F3JPNFCZ.js +23 -0
  80. package/lib/{chunk-B5E27PLU.js → chunk-FENJHLNM.js} +6 -3
  81. package/lib/{chunk-UU43WIZG.js → chunk-FJML7INB.js} +4 -2
  82. package/lib/{chunk-KCF2Z6N7.js → chunk-FQZDUDFK.js} +5 -3
  83. package/lib/{chunk-GJNIQAIH.js → chunk-GSNRAGKQ.js} +13 -6
  84. package/lib/{chunk-443ZQLVX.js → chunk-GU7BBYWB.js} +5 -4
  85. package/lib/{chunk-X2GAVYV2.js → chunk-HDKU6LRI.js} +110 -748
  86. package/lib/chunk-J3C2LEW7.js +121 -0
  87. package/lib/{chunk-XS4EJSEK.js → chunk-K5WZ2VYK.js} +7 -5
  88. package/lib/{chunk-3HZZY3Y7.js → chunk-OOKBXQAY.js} +7 -6
  89. package/lib/chunk-P2WS4RM4.js +707 -0
  90. package/lib/{chunk-RBNPBTDP.js → chunk-SNQOHNXE.js} +1 -1
  91. package/lib/{chunk-HFSWUTXX.js → chunk-SPIFZBIW.js} +1 -1
  92. package/lib/{chunk-QLUTNR37.js → chunk-T5IUI7W7.js} +12 -11
  93. package/lib/{chunk-ZINLHOX4.js → chunk-TGSVSG2G.js} +3 -2
  94. package/lib/{chunk-2L3HR67O.js → chunk-U2KEMVXO.js} +24 -16
  95. package/lib/{chunk-RYIWYWRQ.js → chunk-UHRBPZ4A.js} +7 -5
  96. package/lib/{chunk-2QTJTEBV.js → chunk-ULCT3PAV.js} +1 -1
  97. package/lib/{chunk-FCM3NYFR.js → chunk-UZNUS7RP.js} +12 -9
  98. package/lib/{chunk-GLJQ4C76.js → chunk-V3G2QGL3.js} +13 -106
  99. package/lib/{chunk-Z44IAMNG.js → chunk-VILOEVK7.js} +60 -28
  100. package/lib/chunk-VJWQSYEG.js +119 -0
  101. package/lib/{chunk-5ELAUHRL.js → chunk-WGAIE3DD.js} +23 -19
  102. package/lib/{chunk-OQGXZYZS.js → chunk-WUCRAV36.js} +13 -7
  103. package/lib/{chunk-RZYAIX2R.js → chunk-XYAWJTHM.js} +11 -10
  104. package/lib/{chunk-OSBEH67S.js → chunk-YA23NDMW.js} +5 -3
  105. package/lib/{chunk-AIMEXBTK.js → chunk-YNJNMQWU.js} +37 -142
  106. package/lib/{chunk-QJ5ZFTML.js → chunk-ZMG25MXF.js} +20 -18
  107. package/lib/cli.js +72 -35
  108. package/lib/elements.js +13 -11
  109. package/lib/from-hugo.js +36 -0
  110. package/lib/from-jekyll.js +41 -0
  111. package/lib/from-mkdocs.js +49 -0
  112. package/lib/from-vitepress.js +49 -0
  113. package/lib/image.js +12 -11
  114. package/lib/links.js +13 -11
  115. package/lib/llms.js +613 -0
  116. package/lib/minify.js +14 -12
  117. package/lib/redirects.js +13 -11
  118. package/lib/robots.js +87 -0
  119. package/lib/rss.js +24 -13
  120. package/lib/sass.js +12 -11
  121. package/lib/sitemap.js +23 -18
  122. package/lib/ssqch.js +6 -5
  123. package/lib/vue.js +400 -0
  124. package/package.json +29 -1
  125. package/types/from-hugo.d.ts +5 -0
  126. package/types/from-jekyll.d.ts +11 -0
  127. package/types/from-mkdocs.d.ts +11 -0
  128. package/types/from-vitepress.d.ts +5 -0
  129. package/types/index.d.ts +51 -31
  130. package/types/llms.d.ts +27 -0
  131. package/types/robots.d.ts +13 -0
  132. package/types/sass.d.ts +1 -1
  133. package/types/sitemap.d.ts +2 -2
  134. package/types/vue.d.ts +17 -0
  135. package/wasm/markdown.wasm +0 -0
  136. package/lib/chunk-RVXGUMFI.js +0 -21
  137. /package/lib/{chunk-ZR3JYLFB.js.LEGAL.txt → chunk-6FY77I4M.js.LEGAL.txt} +0 -0
  138. /package/lib/{chunk-AIMEXBTK.js.LEGAL.txt → chunk-YNJNMQWU.js.LEGAL.txt} +0 -0
@@ -0,0 +1,119 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+
4
+ // src/paths.ts
5
+ import fs from "node:fs";
6
+ import path from "node:path";
7
+ var slashes = (p) => path.sep === "/" ? p : p.split(path.sep).join("/");
8
+ function displayPath(root, file) {
9
+ if (file === root) return "./";
10
+ return file.startsWith(root + path.sep) ? `./${slashes(file.slice(root.length + 1))}` : file;
11
+ }
12
+ var shown = (root, file) => displayPath(root, file).replace(/^\.\//, "");
13
+ var relative = (dir, file) => slashes(path.relative(dir, file));
14
+ var joinAsGiven = (base, rel) => path.isAbsolute(rel) || base === "" ? rel : /[\\/]$/.test(base) ? base + rel : base + path.sep + rel;
15
+ function parentAsGiven(p) {
16
+ const separators = path.sep === "/" ? "/" : "\\/";
17
+ let end = p.length;
18
+ while (end > 1 && separators.includes(p[end - 1])) end--;
19
+ let at = end - 1;
20
+ while (at >= 0 && !separators.includes(p[at])) at--;
21
+ if (at < 0) return "";
22
+ let parent = at;
23
+ while (parent > 0 && separators.includes(p[parent - 1])) parent--;
24
+ return parent === 0 ? p.slice(0, 1) : p.slice(0, parent);
25
+ }
26
+ var realPath = (p) => {
27
+ try {
28
+ return fs.realpathSync.native(p);
29
+ } catch {
30
+ return p;
31
+ }
32
+ };
33
+ var isFile = (p) => fs.statSync(p, { throwIfNoEntry: false })?.isFile() ?? false;
34
+ var isDir = (p) => fs.statSync(p, { throwIfNoEntry: false })?.isDirectory() ?? false;
35
+ var isInside = (dir, file) => file === dir || file.startsWith(dir.endsWith(path.sep) ? dir : dir + path.sep);
36
+ function compareText(a, b) {
37
+ const n = Math.min(a.length, b.length);
38
+ for (let i = 0; i < n; i++) {
39
+ let x = a.charCodeAt(i), y = b.charCodeAt(i);
40
+ if (x === y) continue;
41
+ if (x >= 55296 && y >= 55296) {
42
+ x = x >= 57344 ? x - 2048 : x + 8192;
43
+ y = y >= 57344 ? y - 2048 : y + 8192;
44
+ }
45
+ return x - y;
46
+ }
47
+ return a.length - b.length;
48
+ }
49
+ function comparePaths(a, b) {
50
+ if (a === b) return 0;
51
+ const x = a.split(path.sep), y = b.split(path.sep);
52
+ const n = Math.min(x.length, y.length);
53
+ for (let i = 0; i < n; i++) {
54
+ if (x[i] === y[i]) continue;
55
+ return compareText(x[i], y[i]);
56
+ }
57
+ return x.length - y.length;
58
+ }
59
+ function walkFiles(dir) {
60
+ const out = [];
61
+ const walk = (d) => {
62
+ let entries;
63
+ try {
64
+ entries = fs.readdirSync(d, { withFileTypes: true });
65
+ } catch {
66
+ return;
67
+ }
68
+ for (const entry of entries) {
69
+ const p = path.join(d, entry.name);
70
+ if (entry.isDirectory()) walk(p);
71
+ else if (entry.isFile()) out.push(p);
72
+ }
73
+ };
74
+ walk(dir);
75
+ return out;
76
+ }
77
+ function readFollowing(dir, above, onError) {
78
+ const out = [];
79
+ const here = above[above.length - 1] ?? realPath(dir);
80
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
81
+ const file = path.join(dir, entry.name);
82
+ if (!entry.isSymbolicLink()) {
83
+ out.push({ name: entry.name, path: file, isDirectory: entry.isDirectory(), isFile: entry.isFile(), real: path.join(here, entry.name) });
84
+ continue;
85
+ }
86
+ const stat = fs.statSync(file, { throwIfNoEntry: false });
87
+ if (!stat) {
88
+ onError({ path: file, broken: true });
89
+ continue;
90
+ }
91
+ const real = realPath(file);
92
+ if (stat.isDirectory()) {
93
+ const at = above.indexOf(real);
94
+ if (at !== -1) {
95
+ onError({ path: file, loop: above[at] });
96
+ continue;
97
+ }
98
+ }
99
+ out.push({ name: entry.name, path: file, isDirectory: stat.isDirectory(), isFile: stat.isFile(), real });
100
+ }
101
+ return out;
102
+ }
103
+
104
+ export {
105
+ slashes,
106
+ displayPath,
107
+ shown,
108
+ relative,
109
+ joinAsGiven,
110
+ parentAsGiven,
111
+ realPath,
112
+ isFile,
113
+ isDir,
114
+ isInside,
115
+ compareText,
116
+ comparePaths,
117
+ walkFiles,
118
+ readFollowing
119
+ };
@@ -2,38 +2,39 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  isAsset
5
- } from "./chunk-KCF2Z6N7.js";
5
+ } from "./chunk-FQZDUDFK.js";
6
6
  import {
7
7
  build
8
- } from "./chunk-ZR3JYLFB.js";
9
- import "./chunk-OSBEH67S.js";
10
- import "./chunk-HWW5NCVJ.js";
11
- import "./chunk-GLJQ4C76.js";
12
- import "./chunk-RYIWYWRQ.js";
8
+ } from "./chunk-6FY77I4M.js";
9
+ import "./chunk-YA23NDMW.js";
10
+ import "./chunk-V3G2QGL3.js";
11
+ import "./chunk-4Q6WMTER.js";
12
+ import "./chunk-UHRBPZ4A.js";
13
+ import "./chunk-25WERNDD.js";
13
14
  import {
14
15
  fileHash
15
- } from "./chunk-I3HYKEEW.js";
16
+ } from "./chunk-ER72RPD6.js";
16
17
  import {
17
18
  filesRead
18
19
  } from "./chunk-3NYSSA2C.js";
19
- import "./chunk-Z44IAMNG.js";
20
- import "./chunk-2QTJTEBV.js";
20
+ import "./chunk-VILOEVK7.js";
21
+ import "./chunk-ULCT3PAV.js";
21
22
  import {
22
23
  summary
23
- } from "./chunk-ERAIEV3O.js";
24
+ } from "./chunk-6U5VIQVY.js";
24
25
  import "./chunk-AD3HAW3W.js";
25
26
  import "./chunk-YCOTX2VM.js";
26
27
  import {
27
28
  dirsOf
28
- } from "./chunk-GS5B3CBW.js";
29
- import "./chunk-JC54PHIT.js";
30
- import "./chunk-HFSWUTXX.js";
29
+ } from "./chunk-DDV6JEC2.js";
30
+ import "./chunk-6OUCRDYI.js";
31
+ import "./chunk-SPIFZBIW.js";
31
32
  import "./chunk-FVZ5JBRI.js";
32
- import "./chunk-UU43WIZG.js";
33
+ import "./chunk-FJML7INB.js";
33
34
  import {
34
35
  describeThrown,
35
36
  loadedFiles
36
- } from "./chunk-IOBC665M.js";
37
+ } from "./chunk-4AZFCSGJ.js";
37
38
  import "./chunk-CMUWRPSQ.js";
38
39
  import {
39
40
  BuildError,
@@ -42,14 +43,16 @@ import {
42
43
  aliasesKnown,
43
44
  aliasesUsed,
44
45
  describe,
45
- isInside,
46
46
  messageOf,
47
47
  printError,
48
+ red
49
+ } from "./chunk-YNJNMQWU.js";
50
+ import {
51
+ isInside,
48
52
  realPath,
49
- red,
50
53
  relative,
51
54
  slashes
52
- } from "./chunk-AIMEXBTK.js";
55
+ } from "./chunk-VJWQSYEG.js";
53
56
  import "./chunk-I3PS26CI.js";
54
57
 
55
58
  // src/serve/build-process.ts
@@ -139,7 +142,8 @@ async function runBuilder(start, makeConfig, root) {
139
142
  wake = resolve;
140
143
  });
141
144
  wake = void 0;
142
- const { recovered } = asked.shift();
145
+ const { recovered, changed } = asked.shift();
146
+ config.changed = changed;
143
147
  let result;
144
148
  try {
145
149
  const report = await working(() => build(config));
@@ -3,6 +3,7 @@ const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  canonicalTag,
5
5
  canonicalText,
6
+ canonicalUrl,
6
7
  compare,
7
8
  compareRuns,
8
9
  diffJson,
@@ -11,24 +12,28 @@ import {
11
12
  isHashedImage,
12
13
  isSame,
13
14
  keyed,
15
+ knownChange,
14
16
  runsJson,
15
17
  runsText,
16
18
  tokens,
17
19
  withoutFingerprints,
18
20
  withoutImageIds
19
- } from "./chunk-X2GAVYV2.js";
20
- import "./chunk-RYIWYWRQ.js";
21
- import "./chunk-2QTJTEBV.js";
22
- import "./chunk-ERAIEV3O.js";
23
- import "./chunk-GS5B3CBW.js";
21
+ } from "./chunk-HDKU6LRI.js";
22
+ import "./chunk-P2WS4RM4.js";
23
+ import "./chunk-UHRBPZ4A.js";
24
+ import "./chunk-ULCT3PAV.js";
25
+ import "./chunk-6U5VIQVY.js";
26
+ import "./chunk-DDV6JEC2.js";
24
27
  import "./chunk-FVZ5JBRI.js";
25
- import "./chunk-UU43WIZG.js";
28
+ import "./chunk-FJML7INB.js";
26
29
  import "./chunk-CMUWRPSQ.js";
27
- import "./chunk-AIMEXBTK.js";
30
+ import "./chunk-YNJNMQWU.js";
31
+ import "./chunk-VJWQSYEG.js";
28
32
  import "./chunk-I3PS26CI.js";
29
33
  export {
30
34
  canonicalTag,
31
35
  canonicalText,
36
+ canonicalUrl,
32
37
  compare,
33
38
  compareRuns,
34
39
  diffJson,
@@ -37,6 +42,7 @@ export {
37
42
  isHashedImage,
38
43
  isSame,
39
44
  keyed,
45
+ knownChange,
40
46
  runsJson,
41
47
  runsText,
42
48
  tokens,
@@ -2,28 +2,29 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  write
5
- } from "./chunk-B5E27PLU.js";
5
+ } from "./chunk-FENJHLNM.js";
6
6
  import {
7
7
  loadConfig,
8
8
  schemaTypes
9
- } from "./chunk-Z44IAMNG.js";
10
- import "./chunk-2QTJTEBV.js";
11
- import "./chunk-ERAIEV3O.js";
9
+ } from "./chunk-VILOEVK7.js";
10
+ import "./chunk-ULCT3PAV.js";
11
+ import "./chunk-6U5VIQVY.js";
12
12
  import "./chunk-AD3HAW3W.js";
13
13
  import {
14
14
  types
15
15
  } from "./chunk-YCOTX2VM.js";
16
- import "./chunk-GS5B3CBW.js";
17
- import "./chunk-JC54PHIT.js";
18
- import "./chunk-HFSWUTXX.js";
16
+ import "./chunk-DDV6JEC2.js";
17
+ import "./chunk-6OUCRDYI.js";
18
+ import "./chunk-SPIFZBIW.js";
19
19
  import "./chunk-FVZ5JBRI.js";
20
- import "./chunk-UU43WIZG.js";
21
- import "./chunk-IOBC665M.js";
20
+ import "./chunk-FJML7INB.js";
21
+ import "./chunk-4AZFCSGJ.js";
22
22
  import "./chunk-CMUWRPSQ.js";
23
23
  import {
24
24
  messageOf,
25
25
  red
26
- } from "./chunk-AIMEXBTK.js";
26
+ } from "./chunk-YNJNMQWU.js";
27
+ import "./chunk-VJWQSYEG.js";
27
28
  import "./chunk-I3PS26CI.js";
28
29
 
29
30
  // src/commands/types.ts
@@ -3,15 +3,17 @@ const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  require_nunjucks,
5
5
  safe
6
- } from "./chunk-JC54PHIT.js";
6
+ } from "./chunk-6OUCRDYI.js";
7
7
  import {
8
8
  BuildError,
9
- compareText,
10
9
  isPlainObject,
11
10
  parseYaml,
12
11
  sourceDateEpoch,
13
12
  toDate
14
- } from "./chunk-AIMEXBTK.js";
13
+ } from "./chunk-YNJNMQWU.js";
14
+ import {
15
+ compareText
16
+ } from "./chunk-VJWQSYEG.js";
15
17
  import {
16
18
  __commonJS,
17
19
  __require,
@@ -1,105 +1,8 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
-
4
- // src/paths.ts
5
- import fs from "node:fs";
6
- import path from "node:path";
7
- var slashes = (p) => path.sep === "/" ? p : p.split(path.sep).join("/");
8
- function displayPath(root, file) {
9
- if (file === root) return "./";
10
- return file.startsWith(root + path.sep) ? `./${slashes(file.slice(root.length + 1))}` : file;
11
- }
12
- var shown = (root, file) => displayPath(root, file).replace(/^\.\//, "");
13
- var relative = (dir, file) => slashes(path.relative(dir, file));
14
- var joinAsGiven = (base, rel) => path.isAbsolute(rel) || base === "" ? rel : /[\\/]$/.test(base) ? base + rel : base + path.sep + rel;
15
- function parentAsGiven(p) {
16
- const separators = path.sep === "/" ? "/" : "\\/";
17
- let end = p.length;
18
- while (end > 1 && separators.includes(p[end - 1])) end--;
19
- let at = end - 1;
20
- while (at >= 0 && !separators.includes(p[at])) at--;
21
- if (at < 0) return "";
22
- let parent = at;
23
- while (parent > 0 && separators.includes(p[parent - 1])) parent--;
24
- return parent === 0 ? p.slice(0, 1) : p.slice(0, parent);
25
- }
26
- var realPath = (p) => {
27
- try {
28
- return fs.realpathSync.native(p);
29
- } catch {
30
- return p;
31
- }
32
- };
33
- var isFile = (p) => fs.statSync(p, { throwIfNoEntry: false })?.isFile() ?? false;
34
- var isDir = (p) => fs.statSync(p, { throwIfNoEntry: false })?.isDirectory() ?? false;
35
- var isInside = (dir, file) => file === dir || file.startsWith(dir.endsWith(path.sep) ? dir : dir + path.sep);
36
- function compareText(a, b) {
37
- const n = Math.min(a.length, b.length);
38
- for (let i2 = 0; i2 < n; i2++) {
39
- let x = a.charCodeAt(i2), y = b.charCodeAt(i2);
40
- if (x === y) continue;
41
- if (x >= 55296 && y >= 55296) {
42
- x = x >= 57344 ? x - 2048 : x + 8192;
43
- y = y >= 57344 ? y - 2048 : y + 8192;
44
- }
45
- return x - y;
46
- }
47
- return a.length - b.length;
48
- }
49
- function comparePaths(a, b) {
50
- if (a === b) return 0;
51
- const x = a.split(path.sep), y = b.split(path.sep);
52
- const n = Math.min(x.length, y.length);
53
- for (let i2 = 0; i2 < n; i2++) {
54
- if (x[i2] === y[i2]) continue;
55
- return compareText(x[i2], y[i2]);
56
- }
57
- return x.length - y.length;
58
- }
59
- function walkFiles(dir) {
60
- const out = [];
61
- const walk = (d) => {
62
- let entries;
63
- try {
64
- entries = fs.readdirSync(d, { withFileTypes: true });
65
- } catch {
66
- return;
67
- }
68
- for (const entry of entries) {
69
- const p = path.join(d, entry.name);
70
- if (entry.isDirectory()) walk(p);
71
- else if (entry.isFile()) out.push(p);
72
- }
73
- };
74
- walk(dir);
75
- return out;
76
- }
77
- function readFollowing(dir, above, onError) {
78
- const out = [];
79
- const here = above[above.length - 1] ?? realPath(dir);
80
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
81
- const file = path.join(dir, entry.name);
82
- if (!entry.isSymbolicLink()) {
83
- out.push({ name: entry.name, path: file, isDirectory: entry.isDirectory(), isFile: entry.isFile(), real: path.join(here, entry.name) });
84
- continue;
85
- }
86
- const stat = fs.statSync(file, { throwIfNoEntry: false });
87
- if (!stat) {
88
- onError({ path: file, broken: true });
89
- continue;
90
- }
91
- const real = realPath(file);
92
- if (stat.isDirectory()) {
93
- const at = above.indexOf(real);
94
- if (at !== -1) {
95
- onError({ path: file, loop: above[at] });
96
- continue;
97
- }
98
- }
99
- out.push({ name: entry.name, path: file, isDirectory: stat.isDirectory(), isFile: stat.isFile(), real });
100
- }
101
- return out;
102
- }
3
+ import {
4
+ realPath
5
+ } from "./chunk-VJWQSYEG.js";
103
6
 
104
7
  // node_modules/js-yaml/dist/js-yaml.mjs
105
8
  function isNothing(subject) {
@@ -3484,16 +3387,16 @@ function parse(toml, options = {}) {
3484
3387
  var HAS_WELLFORMED = !!"".isWellFormed;
3485
3388
 
3486
3389
  // src/data.ts
3487
- import fs4 from "node:fs";
3488
- import path4 from "node:path";
3489
-
3490
- // src/diagnostics.ts
3491
3390
  import fs3 from "node:fs";
3492
3391
  import path3 from "node:path";
3493
3392
 
3494
- // src/equivalents.ts
3393
+ // src/diagnostics.ts
3495
3394
  import fs2 from "node:fs";
3496
3395
  import path2 from "node:path";
3396
+
3397
+ // src/equivalents.ts
3398
+ import fs from "node:fs";
3399
+ import path from "node:path";
3497
3400
  var SERVE = "ssqch's dev server is `ssqch serve`: it builds, watches and reloads the browser.";
3498
3401
  var TABLE = [
3499
3402
  // Commands.
@@ -3502,7 +3405,9 @@ var TABLE = [
3502
3405
  { word: "server", kind: "command", alias: true, from: ["Hugo", "Hexo", "Jekyll"], ssqch: "serve", say: SERVE, more: "ssqch docs serve" },
3503
3406
  { word: "preview", kind: "command", alias: true, from: ["Astro", "VitePress"], ssqch: "serve --built", say: "Serving a production build as it is, without building or reloading, is `ssqch serve --built`.", more: "ssqch docs serve" },
3504
3407
  { word: "watch", kind: "command", alias: true, from: [], ssqch: "serve", say: SERVE, more: "ssqch docs serve" },
3505
- { word: "check", kind: "command", alias: false, from: ["Zola", "Astro"], ssqch: "build", say: "`ssqch build` checks as it builds: content schemas on every build, and internal links with `linksPlugin()`.", more: 'ssqch docs "Content schemas"' },
3408
+ // ssqch's own old name (0.12 and before): a rename replaces it, so it's refused with the new one.
3409
+ { word: "inspect", kind: "command", alias: false, from: [], ssqch: "trace", say: "`ssqch inspect` is `ssqch trace` now, with the same options and JSON: it follows a page's values back through the data cascade.", more: "ssqch trace --help" },
3410
+ { word: "check", kind: "command", alias: false, from: ["Zola", "Astro"], ssqch: "build", say: "`ssqch build` checks as it builds: content schemas on every build, and internal links with `linksPlugin()`. `ssqch patrol` checks a build for what agents and crawlers read.", more: 'ssqch docs "Content schemas"' },
3506
3411
  { word: "clean", kind: "command", alias: false, from: ["Hexo", "Jekyll", "Gatsby"], ssqch: "leaveNoTrace", say: "ssqch has no clean command: `leaveNoTrace: true` in the config deletes what an earlier build wrote and this one didn't.", more: "ssqch docs leaveNoTrace" },
3507
3412
  { word: "generate", kind: "command", alias: true, from: ["Hexo"], ssqch: "build", say: "To build the site: `ssqch build`.", more: "ssqch docs build" },
3508
3413
  { word: "version", kind: "command", alias: false, from: ["Hugo"], ssqch: "--version", say: "The version is `ssqch --version`.", more: "ssqch --help" },
@@ -3530,9 +3435,12 @@ var TABLE = [
3530
3435
  { word: "integrations", kind: "config", alias: false, from: ["Astro"], ssqch: "plugins", say: "In ssqch it's `plugins`: plugins: [imagePlugin()].", more: "ssqch docs plugins" },
3531
3436
  { word: "markdownTemplateEngine", kind: "config", alias: true, from: ["Eleventy"], ssqch: "markdownEngine", say: 'In ssqch it\'s `markdownEngine`: markdownEngine: "njk" (or false).', more: "ssqch docs markdownEngine" },
3532
3437
  { word: "htmlTemplateEngine", kind: "config", alias: true, from: ["Eleventy"], ssqch: "htmlEngine", say: 'In ssqch it\'s `htmlEngine`: htmlEngine: "njk" (or false).', more: "ssqch docs htmlEngine" },
3438
+ { word: "uglyURLs", kind: "config", alias: false, from: ["Hugo"], ssqch: "urls", say: 'In ssqch it\'s `urls`: urls: "html" writes /guide/intro.html.', more: "ssqch docs urls" },
3439
+ { word: "cleanUrls", kind: "config", alias: false, from: ["VitePress"], ssqch: "urls", say: `ssqch's URLs are clean by default (urls: "folders", /guide/intro/); urls: "html" writes /guide/intro.html, as VitePress does without cleanUrls.`, more: "ssqch docs urls" },
3533
3440
  { word: "baseURL", kind: "config", alias: false, from: ["Hugo"], ssqch: "base", say: "ssqch's `base` is the path only (base: \"/repo/\"); the site's full URL goes in your data, for sitemapPlugin({ url }).", more: "ssqch docs base" },
3534
3441
  { word: "title", kind: "config", alias: false, from: ["Hugo", "Zola", "Jekyll"], ssqch: "data", say: "The site's title is data: put it in `_data/site.json` and use `site.title` in templates.", more: "ssqch docs data" },
3535
3442
  { word: "addPassthroughCopy", kind: "config", alias: false, from: ["Eleventy"], ssqch: "passthrough", say: 'In ssqch it\'s `passthrough`: passthrough: ["src/fonts", { "src/static": "static" }].', more: "ssqch docs passthrough" },
3443
+ { word: "clean", kind: "config", alias: false, from: [], ssqch: "leaveNoTrace", say: "ssqch calls it `leaveNoTrace`: leaveNoTrace: true deletes what an earlier build wrote and this one didn't.", more: "ssqch docs leaveNoTrace" },
3536
3444
  { word: "addFilter", kind: "config", alias: false, from: ["Eleventy"], ssqch: "filters", say: "In ssqch it's `filters`: filters: { shout: (s) => s.toUpperCase() }.", more: "ssqch docs filters" },
3537
3445
  { word: "addShortcode", kind: "config", alias: false, from: ["Eleventy"], ssqch: "filters", say: "A shortcode is a function in `filters`: filters: { year: () => String(new Date().getFullYear()) }.", more: "ssqch docs filters" },
3538
3446
  { word: "addCollection", kind: "config", alias: false, from: ["Eleventy"], ssqch: "collections", say: 'In ssqch it\'s `collections`: collections: { posts: (pages) => pages.byTag("post") }.', more: "ssqch docs collections" },
@@ -3554,6 +3462,8 @@ var TABLE = [
3554
3462
  { word: "getPreviousCollectionItem", kind: "filter", alias: true, from: ["Eleventy"], ssqch: "navPager", say: "`collection | getPreviousCollectionItem(page)` works: it's `navPager(collection, page.url).previous`, which gives `previous` and `next` at once.", more: "ssqch docs navPager" },
3555
3463
  { word: "getNextCollectionItem", kind: "filter", alias: true, from: ["Eleventy"], ssqch: "navPager", say: "`collection | getNextCollectionItem(page)` works: it's `navPager(collection, page.url).next`, which gives `previous` and `next` at once.", more: "ssqch docs navPager" },
3556
3464
  { word: "slug", kind: "filter", alias: false, from: ["Eleventy"], ssqch: "slugify", say: "ssqch's is `slugify`, which differs: Eleventy's `slug` (the `slugify` npm package) keeps `.` and some punctuation, so `Node.js` is `node.js` there and `node-js` in ssqch. To keep old URLs, define `slug` in `filters` with that package: slug: (s) => slugify(String(s), { lower: true }).", more: "ssqch docs slugify" },
3465
+ { word: "rssDate", kind: "filter", alias: true, from: ["Eleventy"], ssqch: "dateToRfc3339", say: "With `rssPlugin()` it's `dateToRfc3339`: {{ post.date | dateToRfc3339 }}.", more: "ssqch docs rssPlugin" },
3466
+ { word: "rssLastUpdatedDate", kind: "filter", alias: true, from: ["Eleventy"], ssqch: "getNewestCollectionItemDate", say: "With `rssPlugin()` it's `getNewestCollectionItemDate`, then `dateToRfc3339`: {{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}.", more: "ssqch docs rssPlugin" },
3557
3467
  { word: "absolute_url", kind: "filter", alias: false, from: ["Jekyll"], ssqch: "absoluteUrl", say: '`absoluteUrl(url, base)` comes with `rssPlugin()` from "ssqch/rss".', more: "ssqch docs absoluteUrl" },
3558
3468
  { word: "markdownify", kind: "filter", alias: true, from: ["Jekyll", "Hugo"], ssqch: "markdown", say: 'ssqch\'s function is `markdown(text)` (or `markdown(text, "inline")`).', more: "ssqch docs markdown" },
3559
3469
  { word: "jsonify", kind: "filter", alias: false, from: ["Jekyll"], ssqch: "dump", say: "`jsonify` works in Liquid templates; in Jinja it's `tojson`, and in Nunjucks `dump`.", more: 'ssqch docs "Jinja and Nunjucks"' },
@@ -3593,19 +3503,20 @@ var OTHER_CONFIGS = [
3593
3503
  ["astro.config.mjs", "Astro", null, "from-component-frameworks.md"],
3594
3504
  ["astro.config.ts", "Astro", null, "from-component-frameworks.md"],
3595
3505
  ["gatsby-config.js", "Gatsby", null, "from-component-frameworks.md"],
3596
- [".vitepress/config.mts", "VitePress", null, "from-component-frameworks.md"],
3597
- [".vitepress/config.js", "VitePress", null, "from-component-frameworks.md"]
3506
+ [".vitepress/config.ts", "VitePress", null, "from-vitepress.md"],
3507
+ [".vitepress/config.mts", "VitePress", null, "from-vitepress.md"],
3508
+ [".vitepress/config.js", "VitePress", null, "from-vitepress.md"]
3598
3509
  ];
3599
3510
  function otherGenerator(root) {
3600
- const isFile2 = (file2) => fs2.statSync(path2.join(root, file2), { throwIfNoEntry: false })?.isFile() ?? false;
3511
+ const isFile = (file2) => fs.statSync(path.join(root, file2), { throwIfNoEntry: false })?.isFile() ?? false;
3601
3512
  const read = (file2) => {
3602
3513
  try {
3603
- return fs2.readFileSync(path2.join(root, file2), "utf8");
3514
+ return fs.readFileSync(path.join(root, file2), "utf8");
3604
3515
  } catch {
3605
3516
  return void 0;
3606
3517
  }
3607
3518
  };
3608
- let found = OTHER_CONFIGS.find(([file2]) => isFile2(file2));
3519
+ let found = OTHER_CONFIGS.find(([file2]) => isFile(file2));
3609
3520
  if (!found) {
3610
3521
  const toml = read("config.toml");
3611
3522
  if (toml?.includes("base_url")) found = ["config.toml", "Zola", "zola", "from-zola.md"];
@@ -3726,20 +3637,20 @@ var Locator = class {
3726
3637
  name = name.replace(/^["'`]+|["'`]+$/g, "");
3727
3638
  if (name === "") return void 0;
3728
3639
  for (const dir of this.dirs) {
3729
- let file = path3.resolve(dir, name);
3730
- if (!fs3.statSync(file, { throwIfNoEntry: false })?.isFile()) continue;
3640
+ let file = path2.resolve(dir, name);
3641
+ if (!fs2.statSync(file, { throwIfNoEntry: false })?.isFile()) continue;
3731
3642
  file = realPath(file);
3732
- const rel = path3.relative(realPath(this.root), file);
3733
- const outside = rel === ".." || rel.startsWith(`..${path3.sep}`) || path3.isAbsolute(rel);
3734
- const shown2 = (outside ? file : rel).split(path3.sep).join("/");
3735
- return { path: file, shown: shown2 };
3643
+ const rel = path2.relative(realPath(this.root), file);
3644
+ const outside = rel === ".." || rel.startsWith(`..${path2.sep}`) || path2.isAbsolute(rel);
3645
+ const shown = (outside ? file : rel).split(path2.sep).join("/");
3646
+ return { path: file, shown };
3736
3647
  }
3737
3648
  return void 0;
3738
3649
  }
3739
3650
  };
3740
3651
  function linesBeforeBody(file) {
3741
3652
  try {
3742
- const src = fs3.readFileSync(file, "utf8");
3653
+ const src = fs2.readFileSync(file, "utf8");
3743
3654
  const { body } = parseFrontMatter(src);
3744
3655
  return src.slice(0, src.length - body.length).split("\n").length - 1;
3745
3656
  } catch {
@@ -3827,8 +3738,8 @@ function fileLines(message, at) {
3827
3738
  function frames(e, fallback, at) {
3828
3739
  const found = [];
3829
3740
  for (const problem of fromError(e, fallback, at)) {
3830
- const shown2 = frame(problem, at);
3831
- if (shown2 !== void 0 && !found.includes(shown2)) found.push(shown2);
3741
+ const shown = frame(problem, at);
3742
+ if (shown !== void 0 && !found.includes(shown)) found.push(shown);
3832
3743
  if (found.length === 3) break;
3833
3744
  }
3834
3745
  return found.length ? found.join("\n\n") : void 0;
@@ -3838,7 +3749,7 @@ function frame(problem, at) {
3838
3749
  if (problem.file === void 0) return void 0;
3839
3750
  let source;
3840
3751
  try {
3841
- source = fs3.readFileSync(path3.resolve(at.root, problem.file), "utf8");
3752
+ source = fs2.readFileSync(path2.resolve(at.root, problem.file), "utf8");
3842
3753
  } catch {
3843
3754
  return void 0;
3844
3755
  }
@@ -3937,7 +3848,6 @@ var isPlainObject = (v) => {
3937
3848
  const proto = Object.getPrototypeOf(v);
3938
3849
  return proto === Object.prototype || proto === null;
3939
3850
  };
3940
- var frontMatterSettings = { trimAfter: false };
3941
3851
  function parseFrontMatter(src) {
3942
3852
  let format;
3943
3853
  let fence;
@@ -3966,7 +3876,7 @@ function parseFrontMatter(src) {
3966
3876
  const next = newline === -1 ? rest.length : newline + 1;
3967
3877
  if (rest.slice(offset, next).trimEnd() === fence) {
3968
3878
  const text = rest.slice(0, offset);
3969
- const body = frontMatterSettings.trimAfter ? rest.slice(next).replace(/^(?:[ \t]*\r?\n)+/, "") : rest.slice(next);
3879
+ const body = rest.slice(next);
3970
3880
  if (format === "json") {
3971
3881
  let value;
3972
3882
  try {
@@ -4348,7 +4258,7 @@ function tomlDateText(d) {
4348
4258
  return d.toISOString().replace(/\.(\d*?)0+(?=$|Z|[+-]\d\d:\d\d$)/, (_, digits) => digits ? `.${digits}` : "");
4349
4259
  }
4350
4260
  function readText(file) {
4351
- return decodeText(fs4.readFileSync(file));
4261
+ return decodeText(fs3.readFileSync(file));
4352
4262
  }
4353
4263
  var utf8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
4354
4264
  function decodeText(bytes) {
@@ -4360,7 +4270,7 @@ function decodeText(bytes) {
4360
4270
  }
4361
4271
  var stripBom = (text) => text.charCodeAt(0) === 65279 ? text.slice(1) : text;
4362
4272
  function loadStaticDataFile(file) {
4363
- const ext = path4.extname(file).slice(1);
4273
+ const ext = path3.extname(file).slice(1);
4364
4274
  const read = () => {
4365
4275
  try {
4366
4276
  return readText(file);
@@ -4396,7 +4306,7 @@ function loadStaticDataFile(file) {
4396
4306
  }
4397
4307
  var STATIC_DATA_EXTENSIONS = ["json", "yaml", "yml", "toml"];
4398
4308
  function loadDataFile(file, extra) {
4399
- const ext = path4.extname(file).slice(1);
4309
+ const ext = path3.extname(file).slice(1);
4400
4310
  if (STATIC_DATA_EXTENSIONS.includes(ext)) return loadStaticDataFile(file);
4401
4311
  const load2 = extra.get(ext);
4402
4312
  return load2 ? load2(file) : NOT_DATA;
@@ -4502,26 +4412,11 @@ function utcMs(y, mo, d, h = "0", mi = "0", s = "0", fraction) {
4502
4412
  }
4503
4413
 
4504
4414
  export {
4505
- slashes,
4506
- displayPath,
4507
- shown,
4508
- relative,
4509
- joinAsGiven,
4510
- parentAsGiven,
4511
- realPath,
4512
- isFile,
4513
- isDir,
4514
- isInside,
4515
- compareText,
4516
- comparePaths,
4517
- walkFiles,
4518
- readFollowing,
4519
4415
  jsYaml,
4520
4416
  TomlError,
4521
4417
  buildTime,
4522
4418
  sourceDateEpoch,
4523
4419
  isPlainObject,
4524
- frontMatterSettings,
4525
4420
  parseFrontMatter,
4526
4421
  parseYaml,
4527
4422
  tomlReason,
@@ -4567,4 +4462,4 @@ export {
4567
4462
  describe,
4568
4463
  printError
4569
4464
  };
4570
- /*! For license information please see chunk-AIMEXBTK.js.LEGAL.txt */
4465
+ /*! For license information please see chunk-YNJNMQWU.js.LEGAL.txt */