@mark1russell7/conventions 0.21.0 → 0.22.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 +2 -0
- package/build/cli.js +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/{run-sEUuSlqi.js → run-C-CDw-pk.js} +73 -3
- package/build/run-C-CDw-pk.js.map +1 -0
- package/package.json +2 -2
- package/build/run-sEUuSlqi.js.map +0 -1
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Each break shows the file, the line, the rule and the fix. In GitHub Actions, th
|
|
|
23
23
|
`conventions fix` writes the fixes that the rules know, and checks again. It continues until no fix applies. Each fix is an exact change of a file, and the fix writes it only when the file did not change after the check. These breaks have a fix:
|
|
24
24
|
|
|
25
25
|
- `runner-budget`: the minute of a schedule, a `max-parallel` of a matrix, and a concurrency group at the top of a workflow. A new run of a pull request stops the old run. A run of another event waits for the old run.
|
|
26
|
+
- `main-runs-finish`: a `cancel-in-progress: true` in a workflow that starts on `push`. The fix writes `${{ github.event_name == 'pull_request' }}`.
|
|
26
27
|
- `tests-required`: the option `passWithNoTests` in a config or a script, in a package with test files. A package with no tests needs a person, who removes its test script.
|
|
27
28
|
- `typed-files`: a config file at the root of a package (`vitest.config.ts`). The fix adds `*.config.ts` and `rootDir: "."` to the `tsconfig.test.json` of the package, when that file has no comments.
|
|
28
29
|
- `trust-policy`: the settings `trustPolicy`, `trustPolicyIgnoreAfter` and `trustPolicyExclude` of `pnpm-workspace.yaml`. The fix makes the file when the repository has none.
|
|
@@ -55,6 +56,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
55
56
|
| `tests-required` | No test runner passes when it finds no test: no `passWithNoTests: true` in a config of vitest, vite, jest or Playwright, and no `--passWithNoTests` in `package.json`. With the option, a broken include pattern turns the test gate green with no test run. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
56
57
|
| `roadmap-parses` | Each call of the Pages workflow of the template (`reusable-pages.yml`) gives a `roadmap`, or `site-pages: false`. Without it, the Status page shows no item of the plan. Each roadmap that a workflow gives to the Status page (a `roadmap:` key) parses as `@mark1russell7/site-pages` reads it. The rule uses the parser of site-pages. Thus a pull request finds a bad row, and the Pages job on `main` does not stop on it. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
57
58
|
| `runner-budget` | All repositories of the account share 40 runners. Each `strategy` with a `matrix` has a `max-parallel` of 3 or less. Each workflow has a concurrency group at the top or in each job. A job that calls a shared workflow of the option `grouped` gets its group from that workflow, and each job of that workflow has a group. The minute of each `cron` comes from a hash of the repository and the file (1 to 59), so the schedules of the repositories do not start together. The repository comes from `GITHUB_REPOSITORY` or from the remote `origin`. | fleet `runner-slots` (STRATEGY.md, 2026-10-30). |
|
|
59
|
+
| `main-runs-finish` | A workflow that starts on `push` does not cancel a run in progress. A newer push cancels only the run of a pull request: `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`. A newer run of `main` waits, and GitHub keeps only the newest run that waits. On 2026-11-03 the next merge cancelled the CI run of a commit on `main`, so the main check of that commit had no result. A bench run on `main` was cancelled too, and its claim had no measurement. | fleet `main-runs-finish` (STRATEGY.md, 2026-11-03). |
|
|
58
60
|
| `gate-trigger` | No workflow has `paths` or `paths-ignore` on `on.pull_request` or `on.pull_request_target`. The ruleset needs the summary check `<Name> OK` of each gate, and a workflow with a path filter does not start on each pull request. Then its check is not there, the ruleset cannot ask for it, and a pull request can merge before the gate ends. A gate uses the actions `changes` and `gate-summary` of the template (`CI.md`, "A gate with paths"). | fleet `gate-trigger` (STRATEGY.md, 2026-11-02). |
|
|
59
61
|
| `license-file` | Each public package has a license field, and a license file with the same license in its own folder. A public repository, or a repository with a public package, has a license file at its root. In a GitHub Actions run, the event file tells if the repository is public, and the option `license` (MIT by default) is the license of a root with no public package. npm packs only the license file of the folder of the package, and GitHub reads only the one of the root: on 2026-11-02 five public repositories showed no license on GitHub while npm said MIT. `conventions fix` writes the missing files. | fleet strategy (2026-11-02). |
|
|
60
62
|
| `home-package` | A change does not add a function with a signature name of another home of the map (for example `median`, `mulberry32` or `writeFileAtomic`). A local copy drifts from the home and splits the fixes. On 2026-11-02 the fleet had 68 local statistics functions in 14 repositories. The rule examines only the lines that the change adds, so the copies that exist do not break. | fleet direction 18 (STRATEGY.md, 2026-11-02). |
|
package/build/cli.js
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/shared-docs.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/unreleased-change.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;EAC1C,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,KAAK,oDAAoD;;UCrM9E;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;UAIH;;WAEN;;WAEA,OAAO,SAAS,eAAe;;;wBAW1B,eAAe,MAAM,OAAO;;;;;;;wBAU5B,YAAY,gBAAgB,gBAAgB,SAAS;;qBCnCxD;qBA2FA,WAAW;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/shared-docs.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/unreleased-change.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;K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C0DvE;WACN;WACA;WACA;;WAEA;WACA;;;UAIM;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;WACA,gBAAgB;;;UAIV;;WAEN;;WAEA;;WAEA;WACA,iBAAiB;WACjB,eAAe;;;wBAgGV,aAAa,cAAc,eAAe;;UClLzC;WACN;WACA;WACA;;WAEA;WACA,iBAAiB;;WAEjB;;WAEA;;;UAIM;WACN,gBAAgB;;WAEhB;;;UAIM;;WAEN;;WAEA;;WAEA;WACA,MAAM,SAAS;;WAEf,iBAAiB;;;wBAaZ,WAAW,cAAc,iBAAgB,SAAiB;;wBAO1D,cAAc,cAAc,QAAQ,mBAAmB,UAAS,KAAK,gCAAqC;;wBAwB1G,UAAU,SAAS,eAAe;;UA2CjC;;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6BG,OAAO,yBAAyB,IAAI;;;;;;wBC1RpC,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { xt as ACTIONS_COMMIT, Y as DEFAULT_ALLOWED, kt as DEPENDENCY_FIELDS, pt as HOMES, bt as HOME_EXPORTS, X as HOME_PATTERNS, M as HOME_TIMEOUT_MS, y as IGNORE_AFTER, nt as LICENSE_TEXTS, mt as MAP_RULE, p as NPM_REGISTRY, K as PAGES_WORKFLOWS, $ as REAL_COMPARE, d as RULES, m as SHIPPED_FIELDS, Dt as STRICT_OPTIONS, b as TRAIN_SCOPES, h as UNSHIPPED_FILES, t as USAGE, n as annotations, rt as authorOf, N as blockHash, At as cleanPath, jt as codePackages, C as configsOfScript, St as convertGate, r as createContext, Ot as cuePreset, ct as declaredName, Kt as defaultOptions, ht as findHomes, i as formatResult, Ct as gateTrigger, P as githubFetch, Ht as globFolders, Ut as globToRegExp, Mt as hasFile, et as hasImportMetaMain, D as hasTests, lt as homePackage, Nt as inFolder, U as isGitSpecifier, W as isPinned, k as isSourcePath, Pt as keyLine, it as licenseFile, at as licenseFileOf, Ft as lineOf, a as listRules, tt as mainCheck, gt as mapMarkdown, _t as mapText, It as matchesAny, vt as mergeHomes, ut as messageOf, ot as mitText, Q as noBuildOutput, Z as noLocalPaths, g as npmLookup, Wt as packageFolders, q as pagesCalls, J as pagesSite, qt as parseConfig, Lt as parseJsonc, A as pathsOf, G as pinnedGitDeps, wt as prPathFilters, o as readConfig, Rt as readJsonc, yt as readOverlay, Et as readWorkflow, H as releaseFiles, zt as replaceLine, dt as repoOf, st as repositoryIsPublic, I as repositoryOfRemote, V as requiredScripts, z as roadmapOfLine, B as roadmapParses, s as runChecks, c as runCli, l as runFix, Bt as runGit, L as runnerBudget, R as scheduleMinute, w as scriptsOf, F as sharedDocsRule, ft as signaturesOf, j as sourceMain, Vt as specifiersOf, u as summaryMarkdown, Tt as summaryName, E as testsRequired, x as trustPolicy, O as tsconfigTest, T as typedFiles, S as typedScripts, _ as unreleasedChange, v as unreleasedChangeRule, Gt as workspaceGlobs, f as workspaceProtocol } from "./run-
|
|
1
|
+
export { xt as ACTIONS_COMMIT, Y as DEFAULT_ALLOWED, kt as DEPENDENCY_FIELDS, pt as HOMES, bt as HOME_EXPORTS, X as HOME_PATTERNS, M as HOME_TIMEOUT_MS, y as IGNORE_AFTER, nt as LICENSE_TEXTS, mt as MAP_RULE, p as NPM_REGISTRY, K as PAGES_WORKFLOWS, $ as REAL_COMPARE, d as RULES, m as SHIPPED_FIELDS, Dt as STRICT_OPTIONS, b as TRAIN_SCOPES, h as UNSHIPPED_FILES, t as USAGE, n as annotations, rt as authorOf, N as blockHash, At as cleanPath, jt as codePackages, C as configsOfScript, St as convertGate, r as createContext, Ot as cuePreset, ct as declaredName, Kt as defaultOptions, ht as findHomes, i as formatResult, Ct as gateTrigger, P as githubFetch, Ht as globFolders, Ut as globToRegExp, Mt as hasFile, et as hasImportMetaMain, D as hasTests, lt as homePackage, Nt as inFolder, U as isGitSpecifier, W as isPinned, k as isSourcePath, Pt as keyLine, it as licenseFile, at as licenseFileOf, Ft as lineOf, a as listRules, tt as mainCheck, gt as mapMarkdown, _t as mapText, It as matchesAny, vt as mergeHomes, ut as messageOf, ot as mitText, Q as noBuildOutput, Z as noLocalPaths, g as npmLookup, Wt as packageFolders, q as pagesCalls, J as pagesSite, qt as parseConfig, Lt as parseJsonc, A as pathsOf, G as pinnedGitDeps, wt as prPathFilters, o as readConfig, Rt as readJsonc, yt as readOverlay, Et as readWorkflow, H as releaseFiles, zt as replaceLine, dt as repoOf, st as repositoryIsPublic, I as repositoryOfRemote, V as requiredScripts, z as roadmapOfLine, B as roadmapParses, s as runChecks, c as runCli, l as runFix, Bt as runGit, L as runnerBudget, R as scheduleMinute, w as scriptsOf, F as sharedDocsRule, ft as signaturesOf, j as sourceMain, Vt as specifiersOf, u as summaryMarkdown, Tt as summaryName, E as testsRequired, x as trustPolicy, O as tsconfigTest, T as typedFiles, S as typedScripts, _ as unreleasedChange, v as unreleasedChangeRule, Gt as workspaceGlobs, f as workspaceProtocol } from "./run-C-CDw-pk.js";
|
|
@@ -1488,6 +1488,75 @@ function readWorkflow(file, text) {
|
|
|
1488
1488
|
jobs
|
|
1489
1489
|
};
|
|
1490
1490
|
}
|
|
1491
|
+
// src/rules/main-runs-finish.ts
|
|
1492
|
+
/**
|
|
1493
|
+
* The rule `main-runs-finish`: a workflow that starts on `push` does not cancel a run in progress. Only the run of a pull
|
|
1494
|
+
* request is cancelled by a newer push.
|
|
1495
|
+
*/
|
|
1496
|
+
/** The value of `cancel-in-progress` that cancels only the run of a pull request. */
|
|
1497
|
+
const PULL_REQUEST_ONLY = "${{ github.event_name == 'pull_request' }}";
|
|
1498
|
+
/** This function tells if the workflow starts on `push`: `on: push`, `on: [push, ...]` or a key `push` under `on`. */
|
|
1499
|
+
function startsOnPush(lines) {
|
|
1500
|
+
const on = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "on") !== void 0);
|
|
1501
|
+
if (on < 0) return false;
|
|
1502
|
+
const value = keyValue(lines[on] ?? "", "on") ?? "";
|
|
1503
|
+
if (value !== "") return /(^|[\s[,])push([\s\],]|$)/.test(value);
|
|
1504
|
+
return childKeys(lines, on).some((index) => {
|
|
1505
|
+
const key = (lines[index] ?? "").trim().replace(/^- /, "");
|
|
1506
|
+
return key === "push" || key.startsWith("push:");
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
const mainRunsFinish = {
|
|
1510
|
+
id: "main-runs-finish",
|
|
1511
|
+
title: "A workflow that starts on push does not cancel a run in progress. A newer push cancels only the run of a pull request.",
|
|
1512
|
+
reason: "On 2026-11-03 the next merge cancelled the CI run of a commit on main, so the main check of that commit had no result. A shared concurrency group also cancelled a bench run on main, and its claim had no measurement. The CI workflow of the template had `cancel-in-progress: true`, and each repository copied it.",
|
|
1513
|
+
fix: `Set \`cancel-in-progress: ${PULL_REQUEST_ONLY}\`. A newer run of main then waits for the older run, and GitHub keeps only the newest run that waits.`,
|
|
1514
|
+
sources: [{
|
|
1515
|
+
repo: "fleet",
|
|
1516
|
+
rule: "main-runs-finish",
|
|
1517
|
+
doc: "docs/STRATEGY.md (2026-11-03, a run of main ends)"
|
|
1518
|
+
}, {
|
|
1519
|
+
repo: "algebra",
|
|
1520
|
+
rule: "main-check",
|
|
1521
|
+
doc: "the A2 and A5 results (2026-11-03): a cancelled main run, and a cancelled bench run"
|
|
1522
|
+
}],
|
|
1523
|
+
options: {},
|
|
1524
|
+
check(context) {
|
|
1525
|
+
const files = context.gitFiles();
|
|
1526
|
+
if (files === void 0) return { skipped: "the root is not in a git repository" };
|
|
1527
|
+
const workflows = files.filter((path) => WORKFLOW$1.test(path)).sort(byCode);
|
|
1528
|
+
const breaks = [];
|
|
1529
|
+
let pushed = 0;
|
|
1530
|
+
for (const file of workflows) {
|
|
1531
|
+
let text;
|
|
1532
|
+
try {
|
|
1533
|
+
text = readFileSync(join(context.root, file), "utf8");
|
|
1534
|
+
} catch {
|
|
1535
|
+
continue;
|
|
1536
|
+
}
|
|
1537
|
+
const lines = workflowLines(text);
|
|
1538
|
+
if (!startsOnPush(lines)) continue;
|
|
1539
|
+
pushed += 1;
|
|
1540
|
+
lines.forEach((line, index) => {
|
|
1541
|
+
if (keyValue(line, "cancel-in-progress") !== "true") return;
|
|
1542
|
+
const original = text.split(/\r?\n/)[index] ?? line;
|
|
1543
|
+
const after = replaceLine(text, index + 1, [original.replace(/cancel-in-progress:\s*["']?true["']?/, () => `cancel-in-progress: ${PULL_REQUEST_ONLY}`)]);
|
|
1544
|
+
breaks.push({
|
|
1545
|
+
file,
|
|
1546
|
+
line: index + 1,
|
|
1547
|
+
message: `${file} starts on push and has \`cancel-in-progress: true\`. A newer push cancels the run of main in progress, and that commit gets no result.`,
|
|
1548
|
+
edits: [{
|
|
1549
|
+
file,
|
|
1550
|
+
before: text,
|
|
1551
|
+
after
|
|
1552
|
+
}]
|
|
1553
|
+
});
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
if (pushed === 0) return { skipped: "no workflow starts on push" };
|
|
1557
|
+
return breaks;
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1491
1560
|
// src/rules/gate-trigger.ts
|
|
1492
1561
|
/**
|
|
1493
1562
|
* The rule `gate-trigger`: a workflow that runs on pull requests starts on each pull request, with no path filter. The
|
|
@@ -1682,7 +1751,7 @@ function convertGate(text, file, commit = ACTIONS_COMMIT) {
|
|
|
1682
1751
|
const group = (id) => grouped ? [] : [
|
|
1683
1752
|
`${job}concurrency:`,
|
|
1684
1753
|
`${job}${unit}group: \${{ github.workflow }}-${id}-\${{ github.ref }}`,
|
|
1685
|
-
`${job}${unit}cancel-in-progress:
|
|
1754
|
+
`${job}${unit}cancel-in-progress: ${PULL_REQUEST_ONLY}`
|
|
1686
1755
|
];
|
|
1687
1756
|
const changes = [
|
|
1688
1757
|
`${jobIndent}changes:`,
|
|
@@ -8756,7 +8825,7 @@ const runnerBudget = {
|
|
|
8756
8825
|
id: "runner-budget",
|
|
8757
8826
|
title: "Each matrix has a max-parallel of 3 or less, each workflow has a concurrency group, and each schedule starts at the minute that the repository and the file give.",
|
|
8758
8827
|
reason: "All repositories of the account share 40 runners, and heavy work keeps at most 28 of them. On 2026-10-30, a matrix with no max-parallel and the sync pull requests of about 20 repositories filled 39 of the 40 runners, with 88 jobs in the queue. Each repository copied the weekly scan at `23 5 * * 1`, so all scans started at the same minute. A workflow with no concurrency group starts a new run on each push, and the old runs keep their runners.",
|
|
8759
|
-
fix: "Add `max-parallel: 3` (or less) under `strategy`. Add a concurrency group at the top of the workflow (`concurrency: { group: <name>-${{ github.ref }}, cancel-in-progress:
|
|
8828
|
+
fix: "Add `max-parallel: 3` (or less) under `strategy`. Add a concurrency group at the top of the workflow (`concurrency: { group: <name>-${{ github.ref }}, cancel-in-progress: ${{ github.event_name == 'pull_request' }} }`), or in each job. Change the minute of each `cron` to the minute that the message gives; the hour and the days stay.",
|
|
8760
8829
|
sources: [{
|
|
8761
8830
|
repo: "fleet",
|
|
8762
8831
|
rule: "runner-slots",
|
|
@@ -10393,6 +10462,7 @@ const RULES = [
|
|
|
10393
10462
|
testsRequired,
|
|
10394
10463
|
roadmapParses,
|
|
10395
10464
|
runnerBudget,
|
|
10465
|
+
mainRunsFinish,
|
|
10396
10466
|
gateTrigger,
|
|
10397
10467
|
homePackage,
|
|
10398
10468
|
licenseFile,
|
|
@@ -10795,4 +10865,4 @@ function runMap(args, io) {
|
|
|
10795
10865
|
}
|
|
10796
10866
|
export { REAL_COMPARE as $, pathsOf as A, cleanPath as At, roadmapParses as B, runGit as Bt, configsOfScript as C, gateTrigger as Ct, hasTests as D, STRICT_OPTIONS as Dt, testsRequired as E, readWorkflow as Et, sharedDocsRule as F, lineOf as Ft, pinnedGitDeps as G, workspaceGlobs as Gt, releaseFiles as H, globFolders as Ht, repositoryOfRemote as I, matchesAny as It, pagesSite as J, PAGES_WORKFLOWS as K, defaultOptions as Kt, runnerBudget as L, parseJsonc as Lt, HOME_TIMEOUT_MS as M, hasFile as Mt, blockHash as N, inFolder as Nt, tsconfigTest as O, cuePreset as Ot, githubFetch as P, keyLine as Pt, noBuildOutput as Q, scheduleMinute as R, readJsonc as Rt, typedScripts as S, convertGate as St, typedFiles as T, summaryName as Tt, isGitSpecifier as U, globToRegExp as Ut, requiredScripts as V, specifiersOf as Vt, isPinned as W, packageFolders as Wt, HOME_PATTERNS as X, DEFAULT_ALLOWED as Y, noLocalPaths as Z, unreleasedChange as _, mapText as _t, listRules as a, licenseFileOf as at, TRAIN_SCOPES as b, HOME_EXPORTS as bt, runCli as c, declaredName as ct, RULES as d, repoOf as dt, hasImportMetaMain as et, workspaceProtocol as f, signaturesOf as ft, npmLookup as g, mapMarkdown as gt, UNSHIPPED_FILES as h, findHomes as ht, formatResult as i, licenseFile as it, sourceMain as j, codePackages as jt, isSourcePath as k, DEPENDENCY_FIELDS as kt, runFix as l, homePackage as lt, SHIPPED_FIELDS as m, MAP_RULE as mt, annotations as n, LICENSE_TEXTS as nt, readConfig as o, mitText as ot, NPM_REGISTRY as p, HOMES as pt, pagesCalls as q, parseConfig as qt, createContext as r, authorOf as rt, runChecks as s, repositoryIsPublic as st, USAGE as t, mainCheck as tt, summaryMarkdown as u, messageOf as ut, unreleasedChangeRule as v, mergeHomes as vt, scriptsOf as w, prPathFilters as wt, trustPolicy as x, ACTIONS_COMMIT as xt, IGNORE_AFTER as y, readOverlay as yt, roadmapOfLine as z, replaceLine as zt };
|
|
10797
10867
|
|
|
10798
|
-
//# sourceMappingURL=run-
|
|
10868
|
+
//# sourceMappingURL=run-C-CDw-pk.js.map
|