@mark1russell7/conventions 0.35.0 → 0.36.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 +1 -0
- package/build/cli.js +1 -1
- package/build/index.d.ts +5 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/{run-Do3z3eKR.js → run-D3xtuVA_.js} +150 -4
- package/build/run-D3xtuVA_.js.map +1 -0
- package/package.json +1 -1
- package/build/run-Do3z3eKR.js.map +0 -1
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
53
53
|
| `no-local-paths` | No tracked file has the home folder of a user: `C:\Users\<name>`, `/Users/<name>` or `/home/<name>`. A CI user (`runner`), a name of one character and a placeholder (`<you>`) are not a break. | client `I12`. systems `no-identifying-names`, `no-private-identifiers`, `no-private-names`. coeval `no-private-names`. |
|
|
54
54
|
| `release-files` | A pull request changes `.github/workflows/release.yml` or `scripts/release/` only with a line `Release-Edit: <reason>` in a commit message or in the body of the pull request. The commits of the release bot (the sync of the template) need no reason. | coeval `no-release-edit`, `no-release-edits`. crawler `no-release-edit`, `no-release-edits`. headroom `no-release-edits`, `release-files-frozen`. |
|
|
55
55
|
| `unreleased-change` | A change does not set a version that npm has: the release skips such a version. The rule compares the version of the head of the change with the version of its merge base, so a version that only the base branch changed does not count. A repository where each pull request sets its version sets the option `versionEachChange`. Then a change of the shipped files also raises the version, when npm has that version already. The files that ship are the files of the folder of the package, without the tests, the fixtures, the Markdown files and the configs (the option `unshipped`). When git tracks each entry of the field `files`, only those entries ship. A change of `package.json` ships when a field of the option `fields` changes, for example `exports`, but not the dependencies. On a push to the default branch, a version that the push sets breaks only when npm had it before the push. The release of the same push can publish it. An error of the registry makes the rule show `skip`. A repository with `.changeset/config.json`, a private package and a version `0.0.0` or `0.0.0-<stage>` are not examined. | rigor #18 and #20 (2026-11-02): two pull requests set the same version, and the second change did not get to npm. crawler, coeval, template `release.yml`. |
|
|
56
|
+
| `version-title` | A merge whose title names a version sets a version in a `package.json`. A title names a version in parentheses at its end, for example `(0.3.3)` before the `(#212)` of a squash, or after `Release` at its start. On a push to the default branch, the rule examines each commit of the first-parent line against its first parent. On a pull request, it reads the title of the event file and examines the merge commit against the base. A title with no version passes. A title that names an other version than the version that the merge sets also passes, because the change gets a release. | template #212 (`5933b34`) and #215 (`e077054`), 2026-11-06: both set `site-pages` 0.3.3, so the squash of #215 changed no `package.json`, and no release started. Template #162 and #164 (2026-11-04) did the same with 0.2.5. crawler, coeval `release.yml`. |
|
|
56
57
|
| `published-minor` | A consumer does not stay behind the newest published minor of a package that the option `packages` names. The rule compares each range, and each version of `pnpm-lock.yaml`, with the tag `latest` of npm. A caret range of a `0.x` version cannot reach the next minor. With no `packages`, the rule does not start. | a consumer that stayed behind a published minor |
|
|
57
58
|
| `changelog-version` | The top version section of the changelog of a package (`CHANGELOG.md` in its folder) is not above the version of its `package.json`. A section "Unreleased" does not count. With the option `everyVersion`, the top section is the same version. On 2026-11-03 a pull request added the section 0.5.0 with two breaking changes and left `package.json` at 0.4.1. A change of a dependency range then made the train plan the PATCH 0.4.2. | packing #249 and #253, release-train (2026-11-03). |
|
|
58
59
|
| `typed-scripts` | Git keeps no JavaScript source (`.js`, `.mjs`, `.cjs`, `.jsx`, or a file with a `#!` line of `node`) and no shell script (`.sh`, `.bash`, `.zsh`, `.ps1`, or a `#!` line of a shell) of more than one line of code. Each script is TypeScript, which Node 22.18 and later starts directly. A file that must stay (generated output, vendored code, a configuration that a tool reads only as JavaScript) goes in `ignore` with its reason, so the list of exceptions can only get shorter. | private `typed-everything` (STRATEGY.md, direction 15). |
|
package/build/cli.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -406,6 +406,11 @@ export declare const TRAIN_SCOPES: readonly ["@mark1russell7/*", "@procedures/*"
|
|
|
406
406
|
/** 7 days, in minutes. */
|
|
407
407
|
export declare const IGNORE_AFTER = 10080;
|
|
408
408
|
export declare const trustPolicy: Rule;
|
|
409
|
+
/** This function gives the versions that a title names, in their order, each one time. */
|
|
410
|
+
export declare function namedVersions(title: string): string[];
|
|
411
|
+
/** This function gives the versions that the change from `from` to `to` sets: each `package.json` whose version changes. */
|
|
412
|
+
export declare function setVersions(context: RuleContext, from: string, to: string): string[] | undefined;
|
|
413
|
+
export declare const versionTitle: Rule;
|
|
409
414
|
/** A file that GitHub reads as YAML: a workflow, or the file `action.yml` of an action of the repository. */
|
|
410
415
|
export declare const GITHUB_YAML: RegExp;
|
|
411
416
|
/** A fault of the YAML of a file: its line and column (from 1), and the first line of the message of the parser. */
|
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/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/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.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/workflow-parses.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/release-text.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;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nC,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;;wBCmDX,gBAAgB;;;;;wBAmChB,UACd,SAAS,SAAS,0BAClB,cACA,OAAM;qBAkRK,YAAY;qBC/VZ,cAAc;;qBC3Bd;;qBAGA;qBA6DA,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-one-job.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/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.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/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/release-text.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cA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AK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6CG,OAAO,yBAAyB,IAAI;;;;;;;;qBChUvC;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB;;;;;;wBCzC5C,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isPinned, $t as codePackages, A as pathsOf, At as findHomes, B as lockedVersions, Bt as securityOneJob, C as configsOfScript, Ct as declaredName, D as hasTests, Dt as signaturesOf, E as testsRequired, Et as repoOf, F as sharedDocsRule, Ft as HOME_EXPORTS, G as NPM_REGISTRY, Gt as prPathFilters, H as publishedMinor, Ht as ACTIONS_COMMIT, I as roadmapOfLine, It as SECURITY_SCAN_COMMIT, J as npmLookup, Jt as readWorkflow, K as SHIPPED_FIELDS, Kt as summaryName, L as roadmapParses, Lt as SECURITY_SCAN_INPUTS, M as HOME_TIMEOUT_MS, Mt as mapText, N as blockHash, Nt as mergeHomes, O as tsconfigTest, Ot as HOMES, P as githubFetch, Pt as readOverlay, Q as isGitSpecifier, Qt as cleanPath, R as requiredScripts, Rt as SECURITY_TIMEOUT_MINUTES, S as typedScripts, St as repositoryIsPublic, T as typedFiles, Tt as messageOf, U as publishedMinorRule, Ut as convertGate, V as minorOf, Vt as withOneJob, W as reachOf, Wt as gateTrigger, X as unreleasedChangeRule, Xt as cuePreset, Y as unreleasedChange, Yt as STRICT_OPTIONS, Z as pipeFails, Zt as DEPENDENCY_FIELDS, _ as setVersions, _t as LICENSE_TEXTS, a as listRules, an as parseJsonc, at as pushMainOnly, b as TRAIN_SCOPES, bt as licenseFileOf, c as runCli, cn as runGit, ct as pagesSite, d as RULES, dn as globToRegExp, dt as HOME_PATTERNS, en as hasFile, et as pinnedGitDeps, f as workspaceProtocol, fn as packageFolders, ft as noLocalPaths, g as namedVersions, gt as mainCheck, h as yamlFaults, hn as parseConfig, ht as hasImportMetaMain, i as formatResult, in as matchesAny, it as scheduleMinute, j as sourceMain, jt as mapMarkdown, k as isSourcePath, kt as MAP_RULE, l as runFix, ln as specifiersOf, lt as apiReportScript, m as workflowParses, mn as defaultOptions, mt as REAL_COMPARE, n as annotations, nn as keyLine, nt as repositoryOfRemote, o as readConfig, on as readJsonc, ot as PAGES_WORKFLOWS, p as GITHUB_YAML, pn as workspaceGlobs, pt as noBuildOutput, q as UNSHIPPED_FILES, qt as gateAfterCancel, r as createContext, rn as lineOf, rt as runnerBudget, s as runChecks, sn as replaceLine, st as pagesCalls, t as USAGE, tn as inFolder, tt as pagesAfterRelease, u as summaryMarkdown, un as globFolders, ut as DEFAULT_ALLOWED, v as versionTitle, vt as authorOf, w as scriptsOf, wt as homePackage, x as trustPolicy, xt as mitText, y as IGNORE_AFTER, yt as licenseFile, z as releaseFiles, zt as securityCallers } from "./run-D3xtuVA_.js";
|
|
2
2
|
// src/release-text.ts
|
|
3
3
|
/**
|
|
4
4
|
* The rule for the git tag and the text of a GitHub release of a package version.
|
|
@@ -64,6 +64,6 @@ function releaseNotes(name, version, changelog) {
|
|
|
64
64
|
if (section.length <= 1e5) return section;
|
|
65
65
|
return `${section.slice(0, MAX_NOTES)}\n\n(The CHANGELOG.md of \`${name}\` has the full text.)`;
|
|
66
66
|
}
|
|
67
|
-
export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, GITHUB_YAML, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SECURITY_SCAN_COMMIT, SECURITY_SCAN_INPUTS, SECURITY_TIMEOUT_MINUTES, SHIPPED_FIELDS, STRICT_OPTIONS, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, securityCallers, securityOneJob, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
67
|
+
export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, GITHUB_YAML, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SECURITY_SCAN_COMMIT, SECURITY_SCAN_INPUTS, SECURITY_TIMEOUT_MINUTES, SHIPPED_FIELDS, STRICT_OPTIONS, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, namedVersions, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, securityCallers, securityOneJob, setVersions, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, versionTitle, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
68
68
|
|
|
69
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -311,10 +311,10 @@ function codePackages(context) {
|
|
|
311
311
|
return context.packages.length > 0 ? context.packages : [context.rootPackage];
|
|
312
312
|
}
|
|
313
313
|
// ../site-pages/src/data/versions.ts
|
|
314
|
-
const SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
314
|
+
const SEMVER$1 = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
315
315
|
/** This function gives the parts of a version, or null when the text is not a SemVer version. */
|
|
316
316
|
function parseVersion(version) {
|
|
317
|
-
const match = SEMVER.exec(version);
|
|
317
|
+
const match = SEMVER$1.exec(version);
|
|
318
318
|
if (!match) return null;
|
|
319
319
|
return {
|
|
320
320
|
major: Number(match[1]),
|
|
@@ -12552,6 +12552,151 @@ const trustPolicy = {
|
|
|
12552
12552
|
return breaks;
|
|
12553
12553
|
}
|
|
12554
12554
|
};
|
|
12555
|
+
// src/rules/version-title.ts
|
|
12556
|
+
/**
|
|
12557
|
+
* The rule `version-title`: a merge whose title names a version sets that version in a `package.json`.
|
|
12558
|
+
*/
|
|
12559
|
+
/** A version of SemVer, with an optional pre-release. */
|
|
12560
|
+
const SEMVER = String.raw`\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?`;
|
|
12561
|
+
/**
|
|
12562
|
+
* The places of a version in a title. The first place is in parentheses at the end, before the number of a squash, for
|
|
12563
|
+
* example `feat: a rule (0.3.3) (#212)`. The second place is after "Release" at the start, for example `Release 0.23.0`.
|
|
12564
|
+
*/
|
|
12565
|
+
const NAMED = [new RegExp(String.raw`\((${SEMVER})\)(?:\s*\(#\d+\))?\s*$`), new RegExp(String.raw`^(?:[a-z]+(?:\([^)]*\))?!?:\s*)?release v?(${SEMVER})\b`, "i")];
|
|
12566
|
+
/** This function gives the versions that a title names, in their order, each one time. */
|
|
12567
|
+
function namedVersions(title) {
|
|
12568
|
+
const found = [];
|
|
12569
|
+
for (const pattern of NAMED) {
|
|
12570
|
+
const version = pattern.exec(title)?.[1];
|
|
12571
|
+
if (version !== void 0 && !found.includes(version)) found.push(version);
|
|
12572
|
+
}
|
|
12573
|
+
return found;
|
|
12574
|
+
}
|
|
12575
|
+
/** This function gives the version of a `package.json` at a commit, or undefined. */
|
|
12576
|
+
function versionAt(context, commit, file) {
|
|
12577
|
+
const text = context.git(["show", `${commit}:${file}`]);
|
|
12578
|
+
if (text === void 0) return void 0;
|
|
12579
|
+
try {
|
|
12580
|
+
const value = JSON.parse(text).version;
|
|
12581
|
+
return typeof value === "string" ? value : void 0;
|
|
12582
|
+
} catch {
|
|
12583
|
+
return;
|
|
12584
|
+
}
|
|
12585
|
+
}
|
|
12586
|
+
/** This function gives the versions that the change from `from` to `to` sets: each `package.json` whose version changes. */
|
|
12587
|
+
function setVersions(context, from, to) {
|
|
12588
|
+
const out = context.git([
|
|
12589
|
+
"diff",
|
|
12590
|
+
"--name-only",
|
|
12591
|
+
"--no-renames",
|
|
12592
|
+
from,
|
|
12593
|
+
to,
|
|
12594
|
+
"--",
|
|
12595
|
+
"package.json",
|
|
12596
|
+
"**/package.json"
|
|
12597
|
+
]);
|
|
12598
|
+
if (out === void 0) return void 0;
|
|
12599
|
+
const versions = [];
|
|
12600
|
+
for (const file of out.split(/\r?\n/).filter((line) => line !== "")) {
|
|
12601
|
+
const after = versionAt(context, to, file);
|
|
12602
|
+
if (after !== void 0 && after !== versionAt(context, from, file) && !versions.includes(after)) versions.push(after);
|
|
12603
|
+
}
|
|
12604
|
+
return versions;
|
|
12605
|
+
}
|
|
12606
|
+
/** This function gives the title of the pull request of the event file, or undefined. */
|
|
12607
|
+
function pullRequestTitle(context) {
|
|
12608
|
+
const file = context.env["GITHUB_EVENT_PATH"];
|
|
12609
|
+
if (file === void 0 || file === "" || !existsSync(file)) return void 0;
|
|
12610
|
+
try {
|
|
12611
|
+
const title = JSON.parse(readFileSync(file, "utf8")).pull_request?.title;
|
|
12612
|
+
return typeof title === "string" ? title : void 0;
|
|
12613
|
+
} catch {
|
|
12614
|
+
return;
|
|
12615
|
+
}
|
|
12616
|
+
}
|
|
12617
|
+
/**
|
|
12618
|
+
* This function gives the break of a title that names a version when the change sets no version, or undefined. A change
|
|
12619
|
+
* that sets an other version than its title gets a release, so it does not break.
|
|
12620
|
+
*/
|
|
12621
|
+
function breakOf(title, set, file, where) {
|
|
12622
|
+
const named = namedVersions(title);
|
|
12623
|
+
if (named.length === 0 || set.length > 0) return void 0;
|
|
12624
|
+
return {
|
|
12625
|
+
file,
|
|
12626
|
+
message: `${where} has the title "${title}", which names ${named.join(", ")}, but it sets no version. The release workflow starts only on a change of a version, so the change gets no release.`
|
|
12627
|
+
};
|
|
12628
|
+
}
|
|
12629
|
+
const versionTitle = {
|
|
12630
|
+
id: "version-title",
|
|
12631
|
+
title: "A merge whose title names a version, for example `(0.3.3)` or `Release 0.23.0`, sets a version in a `package.json`.",
|
|
12632
|
+
reason: "When two pull requests set the same version line, the second one merges with no conflict and changes no version. The release workflow starts only on a change of a version, so the change gets no release. Template #164 merged so on 2026-11-04, and #215 on 2026-11-06.",
|
|
12633
|
+
fix: "Set the next free version (SemVer) in a pull request, and correct the title. On a pull request, merge the base branch in first: the version that the title names is then the version that the merge sets.",
|
|
12634
|
+
sources: [
|
|
12635
|
+
{
|
|
12636
|
+
repo: "template",
|
|
12637
|
+
rule: "version-title",
|
|
12638
|
+
doc: "#212 (5933b34) and #215 (e077054), 2026-11-06: both set site-pages 0.3.3, and e077054 changed no package.json"
|
|
12639
|
+
},
|
|
12640
|
+
{
|
|
12641
|
+
repo: "template",
|
|
12642
|
+
rule: "version-title",
|
|
12643
|
+
doc: "#162 (9392d6e) and #164 (5b6d568), 2026-11-04: both set site-pages 0.2.5, and #166 released the change of #164 as 0.2.6"
|
|
12644
|
+
},
|
|
12645
|
+
{
|
|
12646
|
+
repo: "rigor",
|
|
12647
|
+
rule: "unreleased-change",
|
|
12648
|
+
doc: "pull requests #18 and #20 (2026-11-02): two pull requests set the same version"
|
|
12649
|
+
},
|
|
12650
|
+
...["crawler", "coeval"].map((repo) => ({
|
|
12651
|
+
repo,
|
|
12652
|
+
rule: "version-title",
|
|
12653
|
+
doc: ".github/workflows/release.yml (it starts on a push to main that changes a package.json)"
|
|
12654
|
+
}))
|
|
12655
|
+
],
|
|
12656
|
+
options: {},
|
|
12657
|
+
check(context) {
|
|
12658
|
+
const event = context.env["GITHUB_EVENT_NAME"];
|
|
12659
|
+
if (context.base === void 0 && (event === "pull_request" || event === "pull_request_target")) {
|
|
12660
|
+
const title = pullRequestTitle(context);
|
|
12661
|
+
if (title === void 0) return { skipped: "the event file has no title of the pull request" };
|
|
12662
|
+
const range = rangeOf(context);
|
|
12663
|
+
if ("skipped" in range) return range;
|
|
12664
|
+
const set = setVersions(context, range.ends[0], "HEAD");
|
|
12665
|
+
if (set === void 0) return { skipped: "git cannot give the changed files of the pull request" };
|
|
12666
|
+
const found = breakOf(title, set, "package.json", "The pull request");
|
|
12667
|
+
return found === void 0 ? [] : [found];
|
|
12668
|
+
}
|
|
12669
|
+
const range = rangeOf(context, { push: true });
|
|
12670
|
+
if ("skipped" in range) return range;
|
|
12671
|
+
const out = context.git([
|
|
12672
|
+
"rev-list",
|
|
12673
|
+
"--first-parent",
|
|
12674
|
+
...range.log
|
|
12675
|
+
]);
|
|
12676
|
+
if (out === void 0) return { skipped: "git cannot give the commits of the change" };
|
|
12677
|
+
const breaks = [];
|
|
12678
|
+
for (const commit of out.split(/\r?\n/).filter((line) => line !== "")) {
|
|
12679
|
+
const title = context.git([
|
|
12680
|
+
"log",
|
|
12681
|
+
"-1",
|
|
12682
|
+
"--format=%s",
|
|
12683
|
+
commit
|
|
12684
|
+
])?.trim();
|
|
12685
|
+
if (title === void 0 || namedVersions(title).length === 0) continue;
|
|
12686
|
+
if (context.git([
|
|
12687
|
+
"rev-parse",
|
|
12688
|
+
"--verify",
|
|
12689
|
+
"--quiet",
|
|
12690
|
+
`${commit}^1^{commit}`
|
|
12691
|
+
]) === void 0) continue;
|
|
12692
|
+
const set = setVersions(context, `${commit}^1`, commit);
|
|
12693
|
+
if (set === void 0) continue;
|
|
12694
|
+
const found = breakOf(title, set, "package.json", `The commit ${commit.slice(0, 7)}`);
|
|
12695
|
+
if (found !== void 0) breaks.push(found);
|
|
12696
|
+
}
|
|
12697
|
+
return breaks;
|
|
12698
|
+
}
|
|
12699
|
+
};
|
|
12555
12700
|
// src/rules/workflow-parses.ts
|
|
12556
12701
|
/**
|
|
12557
12702
|
* The rule `workflow-parses`: each workflow file and each action file of `.github` parses as YAML.
|
|
@@ -12696,6 +12841,7 @@ const RULES = [
|
|
|
12696
12841
|
apiReportScript,
|
|
12697
12842
|
releaseFiles,
|
|
12698
12843
|
unreleasedChange,
|
|
12844
|
+
versionTitle,
|
|
12699
12845
|
publishedMinor,
|
|
12700
12846
|
changelogVersion,
|
|
12701
12847
|
typedScripts,
|
|
@@ -13147,6 +13293,6 @@ function runMap(args, io) {
|
|
|
13147
13293
|
else io.stdout(mapText(found));
|
|
13148
13294
|
return 0;
|
|
13149
13295
|
}
|
|
13150
|
-
export {
|
|
13296
|
+
export { isPinned as $, codePackages as $t, pathsOf as A, findHomes as At, lockedVersions as B, securityOneJob as Bt, configsOfScript as C, declaredName as Ct, hasTests as D, signaturesOf as Dt, testsRequired as E, repoOf as Et, sharedDocsRule as F, HOME_EXPORTS as Ft, NPM_REGISTRY as G, prPathFilters as Gt, publishedMinor as H, ACTIONS_COMMIT as Ht, roadmapOfLine as I, SECURITY_SCAN_COMMIT as It, npmLookup as J, readWorkflow as Jt, SHIPPED_FIELDS as K, summaryName as Kt, roadmapParses as L, SECURITY_SCAN_INPUTS as Lt, HOME_TIMEOUT_MS as M, mapText as Mt, blockHash as N, mergeHomes as Nt, tsconfigTest as O, HOMES as Ot, githubFetch as P, readOverlay as Pt, isGitSpecifier as Q, cleanPath as Qt, requiredScripts as R, SECURITY_TIMEOUT_MINUTES as Rt, typedScripts as S, repositoryIsPublic as St, typedFiles as T, messageOf as Tt, publishedMinorRule as U, convertGate as Ut, minorOf as V, withOneJob as Vt, reachOf as W, gateTrigger as Wt, unreleasedChangeRule as X, cuePreset as Xt, unreleasedChange as Y, STRICT_OPTIONS as Yt, pipeFails as Z, DEPENDENCY_FIELDS as Zt, setVersions as _, LICENSE_TEXTS as _t, listRules as a, parseJsonc as an, pushMainOnly as at, TRAIN_SCOPES as b, licenseFileOf as bt, runCli as c, runGit as cn, pagesSite as ct, RULES as d, globToRegExp as dn, HOME_PATTERNS as dt, hasFile as en, pinnedGitDeps as et, workspaceProtocol as f, packageFolders as fn, noLocalPaths as ft, namedVersions as g, mainCheck as gt, yamlFaults as h, parseConfig as hn, hasImportMetaMain as ht, formatResult as i, matchesAny as in, scheduleMinute as it, sourceMain as j, mapMarkdown as jt, isSourcePath as k, MAP_RULE as kt, runFix as l, specifiersOf as ln, apiReportScript as lt, workflowParses as m, defaultOptions as mn, REAL_COMPARE as mt, annotations as n, keyLine as nn, repositoryOfRemote as nt, readConfig as o, readJsonc as on, PAGES_WORKFLOWS as ot, GITHUB_YAML as p, workspaceGlobs as pn, noBuildOutput as pt, UNSHIPPED_FILES as q, gateAfterCancel as qt, createContext as r, lineOf as rn, runnerBudget as rt, runChecks as s, replaceLine as sn, pagesCalls as st, USAGE as t, inFolder as tn, pagesAfterRelease as tt, summaryMarkdown as u, globFolders as un, DEFAULT_ALLOWED as ut, versionTitle as v, authorOf as vt, scriptsOf as w, homePackage as wt, trustPolicy as x, mitText as xt, IGNORE_AFTER as y, licenseFile as yt, releaseFiles as z, securityCallers as zt };
|
|
13151
13297
|
|
|
13152
|
-
//# sourceMappingURL=run-
|
|
13298
|
+
//# sourceMappingURL=run-D3xtuVA_.js.map
|