@mark1russell7/conventions 0.42.5 → 0.42.6
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-C0vL-9On.js → run-DQnTpiNz.js} +207 -12
- package/build/run-DQnTpiNz.js.map +1 -0
- package/package.json +1 -1
- package/build/run-C0vL-9On.js.map +0 -1
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ Each break shows the file, the line, the rule and the fix. In GitHub Actions, th
|
|
|
31
31
|
- `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.
|
|
32
32
|
- `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.
|
|
33
33
|
- `trust-policy`: the settings `trustPolicy`, `trustPolicyIgnoreAfter` and `trustPolicyExclude` of `pnpm-workspace.yaml`. The fix makes the file when the repository has none.
|
|
34
|
+
- `security-overrides`: the line of a shared override in `overrides` of `pnpm-workspace.yaml`, with a comment that names its advisories. The fix also removes a line whose parent is not in the lockfile. After the fix, start `pnpm install` and commit the lockfile.
|
|
34
35
|
- `main-check`: a compare of `process.argv[1]` with the path of the script. The fix writes `import.meta.main` when each Node version of `engines.node` has it (`^22.18`, `>=24.2`). Else it writes a compare of the two real paths, and it adds the imports. It removes the imports that only the old compare used.
|
|
35
36
|
- `gate-trigger`: a path filter on the pull request trigger of a gate. The fix removes the filter and adds a job `changes` with the same patterns. Each other job needs it and has an `if` on its match. A summary job `<Name> OK` with the action `gate-summary` needs each job. A job with its own `if`, and each job that needs such a job, can be skipped (`allow-skip`). Some workflows need a person, because the fix cannot convert them with certainty. Examples are a trigger in the flow form, an `if` of more than one line, and a job `changes` that already exists.
|
|
36
37
|
|
|
@@ -45,6 +46,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
45
46
|
| `pinned-git-deps` | A dependency from git (`github:`, `git+https:`, `owner/repo`) names a full commit SHA. The rule also examines `overrides`, `resolutions` and `pnpm.overrides`. | coeval `pinned-deps`, `unpublished-dep-pinned`. headroom `non-npm-deps-pinned`, `pinned-github-specifier`. private `github-dep-full-sha`, `github-dep-pinned`. client `general-npm-version`. |
|
|
46
47
|
| `workspace-protocol` | A dependency on a package of the workspace uses `workspace:`. The rule does not examine peer dependencies. | client `workspace-protocol`, `workspace-deps`. coeval `pinned-deps`. headroom `non-npm-deps-pinned`. crawler `mcp-workspace-dep`. |
|
|
47
48
|
| `trust-policy` | A repository with a `pnpm-lock.yaml` sets `trustPolicy: no-downgrade` in `pnpm-workspace.yaml`: pnpm refuses a version with less trust evidence than an earlier version, for example one with no provenance after versions from a trusted publisher. `trustPolicyIgnoreAfter` is 10080 or more, so the check examines the versions of the last 7 days. A stolen-token version is new, and older versions can have less evidence for other reasons. `trustPolicyExclude` has the scopes of the release train, which checks the provenance of their versions itself. | private `trust-policy` (STRATEGY.md, 2026-11-01). |
|
|
49
|
+
| `security-overrides` | A lockfile with a bad path of a shared override has the override of pnpm in `pnpm-workspace.yaml`. The overrides are data (`SHARED_OVERRIDES`). Each one has a parent, a child, a range, the first fixed version of the child and its advisories. A bad path is a version of the child under the parent below the fixed version. The rule reads the lockfile, so an override with another range passes when the lockfile has a fixed version. An override ends when the lockfile has no version of its parent. Then the rule asks for its removal. The first override is `archiver-utils>glob` at `^14.0.3` (GHSA-3g3m-2fjr-6pw4 and GHSA-g3hv-75wg-m249). The rule fails from 2026-11-30. | netdiag #37 and systems #557 (2026-11-15): the same override, written by hand, with no end. A private repository has the bad path and no override. |
|
|
48
50
|
| `source-main` | The `main` of each workspace package is `src/index.ts` (a package with only a `bin` has no `main`, and a private package with no entry is an app). A public package that has a source entry has the same field in `publishConfig`, and that field points at the build. | coeval `package-main-source`, `source-package-main`. crawler `pkg-source-main`, `source-package-main`, `publish-config-build`. private `new-package-main-index`, `source-package-main`. headroom `source-package-main`. |
|
|
49
51
|
| `tsconfig-test` | Each package with a `tsconfig.json` has a `tsconfig.test.json`, and its `typecheck` script names it. | coeval, crawler, Vex `package-tsconfig-test` or `pkg-tsconfig-test`, and `tsconfig-test`. headroom `tsconfig-test`, `tsconfig-test-per-package`. |
|
|
50
52
|
| `cue-preset` | The `tsconfig.json` of each package extends a preset of `@mark1russell7/cue`. No config of a package turns off a strict option that its preset turns on. `erasableSyntaxOnly` is one of these options, because `node` cannot strip the other syntax. | client `cue-config`, `no-manual-tsconfig`. private `cue-preset-strict`, `strict-preset`, `new-package-via-cli`. coeval, crawler, headroom, Vex `package-scaffold`. |
|
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-after-cancel.ts","../src/rules/gate-trigger.ts","../src/rules/security-one-job.ts","../src/rules/setup-cue.ts","../src/rules/shared-ci.ts","../src/rules/service-run-main.ts","../src/map.ts","../src/rules/home-module.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/coverage-provider.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/private-names.ts","../src/rules/no-local-paths.ts","../src/rules/pack-no-buildinfo.ts","../src/rules/exports-require.ts","../src/rules/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/site-check-in-ci.ts","../src/rules/pinned-git-deps.ts","../src/rules/pipe-fails.ts","../src/rules/push-main-only.ts","../src/rules/unreleased-change.ts","../src/rules/published-minor.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/version-title.ts","../src/rules/workflow-parses.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/run.ts","../src/pre-push.ts","../src/home-exports.ts","../src/workflow.ts","../src/release-text.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;;;qBAG3C;;UAGI;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;;;;;WAKjC;;;;;;;WAOA;EACT,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;;UCpN9E;;WAEN;;WAEA;;;;;WAKA;;WAEA;;WAEA,SAAS;;;UAIH;;WAEN;;WAEA,OAAO,SAAS,eAAe;;;wBAW1B,eAAe,MAAM,OAAO;;;;;;;wBAU5B,YAAY,gBAAgB,gBAAgB,SAAS;;qBCxCxD;qBA4FA,WAAW;qBC5CX,iBAAiB;;UCzCb;WACN;WACA;WACA;;;wBAIK,cAAc,eAAe;;qBAoBhC;;wBAyB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CZ,eAAe;;;;;wBAaf,SAAS,cAAc;qBAqB1B,eAAe;qBC2Gf,WAAW;qBCuJX,cAAc;;;;;KChSf;WAA4B;WAAsC,QAAQ,SAAS;WAAkC;;WAA+B;;;KAGpJ,kBAAkB,0BAA0B,qBAAqB,oBAAoB;;qBAGpF;;qBAGA;;qBAwBA;;;;;qBAyBA,WAAW;;wBAoGR,qBAAqB,SAAQ,iBAA6B;qBA4G7D,kBAAkB;;KC5QnB,kBAAkB,eAAe;;wBAG7B,QAAQ,kBAAkB;;;;;;wBAY1B,QAAQ,oBAAoB;;;;;wBAuB5B,eAAe,eAAe,oBAAoB;;wBA0ClD,mBAAmB,SAAQ,gBAA4B,qBAA+B;qBA8DzF,gBAAgB;qBC9IhB,cAAc;qBCad,iBAAiB;;wBCsDd,cAAc;qBAajB,eAAe;;;;;;wBC3EZ,eAAe,oBAAoB;;wBAUnC,mBAAmB;qBAoJtB,cAAc;;KClKf;WAAwB;;WAA4B;;;KAGpD,aAAa,4BAA4B,oBAAoB;;qBAG5D;;qBAiBA,aAAa;;qBAcb,YAAa;;wBAoEV,eAAe,aAAY,YAA0B;;wBC3GrD,QAAQ;;wBAQR,aAAa;qBAKhB,YAAY;qBCkBZ,eAAe;;wBCpBZ,SAAS,0BAA0B;qBAKtC,cAAc;;wBCoDX,gBAAgB;;;;;wBAmChB,UACd,SAAS,SAAS,0BAClB,cACA,OAAM;qBA4NK,YAAY;qBC1SZ,cAAc;;qBC3Bd;;qBAGA;qBA6DA,aAAa;;wBCxDV,cAAc;;wBAsBd,YAAY,SAAS,aAAa,cAAc;qBAyCnD,cAAc;;qBCxEd,aAAa;;UAGT;WACN;WACA;WACA;;;wBAIK,WAAW,eAAe;qBAY7B,gBAAgB;qBCxBhB,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-after-cancel.ts","../src/rules/gate-trigger.ts","../src/rules/security-one-job.ts","../src/rules/setup-cue.ts","../src/rules/shared-ci.ts","../src/rules/service-run-main.ts","../src/map.ts","../src/rules/home-module.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/coverage-provider.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/private-names.ts","../src/rules/no-local-paths.ts","../src/rules/pack-no-buildinfo.ts","../src/rules/exports-require.ts","../src/rules/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/site-check-in-ci.ts","../src/rules/pinned-git-deps.ts","../src/rules/pipe-fails.ts","../src/rules/push-main-only.ts","../src/rules/unreleased-change.ts","../src/rules/published-minor.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/version-title.ts","../src/rules/workflow-parses.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/run.ts","../src/pre-push.ts","../src/home-exports.ts","../src/workflow.ts","../src/release-text.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;;;qBAG3C;;UAGI;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;;;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AgBI;;WAEN;WACA,KAAK,SAAS;;WAEd,MAAM;;;;;;;wBAWD,YAAY,SAAS,aAAa,IAAI,KAAK;;qBCzX9C,cAAc,SAAS;WAA0B;WAA0B;;UC6EvE;WACN;WACA;WACA;;WAEA;WACA;;;UAIM;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;WACA,gBAAgB;;;UAIV;;WAEN;;WAEA;;WAEA;;WAEA;WACA,iBAAiB;WACjB,eAAe;;;wBAgGV,aAAa,cAAc,eAAe;;;;;;;wBAmD1C,WAAW,cAAc,eAAe;;;;;;;;qBChQ3C;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB"}
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as unreleasedChangeRule, $n as specifiersOf, $t as messageOf, A as typedFiles, An as ACTIONS_COMMIT, At as lineNameHit, B as roadmapParses, Bn as DEPENDENCY_FIELDS, Bt as apiReportScript, C as versionTitle, Cn as setupCue, Ct as privatePatterns, D as typedScripts, Dn as securityCallers, Dt as firstNameMatch, E as trustPolicy, En as SECURITY_TIMEOUT_MINUTES, Et as PrivateNameListError, F as HOME_TIMEOUT_MS, Fn as gateAfterCancel, Ft as noBuildOutput, G as publishedMinor, Gn as inFolder, Gt as mitText, H as releaseFiles, Hn as cleanPath, Ht as authorOf, I as blockHash, In as readAction, It as REAL_COMPARE, J as NPM_REGISTRY, Jn as matchesAny, Jt as moduleMessage, K as publishedMinorRule, Kn as keyLine, Kt as repositoryIsPublic, L as githubFetch, Ln as readWorkflow, Lt as hasImportMetaMain, M as isSourcePath, Mn as gateTrigger, Mt as nameMatches, N as pathsOf, Nn as prPathFilters, Nt as parsePrivateNames, O as configsOfScript, On as securityOneJob, Ot as isAllowedHit, P as sourceMain, Pn as summaryName, Pt as pathNameHit, Q as unreleasedChange, Qn as runGit, Qt as homePackage, R as sharedDocsRule, Rn as STRICT_OPTIONS, Rt as mainCheck, S as setVersions, Sn as sharedCi, St as privateNamesFile, T as TRAIN_SCOPES, Tn as SECURITY_SCAN_INPUTS, Tt as PRIVATE_NAME_LIST, U as lockedVersions, Un as codePackages, Ut as licenseFile, V as requiredScripts, Vn as RULE_WARN_DAYS, Vt as LICENSE_TEXTS, W as minorOf, Wn as hasFile, Wt as licenseFileOf, X as UNSHIPPED_FILES, Xn as readJsonc, Xt as modulesOf, Y as SHIPPED_FIELDS, Yn as parseJsonc, Yt as moduleUses, Z as npmLookup, Zn as replaceLine, Zt as declaredName, _ as workspaceProtocol, _n as tsconfigTest, _t as PRIVATE_NAMES_FILE_CONFIG, a as listRules, an as MAP_RULE, at as pagesAfterRelease, b as yamlFaults, bn as SHARED_WORKFLOWS, bt as invalidPatternBreaks, c as runCli, cn as mapText, ct as scheduleMinute, d as HOOK_MARKER, dn as npmNames, dt as pagesCalls, en as repoOf, er as defaultOptions, et as pipeFails, f as NO_READ_LINE, fn as readOverlay, ft as pagesSite, g as RULES, gn as hasTests, gt as HOME_PATTERNS, h as prePush, hn as serviceRunMain, ht as DEFAULT_ALLOWED, i as formatResult, in as HOMES, it as siteCheckInCi, j as testsRequired, jn as convertGate, jt as lineNameHits, k as scriptsOf, kn as withOneJob, kt as isCommonUse, l as runFix, ln as mergeHomes, lt as pushMainOnly, m as installHook, mn as runCalls, mt as packNoBuildinfo, n as annotations, nn as signaturesOf, nt as isPinned, o as readConfig, on as findHomes, ot as repositoryOfRemote, p as PRE_PUSH_HOOK, pn as SERVICE_PACKAGE, pt as exportsRequire, q as reachOf, qn as lineOf, qt as homeModule, r as createContext, rn as HOME_EXPORTS, rt as pinnedGitDeps, s as runChecks, sn as mapMarkdown, st as runnerBudget, t as USAGE, tn as reposOf, tr as parseConfig, tt as isGitSpecifier, u as summaryMarkdown, un as npmDrift, ut as PAGES_WORKFLOWS, v as GITHUB_YAML, vn as SHARED_ACTIONS, vt as PRIVATE_NAMES_FILE_VARIABLE, w as IGNORE_AFTER, wn as SECURITY_SCAN_COMMIT, wt as privateTextBreaks, x as namedVersions, xn as callsSharedCi, xt as noLocalPaths, y as workflowParses, yn as SHARED_CI, yt as PRIVATE_PATTERNS_VARIABLE, z as roadmapOfLine, zn as cuePreset, zt as coverageProvider } from "./run-
|
|
1
|
+
import { $ as unreleasedChangeRule, $n as specifiersOf, $t as messageOf, A as typedFiles, An as ACTIONS_COMMIT, At as lineNameHit, B as roadmapParses, Bn as DEPENDENCY_FIELDS, Bt as apiReportScript, C as versionTitle, Cn as setupCue, Ct as privatePatterns, D as typedScripts, Dn as securityCallers, Dt as firstNameMatch, E as trustPolicy, En as SECURITY_TIMEOUT_MINUTES, Et as PrivateNameListError, F as HOME_TIMEOUT_MS, Fn as gateAfterCancel, Ft as noBuildOutput, G as publishedMinor, Gn as inFolder, Gt as mitText, H as releaseFiles, Hn as cleanPath, Ht as authorOf, I as blockHash, In as readAction, It as REAL_COMPARE, J as NPM_REGISTRY, Jn as matchesAny, Jt as moduleMessage, K as publishedMinorRule, Kn as keyLine, Kt as repositoryIsPublic, L as githubFetch, Ln as readWorkflow, Lt as hasImportMetaMain, M as isSourcePath, Mn as gateTrigger, Mt as nameMatches, N as pathsOf, Nn as prPathFilters, Nt as parsePrivateNames, O as configsOfScript, On as securityOneJob, Ot as isAllowedHit, P as sourceMain, Pn as summaryName, Pt as pathNameHit, Q as unreleasedChange, Qn as runGit, Qt as homePackage, R as sharedDocsRule, Rn as STRICT_OPTIONS, Rt as mainCheck, S as setVersions, Sn as sharedCi, St as privateNamesFile, T as TRAIN_SCOPES, Tn as SECURITY_SCAN_INPUTS, Tt as PRIVATE_NAME_LIST, U as lockedVersions, Un as codePackages, Ut as licenseFile, V as requiredScripts, Vn as RULE_WARN_DAYS, Vt as LICENSE_TEXTS, W as minorOf, Wn as hasFile, Wt as licenseFileOf, X as UNSHIPPED_FILES, Xn as readJsonc, Xt as modulesOf, Y as SHIPPED_FIELDS, Yn as parseJsonc, Yt as moduleUses, Z as npmLookup, Zn as replaceLine, Zt as declaredName, _ as workspaceProtocol, _n as tsconfigTest, _t as PRIVATE_NAMES_FILE_CONFIG, a as listRules, an as MAP_RULE, at as pagesAfterRelease, b as yamlFaults, bn as SHARED_WORKFLOWS, bt as invalidPatternBreaks, c as runCli, cn as mapText, ct as scheduleMinute, d as HOOK_MARKER, dn as npmNames, dt as pagesCalls, en as repoOf, er as defaultOptions, et as pipeFails, f as NO_READ_LINE, fn as readOverlay, ft as pagesSite, g as RULES, gn as hasTests, gt as HOME_PATTERNS, h as prePush, hn as serviceRunMain, ht as DEFAULT_ALLOWED, i as formatResult, in as HOMES, it as siteCheckInCi, j as testsRequired, jn as convertGate, jt as lineNameHits, k as scriptsOf, kn as withOneJob, kt as isCommonUse, l as runFix, ln as mergeHomes, lt as pushMainOnly, m as installHook, mn as runCalls, mt as packNoBuildinfo, n as annotations, nn as signaturesOf, nt as isPinned, o as readConfig, on as findHomes, ot as repositoryOfRemote, p as PRE_PUSH_HOOK, pn as SERVICE_PACKAGE, pt as exportsRequire, q as reachOf, qn as lineOf, qt as homeModule, r as createContext, rn as HOME_EXPORTS, rt as pinnedGitDeps, s as runChecks, sn as mapMarkdown, st as runnerBudget, t as USAGE, tn as reposOf, tr as parseConfig, tt as isGitSpecifier, u as summaryMarkdown, un as npmDrift, ut as PAGES_WORKFLOWS, v as GITHUB_YAML, vn as SHARED_ACTIONS, vt as PRIVATE_NAMES_FILE_VARIABLE, w as IGNORE_AFTER, wn as SECURITY_SCAN_COMMIT, wt as privateTextBreaks, x as namedVersions, xn as callsSharedCi, xt as noLocalPaths, y as workflowParses, yn as SHARED_CI, yt as PRIVATE_PATTERNS_VARIABLE, z as roadmapOfLine, zn as cuePreset, zt as coverageProvider } from "./run-DQnTpiNz.js";
|
|
2
2
|
import { i as packageFolders, n as globFolders, r as globToRegExp, s as workspaceGlobs } from "./workspace-Cx7p7bWn.js";
|
|
3
3
|
// src/release-text.ts
|
|
4
4
|
/**
|
|
@@ -15159,7 +15159,7 @@ function isPinned(spec, fullSha) {
|
|
|
15159
15159
|
return path !== void 0 && path.split(/[/.]/).some((part) => sha.test(part));
|
|
15160
15160
|
}
|
|
15161
15161
|
/** This function gives the specifiers of the fields of overrides, also the field `overrides` of `pnpm`. */
|
|
15162
|
-
function overridesOf(manifest) {
|
|
15162
|
+
function overridesOf$1(manifest) {
|
|
15163
15163
|
const out = [];
|
|
15164
15164
|
for (const field of OVERRIDE_FIELDS) for (const [name, spec] of specifiersOf(manifest, field)) out.push([
|
|
15165
15165
|
field,
|
|
@@ -15231,7 +15231,7 @@ const pinnedGitDeps = {
|
|
|
15231
15231
|
name,
|
|
15232
15232
|
spec
|
|
15233
15233
|
]);
|
|
15234
|
-
found.push(...overridesOf(info.manifest));
|
|
15234
|
+
found.push(...overridesOf$1(info.manifest));
|
|
15235
15235
|
for (const [field, name, spec] of found) {
|
|
15236
15236
|
if (!isGitSpecifier(spec) || isPinned(spec, fullSha)) continue;
|
|
15237
15237
|
const line = keyLine(info.text, field, name);
|
|
@@ -17196,7 +17196,7 @@ const typedScripts = {
|
|
|
17196
17196
|
* The rule `trust-policy`: a pnpm repository sets `trustPolicy: no-downgrade` in `pnpm-workspace.yaml`. It checks each
|
|
17197
17197
|
* version for 7 days after its publish (`trustPolicyIgnoreAfter`). It excludes the scopes of the release train.
|
|
17198
17198
|
*/
|
|
17199
|
-
const WORKSPACE = "pnpm-workspace.yaml";
|
|
17199
|
+
const WORKSPACE$1 = "pnpm-workspace.yaml";
|
|
17200
17200
|
/** The scopes that the release train updates. The train checks the provenance of their versions itself. */
|
|
17201
17201
|
const TRAIN_SCOPES = ["@mark1russell7/*", "@procedures/*"];
|
|
17202
17202
|
/** 7 days, in minutes. */
|
|
@@ -17282,11 +17282,11 @@ const trustPolicy = {
|
|
|
17282
17282
|
if (!hasFile(context.root, "pnpm-lock.yaml")) return { skipped: "the repository has no pnpm-lock.yaml" };
|
|
17283
17283
|
const exclude = Array.isArray(options["exclude"]) ? options["exclude"] : TRAIN_SCOPES;
|
|
17284
17284
|
const ignoreAfter = typeof options["ignoreAfter"] === "number" ? options["ignoreAfter"] : IGNORE_AFTER;
|
|
17285
|
-
const exists = hasFile(context.root, WORKSPACE);
|
|
17286
|
-
const text = exists ? readFileSync(join(context.root, WORKSPACE), "utf8") : "";
|
|
17285
|
+
const exists = hasFile(context.root, WORKSPACE$1);
|
|
17286
|
+
const text = exists ? readFileSync(join(context.root, WORKSPACE$1), "utf8") : "";
|
|
17287
17287
|
const lines = text.split(/\r?\n/);
|
|
17288
17288
|
const edit = (after) => after === text ? [] : [{
|
|
17289
|
-
file: WORKSPACE,
|
|
17289
|
+
file: WORKSPACE$1,
|
|
17290
17290
|
before: text,
|
|
17291
17291
|
after
|
|
17292
17292
|
}];
|
|
@@ -17294,9 +17294,9 @@ const trustPolicy = {
|
|
|
17294
17294
|
const breaks = [];
|
|
17295
17295
|
const policy = valueOf(lines, "trustPolicy");
|
|
17296
17296
|
if (policy?.value !== "no-downgrade") breaks.push({
|
|
17297
|
-
file: WORKSPACE,
|
|
17297
|
+
file: WORKSPACE$1,
|
|
17298
17298
|
...at(policy?.index),
|
|
17299
|
-
message: policy === void 0 ? `${exists ? WORKSPACE : "The repository"} does not set trustPolicy.` : `trustPolicy is "${policy.value}", not "no-downgrade".`,
|
|
17299
|
+
message: policy === void 0 ? `${exists ? WORKSPACE$1 : "The repository"} does not set trustPolicy.` : `trustPolicy is "${policy.value}", not "no-downgrade".`,
|
|
17300
17300
|
edits: edit(policy === void 0 ? insert(text, -1, [...POLICY_COMMENT, "trustPolicy: no-downgrade"]) : setValue(text, policy.index, "trustPolicy", "no-downgrade"))
|
|
17301
17301
|
});
|
|
17302
17302
|
const ignore = valueOf(lines, "trustPolicyIgnoreAfter");
|
|
@@ -17304,9 +17304,9 @@ const trustPolicy = {
|
|
|
17304
17304
|
if (minutes === void 0 || !Number.isInteger(minutes) || minutes < ignoreAfter) {
|
|
17305
17305
|
const after = ignore !== void 0 ? setValue(text, ignore.index, "trustPolicyIgnoreAfter", String(ignoreAfter)) : policy !== void 0 ? insert(text, policy.index, [...IGNORE_COMMENT, `trustPolicyIgnoreAfter: ${String(ignoreAfter)}`]) : text;
|
|
17306
17306
|
breaks.push({
|
|
17307
|
-
file: WORKSPACE,
|
|
17307
|
+
file: WORKSPACE$1,
|
|
17308
17308
|
...at(ignore?.index),
|
|
17309
|
-
message: ignore === void 0 ? `${WORKSPACE} does not set trustPolicyIgnoreAfter, so pnpm also refuses old versions that have less evidence for other reasons.` : `trustPolicyIgnoreAfter is ${ignore.value}, not a whole number of at least ${String(ignoreAfter)} minutes.`,
|
|
17309
|
+
message: ignore === void 0 ? `${WORKSPACE$1} does not set trustPolicyIgnoreAfter, so pnpm also refuses old versions that have less evidence for other reasons.` : `trustPolicyIgnoreAfter is ${ignore.value}, not a whole number of at least ${String(ignoreAfter)} minutes.`,
|
|
17310
17310
|
edits: edit(after)
|
|
17311
17311
|
});
|
|
17312
17312
|
}
|
|
@@ -17326,7 +17326,7 @@ const trustPolicy = {
|
|
|
17326
17326
|
...items
|
|
17327
17327
|
]);
|
|
17328
17328
|
breaks.push({
|
|
17329
|
-
file: WORKSPACE,
|
|
17329
|
+
file: WORKSPACE$1,
|
|
17330
17330
|
...at(start >= 0 ? start : void 0),
|
|
17331
17331
|
message: `trustPolicyExclude does not have ${missing.join(", ")}.`,
|
|
17332
17332
|
edits: edit(after)
|
|
@@ -17335,6 +17335,200 @@ const trustPolicy = {
|
|
|
17335
17335
|
return breaks;
|
|
17336
17336
|
}
|
|
17337
17337
|
};
|
|
17338
|
+
// src/rules/security-overrides.ts
|
|
17339
|
+
/**
|
|
17340
|
+
* The rule `security-overrides`: a repository whose lockfile has a bad path of `SHARED_OVERRIDES` sets the override of
|
|
17341
|
+
* pnpm for it. When the lockfile has no version of the parent of an override, the override ends, and the rule removes it.
|
|
17342
|
+
*/
|
|
17343
|
+
const WORKSPACE = "pnpm-workspace.yaml";
|
|
17344
|
+
const LOCKFILE = "pnpm-lock.yaml";
|
|
17345
|
+
/**
|
|
17346
|
+
* The shared overrides. The package glob 10 under archiver-utils 5 has GHSA-3g3m-2fjr-6pw4. Its minimatch 9 has
|
|
17347
|
+
* GHSA-g3hv-75wg-m249. The version glob 14.0.2 fixes glob. The version 14.0.3 is the first that asks for a fixed
|
|
17348
|
+
* minimatch (`^11.0.2`).
|
|
17349
|
+
*/
|
|
17350
|
+
const SHARED_OVERRIDES = [{
|
|
17351
|
+
parent: "archiver-utils",
|
|
17352
|
+
child: "glob",
|
|
17353
|
+
range: "^14.0.3",
|
|
17354
|
+
fixed: "14.0.3",
|
|
17355
|
+
advisories: ["GHSA-3g3m-2fjr-6pw4", "GHSA-g3hv-75wg-m249"],
|
|
17356
|
+
end: "archiver 8 has no archiver-utils, so the override ends when testcontainers accepts archiver 8"
|
|
17357
|
+
}];
|
|
17358
|
+
/** This function gives the selector of an override: `parent>child`. */
|
|
17359
|
+
const selectorOf = (override) => `${override.parent}>${override.child}`;
|
|
17360
|
+
/** This function removes the quotes around a key or a value of YAML. */
|
|
17361
|
+
const unquoted = (text) => text.trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
17362
|
+
/** This function gives the parts of a release version, or undefined for other text. It cuts the peer suffix `(...)`. */
|
|
17363
|
+
function partsOf(version) {
|
|
17364
|
+
const match = /^(\d+)\.(\d+)\.(\d+)(?:$|\()/.exec(version.trim());
|
|
17365
|
+
return match === null ? void 0 : [
|
|
17366
|
+
Number(match[1]),
|
|
17367
|
+
Number(match[2]),
|
|
17368
|
+
Number(match[3])
|
|
17369
|
+
];
|
|
17370
|
+
}
|
|
17371
|
+
/** This function tells if the release version `version` is below the version `fixed`. It gives false for other text. */
|
|
17372
|
+
function isBelow(version, fixed) {
|
|
17373
|
+
const have = partsOf(version);
|
|
17374
|
+
const want = partsOf(fixed);
|
|
17375
|
+
if (have === void 0 || want === void 0) return false;
|
|
17376
|
+
for (let index = 0; index < 3; index++) if ((have[index] ?? 0) !== (want[index] ?? 0)) return (have[index] ?? 0) < (want[index] ?? 0);
|
|
17377
|
+
return false;
|
|
17378
|
+
}
|
|
17379
|
+
/**
|
|
17380
|
+
* This function reads the `snapshots` of each document of the text of a `pnpm-lock.yaml` file. It gives the count of
|
|
17381
|
+
* the snapshots of `parent`, and the version of `child` in the dependencies of each of them.
|
|
17382
|
+
*/
|
|
17383
|
+
function childVersions(text, parent, child) {
|
|
17384
|
+
const versions = [];
|
|
17385
|
+
let parents = 0;
|
|
17386
|
+
let inside = false;
|
|
17387
|
+
let inParent = false;
|
|
17388
|
+
let inDependencies = false;
|
|
17389
|
+
for (const line of text.split(/\r?\n/)) {
|
|
17390
|
+
if (/^\S/.test(line)) {
|
|
17391
|
+
inside = line.trimEnd() === "snapshots:";
|
|
17392
|
+
inParent = false;
|
|
17393
|
+
continue;
|
|
17394
|
+
}
|
|
17395
|
+
if (!inside) continue;
|
|
17396
|
+
const entry = yamlEntry(line);
|
|
17397
|
+
if (entry === void 0) continue;
|
|
17398
|
+
const key = unquoted(entry.key);
|
|
17399
|
+
if (entry.indent === 2) {
|
|
17400
|
+
inParent = key.startsWith(`${parent}@`) && /^\d/.test(key.slice(parent.length + 1));
|
|
17401
|
+
inDependencies = false;
|
|
17402
|
+
if (inParent) parents++;
|
|
17403
|
+
} else if (entry.indent === 4) inDependencies = key === "dependencies" || key === "optionalDependencies";
|
|
17404
|
+
else if (entry.indent === 6 && inParent && inDependencies && key === child) versions.push(unquoted(entry.value));
|
|
17405
|
+
}
|
|
17406
|
+
return {
|
|
17407
|
+
parents,
|
|
17408
|
+
versions
|
|
17409
|
+
};
|
|
17410
|
+
}
|
|
17411
|
+
/** This function gives the block `overrides` of the lines of `pnpm-workspace.yaml`, or undefined when it has none. */
|
|
17412
|
+
function overridesOf(lines) {
|
|
17413
|
+
const key = lines.findIndex((line) => /^overrides:(\s|$)/.test(line));
|
|
17414
|
+
if (key < 0) return void 0;
|
|
17415
|
+
const rest = (lines[key] ?? "").slice(10).replace(/\s+#.*$/, "").trim();
|
|
17416
|
+
const entries = /* @__PURE__ */ new Map();
|
|
17417
|
+
let last = key;
|
|
17418
|
+
for (let index = key + 1; index < lines.length; index++) {
|
|
17419
|
+
const line = lines[index] ?? "";
|
|
17420
|
+
if (line.trim() === "" || line.trimStart().startsWith("#")) continue;
|
|
17421
|
+
if (/^\S/.test(line)) break;
|
|
17422
|
+
const entry = yamlEntry(line);
|
|
17423
|
+
if (entry !== void 0) entries.set(unquoted(entry.key), {
|
|
17424
|
+
index,
|
|
17425
|
+
value: unquoted(entry.value.replace(/\s+#.*$/, ""))
|
|
17426
|
+
});
|
|
17427
|
+
last = index;
|
|
17428
|
+
}
|
|
17429
|
+
return {
|
|
17430
|
+
key,
|
|
17431
|
+
last,
|
|
17432
|
+
inline: rest !== "",
|
|
17433
|
+
entries
|
|
17434
|
+
};
|
|
17435
|
+
}
|
|
17436
|
+
/** This function gives the comment and the line of an override, with the indent `indent`. */
|
|
17437
|
+
const overrideLines = (override, indent) => [`${indent}# ${override.advisories.join(" and ")}. The rule security-overrides of conventions removes this line at its end.`, `${indent}"${selectorOf(override)}": "${override.range}"`];
|
|
17438
|
+
/** This function tells if a line is the comment that `overrideLines` writes. */
|
|
17439
|
+
const isOwnComment = (line) => line.trimStart().startsWith("#") && line.includes("The rule security-overrides of conventions");
|
|
17440
|
+
const securityOverrides = {
|
|
17441
|
+
id: "security-overrides",
|
|
17442
|
+
title: "A lockfile with a bad path of a shared override has the override of pnpm, and an override with no parent in the lockfile goes.",
|
|
17443
|
+
reason: "An advisory deep in the tree, for example glob 10 under archiver-utils, waits for each package on its path to release. The override of pnpm closes it in one line. Each repository wrote that line by hand, and no line said when it ends. A data list keeps one range for each repository, and the lockfile tells when the override ends.",
|
|
17444
|
+
fix: "Add the override of `SHARED_OVERRIDES` to `overrides` in `pnpm-workspace.yaml`, then start `pnpm install` and commit the lockfile. Remove an override whose parent is not in the lockfile. `conventions fix` edits `pnpm-workspace.yaml`.",
|
|
17445
|
+
sources: [
|
|
17446
|
+
{
|
|
17447
|
+
repo: "netdiag",
|
|
17448
|
+
rule: "security-overrides",
|
|
17449
|
+
doc: "netdiag #37 (2026-11-15): the override archiver-utils>glob for GHSA-3g3m-2fjr-6pw4 and GHSA-g3hv-75wg-m249"
|
|
17450
|
+
},
|
|
17451
|
+
{
|
|
17452
|
+
repo: "systems",
|
|
17453
|
+
rule: "security-overrides",
|
|
17454
|
+
doc: "systems #557 (2026-11-15): the same override, written by hand"
|
|
17455
|
+
},
|
|
17456
|
+
{
|
|
17457
|
+
repo: "private",
|
|
17458
|
+
rule: "security-overrides",
|
|
17459
|
+
doc: "a private repository (2026-11-16): glob 10.5.0 under archiver-utils 5.0.2 in its lockfile, with no override"
|
|
17460
|
+
}
|
|
17461
|
+
],
|
|
17462
|
+
options: {},
|
|
17463
|
+
failsFrom: "2026-11-30",
|
|
17464
|
+
check(context) {
|
|
17465
|
+
if (!hasFile(context.root, LOCKFILE)) return { skipped: "the repository has no pnpm-lock.yaml" };
|
|
17466
|
+
const lock = readFileSync(join(context.root, LOCKFILE), "utf8");
|
|
17467
|
+
const format = /^lockfileVersion:\s*['"]?(\d+)/m.exec(lock);
|
|
17468
|
+
if (format === null || Number(format[1]) < 9) return { skipped: "pnpm-lock.yaml is not a lockfile of version 9 or later" };
|
|
17469
|
+
const text = hasFile(context.root, WORKSPACE) ? readFileSync(join(context.root, WORKSPACE), "utf8") : "";
|
|
17470
|
+
const eol = text.includes("\r\n") ? "\r\n" : "\n";
|
|
17471
|
+
const lines = text.split(/\r?\n/);
|
|
17472
|
+
const block = overridesOf(lines);
|
|
17473
|
+
const breaks = [];
|
|
17474
|
+
for (const override of SHARED_OVERRIDES) {
|
|
17475
|
+
const selector = selectorOf(override);
|
|
17476
|
+
const found = childVersions(lock, override.parent, override.child);
|
|
17477
|
+
const bad = found.versions.filter((version) => isBelow(version, override.fixed));
|
|
17478
|
+
const own = block?.entries.get(selector);
|
|
17479
|
+
if (bad.length > 0 && own === void 0) {
|
|
17480
|
+
const message = `${LOCKFILE} has ${override.child} ${[...new Set(bad)].join(", ")} under ${override.parent} (${override.advisories.join(", ")}). Add the override "${selector}": "${override.range}" to ${WORKSPACE}, then start pnpm install.`;
|
|
17481
|
+
if (block?.inline === true) {
|
|
17482
|
+
breaks.push({
|
|
17483
|
+
file: WORKSPACE,
|
|
17484
|
+
line: block.key + 1,
|
|
17485
|
+
message: `${message} The key overrides has an inline value, so a person writes the line.`
|
|
17486
|
+
});
|
|
17487
|
+
continue;
|
|
17488
|
+
}
|
|
17489
|
+
const after = [...lines];
|
|
17490
|
+
if (block === void 0) {
|
|
17491
|
+
while (after.length > 0 && after[after.length - 1] === "") after.pop();
|
|
17492
|
+
after.push(...after.length > 0 ? [""] : [], "overrides:", ...overrideLines(override, " "), "");
|
|
17493
|
+
} else {
|
|
17494
|
+
const first = [...block.entries.values()][0];
|
|
17495
|
+
const indent = first === void 0 ? " " : (lines[first.index] ?? "").slice(0, (lines[first.index] ?? "").length - (lines[first.index] ?? "").trimStart().length);
|
|
17496
|
+
after.splice(block.last + 1, 0, ...overrideLines(override, indent));
|
|
17497
|
+
}
|
|
17498
|
+
breaks.push({
|
|
17499
|
+
file: WORKSPACE,
|
|
17500
|
+
...block === void 0 ? {} : { line: block.key + 1 },
|
|
17501
|
+
message,
|
|
17502
|
+
edits: [{
|
|
17503
|
+
file: WORKSPACE,
|
|
17504
|
+
before: text,
|
|
17505
|
+
after: after.join(eol)
|
|
17506
|
+
}]
|
|
17507
|
+
});
|
|
17508
|
+
} else if (found.parents === 0 && own !== void 0 && block !== void 0) {
|
|
17509
|
+
const after = [...lines];
|
|
17510
|
+
let start = own.index;
|
|
17511
|
+
while (start > 0 && isOwnComment(after[start - 1] ?? "")) start--;
|
|
17512
|
+
after.splice(start, own.index - start + 1);
|
|
17513
|
+
if (block.entries.size === 1 && !block.inline) {
|
|
17514
|
+
after.splice(block.key, 1);
|
|
17515
|
+
if (block.key > 0 && after[block.key - 1] === "" && (after[block.key] ?? "") === "") after.splice(block.key, 1);
|
|
17516
|
+
}
|
|
17517
|
+
breaks.push({
|
|
17518
|
+
file: WORKSPACE,
|
|
17519
|
+
line: own.index + 1,
|
|
17520
|
+
message: `The override "${selector}" ends: ${LOCKFILE} has no ${override.parent}. Remove it (${override.end}).`,
|
|
17521
|
+
edits: [{
|
|
17522
|
+
file: WORKSPACE,
|
|
17523
|
+
before: text,
|
|
17524
|
+
after: after.join(eol)
|
|
17525
|
+
}]
|
|
17526
|
+
});
|
|
17527
|
+
}
|
|
17528
|
+
}
|
|
17529
|
+
return breaks;
|
|
17530
|
+
}
|
|
17531
|
+
};
|
|
17338
17532
|
// src/rules/version-title.ts
|
|
17339
17533
|
/**
|
|
17340
17534
|
* The rule `version-title`: a merge whose title names a version sets that version in a `package.json`.
|
|
@@ -17641,6 +17835,7 @@ const RULES = [
|
|
|
17641
17835
|
pinnedGitDeps,
|
|
17642
17836
|
workspaceProtocol,
|
|
17643
17837
|
trustPolicy,
|
|
17838
|
+
securityOverrides,
|
|
17644
17839
|
sourceMain,
|
|
17645
17840
|
serviceRunMain,
|
|
17646
17841
|
tsconfigTest,
|
|
@@ -18577,4 +18772,4 @@ function runHook(args, io) {
|
|
|
18577
18772
|
}
|
|
18578
18773
|
export { unreleasedChangeRule as $, specifiersOf as $n, messageOf as $t, typedFiles as A, ACTIONS_COMMIT as An, lineNameHit as At, roadmapParses as B, DEPENDENCY_FIELDS as Bn, apiReportScript as Bt, versionTitle as C, setupCue as Cn, privatePatterns as Ct, typedScripts as D, securityCallers as Dn, firstNameMatch as Dt, trustPolicy as E, SECURITY_TIMEOUT_MINUTES as En, PrivateNameListError as Et, HOME_TIMEOUT_MS as F, gateAfterCancel as Fn, noBuildOutput as Ft, publishedMinor as G, inFolder as Gn, mitText as Gt, releaseFiles as H, cleanPath as Hn, authorOf as Ht, blockHash as I, readAction as In, REAL_COMPARE as It, NPM_REGISTRY as J, matchesAny as Jn, moduleMessage as Jt, publishedMinorRule as K, keyLine as Kn, repositoryIsPublic as Kt, githubFetch as L, readWorkflow as Ln, hasImportMetaMain as Lt, isSourcePath as M, gateTrigger as Mn, nameMatches as Mt, pathsOf as N, prPathFilters as Nn, parsePrivateNames as Nt, configsOfScript as O, securityOneJob as On, isAllowedHit as Ot, sourceMain as P, summaryName as Pn, pathNameHit as Pt, unreleasedChange as Q, runGit as Qn, homePackage as Qt, sharedDocsRule as R, STRICT_OPTIONS as Rn, mainCheck as Rt, setVersions as S, sharedCi as Sn, privateNamesFile as St, TRAIN_SCOPES as T, SECURITY_SCAN_INPUTS as Tn, PRIVATE_NAME_LIST as Tt, lockedVersions as U, codePackages as Un, licenseFile as Ut, requiredScripts as V, RULE_WARN_DAYS as Vn, LICENSE_TEXTS as Vt, minorOf as W, hasFile as Wn, licenseFileOf as Wt, UNSHIPPED_FILES as X, readJsonc as Xn, modulesOf as Xt, SHIPPED_FIELDS as Y, parseJsonc as Yn, moduleUses as Yt, npmLookup as Z, replaceLine as Zn, declaredName as Zt, workspaceProtocol as _, tsconfigTest as _n, PRIVATE_NAMES_FILE_CONFIG as _t, listRules as a, MAP_RULE as an, pagesAfterRelease as at, yamlFaults as b, SHARED_WORKFLOWS as bn, invalidPatternBreaks as bt, runCli as c, mapText as cn, scheduleMinute as ct, HOOK_MARKER as d, npmNames as dn, pagesCalls as dt, repoOf as en, defaultOptions as er, pipeFails as et, NO_READ_LINE as f, readOverlay as fn, pagesSite as ft, RULES as g, hasTests as gn, HOME_PATTERNS as gt, prePush as h, serviceRunMain as hn, DEFAULT_ALLOWED as ht, formatResult as i, HOMES as in, siteCheckInCi as it, testsRequired as j, convertGate as jn, lineNameHits as jt, scriptsOf as k, withOneJob as kn, isCommonUse as kt, runFix as l, mergeHomes as ln, pushMainOnly as lt, installHook as m, runCalls as mn, packNoBuildinfo as mt, annotations as n, signaturesOf as nn, isPinned as nt, readConfig as o, findHomes as on, repositoryOfRemote as ot, PRE_PUSH_HOOK as p, SERVICE_PACKAGE as pn, exportsRequire as pt, reachOf as q, lineOf as qn, homeModule as qt, createContext as r, HOME_EXPORTS as rn, pinnedGitDeps as rt, runChecks as s, mapMarkdown as sn, runnerBudget as st, USAGE as t, reposOf as tn, parseConfig as tr, isGitSpecifier as tt, summaryMarkdown as u, npmDrift as un, PAGES_WORKFLOWS as ut, GITHUB_YAML as v, SHARED_ACTIONS as vn, PRIVATE_NAMES_FILE_VARIABLE as vt, IGNORE_AFTER as w, SECURITY_SCAN_COMMIT as wn, privateTextBreaks as wt, namedVersions as x, callsSharedCi as xn, noLocalPaths as xt, workflowParses as y, SHARED_CI as yn, PRIVATE_PATTERNS_VARIABLE as yt, roadmapOfLine as z, cuePreset as zn, coverageProvider as zt };
|
|
18579
18774
|
|
|
18580
|
-
//# sourceMappingURL=run-
|
|
18775
|
+
//# sourceMappingURL=run-DQnTpiNz.js.map
|