ssqch 0.7.0 → 0.8.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 (153) hide show
  1. package/README.md +6 -4
  2. package/bin/ssqch.js +14 -48
  3. package/bundled/README.md +1247 -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 +532 -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-mkdocs.md +45 -0
  81. package/bundled/trailheads/from-zola.md +71 -0
  82. package/lib/assets.js +235 -3
  83. package/lib/chunk-37KSIVNY.js +29 -0
  84. package/lib/chunk-3GYLOC6Y.js +1017 -0
  85. package/lib/chunk-3NYSSA2C.js +22 -0
  86. package/lib/chunk-3PHCFZEU.js +209 -0
  87. package/lib/chunk-4Q6WMTER.js +32 -0
  88. package/lib/chunk-6XYSFG6V.js +4423 -0
  89. package/lib/chunk-6XYSFG6V.js.LEGAL.txt +41 -0
  90. package/lib/chunk-AD3HAW3W.js +10 -0
  91. package/lib/chunk-AMBFWPZ4.js +118 -0
  92. package/lib/chunk-BOBPVAX2.js +37088 -0
  93. package/lib/chunk-BOBPVAX2.js.LEGAL.txt +27 -0
  94. package/lib/chunk-BRK4MXXO.js +565 -0
  95. package/lib/chunk-C35KIPAR.js +247 -0
  96. package/lib/chunk-CDEPYU7W.js +25 -0
  97. package/lib/chunk-CMUWRPSQ.js +113 -0
  98. package/lib/chunk-DDV6JEC2.js +46 -0
  99. package/lib/chunk-DHHQKW4F.js +71 -0
  100. package/lib/chunk-EIT4ZDT4.js +1485 -0
  101. package/lib/chunk-EZZUUPI4.js +20 -0
  102. package/lib/chunk-F65YUXZ7.js +334 -0
  103. package/lib/chunk-FVZ5JBRI.js +115 -0
  104. package/lib/chunk-FYGE634X.js +44 -0
  105. package/lib/chunk-GOE4ZSAB.js +75 -0
  106. package/lib/chunk-GSKVRAHF.js +44 -0
  107. package/lib/chunk-HR2RU2LY.js +999 -0
  108. package/lib/chunk-HXCLCXRT.js +20 -0
  109. package/lib/chunk-I3PS26CI.js +48 -0
  110. package/lib/chunk-IAFM5ITE.js +11 -0
  111. package/lib/chunk-IRHRK7XB.js +54 -0
  112. package/lib/chunk-JRT7TQQP.js +57 -0
  113. package/lib/chunk-JSPSMIJ2.js +217 -0
  114. package/lib/chunk-KBGE5MCY.js +175 -0
  115. package/lib/chunk-N5QTGQ5N.js +207 -0
  116. package/lib/chunk-NKXEPHRZ.js +136 -0
  117. package/lib/chunk-NUKCUDC4.js +146 -0
  118. package/lib/chunk-RI2L3VGO.js +376 -0
  119. package/lib/chunk-TDGBQNGW.js +251 -0
  120. package/lib/chunk-TN6EEDX2.js +3935 -0
  121. package/lib/chunk-TWCVHOKO.js +1229 -0
  122. package/lib/chunk-UGEGUUBT.js +29 -0
  123. package/lib/chunk-UU43WIZG.js +29 -0
  124. package/lib/chunk-VJWQSYEG.js +119 -0
  125. package/lib/chunk-VVPZ5PDP.js +160 -0
  126. package/lib/chunk-WMOVCQO6.js +1287 -0
  127. package/lib/chunk-WP3RPVUM.js +211 -0
  128. package/lib/chunk-YSH2NMIE.js +502 -0
  129. package/lib/cli.js +540 -0
  130. package/lib/elements.js +180 -3
  131. package/lib/image.js +27 -3
  132. package/lib/links.js +464 -3
  133. package/lib/minify.js +69 -3
  134. package/lib/redirects.js +152 -3
  135. package/lib/rss.js +139 -3
  136. package/lib/sass.js +221 -3
  137. package/lib/sitemap.js +88 -3
  138. package/lib/ssqch.js +28 -0
  139. package/package.json +83 -80
  140. package/src/serve/live.js +174 -0
  141. package/src/serve/not-found.html +31 -0
  142. package/types/globals.d.ts +3 -2
  143. package/types/image.d.ts +7 -3
  144. package/types/index.d.ts +18 -5
  145. package/types/links.d.ts +1 -1
  146. package/types/minify.d.ts +1 -1
  147. package/types/rss.d.ts +1 -1
  148. package/types/sass.d.ts +1 -1
  149. package/wasm/markdown.wasm +0 -0
  150. package/wasm/minify.wasm +0 -0
  151. package/wasm/sass.wasm +0 -0
  152. package/lib/index.js +0 -3
  153. package/platforms.json +0 -6
@@ -0,0 +1,41 @@
1
+ Bundled license information:
2
+
3
+ smol-toml/dist/error.js:
4
+ smol-toml/dist/primitive.js:
5
+ smol-toml/dist/date.js:
6
+ smol-toml/dist/extract.js:
7
+ smol-toml/dist/util.js:
8
+ smol-toml/dist/struct.js:
9
+ smol-toml/dist/parse.js:
10
+ smol-toml/dist/stringify.js:
11
+ smol-toml/dist/index.js:
12
+ /*!
13
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ *
16
+ * Redistribution and use in source and binary forms, with or without
17
+ * modification, are permitted provided that the following conditions are met:
18
+ *
19
+ * 1. Redistributions of source code must retain the above copyright notice, this
20
+ * list of conditions and the following disclaimer.
21
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
22
+ * this list of conditions and the following disclaimer in the
23
+ * documentation and/or other materials provided with the distribution.
24
+ * 3. Neither the name of the copyright holder nor the names of its contributors
25
+ * may be used to endorse or promote products derived from this software without
26
+ * specific prior written permission.
27
+ *
28
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ */
39
+
40
+ js-yaml/dist/js-yaml.mjs:
41
+ /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
@@ -0,0 +1,10 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+
4
+ // src/version.ts
5
+ import fs from "node:fs";
6
+ var VERSION = JSON.parse(fs.readFileSync(new URL("../package.json", new URL("../src/version.ts", import.meta.url).href), "utf8")).version;
7
+
8
+ export {
9
+ VERSION
10
+ };
@@ -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-WP3RPVUM.js";
6
+ import {
7
+ DEFAULTS,
8
+ configOptions
9
+ } from "./chunk-TN6EEDX2.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-6XYSFG6V.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
+ };