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.
- package/README.md +8 -4
- package/bin/ssqch.js +14 -48
- package/bundled/README.md +1314 -0
- package/bundled/completions/bash +840 -0
- package/bundled/completions/elvish +286 -0
- package/bundled/completions/fish +182 -0
- package/bundled/completions/powershell +318 -0
- package/bundled/completions/zsh +510 -0
- package/bundled/ssqch.d.ts +540 -0
- package/bundled/starter/engines/index.edge +11 -0
- package/bundled/starter/engines/index.ejs +11 -0
- package/bundled/starter/engines/index.hbs +11 -0
- package/bundled/starter/engines/index.liquid +11 -0
- package/bundled/starter/engines/layout.edge +35 -0
- package/bundled/starter/engines/layout.ejs +35 -0
- package/bundled/starter/engines/layout.hbs +35 -0
- package/bundled/starter/engines/layout.liquid +35 -0
- package/bundled/starter/gitignore +3 -0
- package/bundled/starter/jsconfig.json +11 -0
- package/bundled/starter/src/404.md +8 -0
- package/bundled/starter/src/_blueprints/posts.md +5 -0
- package/bundled/starter/src/_data/site.json +4 -0
- package/bundled/starter/src/_includes/layout.jinja +35 -0
- package/bundled/starter/src/index.jinja +11 -0
- package/bundled/starter/src/posts/i-know-what-i-saw.md +11 -0
- package/bundled/starter/src/posts/posts.json +4 -0
- package/bundled/starter/src/posts/raiders-of-the-lost-path.md +27 -0
- package/bundled/starter/src/posts/the-cache-of-the-wild.md +26 -0
- package/bundled/starter/src/posts/the-stump-has-moved.md +15 -0
- package/bundled/starter/src/posts/upon-further-review-a-stump.md +18 -0
- package/bundled/starter/ssqch.config.js +29 -0
- package/bundled/starter-docs/engines/edge/base.edge +41 -0
- package/bundled/starter-docs/engines/edge/containers/details.edge +5 -0
- package/bundled/starter-docs/engines/edge/containers/tab.edge +4 -0
- package/bundled/starter-docs/engines/edge/containers/tabs.edge +5 -0
- package/bundled/starter-docs/engines/edge/doc.edge +59 -0
- package/bundled/starter-docs/engines/edge/hooks/heading.edge +2 -0
- package/bundled/starter-docs/engines/ejs/base.ejs +41 -0
- package/bundled/starter-docs/engines/ejs/containers/details.ejs +5 -0
- package/bundled/starter-docs/engines/ejs/containers/tab.ejs +4 -0
- package/bundled/starter-docs/engines/ejs/containers/tabs.ejs +5 -0
- package/bundled/starter-docs/engines/ejs/doc.ejs +59 -0
- package/bundled/starter-docs/engines/ejs/hooks/heading.ejs +2 -0
- package/bundled/starter-docs/engines/hbs/base.hbs +41 -0
- package/bundled/starter-docs/engines/hbs/containers/details.hbs +5 -0
- package/bundled/starter-docs/engines/hbs/containers/tab.hbs +4 -0
- package/bundled/starter-docs/engines/hbs/containers/tabs.hbs +5 -0
- package/bundled/starter-docs/engines/hbs/doc.hbs +58 -0
- package/bundled/starter-docs/engines/hbs/hooks/heading.hbs +2 -0
- package/bundled/starter-docs/engines/liquid/base.liquid +41 -0
- package/bundled/starter-docs/engines/liquid/containers/details.liquid +5 -0
- package/bundled/starter-docs/engines/liquid/containers/tab.liquid +4 -0
- package/bundled/starter-docs/engines/liquid/containers/tabs.liquid +5 -0
- package/bundled/starter-docs/engines/liquid/doc.liquid +60 -0
- package/bundled/starter-docs/engines/liquid/hooks/heading.liquid +2 -0
- package/bundled/starter-docs/gitignore +4 -0
- package/bundled/starter-docs/src/404.md +12 -0
- package/bundled/starter-docs/src/_blueprints/docs.md +5 -0
- package/bundled/starter-docs/src/_data/nav.yml +10 -0
- package/bundled/starter-docs/src/_data/site.json +5 -0
- package/bundled/starter-docs/src/_includes/base.jinja +41 -0
- package/bundled/starter-docs/src/_includes/containers/details.jinja +5 -0
- package/bundled/starter-docs/src/_includes/containers/tab.jinja +4 -0
- package/bundled/starter-docs/src/_includes/containers/tabs.jinja +5 -0
- package/bundled/starter-docs/src/_includes/doc.jinja +59 -0
- package/bundled/starter-docs/src/_includes/hooks/heading.jinja +2 -0
- package/bundled/starter-docs/src/assets/docs.css +257 -0
- package/bundled/starter-docs/src/assets/docs.js +67 -0
- package/bundled/starter-docs/src/docs/docs.json +1 -0
- package/bundled/starter-docs/src/docs/guides/deploying.md +77 -0
- package/bundled/starter-docs/src/docs/guides/writing.md +65 -0
- package/bundled/starter-docs/src/docs/index.md +29 -0
- package/bundled/starter-docs/src/docs/install.md +42 -0
- package/bundled/starter-docs/src/index.md +13 -0
- package/bundled/starter-docs/ssqch.config.js +40 -0
- package/bundled/trailheads/from-component-frameworks.md +116 -0
- package/bundled/trailheads/from-docusaurus.md +55 -0
- package/bundled/trailheads/from-eleventy.md +140 -0
- package/bundled/trailheads/from-hexo.md +92 -0
- package/bundled/trailheads/from-jekyll.md +79 -0
- package/bundled/trailheads/from-mkdocs.md +45 -0
- package/bundled/trailheads/from-zola.md +71 -0
- package/lib/assets.js +235 -3
- package/lib/chunk-3A647I3N.js +384 -0
- package/lib/chunk-3GYLOC6Y.js +1017 -0
- package/lib/chunk-3K3ANWZ2.js +118 -0
- package/lib/chunk-3NYSSA2C.js +22 -0
- package/lib/chunk-47P4YREZ.js +1287 -0
- package/lib/chunk-4Q6WMTER.js +32 -0
- package/lib/chunk-76NTVE34.js +338 -0
- package/lib/chunk-7PWCYHTJ.js +1350 -0
- package/lib/chunk-7RDRZHJD.js +217 -0
- package/lib/chunk-7SD7K567.js +57 -0
- package/lib/chunk-7XLK2GEG.js +54 -0
- package/lib/chunk-AD3HAW3W.js +10 -0
- package/lib/chunk-BEGC7YP6.js +502 -0
- package/lib/chunk-CMUWRPSQ.js +113 -0
- package/lib/chunk-CZ4XQC56.js +999 -0
- package/lib/chunk-D2XE2GTY.js +71 -0
- package/lib/chunk-DDV6JEC2.js +46 -0
- package/lib/chunk-DELWRJAO.js +37409 -0
- package/lib/chunk-DELWRJAO.js.LEGAL.txt +27 -0
- package/lib/chunk-F65YUXZ7.js +334 -0
- package/lib/chunk-FVZ5JBRI.js +115 -0
- package/lib/chunk-GRWMGC7D.js +4435 -0
- package/lib/chunk-GRWMGC7D.js.LEGAL.txt +41 -0
- package/lib/chunk-GUKSZ2XM.js +207 -0
- package/lib/chunk-HPXAZ2HU.js +251 -0
- package/lib/chunk-HXCLCXRT.js +20 -0
- package/lib/chunk-I3PS26CI.js +48 -0
- package/lib/chunk-IAFM5ITE.js +11 -0
- package/lib/chunk-II5DEH3Q.js +209 -0
- package/lib/chunk-IJWHOFRP.js +44 -0
- package/lib/chunk-LPHNACE4.js +29 -0
- package/lib/chunk-MI6EJWA2.js +175 -0
- package/lib/chunk-NCWFYT74.js +1541 -0
- package/lib/chunk-NKXEPHRZ.js +136 -0
- package/lib/chunk-NNUKIGOO.js +160 -0
- package/lib/chunk-R7K3D5W5.js +3957 -0
- package/lib/chunk-RNJFPFXE.js +29 -0
- package/lib/chunk-SF4I6Z7S.js +25 -0
- package/lib/chunk-SURPOAW7.js +44 -0
- package/lib/chunk-SXMJ52IK.js +572 -0
- package/lib/chunk-TICWN55Z.js +20 -0
- package/lib/chunk-TVU3OPPK.js +146 -0
- package/lib/chunk-UU43WIZG.js +29 -0
- package/lib/chunk-VJWQSYEG.js +119 -0
- package/lib/chunk-XMXBHXZR.js +75 -0
- package/lib/chunk-YTHQBMDJ.js +211 -0
- package/lib/cli.js +547 -0
- package/lib/elements.js +180 -3
- package/lib/image.js +27 -3
- package/lib/links.js +464 -3
- package/lib/minify.js +69 -3
- package/lib/redirects.js +152 -3
- package/lib/rss.js +139 -3
- package/lib/sass.js +256 -3
- package/lib/sitemap.js +113 -3
- package/lib/ssqch.js +28 -0
- package/package.json +83 -80
- package/src/serve/live.js +174 -0
- package/src/serve/not-found.html +31 -0
- package/types/globals.d.ts +3 -2
- package/types/image.d.ts +7 -3
- package/types/index.d.ts +28 -9
- package/types/links.d.ts +1 -1
- package/types/minify.d.ts +1 -1
- package/types/rss.d.ts +1 -1
- package/types/sass.d.ts +1 -1
- package/types/sitemap.d.ts +2 -0
- package/wasm/markdown.wasm +0 -0
- package/wasm/minify.wasm +0 -0
- package/wasm/sass.wasm +0 -0
- package/lib/index.js +0 -3
- package/platforms.json +0 -6
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
2
|
+
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
types,
|
|
5
|
+
write
|
|
6
|
+
} from "./chunk-YTHQBMDJ.js";
|
|
7
|
+
import {
|
|
8
|
+
loadConfig,
|
|
9
|
+
schemaTypes
|
|
10
|
+
} from "./chunk-R7K3D5W5.js";
|
|
11
|
+
import "./chunk-7XLK2GEG.js";
|
|
12
|
+
import "./chunk-NKXEPHRZ.js";
|
|
13
|
+
import "./chunk-AD3HAW3W.js";
|
|
14
|
+
import "./chunk-DDV6JEC2.js";
|
|
15
|
+
import "./chunk-NCWFYT74.js";
|
|
16
|
+
import "./chunk-FVZ5JBRI.js";
|
|
17
|
+
import "./chunk-HPXAZ2HU.js";
|
|
18
|
+
import "./chunk-UU43WIZG.js";
|
|
19
|
+
import "./chunk-76NTVE34.js";
|
|
20
|
+
import "./chunk-CMUWRPSQ.js";
|
|
21
|
+
import {
|
|
22
|
+
messageOf,
|
|
23
|
+
red
|
|
24
|
+
} from "./chunk-GRWMGC7D.js";
|
|
25
|
+
import "./chunk-VJWQSYEG.js";
|
|
26
|
+
import "./chunk-I3PS26CI.js";
|
|
27
|
+
|
|
28
|
+
// src/commands/types.ts
|
|
29
|
+
import path from "node:path";
|
|
30
|
+
function schemaDeclarations(schemas) {
|
|
31
|
+
if (schemas.length === 0) return "";
|
|
32
|
+
let out = '\n// This site\'s `schemas`. Run `ssqch types` again after changing them.\ndeclare module "ssqch" {\n interface Schemas {\n';
|
|
33
|
+
for (const [name, typescript] of schemas) {
|
|
34
|
+
const plain = /^[A-Za-z0-9_]+$/.test(name) && !/^\d/.test(name);
|
|
35
|
+
out += ` ${plain ? name : JSON.stringify(name)}: ${typescript};
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
return out + " }\n}\n";
|
|
39
|
+
}
|
|
40
|
+
async function runTypes(options) {
|
|
41
|
+
const { root } = options;
|
|
42
|
+
const out = root !== void 0 && !path.isAbsolute(options.out) ? /[\\/]$/.test(root) ? root + options.out : root + path.sep + options.out : options.out;
|
|
43
|
+
const file = path.resolve(out);
|
|
44
|
+
let text = types();
|
|
45
|
+
let schemas = 0;
|
|
46
|
+
try {
|
|
47
|
+
const env = "development";
|
|
48
|
+
const config = await loadConfig({ root: root ?? ".", env, quiet: true });
|
|
49
|
+
const found = await schemaTypes(config);
|
|
50
|
+
schemas = found.length;
|
|
51
|
+
text += schemaDeclarations(found);
|
|
52
|
+
} catch (e) {
|
|
53
|
+
process.stderr.write(`warn: couldn't read the site's config, so its schemas aren't in the types: ${messageOf(e)}
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
write(file, text, out);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
process.stderr.write(`${red("error:")} ${e.message}
|
|
60
|
+
`);
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
const withSchemas = schemas === 0 ? "" : schemas === 1 ? " (with 1 schema)" : ` (with ${schemas} schemas)`;
|
|
64
|
+
process.stdout.write(`Wrote ${out}${withSchemas}. List it in jsconfig.json's "include" so editors pick it up.
|
|
65
|
+
`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
runTypes,
|
|
70
|
+
schemaDeclarations
|
|
71
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
2
|
+
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
slashes
|
|
5
|
+
} from "./chunk-VJWQSYEG.js";
|
|
6
|
+
|
|
7
|
+
// src/dirs.ts
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
var CONFIG_FILES = ["ssqch.config.js", "ssqch.config.mjs", "ssqch.config.cjs", "ssqch.config.ts", "ssqch.config.mts"];
|
|
11
|
+
function dirsOf(config) {
|
|
12
|
+
const input = path.resolve(config.root, config.input);
|
|
13
|
+
return {
|
|
14
|
+
root: config.root,
|
|
15
|
+
input,
|
|
16
|
+
output: path.resolve(config.root, config.output),
|
|
17
|
+
includes: path.resolve(input, config.includes),
|
|
18
|
+
layouts: path.resolve(input, config.layouts ?? config.includes),
|
|
19
|
+
data: path.resolve(input, config.data)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function shownDir(config, configured) {
|
|
23
|
+
if (path.isAbsolute(configured)) return configured;
|
|
24
|
+
const base = fs.existsSync(config.root) ? config.root : config.rootGiven;
|
|
25
|
+
return /[\\/]$/.test(base) ? base + configured : base + path.sep + configured;
|
|
26
|
+
}
|
|
27
|
+
function shownOutput(config, native = false) {
|
|
28
|
+
const output = path.resolve(config.root, config.output);
|
|
29
|
+
const inside = output === config.root || output.startsWith(config.root + path.sep);
|
|
30
|
+
const shown = path.isAbsolute(config.output) && !inside ? output : path.relative(config.root, output);
|
|
31
|
+
return native ? shown : slashes(shown);
|
|
32
|
+
}
|
|
33
|
+
function parseEnvironment(s) {
|
|
34
|
+
const name = s.toLowerCase();
|
|
35
|
+
if (name === "dev" || name === "development") return "development";
|
|
36
|
+
if (name === "prod" || name === "production") return "production";
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
CONFIG_FILES,
|
|
42
|
+
dirsOf,
|
|
43
|
+
shownDir,
|
|
44
|
+
shownOutput,
|
|
45
|
+
parseEnvironment
|
|
46
|
+
};
|