ssqch 0.7.1 → 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
package/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # ssqch
2
2
 
3
- [SiteSquatch](https://github.com/reverentgeek/sitesquatch) is a fast static site generator, written in Rust and configured with JavaScript (`ssqch.config.js`). This package installs the prebuilt `ssqch` binary for your platform, so a site can pin it as a dev dependency:
3
+ [SiteSquatch](https://github.com/reverentgeek/sitesquatch) is a fast static site generator, configured with JavaScript (`ssqch.config.js`). It runs on Node.js 22.18 or newer. Install it in a site as a dev dependency, so the lockfile pins the version:
4
4
 
5
5
  ```sh
6
6
  npm install --save-dev ssqch
7
7
  npx ssqch build
8
8
  ```
9
9
 
10
- Or with pnpm (`pnpm add -D ssqch`, `pnpm ssqch build`) or yarn. In `package.json` scripts, call it by name: `"build": "ssqch build"`.
10
+ Or with pnpm (`pnpm add -D ssqch`, `pnpm ssqch build`) or yarn. In `package.json` scripts, call it by name: `"build": "ssqch build"`. `npx ssqch init` starts a new site.
11
11
 
12
- The binary comes from an optional dependency for your platform (`@ssqch/darwin-arm64`, `@ssqch/darwin-x64`, `@ssqch/linux-x64` or `@ssqch/win32-x64`). Installing runs no scripts and downloads nothing beyond the packages. The Linux binary is statically linked, so it runs on any distribution, Alpine included. On other platforms, install from source with `cargo install ssqch --locked`.
12
+ The package is JavaScript, with its template and Markdown libraries bundled in, and its Markdown, highlighter, minifier and Sass as WebAssembly, so it's the same on every platform. Installing it brings one other package: [sharp](https://sharp.pixelplumbing.com), which encodes images.
13
13
 
14
- See the [README](https://github.com/reverentgeek/sitesquatch#readme) for everything else, including the other ways to install it.
14
+ The modules a config imports (`ssqch`, `ssqch/image` and the rest) are in the package's `exports` map, with their types, so editors, TypeScript and ESLint's `n/no-missing-import` find them.
15
+
16
+ Outside a site, `npm install --global ssqch` puts `ssqch` on your `PATH`, and Homebrew (`brew install reverentgeek/tap/ssqch`) installs this package with Homebrew's own Node. See the [README](https://github.com/reverentgeek/sitesquatch#readme) for everything else.
package/bin/ssqch.js CHANGED
@@ -1,50 +1,16 @@
1
1
  #!/usr/bin/env node
2
- // Runs the ssqch binary from the platform package that npm, pnpm or yarn
3
- // installed next to this one (`@ssqch/<platform>-<arch>`, an optional
4
- // dependency limited to its `os` and `cpu`, so only the matching one installs).
5
- "use strict";
2
+ import { createRequire as __ssqchCreateRequire } from "node:module";
3
+ const require = __ssqchCreateRequire(import.meta.url);
6
4
 
7
- const { spawn } = require("node:child_process");
8
- const platforms = require("../platforms.json");
9
-
10
- const key = `${process.platform}-${process.arch}`;
11
- const exe = process.platform === "win32" ? "ssqch.exe" : "ssqch";
12
-
13
- function fail(message) {
14
- process.stderr.write(`ssqch: ${message}\n`);
15
- process.exit(1);
16
- }
17
-
18
- function findBinary() {
19
- if (!platforms[key]) {
20
- fail(`no prebuilt binary for ${key}. The npm package covers ${Object.keys(platforms).join(", ")}. Build it from source with \`cargo install ssqch --locked\`; see https://github.com/reverentgeek/sitesquatch#install`);
21
- }
22
- const pkg = `@ssqch/${key}`;
23
- try {
24
- return require.resolve(`${pkg}/bin/${exe}`);
25
- } catch {
26
- const { version } = require("../package.json");
27
- fail(`${pkg} isn't installed, so there's no binary to run. It's an optional dependency of ssqch, and npm skips one it can't download: check that ${pkg}@${version} is on the registry, and reinstall without \`--no-optional\` or \`--omit=optional\` (with a lockfile made on another platform, run the install again here). Tracks lead here, but nobody's home.`);
28
- }
29
- }
30
-
31
- const binary = findBinary();
32
- const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
33
-
34
- // A terminal's Ctrl-C reaches both processes, but a process manager (concurrently,
35
- // a container, CI) signals only this one: pass it on, so `ssqch serve` stops too.
36
- const forwarded = ["SIGINT", "SIGTERM", "SIGHUP"];
37
- for (const signal of forwarded) {
38
- process.on(signal, () => child.kill(signal));
39
- }
40
-
41
- child.on("error", (error) => fail(`couldn't run ${binary}: ${error.message}`));
42
- child.on("exit", (code, signal) => {
43
- if (signal) {
44
- // Exit the way the binary did.
45
- for (const s of forwarded) process.removeAllListeners(s);
46
- process.kill(process.pid, signal);
47
- return;
48
- }
49
- process.exit(code ?? 1);
50
- });
5
+ // bin/ssqch.ts
6
+ import module from "node:module";
7
+ import os from "node:os";
8
+ process.env.UV_THREADPOOL_SIZE ??= String(os.availableParallelism() + 4);
9
+ module.enableCompileCache?.();
10
+ var { main, crashed } = await import("../lib/cli.js");
11
+ process.on("uncaughtException", crashed);
12
+ process.on("unhandledRejection", crashed);
13
+ var code = await main(process.argv.slice(2));
14
+ process.exitCode = code;
15
+ await Promise.all([process.stdout, process.stderr].map((stream) => new Promise((resolve) => stream.write("", resolve))));
16
+ process.exit(code);