ssqch 0.7.1 → 0.9.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 (155) hide show
  1. package/README.md +8 -4
  2. package/bin/ssqch.js +14 -48
  3. package/bundled/README.md +1314 -0
  4. package/bundled/completions/bash +840 -0
  5. package/bundled/completions/elvish +286 -0
  6. package/bundled/completions/fish +182 -0
  7. package/bundled/completions/powershell +318 -0
  8. package/bundled/completions/zsh +510 -0
  9. package/bundled/ssqch.d.ts +540 -0
  10. package/bundled/starter/engines/index.edge +11 -0
  11. package/bundled/starter/engines/index.ejs +11 -0
  12. package/bundled/starter/engines/index.hbs +11 -0
  13. package/bundled/starter/engines/index.liquid +11 -0
  14. package/bundled/starter/engines/layout.edge +35 -0
  15. package/bundled/starter/engines/layout.ejs +35 -0
  16. package/bundled/starter/engines/layout.hbs +35 -0
  17. package/bundled/starter/engines/layout.liquid +35 -0
  18. package/bundled/starter/gitignore +3 -0
  19. package/bundled/starter/jsconfig.json +11 -0
  20. package/bundled/starter/src/404.md +8 -0
  21. package/bundled/starter/src/_blueprints/posts.md +5 -0
  22. package/bundled/starter/src/_data/site.json +4 -0
  23. package/bundled/starter/src/_includes/layout.jinja +35 -0
  24. package/bundled/starter/src/index.jinja +11 -0
  25. package/bundled/starter/src/posts/i-know-what-i-saw.md +11 -0
  26. package/bundled/starter/src/posts/posts.json +4 -0
  27. package/bundled/starter/src/posts/raiders-of-the-lost-path.md +27 -0
  28. package/bundled/starter/src/posts/the-cache-of-the-wild.md +26 -0
  29. package/bundled/starter/src/posts/the-stump-has-moved.md +15 -0
  30. package/bundled/starter/src/posts/upon-further-review-a-stump.md +18 -0
  31. package/bundled/starter/ssqch.config.js +29 -0
  32. package/bundled/starter-docs/engines/edge/base.edge +41 -0
  33. package/bundled/starter-docs/engines/edge/containers/details.edge +5 -0
  34. package/bundled/starter-docs/engines/edge/containers/tab.edge +4 -0
  35. package/bundled/starter-docs/engines/edge/containers/tabs.edge +5 -0
  36. package/bundled/starter-docs/engines/edge/doc.edge +59 -0
  37. package/bundled/starter-docs/engines/edge/hooks/heading.edge +2 -0
  38. package/bundled/starter-docs/engines/ejs/base.ejs +41 -0
  39. package/bundled/starter-docs/engines/ejs/containers/details.ejs +5 -0
  40. package/bundled/starter-docs/engines/ejs/containers/tab.ejs +4 -0
  41. package/bundled/starter-docs/engines/ejs/containers/tabs.ejs +5 -0
  42. package/bundled/starter-docs/engines/ejs/doc.ejs +59 -0
  43. package/bundled/starter-docs/engines/ejs/hooks/heading.ejs +2 -0
  44. package/bundled/starter-docs/engines/hbs/base.hbs +41 -0
  45. package/bundled/starter-docs/engines/hbs/containers/details.hbs +5 -0
  46. package/bundled/starter-docs/engines/hbs/containers/tab.hbs +4 -0
  47. package/bundled/starter-docs/engines/hbs/containers/tabs.hbs +5 -0
  48. package/bundled/starter-docs/engines/hbs/doc.hbs +58 -0
  49. package/bundled/starter-docs/engines/hbs/hooks/heading.hbs +2 -0
  50. package/bundled/starter-docs/engines/liquid/base.liquid +41 -0
  51. package/bundled/starter-docs/engines/liquid/containers/details.liquid +5 -0
  52. package/bundled/starter-docs/engines/liquid/containers/tab.liquid +4 -0
  53. package/bundled/starter-docs/engines/liquid/containers/tabs.liquid +5 -0
  54. package/bundled/starter-docs/engines/liquid/doc.liquid +60 -0
  55. package/bundled/starter-docs/engines/liquid/hooks/heading.liquid +2 -0
  56. package/bundled/starter-docs/gitignore +4 -0
  57. package/bundled/starter-docs/src/404.md +12 -0
  58. package/bundled/starter-docs/src/_blueprints/docs.md +5 -0
  59. package/bundled/starter-docs/src/_data/nav.yml +10 -0
  60. package/bundled/starter-docs/src/_data/site.json +5 -0
  61. package/bundled/starter-docs/src/_includes/base.jinja +41 -0
  62. package/bundled/starter-docs/src/_includes/containers/details.jinja +5 -0
  63. package/bundled/starter-docs/src/_includes/containers/tab.jinja +4 -0
  64. package/bundled/starter-docs/src/_includes/containers/tabs.jinja +5 -0
  65. package/bundled/starter-docs/src/_includes/doc.jinja +59 -0
  66. package/bundled/starter-docs/src/_includes/hooks/heading.jinja +2 -0
  67. package/bundled/starter-docs/src/assets/docs.css +257 -0
  68. package/bundled/starter-docs/src/assets/docs.js +67 -0
  69. package/bundled/starter-docs/src/docs/docs.json +1 -0
  70. package/bundled/starter-docs/src/docs/guides/deploying.md +77 -0
  71. package/bundled/starter-docs/src/docs/guides/writing.md +65 -0
  72. package/bundled/starter-docs/src/docs/index.md +29 -0
  73. package/bundled/starter-docs/src/docs/install.md +42 -0
  74. package/bundled/starter-docs/src/index.md +13 -0
  75. package/bundled/starter-docs/ssqch.config.js +40 -0
  76. package/bundled/trailheads/from-component-frameworks.md +116 -0
  77. package/bundled/trailheads/from-docusaurus.md +55 -0
  78. package/bundled/trailheads/from-eleventy.md +140 -0
  79. package/bundled/trailheads/from-hexo.md +92 -0
  80. package/bundled/trailheads/from-jekyll.md +79 -0
  81. package/bundled/trailheads/from-mkdocs.md +45 -0
  82. package/bundled/trailheads/from-zola.md +71 -0
  83. package/lib/assets.js +235 -3
  84. package/lib/chunk-3A647I3N.js +384 -0
  85. package/lib/chunk-3GYLOC6Y.js +1017 -0
  86. package/lib/chunk-3K3ANWZ2.js +118 -0
  87. package/lib/chunk-3NYSSA2C.js +22 -0
  88. package/lib/chunk-47P4YREZ.js +1287 -0
  89. package/lib/chunk-4Q6WMTER.js +32 -0
  90. package/lib/chunk-76NTVE34.js +338 -0
  91. package/lib/chunk-7PWCYHTJ.js +1350 -0
  92. package/lib/chunk-7RDRZHJD.js +217 -0
  93. package/lib/chunk-7SD7K567.js +57 -0
  94. package/lib/chunk-7XLK2GEG.js +54 -0
  95. package/lib/chunk-AD3HAW3W.js +10 -0
  96. package/lib/chunk-BEGC7YP6.js +502 -0
  97. package/lib/chunk-CMUWRPSQ.js +113 -0
  98. package/lib/chunk-CZ4XQC56.js +999 -0
  99. package/lib/chunk-D2XE2GTY.js +71 -0
  100. package/lib/chunk-DDV6JEC2.js +46 -0
  101. package/lib/chunk-DELWRJAO.js +37409 -0
  102. package/lib/chunk-DELWRJAO.js.LEGAL.txt +27 -0
  103. package/lib/chunk-F65YUXZ7.js +334 -0
  104. package/lib/chunk-FVZ5JBRI.js +115 -0
  105. package/lib/chunk-GRWMGC7D.js +4435 -0
  106. package/lib/chunk-GRWMGC7D.js.LEGAL.txt +41 -0
  107. package/lib/chunk-GUKSZ2XM.js +207 -0
  108. package/lib/chunk-HPXAZ2HU.js +251 -0
  109. package/lib/chunk-HXCLCXRT.js +20 -0
  110. package/lib/chunk-I3PS26CI.js +48 -0
  111. package/lib/chunk-IAFM5ITE.js +11 -0
  112. package/lib/chunk-II5DEH3Q.js +209 -0
  113. package/lib/chunk-IJWHOFRP.js +44 -0
  114. package/lib/chunk-LPHNACE4.js +29 -0
  115. package/lib/chunk-MI6EJWA2.js +175 -0
  116. package/lib/chunk-NCWFYT74.js +1541 -0
  117. package/lib/chunk-NKXEPHRZ.js +136 -0
  118. package/lib/chunk-NNUKIGOO.js +160 -0
  119. package/lib/chunk-R7K3D5W5.js +3957 -0
  120. package/lib/chunk-RNJFPFXE.js +29 -0
  121. package/lib/chunk-SF4I6Z7S.js +25 -0
  122. package/lib/chunk-SURPOAW7.js +44 -0
  123. package/lib/chunk-SXMJ52IK.js +572 -0
  124. package/lib/chunk-TICWN55Z.js +20 -0
  125. package/lib/chunk-TVU3OPPK.js +146 -0
  126. package/lib/chunk-UU43WIZG.js +29 -0
  127. package/lib/chunk-VJWQSYEG.js +119 -0
  128. package/lib/chunk-XMXBHXZR.js +75 -0
  129. package/lib/chunk-YTHQBMDJ.js +211 -0
  130. package/lib/cli.js +547 -0
  131. package/lib/elements.js +180 -3
  132. package/lib/image.js +27 -3
  133. package/lib/links.js +464 -3
  134. package/lib/minify.js +69 -3
  135. package/lib/redirects.js +152 -3
  136. package/lib/rss.js +139 -3
  137. package/lib/sass.js +256 -3
  138. package/lib/sitemap.js +113 -3
  139. package/lib/ssqch.js +28 -0
  140. package/package.json +83 -80
  141. package/src/serve/live.js +174 -0
  142. package/src/serve/not-found.html +31 -0
  143. package/types/globals.d.ts +3 -2
  144. package/types/image.d.ts +7 -3
  145. package/types/index.d.ts +28 -9
  146. package/types/links.d.ts +1 -1
  147. package/types/minify.d.ts +1 -1
  148. package/types/rss.d.ts +1 -1
  149. package/types/sass.d.ts +1 -1
  150. package/types/sitemap.d.ts +2 -0
  151. package/wasm/markdown.wasm +0 -0
  152. package/wasm/minify.wasm +0 -0
  153. package/wasm/sass.wasm +0 -0
  154. package/lib/index.js +0 -3
  155. package/platforms.json +0 -6
@@ -0,0 +1,118 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ starterEngines
5
+ } from "./chunk-YTHQBMDJ.js";
6
+ import {
7
+ DEFAULTS,
8
+ configOptions
9
+ } from "./chunk-R7K3D5W5.js";
10
+ import {
11
+ VERSION
12
+ } from "./chunk-AD3HAW3W.js";
13
+ import {
14
+ CONFIG_FILES
15
+ } from "./chunk-DDV6JEC2.js";
16
+ import {
17
+ red
18
+ } from "./chunk-GRWMGC7D.js";
19
+
20
+ // src/commands/capabilities.ts
21
+ var MODULE_EXPORTS = [
22
+ ["ssqch", ["defineConfig", "markdown", "readData", "files", "slugify", "slugger"]],
23
+ ["ssqch/image", ["imagePlugin", "image", "imageUrl"]],
24
+ ["ssqch/rss", ["rssPlugin", "getNewestCollectionItemDate", "dateToRfc3339", "dateToRfc822", "absoluteUrl", "htmlToAbsoluteUrls", "feedHtml"]],
25
+ ["ssqch/assets", ["assetsPlugin"]],
26
+ ["ssqch/links", ["linksPlugin"]],
27
+ ["ssqch/sitemap", ["sitemapPlugin"]],
28
+ ["ssqch/redirects", ["redirectsPlugin"]],
29
+ ["ssqch/sass", ["sassPlugin"]],
30
+ ["ssqch/elements", ["elementsPlugin"]],
31
+ ["ssqch/minify", ["minifyPlugin", "minify"]]
32
+ ];
33
+ var NODE_MODULES = ["fs", "fs/promises", "path", "path/posix", "url", "process", "buffer", "crypto", "module", "util", "events", "os", "assert", "assert/strict", "timers", "timers/promises", "string_decoder", "http", "https", "http2", "net", "tls", "dns", "child_process", "worker_threads", "cluster", "readline", "zlib", "vm", "stream", "tty", "perf_hooks"];
34
+ function modules() {
35
+ return MODULE_EXPORTS.map(([name, exports]) => ({ name, exports: [...exports] }));
36
+ }
37
+ async function avifWorks() {
38
+ try {
39
+ const name = "sharp";
40
+ const sharp = (await import(name)).default;
41
+ return Boolean(sharp?.format?.heif?.output?.buffer);
42
+ } catch {
43
+ return false;
44
+ }
45
+ }
46
+ async function capabilities(commands) {
47
+ const avif = await avifWorks();
48
+ const features = { avif, fetch: true, sass: true, liquid: true, jinja: true, handlebars: true };
49
+ const globals = ["console", "process", "Buffer", "URL", "URLSearchParams", "TextEncoder", "TextDecoder", "EventTarget", "Intl", "setTimeout", "setInterval", "setImmediate", "fetch", "Headers", "Request", "Response", "AbortController", "AbortSignal"];
50
+ return {
51
+ schemaVersion: 1,
52
+ version: VERSION,
53
+ commands,
54
+ json: ["build --format json", "inspect --format json", "diff --format json", "capabilities --format json", "docs --format json", "serve --ready-file"],
55
+ features,
56
+ configFiles: [...CONFIG_FILES, "sitesquatch.toml"],
57
+ configOptions: configOptions(),
58
+ templateLanguages: [
59
+ { name: "edge", extensions: ["edge"] },
60
+ { name: "markdown", extensions: ["md", "markdown"] },
61
+ { name: "html", extensions: ["html"] },
62
+ { name: "ejs", extensions: ["ejs"] },
63
+ { name: "liquid", extensions: ["liquid"] },
64
+ { name: "nunjucks", extensions: ["njk", "jinja", "j2"] },
65
+ { name: "handlebars", extensions: ["hbs", "handlebars", "mustache"] }
66
+ ],
67
+ defaults: { templateFormats: [...DEFAULTS.templateFormats], markdownEngine: DEFAULTS.markdownEngine, htmlEngine: DEFAULTS.htmlEngine },
68
+ frontMatter: ["yaml", "json", "toml"],
69
+ dataFiles: ["json", "yaml", "yml", "toml", "js", "mjs", "cjs"],
70
+ modules: modules(),
71
+ nodeModules: { available: NODE_MODULES.map((m) => `node:${m}`), stubs: [] },
72
+ globals,
73
+ imageFormats: avif ? ["avif", "webp", "jpeg", "png", "gif", "svg"] : ["webp", "jpeg", "png", "gif", "svg"],
74
+ starters: ["site", "docs"],
75
+ starterEngines: starterEngines(),
76
+ importers: ["eleventy", "zola"]
77
+ };
78
+ }
79
+ function text(caps) {
80
+ let out = `What's in the pack: ssqch ${caps.version}
81
+ `;
82
+ const row = (label, value) => {
83
+ out += ` ${label.padEnd(19)}${value}
84
+ `;
85
+ };
86
+ row("Commands", caps.commands.join(", "));
87
+ row("Optional features", Object.entries(caps.features).map(([name, on]) => `${name} ${on ? "yes" : "no"}`).join(", "));
88
+ row("Template languages", caps.templateLanguages.map((l) => `${l.name} (.${l.extensions.join(", .")})`).join(", "));
89
+ const { defaults } = caps;
90
+ const through = defaults.markdownEngine === defaults.htmlEngine ? `Markdown and HTML through ${defaults.markdownEngine}` : `Markdown through ${defaults.markdownEngine}, HTML through ${defaults.htmlEngine}`;
91
+ row("Defaults", `templateFormats ${defaults.templateFormats.join(", ")}; ${through}`);
92
+ row("Config files", caps.configFiles.join(", "));
93
+ row("Config options", caps.configOptions.join(", "));
94
+ row("Modules", caps.modules.map((m) => m.name).join(", "));
95
+ row("Node modules", caps.nodeModules.available.join(", "));
96
+ row("Globals", caps.globals.join(", "));
97
+ row("Image formats", caps.imageFormats.join(", "));
98
+ row("Starters", `${caps.starters.join(", ")} (in ${caps.starterEngines.join(", ")})`);
99
+ row("Importers", caps.importers.join(", "));
100
+ return out + "\n--format json has all of it, with each module's exports.\n";
101
+ }
102
+ async function runCapabilities(format, commands) {
103
+ if (format !== "text" && format !== "json") {
104
+ process.stderr.write(`${red("error:")} --format ${format}: use text or json
105
+ `);
106
+ return 1;
107
+ }
108
+ const caps = await capabilities(commands);
109
+ process.stdout.write(format === "json" ? JSON.stringify(caps, null, 2) + "\n" : text(caps));
110
+ return 0;
111
+ }
112
+
113
+ export {
114
+ MODULE_EXPORTS,
115
+ modules,
116
+ capabilities,
117
+ runCapabilities
118
+ };
@@ -0,0 +1,22 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+
4
+ // src/plugin-files.ts
5
+ var read = /* @__PURE__ */ new WeakMap();
6
+ function startReading(config, plugin) {
7
+ let byPlugin = read.get(config);
8
+ if (!byPlugin) read.set(config, byPlugin = /* @__PURE__ */ new Map());
9
+ const files = /* @__PURE__ */ new Set();
10
+ byPlugin.set(plugin, files);
11
+ return files;
12
+ }
13
+ function filesRead(config) {
14
+ const all = /* @__PURE__ */ new Set();
15
+ for (const files of read.get(config)?.values() ?? []) for (const file of files) all.add(file);
16
+ return [...all].sort();
17
+ }
18
+
19
+ export {
20
+ startReading,
21
+ filesRead
22
+ };