ssqch 0.10.1 → 0.11.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 +61 -15
- package/bundled/completions/elvish +27 -12
- package/bundled/completions/fish +35 -23
- package/bundled/completions/powershell +29 -12
- package/bundled/completions/zsh +39 -19
- package/bundled/docs/agents.md +11 -0
- package/bundled/docs/comparing-builds.md +37 -5
- package/bundled/docs/configuring.md +30 -5
- package/bundled/docs/field-guide.md +1 -1
- package/bundled/docs/github-pages.md +1 -1
- package/bundled/docs/index.md +1 -1
- package/bundled/docs/known-gaps.md +1 -1
- package/bundled/docs/markdown.md +63 -5
- package/bundled/docs/multilingual.md +20 -3
- package/bundled/docs/nav.yml +1 -0
- package/bundled/docs/netlify.md +2 -2
- package/bundled/docs/plugins.md +4 -4
- package/bundled/docs/seo.md +39 -1
- package/bundled/docs/template-languages.md +6 -4
- package/bundled/docs/templates.md +3 -3
- package/bundled/docs/trailheads/from-eleventy.md +25 -13
- package/bundled/docs/trailheads/from-hugo.md +103 -0
- package/bundled/docs/trailheads/from-jekyll.md +49 -15
- package/bundled/docs/trailheads/from-mkdocs.md +54 -9
- package/bundled/docs/trailheads/from-zola.md +2 -2
- package/bundled/docs/trailheads.md +22 -5
- package/bundled/docs/where-values-come-from.md +1 -1
- package/bundled/mkdocs/404.jinja +6 -0
- package/bundled/ssqch.d.ts +71 -16
- package/lib/assets.js +10 -9
- package/lib/{chunk-MUYWL4ZX.js → chunk-2L3HR67O.js} +71 -18
- package/lib/{chunk-ERNVEZOK.js → chunk-2QTJTEBV.js} +1 -1
- package/lib/{chunk-CXRHH5P5.js → chunk-3HZZY3Y7.js} +5 -5
- package/lib/{chunk-G67W2FTJ.js → chunk-3K237XAX.js} +9 -8
- package/lib/{chunk-6RSZV5O2.js → chunk-443ZQLVX.js} +3 -3
- package/lib/{chunk-ZZBHBLDB.js → chunk-5ELAUHRL.js} +18 -16
- package/lib/{chunk-MDG5A4NI.js → chunk-A75EVUJX.js} +5 -5
- package/lib/{chunk-JFPLNHEQ.js → chunk-AIMEXBTK.js} +28 -5
- package/lib/{chunk-6OUT5VFK.js → chunk-B5E27PLU.js} +10 -39
- package/lib/{chunk-R2YGC3VE.js → chunk-CMJ7X5WW.js} +3 -2
- package/lib/{chunk-MDB3D3LP.js → chunk-ERAIEV3O.js} +2 -2
- package/lib/{chunk-DTSTCVRX.js → chunk-FCM3NYFR.js} +11 -8
- package/lib/{chunk-X7C6GFUM.js → chunk-GJNIQAIH.js} +8 -8
- package/lib/{chunk-FYRC2HBU.js → chunk-GLJQ4C76.js} +39 -18
- package/lib/{chunk-BXARVN5Z.js → chunk-GS5B3CBW.js} +1 -1
- package/lib/chunk-H5K2ZE7B.js +219 -0
- package/lib/{chunk-DNWA7WNO.js → chunk-HFSWUTXX.js} +1 -1
- package/lib/{chunk-7JGYYAKI.js → chunk-HWW5NCVJ.js} +1 -1
- package/lib/{chunk-BT3NVQOD.js → chunk-I3HYKEEW.js} +1 -1
- package/lib/{chunk-RFNLZM7W.js → chunk-IOBC665M.js} +1 -1
- package/lib/chunk-JC54PHIT.js +7992 -0
- package/lib/{chunk-3BQJY6GF.js → chunk-KCF2Z6N7.js} +1 -1
- package/lib/{chunk-HMVYNV6M.js → chunk-KZZS4W2V.js} +14 -12
- package/lib/{chunk-XR7GFL4B.js → chunk-LJOURBYT.js} +14 -12
- package/lib/chunk-OQGXZYZS.js +45 -0
- package/lib/chunk-OSBEH67S.js +6296 -0
- package/lib/{chunk-FYU22VDK.js → chunk-QJ5ZFTML.js} +14 -12
- package/lib/{chunk-LU73FTIR.js → chunk-QLUTNR37.js} +11 -10
- package/lib/{chunk-DUGGZ4EE.js → chunk-RBNPBTDP.js} +1 -1
- package/lib/{chunk-F65YUXZ7.js → chunk-RIAOXEXC.js} +10 -4
- package/lib/chunk-RVXGUMFI.js +21 -0
- package/lib/{chunk-FZGJUJAL.js → chunk-RYIWYWRQ.js} +3 -3
- package/lib/{chunk-LYPKL524.js → chunk-RZYAIX2R.js} +12 -10
- package/lib/{chunk-3NDFUMV2.js → chunk-V2FSMOFX.js} +3 -3
- package/lib/{chunk-26SHWRC6.js → chunk-X2GAVYV2.js} +524 -72
- package/lib/chunk-XS4EJSEK.js +279 -0
- package/lib/chunk-YCOTX2VM.js +37 -0
- package/lib/{chunk-P2TRR6XK.js → chunk-Z44IAMNG.js} +85 -16
- package/lib/chunk-Z5OP43HU.js +2945 -0
- package/lib/{chunk-3LODFCCH.js → chunk-ZINLHOX4.js} +2 -2
- package/lib/{chunk-HNG372DW.js → chunk-ZR3JYLFB.js} +814 -12347
- package/lib/cli.js +78 -37
- package/lib/elements.js +10 -9
- package/lib/image.js +11 -10
- package/lib/links.js +10 -9
- package/lib/minify.js +71 -12
- package/lib/redirects.js +10 -9
- package/lib/rss.js +13 -10
- package/lib/sass.js +13 -243
- package/lib/sitemap.js +18 -15
- package/lib/ssqch.js +6 -4
- package/package.json +1 -1
- package/types/index.d.ts +52 -11
- package/types/minify.d.ts +15 -3
- package/types/sass.d.ts +2 -0
- package/types/sitemap.d.ts +2 -2
- package/wasm/markdown.wasm +0 -0
- package/wasm/minify.wasm +0 -0
- package/wasm/sass.wasm +0 -0
- package/lib/chunk-II7ZRIAC.js +0 -1285
- package/lib/chunk-IOXCGMSF.js +0 -1539
- /package/lib/{chunk-JFPLNHEQ.js.LEGAL.txt → chunk-AIMEXBTK.js.LEGAL.txt} +0 -0
- /package/lib/{chunk-HNG372DW.js.LEGAL.txt → chunk-ZR3JYLFB.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { createRequire as __ssqchCreateRequire } from "node:module";
|
|
2
|
+
const require = __ssqchCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
commandLine
|
|
5
|
+
} from "./chunk-HWW5NCVJ.js";
|
|
6
|
+
import {
|
|
7
|
+
compareRuns,
|
|
8
|
+
runsText
|
|
9
|
+
} from "./chunk-X2GAVYV2.js";
|
|
10
|
+
import {
|
|
11
|
+
compareText,
|
|
12
|
+
red
|
|
13
|
+
} from "./chunk-AIMEXBTK.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/baseline.ts
|
|
16
|
+
import { spawnSync } from "node:child_process";
|
|
17
|
+
import fs from "node:fs";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
var FALLBACK_TIME = Date.UTC(2026, 0, 1) / 1e3;
|
|
20
|
+
function baselineTime(root, rev = "HEAD") {
|
|
21
|
+
const inGit = git(root, ["rev-parse", "--is-inside-work-tree"]).status === 0;
|
|
22
|
+
return inGit ? Number(git(root, ["log", "-1", "--format=%ct", rev]).stdout.toString().trim()) || FALLBACK_TIME : FALLBACK_TIME;
|
|
23
|
+
}
|
|
24
|
+
var BaselineError = class extends Error {
|
|
25
|
+
};
|
|
26
|
+
var git = (root, args) => spawnSync("git", ["-C", root, ...args], { encoding: "buffer", maxBuffer: 1 << 30 });
|
|
27
|
+
async function runBaseline(options) {
|
|
28
|
+
const say = (line) => {
|
|
29
|
+
if (!options.quiet) process.stderr.write(`${line}
|
|
30
|
+
`);
|
|
31
|
+
};
|
|
32
|
+
const root = path.resolve(options.root);
|
|
33
|
+
const work = path.join(root, ".cache", "ssqch", "baseline-copies");
|
|
34
|
+
const worktrees = [];
|
|
35
|
+
try {
|
|
36
|
+
if (!options.command.trim()) throw new BaselineError('give the old generator\'s build command: `ssqch baseline "npx @11ty/eleventy"`');
|
|
37
|
+
if (!Number.isInteger(options.runs) || options.runs < 1) throw new BaselineError(`--runs ${options.runs}: give a number of builds, 1 or more`);
|
|
38
|
+
if (path.isAbsolute(options.from) || options.from.split(/[\\/]/).includes("..")) throw new BaselineError(`--from ${options.from}: the folder the command writes, inside the site's folder (\`_site\`)`);
|
|
39
|
+
const inGit = git(root, ["rev-parse", "--is-inside-work-tree"]).status === 0;
|
|
40
|
+
if (options.commit !== void 0 && !inGit) throw new BaselineError(`--commit ${options.commit}: ${root} isn't in a git repository`);
|
|
41
|
+
const rev = options.commit ?? "HEAD";
|
|
42
|
+
const time = baselineTime(root, rev);
|
|
43
|
+
if (options.commit !== void 0 && git(root, ["rev-parse", "--verify", "--quiet", `${options.commit}^{commit}`]).status !== 0) throw new BaselineError(`--commit ${options.commit}: no such commit`);
|
|
44
|
+
const patch = options.patch === void 0 ? void 0 : path.resolve(options.patch);
|
|
45
|
+
if (patch !== void 0 && !fs.statSync(patch, { throwIfNoEntry: false })?.isFile()) throw new BaselineError(`--patch ${options.patch}: no such file (a patch, as \`git diff > fix.patch\` writes)`);
|
|
46
|
+
if (path.isAbsolute(options.to) || options.to.split(/[\\/]/).includes("..")) throw new BaselineError(`--to ${options.to}: a name inside the site's folder (\`ref\`, or \`.refs/jekyll\`)`);
|
|
47
|
+
let command = options.command;
|
|
48
|
+
let clock = "TZ=UTC, SOURCE_DATE_EPOCH and every file's time pinned; a generator that reads its own clock isn't, so pin it in its config if the builds vary";
|
|
49
|
+
const jekyll = /\bjekyll\s+build\b/.test(command);
|
|
50
|
+
if (jekyll) {
|
|
51
|
+
const pin = path.join(work, "..", "baseline-time.yml");
|
|
52
|
+
fs.mkdirSync(path.dirname(pin), { recursive: true });
|
|
53
|
+
fs.writeFileSync(pin, `# Written by ssqch baseline: Jekyll's site.time, pinned.
|
|
54
|
+
time: ${new Date(time * 1e3).toISOString().replace("T", " ").replace(/\.\d+Z$/, " +0000")}
|
|
55
|
+
`);
|
|
56
|
+
const given = /--config(=|\s+)(\S+)/.exec(command);
|
|
57
|
+
if (given) {
|
|
58
|
+
command = command.replace(given[0], `--config${given[1]}${given[2]},${JSON.stringify(pin)}`);
|
|
59
|
+
clock = `TZ=UTC, SOURCE_DATE_EPOCH, every file's time and Jekyll's site.time pinned (a time: of its own, after --config ${given[2]})`;
|
|
60
|
+
} else {
|
|
61
|
+
command = command.replace(/\bjekyll\s+build\b/, (m) => `${m} --config _config.yml,${JSON.stringify(pin)}`);
|
|
62
|
+
clock = "TZ=UTC, SOURCE_DATE_EPOCH, every file's time and Jekyll's site.time pinned (with --config _config.yml and a time: of its own)";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const copyInstalls = options.copyInstalls || /\bhugo\b/.test(options.command);
|
|
66
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
67
|
+
fs.mkdirSync(work, { recursive: true });
|
|
68
|
+
const names = [];
|
|
69
|
+
for (let run = 1; run <= options.runs; run++) {
|
|
70
|
+
const copy = path.join(work, `run-${run}`);
|
|
71
|
+
if (options.commit !== void 0) {
|
|
72
|
+
const added = git(root, ["worktree", "add", "--detach", "--force", copy, options.commit]);
|
|
73
|
+
if (added.status !== 0) throw new BaselineError(`couldn't check out ${options.commit}: ${added.stderr.toString().trim()}`);
|
|
74
|
+
worktrees.push(copy);
|
|
75
|
+
} else {
|
|
76
|
+
const untracked = copyWorkingTree(root, copy, inGit, [options.from, ".cache", "node_modules"], options.to);
|
|
77
|
+
if (run === 1 && untracked.length) {
|
|
78
|
+
const folders = [...new Set(untracked.map((rel) => rel.includes("/") ? `${rel.slice(0, rel.indexOf("/"))}/` : rel))].sort(compareText);
|
|
79
|
+
process.stderr.write(`warn: ${untracked.length === 1 ? "1 file git doesn't track goes" : `${untracked.length} files git doesn't track go`} into the copies too (${folders.slice(0, 4).join(", ")}${folders.length > 4 ? ", ..." : ""}), as the old generator reads the working tree; a fresh checkout wouldn't have ${untracked.length === 1 ? "it" : "them"}. Add ${untracked.length === 1 ? "it" : "them"} to git or .gitignore, or build a commit (\`--commit HEAD\`)
|
|
80
|
+
`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (patch !== void 0) {
|
|
84
|
+
const applied = spawnSync("git", ["apply", "--whitespace=nowarn", patch], { cwd: copy, encoding: "utf8", env: { ...process.env, GIT_CEILING_DIRECTORIES: path.dirname(copy) } });
|
|
85
|
+
if (applied.status !== 0) throw new BaselineError(`--patch ${options.patch}: didn't apply to ${options.commit ?? "the working tree"}: ${(applied.stderr || applied.error?.message || "").trim()}`);
|
|
86
|
+
}
|
|
87
|
+
pinTimes(copy, time);
|
|
88
|
+
for (const rel of installs(root, options.link)) {
|
|
89
|
+
const from = path.join(root, ...rel.split("/"));
|
|
90
|
+
const to = path.join(copy, ...rel.split("/"));
|
|
91
|
+
if (!fs.existsSync(from) || fs.existsSync(to)) continue;
|
|
92
|
+
fs.mkdirSync(path.dirname(to), { recursive: true });
|
|
93
|
+
const dir = fs.statSync(from).isDirectory();
|
|
94
|
+
if (dir && copyInstalls) fs.cpSync(from, to, { recursive: true, verbatimSymlinks: true, mode: fs.constants.COPYFILE_FICLONE });
|
|
95
|
+
else if (dir) fs.symlinkSync(from, to, process.platform === "win32" ? "junction" : "dir");
|
|
96
|
+
else fs.copyFileSync(from, to);
|
|
97
|
+
}
|
|
98
|
+
say(`Building ${run} of ${options.runs}: ${command}`);
|
|
99
|
+
const { file, args, options: spawnOptions } = commandLine(command, copy, { TZ: "UTC", SOURCE_DATE_EPOCH: String(time) });
|
|
100
|
+
const result = spawnSync(file, args, { ...spawnOptions, stdio: ["ignore", options.quiet ? "ignore" : process.stderr, options.quiet ? "ignore" : process.stderr] });
|
|
101
|
+
if (result.error) throw new BaselineError(`couldn't run \`${options.command}\`: ${result.error.message}`);
|
|
102
|
+
if (result.status !== 0) throw new BaselineError(`\`${options.command}\` failed in build ${run} (exit code ${result.status ?? result.signal}); its output is above`);
|
|
103
|
+
const built = path.join(copy, options.from);
|
|
104
|
+
if (!fs.statSync(built, { throwIfNoEntry: false })?.isDirectory()) throw new BaselineError(`\`${options.command}\` wrote no ${options.from}/ in build ${run}: give the folder it writes with --from (Eleventy and Jekyll write _site, Hugo public, Astro dist)`);
|
|
105
|
+
if (run === 1 && jekyll) {
|
|
106
|
+
const home = path.join(built, "index.html");
|
|
107
|
+
const text = fs.statSync(home, { throwIfNoEntry: false })?.isFile() ? fs.readFileSync(home, "utf8") : "";
|
|
108
|
+
if (text.includes("github.com/pages/")) process.stderr.write("warn: Jekyll's build has `https://github.com/pages/...` URLs: jekyll-github-metadata couldn't tell which repository this is, so `site.url` is wrong on every page. Give it the repository (`PAGES_REPO_NWO=owner/repo`, and `JEKYLL_GITHUB_TOKEN` if it asks), or `url:` in a config of your own\n");
|
|
109
|
+
}
|
|
110
|
+
const name = `${options.to}-${run}`;
|
|
111
|
+
const target = path.join(root, ...name.split("/"));
|
|
112
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
113
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
114
|
+
fs.renameSync(built, target);
|
|
115
|
+
names.push(name);
|
|
116
|
+
}
|
|
117
|
+
for (let run = options.runs + 1; fs.existsSync(path.join(root, `${options.to}-${run}`)); run++) fs.rmSync(path.join(root, `${options.to}-${run}`), { recursive: true, force: true });
|
|
118
|
+
const shown = names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
119
|
+
say(`Base camp is set: ${shown}, built from ${options.commit ?? "the working tree"}${options.patch !== void 0 ? ` and ${options.patch}` : ""} with ${clock}.`);
|
|
120
|
+
let code = 0;
|
|
121
|
+
let reference = names[0];
|
|
122
|
+
const common = path.join(root, `${options.to}-common`);
|
|
123
|
+
fs.rmSync(common, { recursive: true, force: true });
|
|
124
|
+
if (names.length > 1) {
|
|
125
|
+
const report = await compareRuns(names.map((n) => path.join(root, n)), { exact: false, ignore: [], only: void 0, lines: 10 });
|
|
126
|
+
process.stdout.write(runsText({ ...report, runs: names }, 10, process.stdout.isTTY === true));
|
|
127
|
+
code = report.varies.length ? 1 : 0;
|
|
128
|
+
reference = names[report.typical];
|
|
129
|
+
if (report.varies.length && names.length >= 3) {
|
|
130
|
+
fs.cpSync(path.join(root, names[report.typical]), common, { recursive: true, verbatimSymlinks: true });
|
|
131
|
+
for (const v of report.varies) {
|
|
132
|
+
const [most] = v.versions;
|
|
133
|
+
const own = v.files[report.typical];
|
|
134
|
+
if (own !== void 0) fs.rmSync(path.join(common, own), { force: true });
|
|
135
|
+
if (most.missing) continue;
|
|
136
|
+
const from = v.files[most.runs[0]];
|
|
137
|
+
fs.mkdirSync(path.dirname(path.join(common, from)), { recursive: true });
|
|
138
|
+
fs.copyFileSync(path.join(root, names[most.runs[0]], from), path.join(common, from));
|
|
139
|
+
}
|
|
140
|
+
reference = `${options.to}-common`;
|
|
141
|
+
say(`Wrote ${reference}: each file's most common version of the ${names.length} builds, to compare ssqch's with.`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
process.stdout.write(`
|
|
145
|
+
Next: build with ssqch into an empty folder, then \`ssqch diff ${reference} <ssqch's output>\`${code ? ", with an --ignore for what varies above" : ""}, and fix the biggest group first. The whole loop: \`ssqch docs "moving a site with an agent"\`.
|
|
146
|
+
`);
|
|
147
|
+
return code;
|
|
148
|
+
} catch (e) {
|
|
149
|
+
process.stderr.write(`${red("error:")} ${e instanceof BaselineError ? e.message : e instanceof Error ? e.message : String(e)}
|
|
150
|
+
`);
|
|
151
|
+
return 2;
|
|
152
|
+
} finally {
|
|
153
|
+
for (const tree of worktrees) git(root, ["worktree", "remove", "--force", tree]);
|
|
154
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
155
|
+
if (worktrees.length) git(root, ["worktree", "prune"]);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function installs(root, more) {
|
|
159
|
+
const found = ["node_modules", ".bundle", "vendor/bundle", ".venv"];
|
|
160
|
+
try {
|
|
161
|
+
const config = fs.readFileSync(path.join(root, ".bundle", "config"), "utf8");
|
|
162
|
+
const gems = /^BUNDLE_PATH:\s*["']?([^"'\n]+?)["']?\s*$/m.exec(config)?.[1];
|
|
163
|
+
if (gems && !path.isAbsolute(gems) && !gems.startsWith("~")) found.push(gems.replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
164
|
+
} catch {
|
|
165
|
+
}
|
|
166
|
+
for (const rel of more) {
|
|
167
|
+
if (path.isAbsolute(rel) || rel.split(/[\\/]/).includes("..")) throw new BaselineError(`--link ${rel}: a folder inside the site's folder (\`vendor/bundle\`)`);
|
|
168
|
+
found.push(rel.replaceAll("\\", "/").replace(/\/+$/, ""));
|
|
169
|
+
}
|
|
170
|
+
return [...new Set(found)];
|
|
171
|
+
}
|
|
172
|
+
function copyWorkingTree(root, copy, inGit, skip, to) {
|
|
173
|
+
const build = new RegExp(`^${to.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}-\\d+(?:/|$)`);
|
|
174
|
+
const skipped = (rel) => rel === ".git" || rel.startsWith(".git/") || build.test(rel) || skip.some((s) => rel === s || rel.startsWith(`${s}/`));
|
|
175
|
+
let files;
|
|
176
|
+
if (inGit) {
|
|
177
|
+
const listed = git(root, ["ls-files", "-z", "--cached", "--others", "--exclude-standard"]);
|
|
178
|
+
if (listed.status !== 0) throw new BaselineError(`couldn't list the site's files: ${listed.stderr.toString().trim()}`);
|
|
179
|
+
files = listed.stdout.toString().split("\0").filter(Boolean);
|
|
180
|
+
} else {
|
|
181
|
+
files = [];
|
|
182
|
+
const walk = (rel) => {
|
|
183
|
+
for (const entry of fs.readdirSync(path.join(root, rel), { withFileTypes: true }).sort((a, b) => compareText(a.name, b.name))) {
|
|
184
|
+
const child = rel ? `${rel}/${entry.name}` : entry.name;
|
|
185
|
+
if (skipped(child)) continue;
|
|
186
|
+
if (entry.isDirectory()) walk(child);
|
|
187
|
+
else if (entry.isFile()) files.push(child);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
walk("");
|
|
191
|
+
}
|
|
192
|
+
let untracked = [];
|
|
193
|
+
if (inGit) {
|
|
194
|
+
const others = git(root, ["ls-files", "-z", "--others", "--exclude-standard"]);
|
|
195
|
+
if (others.status === 0) untracked = others.stdout.toString().split("\0").filter((rel) => rel && !skipped(rel));
|
|
196
|
+
}
|
|
197
|
+
for (const rel of files) {
|
|
198
|
+
if (skipped(rel)) continue;
|
|
199
|
+
const from = path.join(root, ...rel.split("/"));
|
|
200
|
+
if (!fs.statSync(from, { throwIfNoEntry: false })?.isFile()) continue;
|
|
201
|
+
const to2 = path.join(copy, ...rel.split("/"));
|
|
202
|
+
fs.mkdirSync(path.dirname(to2), { recursive: true });
|
|
203
|
+
fs.copyFileSync(from, to2);
|
|
204
|
+
}
|
|
205
|
+
return untracked;
|
|
206
|
+
}
|
|
207
|
+
function pinTimes(dir, time) {
|
|
208
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
209
|
+
if (entry.name === ".git" || entry.name === "node_modules") continue;
|
|
210
|
+
const full = path.join(dir, entry.name);
|
|
211
|
+
if (entry.isDirectory()) pinTimes(full, time);
|
|
212
|
+
else if (entry.isFile()) fs.utimesSync(full, time, time);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export {
|
|
217
|
+
baselineTime,
|
|
218
|
+
runBaseline
|
|
219
|
+
};
|
|
@@ -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-AIMEXBTK.js";
|
|
6
6
|
|
|
7
7
|
// src/serve/builder.ts
|
|
8
8
|
import { fork } from "node:child_process";
|