ssqch 0.8.0 → 0.10.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 +3 -1
- package/bundled/docs/agents.md +70 -0
- package/bundled/docs/benchmarks.md +29 -0
- package/bundled/docs/build-summary.md +27 -0
- package/bundled/docs/comparing-builds.md +51 -0
- package/bundled/docs/configuring.md +138 -0
- package/bundled/docs/content-schemas.md +54 -0
- package/bundled/docs/css-and-javascript.md +33 -0
- package/bundled/docs/data-files.md +55 -0
- package/bundled/docs/deploying.md +47 -0
- package/bundled/docs/field-guide.md +144 -0
- package/bundled/docs/footprint.md +27 -0
- package/bundled/docs/github-pages.md +41 -0
- package/bundled/docs/index.md +26 -0
- package/bundled/docs/install.md +27 -0
- package/bundled/docs/known-gaps.md +18 -0
- package/bundled/docs/markdown.md +114 -0
- package/bundled/docs/multilingual.md +14 -0
- package/bundled/docs/nav.yml +50 -0
- package/bundled/docs/netlify.md +30 -0
- package/bundled/docs/new-pages.md +42 -0
- package/bundled/docs/plugins.md +13 -0
- package/bundled/docs/rust-plugins.md +32 -0
- package/bundled/docs/seo.md +19 -0
- package/bundled/docs/template-languages.md +106 -0
- package/bundled/docs/templates.md +37 -0
- package/bundled/docs/themes.md +31 -0
- package/bundled/{trailheads → docs/trailheads}/from-component-frameworks.md +7 -3
- package/bundled/{trailheads → docs/trailheads}/from-docusaurus.md +7 -4
- package/bundled/{trailheads → docs/trailheads}/from-eleventy.md +7 -4
- package/bundled/{trailheads → docs/trailheads}/from-hexo.md +7 -4
- package/bundled/docs/trailheads/from-jekyll.md +82 -0
- package/bundled/{trailheads → docs/trailheads}/from-mkdocs.md +8 -5
- package/bundled/{trailheads → docs/trailheads}/from-zola.md +6 -3
- package/bundled/docs/trailheads.md +38 -0
- package/bundled/docs/where-values-come-from.md +57 -0
- package/bundled/ssqch.d.ts +20 -10
- package/lib/assets.js +15 -7
- package/lib/{chunk-N5QTGQ5N.js → chunk-2LEOPLTZ.js} +2 -2
- package/lib/{chunk-AMBFWPZ4.js → chunk-3EPHKJEG.js} +3 -3
- package/lib/{chunk-BRK4MXXO.js → chunk-3HHRKG33.js} +65 -18
- package/lib/{chunk-EIT4ZDT4.js → chunk-5DNDSNTP.js} +61 -5
- package/lib/{chunk-NUKCUDC4.js → chunk-7HXCQEGA.js} +3 -3
- package/lib/{chunk-6XYSFG6V.js → chunk-BGCBSQ4A.js} +3067 -3054
- package/lib/{chunk-RI2L3VGO.js → chunk-CB6YFUXU.js} +19 -11
- package/lib/{chunk-JSPSMIJ2.js → chunk-DMVJ53SM.js} +9 -9
- package/lib/{chunk-FYGE634X.js → chunk-DW7VMJEZ.js} +9 -9
- package/lib/{chunk-GSKVRAHF.js → chunk-E5UB2YY7.js} +6 -6
- package/lib/{chunk-DHHQKW4F.js → chunk-EEJDLCD3.js} +7 -7
- package/lib/{chunk-TWCVHOKO.js → chunk-HDQ4SRWM.js} +125 -4
- package/lib/{chunk-JRT7TQQP.js → chunk-HGJ5VWUR.js} +1 -1
- package/lib/{chunk-C35KIPAR.js → chunk-JWCCVTTR.js} +98 -7
- package/lib/{chunk-EZZUUPI4.js → chunk-JXZT5L7W.js} +2 -2
- package/lib/{chunk-KBGE5MCY.js → chunk-LAV3DEY4.js} +1 -1
- package/lib/{chunk-IRHRK7XB.js → chunk-LCPSKHAV.js} +1 -1
- package/lib/{chunk-3PHCFZEU.js → chunk-N4O5MDIB.js} +2 -2
- package/lib/{chunk-TDGBQNGW.js → chunk-NFJJKDRI.js} +1 -1
- package/lib/{chunk-UGEGUUBT.js → chunk-NUUEOGLZ.js} +8 -8
- package/lib/{chunk-VVPZ5PDP.js → chunk-Q4LFTYK2.js} +11 -11
- package/lib/{chunk-TN6EEDX2.js → chunk-QMA7CK7B.js} +51 -6
- package/lib/{chunk-CDEPYU7W.js → chunk-RJFWTW2Y.js} +2 -2
- package/lib/{chunk-YSH2NMIE.js → chunk-RKFZSVNF.js} +6 -6
- package/lib/{chunk-GOE4ZSAB.js → chunk-RM5Q3KFB.js} +9 -9
- package/lib/{chunk-37KSIVNY.js → chunk-RVBNVGZV.js} +3 -3
- package/lib/{chunk-HR2RU2LY.js → chunk-SA5KSJ4Y.js} +11 -7
- package/lib/{chunk-BOBPVAX2.js → chunk-SRNLKWXL.js} +424 -78
- package/lib/{chunk-WP3RPVUM.js → chunk-Y2ESFAAD.js} +2 -3
- package/lib/{chunk-WMOVCQO6.js → chunk-ZM6TU2JB.js} +6 -6
- package/lib/cli.js +32 -25
- package/lib/elements.js +7 -7
- package/lib/image.js +8 -8
- package/lib/links.js +10 -10
- package/lib/minify.js +7 -7
- package/lib/redirects.js +8 -8
- package/lib/rss.js +20 -19
- package/lib/sass.js +45 -10
- package/lib/sitemap.js +36 -11
- package/lib/ssqch.js +4 -4
- package/package.json +2 -2
- package/types/image.d.ts +5 -5
- package/types/index.d.ts +12 -4
- package/types/rss.d.ts +1 -1
- package/types/sitemap.d.ts +2 -0
- package/wasm/markdown.wasm +0 -0
- package/bundled/README.md +0 -1247
- package/lib/{chunk-6XYSFG6V.js.LEGAL.txt → chunk-BGCBSQ4A.js.LEGAL.txt} +3 -3
- /package/lib/{chunk-BOBPVAX2.js.LEGAL.txt → chunk-SRNLKWXL.js.LEGAL.txt} +0 -0
|
@@ -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-BGCBSQ4A.js";
|
|
6
6
|
import {
|
|
7
7
|
joinAsGiven,
|
|
8
8
|
parentAsGiven,
|
|
@@ -20,8 +20,7 @@ import { fileURLToPath } from "node:url";
|
|
|
20
20
|
var PACKAGE = path.dirname(path.dirname(fileURLToPath(new URL("../src/bundled.ts", import.meta.url).href)));
|
|
21
21
|
var BUNDLED = path.join(PACKAGE, "bundled");
|
|
22
22
|
var FROM_REPOSITORY = [
|
|
23
|
-
["
|
|
24
|
-
["trailheads", "docs/trailheads"]
|
|
23
|
+
["docs", "site/src/docs"]
|
|
25
24
|
];
|
|
26
25
|
function bundledPath(rel) {
|
|
27
26
|
const inPackage = path.join(BUNDLED, rel);
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
} from "./chunk-3GYLOC6Y.js";
|
|
6
6
|
import {
|
|
7
7
|
findConfig
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-QMA7CK7B.js";
|
|
9
|
+
import "./chunk-LCPSKHAV.js";
|
|
10
10
|
import "./chunk-NKXEPHRZ.js";
|
|
11
11
|
import {
|
|
12
12
|
VERSION
|
|
13
13
|
} from "./chunk-AD3HAW3W.js";
|
|
14
14
|
import "./chunk-DDV6JEC2.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-5DNDSNTP.js";
|
|
16
16
|
import "./chunk-FVZ5JBRI.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-NFJJKDRI.js";
|
|
18
18
|
import "./chunk-UU43WIZG.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-JWCCVTTR.js";
|
|
20
20
|
import "./chunk-CMUWRPSQ.js";
|
|
21
21
|
import {
|
|
22
22
|
TABLE,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
readToml,
|
|
26
26
|
red,
|
|
27
27
|
tomlReason
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
29
29
|
import {
|
|
30
30
|
compareText,
|
|
31
31
|
isDir,
|
package/lib/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
BUILDER
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LAV3DEY4.js";
|
|
6
6
|
import {
|
|
7
7
|
Printed,
|
|
8
8
|
UsageError,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_ENGINE,
|
|
13
13
|
bundled
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Y2ESFAAD.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
17
|
} from "./chunk-AD3HAW3W.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-DDV6JEC2.js";
|
|
24
24
|
import {
|
|
25
25
|
describeThrown
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JWCCVTTR.js";
|
|
27
27
|
import {
|
|
28
28
|
prettyJson,
|
|
29
29
|
quoted
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
toJson2,
|
|
49
49
|
warn,
|
|
50
50
|
warning
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
52
52
|
import {
|
|
53
53
|
relative
|
|
54
54
|
} from "./chunk-VJWQSYEG.js";
|
|
@@ -120,7 +120,7 @@ var COMMANDS = [
|
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
name: "diff",
|
|
123
|
-
about: "Compare two builds of a site: URLs added and removed, and what changed on each page",
|
|
123
|
+
about: "Compare two builds of a site: URLs added and removed, and what changed on each page. Given three or more, list what varies between them",
|
|
124
124
|
options: [
|
|
125
125
|
{ long: "exact", help: "Compare bytes: don't match fingerprinted files or ignore whitespace" },
|
|
126
126
|
{ long: "ignore", value: "REGEX", help: "Leave out text matching this regular expression before comparing (repeatable)", many: true },
|
|
@@ -128,8 +128,8 @@ var COMMANDS = [
|
|
|
128
128
|
{ long: "lines", value: "LINES", help: "Changed lines to show for each file (0 for all)", default: "10", check: number },
|
|
129
129
|
FORMAT
|
|
130
130
|
],
|
|
131
|
-
positionals: [{ name: "BEFORE", help: "The build from before the change", required: true, path: true }, { name: "AFTER", help: "The build from after it", required: true, path: true }],
|
|
132
|
-
afterHelp: "Build the site into one folder before a change and another after it:\n\n ssqch build --output dist-before\n (upgrade ssqch, edit a layout, ...)\n ssqch build\n ssqch diff dist-before dist\n\nExits with 0 when the builds are the same, 1 when they differ, and 2 on an error."
|
|
131
|
+
positionals: [{ name: "BEFORE", help: "The build from before the change", required: true, path: true }, { name: "AFTER", help: "The build from after it", required: true, path: true }, { name: "MORE", help: "More builds: with three or more, which files vary between them (builds made the same way)", required: false, many: true, path: true }],
|
|
132
|
+
afterHelp: "Build the site into one folder before a change and another after it:\n\n ssqch build --output dist-before\n (upgrade ssqch, edit a layout, ...)\n ssqch build\n ssqch diff dist-before dist\n\nTo see whether a build is the same every time (another generator's, before a move), build it three times and compare all three:\n\n ssqch diff ref-1 ref-2 ref-3\n\nExits with 0 when the builds are the same, 1 when they differ, and 2 on an error."
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
name: "footprint",
|
|
@@ -318,28 +318,28 @@ async function main(argv) {
|
|
|
318
318
|
`);
|
|
319
319
|
return 1;
|
|
320
320
|
}
|
|
321
|
-
if (command === "import") return (await import("./chunk-
|
|
321
|
+
if (command === "import") return (await import("./chunk-ZM6TU2JB.js")).runImport(cli.positionals[0], cli.positionals[1] ?? ".", flag("write"));
|
|
322
322
|
switch (command) {
|
|
323
323
|
case "init":
|
|
324
|
-
return (await import("./chunk-
|
|
324
|
+
return (await import("./chunk-RJFWTW2Y.js")).runInit({ dir: cli.positionals[0] ?? ".", starter: value("starter") ?? "site", engine: value("engine") ?? DEFAULT_ENGINE, quiet: flag("quiet") });
|
|
325
325
|
case "capabilities":
|
|
326
|
-
return (await import("./chunk-
|
|
326
|
+
return (await import("./chunk-NUUEOGLZ.js")).runCapabilities(format, CAPABILITY_ORDER);
|
|
327
327
|
case "docs":
|
|
328
|
-
return (await import("./chunk-
|
|
328
|
+
return (await import("./chunk-3HHRKG33.js")).runDocs(GRAMMAR, { query: cli.positionals, from: value("from"), format });
|
|
329
329
|
case "sighting":
|
|
330
|
-
return (await import("./chunk-
|
|
330
|
+
return (await import("./chunk-RM5Q3KFB.js")).runSighting(path.resolve(value("root") ?? "."));
|
|
331
331
|
case "completions": {
|
|
332
332
|
process.stdout.write(bundled(`completions/${cli.positionals[0]}`));
|
|
333
333
|
return 0;
|
|
334
334
|
}
|
|
335
335
|
case "types": {
|
|
336
336
|
routeConsole();
|
|
337
|
-
return (await import("./chunk-
|
|
337
|
+
return (await import("./chunk-EEJDLCD3.js")).runTypes({ root: value("root"), out: value("out") ?? "ssqch.d.ts" });
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
const many = (name) => Array.isArray(cli.options[name]) ? cli.options[name] : typeof cli.options[name] === "string" ? [cli.options[name]] : [];
|
|
341
341
|
const top = Number(value("top") ?? "5");
|
|
342
|
-
if (command === "diff") return runDiff(cli.positionals
|
|
342
|
+
if (command === "diff") return runDiff(cli.positionals, { exact: flag("exact"), ignore: many("ignore"), only: many("only"), lines: Number(value("lines") ?? "10"), format });
|
|
343
343
|
if (command === "footprint" && cli.positionals[0] !== void 0) {
|
|
344
344
|
try {
|
|
345
345
|
await runFootprint(cli.positionals[0], cli.positionals[0], top, format);
|
|
@@ -360,15 +360,15 @@ async function main(argv) {
|
|
|
360
360
|
const root = path.resolve(value("root") ?? ".");
|
|
361
361
|
siteRoot = root;
|
|
362
362
|
routeConsole();
|
|
363
|
-
const makeConfig = async () => (await import("./chunk-
|
|
363
|
+
const makeConfig = async () => (await import("./chunk-E5UB2YY7.js")).loadConfig({ root, rootGiven: value("root") ?? ".", env, serving, quiet: flag("quiet") || inspecting, verbose: flag("verbose"), output: value("output"), base: value("base") });
|
|
364
364
|
if (command === "new") return newPage(makeConfig, root, { path: cli.positionals[0], title: value("title"), date: value("date"), blueprint: value("blueprint"), set: cli.options.set ?? [], format });
|
|
365
365
|
if (serving) {
|
|
366
|
-
if (building) return (await import("./chunk-
|
|
366
|
+
if (building) return (await import("./chunk-Q4LFTYK2.js")).runBuilder(building, makeConfig, root);
|
|
367
367
|
const readyFile = value("ready-file") === void 0 ? void 0 : path.resolve(value("ready-file"));
|
|
368
368
|
const options = { port: Number(value("port") ?? "8080"), readyFile, quiet: flag("quiet") };
|
|
369
369
|
if (!flag("built")) {
|
|
370
370
|
try {
|
|
371
|
-
return await (await import("./chunk-
|
|
371
|
+
return await (await import("./chunk-SA5KSJ4Y.js")).serve(argv, options);
|
|
372
372
|
} catch (e) {
|
|
373
373
|
printError("error:", e, "build", new Locator(root));
|
|
374
374
|
return 1;
|
|
@@ -382,7 +382,7 @@ async function main(argv) {
|
|
|
382
382
|
return 1;
|
|
383
383
|
}
|
|
384
384
|
try {
|
|
385
|
-
return await (await import("./chunk-
|
|
385
|
+
return await (await import("./chunk-SA5KSJ4Y.js")).serveBuilt(config2, options);
|
|
386
386
|
} catch (e) {
|
|
387
387
|
printError("error:", e, "build", locatorOf(config2));
|
|
388
388
|
return 1;
|
|
@@ -411,7 +411,7 @@ async function main(argv) {
|
|
|
411
411
|
await runFootprint(shownDir(config, config.output), shownOutput(config), top, format);
|
|
412
412
|
return 0;
|
|
413
413
|
}
|
|
414
|
-
const [{ build }, { summary }] = await Promise.all([import("./chunk-
|
|
414
|
+
const [{ build }, { summary }] = await Promise.all([import("./chunk-DW7VMJEZ.js"), import("./chunk-HXCLCXRT.js")]);
|
|
415
415
|
const report = await build(config);
|
|
416
416
|
if (!config.quiet) process.stdout.write(summary(config, report));
|
|
417
417
|
return 0;
|
|
@@ -429,7 +429,7 @@ async function newPage(makeConfig, root, command) {
|
|
|
429
429
|
return 1;
|
|
430
430
|
}
|
|
431
431
|
try {
|
|
432
|
-
(await import("./chunk-
|
|
432
|
+
(await import("./chunk-RKFZSVNF.js")).runNew(config, command);
|
|
433
433
|
return 0;
|
|
434
434
|
} catch (e) {
|
|
435
435
|
printError("error:", e, "build", locatorOf(config));
|
|
@@ -441,7 +441,7 @@ var checkFormat = (format) => {
|
|
|
441
441
|
};
|
|
442
442
|
async function runInspect(config, target, name, format) {
|
|
443
443
|
checkFormat(format);
|
|
444
|
-
const { field, fieldText, inspect, inspectionJson, inspectionText } = await import("./chunk-
|
|
444
|
+
const { field, fieldText, inspect, inspectionJson, inspectionText } = await import("./chunk-DMVJ53SM.js");
|
|
445
445
|
let report;
|
|
446
446
|
try {
|
|
447
447
|
report = await inspect(config, target);
|
|
@@ -457,10 +457,11 @@ async function runInspect(config, target, name, format) {
|
|
|
457
457
|
if (format === "json") process.stdout.write(prettyJson(inspectionJson(report, one)) + "\n");
|
|
458
458
|
else process.stdout.write(one ? fieldText(one) : inspectionText(report));
|
|
459
459
|
}
|
|
460
|
-
async function runDiff(
|
|
460
|
+
async function runDiff(dirs, options) {
|
|
461
|
+
const [before, after] = dirs;
|
|
461
462
|
try {
|
|
462
463
|
checkFormat(options.format);
|
|
463
|
-
const [{ rustRegExp }, { globProblem, globToRegExp }, { compare, diffJson, diffText, isSame }] = await Promise.all([import("./chunk-IAFM5ITE.js"), import("./chunk-
|
|
464
|
+
const [{ rustRegExp }, { globProblem, globToRegExp }, { compare, compareRuns, diffJson, diffText, isSame, runsJson, runsText }] = await Promise.all([import("./chunk-IAFM5ITE.js"), import("./chunk-JXZT5L7W.js"), import("./chunk-HDQ4SRWM.js")]);
|
|
464
465
|
const ignore = options.ignore.map((pattern) => {
|
|
465
466
|
try {
|
|
466
467
|
return rustRegExp(pattern, "g");
|
|
@@ -474,6 +475,12 @@ async function runDiff(before, after, options) {
|
|
|
474
475
|
if (problem !== void 0) bail(`--only ${quoted(given)} isn't a glob: error parsing glob '${glob}': ${problem}`);
|
|
475
476
|
return globToRegExp(glob);
|
|
476
477
|
}) : void 0;
|
|
478
|
+
if (dirs.length > 2) {
|
|
479
|
+
const runs = await compareRuns(dirs, { exact: options.exact, ignore, only, lines: options.lines });
|
|
480
|
+
if (options.format === "json") process.stdout.write(JSON.stringify(runsJson(runs, options.lines), null, 2) + "\n");
|
|
481
|
+
else process.stdout.write(runsText(runs, options.lines, process.stdout.isTTY === true));
|
|
482
|
+
return runs.varies.length ? 1 : 0;
|
|
483
|
+
}
|
|
477
484
|
const report = await compare(before, after, { exact: options.exact, ignore, only, lines: options.lines });
|
|
478
485
|
if (options.format === "json") process.stdout.write(JSON.stringify(diffJson(report, options.lines), null, 2) + "\n");
|
|
479
486
|
else process.stdout.write(diffText(report, options.lines, process.stdout.isTTY === true));
|
|
@@ -486,7 +493,7 @@ async function runDiff(before, after, options) {
|
|
|
486
493
|
}
|
|
487
494
|
async function runFootprint(dir, shown, top, format) {
|
|
488
495
|
checkFormat(format);
|
|
489
|
-
const { footprintJson, footprintText, measure } = await import("./chunk-
|
|
496
|
+
const { footprintJson, footprintText, measure } = await import("./chunk-RVBNVGZV.js");
|
|
490
497
|
const measured = await measure(dir);
|
|
491
498
|
if (format === "json") process.stdout.write(JSON.stringify(footprintJson(measured, shown, top), null, 2) + "\n");
|
|
492
499
|
else process.stdout.write(footprintText(measured, shown, top));
|
|
@@ -510,7 +517,7 @@ async function buildJson(makeConfig, root, env) {
|
|
|
510
517
|
const dirs = dirsOf(config);
|
|
511
518
|
out.output = shownOutput(config);
|
|
512
519
|
try {
|
|
513
|
-
const report = await (await import("./chunk-
|
|
520
|
+
const report = await (await import("./chunk-DW7VMJEZ.js")).build(config);
|
|
514
521
|
out.durationMs = ms(report.durationMs);
|
|
515
522
|
out.pages = { written: report.pagesWritten, templates: report.templates, bytes: report.pageBytes, new: report.pagesNew ?? null, gone: report.pagesGone ?? null };
|
|
516
523
|
out.copied = { files: report.filesCopied, unchanged: report.filesUnchanged, bytes: report.passthroughBytes };
|
package/lib/elements.js
CHANGED
|
@@ -2,29 +2,29 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
Options
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HGJ5VWUR.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
debugString,
|
|
9
9
|
rewriteHtml,
|
|
10
10
|
withBase
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QMA7CK7B.js";
|
|
12
|
+
import "./chunk-LCPSKHAV.js";
|
|
13
13
|
import {
|
|
14
14
|
count
|
|
15
15
|
} from "./chunk-NKXEPHRZ.js";
|
|
16
16
|
import "./chunk-AD3HAW3W.js";
|
|
17
17
|
import "./chunk-DDV6JEC2.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-5DNDSNTP.js";
|
|
19
19
|
import "./chunk-FVZ5JBRI.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-NFJJKDRI.js";
|
|
21
21
|
import "./chunk-UU43WIZG.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-JWCCVTTR.js";
|
|
23
23
|
import "./chunk-CMUWRPSQ.js";
|
|
24
24
|
import {
|
|
25
25
|
bail,
|
|
26
26
|
context
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
28
28
|
import {
|
|
29
29
|
compareText,
|
|
30
30
|
displayPath,
|
package/lib/image.js
CHANGED
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
image,
|
|
5
5
|
imagePlugin,
|
|
6
6
|
imageUrl
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-7HXCQEGA.js";
|
|
8
|
+
import "./chunk-HGJ5VWUR.js";
|
|
9
|
+
import "./chunk-QMA7CK7B.js";
|
|
10
|
+
import "./chunk-LCPSKHAV.js";
|
|
11
11
|
import "./chunk-NKXEPHRZ.js";
|
|
12
12
|
import "./chunk-AD3HAW3W.js";
|
|
13
13
|
import "./chunk-DDV6JEC2.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-5DNDSNTP.js";
|
|
15
15
|
import "./chunk-FVZ5JBRI.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-NFJJKDRI.js";
|
|
17
17
|
import "./chunk-UU43WIZG.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-JWCCVTTR.js";
|
|
19
19
|
import "./chunk-CMUWRPSQ.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-BGCBSQ4A.js";
|
|
21
21
|
import "./chunk-VJWQSYEG.js";
|
|
22
22
|
import "./chunk-I3PS26CI.js";
|
|
23
23
|
export {
|
package/lib/links.js
CHANGED
|
@@ -2,12 +2,12 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
Options
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HGJ5VWUR.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
rewriteHtml
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-QMA7CK7B.js";
|
|
10
|
+
import "./chunk-LCPSKHAV.js";
|
|
11
11
|
import {
|
|
12
12
|
count
|
|
13
13
|
} from "./chunk-NKXEPHRZ.js";
|
|
@@ -15,16 +15,16 @@ import "./chunk-AD3HAW3W.js";
|
|
|
15
15
|
import {
|
|
16
16
|
dirsOf
|
|
17
17
|
} from "./chunk-DDV6JEC2.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-5DNDSNTP.js";
|
|
19
19
|
import {
|
|
20
20
|
closest,
|
|
21
21
|
closestPathFinder
|
|
22
22
|
} from "./chunk-FVZ5JBRI.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-NFJJKDRI.js";
|
|
24
24
|
import {
|
|
25
25
|
TRAIL_GOES_COLD
|
|
26
26
|
} from "./chunk-UU43WIZG.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-JWCCVTTR.js";
|
|
28
28
|
import "./chunk-CMUWRPSQ.js";
|
|
29
29
|
import {
|
|
30
30
|
Diagnostics,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isCapturing,
|
|
34
34
|
warn,
|
|
35
35
|
warning
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
37
37
|
import {
|
|
38
38
|
compareText
|
|
39
39
|
} from "./chunk-VJWQSYEG.js";
|
|
@@ -296,7 +296,7 @@ function find(output, urlPath, written) {
|
|
|
296
296
|
const index = path.join(base, "index.html");
|
|
297
297
|
return there(index) ? index : void 0;
|
|
298
298
|
}
|
|
299
|
-
function redirectSources(output) {
|
|
299
|
+
function redirectSources(output, base) {
|
|
300
300
|
let text;
|
|
301
301
|
try {
|
|
302
302
|
text = fs.readFileSync(path.join(output, "_redirects"), "utf8");
|
|
@@ -308,7 +308,7 @@ function redirectSources(output) {
|
|
|
308
308
|
const l = trim(line);
|
|
309
309
|
if (l === "" || l.startsWith("#")) continue;
|
|
310
310
|
const from = firstWord(l);
|
|
311
|
-
if (from !== void 0 && from.startsWith("/")) sources.push(from);
|
|
311
|
+
if (from !== void 0 && from.startsWith("/")) sources.push(inSite(from, base) ?? from);
|
|
312
312
|
}
|
|
313
313
|
return sources;
|
|
314
314
|
}
|
|
@@ -360,7 +360,7 @@ async function check(config, output, written, options) {
|
|
|
360
360
|
const origin = (options.url === void 0 ? void 0 : originOf(options.url)) ?? sitemapOrigin(output);
|
|
361
361
|
const ids = new Map(scans.map(([file, scan]) => [file, scan.ids]));
|
|
362
362
|
const writtenFiles = new Set(written);
|
|
363
|
-
const redirects = redirectSources(output);
|
|
363
|
+
const redirects = redirectSources(output, config.base);
|
|
364
364
|
const anchors = options.anchors ?? true;
|
|
365
365
|
let checked = 0;
|
|
366
366
|
const seen = /* @__PURE__ */ new Set();
|
package/lib/minify.js
CHANGED
|
@@ -2,27 +2,27 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
Options
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HGJ5VWUR.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
RustPlugin,
|
|
9
9
|
compilePlugin
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-QMA7CK7B.js";
|
|
11
|
+
import "./chunk-LCPSKHAV.js";
|
|
12
12
|
import "./chunk-NKXEPHRZ.js";
|
|
13
13
|
import "./chunk-AD3HAW3W.js";
|
|
14
14
|
import "./chunk-DDV6JEC2.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-5DNDSNTP.js";
|
|
16
16
|
import {
|
|
17
17
|
closest
|
|
18
18
|
} from "./chunk-FVZ5JBRI.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-NFJJKDRI.js";
|
|
20
20
|
import "./chunk-UU43WIZG.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-JWCCVTTR.js";
|
|
22
22
|
import "./chunk-CMUWRPSQ.js";
|
|
23
23
|
import {
|
|
24
24
|
BuildError
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
26
26
|
import "./chunk-VJWQSYEG.js";
|
|
27
27
|
import "./chunk-I3PS26CI.js";
|
|
28
28
|
|
package/lib/redirects.js
CHANGED
|
@@ -2,27 +2,27 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
Options
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HGJ5VWUR.js";
|
|
6
6
|
import {
|
|
7
7
|
BUILTINS,
|
|
8
8
|
debugString,
|
|
9
9
|
escapeHtml,
|
|
10
10
|
withBase
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QMA7CK7B.js";
|
|
12
|
+
import "./chunk-LCPSKHAV.js";
|
|
13
13
|
import "./chunk-NKXEPHRZ.js";
|
|
14
14
|
import "./chunk-AD3HAW3W.js";
|
|
15
15
|
import "./chunk-DDV6JEC2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-5DNDSNTP.js";
|
|
17
17
|
import "./chunk-FVZ5JBRI.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-NFJJKDRI.js";
|
|
19
19
|
import "./chunk-UU43WIZG.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-JWCCVTTR.js";
|
|
21
21
|
import "./chunk-CMUWRPSQ.js";
|
|
22
22
|
import {
|
|
23
23
|
bail,
|
|
24
24
|
context
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
26
26
|
import {
|
|
27
27
|
compareText,
|
|
28
28
|
displayPath,
|
|
@@ -140,7 +140,7 @@ BUILTINS.set("ssqch/redirects", (config, given) => {
|
|
|
140
140
|
const target = withBase(config2.base, to);
|
|
141
141
|
files.push({ path, contents: redirectPage(target), hook: { name: "redirect", value: { from, to: target } } });
|
|
142
142
|
}
|
|
143
|
-
lines += `${from} ${to} 301
|
|
143
|
+
lines += `${withBase(config2.base, from)} ${withBase(config2.base, to)} 301
|
|
144
144
|
`;
|
|
145
145
|
}
|
|
146
146
|
if (netlify && lines !== "") files.push({ path: "/_redirects", contents: lines, append: true });
|
package/lib/rss.js
CHANGED
|
@@ -2,28 +2,29 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
feedImages
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7HXCQEGA.js";
|
|
6
6
|
import {
|
|
7
7
|
Options
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HGJ5VWUR.js";
|
|
9
9
|
import {
|
|
10
10
|
BUILTINS,
|
|
11
|
-
rewriteHtml
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
rewriteHtml,
|
|
12
|
+
withBaseOnce
|
|
13
|
+
} from "./chunk-QMA7CK7B.js";
|
|
14
|
+
import "./chunk-LCPSKHAV.js";
|
|
14
15
|
import "./chunk-NKXEPHRZ.js";
|
|
15
16
|
import "./chunk-AD3HAW3W.js";
|
|
16
17
|
import "./chunk-DDV6JEC2.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-5DNDSNTP.js";
|
|
18
19
|
import "./chunk-FVZ5JBRI.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-NFJJKDRI.js";
|
|
20
21
|
import "./chunk-UU43WIZG.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-JWCCVTTR.js";
|
|
22
23
|
import "./chunk-CMUWRPSQ.js";
|
|
23
24
|
import {
|
|
24
25
|
bail,
|
|
25
26
|
toDate
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BGCBSQ4A.js";
|
|
27
28
|
import "./chunk-VJWQSYEG.js";
|
|
28
29
|
import "./chunk-I3PS26CI.js";
|
|
29
30
|
|
|
@@ -69,15 +70,15 @@ function year(d) {
|
|
|
69
70
|
if (y < 0) return `-${String(-y).padStart(4, "0")}`;
|
|
70
71
|
return y > 9999 ? `+${y}` : String(y).padStart(4, "0");
|
|
71
72
|
}
|
|
72
|
-
function absoluteUrl(url, base) {
|
|
73
|
-
const text = String(url);
|
|
73
|
+
function absoluteUrl(url, base, siteBase = "") {
|
|
74
|
+
const text = withBaseOnce(siteBase, String(url));
|
|
74
75
|
try {
|
|
75
76
|
return new URL(text, String(base)).toString();
|
|
76
77
|
} catch {
|
|
77
78
|
return text;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
function htmlToAbsoluteUrls(html, base) {
|
|
81
|
+
function htmlToAbsoluteUrls(html, base, siteBase = "") {
|
|
81
82
|
const baseUrl = String(base);
|
|
82
83
|
return rewriteHtml(String(html ?? ""), {
|
|
83
84
|
tag(el) {
|
|
@@ -85,25 +86,25 @@ function htmlToAbsoluteUrls(html, base) {
|
|
|
85
86
|
const v = el.get(attr);
|
|
86
87
|
if (v === void 0) continue;
|
|
87
88
|
if (attr !== "srcset") {
|
|
88
|
-
el.set(attr, absoluteUrl(v, baseUrl));
|
|
89
|
+
el.set(attr, absoluteUrl(v, baseUrl, siteBase));
|
|
89
90
|
continue;
|
|
90
91
|
}
|
|
91
92
|
const candidates = v.split(",").map((c) => {
|
|
92
93
|
const candidate = c.trim();
|
|
93
94
|
const space = candidate.indexOf(" ");
|
|
94
|
-
return space === -1 ? absoluteUrl(candidate, baseUrl) : `${absoluteUrl(candidate.slice(0, space), baseUrl)} ${candidate.slice(space + 1)}`;
|
|
95
|
+
return space === -1 ? absoluteUrl(candidate, baseUrl, siteBase) : `${absoluteUrl(candidate.slice(0, space), baseUrl, siteBase)} ${candidate.slice(space + 1)}`;
|
|
95
96
|
});
|
|
96
97
|
el.set(attr, candidates.join(", "));
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
|
-
function feedHtml(html, base, options) {
|
|
102
|
+
function feedHtml(html, base, options, siteBase = "") {
|
|
102
103
|
const feedImages2 = feedImages;
|
|
103
104
|
if (typeof feedImages2 !== "function") bail("feedHtml() isn't in the Node build of ssqch yet (the move to Node, stage 5)");
|
|
104
105
|
const source = html === void 0 || html === null ? "" : String(html);
|
|
105
106
|
const done = feedImages2(source, String(base), options);
|
|
106
|
-
return typeof done === "string" ? htmlToAbsoluteUrls(done, base) : done.then((h) => htmlToAbsoluteUrls(h, base));
|
|
107
|
+
return typeof done === "string" ? htmlToAbsoluteUrls(done, base, siteBase) : done.then((h) => htmlToAbsoluteUrls(h, base, siteBase));
|
|
107
108
|
}
|
|
108
109
|
BUILTINS.set("ssqch/rss", (config, options) => {
|
|
109
110
|
new Options(options, []);
|
|
@@ -111,15 +112,15 @@ BUILTINS.set("ssqch/rss", (config, options) => {
|
|
|
111
112
|
filters.set("getNewestCollectionItemDate", (items) => getNewestCollectionItemDate(items));
|
|
112
113
|
filters.set("dateToRfc3339", (date) => dateToRfc3339(date));
|
|
113
114
|
filters.set("dateToRfc822", (date) => dateToRfc822(date));
|
|
114
|
-
filters.set("absoluteUrl", (url, base) => absoluteUrl(output(url), output(base)));
|
|
115
|
-
filters.set("htmlToAbsoluteUrls", (html, base) => htmlToAbsoluteUrls(output(html), output(base)));
|
|
115
|
+
filters.set("absoluteUrl", (url, base) => absoluteUrl(output(url), output(base), config.base));
|
|
116
|
+
filters.set("htmlToAbsoluteUrls", (html, base) => htmlToAbsoluteUrls(output(html), output(base), config.base));
|
|
116
117
|
const unprefixed = (e) => {
|
|
117
118
|
if (e instanceof Error && e.message.startsWith("feedHtml(): ")) e.message = e.message.slice("feedHtml(): ".length);
|
|
118
119
|
return e;
|
|
119
120
|
};
|
|
120
121
|
filters.set("feedHtml", (html, base, options2) => {
|
|
121
122
|
try {
|
|
122
|
-
const done = feedHtml(html, base, options2);
|
|
123
|
+
const done = feedHtml(html, base, options2, config.base);
|
|
123
124
|
return typeof done === "string" ? done : done.catch((e) => {
|
|
124
125
|
throw unprefixed(e);
|
|
125
126
|
});
|