@mark1russell7/conventions 0.50.1 → 0.50.3
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 -2
- package/build/cli.js +1 -1
- package/build/index.d.ts +10 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/owners.d.ts +3 -1
- package/build/owners.d.ts.map +1 -1
- package/build/owners.js +5 -2
- package/build/owners.js.map +1 -1
- package/build/{run-DNe9I3-M.js → run-DRCOlvNx.js} +548 -404
- package/build/run-DRCOlvNx.js.map +1 -0
- package/package.json +1 -1
- package/build/run-DNe9I3-M.js.map +0 -1
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ Each break shows the file, the line, the rule and the fix. In GitHub Actions, th
|
|
|
27
27
|
- `push-main-only`: a workflow that starts on `push` and on `pull_request`, with no limit of `push` to the default branch or with no `workflow_dispatch`. The fix adds `branches` and `workflow_dispatch`, and keeps the comments and each other trigger. It keeps a tag run when the workflow reads the tag. It does not edit `release.yml`, and a person chooses the change for `branches-ignore` or for another named branch.
|
|
28
28
|
- `pipe-fails`: a step with a pipe and no `pipefail`. The fix adds `defaults: { run: { shell: bash } }` to the workflow. It does not write over another shell.
|
|
29
29
|
- `gate-after-cancel`: a summary job of a gate with `always()` in its condition. The fix writes `if: ${{ !cancelled() }}`. A condition with other parts needs a person.
|
|
30
|
+
- `security-gate`: a repository with the gate `ci.yml` (a pull request trigger) and no security gate: no job `Security OK`, no step with the action `security-scan`. The fix writes `.github/workflows/security.yml` as the stamp writes it, with the action pinned to a commit and the minute of the repository and the file. It needs a person when `security.yml` is there and is not a gate, or when no remote origin gives the minute. It skips a private repository, which has no paid Actions minutes.
|
|
30
31
|
- `security-one-job`: a job that uses the shared workflow `reusable-security.yml`, with or without its summary job `Security OK`. The fix writes one job `Security OK` that runs the action `security-scan`, with the same inputs and time limit. With no summary job, the new job gets the id `security-ok`. The pin is the first commit of the template with the action, and Renovate moves it. Another summary job, a second job that needs the scans, another job `security-ok` or an input of more than one line needs a person.
|
|
31
32
|
- `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
33
|
- `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.
|
|
@@ -71,6 +72,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
71
72
|
| `pipe-fails` | A failure on the left of a pipe fails its step. With no `shell` key, GitHub has no `pipefail`, so `tests \| tee out.txt` passes when the tests fail. The fix adds `shell: bash` as the default of the workflow. A step that then turns red had a failure that the pipe hid. |
|
|
72
73
|
| `job-fails` | A failed job fails its run and each job that reads it. When a job with `continue-on-error` fails, `needs.<job>.result` is `success`, so a summary job of a gate passes over a crash. The rule also finds `continue-on-error` on a test step that no later step reads, and a `|| true` after a test command. The option `advisory` keeps a job for a time, as `<file>#<job> until <YYYY-MM-DD>: <reason>`. An entry fails after its day, and when its job hides no failure. The rule fails from 2026-12-07. | coeval run 42034457935 (2026-11-05), vex-testkit `workflow-faults.ts`, lag `ci.yml`. |
|
|
73
74
|
| `gate-after-cancel` | A summary job of a gate has the condition `if: ${{ !cancelled() }}`, not `always()`. After a cancel, a job with `always()` asks for a runner, and the new run waits behind it. A job with `!cancelled()` concludes `cancelled` with no runner, and the pull request stays blocked. |
|
|
75
|
+
| `security-gate` | A repository with the gate `ci.yml` also has the gate `security.yml`: the scans of the action `security-scan` in one job `Security OK`. The ruleset of main names `CI OK` and `Security OK`. With no security gate, a pull request can add a dependency with a known advisory, and no scan reads the code. On 2026-11-22, 16 of 61 public repositories had `CI OK` and no `Security OK`. | private |
|
|
74
76
|
| `security-one-job` | The security scans run in one job, the check `Security OK`, with the action `security-scan` of the template. The shared workflow `reusable-security.yml` gives three scan jobs, and its caller adds a summary job. Each job asks for its own runner, so in a full queue a run waits for four runners. On 2026-11-06 each scan job of one repository waited 23 to 40 minutes. |
|
|
75
77
|
| `service-run-main` | In a server package, only the entry `src/main.ts` starts the service with `run()`. A server package has a dependency on `@mark1russell7/service` and a file `src/main.ts`, as the preset `service` writes it. A source file that imports the service package and starts `run()` is a break. A file that imports only the tool entries (`/channel`, `/clock`, `/heartbeat`, `/backoff`, `/limiter`, `/rules`) is not read: their values have their own `run`, as the pool of `/channel`. `run()` owns the process, so a module that starts it cannot be imported by a test. |
|
|
76
78
|
| `shared-ci` | The workflow `ci.yml` calls the shared workflow `reusable-ci.yml` of the template, and no workflow or action of the repository has the name of a shared one of the template. A `ci.yml` with its own steps, or a local copy, does not get the fixes and the new checks of the template. The template itself is not examined (option `home`). On 2026-11-07, 3 of 19 repositories of the account ran CI steps of their own. |
|
|
@@ -294,7 +296,7 @@ The repositories have more than one owner: the personal account and an organizat
|
|
|
294
296
|
import { OWNERS, ownersOf, repoKeyer, sharedNames } from "@mark1russell7/conventions/owners";
|
|
295
297
|
```
|
|
296
298
|
|
|
297
|
-
The subpath `@mark1russell7/conventions/owners` has no import, so a workflow with a sparse checkout and no install can import its source. `ownersOf(value)` reads a list of logins with commas, and gives each owner for an empty list. `sharedNames(repos)` gives each repository name that two owners have. `repoKeyer(repos)` gives the record key of each repository: the name when one owner has the name, and `owner/name` when two owners have it. Thus a reader that keys its records by the name keeps its old keys, and two repositories with one name become two records.
|
|
299
|
+
The subpath `@mark1russell7/conventions/owners` has no import, so a workflow with a sparse checkout and no install can import its source. `ownersOf(value)` reads a list of logins with commas, and gives each owner for an empty list. `sharedNames(repos)` gives each repository name that two owners have. `repoKeyer(repos)` gives the record key of each repository: the name when one owner has the name, and `owner/name` when two owners have it. Thus a reader that keys its records by the name keeps its old keys, and two repositories with one name become two records. A second argument sets the separator: `repoKeyer(repos, "~")` gives `owner~name`, for a key in a file name or a database id.
|
|
298
300
|
|
|
299
301
|
## Add a rule
|
|
300
302
|
|
|
@@ -312,7 +314,7 @@ The package also exports the functions of the tool:
|
|
|
312
314
|
- `replaceLine(text, line, lines)` gives the text with one line replaced, for the edits of a rule.
|
|
313
315
|
- `formatResult(result)`, `summaryMarkdown(result)`, `annotations(result)` and `listRules(config)` give the output.
|
|
314
316
|
- `parseConfig(value, rules)` and `readConfig(root)` read the field `conventions`. `parseRuleConfig(value, rule)` reads the entry of one rule, and not the other entries.
|
|
315
|
-
- `OWNERS` is the list of the owners, with `ownerOf(login)`, `ownersOf(value)`, `sharedNames(repos)` and `repoKeyer(repos)`. The subpath `@mark1russell7/conventions/owners` gives them and no other code.
|
|
317
|
+
- `OWNERS` is the list of the owners, with `ownerOf(login)`, `ownersOf(value)`, `sharedNames(repos)` and `repoKeyer(repos, separator)`. The subpath `@mark1russell7/conventions/owners` gives them and no other code.
|
|
316
318
|
- `HOMES` is the map of homes. `findHomes(query)` finds the homes of words, and `mapMarkdown(homes)` and `mapText(homes)` write them. `readOverlay(file)` and `mergeHomes(base, extra)` add more homes.
|
|
317
319
|
- `tagName(name, version, packageCount)` gives the git tag of a version. `releaseNotes(name, version, changelog)` gives the text of its GitHub release, with `changelogSection`, `npmUrl` and `MAX_NOTES`. The script `scripts/release/tags.ts` keeps the same rule, and a test compares the two.
|
|
318
320
|
- `RULES` and each rule, with the helpers `isGitSpecifier`, `isPinned`, `isSourcePath` and `parseJsonc`.
|
package/build/cli.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -267,6 +267,16 @@ export declare function convertGate(text: string, file: string, commit?: string)
|
|
|
267
267
|
reason: string;
|
|
268
268
|
};
|
|
269
269
|
export declare const gateTrigger: Rule;
|
|
270
|
+
/** The path of the security gate in a repository. */
|
|
271
|
+
export declare const SECURITY_FILE: string;
|
|
272
|
+
/**
|
|
273
|
+
* This function tells if a workflow is a security gate. A security gate has a job `Security OK`, a step with the action
|
|
274
|
+
* security-scan, or a job that uses the shared workflow of the scans. It reads each line with the reader of the workflows.
|
|
275
|
+
*/
|
|
276
|
+
export declare function isSecurityGate(text: string): boolean;
|
|
277
|
+
/** This function gives the security gate of a repository. It is the file of the template, with the pin of the action and the minute of the repository. */
|
|
278
|
+
export declare function securityWorkflow(repository: string, commit?: string): string;
|
|
279
|
+
export declare const securityGate: Rule;
|
|
270
280
|
/** The first commit of the template with the action `security-scan` (pull request 206). Renovate and the template sync move the pin after the fix. */
|
|
271
281
|
export declare const SECURITY_SCAN_COMMIT: string;
|
|
272
282
|
/** The inputs of the action `security-scan`. The shared workflow has the same inputs and also `timeout-minutes`. */
|
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/summary-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/publish-text-safe.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/job-fails.ts","../src/rules/playwright-install.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/workflow.ts","../src/rules/workflow-parses.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/run.ts","../src/pre-push.ts","../src/home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,gBAAgB,SAAS;;qBCrGxD;qBA4FA,WAAW;qBC5CX,iBAAiB;;UCzCb;WACN;WACA;WACA;;;wBAIK,cAAc,eAAe;;qBAoBhC;;wBAyBG,YAAY;;wBAaZ,cAAc,SAAS,wCAAwC,KAAK,sBAAsB;;UAczF;WACN;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;;;wBAIK,WAAW,GAAG;;;;;;;wBA2Bd,YAAY,cAAc,cAAc;EAAoC;;EAAmB;;qBA+GlG,aAAa;;
|
|
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-gate.ts","../src/rules/security-one-job.ts","../src/rules/summary-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/publish-text-safe.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/job-fails.ts","../src/rules/playwright-install.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/workflow.ts","../src/rules/workflow-parses.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/run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WAEf,iBAAiB;;WAEjB;;;wBAaK,WAAW,cAAc,iBAAgB,SAAiB;;wBAO1D,cAAc,cAAc,QAAQ,mBAAmB,UAAS,KAAK,0CAA+C;;wBAwCpH,UAAU,SAAS,eAAe;;UAkEjC;;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA4BrB,gBAAgB,QAAQ;;;;;;wBA2BxB,YAAY,QAAQ;;wBAapB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;WAET;;;qBAIE;;wBAwEG,OAAO,yBAAyB,IAAI;;qBChYvC;;UAGI;;WAEN;;;;;WAKA;;;;;WAKA;;;;;WAKA;;WAEA;WACA,KAAK,SAAS;;WAEd;;WAEA,MAAM;;WAEN,YAAY;;;;;;;;;;;;wBA0MP,QAAQ,SAAS,gBAAgB,IAAI,KAAK;;UA6GzC;;WAEN;WACA;WACA;WACA;;;;;;wBAOK,iBAAiB,0BAA0B;;;;;wBAuB3C,eAAe,MAAM,aAAa,IAAI,KAAK;;qBAS9C;;;;;;;;qBAgCA;;UAgBI;;WAEN;WACA,KAAK,SAAS;;WAEd,MAAM;;;;;;;wBAQD,YAAY,SAAS,aAAa,IAAI,KAAK;;qBCnd9C,cAAc,SAAS;WAA0B;WAA0B;;;;;;;;;qBCM3E;;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 unreleasedChange, $n as
|
|
1
|
+
import { $ as unreleasedChange, $n as summaryJob, $t as homePackage, A as scriptsOf, An as addSummaryJob, At as privateTextBreaks, B as roadmapOfLine, Bn as runnerBudget, Bt as parsePrivateNames, C as setVersions, Cn as sharedCi, Cr as runGitShow, Ct as PRIVATE_NAMES_FILE_VARIABLE, D as trustPolicy, Dn as securityGate, Dr as parseConfig, Dt as privateNamesFile, E as TRAIN_SCOPES, En as isSecurityGate, Er as defaultOptions, Et as noLocalPaths, F as sourceMain, Fn as SECURITY_SCAN_INPUTS, Ft as isCommonUse, G as minorOf, Gn as licenseFileOf, Gt as mainCheck, H as requiredScripts, Hn as LICENSE_TEXTS, Ht as noBuildOutput, I as HOME_TIMEOUT_MS, In as SECURITY_TIMEOUT_MINUTES, It as lineNameHit, J as reachOf, Jn as ACTIONS_COMMIT, Jt as homeModule, K as publishedMinor, Kn as mitText, Kt as coverageProvider, L as blockHash, Ln as securityCallers, Lt as lineNameHits, M as testsRequired, Mn as startsOnPullRequest, Mt as PrivateNameListError, N as isSourcePath, Nn as summaryJobRule, Nt as firstNameMatch, O as typedScripts, On as securityWorkflow, Or as parseRuleConfig, Ot as privateNamesFiles, P as pathsOf, Pn as SECURITY_SCAN_COMMIT, Pt as isAllowedHit, Q as npmLookup, Qn as skippableJobs, Qt as declaredName, R as githubFetch, Rn as securityOneJob, Rt as mergePrivateNames, S as namedVersions, Sn as callsSharedCi, Sr as runGit, St as PRIVATE_NAMES_FILE_CONFIG, T as IGNORE_AFTER, Tn as SECURITY_FILE, Tr as specifiersOf, Tt as invalidPatternBreaks, U as releaseFiles, Un as authorOf, Ut as REAL_COMPARE, V as roadmapParses, Vn as scheduleMinute, Vt as pathNameHit, W as lockedVersions, Wn as licenseFile, Wt as hasImportMetaMain, X as SHIPPED_FIELDS, Xn as gateTrigger, Xt as moduleUses, Y as NPM_REGISTRY, Yn as convertGate, Yt as moduleMessage, Z as UNSHIPPED_FILES, Zn as prPathFilters, Zt as modulesOf, _ as runPrePushArgs, _n as hasTests, _r as parseCatFileBatch, _t as exportsRequire, a as listRules, an as HOMES, ar as yamlFaults, at as startsTests, b as GITHUB_YAML, bn as SHARED_CI, br as replaceLine, bt as DEFAULT_ALLOWED, c as runCli, cn as mapMarkdown, cr as DEPENDENCY_FIELDS, ct as isGitSpecifier, d as HOOK_MARKER, dn as npmDrift, dr as codePackages, dt as siteCheckInCi, en as messageOf, er as summaryName, et as unreleasedChangeRule, f as NO_READ_LINE, fn as npmNames, fr as hasFile, ft as pagesAfterRelease, g as prePush, gn as serviceRunMain, gr as matchesAny, gt as pagesSite, h as parsePrePushArgs, hn as runCalls, hr as lineOf, ht as pagesCalls, i as formatResult, in as HOME_EXPORTS, ir as readWorkflow, it as parseAdvisory, j as typedFiles, jn as hasSummaryJob, jt as PRIVATE_NAME_LIST, k as configsOfScript, kn as SUMMARY_GATES, kt as privatePatterns, l as runFix, ln as mapText, lr as RULE_WARN_DAYS, lt as isPinned, m as installHook, mn as SERVICE_PACKAGE, mr as keyLine, mt as PAGES_WORKFLOWS, n as annotations, nn as reposOf, nr as parseWorkflow, nt as hiddenFailures, o as readConfig, on as MAP_RULE, or as STRICT_OPTIONS, ot as swallowsTests, p as PRE_PUSH_HOOK, pn as readOverlay, pr as inFolder, pt as pushMainOnly, q as publishedMinorRule, qn as repositoryIsPublic, qt as apiReportScript, r as createContext, rn as signaturesOf, rr as readAction, rt as jobFails, s as runChecks, sn as findHomes, sr as cuePreset, st as pipeFails, t as USAGE, tn as repoOf, tr as gateAfterCancel, tt as playwrightInstall, u as summaryMarkdown, un as mergeHomes, ur as cleanPath, ut as pinnedGitDeps, v as RULES, vn as tsconfigTest, vr as parseJsonc, vt as publishTextSafe, w as versionTitle, wn as setupCue, wr as showFiles, wt as PRIVATE_PATTERNS_VARIABLE, x as workflowParses, xn as SHARED_WORKFLOWS, xr as repositoryOfRemote, xt as HOME_PATTERNS, y as workspaceProtocol, yn as SHARED_ACTIONS, yr as readJsonc, yt as packNoBuildinfo, z as sharedDocsRule, zn as withOneJob, zt as nameMatches } from "./run-DRCOlvNx.js";
|
|
2
2
|
import { OWNERS, ownerOf, ownersOf, repoKeyer, sharedNames } from "./owners.js";
|
|
3
3
|
import { a as packageFolders, i as isWorkspaceFolder, l as workspaceGlobs, n as globFolders, o as parseWorkspaceGlobs, r as globToRegExp } from "./workspace-_CIq-8ei.js";
|
|
4
4
|
// src/release-text.ts
|
|
@@ -66,6 +66,6 @@ function releaseNotes(name, version, changelog) {
|
|
|
66
66
|
if (section.length <= 1e5) return section;
|
|
67
67
|
return `${section.slice(0, MAX_NOTES)}\n\n(The CHANGELOG.md of \`${name}\` has the full text.)`;
|
|
68
68
|
}
|
|
69
|
-
export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, GITHUB_YAML, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, HOOK_MARKER, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NO_READ_LINE, NPM_REGISTRY, OWNERS, PAGES_WORKFLOWS, PRE_PUSH_HOOK, PRIVATE_NAMES_FILE_CONFIG, PRIVATE_NAMES_FILE_VARIABLE, PRIVATE_NAME_LIST, PRIVATE_PATTERNS_VARIABLE, PrivateNameListError, REAL_COMPARE, RULES, RULE_WARN_DAYS, SECURITY_SCAN_COMMIT, SECURITY_SCAN_INPUTS, SECURITY_TIMEOUT_MINUTES, SERVICE_PACKAGE, SHARED_ACTIONS, SHARED_CI, SHARED_WORKFLOWS, SHIPPED_FIELDS, STRICT_OPTIONS, SUMMARY_GATES, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, addSummaryJob, annotations, apiReportScript, authorOf, blockHash, callsSharedCi, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, coverageProvider, createContext, cuePreset, declaredName, defaultOptions, exportsRequire, findHomes, firstNameMatch, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasSummaryJob, hasTests, hiddenFailures, homeModule, homePackage, inFolder, installHook, invalidPatternBreaks, isAllowedHit, isCommonUse, isGitSpecifier, isPinned, isSourcePath, isWorkspaceFolder, jobFails, keyLine, licenseFile, licenseFileOf, lineNameHit, lineNameHits, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, mergePrivateNames, messageOf, minorOf, mitText, moduleMessage, moduleUses, modulesOf, nameMatches, namedVersions, noBuildOutput, noLocalPaths, npmDrift, npmLookup, npmNames, npmUrl, ownerOf, ownersOf, packNoBuildinfo, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseAdvisory, parseCatFileBatch, parseConfig, parseJsonc, parsePrePushArgs, parsePrivateNames, parseRuleConfig, parseWorkflow, parseWorkspaceGlobs, pathNameHit, pathsOf, pinnedGitDeps, pipeFails, playwrightInstall, prPathFilters, prePush, privateNamesFile, privateNamesFiles, privatePatterns, privateTextBreaks, publishTextSafe, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readAction, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoKeyer, repoOf, reposOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runCalls, runChecks, runCli, runFix, runGit, runGitShow, runPrePushArgs, runnerBudget, scheduleMinute, scriptsOf, securityCallers, securityOneJob, serviceRunMain, setVersions, setupCue, sharedCi, sharedDocsRule, sharedNames, showFiles, signaturesOf, siteCheckInCi, skippableJobs, sourceMain, specifiersOf, startsOnPullRequest, startsTests, summaryJob, summaryJobRule, summaryMarkdown, summaryName, swallowsTests, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, versionTitle, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
69
|
+
export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, GITHUB_YAML, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, HOOK_MARKER, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NO_READ_LINE, NPM_REGISTRY, OWNERS, PAGES_WORKFLOWS, PRE_PUSH_HOOK, PRIVATE_NAMES_FILE_CONFIG, PRIVATE_NAMES_FILE_VARIABLE, PRIVATE_NAME_LIST, PRIVATE_PATTERNS_VARIABLE, PrivateNameListError, REAL_COMPARE, RULES, RULE_WARN_DAYS, SECURITY_FILE, SECURITY_SCAN_COMMIT, SECURITY_SCAN_INPUTS, SECURITY_TIMEOUT_MINUTES, SERVICE_PACKAGE, SHARED_ACTIONS, SHARED_CI, SHARED_WORKFLOWS, SHIPPED_FIELDS, STRICT_OPTIONS, SUMMARY_GATES, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, addSummaryJob, annotations, apiReportScript, authorOf, blockHash, callsSharedCi, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, coverageProvider, createContext, cuePreset, declaredName, defaultOptions, exportsRequire, findHomes, firstNameMatch, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasSummaryJob, hasTests, hiddenFailures, homeModule, homePackage, inFolder, installHook, invalidPatternBreaks, isAllowedHit, isCommonUse, isGitSpecifier, isPinned, isSecurityGate, isSourcePath, isWorkspaceFolder, jobFails, keyLine, licenseFile, licenseFileOf, lineNameHit, lineNameHits, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, mergePrivateNames, messageOf, minorOf, mitText, moduleMessage, moduleUses, modulesOf, nameMatches, namedVersions, noBuildOutput, noLocalPaths, npmDrift, npmLookup, npmNames, npmUrl, ownerOf, ownersOf, packNoBuildinfo, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseAdvisory, parseCatFileBatch, parseConfig, parseJsonc, parsePrePushArgs, parsePrivateNames, parseRuleConfig, parseWorkflow, parseWorkspaceGlobs, pathNameHit, pathsOf, pinnedGitDeps, pipeFails, playwrightInstall, prPathFilters, prePush, privateNamesFile, privateNamesFiles, privatePatterns, privateTextBreaks, publishTextSafe, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readAction, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoKeyer, repoOf, reposOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runCalls, runChecks, runCli, runFix, runGit, runGitShow, runPrePushArgs, runnerBudget, scheduleMinute, scriptsOf, securityCallers, securityGate, securityOneJob, securityWorkflow, serviceRunMain, setVersions, setupCue, sharedCi, sharedDocsRule, sharedNames, showFiles, signaturesOf, siteCheckInCi, skippableJobs, sourceMain, specifiersOf, startsOnPullRequest, startsTests, summaryJob, summaryJobRule, summaryMarkdown, summaryName, swallowsTests, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, versionTitle, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
70
70
|
|
|
71
71
|
//# sourceMappingURL=index.js.map
|
package/build/owners.d.ts
CHANGED
|
@@ -46,6 +46,8 @@ export interface RepoRef {
|
|
|
46
46
|
* - The records of a name that one owner has keep the key that they had before the second owner came.
|
|
47
47
|
* - Two repositories with one name become two records, so a fork in the other owner stops no reader.
|
|
48
48
|
* - The key of a repository that is not in the list is its name, unless the list has its name with more than one owner.
|
|
49
|
+
* - The separator is `/` by default. A key for a file name or a database id takes a separator that no login and no name has, for example `~`.
|
|
50
|
+
* - A separator that a login or a name can have gives an error, because two keys can then be equal.
|
|
49
51
|
*/
|
|
50
|
-
export declare function repoKeyer(repos: readonly RepoRef[]): (repo: RepoRef) => string;
|
|
52
|
+
export declare function repoKeyer(repos: readonly RepoRef[], separator?: string): (repo: RepoRef) => string;
|
|
51
53
|
//# sourceMappingURL=owners.d.ts.map
|
package/build/owners.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owners.d.ts","names":[],"sources":["../src/owners.ts"],"mappings":";;;;;;;iBAQiB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;qBAOE,iBAAiB;;wBAMd,QAAQ,gBAAgB;;wBAKxB,SAAS;;;;;;wBAaT,YAAY,gBAAgB;;iBAa3B;;WAEN;;WAEA
|
|
1
|
+
{"version":3,"file":"owners.d.ts","names":[],"sources":["../src/owners.ts"],"mappings":";;;;;;;iBAQiB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;qBAOE,iBAAiB;;wBAMd,QAAQ,gBAAgB;;wBAKxB,SAAS;;;;;;wBAaT,YAAY,gBAAgB;;iBAa3B;;WAEN;;WAEA;;;;;;;;;;;;wBAaK,UAAU,gBAAgB,WAAW,sBAA2B,MAAM"}
|
package/build/owners.js
CHANGED
|
@@ -45,10 +45,13 @@ function sharedNames(repos) {
|
|
|
45
45
|
* - The records of a name that one owner has keep the key that they had before the second owner came.
|
|
46
46
|
* - Two repositories with one name become two records, so a fork in the other owner stops no reader.
|
|
47
47
|
* - The key of a repository that is not in the list is its name, unless the list has its name with more than one owner.
|
|
48
|
+
* - The separator is `/` by default. A key for a file name or a database id takes a separator that no login and no name has, for example `~`.
|
|
49
|
+
* - A separator that a login or a name can have gives an error, because two keys can then be equal.
|
|
48
50
|
*/
|
|
49
|
-
function repoKeyer(repos) {
|
|
51
|
+
function repoKeyer(repos, separator = "/") {
|
|
52
|
+
if (separator === "" || /[A-Za-z0-9._-]/u.test(separator)) throw new Error(`The separator "${separator}" is empty or has a character that a login or a repository name can have.`);
|
|
50
53
|
const shared = new Set(sharedNames(repos));
|
|
51
|
-
return (repo) => shared.has(repo.name.toLowerCase()) ? `${repo.owner}
|
|
54
|
+
return (repo) => shared.has(repo.name.toLowerCase()) ? `${repo.owner}${separator}${repo.name}` : repo.name;
|
|
52
55
|
}
|
|
53
56
|
export { OWNERS, ownerOf, ownersOf, repoKeyer, sharedNames };
|
|
54
57
|
|
package/build/owners.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owners.js","names":[],"sources":["../src/owners.ts"],"sourcesContent":["/**\n * The owners of the repositories: the GitHub accounts that hold them. Each account has its own pool of concurrent jobs, so\n * a repository can move from one owner to the other. A reader of all repositories reads each owner, and a gate of the\n * runners keeps one lane for each owner. Thus no reader names an owner in its code. This file has no import, so a workflow\n * with a sparse checkout and no install can import it from the source.\n */\n\n/** A GitHub account that holds repositories. */\nexport interface Owner {\n /** The login of the account. */\n readonly login: string;\n /** The kind of the account. The path `users/<login>/repos` of the API lists the repositories of both kinds. */\n readonly kind: \"user\" | \"organization\";\n /** The plan of the account. */\n readonly plan: \"pro\" | \"team\";\n /** The concurrent jobs of the plan: 40 for GitHub Pro, 60 for an organization on GitHub Team. */\n readonly jobs: number;\n /** The concurrent macOS jobs of the plan. */\n readonly macos: number;\n}\n\n/**\n * The owners, the personal account first. The organization got the plan Team on 2026-11-16, with its own pool of 60 jobs.\n * An owner with no public repository adds no read.\n */\nexport const OWNERS: readonly Owner[] = [\n { login: \"mark1russell7\", kind: \"user\", plan: \"pro\", jobs: 40, macos: 5 },\n { login: \"metrograph-labs\", kind: \"organization\", plan: \"team\", jobs: 60, macos: 5 },\n];\n\n/** This function gives the owner with this login, with no regard to case, or undefined. */\nexport function ownerOf(login: string): Owner | undefined {\n return OWNERS.find((owner) => owner.login.toLowerCase() === login.toLowerCase());\n}\n\n/** This function reads a list of logins with commas. An empty value gives the login of each owner of `OWNERS`. */\nexport function ownersOf(value: string | undefined): string[] {\n const named = (value ?? \"\")\n .split(\",\")\n .map((login) => login.trim())\n .filter(Boolean);\n return named.length > 0 ? [...new Set(named)] : OWNERS.map((owner) => owner.login);\n}\n\n/**\n * This function gives each repository name that more than one owner has, in lower case and in order. If a reader keys its\n * records by the name alone, the two repositories of such a name become one record. Thus the reader takes its keys from\n * `repoKeyer`.\n */\nexport function sharedNames(repos: readonly RepoRef[]): string[] {\n const owners = new Map<string, Set<string>>();\n for (const repo of repos) {\n const name = repo.name.toLowerCase();\n owners.set(name, (owners.get(name) ?? new Set<string>()).add(repo.owner.toLowerCase()));\n }\n return [...owners]\n .filter(([, logins]) => logins.size > 1)\n .map(([name]) => name)\n .sort();\n}\n\n/** A repository: the login of its owner and its name, as the API gives them. */\nexport interface RepoRef {\n /** The login of the owner. */\n readonly owner: string;\n /** The name of the repository. */\n readonly name: string;\n}\n\n/**\n * This function gives the record key of each repository of a list. The key is the name when one owner has the name, and\n * `owner/name` when more than one owner has it (see `sharedNames`).\n *\n * - The records of a name that one owner has keep the key that they had before the second owner came.\n * - Two repositories with one name become two records, so a fork in the other owner stops no reader.\n * - The key of a repository that is not in the list is its name, unless the list has its name with more than one owner.\n */\nexport function repoKeyer(repos: readonly RepoRef[]): (repo: RepoRef) => string {\n const shared = new Set(sharedNames(repos));\n return (repo) => (shared.has(repo.name.toLowerCase()) ? `${repo.owner}
|
|
1
|
+
{"version":3,"file":"owners.js","names":[],"sources":["../src/owners.ts"],"sourcesContent":["/**\n * The owners of the repositories: the GitHub accounts that hold them. Each account has its own pool of concurrent jobs, so\n * a repository can move from one owner to the other. A reader of all repositories reads each owner, and a gate of the\n * runners keeps one lane for each owner. Thus no reader names an owner in its code. This file has no import, so a workflow\n * with a sparse checkout and no install can import it from the source.\n */\n\n/** A GitHub account that holds repositories. */\nexport interface Owner {\n /** The login of the account. */\n readonly login: string;\n /** The kind of the account. The path `users/<login>/repos` of the API lists the repositories of both kinds. */\n readonly kind: \"user\" | \"organization\";\n /** The plan of the account. */\n readonly plan: \"pro\" | \"team\";\n /** The concurrent jobs of the plan: 40 for GitHub Pro, 60 for an organization on GitHub Team. */\n readonly jobs: number;\n /** The concurrent macOS jobs of the plan. */\n readonly macos: number;\n}\n\n/**\n * The owners, the personal account first. The organization got the plan Team on 2026-11-16, with its own pool of 60 jobs.\n * An owner with no public repository adds no read.\n */\nexport const OWNERS: readonly Owner[] = [\n { login: \"mark1russell7\", kind: \"user\", plan: \"pro\", jobs: 40, macos: 5 },\n { login: \"metrograph-labs\", kind: \"organization\", plan: \"team\", jobs: 60, macos: 5 },\n];\n\n/** This function gives the owner with this login, with no regard to case, or undefined. */\nexport function ownerOf(login: string): Owner | undefined {\n return OWNERS.find((owner) => owner.login.toLowerCase() === login.toLowerCase());\n}\n\n/** This function reads a list of logins with commas. An empty value gives the login of each owner of `OWNERS`. */\nexport function ownersOf(value: string | undefined): string[] {\n const named = (value ?? \"\")\n .split(\",\")\n .map((login) => login.trim())\n .filter(Boolean);\n return named.length > 0 ? [...new Set(named)] : OWNERS.map((owner) => owner.login);\n}\n\n/**\n * This function gives each repository name that more than one owner has, in lower case and in order. If a reader keys its\n * records by the name alone, the two repositories of such a name become one record. Thus the reader takes its keys from\n * `repoKeyer`.\n */\nexport function sharedNames(repos: readonly RepoRef[]): string[] {\n const owners = new Map<string, Set<string>>();\n for (const repo of repos) {\n const name = repo.name.toLowerCase();\n owners.set(name, (owners.get(name) ?? new Set<string>()).add(repo.owner.toLowerCase()));\n }\n return [...owners]\n .filter(([, logins]) => logins.size > 1)\n .map(([name]) => name)\n .sort();\n}\n\n/** A repository: the login of its owner and its name, as the API gives them. */\nexport interface RepoRef {\n /** The login of the owner. */\n readonly owner: string;\n /** The name of the repository. */\n readonly name: string;\n}\n\n/**\n * This function gives the record key of each repository of a list. The key is the name when one owner has the name, and\n * `owner/name` when more than one owner has it (see `sharedNames`).\n *\n * - The records of a name that one owner has keep the key that they had before the second owner came.\n * - Two repositories with one name become two records, so a fork in the other owner stops no reader.\n * - The key of a repository that is not in the list is its name, unless the list has its name with more than one owner.\n * - The separator is `/` by default. A key for a file name or a database id takes a separator that no login and no name has, for example `~`.\n * - A separator that a login or a name can have gives an error, because two keys can then be equal.\n */\nexport function repoKeyer(repos: readonly RepoRef[], separator: string = \"/\"): (repo: RepoRef) => string {\n if (separator === \"\" || /[A-Za-z0-9._-]/u.test(separator)) {\n throw new Error(`The separator \"${separator}\" is empty or has a character that a login or a repository name can have.`);\n }\n const shared = new Set(sharedNames(repos));\n return (repo) => (shared.has(repo.name.toLowerCase()) ? `${repo.owner}${separator}${repo.name}` : repo.name);\n}\n"],"mappings":";;;;;AAyBA,MAAa,SAA2B,CACtC;CAAE,OAAO;CAAiB,MAAM;CAAQ,MA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