ssqch 0.10.0 → 0.11.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 (95) hide show
  1. package/bundled/completions/bash +62 -16
  2. package/bundled/completions/elvish +28 -12
  3. package/bundled/completions/fish +36 -23
  4. package/bundled/completions/powershell +30 -12
  5. package/bundled/completions/zsh +40 -19
  6. package/bundled/docs/agents.md +12 -1
  7. package/bundled/docs/build-summary.md +31 -1
  8. package/bundled/docs/comparing-builds.md +37 -5
  9. package/bundled/docs/configuring.md +30 -5
  10. package/bundled/docs/field-guide.md +1 -1
  11. package/bundled/docs/github-pages.md +1 -1
  12. package/bundled/docs/index.md +1 -1
  13. package/bundled/docs/known-gaps.md +1 -1
  14. package/bundled/docs/markdown.md +63 -5
  15. package/bundled/docs/multilingual.md +20 -3
  16. package/bundled/docs/nav.yml +1 -0
  17. package/bundled/docs/netlify.md +2 -2
  18. package/bundled/docs/plugins.md +4 -4
  19. package/bundled/docs/seo.md +39 -1
  20. package/bundled/docs/template-languages.md +6 -4
  21. package/bundled/docs/templates.md +3 -3
  22. package/bundled/docs/trailheads/from-eleventy.md +25 -13
  23. package/bundled/docs/trailheads/from-hugo.md +103 -0
  24. package/bundled/docs/trailheads/from-jekyll.md +49 -15
  25. package/bundled/docs/trailheads/from-mkdocs.md +54 -9
  26. package/bundled/docs/trailheads/from-zola.md +2 -2
  27. package/bundled/docs/trailheads.md +22 -5
  28. package/bundled/docs/where-values-come-from.md +1 -1
  29. package/bundled/mkdocs/404.jinja +6 -0
  30. package/bundled/ssqch.d.ts +78 -18
  31. package/lib/assets.js +11 -12
  32. package/lib/{chunk-3HHRKG33.js → chunk-2L3HR67O.js} +71 -19
  33. package/lib/{chunk-LCPSKHAV.js → chunk-2QTJTEBV.js} +1 -1
  34. package/lib/{chunk-RVBNVGZV.js → chunk-3HZZY3Y7.js} +5 -6
  35. package/lib/{chunk-RKFZSVNF.js → chunk-3K237XAX.js} +10 -11
  36. package/lib/{chunk-HXCLCXRT.js → chunk-443ZQLVX.js} +5 -3
  37. package/lib/{chunk-Q4LFTYK2.js → chunk-5ELAUHRL.js} +20 -20
  38. package/lib/{chunk-SA5KSJ4Y.js → chunk-A75EVUJX.js} +10 -12
  39. package/lib/{chunk-BGCBSQ4A.js → chunk-AIMEXBTK.js} +163 -29
  40. package/lib/{chunk-Y2ESFAAD.js → chunk-B5E27PLU.js} +10 -41
  41. package/lib/{chunk-RJFWTW2Y.js → chunk-CMJ7X5WW.js} +3 -3
  42. package/lib/{chunk-NKXEPHRZ.js → chunk-ERAIEV3O.js} +106 -4
  43. package/lib/{chunk-E5UB2YY7.js → chunk-FCM3NYFR.js} +11 -9
  44. package/lib/{chunk-3EPHKJEG.js → chunk-GJNIQAIH.js} +8 -8
  45. package/lib/{chunk-CB6YFUXU.js → chunk-GLJQ4C76.js} +40 -21
  46. package/lib/{chunk-DDV6JEC2.js → chunk-GS5B3CBW.js} +1 -1
  47. package/lib/chunk-H5K2ZE7B.js +219 -0
  48. package/lib/{chunk-NFJJKDRI.js → chunk-HFSWUTXX.js} +1 -1
  49. package/lib/{chunk-4Q6WMTER.js → chunk-HWW5NCVJ.js} +1 -1
  50. package/lib/{chunk-LAV3DEY4.js → chunk-I3HYKEEW.js} +1 -1
  51. package/lib/{chunk-JWCCVTTR.js → chunk-IOBC665M.js} +2 -4
  52. package/lib/chunk-JC54PHIT.js +7992 -0
  53. package/lib/{chunk-2LEOPLTZ.js → chunk-KCF2Z6N7.js} +3 -5
  54. package/lib/{chunk-DMVJ53SM.js → chunk-KZZS4W2V.js} +15 -15
  55. package/lib/{chunk-RM5Q3KFB.js → chunk-LJOURBYT.js} +14 -13
  56. package/lib/chunk-OQGXZYZS.js +45 -0
  57. package/lib/chunk-OSBEH67S.js +6296 -0
  58. package/lib/{chunk-DW7VMJEZ.js → chunk-QJ5ZFTML.js} +14 -13
  59. package/lib/{chunk-NUUEOGLZ.js → chunk-QLUTNR37.js} +11 -11
  60. package/lib/{chunk-HGJ5VWUR.js → chunk-RBNPBTDP.js} +1 -1
  61. package/lib/{chunk-F65YUXZ7.js → chunk-RIAOXEXC.js} +10 -4
  62. package/lib/chunk-RVXGUMFI.js +21 -0
  63. package/lib/{chunk-N4O5MDIB.js → chunk-RYIWYWRQ.js} +5 -7
  64. package/lib/{chunk-EEJDLCD3.js → chunk-RZYAIX2R.js} +12 -11
  65. package/lib/{chunk-7HXCQEGA.js → chunk-V2FSMOFX.js} +3 -3
  66. package/lib/{chunk-HDQ4SRWM.js → chunk-X2GAVYV2.js} +525 -75
  67. package/lib/chunk-XS4EJSEK.js +279 -0
  68. package/lib/chunk-YCOTX2VM.js +37 -0
  69. package/lib/{chunk-QMA7CK7B.js → chunk-Z44IAMNG.js} +137 -32
  70. package/lib/chunk-Z5OP43HU.js +2945 -0
  71. package/lib/{chunk-JXZT5L7W.js → chunk-ZINLHOX4.js} +2 -3
  72. package/lib/{chunk-SRNLKWXL.js → chunk-ZR3JYLFB.js} +893 -12382
  73. package/lib/cli.js +82 -41
  74. package/lib/elements.js +11 -12
  75. package/lib/image.js +11 -11
  76. package/lib/links.js +11 -12
  77. package/lib/minify.js +71 -13
  78. package/lib/redirects.js +11 -12
  79. package/lib/rss.js +13 -11
  80. package/lib/sass.js +13 -245
  81. package/lib/sitemap.js +19 -18
  82. package/lib/ssqch.js +6 -5
  83. package/package.json +1 -1
  84. package/types/index.d.ts +59 -13
  85. package/types/minify.d.ts +15 -3
  86. package/types/sass.d.ts +2 -0
  87. package/types/sitemap.d.ts +2 -2
  88. package/wasm/markdown.wasm +0 -0
  89. package/wasm/minify.wasm +0 -0
  90. package/wasm/sass.wasm +0 -0
  91. package/lib/chunk-5DNDSNTP.js +0 -1541
  92. package/lib/chunk-VJWQSYEG.js +0 -119
  93. package/lib/chunk-ZM6TU2JB.js +0 -1287
  94. /package/lib/{chunk-BGCBSQ4A.js.LEGAL.txt → chunk-AIMEXBTK.js.LEGAL.txt} +0 -0
  95. /package/lib/{chunk-SRNLKWXL.js.LEGAL.txt → chunk-ZR3JYLFB.js.LEGAL.txt} +0 -0
@@ -2,36 +2,38 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  isAsset
5
- } from "./chunk-2LEOPLTZ.js";
5
+ } from "./chunk-KCF2Z6N7.js";
6
6
  import {
7
7
  build
8
- } from "./chunk-SRNLKWXL.js";
9
- import "./chunk-4Q6WMTER.js";
10
- import "./chunk-CB6YFUXU.js";
11
- import "./chunk-N4O5MDIB.js";
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";
13
+ import {
14
+ fileHash
15
+ } from "./chunk-I3HYKEEW.js";
12
16
  import {
13
17
  filesRead
14
18
  } from "./chunk-3NYSSA2C.js";
15
- import {
16
- fileHash
17
- } from "./chunk-LAV3DEY4.js";
18
- import "./chunk-QMA7CK7B.js";
19
- import "./chunk-LCPSKHAV.js";
19
+ import "./chunk-Z44IAMNG.js";
20
+ import "./chunk-2QTJTEBV.js";
20
21
  import {
21
22
  summary
22
- } from "./chunk-NKXEPHRZ.js";
23
+ } from "./chunk-ERAIEV3O.js";
23
24
  import "./chunk-AD3HAW3W.js";
25
+ import "./chunk-YCOTX2VM.js";
24
26
  import {
25
27
  dirsOf
26
- } from "./chunk-DDV6JEC2.js";
27
- import "./chunk-5DNDSNTP.js";
28
+ } from "./chunk-GS5B3CBW.js";
29
+ import "./chunk-JC54PHIT.js";
30
+ import "./chunk-HFSWUTXX.js";
28
31
  import "./chunk-FVZ5JBRI.js";
29
- import "./chunk-NFJJKDRI.js";
30
32
  import "./chunk-UU43WIZG.js";
31
33
  import {
32
34
  describeThrown,
33
35
  loadedFiles
34
- } from "./chunk-JWCCVTTR.js";
36
+ } from "./chunk-IOBC665M.js";
35
37
  import "./chunk-CMUWRPSQ.js";
36
38
  import {
37
39
  BuildError,
@@ -40,16 +42,14 @@ import {
40
42
  aliasesKnown,
41
43
  aliasesUsed,
42
44
  describe,
45
+ isInside,
43
46
  messageOf,
44
47
  printError,
45
- red
46
- } from "./chunk-BGCBSQ4A.js";
47
- import {
48
- isInside,
49
48
  realPath,
49
+ red,
50
50
  relative,
51
51
  slashes
52
- } from "./chunk-VJWQSYEG.js";
52
+ } from "./chunk-AIMEXBTK.js";
53
53
  import "./chunk-I3PS26CI.js";
54
54
 
55
55
  // src/serve/build-process.ts
@@ -6,18 +6,18 @@ import {
6
6
  fingerprint,
7
7
  isAsset,
8
8
  sameStamps
9
- } from "./chunk-2LEOPLTZ.js";
9
+ } from "./chunk-KCF2Z6N7.js";
10
10
  import {
11
11
  commandLine
12
- } from "./chunk-4Q6WMTER.js";
12
+ } from "./chunk-HWW5NCVJ.js";
13
13
  import {
14
14
  Builder,
15
15
  stopBuilders
16
- } from "./chunk-LAV3DEY4.js";
16
+ } from "./chunk-I3HYKEEW.js";
17
17
  import {
18
18
  CONFIG_FILES,
19
19
  dirsOf
20
- } from "./chunk-DDV6JEC2.js";
20
+ } from "./chunk-GS5B3CBW.js";
21
21
  import {
22
22
  closestPath
23
23
  } from "./chunk-FVZ5JBRI.js";
@@ -29,19 +29,17 @@ import {
29
29
  import {
30
30
  BuildError,
31
31
  aliasesUsed,
32
+ isInside,
32
33
  messageOf,
33
34
  progress,
34
- red,
35
- warn,
36
- warning
37
- } from "./chunk-BGCBSQ4A.js";
38
- import {
39
- isInside,
40
35
  realPath,
36
+ red,
41
37
  relative,
42
38
  slashes,
43
- walkFiles
44
- } from "./chunk-VJWQSYEG.js";
39
+ walkFiles,
40
+ warn,
41
+ warning
42
+ } from "./chunk-AIMEXBTK.js";
45
43
  import "./chunk-I3PS26CI.js";
46
44
 
47
45
  // src/serve/server.ts
@@ -1,8 +1,105 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
- import {
4
- realPath
5
- } from "./chunk-VJWQSYEG.js";
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
+ }
6
103
 
7
104
  // node_modules/js-yaml/dist/js-yaml.mjs
8
105
  function isNothing(subject) {
@@ -3387,16 +3484,16 @@ function parse(toml, options = {}) {
3387
3484
  var HAS_WELLFORMED = !!"".isWellFormed;
3388
3485
 
3389
3486
  // src/data.ts
3487
+ import fs4 from "node:fs";
3488
+ import path4 from "node:path";
3489
+
3490
+ // src/diagnostics.ts
3390
3491
  import fs3 from "node:fs";
3391
3492
  import path3 from "node:path";
3392
3493
 
3393
- // src/diagnostics.ts
3494
+ // src/equivalents.ts
3394
3495
  import fs2 from "node:fs";
3395
3496
  import path2 from "node:path";
3396
-
3397
- // src/equivalents.ts
3398
- import fs from "node:fs";
3399
- import path from "node:path";
3400
3497
  var SERVE = "ssqch's dev server is `ssqch serve`: it builds, watches and reloads the browser.";
3401
3498
  var TABLE = [
3402
3499
  // Commands.
@@ -3447,13 +3544,15 @@ var TABLE = [
3447
3544
  // Front-matter keys that can't be a site's own.
3448
3545
  { word: "eleventyComputed", kind: "frontMatter", alias: true, from: ["Eleventy"], ssqch: "computed", say: "ssqch's name is `computed`.", more: "ssqch docs computed" },
3449
3546
  { word: "eleventyExcludeFromCollections", kind: "frontMatter", alias: true, from: ["Eleventy"], ssqch: "excludeFromCollections", say: "ssqch's name is `excludeFromCollections`.", more: "ssqch docs excludeFromCollections" },
3450
- { word: "eleventyNavigation", kind: "frontMatter", alias: false, from: ["Eleventy"], ssqch: "nav", say: "ssqch's own navigation (`pagesTree` and `navTree`) reads `nav`, so these pages aren't in it. Templates and filters that read `eleventyNavigation` (eleventy-navigation's `findNavigationEntries`) still get it as it is.", more: "ssqch docs nav" },
3547
+ { word: "eleventyNavigation", kind: "frontMatter", alias: false, from: ["Eleventy"], ssqch: "nav", say: 'ssqch\'s own navigation (`pagesTree` and `navTree`) reads `nav`, so these pages aren\'t in it: rename it to `nav` (the same `key`, `parent`, `order` and `title`), and `collections.all | eleventyNavigation: "Feature"` is `pagesTree(collections.all, { root: "Feature" })`. Templates and filters that read `eleventyNavigation` (eleventy-navigation\'s `findNavigationEntries`) still get it as it is.', more: "ssqch docs nav" },
3451
3548
  { word: "templateEngineOverride", kind: "frontMatter", alias: true, from: ["Eleventy"], ssqch: "render", say: "ssqch's name is `render`, a list: render: [njk, md].", more: "ssqch docs render" },
3452
3549
  { word: "redirect_from", kind: "frontMatter", alias: true, from: ["Jekyll"], ssqch: "aliases", say: 'ssqch\'s name is `aliases`; `redirectsPlugin()` from "ssqch/redirects" writes the redirects.', more: "ssqch docs aliases" },
3453
3550
  { word: "published", kind: "frontMatter", alias: false, from: ["Jekyll"], ssqch: "draft", say: "`published: false` doesn't hold a page back in ssqch, so it's published: use `draft: true`.", more: "ssqch docs draft" },
3454
3551
  // Filters.
3455
3552
  { word: "url", kind: "filter", alias: true, from: ["Eleventy"], ssqch: "base", say: 'It returns the URL as it is: the build adds `base` to every URL from the site\'s root, so `href="/about/"` needs no filter (use `withBase()` outside HTML attributes).', more: "ssqch docs base" },
3456
3553
  { word: "relative_url", kind: "filter", alias: true, from: ["Jekyll"], ssqch: "base", say: 'It returns the URL as it is: the build adds `base` to every URL from the site\'s root, so `href="/about/"` needs no filter (use `withBase()` outside HTML attributes).', more: "ssqch docs base" },
3554
+ { 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
+ { 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" },
3457
3556
  { 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" },
3458
3557
  { 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" },
3459
3558
  { 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" },
@@ -3498,15 +3597,15 @@ var OTHER_CONFIGS = [
3498
3597
  [".vitepress/config.js", "VitePress", null, "from-component-frameworks.md"]
3499
3598
  ];
3500
3599
  function otherGenerator(root) {
3501
- const isFile = (file2) => fs.statSync(path.join(root, file2), { throwIfNoEntry: false })?.isFile() ?? false;
3600
+ const isFile2 = (file2) => fs2.statSync(path2.join(root, file2), { throwIfNoEntry: false })?.isFile() ?? false;
3502
3601
  const read = (file2) => {
3503
3602
  try {
3504
- return fs.readFileSync(path.join(root, file2), "utf8");
3603
+ return fs2.readFileSync(path2.join(root, file2), "utf8");
3505
3604
  } catch {
3506
3605
  return void 0;
3507
3606
  }
3508
3607
  };
3509
- let found = OTHER_CONFIGS.find(([file2]) => isFile(file2));
3608
+ let found = OTHER_CONFIGS.find(([file2]) => isFile2(file2));
3510
3609
  if (!found) {
3511
3610
  const toml = read("config.toml");
3512
3611
  if (toml?.includes("base_url")) found = ["config.toml", "Zola", "zola", "from-zola.md"];
@@ -3517,9 +3616,9 @@ function otherGenerator(root) {
3517
3616
  }
3518
3617
  }
3519
3618
  if (!found) return void 0;
3520
- const [file, generator, importer] = found;
3619
+ const [file, generator] = found;
3521
3620
  const docs = `\`ssqch docs --from ${generator.toLowerCase()}\` says what maps to what`;
3522
- const next = importer ? `\`ssqch import ${importer}\` drafts one from it, and ${docs}` : `\`ssqch init\` starts one, and ${docs}`;
3621
+ const next = `\`ssqch scout\` lists what moving it takes and drafts a config (\`--write-draft\`), and ${docs}`;
3523
3622
  const article = /^[AEIOU]/.test(generator) ? "an" : "a";
3524
3623
  return `this folder has ${article} ${generator} config (${file}) and no ssqch.config.js, so ssqch builds it with its own defaults. ${next}.`;
3525
3624
  }
@@ -3627,20 +3726,20 @@ var Locator = class {
3627
3726
  name = name.replace(/^["'`]+|["'`]+$/g, "");
3628
3727
  if (name === "") return void 0;
3629
3728
  for (const dir of this.dirs) {
3630
- let file = path2.resolve(dir, name);
3631
- if (!fs2.statSync(file, { throwIfNoEntry: false })?.isFile()) continue;
3729
+ let file = path3.resolve(dir, name);
3730
+ if (!fs3.statSync(file, { throwIfNoEntry: false })?.isFile()) continue;
3632
3731
  file = realPath(file);
3633
- const rel = path2.relative(realPath(this.root), file);
3634
- const outside = rel === ".." || rel.startsWith(`..${path2.sep}`) || path2.isAbsolute(rel);
3635
- const shown = (outside ? file : rel).split(path2.sep).join("/");
3636
- return { path: file, shown };
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 };
3637
3736
  }
3638
3737
  return void 0;
3639
3738
  }
3640
3739
  };
3641
3740
  function linesBeforeBody(file) {
3642
3741
  try {
3643
- const src = fs2.readFileSync(file, "utf8");
3742
+ const src = fs3.readFileSync(file, "utf8");
3644
3743
  const { body } = parseFrontMatter(src);
3645
3744
  return src.slice(0, src.length - body.length).split("\n").length - 1;
3646
3745
  } catch {
@@ -3728,8 +3827,8 @@ function fileLines(message, at) {
3728
3827
  function frames(e, fallback, at) {
3729
3828
  const found = [];
3730
3829
  for (const problem of fromError(e, fallback, at)) {
3731
- const shown = frame(problem, at);
3732
- if (shown !== void 0 && !found.includes(shown)) found.push(shown);
3830
+ const shown2 = frame(problem, at);
3831
+ if (shown2 !== void 0 && !found.includes(shown2)) found.push(shown2);
3733
3832
  if (found.length === 3) break;
3734
3833
  }
3735
3834
  return found.length ? found.join("\n\n") : void 0;
@@ -3739,7 +3838,7 @@ function frame(problem, at) {
3739
3838
  if (problem.file === void 0) return void 0;
3740
3839
  let source;
3741
3840
  try {
3742
- source = fs2.readFileSync(path2.resolve(at.root, problem.file), "utf8");
3841
+ source = fs3.readFileSync(path3.resolve(at.root, problem.file), "utf8");
3743
3842
  } catch {
3744
3843
  return void 0;
3745
3844
  }
@@ -3838,6 +3937,7 @@ var isPlainObject = (v) => {
3838
3937
  const proto = Object.getPrototypeOf(v);
3839
3938
  return proto === Object.prototype || proto === null;
3840
3939
  };
3940
+ var frontMatterSettings = { trimAfter: false };
3841
3941
  function parseFrontMatter(src) {
3842
3942
  let format;
3843
3943
  let fence;
@@ -3866,7 +3966,7 @@ function parseFrontMatter(src) {
3866
3966
  const next = newline === -1 ? rest.length : newline + 1;
3867
3967
  if (rest.slice(offset, next).trimEnd() === fence) {
3868
3968
  const text = rest.slice(0, offset);
3869
- const body = rest.slice(next);
3969
+ const body = frontMatterSettings.trimAfter ? rest.slice(next).replace(/^(?:[ \t]*\r?\n)+/, "") : rest.slice(next);
3870
3970
  if (format === "json") {
3871
3971
  let value;
3872
3972
  try {
@@ -3888,6 +3988,15 @@ function parseFrontMatter(src) {
3888
3988
  try {
3889
3989
  return { data: parseYaml(text), body };
3890
3990
  } catch (e) {
3991
+ if (e instanceof jsYaml.YAMLException && /duplicated mapping key/.test(e.reason)) {
3992
+ try {
3993
+ const value = jsYaml.load(text, { schema: YAML_SCHEMA, json: true });
3994
+ const line = e.mark ? e.mark.line + 1 : 0;
3995
+ const key = e.mark ? /^\s*["']?([^"':]+)["']?\s*:/.exec(text.split("\n")[e.mark.line] ?? "")?.[1]?.trim() : void 0;
3996
+ return { data: frontMatterObject(value ?? {}, "YAML"), body, duplicate: { key: key ?? "", line } };
3997
+ } catch {
3998
+ }
3999
+ }
3891
4000
  throw new BuildError(`invalid YAML front matter: ${yamlReason(e)}`);
3892
4001
  }
3893
4002
  }
@@ -4239,7 +4348,7 @@ function tomlDateText(d) {
4239
4348
  return d.toISOString().replace(/\.(\d*?)0+(?=$|Z|[+-]\d\d:\d\d$)/, (_, digits) => digits ? `.${digits}` : "");
4240
4349
  }
4241
4350
  function readText(file) {
4242
- return decodeText(fs3.readFileSync(file));
4351
+ return decodeText(fs4.readFileSync(file));
4243
4352
  }
4244
4353
  var utf8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
4245
4354
  function decodeText(bytes) {
@@ -4251,7 +4360,7 @@ function decodeText(bytes) {
4251
4360
  }
4252
4361
  var stripBom = (text) => text.charCodeAt(0) === 65279 ? text.slice(1) : text;
4253
4362
  function loadStaticDataFile(file) {
4254
- const ext = path3.extname(file).slice(1);
4363
+ const ext = path4.extname(file).slice(1);
4255
4364
  const read = () => {
4256
4365
  try {
4257
4366
  return readText(file);
@@ -4287,7 +4396,7 @@ function loadStaticDataFile(file) {
4287
4396
  }
4288
4397
  var STATIC_DATA_EXTENSIONS = ["json", "yaml", "yml", "toml"];
4289
4398
  function loadDataFile(file, extra) {
4290
- const ext = path3.extname(file).slice(1);
4399
+ const ext = path4.extname(file).slice(1);
4291
4400
  if (STATIC_DATA_EXTENSIONS.includes(ext)) return loadStaticDataFile(file);
4292
4401
  const load2 = extra.get(ext);
4293
4402
  return load2 ? load2(file) : NOT_DATA;
@@ -4343,6 +4452,7 @@ function toDate(value) {
4343
4452
  return void 0;
4344
4453
  }
4345
4454
  var RFC3339 = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2}):(\d{2})(\.\d+)?([Zz]|[+-]\d{2}:\d{2})$/;
4455
+ var ZONED = /^(\d{4})-(\d{1,2})-(\d{1,2})[Tt ](\d{1,2}):(\d{2})(?::(\d{2})(\.\d+)?)? ?([Zz]|[+-]\d{2}:?\d{2}|UTC)$/;
4346
4456
  var DATE_ONLY = /^([+-]?\d{1,6})-(\d{1,2})-(\d{1,2})$/;
4347
4457
  var NAIVE = /^([+-]?\d{1,6})-(\d{1,2})-(\d{1,2})[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(\.\d+)?)?$/;
4348
4458
  function parseDate2(text) {
@@ -4359,6 +4469,14 @@ function parseDate2(text) {
4359
4469
  }
4360
4470
  return new Date(utc - offset);
4361
4471
  }
4472
+ m = ZONED.exec(s);
4473
+ if (m) {
4474
+ const utc = utcMs(m[1], m[2], m[3], m[4], m[5], m[6] ?? "0", m[7]);
4475
+ if (utc === void 0) return void 0;
4476
+ const zone = m[8].replace(":", "");
4477
+ const minutes = /^[Zz]|UTC$/.test(zone) ? 0 : Number(zone.slice(1, 3)) * 60 + Number(zone.slice(3, 5));
4478
+ return new Date(utc - (zone[0] === "-" ? -minutes : minutes) * 6e4);
4479
+ }
4362
4480
  m = DATE_ONLY.exec(s);
4363
4481
  if (m) {
4364
4482
  const utc = utcMs(m[1], m[2], m[3]);
@@ -4384,12 +4502,28 @@ function utcMs(y, mo, d, h = "0", mi = "0", s = "0", fraction) {
4384
4502
  }
4385
4503
 
4386
4504
  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,
4387
4519
  jsYaml,
4388
4520
  TomlError,
4389
4521
  buildTime,
4390
4522
  sourceDateEpoch,
4391
4523
  isPlainObject,
4524
+ frontMatterSettings,
4392
4525
  parseFrontMatter,
4526
+ parseYaml,
4393
4527
  tomlReason,
4394
4528
  readToml,
4395
4529
  setOwn,
@@ -4433,4 +4567,4 @@ export {
4433
4567
  describe,
4434
4568
  printError
4435
4569
  };
4436
- /*! For license information please see chunk-BGCBSQ4A.js.LEGAL.txt */
4570
+ /*! For license information please see chunk-AIMEXBTK.js.LEGAL.txt */
@@ -1,47 +1,19 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
- red
5
- } from "./chunk-BGCBSQ4A.js";
4
+ bundled,
5
+ types
6
+ } from "./chunk-YCOTX2VM.js";
6
7
  import {
7
8
  joinAsGiven,
8
9
  parentAsGiven,
10
+ red,
9
11
  slashes
10
- } from "./chunk-VJWQSYEG.js";
12
+ } from "./chunk-AIMEXBTK.js";
11
13
 
12
14
  // src/commands/init.ts
13
- import fs2 from "node:fs";
14
- import path2 from "node:path";
15
-
16
- // src/bundled.ts
17
15
  import fs from "node:fs";
18
16
  import path from "node:path";
19
- import { fileURLToPath } from "node:url";
20
- var PACKAGE = path.dirname(path.dirname(fileURLToPath(new URL("../src/bundled.ts", import.meta.url).href)));
21
- var BUNDLED = path.join(PACKAGE, "bundled");
22
- var FROM_REPOSITORY = [
23
- ["docs", "site/src/docs"]
24
- ];
25
- function bundledPath(rel) {
26
- const inPackage = path.join(BUNDLED, rel);
27
- if (fs.existsSync(inPackage)) return inPackage;
28
- for (const [prefix, original] of FROM_REPOSITORY) {
29
- if (rel === prefix || rel.startsWith(`${prefix}/`)) return path.join(PACKAGE, "../..", original + rel.slice(prefix.length));
30
- }
31
- return inPackage;
32
- }
33
- var cache = /* @__PURE__ */ new Map();
34
- function bundled(rel) {
35
- let text = cache.get(rel);
36
- if (text === void 0) cache.set(rel, text = fs.readFileSync(bundledPath(rel), "utf8"));
37
- return text;
38
- }
39
- function bundledNames(rel) {
40
- return fs.readdirSync(bundledPath(rel)).sort();
41
- }
42
- var types = () => bundled("ssqch.d.ts");
43
-
44
- // src/commands/init.ts
45
17
  var STARTER = [
46
18
  ["ssqch.config.js", "starter/ssqch.config.js"],
47
19
  ["src/_data/site.json", "starter/src/_data/site.json"],
@@ -150,18 +122,18 @@ function write(file, contents, shown = file) {
150
122
  const parent = parentAsGiven(shown);
151
123
  if (parent !== "") {
152
124
  try {
153
- fs2.mkdirSync(path2.dirname(file), { recursive: true });
125
+ fs.mkdirSync(path.dirname(file), { recursive: true });
154
126
  } catch (e) {
155
127
  throw new Error(`creating ${parent}: ${e.message}`);
156
128
  }
157
129
  }
158
130
  try {
159
- fs2.writeFileSync(file, contents);
131
+ fs.writeFileSync(file, contents);
160
132
  } catch (e) {
161
133
  throw new Error(`writing ${shown}: ${e.message}`);
162
134
  }
163
135
  }
164
- var isCurrentFolder = (dir) => dir.startsWith(".") && dir.split(path2.sep === "/" ? "/" : /[\\/]/).every((part) => part === "" || part === ".");
136
+ var isCurrentFolder = (dir) => dir.startsWith(".") && dir.split(path.sep === "/" ? "/" : /[\\/]/).every((part) => part === "" || part === ".");
165
137
  function runInit(options) {
166
138
  const { dir, starter, engine, quiet } = options;
167
139
  const written = [], skipped = [];
@@ -169,8 +141,8 @@ function runInit(options) {
169
141
  if (!STARTERS.includes(starter)) throw new Error(`--starter ${starter}: not a starter (use ${STARTERS.join(" or ")})`);
170
142
  if (!ENGINES.includes(engine)) throw new Error(`--engine ${engine}: not a starter engine (use ${ENGINES.join(", ")})`);
171
143
  for (const [rel, contents] of starterFiles(starter, engine)) {
172
- const file = path2.join(dir, rel);
173
- if (fs2.existsSync(file)) skipped.push(rel);
144
+ const file = path.join(dir, rel);
145
+ if (fs.existsSync(file)) skipped.push(rel);
174
146
  else {
175
147
  write(file, contents, joinAsGiven(dir, rel));
176
148
  written.push(rel);
@@ -196,9 +168,6 @@ Camp is set up. Next: ${isCurrentFolder(dir) ? "" : `cd ${dir} && `}ssqch serve,
196
168
  }
197
169
 
198
170
  export {
199
- bundled,
200
- bundledNames,
201
- types,
202
171
  STARTERS,
203
172
  ENGINES,
204
173
  DEFAULT_ENGINE,
@@ -9,9 +9,9 @@ import {
9
9
  starterEngines,
10
10
  starterFiles,
11
11
  write
12
- } from "./chunk-Y2ESFAAD.js";
13
- import "./chunk-BGCBSQ4A.js";
14
- import "./chunk-VJWQSYEG.js";
12
+ } from "./chunk-B5E27PLU.js";
13
+ import "./chunk-YCOTX2VM.js";
14
+ import "./chunk-AIMEXBTK.js";
15
15
  import "./chunk-I3PS26CI.js";
16
16
  export {
17
17
  DEFAULT_ENGINE,