@mark1russell7/conventions 0.64.3 → 0.64.5
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 +4 -1
- package/build/cli.js +1 -1
- package/build/index.d.ts +15 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/{run-gqm9mBei.js → run-DX5mvqwy.js} +362 -50
- package/build/run-DX5mvqwy.js.map +1 -0
- package/package.json +2 -2
- package/build/run-gqm9mBei.js.map +0 -1
|
@@ -5,8 +5,9 @@ import { createRequire } from "node:module";
|
|
|
5
5
|
import { spawnSync } from "node:child_process";
|
|
6
6
|
import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
8
|
-
import { LineCounter, isMap, isScalar, parseAllDocuments } from "yaml";
|
|
9
8
|
import { errorMessage } from "@mark1russell7/text";
|
|
9
|
+
import "@mark1russell7/text/references";
|
|
10
|
+
import { LineCounter, isMap, isScalar, isSeq, parseAllDocuments } from "yaml";
|
|
10
11
|
import { createHash } from "node:crypto";
|
|
11
12
|
import { containsShape, functionsOf } from "@mark1russell7/code-shape";
|
|
12
13
|
import { SECRET_SHAPES, findSecretShapes, findSecretShapesInValue, redactSecretShapes } from "@mark1russell7/text/redact";
|
|
@@ -911,12 +912,17 @@ document.addEventListener("click", (event) => {
|
|
|
911
912
|
const label = button.querySelector("[data-sp-label]");
|
|
912
913
|
if (label) label.textContent = open ? button.dataset.less : button.dataset.more;
|
|
913
914
|
});
|
|
914
|
-
// A malformed hash, for example "#100%", must not stop the module
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
hashed =
|
|
918
|
-
|
|
919
|
-
|
|
915
|
+
// A malformed hash, for example "#100%", must not stop the module. A second link in the same tab changes only the hash,
|
|
916
|
+
// so the page follows each change of the hash, not only the hash at its load.
|
|
917
|
+
const followHash = () => {
|
|
918
|
+
let hashed = "";
|
|
919
|
+
try {
|
|
920
|
+
hashed = decodeURIComponent(location.hash.slice(1));
|
|
921
|
+
} catch {}
|
|
922
|
+
for (const [version, panel] of panels) if (panel.id === hashed) select(version, null);
|
|
923
|
+
};
|
|
924
|
+
followHash();
|
|
925
|
+
window.addEventListener("hashchange", followHash);
|
|
920
926
|
const revealAll = () => { for (const box of boxes) reveal(box, selected, false); };
|
|
921
927
|
revealAll();
|
|
922
928
|
window.addEventListener("resize", revealAll);
|
|
@@ -1037,6 +1043,34 @@ function cronLines(workflow) {
|
|
|
1037
1043
|
}];
|
|
1038
1044
|
});
|
|
1039
1045
|
}
|
|
1046
|
+
// ../site-pages/src/site/snapshot.ts
|
|
1047
|
+
/**
|
|
1048
|
+
* The source of `replaceTokenColors`, as JavaScript text. The prerender starts this text in the browser, and Node.js
|
|
1049
|
+
* makes the same function from it. A bundler does not change a text, so the two use the same code. The code needs
|
|
1050
|
+
* nothing from outside its body.
|
|
1051
|
+
*/
|
|
1052
|
+
const REPLACE_TOKEN_COLORS_SOURCE = String.raw`function replaceTokenColors(text, tokens, keepCustomProperties) {
|
|
1053
|
+
const names = new Map(tokens);
|
|
1054
|
+
const swap = (match, digits, red, green, blue) => {
|
|
1055
|
+
let color;
|
|
1056
|
+
if (digits === undefined) {
|
|
1057
|
+
color = "#" + [red, green, blue].map((value) => Number(value).toString(16).padStart(2, "0")).join("");
|
|
1058
|
+
} else {
|
|
1059
|
+
color = "#" + (digits.length === 3 ? digits.replace(/./g, "$&$&") : digits).toLowerCase();
|
|
1060
|
+
}
|
|
1061
|
+
const name = names.get(color);
|
|
1062
|
+
return name === undefined ? match : "var(" + name + ")";
|
|
1063
|
+
};
|
|
1064
|
+
if (!keepCustomProperties) {
|
|
1065
|
+
return text.replace(/(?<![\w#(-])#([0-9a-f]{6}|[0-9a-f]{3})(?![\w-])|\brgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})\s*(?:[,/]\s*1(?:\.0*)?\s*)?\)/gi, swap);
|
|
1066
|
+
}
|
|
1067
|
+
// A custom property keeps its value: it holds a fixed color for one theme, for example a color of the code.
|
|
1068
|
+
return text.replace(
|
|
1069
|
+
/((?:^|[;{\s])--[\w-]+\s*:[^;{}]*)|(?<![\w#(-])#([0-9a-f]{6}|[0-9a-f]{3})(?![\w-])|\brgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})\s*(?:[,/]\s*1(?:\.0*)?\s*)?\)/gi,
|
|
1070
|
+
(match, custom, digits, red, green, blue) => (custom === undefined ? swap(match, digits, red, green, blue) : match),
|
|
1071
|
+
);
|
|
1072
|
+
}`;
|
|
1073
|
+
new Function(`return (${REPLACE_TOKEN_COLORS_SOURCE});`)();
|
|
1040
1074
|
// src/rules/changelog-version.ts
|
|
1041
1075
|
/**
|
|
1042
1076
|
* The rule `changelog-version`: the top release section of the changelog of a package is not above the version of
|
|
@@ -1821,7 +1855,7 @@ function inputsOf(owner) {
|
|
|
1821
1855
|
return Object.fromEntries(Object.entries(inputs).map(([key, value]) => [key, optionalText(value)]));
|
|
1822
1856
|
}
|
|
1823
1857
|
/** This function reads a step: the same label as the line reader gives, its condition, its action and its secrets. */
|
|
1824
|
-
function parsedStep(value) {
|
|
1858
|
+
function parsedStep(value, line) {
|
|
1825
1859
|
const step = isObject$1(value) ? value : {};
|
|
1826
1860
|
const uses = actionOf(optionalText(step["uses"]));
|
|
1827
1861
|
return {
|
|
@@ -1830,7 +1864,8 @@ function parsedStep(value) {
|
|
|
1830
1864
|
uses,
|
|
1831
1865
|
secrets: [...secretsOf(step)],
|
|
1832
1866
|
with: inputsOf(step),
|
|
1833
|
-
run: optionalText(step["run"])
|
|
1867
|
+
run: optionalText(step["run"]),
|
|
1868
|
+
line
|
|
1834
1869
|
};
|
|
1835
1870
|
}
|
|
1836
1871
|
/** This function gives the `concurrency` of a workflow or of a job: a group as one text, or a map with `group`. */
|
|
@@ -1893,8 +1928,14 @@ function matrixJobsOf(strategy) {
|
|
|
1893
1928
|
const added = included.filter((entry) => !combinations.some((combination) => agrees(entry, combination, keys))).length;
|
|
1894
1929
|
return combinations.length + added;
|
|
1895
1930
|
}
|
|
1896
|
-
/** This function
|
|
1897
|
-
function
|
|
1931
|
+
/** This function gives the folder of `defaults.run.working-directory` of a workflow or of a job, or an empty text. */
|
|
1932
|
+
function defaultDirectoryOf(owner) {
|
|
1933
|
+
const defaults = owner["defaults"];
|
|
1934
|
+
const run = isObject$1(defaults) ? defaults["run"] : void 0;
|
|
1935
|
+
return isObject$1(run) ? optionalText(run["working-directory"]) : "";
|
|
1936
|
+
}
|
|
1937
|
+
/** This function reads a job. The folder `workflowDirectory` is the default folder of the workflow. */
|
|
1938
|
+
function parsedJob(id, value, at, workflowDirectory) {
|
|
1898
1939
|
const job = isObject$1(value) ? value : {};
|
|
1899
1940
|
const secrets = secretsOf(job);
|
|
1900
1941
|
if (job["secrets"] === "inherit") secrets.add("inherit");
|
|
@@ -1902,8 +1943,8 @@ function parsedJob(id, value, line, lines) {
|
|
|
1902
1943
|
const limit = strategy["max-parallel"];
|
|
1903
1944
|
return {
|
|
1904
1945
|
id,
|
|
1905
|
-
line,
|
|
1906
|
-
lines,
|
|
1946
|
+
line: at.line,
|
|
1947
|
+
lines: at.lines,
|
|
1907
1948
|
name: optionalText(job["name"]) || id,
|
|
1908
1949
|
maxParallel: typeof limit === "number" && Number.isInteger(limit) && limit > 0 ? limit : null,
|
|
1909
1950
|
matrixJobs: isExpression(job["strategy"]) || isExpression(strategy["matrix"]) ? null : matrixJobsOf(strategy),
|
|
@@ -1914,7 +1955,8 @@ function parsedJob(id, value, line, lines) {
|
|
|
1914
1955
|
with: inputsOf(job),
|
|
1915
1956
|
permissions: permissionsOf(job),
|
|
1916
1957
|
secrets: [...secrets],
|
|
1917
|
-
steps: Array.isArray(job["steps"]) ? job["steps"].map(parsedStep) : []
|
|
1958
|
+
steps: Array.isArray(job["steps"]) ? job["steps"].map((step, index) => parsedStep(step, at.steps[index] ?? at.line)) : [],
|
|
1959
|
+
defaultDirectory: defaultDirectoryOf(job) || workflowDirectory
|
|
1918
1960
|
};
|
|
1919
1961
|
}
|
|
1920
1962
|
/** This function gives the line of each key of a map node of the parser, two keys deep. A key that is not a scalar has no line. */
|
|
@@ -1974,12 +2016,20 @@ function parseWorkflow(file, text) {
|
|
|
1974
2016
|
const jobsNode = first.get("jobs");
|
|
1975
2017
|
if (isMap(jobsNode)) for (const pair of jobsNode.items) {
|
|
1976
2018
|
const at = isScalar(pair.key) ? pair.key.range?.[0] : void 0;
|
|
1977
|
-
if (at
|
|
2019
|
+
if (at === void 0) continue;
|
|
2020
|
+
const stepsNode = isMap(pair.value) ? pair.value.get("steps", true) : void 0;
|
|
2021
|
+
const steps = isSeq(stepsNode) ? stepsNode.items.map((item) => item !== null && typeof item === "object" && "range" in item && Array.isArray(item.range) ? lineOf(item.range[0]) : lineOf(at)) : [];
|
|
2022
|
+
jobNodes.set(String(pair.key.value), {
|
|
1978
2023
|
line: lineOf(at),
|
|
1979
|
-
lines: keyLinesOf(pair.value, lineOf)
|
|
2024
|
+
lines: keyLinesOf(pair.value, lineOf),
|
|
2025
|
+
steps
|
|
1980
2026
|
});
|
|
1981
2027
|
}
|
|
1982
|
-
const jobs = isObject$1(top["jobs"]) ? Object.entries(top["jobs"]).map(([id, job]) => parsedJob(id, job, jobNodes.get(id)
|
|
2028
|
+
const jobs = isObject$1(top["jobs"]) ? Object.entries(top["jobs"]).map(([id, job]) => parsedJob(id, job, jobNodes.get(id) ?? {
|
|
2029
|
+
line: 1,
|
|
2030
|
+
lines: {},
|
|
2031
|
+
steps: []
|
|
2032
|
+
}, defaultDirectoryOf(top))) : [];
|
|
1983
2033
|
const secrets = secretsOf(top);
|
|
1984
2034
|
if (jobs.some((job) => job.secrets.includes("inherit"))) secrets.add("inherit");
|
|
1985
2035
|
const lines = keyLinesOf(first.contents, lineOf);
|
|
@@ -4127,9 +4177,9 @@ const callPermissions = callPermissionsRule();
|
|
|
4127
4177
|
* GitHub fails at times with a 504, and a bare `curl` then fails the job.
|
|
4128
4178
|
*/
|
|
4129
4179
|
/** The files of a composite action. */
|
|
4130
|
-
const ACTION$
|
|
4180
|
+
const ACTION$7 = /^\.github\/actions\/.+\/action\.ya?ml$/;
|
|
4131
4181
|
/** The action of the template itself. It is the one place with the download. */
|
|
4132
|
-
const SHARED_ACTION$
|
|
4182
|
+
const SHARED_ACTION$3 = ".github/actions/setup-cue/action.yml";
|
|
4133
4183
|
/** A hand-written install of the cue CLI: a download of a release asset, or a build with `go install`. */
|
|
4134
4184
|
const DOWNLOAD = /github\.com\/cue-lang\/cue\/releases\/download\/(v[0-9][^/\s"']*)\/|cuelang\.org\/go\/cmd\/cue@(v?[0-9][^\s"']*|latest)/;
|
|
4135
4185
|
/** This function gives each line of a file that installs the cue CLI with its own command. It does not read a comment line. */
|
|
@@ -4174,7 +4224,7 @@ const setupCue = {
|
|
|
4174
4224
|
const files = context.gitFiles();
|
|
4175
4225
|
if (files === void 0) return { skipped: "the root is not in a git repository" };
|
|
4176
4226
|
const breaks = [];
|
|
4177
|
-
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$
|
|
4227
|
+
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$7.test(path)) && path !== SHARED_ACTION$3).sort(byCode)) {
|
|
4178
4228
|
let text;
|
|
4179
4229
|
try {
|
|
4180
4230
|
text = readFileSync(join(context.root, file), "utf8");
|
|
@@ -4200,9 +4250,9 @@ const setupCue = {
|
|
|
4200
4250
|
* `pnpm/action-setup` step fails the job when its fetch of pnpm stalls or when the pnpm that it installed does not start.
|
|
4201
4251
|
*/
|
|
4202
4252
|
/** The files of a composite action. */
|
|
4203
|
-
const ACTION$
|
|
4253
|
+
const ACTION$6 = /^\.github\/actions\/.+\/action\.ya?ml$/;
|
|
4204
4254
|
/** The action of the template itself. It is the one place with the step `pnpm/action-setup`. */
|
|
4205
|
-
const SHARED_ACTION$
|
|
4255
|
+
const SHARED_ACTION$2 = ".github/actions/setup-pnpm/action.yml";
|
|
4206
4256
|
/** A step that uses the action `pnpm/action-setup`, with its ref and the version in the comment after it. */
|
|
4207
4257
|
const ACTION_SETUP = /^\s*(?:-\s+)?uses:\s*["']?pnpm\/action-setup@([^\s"'#]+)["']?\s*(?:#\s*(\S+))?/;
|
|
4208
4258
|
/** The npm command of a global install, up to a comment or the end of the command. */
|
|
@@ -4244,7 +4294,7 @@ const setupPnpm = {
|
|
|
4244
4294
|
id: "setup-pnpm",
|
|
4245
4295
|
title: "pnpm comes from the shared action `setup-pnpm`, not from a step `pnpm/action-setup` or a global npm install in a workflow.",
|
|
4246
4296
|
reason: "A fetch of pnpm stalls at times, and the pnpm that an install gives does not always start. On 2026-12-02 a stalled fetch (EIDLETIMEOUT) failed the memory probe of layout-contract, and a pnpm that did not start failed the CI of wirelab. On 2026-12-03 one failed install made the weekly site run of packing red, and its 323 other jobs passed.",
|
|
4247
|
-
fix: "Use the step `uses: mark1russell7/template/.github/actions/setup-pnpm@<commit>` in place of `pnpm/action-setup`. The action reads the version from the field `packageManager` of `package.json`: move a `with: version` to that field. The input `package_json_file` becomes `package-json-file`. In place of `run_install`, add the step `
|
|
4297
|
+
fix: "Use the step `uses: mark1russell7/template/.github/actions/setup-pnpm@<commit>` in place of `pnpm/action-setup`. The action reads the version from the field `packageManager` of `package.json`: move a `with: version` to that field. The input `package_json_file` becomes `package-json-file`. In place of `run_install`, add the step `uses: mark1russell7/template/.github/actions/pnpm-install@<commit>`.",
|
|
4248
4298
|
sources: [
|
|
4249
4299
|
{
|
|
4250
4300
|
repo: "layout-contract",
|
|
@@ -4273,7 +4323,7 @@ const setupPnpm = {
|
|
|
4273
4323
|
const files = context.gitFiles();
|
|
4274
4324
|
if (files === void 0) return { skipped: "the root is not in a git repository" };
|
|
4275
4325
|
const breaks = [];
|
|
4276
|
-
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$
|
|
4326
|
+
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$6.test(path)) && path !== SHARED_ACTION$2).sort(byCode)) {
|
|
4277
4327
|
let text;
|
|
4278
4328
|
try {
|
|
4279
4329
|
text = readFileSync(join(context.root, file), "utf8");
|
|
@@ -4362,14 +4412,16 @@ const VALUE_OPTIONS = /* @__PURE__ */ new Set([
|
|
|
4362
4412
|
const INSTALL_COMMANDS = /* @__PURE__ */ new Set(["install", "i"]);
|
|
4363
4413
|
/** The option `--filter=` before the selector in one word. */
|
|
4364
4414
|
const FILTER_EQUALS = "--filter=";
|
|
4365
|
-
/** This function gives the
|
|
4366
|
-
function
|
|
4415
|
+
/** This function gives the install of the command `words`, or undefined when the command is not a `pnpm install`. */
|
|
4416
|
+
function installOf(words, editable, action) {
|
|
4367
4417
|
let at = 0;
|
|
4368
4418
|
while (at < words.length && !PNPM.test(words[at]?.text ?? "")) {
|
|
4369
4419
|
const text = words[at]?.text ?? "";
|
|
4370
|
-
if (!LAUNCHERS.has(text) && !(at > 0 && LAUNCHER_ARGUMENT.test(text)) && !/^[A-Za-z_]\w*=/.test(text)) return
|
|
4420
|
+
if (!LAUNCHERS.has(text) && !(at > 0 && LAUNCHER_ARGUMENT.test(text)) && !/^[A-Za-z_]\w*=/.test(text)) return void 0;
|
|
4371
4421
|
at += 1;
|
|
4372
4422
|
}
|
|
4423
|
+
const pnpm = words[at];
|
|
4424
|
+
if (pnpm === void 0) return void 0;
|
|
4373
4425
|
const args = words.slice(at + 1);
|
|
4374
4426
|
let command;
|
|
4375
4427
|
const found = [];
|
|
@@ -4397,9 +4449,15 @@ function selectorsOf(words, editable) {
|
|
|
4397
4449
|
if (command === void 0 && VALUE_OPTIONS.has(word.text)) index += 1;
|
|
4398
4450
|
} else command ??= word.text;
|
|
4399
4451
|
}
|
|
4400
|
-
|
|
4452
|
+
if (command === void 0 || !INSTALL_COMMANDS.has(command)) return void 0;
|
|
4453
|
+
return {
|
|
4454
|
+
line: pnpm.line + 1,
|
|
4455
|
+
words: words.slice(at).map((word) => word.text),
|
|
4456
|
+
action,
|
|
4457
|
+
selectors: found
|
|
4458
|
+
};
|
|
4401
4459
|
}
|
|
4402
|
-
/** This function gives
|
|
4460
|
+
/** This function gives each `pnpm install` in the tokens of one command line. */
|
|
4403
4461
|
function installsOf(tokens, editable) {
|
|
4404
4462
|
const found = [];
|
|
4405
4463
|
let words = [];
|
|
@@ -4408,11 +4466,80 @@ function installsOf(tokens, editable) {
|
|
|
4408
4466
|
words.push(token);
|
|
4409
4467
|
continue;
|
|
4410
4468
|
}
|
|
4411
|
-
|
|
4469
|
+
const install = installOf(words, editable, false);
|
|
4470
|
+
if (install !== void 0) found.push(install);
|
|
4412
4471
|
words = [];
|
|
4413
4472
|
}
|
|
4414
4473
|
return found;
|
|
4415
4474
|
}
|
|
4475
|
+
/** The value of `uses` of a step with the action `pnpm-install` of the template, pinned or in a local folder. */
|
|
4476
|
+
const PNPM_INSTALL_ACTION = /(?:^|\/)\.github\/actions\/pnpm-install(?:@|\/?\s*$|\/?\s+#)/;
|
|
4477
|
+
/** The place of the key of a line: its indent, also after the `- ` of a list item. */
|
|
4478
|
+
const keyPlace = (line) => line.length - line.trimStart().replace(/^-\s+/, "").length;
|
|
4479
|
+
/**
|
|
4480
|
+
* This function gives true when the key under `with` at the line `index` is an input of the action `pnpm-install`.
|
|
4481
|
+
* It reads the keys of the step before and after `with`.
|
|
4482
|
+
*/
|
|
4483
|
+
function inPnpmInstallStep(lines, index) {
|
|
4484
|
+
const own = indentOf$1(lines[index] ?? "");
|
|
4485
|
+
let at = index - 1;
|
|
4486
|
+
while (at >= 0 && ((lines[at] ?? "").trim() === "" || indentOf$1(lines[at] ?? "") >= own)) at -= 1;
|
|
4487
|
+
const withLine = lines[at] ?? "";
|
|
4488
|
+
if (at < 0 || KEY$1.exec(withLine)?.[1] !== "with") return false;
|
|
4489
|
+
const step = keyPlace(withLine);
|
|
4490
|
+
const usesAction = (line) => {
|
|
4491
|
+
const key = KEY$1.exec(line);
|
|
4492
|
+
return key?.[1] === "uses" && PNPM_INSTALL_ACTION.test(line.slice(key[0].length).replace(/^["']|["']\s*$/g, ""));
|
|
4493
|
+
};
|
|
4494
|
+
for (let back = at; back >= 0; back -= 1) {
|
|
4495
|
+
const line = lines[back] ?? "";
|
|
4496
|
+
if (line.trim() === "" || indentOf$1(line) > step) continue;
|
|
4497
|
+
if (keyPlace(line) !== step) break;
|
|
4498
|
+
if (usesAction(line)) return true;
|
|
4499
|
+
if (/^\s*-\s/.test(line)) break;
|
|
4500
|
+
}
|
|
4501
|
+
for (let next = at + 1; next < lines.length; next += 1) {
|
|
4502
|
+
const line = lines[next] ?? "";
|
|
4503
|
+
if (line.trim() === "" || indentOf$1(line) > step) continue;
|
|
4504
|
+
if (indentOf$1(line) !== step || /^\s*-\s/.test(line)) break;
|
|
4505
|
+
if (usesAction(line)) return true;
|
|
4506
|
+
}
|
|
4507
|
+
return false;
|
|
4508
|
+
}
|
|
4509
|
+
/**
|
|
4510
|
+
* This function gives the install of the input `args` at the line `index`, or undefined for another key or step. The
|
|
4511
|
+
* action `pnpm-install` starts `pnpm install` with the words of the input.
|
|
4512
|
+
*/
|
|
4513
|
+
function actionInstall(lines, index, key) {
|
|
4514
|
+
if (key[1] !== "args" || !inPnpmInstallStep(lines, index)) return void 0;
|
|
4515
|
+
const line = lines[index] ?? "";
|
|
4516
|
+
let from = key[0].length;
|
|
4517
|
+
let to = line.length;
|
|
4518
|
+
const value = line.slice(from).trimEnd();
|
|
4519
|
+
const quote = value.charAt(0);
|
|
4520
|
+
const quoted = (quote === "\"" || quote === "'") && value.length > 1 && value.endsWith(quote);
|
|
4521
|
+
if (quoted) {
|
|
4522
|
+
from += 1;
|
|
4523
|
+
to = from + value.length - 2;
|
|
4524
|
+
}
|
|
4525
|
+
const at = {
|
|
4526
|
+
line: index,
|
|
4527
|
+
start: key[0].length,
|
|
4528
|
+
end: key[0].length,
|
|
4529
|
+
operator: false
|
|
4530
|
+
};
|
|
4531
|
+
return installOf([
|
|
4532
|
+
{
|
|
4533
|
+
...at,
|
|
4534
|
+
text: "pnpm"
|
|
4535
|
+
},
|
|
4536
|
+
{
|
|
4537
|
+
...at,
|
|
4538
|
+
text: "install"
|
|
4539
|
+
},
|
|
4540
|
+
...shellTokens(line.slice(0, to), index, from).tokens.filter((token) => !token.operator)
|
|
4541
|
+
], !quoted, true);
|
|
4542
|
+
}
|
|
4416
4543
|
/** This function gives the end of the block of text under the key at the line `index`. The indent of a key after `- ` is the place of the key. */
|
|
4417
4544
|
function textEnd(lines, index) {
|
|
4418
4545
|
const line = lines[index] ?? "";
|
|
@@ -4422,12 +4549,12 @@ function textEnd(lines, index) {
|
|
|
4422
4549
|
return end;
|
|
4423
4550
|
}
|
|
4424
4551
|
/**
|
|
4425
|
-
* This function gives
|
|
4426
|
-
* `pnpm --filter <selector> install
|
|
4427
|
-
* after `&&`, `;`, `|` and in `( )`. It reads a command
|
|
4428
|
-
* value of a key for a person or for GitHub (`name`, `if`).
|
|
4552
|
+
* This function gives each `pnpm install` of a workflow or a composite action, also `pnpm i` and
|
|
4553
|
+
* `pnpm --filter <selector> install`. It also gives the input `args` of each step with the action `pnpm-install`. It
|
|
4554
|
+
* reads the value of each key, the lines of a block of text, and the commands after `&&`, `;`, `|` and in `( )`. It reads a command
|
|
4555
|
+
* that continues after a `\`. It does not read comments, or the value of a key for a person or for GitHub (`name`, `if`).
|
|
4429
4556
|
*/
|
|
4430
|
-
function
|
|
4557
|
+
function pnpmInstallCommands(text) {
|
|
4431
4558
|
const lines = workflowLines(text);
|
|
4432
4559
|
const found = [];
|
|
4433
4560
|
let pending = [];
|
|
@@ -4444,6 +4571,11 @@ function filteredInstalls(text) {
|
|
|
4444
4571
|
if (/^[|>]/.test(value)) index = textEnd(lines, index) - 1;
|
|
4445
4572
|
continue;
|
|
4446
4573
|
}
|
|
4574
|
+
const action = key === null ? void 0 : actionInstall(lines, index, key);
|
|
4575
|
+
if (action !== void 0) {
|
|
4576
|
+
found.push(action);
|
|
4577
|
+
continue;
|
|
4578
|
+
}
|
|
4447
4579
|
if (key !== null) {
|
|
4448
4580
|
from = key[0].length;
|
|
4449
4581
|
const quote = value.charAt(0);
|
|
@@ -4465,6 +4597,10 @@ function filteredInstalls(text) {
|
|
|
4465
4597
|
found.push(...installsOf(pending, editable));
|
|
4466
4598
|
return found;
|
|
4467
4599
|
}
|
|
4600
|
+
/** This function gives the selector of each filtered `pnpm install` of a workflow, from {@link pnpmInstallCommands}. */
|
|
4601
|
+
function filteredInstalls(text) {
|
|
4602
|
+
return pnpmInstallCommands(text).flatMap((install) => install.selectors);
|
|
4603
|
+
}
|
|
4468
4604
|
/** This function gives the selector `<name>...` in the quotes of the old selector, or in double quotes. It gives undefined for a selector in another form. */
|
|
4469
4605
|
function dependencySelector(raw, name) {
|
|
4470
4606
|
if (raw === name) return `"${name}..."`;
|
|
@@ -4592,6 +4728,7 @@ const SHARED_ACTIONS = [
|
|
|
4592
4728
|
"npm-publish",
|
|
4593
4729
|
"pages-build",
|
|
4594
4730
|
"pass-stamp",
|
|
4731
|
+
"pnpm-install",
|
|
4595
4732
|
"pull-of-run",
|
|
4596
4733
|
"release-check",
|
|
4597
4734
|
"security-scan",
|
|
@@ -4608,7 +4745,7 @@ const SHARED_ACTIONS = [
|
|
|
4608
4745
|
/** The `uses` value of a job that calls the shared CI, with no pin. */
|
|
4609
4746
|
const SHARED_CI = "mark1russell7/template/.github/workflows/reusable-ci.yml";
|
|
4610
4747
|
/** The action folder of a path: `.github/actions/<name>/action.yml` gives `<name>`. */
|
|
4611
|
-
const ACTION$
|
|
4748
|
+
const ACTION$5 = /^\.github\/actions\/([^/]+)\//;
|
|
4612
4749
|
/** The file name of a path. */
|
|
4613
4750
|
const baseName = (path) => path.slice(path.lastIndexOf("/") + 1);
|
|
4614
4751
|
/** This function tells if a job of a workflow text uses the shared CI of the template. */
|
|
@@ -4672,7 +4809,7 @@ const sharedCi = {
|
|
|
4672
4809
|
});
|
|
4673
4810
|
const actions = /* @__PURE__ */ new Set();
|
|
4674
4811
|
for (const file of files) {
|
|
4675
|
-
const folder = ACTION$
|
|
4812
|
+
const folder = ACTION$5.exec(file)?.[1];
|
|
4676
4813
|
if (folder !== void 0 && SHARED_ACTIONS.includes(folder) && !actions.has(folder)) {
|
|
4677
4814
|
actions.add(folder);
|
|
4678
4815
|
breaks.push({
|
|
@@ -6550,7 +6687,7 @@ const HOMES = [
|
|
|
6550
6687
|
{
|
|
6551
6688
|
area: "repo-structure",
|
|
6552
6689
|
title: "Repository structure, CI and conventions",
|
|
6553
|
-
covers: "new repositories and packages, the CUE presets, shared CI workflows, the API report, import boundaries, the conventions check, the release and status pages, the browser check of a built site (site-pages check), the offline shell of a built site (entry /offline of site-pages: manifest, service worker, the offline check), the React kit of a docs site (entry /react of site-pages: the theme, the content registry, the sidebar, callouts, tabs, the page footer, react.css)",
|
|
6690
|
+
covers: "new repositories and packages, the CUE presets, shared CI workflows, the API report, import boundaries, the conventions check, the release and status pages, the browser check of a built site (site-pages check), the offline shell of a built site (entry /offline of site-pages: manifest, service worker, the offline check), the React kit of a docs site (entry /react of site-pages: the theme, the content registry, the sidebar, callouts, tabs, the page footer, react.css), the build tools of a docs site (the root entry of site-pages: static routes, prerender in a browser, head tags, JSON-LD, Open Graph images, the sitemap, robots.txt, font preload)",
|
|
6554
6691
|
packages: [
|
|
6555
6692
|
"@mark1russell7/conventions",
|
|
6556
6693
|
"@mark1russell7/template-cli",
|
|
@@ -6584,7 +6721,16 @@ const HOMES = [
|
|
|
6584
6721
|
"sidebar",
|
|
6585
6722
|
"callout",
|
|
6586
6723
|
"table of contents",
|
|
6587
|
-
"theme toggle"
|
|
6724
|
+
"theme toggle",
|
|
6725
|
+
"prerender",
|
|
6726
|
+
"sitemap",
|
|
6727
|
+
"robots.txt",
|
|
6728
|
+
"open graph",
|
|
6729
|
+
"head tags",
|
|
6730
|
+
"json-ld",
|
|
6731
|
+
"font preload",
|
|
6732
|
+
"static routes",
|
|
6733
|
+
"base path"
|
|
6588
6734
|
]
|
|
6589
6735
|
},
|
|
6590
6736
|
{
|
|
@@ -76540,7 +76686,7 @@ function movedTo(repo, moves) {
|
|
|
76540
76686
|
* Each run of the workflow then fails before it starts ("workflow file issue"), and no job shows why.
|
|
76541
76687
|
*/
|
|
76542
76688
|
/** The files of a composite action. */
|
|
76543
|
-
const ACTION$
|
|
76689
|
+
const ACTION$4 = /^\.github\/actions\/.+\/action\.ya?ml$/;
|
|
76544
76690
|
/** The value of `uses:` that names another repository: `owner/name`, then a path or nothing, then `@` and the ref. */
|
|
76545
76691
|
const REMOTE = /^([\w.-]+)\/([\w.-]+)(\/[^@\s]*)?@\S+$/;
|
|
76546
76692
|
/** This function gives each `uses:` of a workflow or an action that names another repository. A local path (`./`) and a Docker image (`docker://`) are not calls of a repository. */
|
|
@@ -76596,7 +76742,7 @@ const movedRepoCalls = {
|
|
|
76596
76742
|
if (bad !== void 0) return { skipped: `the option moves has "${bad.text}", which is not in the form owner/name=owner/name` };
|
|
76597
76743
|
const moves = [...MOVES, ...extra.map((each) => each.move)];
|
|
76598
76744
|
const breaks = [];
|
|
76599
|
-
for (const file of files.filter((path) => WORKFLOW$1.test(path) || ACTION$
|
|
76745
|
+
for (const file of files.filter((path) => WORKFLOW$1.test(path) || ACTION$4.test(path)).sort(byCode)) {
|
|
76600
76746
|
let text;
|
|
76601
76747
|
try {
|
|
76602
76748
|
text = readFileSync(join(context.root, file), "utf8");
|
|
@@ -76699,7 +76845,7 @@ const MANIFEST = /(^|\/)package\.json$/;
|
|
|
76699
76845
|
const MARKDOWN = /\.mdx?$/i;
|
|
76700
76846
|
const CHANGELOG = /(^|\/)CHANGELOG\.md$/i;
|
|
76701
76847
|
/** A file of a composite action. */
|
|
76702
|
-
const ACTION$
|
|
76848
|
+
const ACTION$3 = /^\.github\/actions\/.+\/action\.ya?ml$/;
|
|
76703
76849
|
/** The kinds of place of the core, in the order of a report. */
|
|
76704
76850
|
const PLACE_KINDS = [
|
|
76705
76851
|
{
|
|
@@ -76717,7 +76863,7 @@ const PLACE_KINDS = [
|
|
|
76717
76863
|
{
|
|
76718
76864
|
id: "workflow-names",
|
|
76719
76865
|
title: "The addresses and each key repository of a workflow or a composite action, except uses: (the rule moved-repo-calls).",
|
|
76720
|
-
reads: (file) => WORKFLOW$1.test(file) || ACTION$
|
|
76866
|
+
reads: (file) => WORKFLOW$1.test(file) || ACTION$3.test(file),
|
|
76721
76867
|
find: (text) => {
|
|
76722
76868
|
const skip = (line) => line.trimStart().startsWith("#") || keyValue(line, "uses") !== void 0;
|
|
76723
76869
|
const keys = [];
|
|
@@ -76953,7 +77099,7 @@ const NOT_SOURCE = [
|
|
|
76953
77099
|
/** A call of a method of `console`. The group `method` is the name of the method. */
|
|
76954
77100
|
const CALL = /\bconsole\s*\.\s*(?<method>[A-Za-z]+)\s*\(/g;
|
|
76955
77101
|
/** A line that is a comment: it starts with `//`, `/*` or `*`. */
|
|
76956
|
-
const COMMENT = /^\s*(?:\/\/|\/\*|\*)/;
|
|
77102
|
+
const COMMENT$1 = /^\s*(?:\/\/|\/\*|\*)/;
|
|
76957
77103
|
/** The path of a CLI file: a folder `cli`, `bin` or `commands`, or a file `cli.*` or `main.*`. */
|
|
76958
77104
|
const CLI_PATH = /(?:^|\/)(?:cli|bin|commands?)(?:\/|\.)|(?:^|[/._-])(?:cli|main)\.[a-z]+$/;
|
|
76959
77105
|
/**
|
|
@@ -76981,7 +77127,7 @@ function consoleBreaks(file, text) {
|
|
|
76981
77127
|
const cli = isCliFile(file, text);
|
|
76982
77128
|
const breaks = [];
|
|
76983
77129
|
text.split(/\r?\n/).forEach((line, index) => {
|
|
76984
|
-
if (COMMENT.test(line)) return;
|
|
77130
|
+
if (COMMENT$1.test(line)) return;
|
|
76985
77131
|
for (const match of line.matchAll(CALL)) {
|
|
76986
77132
|
const method = match.groups?.["method"] ?? "";
|
|
76987
77133
|
breaks.push({
|
|
@@ -77099,6 +77245,76 @@ const noConsole = {
|
|
|
77099
77245
|
return state.breaks.some((item) => item.file === CONFIG_FILE$1) ? void 0 : gate.why;
|
|
77100
77246
|
}
|
|
77101
77247
|
};
|
|
77248
|
+
// src/rules/follow-hash.ts
|
|
77249
|
+
/**
|
|
77250
|
+
* The rule `follow-hash`: a source that reads the hash of the address also follows each change of the hash. A second link
|
|
77251
|
+
* to the same page in the same tab changes only the hash, and the page does not load again. A page that reads the hash
|
|
77252
|
+
* only at its load thus keeps the old view. The function `followHash` of `@mark1russell7/site-pages/chrome` reads the
|
|
77253
|
+
* hash at its start and at each `hashchange` event.
|
|
77254
|
+
*/
|
|
77255
|
+
/** A read of the hash of the address: `location.hash` that is not the left side of an assignment. */
|
|
77256
|
+
const READ = /\blocation\s*\.\s*hash\b(?!\s*=(?!=))/;
|
|
77257
|
+
/** A line that only carries the hash into a new address of the same page: a call of `replaceState` or `pushState`. */
|
|
77258
|
+
const CARRY = /\b(?:replaceState|pushState)\s*\(/;
|
|
77259
|
+
/** A line that is a comment: it starts with `//`, `/*` or `*`. */
|
|
77260
|
+
const COMMENT = /^\s*(?:\/\/|\/\*|\*)/;
|
|
77261
|
+
/** A text that follows the changes of the hash: a listener of `hashchange` or `popstate` (also `onhashchange`), or a call of `followHash`. */
|
|
77262
|
+
const FOLLOWS = /hashchange|popstate|\bfollowHash\s*\(/;
|
|
77263
|
+
/**
|
|
77264
|
+
* This function gives the break of one source file. The break is the first line that reads `location.hash`, when the file
|
|
77265
|
+
* does not follow the changes of the hash. A file that follows the changes gives no break. A file that only writes the
|
|
77266
|
+
* hash, or only carries it into `history.replaceState`, gives no break too.
|
|
77267
|
+
*/
|
|
77268
|
+
function hashReadBreaks(file, text) {
|
|
77269
|
+
if (!text.includes("hash") || FOLLOWS.test(text)) return [];
|
|
77270
|
+
const lines = text.split(/\r?\n/);
|
|
77271
|
+
for (const [index, line] of lines.entries()) {
|
|
77272
|
+
if (COMMENT.test(line) || CARRY.test(line) || !READ.test(line)) continue;
|
|
77273
|
+
return [{
|
|
77274
|
+
file,
|
|
77275
|
+
line: index + 1,
|
|
77276
|
+
message: `${file} reads location.hash only once. A second link to the page in the same tab changes the hash, and the view stays the same.`
|
|
77277
|
+
}];
|
|
77278
|
+
}
|
|
77279
|
+
return [];
|
|
77280
|
+
}
|
|
77281
|
+
const followHashRule = {
|
|
77282
|
+
id: "follow-hash",
|
|
77283
|
+
title: "A source that reads `location.hash` also follows each change of the hash: with `followHash` of `@mark1russell7/site-pages/chrome`, or a listener of `hashchange`.",
|
|
77284
|
+
reason: "A second link to the same page in the same tab changes only the hash, and the browser does not load the page again. A page that reads the hash only at its load keeps the old view. On 2026-12-03, a docs site kept the panel of the first record after a link to a second record.",
|
|
77285
|
+
fix: "Read the hash with followHash(listener) of @mark1russell7/site-pages/chrome. It gives the hash at its start and at each change. A file that reads the hash for a different reason goes in `ignore` with its reason.",
|
|
77286
|
+
sources: [{
|
|
77287
|
+
repo: "private",
|
|
77288
|
+
rule: "bug-leaves-class-probe",
|
|
77289
|
+
doc: "a decision of direction: each fault leaves a probe of its class. The case is a docs site on 2026-12-03."
|
|
77290
|
+
}, {
|
|
77291
|
+
repo: "mark1russell7/template",
|
|
77292
|
+
rule: "site-pages releases page",
|
|
77293
|
+
doc: "the inline module of the releases page read the hash only at its load, until the fix of 2026-12-04"
|
|
77294
|
+
}],
|
|
77295
|
+
options: { skip: {
|
|
77296
|
+
type: "strings",
|
|
77297
|
+
default: NOT_SOURCE,
|
|
77298
|
+
description: "The globs of the files that are not sources: tests, fixtures, scripts, benches and examples."
|
|
77299
|
+
} },
|
|
77300
|
+
failsFrom: "2026-12-21",
|
|
77301
|
+
check(context, options) {
|
|
77302
|
+
const files = context.gitFiles();
|
|
77303
|
+
if (files === void 0) return { skipped: "the root is not in a git repository" };
|
|
77304
|
+
const skip = options["skip"];
|
|
77305
|
+
const breaks = [];
|
|
77306
|
+
for (const file of files.filter((path) => isConsoleSource(path, skip)).sort(byCode)) {
|
|
77307
|
+
let text;
|
|
77308
|
+
try {
|
|
77309
|
+
text = readFileSync(join(context.root, file), "utf8");
|
|
77310
|
+
} catch {
|
|
77311
|
+
continue;
|
|
77312
|
+
}
|
|
77313
|
+
breaks.push(...hashReadBreaks(file, text));
|
|
77314
|
+
}
|
|
77315
|
+
return breaks;
|
|
77316
|
+
}
|
|
77317
|
+
};
|
|
77102
77318
|
// src/private-names.ts
|
|
77103
77319
|
/**
|
|
77104
77320
|
* The private name list: a JSON file outside of the public repositories, with the names of private projects. The file
|
|
@@ -79248,6 +79464,10 @@ const SITE_CONFIG_KEYS = {
|
|
|
79248
79464
|
kind: "string",
|
|
79249
79465
|
default: ""
|
|
79250
79466
|
},
|
|
79467
|
+
"site-check-wide-font": {
|
|
79468
|
+
kind: "string",
|
|
79469
|
+
default: ""
|
|
79470
|
+
},
|
|
79251
79471
|
"site-check-playwright": {
|
|
79252
79472
|
kind: "string",
|
|
79253
79473
|
default: "1.64.1"
|
|
@@ -80121,9 +80341,9 @@ const jobFails = {
|
|
|
80121
80341
|
* more try. A bare `playwright install --with-deps` waits for the package mirror with no limit.
|
|
80122
80342
|
*/
|
|
80123
80343
|
/** The files of a composite action. */
|
|
80124
|
-
const ACTION$
|
|
80344
|
+
const ACTION$2 = /^\.github\/actions\/.+\/action\.ya?ml$/;
|
|
80125
80345
|
/** The folder of the action of the template itself. It is the one place with the install. */
|
|
80126
|
-
const SHARED_ACTION = ".github/actions/setup-playwright/";
|
|
80346
|
+
const SHARED_ACTION$1 = ".github/actions/setup-playwright/";
|
|
80127
80347
|
/**
|
|
80128
80348
|
* A command of the Playwright CLI that installs: `install` or `install-deps`. The CLI comes first on the line, or after a
|
|
80129
80349
|
* space or a shell operator. It can have a folder and a version, as in `node_modules/.bin/playwright` or
|
|
@@ -80198,7 +80418,7 @@ const playwrightInstall = {
|
|
|
80198
80418
|
return;
|
|
80199
80419
|
}
|
|
80200
80420
|
};
|
|
80201
|
-
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$
|
|
80421
|
+
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$2.test(path)) && !path.startsWith(SHARED_ACTION$1)).sort(byCode)) {
|
|
80202
80422
|
const text = read(file);
|
|
80203
80423
|
if (text === void 0) continue;
|
|
80204
80424
|
for (const install of playwrightInstalls(text)) breaks.push({
|
|
@@ -80219,6 +80439,96 @@ const playwrightInstall = {
|
|
|
80219
80439
|
return breaks;
|
|
80220
80440
|
}
|
|
80221
80441
|
};
|
|
80442
|
+
// src/rules/pnpm-install.ts
|
|
80443
|
+
/**
|
|
80444
|
+
* The rule `pnpm-install`: no workflow or action starts `pnpm install` in its own step. The shared action
|
|
80445
|
+
* `pnpm-install` of the template gives each try a time limit. After a failure or a stop, the next try starts. A bare
|
|
80446
|
+
* install waits until the limit of the job when a fetch from the npm registry stalls. In a job with a default folder
|
|
80447
|
+
* (`defaults.run.working-directory`), a step of the action gives that folder to its input `working-directory`. A step
|
|
80448
|
+
* `uses` does not take the default folder.
|
|
80449
|
+
*/
|
|
80450
|
+
/** The files of a composite action. */
|
|
80451
|
+
const ACTION$1 = /^\.github\/actions\/.+\/action\.ya?ml$/;
|
|
80452
|
+
/** The action of the template itself. Its step for an old Node.js starts one install with no time limit. */
|
|
80453
|
+
const SHARED_ACTION = ".github/actions/pnpm-install/action.yml";
|
|
80454
|
+
/** The action of a step, with no pin: the action `pnpm-install` of the template, or a copy of the template at a path. */
|
|
80455
|
+
const ACTION_USES = /(?:^|\/)\.github\/actions\/pnpm-install$/;
|
|
80456
|
+
/**
|
|
80457
|
+
* This function gives each step of the action `pnpm-install` with no input `working-directory` in a job with a default
|
|
80458
|
+
* folder other than the root. A file that does not parse gives none: the rule `workflow-parses` reports it.
|
|
80459
|
+
*/
|
|
80460
|
+
function lostFolders(file, text) {
|
|
80461
|
+
const found = [];
|
|
80462
|
+
for (const job of parseWorkflow(file, text).jobs) {
|
|
80463
|
+
const folder = job.defaultDirectory;
|
|
80464
|
+
if (folder === "" || folder === ".") continue;
|
|
80465
|
+
for (const step of job.steps) if (ACTION_USES.test(step.uses) && step.with["working-directory"] === void 0) found.push({
|
|
80466
|
+
line: step.line,
|
|
80467
|
+
job: job.id,
|
|
80468
|
+
folder
|
|
80469
|
+
});
|
|
80470
|
+
}
|
|
80471
|
+
return found;
|
|
80472
|
+
}
|
|
80473
|
+
/**
|
|
80474
|
+
* This function gives each `pnpm install` of a workflow or an action outside the action `pnpm-install`. The reader of
|
|
80475
|
+
* the rule `filtered-install` finds them. It does not read a comment, a quote or a name.
|
|
80476
|
+
*/
|
|
80477
|
+
function bareInstalls(text) {
|
|
80478
|
+
return pnpmInstallCommands(text).filter((install) => !install.action).map((install) => ({
|
|
80479
|
+
line: install.line,
|
|
80480
|
+
command: install.words.join(" ")
|
|
80481
|
+
}));
|
|
80482
|
+
}
|
|
80483
|
+
const pnpmInstall = {
|
|
80484
|
+
id: "pnpm-install",
|
|
80485
|
+
title: "pnpm install runs in the shared action `pnpm-install`, which gives each try a time limit, not in a step `run: pnpm install`.",
|
|
80486
|
+
reason: "A fetch from the npm registry stalls at times. A bare pnpm install then waits until the limit of the job. On 2026-12-02 the downloads of two packages stayed at 0 B in two jobs of client and in one job of TinyImages. Each job waited 15 or 25 minutes and failed. An install from the cache takes seconds: in 25 runs of each of five repositories, the slowest took 18 seconds.",
|
|
80487
|
+
fix: "Use the step `uses: mark1russell7/template/.github/actions/pnpm-install@<commit>` in place of `run: pnpm install`. Its input `args` gives the words after `pnpm install` (the default is `--frozen-lockfile`), and its input `working-directory` gives the folder. The other commands of the step stay in a step `run`. In a job with `defaults.run.working-directory`, give the same folder to the input `working-directory`: a step `uses` does not take the default folder.",
|
|
80488
|
+
sources: [
|
|
80489
|
+
{
|
|
80490
|
+
repo: "client",
|
|
80491
|
+
rule: "ci",
|
|
80492
|
+
doc: "run 46854685048 (2026-12-02): pnpm install --frozen-lockfile stalled in two jobs, and each job waited until its limit"
|
|
80493
|
+
},
|
|
80494
|
+
{
|
|
80495
|
+
repo: "TinyImages",
|
|
80496
|
+
rule: "ci",
|
|
80497
|
+
doc: "run 46853586975 (2026-12-02): the same stall, at the same hour"
|
|
80498
|
+
},
|
|
80499
|
+
{
|
|
80500
|
+
repo: "template",
|
|
80501
|
+
rule: "pnpm-install",
|
|
80502
|
+
doc: "the shared action pnpm-install: a time limit of 3 minutes on each try, and 3 tries"
|
|
80503
|
+
}
|
|
80504
|
+
],
|
|
80505
|
+
options: {},
|
|
80506
|
+
failsFrom: "2026-12-28",
|
|
80507
|
+
check(context) {
|
|
80508
|
+
const files = context.gitFiles();
|
|
80509
|
+
if (files === void 0) return { skipped: "the root is not in a git repository" };
|
|
80510
|
+
const breaks = [];
|
|
80511
|
+
for (const file of files.filter((path) => (WORKFLOW$1.test(path) || ACTION$1.test(path)) && path !== SHARED_ACTION).sort(byCode)) {
|
|
80512
|
+
let text;
|
|
80513
|
+
try {
|
|
80514
|
+
text = readFileSync(join(context.root, file), "utf8");
|
|
80515
|
+
} catch {
|
|
80516
|
+
continue;
|
|
80517
|
+
}
|
|
80518
|
+
if (WORKFLOW$1.test(file)) for (const lost of lostFolders(file, text)) breaks.push({
|
|
80519
|
+
file,
|
|
80520
|
+
line: lost.line,
|
|
80521
|
+
message: `${file} starts the action pnpm-install in the job ${lost.job} with no input working-directory. A step "uses" does not take the default folder ${lost.folder} of the job, so the install runs at the root of the checkout. Give the folder to the input working-directory.`
|
|
80522
|
+
});
|
|
80523
|
+
for (const install of bareInstalls(text)) breaks.push({
|
|
80524
|
+
file,
|
|
80525
|
+
line: install.line,
|
|
80526
|
+
message: `${file} starts "${install.command}" in a step of its own. A stalled fetch then holds the job, with no next try. Use the action pnpm-install of the template.`
|
|
80527
|
+
});
|
|
80528
|
+
}
|
|
80529
|
+
return breaks;
|
|
80530
|
+
}
|
|
80531
|
+
};
|
|
80222
80532
|
// src/rules/unreleased-change.ts
|
|
80223
80533
|
/**
|
|
80224
80534
|
* The rule `unreleased-change`: a change does not set a version that npm has. With the option `versionEachChange`, a
|
|
@@ -83478,6 +83788,7 @@ const RULES = [
|
|
|
83478
83788
|
noBuildOutput,
|
|
83479
83789
|
noLocalPaths,
|
|
83480
83790
|
noConsole,
|
|
83791
|
+
followHashRule,
|
|
83481
83792
|
apiReportScript,
|
|
83482
83793
|
releaseFiles,
|
|
83483
83794
|
unreleasedChange,
|
|
@@ -83510,6 +83821,7 @@ const RULES = [
|
|
|
83510
83821
|
setupCue,
|
|
83511
83822
|
setupPnpm,
|
|
83512
83823
|
filteredInstall,
|
|
83824
|
+
pnpmInstall,
|
|
83513
83825
|
playwrightInstall,
|
|
83514
83826
|
movedRepoCalls,
|
|
83515
83827
|
movedRepoNames,
|
|
@@ -84731,6 +85043,6 @@ function runHook(args, io) {
|
|
|
84731
85043
|
git: (gitArgs) => runGit(io.cwd, gitArgs)
|
|
84732
85044
|
}, io);
|
|
84733
85045
|
}
|
|
84734
|
-
export { retiredFile as $,
|
|
85046
|
+
export { retiredFile as $, tsconfigTest as $n, parseWorkflow as $r, lineNameHit as $t, scriptsOf as A, moduleUses as An, securityCallers as Ar, pushMainOnly as At, giveWaySlots as B, MAP_RULE as Bn, repositoryIsPublic as Br, PRIVATE_NAMES_FILE_VARIABLE as Bt, setVersions as C, defaultOptions as Ci, homeShapesOf as Cn, addSummaryJob as Cr, gitPinOnNpm as Ct, trustPolicy as D, HOME_SHAPES as Dn, SECURITY_SCAN_COMMIT as Dr, pinnedGitDeps as Dt, TRAIN_SCOPES as E, spansOf as En, summaryJobRule as Er, isPinned as Et, sourceMain as F, repoOf as Fn, LICENSE_TEXTS as Fr, publishTextSafe as Ft, workflowPeaks as G, npmDrift as Gn, skippableJobs as Gr, privateNamesFiles as Gt, repositoryPeak as H, mapMarkdown as Hn, convertGate as Hr, invalidPatternBreaks as Ht, TEMPLATE_CALLED as I, reposOf as In, authorOf as Ir, packNoBuildinfo as It, mayRun as J, readOverlay as Jn, JOB_LIMIT_FLOOR_MINUTES as Jr, PRIVATE_NAME_LIST as Jt, evaluateExpression as K, npmNames as Kn, summaryJob as Kr, privatePatterns as Kt, UNKNOWN_MATRIX_JOBS as L, signaturesOf as Ln, licenseFile as Lr, DEFAULT_ALLOWED as Lt, testsRequired as M, declaredName as Mn, withOneJob as Mr, pagesCalls as Mt, isSourcePath as N, homePackage as Nn, runnerBudget as Nr, pagesSite as Nt, typedScripts as O, homeModule as On, SECURITY_SCAN_INPUTS as Or, siteCheckInCi as Ot, pathsOf as P, messageOf$1 as Pn, scheduleMinute as Pr, exportsRequire as Pt, RETIRED_FILES as Q, hasTests as Qn, MATRIX_EXPAND_MAX as Qr, isCommonUse as Qt, calledJobs as R, HOME_EXPORTS as Rn, licenseFileOf as Rr, HOME_PATTERNS as Rt, namedVersions as S, specifiersOf as Si, homeShape as Sn, SUMMARY_GATES as Sr, pnpmYamlParses as St, IGNORE_AFTER as T, parseRuleConfig as Ti, shapesOfSource as Tn, startsOnPullRequest as Tr, isGitSpecifier as Tt, runnerPeak as U, mapText as Un, gateTrigger as Ur, noLocalPaths as Ut, matrixPeak as V, findHomes as Vn, ACTIONS_COMMIT as Vr, PRIVATE_PATTERNS_VARIABLE as Vt, runsAtOnce as W, mergeHomes as Wn, prPathFilters as Wr, privateNamesFile as Wt, roadmapParses as X, runCalls as Xn, gateAfterCancel as Xr, firstNameMatch as Xt, roadmapOfLine as Y, SERVICE_PACKAGE as Yn, jobLimitFloor as Yr, PrivateNameListError as Yt, retiredFiles as Z, serviceRunMain as Zn, FILTER_KEYS as Zr, isAllowedHit as Zt, runPrePushArgs as _, replaceLine as _i, hasImportMetaMain as _n, releaseModeRule as _r, parseAdvisory as _t, listRules as a, DEPENDENCY_FIELDS as ai, followHashRule as an, filteredInstall as ar, publishedMinorRule as at, GITHUB_YAML as b, runGitShow as bi, apiReportScript as bn, securityGate as br, pipeFails as bt, runCli as c, codePackages as ci, NOT_SOURCE as cn, callPermissions as cr, SHIPPED_FIELDS as ct, HOOK_MARKER as d, keyLine as di, consoleKind as dn, blockHash as dr, unreleasedChange as dt, readAction as ei, lineNameHits as en, SHARED_ACTIONS as er, requiredScripts as et, NO_READ_LINE as f, lineOf as fi, isCliFile as fn, githubFetch as fr, unreleasedChangeRule as ft, prePush as g, readJsonc as gi, REAL_COMPARE as gn, hasReleaseMode as gr, jobFails as gt, parsePrePushArgs as h, parseJsonc as hi, noBuildOutput as hn, callsReleaseBuild as hr, hiddenFailures as ht, formatResult as i, cuePreset as ii, pathNameHit as in, sharedCi as ir, publishedMinor as it, typedFiles as j, modulesOf as jn, securityOneJob as jr, PAGES_WORKFLOWS as jt, configsOfScript as k, moduleMessage as kn, SECURITY_TIMEOUT_MINUTES as kr, pagesAfterRelease as kt, runFix as l, hasFile as li, consoleBreaks as ln, callPermissionsRule as lr, UNSHIPPED_FILES as lt, installHook as m, parseCatFileBatch as mi, noConsole as mn, addReleaseMode as mr, playwrightInstall as mt, annotations as n, yamlFaults as ni, nameMatches as nn, SHARED_WORKFLOWS as nr, lockedVersions as nt, readConfig as o, RULE_WARN_DAYS as oi, hashReadBreaks as on, setupPnpm as or, reachOf as ot, PRE_PUSH_HOOK as p, matchesAny as pi, isConsoleSource as pn, sharedDocsRule as pr, pnpmInstall as pt, groupParts as q, npmPackagesOf as qn, summaryName as qr, privateTextBreaks as qt, createContext as r, STRICT_OPTIONS as ri, parsePrivateNames as rn, callsSharedCi as rr, minorOf as rt, runChecks as s, cleanPath as si, CONSOLE_LAST_DAY as sn, setupCue as sr, NPM_REGISTRY as st, USAGE as t, readWorkflow as ti, mergePrivateNames as tn, SHARED_CI as tr, releaseFiles as tt, summaryMarkdown as u, inFolder as ui, consoleGate as un, HOME_TIMEOUT_MS as ur, npmLookup as ut, RULES as v, repositoryOfRemote as vi, mainCheck as vn, SECURITY_FILE as vr, startsTests as vt, versionTitle as w, parseConfig as wi, shapeMessage as wn, hasSummaryJob as wr, dependencySpecifiers as wt, workflowParses as x, showFiles as xi, containedHome as xn, securityWorkflow as xr, PNPM_YAML as xt, workspaceProtocol as y, runGit as yi, coverageProvider as yn, isSecurityGate as yr, swallowsTests as yt, eventClass as z, HOMES as zn, mitText as zr, PRIVATE_NAMES_FILE_CONFIG as zt };
|
|
84735
85047
|
|
|
84736
|
-
//# sourceMappingURL=run-
|
|
85048
|
+
//# sourceMappingURL=run-DX5mvqwy.js.map
|