ssqch 0.12.0 → 0.13.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/bundled/completions/bash +66 -8
- package/bundled/completions/elvish +23 -4
- package/bundled/completions/fish +36 -25
- package/bundled/completions/powershell +25 -4
- package/bundled/completions/zsh +44 -10
- package/bundled/docs/agents.md +2 -2
- package/bundled/docs/build-summary.md +1 -1
- package/bundled/docs/comparing-builds.md +2 -2
- package/bundled/docs/configuring.md +3 -6
- package/bundled/docs/deploying.md +1 -1
- package/bundled/docs/field-guide.md +4 -4
- package/bundled/docs/github-pages.md +1 -0
- package/bundled/docs/index.md +1 -1
- package/bundled/docs/install.md +1 -1
- package/bundled/docs/known-gaps.md +1 -1
- package/bundled/docs/markdown.md +8 -12
- package/bundled/docs/nav.yml +5 -1
- package/bundled/docs/netlify.md +4 -2
- package/bundled/docs/patrol.md +48 -0
- package/bundled/docs/plugins.md +6 -6
- package/bundled/docs/robots.md +72 -0
- package/bundled/docs/seo.md +2 -38
- package/bundled/docs/serving-markdown.md +142 -0
- package/bundled/docs/template-languages.md +1 -1
- package/bundled/docs/templates.md +1 -1
- package/bundled/docs/trailheads/from-hugo.md +5 -3
- package/bundled/docs/trailheads/from-jekyll.md +54 -13
- package/bundled/docs/trailheads/from-mkdocs.md +15 -12
- package/bundled/docs/trailheads/from-vitepress.md +13 -11
- package/bundled/docs/trailheads.md +3 -3
- package/bundled/docs/where-values-come-from.md +5 -5
- package/bundled/docs/writing-plugins.md +69 -0
- package/bundled/ssqch.d.ts +111 -43
- package/bundled/starter/engines/index.edge +1 -0
- package/bundled/starter/engines/index.ejs +1 -0
- package/bundled/starter/engines/index.hbs +1 -0
- package/bundled/starter/engines/index.liquid +1 -0
- package/bundled/starter/engines/layout.edge +7 -0
- package/bundled/starter/engines/layout.ejs +4 -0
- package/bundled/starter/engines/layout.hbs +4 -0
- package/bundled/starter/engines/layout.liquid +4 -0
- package/bundled/starter/src/_data/site.json +1 -0
- package/bundled/starter/src/_includes/layout.jinja +4 -0
- package/bundled/starter/src/index.jinja +1 -0
- package/bundled/starter/ssqch.config.js +14 -1
- package/bundled/starter-docs/engines/edge/base.edge +7 -0
- package/bundled/starter-docs/engines/edge/doc.edge +4 -0
- package/bundled/starter-docs/engines/ejs/base.ejs +4 -0
- package/bundled/starter-docs/engines/ejs/doc.ejs +4 -0
- package/bundled/starter-docs/engines/hbs/base.hbs +4 -0
- package/bundled/starter-docs/engines/hbs/doc.hbs +3 -0
- package/bundled/starter-docs/engines/liquid/base.liquid +4 -0
- package/bundled/starter-docs/engines/liquid/doc.liquid +4 -0
- package/bundled/starter-docs/src/_data/site.json +1 -0
- package/bundled/starter-docs/src/_includes/base.jinja +4 -0
- package/bundled/starter-docs/src/_includes/doc.jinja +4 -0
- package/bundled/starter-docs/src/assets/docs.css +4 -0
- package/bundled/starter-docs/src/assets/docs.js +17 -0
- package/bundled/starter-docs/ssqch.config.js +14 -1
- package/lib/assets.js +9 -9
- package/lib/chunk-25WERNDD.js +112 -0
- package/lib/{chunk-4ZMNLWE4.js → chunk-2BJFGKOE.js} +2 -2
- package/lib/chunk-2FKYWYAB.js +268 -0
- package/lib/{chunk-M2BBE2C3.js → chunk-3ZTRIO6O.js} +18 -17
- package/lib/{chunk-57HLSKZS.js → chunk-4AZFCSGJ.js} +2 -2
- package/lib/{chunk-ULQHJ4TS.js → chunk-55WXDGO4.js} +3 -3
- package/lib/{chunk-JX43SJHU.js → chunk-6FY77I4M.js} +24 -22
- package/lib/{chunk-RY3KLUQ3.js → chunk-6OUCRDYI.js} +267 -202
- package/lib/{chunk-EVFNYUTR.js → chunk-6U5VIQVY.js} +5 -5
- package/lib/{chunk-N3IZ44XY.js → chunk-7U5GWTEH.js} +88 -54
- package/lib/{chunk-VTYQ3JKL.js → chunk-AIJNG6MJ.js} +2 -2
- package/lib/{chunk-IIBZPHAW.js → chunk-C2Q7JKFI.js} +8 -8
- package/lib/{chunk-6CSH757V.js → chunk-DFJFHULZ.js} +33 -8
- package/lib/{chunk-XVV7JJK7.js → chunk-ENWDM2RW.js} +40 -39
- package/lib/{chunk-JUALMFW3.js → chunk-ER72RPD6.js} +1 -1
- package/lib/{chunk-RFREB3SI.js → chunk-F3JPNFCZ.js} +7 -7
- package/lib/{chunk-LLOA3QXV.js → chunk-FENJHLNM.js} +3 -2
- package/lib/{chunk-UU43WIZG.js → chunk-FJML7INB.js} +4 -2
- package/lib/{chunk-IZCF4UH3.js → chunk-FQZDUDFK.js} +1 -1
- package/lib/{chunk-GVHQ37JE.js → chunk-GSNRAGKQ.js} +10 -5
- package/lib/{chunk-L2IY4P6O.js → chunk-GU7BBYWB.js} +3 -3
- package/lib/{chunk-RGYJQYW3.js → chunk-HDKU6LRI.js} +32 -5
- package/lib/{chunk-IQUGLVZY.js → chunk-K5WZ2VYK.js} +4 -4
- package/lib/{chunk-JVT5ZRRH.js → chunk-OOKBXQAY.js} +5 -5
- package/lib/{chunk-MOLTDO5A.js → chunk-SNQOHNXE.js} +1 -1
- package/lib/{chunk-Z3XH4KWX.js → chunk-SPIFZBIW.js} +1 -1
- package/lib/{chunk-FNNXRVSU.js → chunk-T5IUI7W7.js} +10 -10
- package/lib/{chunk-5HEZ3WUQ.js → chunk-TGSVSG2G.js} +2 -2
- package/lib/{chunk-3GROJ3TY.js → chunk-U2KEMVXO.js} +24 -17
- package/lib/{chunk-4B3N44SN.js → chunk-UHRBPZ4A.js} +3 -3
- package/lib/{chunk-GWWA5Y3X.js → chunk-ULCT3PAV.js} +1 -1
- package/lib/{chunk-7RGEWDLF.js → chunk-UZNUS7RP.js} +10 -8
- package/lib/{chunk-DZ5F5XSI.js → chunk-V3G2QGL3.js} +10 -105
- package/lib/{chunk-DOHOKUGB.js → chunk-VILOEVK7.js} +50 -26
- package/lib/{chunk-DXMDXHV7.js → chunk-WGAIE3DD.js} +15 -14
- package/lib/{chunk-G3RFQDKO.js → chunk-WUCRAV36.js} +8 -6
- package/lib/{chunk-52ROOMBZ.js → chunk-XYAWJTHM.js} +9 -9
- package/lib/{chunk-L3K7MMFC.js → chunk-YA23NDMW.js} +2 -2
- package/lib/{chunk-R7PBREXL.js → chunk-YNJNMQWU.js} +8 -5
- package/lib/{chunk-AK7ZKSZP.js → chunk-ZMG25MXF.js} +17 -16
- package/lib/cli.js +56 -34
- package/lib/elements.js +9 -9
- package/lib/from-hugo.js +36 -0
- package/lib/from-jekyll.js +41 -0
- package/lib/from-mkdocs.js +49 -0
- package/lib/from-vitepress.js +49 -0
- package/lib/image.js +10 -10
- package/lib/links.js +9 -9
- package/lib/llms.js +521 -47
- package/lib/minify.js +10 -10
- package/lib/redirects.js +9 -9
- package/lib/robots.js +87 -0
- package/lib/rss.js +22 -12
- package/lib/sass.js +10 -10
- package/lib/sitemap.js +22 -33
- package/lib/ssqch.js +5 -5
- package/lib/vue.js +14 -13
- package/package.json +21 -1
- package/types/from-hugo.d.ts +5 -0
- package/types/from-jekyll.d.ts +11 -0
- package/types/from-mkdocs.d.ts +11 -0
- package/types/from-vitepress.d.ts +5 -0
- package/types/index.d.ts +45 -29
- package/types/llms.d.ts +12 -8
- package/types/robots.d.ts +13 -0
- package/types/sass.d.ts +1 -1
- package/types/sitemap.d.ts +3 -5
- package/wasm/markdown.wasm +0 -0
- /package/lib/{chunk-JX43SJHU.js.LEGAL.txt → chunk-6FY77I4M.js.LEGAL.txt} +0 -0
- /package/lib/{chunk-R7PBREXL.js.LEGAL.txt → chunk-YNJNMQWU.js.LEGAL.txt} +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
tracePages
|
|
5
|
+
} from "./chunk-6FY77I4M.js";
|
|
6
|
+
import "./chunk-YA23NDMW.js";
|
|
7
|
+
import "./chunk-V3G2QGL3.js";
|
|
8
8
|
import "./chunk-4Q6WMTER.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-UHRBPZ4A.js";
|
|
10
|
+
import "./chunk-25WERNDD.js";
|
|
11
|
+
import "./chunk-VILOEVK7.js";
|
|
12
|
+
import "./chunk-ULCT3PAV.js";
|
|
13
|
+
import "./chunk-6U5VIQVY.js";
|
|
13
14
|
import "./chunk-AD3HAW3W.js";
|
|
14
15
|
import "./chunk-YCOTX2VM.js";
|
|
15
16
|
import "./chunk-DDV6JEC2.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-6OUCRDYI.js";
|
|
18
|
+
import "./chunk-SPIFZBIW.js";
|
|
17
19
|
import "./chunk-FVZ5JBRI.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-57HLSKZS.js";
|
|
20
|
+
import "./chunk-FJML7INB.js";
|
|
21
|
+
import "./chunk-4AZFCSGJ.js";
|
|
21
22
|
import {
|
|
22
23
|
charCount,
|
|
23
24
|
firstChars,
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
import {
|
|
31
32
|
bail,
|
|
32
33
|
getPath
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YNJNMQWU.js";
|
|
34
35
|
import {
|
|
35
36
|
comparePaths,
|
|
36
37
|
compareText,
|
|
@@ -39,7 +40,7 @@ import {
|
|
|
39
40
|
} from "./chunk-VJWQSYEG.js";
|
|
40
41
|
import "./chunk-I3PS26CI.js";
|
|
41
42
|
|
|
42
|
-
// src/
|
|
43
|
+
// src/trace.ts
|
|
43
44
|
import fs from "node:fs";
|
|
44
45
|
import path from "node:path";
|
|
45
46
|
var has = (data, key) => data !== null && typeof data === "object" && Object.prototype.hasOwnProperty.call(data, key);
|
|
@@ -83,8 +84,8 @@ function fieldsOf(config, dirs, global, page) {
|
|
|
83
84
|
}
|
|
84
85
|
return out;
|
|
85
86
|
}
|
|
86
|
-
async function
|
|
87
|
-
const { dirs, global, pages } = await
|
|
87
|
+
async function trace(config, target) {
|
|
88
|
+
const { dirs, global, pages } = await tracePages(config);
|
|
88
89
|
const trim = (u) => {
|
|
89
90
|
const rest = u.endsWith("index.html") ? u.slice(0, -10) : void 0;
|
|
90
91
|
return (rest !== void 0 && rest.endsWith("/") ? rest : u).replace(/\/+$/, "");
|
|
@@ -151,30 +152,30 @@ function valueAt(value, key) {
|
|
|
151
152
|
if (value instanceof Date || typeof value === "function") return void 0;
|
|
152
153
|
return has(value, key) ? value[key] : void 0;
|
|
153
154
|
}
|
|
154
|
-
function field(
|
|
155
|
+
function field(traced, dotted) {
|
|
155
156
|
const at = dotted.indexOf(".");
|
|
156
157
|
const [top, rest] = at === -1 ? [dotted, ""] : [dotted.slice(0, at), dotted.slice(at + 1)];
|
|
157
|
-
const found =
|
|
158
|
+
const found = traced.fields.find((f) => f.name === top);
|
|
158
159
|
if (!found || rest === "") return found;
|
|
159
160
|
const pathIn = (v) => rest.split(".").reduce(valueAt, v);
|
|
160
161
|
const setBy = found.setBy.filter((s) => !nullish(pathIn(s.value))).map((s) => ({ from: s.from, value: pathIn(s.value) }));
|
|
161
162
|
return { name: dotted, value: pathIn(found.value), from: setBy.length ? setBy[setBy.length - 1].from : found.from, setBy };
|
|
162
163
|
}
|
|
163
|
-
function
|
|
164
|
-
let out = `${
|
|
164
|
+
function traceText(traced) {
|
|
165
|
+
let out = `${traced.url ?? "(no URL: permalink is false)"}
|
|
165
166
|
`;
|
|
166
167
|
const row = (label, value) => {
|
|
167
168
|
out += ` ${padEnd(label, 12)}${value}
|
|
168
169
|
`;
|
|
169
170
|
};
|
|
170
|
-
row("From", `${
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
row("Date", `${
|
|
174
|
-
row("Collections",
|
|
171
|
+
row("From", `${traced.inputPath} (${traced.engines.length ? traced.engines.join(", ") : "as it is"})`);
|
|
172
|
+
if (traced.outputPath !== null) row("Writes", traced.outputPath);
|
|
173
|
+
if (traced.layouts.length) row("Layouts", traced.layouts.join(" > "));
|
|
174
|
+
row("Date", `${traced.date} (from ${traced.dateFrom})`);
|
|
175
|
+
row("Collections", traced.collections.length ? traced.collections.join(", ") : "none");
|
|
175
176
|
out += "\n Data (name, value, and the level of the cascade that set it)\n";
|
|
176
|
-
const width = Math.min(24, Math.max(0, ...
|
|
177
|
-
for (const f of
|
|
177
|
+
const width = Math.min(24, Math.max(0, ...traced.fields.map((f) => charCount(f.name))));
|
|
178
|
+
for (const f of traced.fields) {
|
|
178
179
|
const overrides = f.setBy.length > 1 ? ` (over ${f.setBy.slice(0, -1).map((s) => s.from).join(", ")})` : "";
|
|
179
180
|
out += ` ${padEnd(f.name, width)} ${padEnd(brief(f.value), 52)} ${f.from}${overrides}
|
|
180
181
|
`;
|
|
@@ -195,25 +196,25 @@ function fieldText(f) {
|
|
|
195
196
|
return out;
|
|
196
197
|
}
|
|
197
198
|
var setByJson = (f) => f.setBy.map((s) => ({ from: s.from, value: toJsonValue(s.value) }));
|
|
198
|
-
function
|
|
199
|
+
function traceJson(traced, one) {
|
|
199
200
|
const out = {
|
|
200
201
|
schemaVersion: 1,
|
|
201
|
-
url:
|
|
202
|
-
inputPath:
|
|
203
|
-
outputPath:
|
|
204
|
-
engines:
|
|
205
|
-
layouts:
|
|
206
|
-
date: { value:
|
|
207
|
-
collections:
|
|
202
|
+
url: traced.url,
|
|
203
|
+
inputPath: traced.inputPath,
|
|
204
|
+
outputPath: traced.outputPath,
|
|
205
|
+
engines: traced.engines,
|
|
206
|
+
layouts: traced.layouts,
|
|
207
|
+
date: { value: traced.date, from: traced.dateFrom },
|
|
208
|
+
collections: traced.collections
|
|
208
209
|
};
|
|
209
210
|
if (one) out.field = { name: one.name, value: toJsonValue(one.value), from: one.from, setBy: setByJson(one) };
|
|
210
|
-
else out.data = Object.fromEntries(
|
|
211
|
+
else out.data = Object.fromEntries(traced.fields.map((f) => [f.name, { value: toJsonValue(f.value), from: f.from, setBy: setByJson(f) }]));
|
|
211
212
|
return out;
|
|
212
213
|
}
|
|
213
214
|
export {
|
|
214
215
|
field,
|
|
215
216
|
fieldText,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
trace,
|
|
218
|
+
traceJson,
|
|
219
|
+
traceText
|
|
219
220
|
};
|
|
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
red
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YNJNMQWU.js";
|
|
6
6
|
|
|
7
7
|
// src/serve/builder.ts
|
|
8
8
|
import { fork } from "node:child_process";
|
|
@@ -3,18 +3,18 @@ const require = __ssqchCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
baselineTime,
|
|
5
5
|
runBaseline
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2BJFGKOE.js";
|
|
7
7
|
import "./chunk-4Q6WMTER.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-HDKU6LRI.js";
|
|
9
9
|
import "./chunk-P2WS4RM4.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-UHRBPZ4A.js";
|
|
11
|
+
import "./chunk-ULCT3PAV.js";
|
|
12
|
+
import "./chunk-6U5VIQVY.js";
|
|
13
13
|
import "./chunk-DDV6JEC2.js";
|
|
14
14
|
import "./chunk-FVZ5JBRI.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-FJML7INB.js";
|
|
16
16
|
import "./chunk-CMUWRPSQ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-YNJNMQWU.js";
|
|
18
18
|
import "./chunk-VJWQSYEG.js";
|
|
19
19
|
import "./chunk-I3PS26CI.js";
|
|
20
20
|
export {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-YCOTX2VM.js";
|
|
7
7
|
import {
|
|
8
8
|
red
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YNJNMQWU.js";
|
|
10
10
|
import {
|
|
11
11
|
joinAsGiven,
|
|
12
12
|
parentAsGiven,
|
|
@@ -107,7 +107,8 @@ This site is built with SiteSquatch (\`ssqch\`), a static site generator. ${file
|
|
|
107
107
|
- How to use something: \`ssqch docs <name>\` (a config option, template function, command or topic) answers for the installed version, and \`ssqch docs\` lists everything.
|
|
108
108
|
- What this ssqch supports: \`ssqch capabilities --format json\`.
|
|
109
109
|
- Check a change: \`ssqch build --format json\`. \`ok\` is the result, and each problem has a \`code\`, a \`file\` and a \`line\`.
|
|
110
|
-
-
|
|
110
|
+
- What agents and crawlers find in the build (robots.txt, the sitemap, llms.txt, each page's Markdown copy): \`ssqch patrol --format json\` after \`ssqch build\`.
|
|
111
|
+
- Why a page's value is what it is: \`ssqch trace <url or file> --format json\`.
|
|
111
112
|
- Before changing layouts or the config: \`ssqch build --output ${out}-before\`, and afterwards \`ssqch build\` and \`ssqch diff ${out}-before ${out}\`.
|
|
112
113
|
- A new page: ${newPage}.
|
|
113
114
|
- \`ssqch serve\` is for a person watching the browser. Check with \`ssqch build\`.
|
|
@@ -4,12 +4,13 @@ const require = __ssqchCreateRequire(import.meta.url);
|
|
|
4
4
|
// src/voice.ts
|
|
5
5
|
var SQUATCH_WATCH = "Squatch Watch is on.";
|
|
6
6
|
var FRESH_TRACKS = "Fresh tracks in";
|
|
7
|
-
var
|
|
7
|
+
var FIRST_SIGHTING = "First confirmed sighting.";
|
|
8
8
|
var RECOVERED = "Build recovered. Back on the trail.";
|
|
9
9
|
var FIELD_NOTES = "Field notes started.";
|
|
10
10
|
var LEFT_NO_TRACE = "left no trace";
|
|
11
11
|
var CAMPSITE_DISTURBED = "Campsite disturbed:";
|
|
12
12
|
var PASSED_THIS_TREE = "we've passed this tree before";
|
|
13
|
+
var ACCOUNTS_DIFFER = "The eyewitness accounts differ:";
|
|
13
14
|
var TRAIL_GOES_COLD = "the trail goes cold";
|
|
14
15
|
var SOMETHING_LARGE = "something large walked through the build";
|
|
15
16
|
var ISSUES_URL = "https://github.com/reverentgeek/sitesquatch/issues";
|
|
@@ -17,12 +18,13 @@ var ISSUES_URL = "https://github.com/reverentgeek/sitesquatch/issues";
|
|
|
17
18
|
export {
|
|
18
19
|
SQUATCH_WATCH,
|
|
19
20
|
FRESH_TRACKS,
|
|
20
|
-
|
|
21
|
+
FIRST_SIGHTING,
|
|
21
22
|
RECOVERED,
|
|
22
23
|
FIELD_NOTES,
|
|
23
24
|
LEFT_NO_TRACE,
|
|
24
25
|
CAMPSITE_DISTURBED,
|
|
25
26
|
PASSED_THIS_TREE,
|
|
27
|
+
ACCOUNTS_DIFFER,
|
|
26
28
|
TRAIL_GOES_COLD,
|
|
27
29
|
SOMETHING_LARGE,
|
|
28
30
|
ISSUES_URL
|
|
@@ -2,11 +2,11 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
starterEngines
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FENJHLNM.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULTS,
|
|
8
8
|
configOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VILOEVK7.js";
|
|
10
10
|
import {
|
|
11
11
|
VERSION
|
|
12
12
|
} from "./chunk-AD3HAW3W.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-DDV6JEC2.js";
|
|
16
16
|
import {
|
|
17
17
|
red
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YNJNMQWU.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/capabilities.ts
|
|
21
21
|
var MODULE_EXPORTS = [
|
|
@@ -30,7 +30,12 @@ var MODULE_EXPORTS = [
|
|
|
30
30
|
["ssqch/elements", ["elementsPlugin"]],
|
|
31
31
|
["ssqch/minify", ["minifyPlugin", "minify", "minifyCss"]],
|
|
32
32
|
["ssqch/llms", ["llmsPlugin"]],
|
|
33
|
-
["ssqch/
|
|
33
|
+
["ssqch/robots", ["robotsPlugin"]],
|
|
34
|
+
["ssqch/vue", ["vuePlugin"]],
|
|
35
|
+
["ssqch/from-vitepress", ["fromVitepress"]],
|
|
36
|
+
["ssqch/from-mkdocs", ["fromMkdocs"]],
|
|
37
|
+
["ssqch/from-jekyll", ["fromJekyll"]],
|
|
38
|
+
["ssqch/from-hugo", ["fromHugo"]]
|
|
34
39
|
];
|
|
35
40
|
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"];
|
|
36
41
|
function modules() {
|
|
@@ -53,7 +58,7 @@ async function capabilities(commands) {
|
|
|
53
58
|
schemaVersion: 1,
|
|
54
59
|
version: VERSION,
|
|
55
60
|
commands,
|
|
56
|
-
json: ["build --format json", "
|
|
61
|
+
json: ["build --format json", "trace --format json", "diff --format json", "capabilities --format json", "docs --format json", "serve --ready-file"],
|
|
57
62
|
features,
|
|
58
63
|
configFiles: [...CONFIG_FILES, "sitesquatch.toml"],
|
|
59
64
|
configOptions: configOptions(),
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
fixed,
|
|
8
8
|
profileText,
|
|
9
9
|
summary
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6U5VIQVY.js";
|
|
11
11
|
import "./chunk-DDV6JEC2.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FJML7INB.js";
|
|
13
|
+
import "./chunk-YNJNMQWU.js";
|
|
14
14
|
import "./chunk-VJWQSYEG.js";
|
|
15
15
|
import "./chunk-I3PS26CI.js";
|
|
16
16
|
export {
|
|
@@ -6,11 +6,14 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
buildFiles,
|
|
8
8
|
urlOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UHRBPZ4A.js";
|
|
10
10
|
import {
|
|
11
11
|
bytes,
|
|
12
12
|
count
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6U5VIQVY.js";
|
|
14
|
+
import {
|
|
15
|
+
ACCOUNTS_DIFFER
|
|
16
|
+
} from "./chunk-FJML7INB.js";
|
|
14
17
|
import {
|
|
15
18
|
firstChars,
|
|
16
19
|
quoted
|
|
@@ -18,7 +21,7 @@ import {
|
|
|
18
21
|
import {
|
|
19
22
|
BuildError,
|
|
20
23
|
bail
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YNJNMQWU.js";
|
|
22
25
|
import {
|
|
23
26
|
compareText
|
|
24
27
|
} from "./chunk-VJWQSYEG.js";
|
|
@@ -210,6 +213,28 @@ function attributeValue(raw) {
|
|
|
210
213
|
if (!raw.includes("&")) return raw;
|
|
211
214
|
return raw.replace(ENTITY_OR_AMP, (whole, name) => name === void 0 ? whole : name === "nbsp" ? "\xA0" : entityChar(name) ?? whole);
|
|
212
215
|
}
|
|
216
|
+
var URL_ATTRS = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "poster", "cite", "data"]);
|
|
217
|
+
var UTF8 = new TextDecoder("utf-8", { fatal: true });
|
|
218
|
+
function canonicalUrl(url) {
|
|
219
|
+
if (!url.includes("%")) return url;
|
|
220
|
+
return url.replace(/(?:%[0-9A-Fa-f]{2})+/g, (run) => {
|
|
221
|
+
const bytes2 = Uint8Array.from(run.slice(1).split("%"), (h) => Number.parseInt(h, 16));
|
|
222
|
+
let text;
|
|
223
|
+
try {
|
|
224
|
+
text = UTF8.decode(bytes2);
|
|
225
|
+
} catch {
|
|
226
|
+
return run;
|
|
227
|
+
}
|
|
228
|
+
let out = "";
|
|
229
|
+
let at = 0;
|
|
230
|
+
for (const c of text) {
|
|
231
|
+
const n = Buffer.byteLength(c);
|
|
232
|
+
out += c.charCodeAt(0) > 127 || ' "<>`{}'.includes(c) ? c : run.slice(at * 3, (at + n) * 3);
|
|
233
|
+
at += n;
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
});
|
|
237
|
+
}
|
|
213
238
|
var NO_ATTRIBUTES = /^<\/?[a-z][a-z0-9-]*>$/;
|
|
214
239
|
function canonicalTag(tag, foreign, xml = false) {
|
|
215
240
|
if (NO_ATTRIBUTES.test(tag)) return [tag, false];
|
|
@@ -266,6 +291,7 @@ function canonicalTag(tag, foreign, xml = false) {
|
|
|
266
291
|
if (attrs.has(attr2)) continue;
|
|
267
292
|
if (value !== void 0 && BOOLEAN.has(attr2) && !foreign && (value === "" || asciiLower(value) === attr2)) value = void 0;
|
|
268
293
|
if (value !== void 0 && SPACED.has(attr2)) value = collapse(value).replace(/ ?, ?/g, ", ");
|
|
294
|
+
if (value !== void 0 && URL_ATTRS.has(attr2)) value = canonicalUrl(value);
|
|
269
295
|
attrs.set(attr2, value);
|
|
270
296
|
}
|
|
271
297
|
if (closing) return [`</${element}>`, false];
|
|
@@ -802,7 +828,7 @@ function onlyDates(list) {
|
|
|
802
828
|
}
|
|
803
829
|
return first;
|
|
804
830
|
}
|
|
805
|
-
var IGNORING = "Ignoring asset fingerprints, image ids, integrity hashes, the generator's version, Vue's and Astro's scope ids and fragment markers, whitespace between tags, and how tags are written where browsers read them the same (attribute order, quotes, entities, `<br/>`) (--exact compares bytes).\n";
|
|
831
|
+
var IGNORING = "Ignoring asset fingerprints, image ids, integrity hashes, the generator's version, Vue's and Astro's scope ids and fragment markers, whitespace between tags, and how tags are written where browsers read them the same (attribute order, quotes, entities, percent-encoding in URLs, `<br/>`) (--exact compares bytes).\n";
|
|
806
832
|
var IMAGES_LISTED = 5;
|
|
807
833
|
function listed(urls, sign) {
|
|
808
834
|
const images = urls.filter(isHashedImage);
|
|
@@ -1081,7 +1107,7 @@ Varies (${report.varies.length})
|
|
|
1081
1107
|
out += grouped ? linesText(sample.ownHunks, sample.ownLines, limit, paint) : linesText(sample.hunks, sample.changedLines, limit, paint);
|
|
1082
1108
|
}
|
|
1083
1109
|
out += `
|
|
1084
|
-
${plural(report.varies.length, "file varies", "files vary")} between builds made the same way; ${steady} are the same in all of them. Pin what changes (the build's time, random ids) before comparing another build with these, or leave it out with --ignore.
|
|
1110
|
+
${ACCOUNTS_DIFFER} ${plural(report.varies.length, "file varies", "files vary")} between builds made the same way; ${steady} are the same in all of them. Pin what changes (the build's time, random ids) before comparing another build with these, or leave it out with --ignore.
|
|
1085
1111
|
`;
|
|
1086
1112
|
const common = report.varies.filter((v) => !v.versions[0].missing && v.versions[0].runs.includes(report.typical)).length;
|
|
1087
1113
|
if (common > 0 && report.varies.some((v) => v.versions[0].runs.length >= 2)) out += `The build most like the others: ${report.runs[report.typical]}, with the most common version of ${common} of the ${plural(report.varies.length, "file", "files")} that vary.
|
|
@@ -1122,6 +1148,7 @@ export {
|
|
|
1122
1148
|
withoutFingerprints,
|
|
1123
1149
|
keyed,
|
|
1124
1150
|
canonicalText,
|
|
1151
|
+
canonicalUrl,
|
|
1125
1152
|
canonicalTag,
|
|
1126
1153
|
tokens,
|
|
1127
1154
|
compare,
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
} from "./chunk-3NYSSA2C.js";
|
|
6
6
|
import {
|
|
7
7
|
Options
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SNQOHNXE.js";
|
|
9
9
|
import {
|
|
10
10
|
BUILTINS,
|
|
11
11
|
cssWithBase,
|
|
12
12
|
debugString,
|
|
13
13
|
wasi
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VILOEVK7.js";
|
|
15
15
|
import {
|
|
16
16
|
WebAssembly
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6OUCRDYI.js";
|
|
18
18
|
import {
|
|
19
19
|
BuildError,
|
|
20
20
|
bail,
|
|
21
21
|
messageOf
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YNJNMQWU.js";
|
|
23
23
|
import {
|
|
24
24
|
comparePaths,
|
|
25
25
|
displayPath,
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
measure,
|
|
9
9
|
overBudget,
|
|
10
10
|
urlOf
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UHRBPZ4A.js";
|
|
12
|
+
import "./chunk-ULCT3PAV.js";
|
|
13
|
+
import "./chunk-6U5VIQVY.js";
|
|
14
14
|
import "./chunk-DDV6JEC2.js";
|
|
15
15
|
import "./chunk-FVZ5JBRI.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FJML7INB.js";
|
|
17
17
|
import "./chunk-CMUWRPSQ.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-YNJNMQWU.js";
|
|
19
19
|
import "./chunk-VJWQSYEG.js";
|
|
20
20
|
import "./chunk-I3PS26CI.js";
|
|
21
21
|
export {
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
capabilities,
|
|
6
6
|
modules,
|
|
7
7
|
runCapabilities
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-GSNRAGKQ.js";
|
|
9
|
+
import "./chunk-FENJHLNM.js";
|
|
10
|
+
import "./chunk-VILOEVK7.js";
|
|
11
|
+
import "./chunk-ULCT3PAV.js";
|
|
12
|
+
import "./chunk-6U5VIQVY.js";
|
|
13
13
|
import "./chunk-AD3HAW3W.js";
|
|
14
14
|
import "./chunk-YCOTX2VM.js";
|
|
15
15
|
import "./chunk-DDV6JEC2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-6OUCRDYI.js";
|
|
17
|
+
import "./chunk-SPIFZBIW.js";
|
|
17
18
|
import "./chunk-FVZ5JBRI.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-57HLSKZS.js";
|
|
19
|
+
import "./chunk-FJML7INB.js";
|
|
20
|
+
import "./chunk-4AZFCSGJ.js";
|
|
21
21
|
import "./chunk-CMUWRPSQ.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-YNJNMQWU.js";
|
|
23
23
|
import "./chunk-VJWQSYEG.js";
|
|
24
24
|
import "./chunk-I3PS26CI.js";
|
|
25
25
|
export {
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
globSet,
|
|
7
7
|
globToRegExp,
|
|
8
8
|
isGlob
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SPIFZBIW.js";
|
|
10
10
|
import "./chunk-CMUWRPSQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-YNJNMQWU.js";
|
|
12
12
|
import "./chunk-VJWQSYEG.js";
|
|
13
13
|
import "./chunk-I3PS26CI.js";
|
|
14
14
|
export {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
BUILTIN_FILTERS
|
|
5
|
-
} from "./chunk-DZ5F5XSI.js";
|
|
6
3
|
import {
|
|
7
4
|
modules
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GSNRAGKQ.js";
|
|
6
|
+
import {
|
|
7
|
+
BUILTIN_FILTERS
|
|
8
|
+
} from "./chunk-V3G2QGL3.js";
|
|
9
|
+
import "./chunk-25WERNDD.js";
|
|
9
10
|
import {
|
|
10
11
|
longHelp
|
|
11
12
|
} from "./chunk-RIAOXEXC.js";
|
|
12
13
|
import {
|
|
13
14
|
agentsMd
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FENJHLNM.js";
|
|
15
16
|
import {
|
|
16
17
|
configOptions
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-VILOEVK7.js";
|
|
19
|
+
import "./chunk-ULCT3PAV.js";
|
|
20
|
+
import "./chunk-6U5VIQVY.js";
|
|
20
21
|
import {
|
|
21
22
|
VERSION
|
|
22
23
|
} from "./chunk-AD3HAW3W.js";
|
|
@@ -26,13 +27,13 @@ import {
|
|
|
26
27
|
types
|
|
27
28
|
} from "./chunk-YCOTX2VM.js";
|
|
28
29
|
import "./chunk-DDV6JEC2.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-6OUCRDYI.js";
|
|
31
|
+
import "./chunk-SPIFZBIW.js";
|
|
30
32
|
import {
|
|
31
33
|
closest
|
|
32
34
|
} from "./chunk-FVZ5JBRI.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-57HLSKZS.js";
|
|
35
|
+
import "./chunk-FJML7INB.js";
|
|
36
|
+
import "./chunk-4AZFCSGJ.js";
|
|
36
37
|
import "./chunk-CMUWRPSQ.js";
|
|
37
38
|
import {
|
|
38
39
|
OTHER_CONFIGS,
|
|
@@ -40,7 +41,7 @@ import {
|
|
|
40
41
|
jsYaml,
|
|
41
42
|
red,
|
|
42
43
|
toJson
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-YNJNMQWU.js";
|
|
44
45
|
import "./chunk-VJWQSYEG.js";
|
|
45
46
|
import "./chunk-I3PS26CI.js";
|
|
46
47
|
|
|
@@ -294,11 +295,15 @@ function also(all, name, not) {
|
|
|
294
295
|
found.sort((a, b) => b[1] - a[1] || a[0] - b[0]);
|
|
295
296
|
return found.map(([i]) => i).slice(0, 4);
|
|
296
297
|
}
|
|
298
|
+
function plainTitle(title) {
|
|
299
|
+
const at = /[:?] /.exec(title);
|
|
300
|
+
return at ? title.slice(at.index + 2) : title;
|
|
301
|
+
}
|
|
297
302
|
function heading(all, query) {
|
|
298
303
|
const q = words(query);
|
|
299
304
|
if (q.length === 0) return void 0;
|
|
300
305
|
const anchor = query.replace(/^#+/, "");
|
|
301
|
-
const exact = all.findIndex((s) => words(s.title).join(" ") === q.join(" ") || slug(s.title) === anchor);
|
|
306
|
+
const exact = all.findIndex((s) => words(s.title).join(" ") === q.join(" ") || words(plainTitle(s.title)).join(" ") === q.join(" ") || slug(s.title) === anchor);
|
|
302
307
|
if (exact !== -1) return exact;
|
|
303
308
|
let best;
|
|
304
309
|
all.forEach((s, i) => {
|
|
@@ -411,7 +416,7 @@ function answerText(all, a) {
|
|
|
411
416
|
`;
|
|
412
417
|
if (described.length) out += "\n";
|
|
413
418
|
if (a.section !== void 0 && a.passages.length) {
|
|
414
|
-
out += `From "${all[a.section].title}" (ssqch docs "${all[a.section].title}"):
|
|
419
|
+
out += `From "${all[a.section].title}" (ssqch docs "${plainTitle(all[a.section].title)}"):
|
|
415
420
|
|
|
416
421
|
${a.passages.join("\n\n")}
|
|
417
422
|
`;
|
|
@@ -636,9 +641,10 @@ ${body.trim()}
|
|
|
636
641
|
return out(json ? JSON.stringify({ query, found: true, page: { file: `site/src/docs/${page.file}`, url: guideUrl(page.file.replace(/^trailheads\//, "")), text } }, null, 2) + "\n" : text);
|
|
637
642
|
}
|
|
638
643
|
}
|
|
639
|
-
const
|
|
644
|
+
const trail = page === void 0 ? trailheadSection(query) : void 0;
|
|
645
|
+
const exact = trail !== void 0 && !known.some((n) => n.name === query) && !all.some((s) => s.title.toLowerCase() === query.trim().toLowerCase() || plainTitle(s.title).toLowerCase() === query.trim().toLowerCase());
|
|
646
|
+
const a = page?.title !== void 0 ? { query, names: [], passages: [], also: [], section: all.findIndex((s) => s.level <= 2 && s.title === page.title) } : exact ? void 0 : answer(grammar, all, known, query);
|
|
640
647
|
if (a && a.section !== -1) return out(json ? JSON.stringify(answerJson(all, a), null, 2) + "\n" : answerText(all, a));
|
|
641
|
-
const trail = trailheadSection(query);
|
|
642
648
|
if (trail) return out(json ? JSON.stringify({ query, found: true, trailhead: trail }, null, 2) + "\n" : `From "${trail.page}" (ssqch docs --from ${trail.generator}):
|
|
643
649
|
|
|
644
650
|
${trail.text}`);
|
|
@@ -658,6 +664,7 @@ export {
|
|
|
658
664
|
docsPage,
|
|
659
665
|
docsText,
|
|
660
666
|
names,
|
|
667
|
+
plainTitle,
|
|
661
668
|
runDocs,
|
|
662
669
|
sections,
|
|
663
670
|
slug,
|
|
@@ -2,12 +2,12 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
BUDGETS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ULCT3PAV.js";
|
|
6
6
|
import {
|
|
7
7
|
bytes,
|
|
8
8
|
count,
|
|
9
9
|
fixed
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6U5VIQVY.js";
|
|
11
11
|
import {
|
|
12
12
|
padEnd,
|
|
13
13
|
padStart
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
BuildError,
|
|
17
17
|
bail,
|
|
18
18
|
warning
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YNJNMQWU.js";
|
|
20
20
|
import {
|
|
21
21
|
compareText,
|
|
22
22
|
realPath
|