@mark1russell7/conventions 0.40.1 → 0.40.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 +1 -0
- package/build/cli.js +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/{run-SgU_jdMt.js → run-8P3m1onp.js} +333 -36
- package/build/run-8P3m1onp.js.map +1 -0
- package/package.json +2 -2
- package/build/run-SgU_jdMt.js.map +0 -1
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
73
73
|
| `setup-cue` | No workflow or action installs the cue CLI with its own command (a download of a release asset of `cue-lang/cue`, or `go install`). A caller of `reusable-ci.yml` gives the input `cue-version`. Another job uses the action `setup-cue` of the template. The action installs the CLI from a cache, or with retries and a sha256 check. On 2026-11-08, a 504 of GitHub failed each bare `curl` of the CLI. |
|
|
74
74
|
| `gate-trigger` | No workflow has `paths` or `paths-ignore` on `on.pull_request` or `on.pull_request_target`. The ruleset needs the summary check `<Name> OK` of each gate, and a workflow with a path filter does not start on each pull request. Then its check is not there, the ruleset cannot ask for it, and a pull request can merge before the gate ends. A gate uses the actions `changes` and `gate-summary` of the template (`CI.md`, "A gate with paths"). | private `gate-trigger` (STRATEGY.md, 2026-11-02). |
|
|
75
75
|
| `license-file` | Each public package has a license field, and a license file with the same license in its own folder. A public repository, or a repository with a public package, has a license file at its root. In a GitHub Actions run, the event file tells if the repository is public, and the option `license` (MIT by default) is the license of a root with no public package. npm packs only the license file of the folder of the package, and GitHub reads only the one of the root: on 2026-11-02 five public repositories showed no license on GitHub while npm said MIT. `conventions fix` writes the missing files. | private strategy (2026-11-02). |
|
|
76
|
+
| `pack-no-buildinfo` | npm does not pack the build info file of tsc. The rule finds the file of each tsconfig of a public package after its `extends` chain. When `incremental` and `composite` are off, tsc writes no file. When an entry of `files` takes the file and no `!<path>` removes it, the rule breaks. A package with no field `files` packs each file, so it breaks too. The file changes on each build, and the release stops when the files of an unchanged version differ from npm. On 2026-11-09 this made the main of splay-react red. `conventions fix` adds the negation after its entry. A changed list of packed files needs a PATCH version. The rule fails from 2026-11-25. | splay-react `package.json` (1.0.2), splay `package.json`, cue `npm/package/ts.cue` (2.1.3). |
|
|
76
77
|
| `home-package` | A change does not add a function with a signature name of another home of the map (for example `median`, `mulberry32` or `writeFileAtomic`). A local copy drifts from the home and splits the fixes. On 2026-11-02 the repositories had 68 local statistics functions in 14 repositories. The rule examines only the lines that the change adds, so the copies that exist do not break. | private direction 18 (STRATEGY.md, 2026-11-02). |
|
|
77
78
|
| `pages-site` | A public repository has a workflow that calls the Pages workflow of the template (`mark1russell7/template/.github/workflows/reusable-pages.yml`, any ref), and the call deploys. A call with `deploy: false` makes a test site only. In a GitHub Actions run, the event file tells if the repository is public. Outside a run, the rule shows `skip`. On 2026-11-02 eight public repositories had no site with a Releases page and a Status page. | vex, crawler, client, coeval `pages.yml`. |
|
|
78
79
|
| `pages-after-release` | A repository with a public package and a release workflow starts its Pages workflow after a release and on each day. `conventions fix` writes the triggers. A workflow with its own deploy steps needs a person. |
|
package/build/cli.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -488,6 +488,7 @@ export declare function invalidPatternBreaks(patterns: readonly PrivatePattern[]
|
|
|
488
488
|
*/
|
|
489
489
|
export declare function privateTextBreaks(name: string, text: string, privates: PrivateSources, options?: TextBreakOptions): Break[];
|
|
490
490
|
export declare const noLocalPaths: Rule;
|
|
491
|
+
export declare const packNoBuildinfo: Rule;
|
|
491
492
|
export declare const apiReportScript: Rule;
|
|
492
493
|
export declare const pagesAfterRelease: Rule;
|
|
493
494
|
/** The Pages workflow of the template, as a call from another repository and as a call from the template itself. */
|
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-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/private-names.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/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;;wBAyBG,YAAY;;;;;;;wBAkBZ,YAAY,cAAc,cAAc;EAAoC;;EAAmB;;qBAwIlG,aAAa;;qBClNb;;qBAGA;;qBAGA;;UAQI;WACN;WACA;;;wBAkBK,gBAAgB,eAAe;;;;;;wBA8B/B,WAAW,cAAc;EAA0C;;EAAmB;;qBA4DzF,gBAAgB;qBChGhB,UAAU;;qBC5BV;;qBAaA;;qBAGA;;wBASG,cAAc,cAAc;qBAI/B,UAAU;;qBC9BV;;wBAYG,SAAS;qBAmBZ,gBAAgB;;KCvCjB;;UAGK;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,OAAO;;WAEP;;;;;;WAMA;;WAEA;;;qBAIE;;qBAIA,gBAAgB;;
|
|
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-package.ts","../src/rules/license-file.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/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/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,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typedFiles, An as DEPENDENCY_FIELDS, At as lineNameHits, B as roadmapParses, Bn as readJsonc, Bt as licenseFile, C as versionTitle, Cn as prPathFilters, Ct as privateTextBreaks, D as typedScripts, Dn as readWorkflow, Dt as isAllowedHit, E as trustPolicy, En as readAction, Et as firstNameMatch, F as HOME_TIMEOUT_MS, Fn as inFolder, Ft as REAL_COMPARE, G as publishedMinor, Gn as parseConfig, Gt as homePackage, H as releaseFiles, Hn as runGit, Ht as mitText, I as blockHash, In as keyLine, It as hasImportMetaMain, J as NPM_REGISTRY, Jt as signaturesOf, K as publishedMinorRule, Kt as messageOf, L as githubFetch, Ln as lineOf, Lt as mainCheck, M as isSourcePath, Mn as cleanPath, Mt as parsePrivateNames, N as pathsOf, Nn as codePackages, Nt as pathNameHit, O as configsOfScript, On as STRICT_OPTIONS, Ot as isCommonUse, P as sourceMain, Pn as hasFile, Pt as noBuildOutput, Q as unreleasedChange, Qt as mapMarkdown, R as sharedDocsRule, Rn as matchesAny, Rt as LICENSE_TEXTS, S as setVersions, Sn as gateTrigger, St as privatePatterns, T as TRAIN_SCOPES, Tn as gateAfterCancel, Tt as PrivateNameListError, U as lockedVersions, Un as specifiersOf, Ut as repositoryIsPublic, V as requiredScripts, Vn as replaceLine, Vt as licenseFileOf, W as minorOf, Wn as defaultOptions, Wt as declaredName, X as UNSHIPPED_FILES, Xt as MAP_RULE, Y as SHIPPED_FIELDS, Yt as HOMES, Z as npmLookup, Zt as findHomes, _ as workspaceProtocol, _n as securityCallers, _t as PRIVATE_NAMES_FILE_VARIABLE, a as listRules, an as serviceRunMain, at as repositoryOfRemote, b as yamlFaults, bn as ACTIONS_COMMIT, bt as noLocalPaths, c as runCli, cn as SHARED_ACTIONS, ct as pushMainOnly, d as HOOK_MARKER, dn as callsSharedCi, dt as pagesSite, en as mergeHomes, et as pipeFails, f as NO_READ_LINE, fn as sharedCi, ft as apiReportScript, g as RULES, gn as SECURITY_TIMEOUT_MINUTES, gt as PRIVATE_NAMES_FILE_CONFIG, h as prePush, hn as SECURITY_SCAN_INPUTS, ht as HOME_PATTERNS, i as formatResult, in as runCalls, it as pagesAfterRelease, j as testsRequired, jn as RULE_WARN_DAYS, jt as nameMatches, k as scriptsOf, kn as cuePreset, kt as lineNameHit, l as runFix, ln as SHARED_CI, lt as PAGES_WORKFLOWS, m as installHook, mn as SECURITY_SCAN_COMMIT, mt as DEFAULT_ALLOWED, n as annotations, nn as HOME_EXPORTS, nt as isPinned, o as readConfig, on as hasTests, ot as runnerBudget, p as PRE_PUSH_HOOK, pn as setupCue, pt as packNoBuildinfo, q as reachOf, qt as repoOf, r as createContext, rn as SERVICE_PACKAGE, rt as pinnedGitDeps, s as runChecks, sn as tsconfigTest, st as scheduleMinute, t as USAGE, tn as readOverlay, tt as isGitSpecifier, u as summaryMarkdown, un as SHARED_WORKFLOWS, ut as pagesCalls, v as GITHUB_YAML, vn as securityOneJob, vt as PRIVATE_PATTERNS_VARIABLE, w as IGNORE_AFTER, wn as summaryName, wt as PRIVATE_NAME_LIST, x as namedVersions, xn as convertGate, xt as privateNamesFile, y as workflowParses, yn as withOneJob, yt as invalidPatternBreaks, z as roadmapOfLine, zn as parseJsonc, zt as authorOf } from "./run-8P3m1onp.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
|
/**
|
|
@@ -65,6 +65,6 @@ function releaseNotes(name, version, changelog) {
|
|
|
65
65
|
if (section.length <= 1e5) return section;
|
|
66
66
|
return `${section.slice(0, MAX_NOTES)}\n\n(The CHANGELOG.md of \`${name}\` has the full text.)`;
|
|
67
67
|
}
|
|
68
|
-
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, 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, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, callsSharedCi, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, firstNameMatch, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, installHook, invalidPatternBreaks, isAllowedHit, isCommonUse, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineNameHit, lineNameHits, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, nameMatches, namedVersions, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, parsePrivateNames, pathNameHit, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, prePush, privateNamesFile, privatePatterns, privateTextBreaks, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readAction, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runCalls, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, securityCallers, securityOneJob, serviceRunMain, setVersions, setupCue, sharedCi, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, versionTitle, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
68
|
+
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, 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, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, callsSharedCi, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, firstNameMatch, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, installHook, invalidPatternBreaks, isAllowedHit, isCommonUse, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineNameHit, lineNameHits, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, nameMatches, namedVersions, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packNoBuildinfo, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, parsePrivateNames, pathNameHit, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, prePush, privateNamesFile, privatePatterns, privateTextBreaks, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readAction, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runCalls, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, securityCallers, securityOneJob, serviceRunMain, setVersions, setupCue, sharedCi, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, versionTitle, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
69
69
|
|
|
70
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@ import { a as relativePath, i as packageFolders, r as globToRegExp, t as byCode
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
5
|
-
import { basename, dirname, extname, join, posix, relative, resolve } from "node:path";
|
|
5
|
+
import { basename, dirname, extname, isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { parseAllDocuments } from "yaml";
|
|
8
8
|
// src/config.ts
|
|
@@ -2231,6 +2231,7 @@ const SHARED_ACTIONS = [
|
|
|
2231
2231
|
"changeset-check",
|
|
2232
2232
|
"coverage",
|
|
2233
2233
|
"data-stamps",
|
|
2234
|
+
"env-json",
|
|
2234
2235
|
"gate-summary",
|
|
2235
2236
|
"green-main",
|
|
2236
2237
|
"npm-publish",
|
|
@@ -8555,6 +8556,29 @@ const HOMES = [
|
|
|
8555
8556
|
],
|
|
8556
8557
|
note: "The plain path, glob and walk functions go to the area files (mark1russell7/files). These packages wrap them as procedures."
|
|
8557
8558
|
},
|
|
8559
|
+
{
|
|
8560
|
+
area: "headless-browser",
|
|
8561
|
+
title: "Headless browser runs",
|
|
8562
|
+
covers: "finding the browser of the system, a headless run with argv, a temporary profile, a time limit and a signal, and its output: PDF files, screenshots in PNG or JPEG, page text",
|
|
8563
|
+
packages: [],
|
|
8564
|
+
repo: "mark1russell7/client",
|
|
8565
|
+
state: "planned",
|
|
8566
|
+
words: [
|
|
8567
|
+
"browser",
|
|
8568
|
+
"chromium",
|
|
8569
|
+
"chrome",
|
|
8570
|
+
"headless",
|
|
8571
|
+
"screenshot",
|
|
8572
|
+
"pdf",
|
|
8573
|
+
"print",
|
|
8574
|
+
"png",
|
|
8575
|
+
"jpeg",
|
|
8576
|
+
"puppeteer",
|
|
8577
|
+
"playwright"
|
|
8578
|
+
],
|
|
8579
|
+
signatures: ["findBrowser", "renderScreenshot"],
|
|
8580
|
+
note: "The home is @procedures/browser (planned). Today findBrowser and renderPdf are in @procedures/pdf, which re-exports them from the new home when it ships."
|
|
8581
|
+
},
|
|
8558
8582
|
{
|
|
8559
8583
|
area: "cli",
|
|
8560
8584
|
title: "Command-line arguments",
|
|
@@ -10060,6 +10084,307 @@ const noLocalPaths = {
|
|
|
10060
10084
|
return breaks;
|
|
10061
10085
|
}
|
|
10062
10086
|
};
|
|
10087
|
+
// src/tsconfig.ts
|
|
10088
|
+
/**
|
|
10089
|
+
* The compiler options of a tsconfig after its `extends` chain, as the rules read them.
|
|
10090
|
+
*/
|
|
10091
|
+
/**
|
|
10092
|
+
* This function gives the value of the compiler option `name` that a tsconfig gets from the configs it extends. It gives
|
|
10093
|
+
* `null` when no config of the chain sets it. It gives `undefined` when it cannot read a config of the chain, for example
|
|
10094
|
+
* a package that is not installed.
|
|
10095
|
+
*/
|
|
10096
|
+
function inheritedOption(tsconfig, name, seen = /* @__PURE__ */ new Set()) {
|
|
10097
|
+
const json = readJsonc(tsconfig);
|
|
10098
|
+
if (json === void 0 || seen.has(tsconfig)) return void 0;
|
|
10099
|
+
const specs = Array.isArray(json.extends) ? json.extends : json.extends === void 0 ? [] : [json.extends];
|
|
10100
|
+
let found = null;
|
|
10101
|
+
for (const spec of specs) {
|
|
10102
|
+
if (typeof spec !== "string") return void 0;
|
|
10103
|
+
let file;
|
|
10104
|
+
try {
|
|
10105
|
+
file = spec.startsWith(".") || spec.startsWith("/") ? resolve(dirname(tsconfig), spec) : createRequire(tsconfig).resolve(spec);
|
|
10106
|
+
} catch {
|
|
10107
|
+
return;
|
|
10108
|
+
}
|
|
10109
|
+
if (!existsSync(file) && existsSync(`${file}.json`)) file = `${file}.json`;
|
|
10110
|
+
const parent = readJsonc(file);
|
|
10111
|
+
if (parent === void 0) return void 0;
|
|
10112
|
+
const own = parent.compilerOptions?.[name];
|
|
10113
|
+
const value = own === void 0 ? inheritedOption(file, name, /* @__PURE__ */ new Set([...seen, tsconfig])) : {
|
|
10114
|
+
value: own,
|
|
10115
|
+
file
|
|
10116
|
+
};
|
|
10117
|
+
if (value === void 0) return void 0;
|
|
10118
|
+
if (value !== null) found = value;
|
|
10119
|
+
}
|
|
10120
|
+
return found;
|
|
10121
|
+
}
|
|
10122
|
+
/**
|
|
10123
|
+
* This function gives the value of the compiler option `name` of a tsconfig. It is its own value, or else the value from
|
|
10124
|
+
* the configs it extends. It gives `null` when no config sets it, and `undefined` when it cannot read a config.
|
|
10125
|
+
*/
|
|
10126
|
+
function compilerOption(tsconfig, name) {
|
|
10127
|
+
const json = readJsonc(tsconfig);
|
|
10128
|
+
if (json === void 0) return void 0;
|
|
10129
|
+
const own = json.compilerOptions?.[name];
|
|
10130
|
+
return own === void 0 ? inheritedOption(tsconfig, name) : {
|
|
10131
|
+
value: own,
|
|
10132
|
+
file: tsconfig
|
|
10133
|
+
};
|
|
10134
|
+
}
|
|
10135
|
+
/**
|
|
10136
|
+
* This function gives the absolute path of a path option. A `${configDir}` is the folder of the tsconfig `tsconfig`. Each
|
|
10137
|
+
* other relative path is relative to the config that sets it.
|
|
10138
|
+
*/
|
|
10139
|
+
function optionPath(tsconfig, option) {
|
|
10140
|
+
const value = option.value;
|
|
10141
|
+
return value.startsWith("${configDir}") ? resolve(dirname(tsconfig), `.${value.slice(12)}`) : resolve(dirname(option.file), value);
|
|
10142
|
+
}
|
|
10143
|
+
/**
|
|
10144
|
+
* This function gives the absolute path of the build info file that tsc writes for a tsconfig, by the rules of tsc. It
|
|
10145
|
+
* gives `null` when tsc writes no build info file: `incremental` and `composite` are both off. It gives `undefined` when
|
|
10146
|
+
* it cannot read a config of the chain.
|
|
10147
|
+
*/
|
|
10148
|
+
function buildInfoFile(tsconfig) {
|
|
10149
|
+
const read = (name) => compilerOption(tsconfig, name);
|
|
10150
|
+
const incremental = read("incremental");
|
|
10151
|
+
const composite = read("composite");
|
|
10152
|
+
if (incremental === void 0 || composite === void 0) return void 0;
|
|
10153
|
+
if (incremental?.value !== true && composite?.value !== true) return null;
|
|
10154
|
+
const paths = {};
|
|
10155
|
+
for (const name of [
|
|
10156
|
+
"tsBuildInfoFile",
|
|
10157
|
+
"outFile",
|
|
10158
|
+
"outDir",
|
|
10159
|
+
"rootDir"
|
|
10160
|
+
]) {
|
|
10161
|
+
const option = read(name);
|
|
10162
|
+
if (option === void 0) return void 0;
|
|
10163
|
+
paths[name] = option !== null && typeof option.value === "string" ? optionPath(tsconfig, {
|
|
10164
|
+
file: option.file,
|
|
10165
|
+
value: option.value
|
|
10166
|
+
}) : null;
|
|
10167
|
+
}
|
|
10168
|
+
if (paths["tsBuildInfoFile"]) return paths["tsBuildInfoFile"];
|
|
10169
|
+
const withoutExtension = (path) => path.replace(/\.[^./\\]*$/, "");
|
|
10170
|
+
if (paths["outFile"]) return `${withoutExtension(paths["outFile"])}.tsbuildinfo`;
|
|
10171
|
+
const config = withoutExtension(resolve(tsconfig));
|
|
10172
|
+
const outDir = paths["outDir"];
|
|
10173
|
+
const rootDir = paths["rootDir"];
|
|
10174
|
+
return `${outDir ? rootDir ? resolve(outDir, relative(rootDir, config)) : join(outDir, basename(config)) : config}.tsbuildinfo`;
|
|
10175
|
+
}
|
|
10176
|
+
// src/rules/pack-no-buildinfo.ts
|
|
10177
|
+
/**
|
|
10178
|
+
* The rule `pack-no-buildinfo`: npm does not pack the build info file of tsc. A public package that writes it in a
|
|
10179
|
+
* folder of its field `files` has the negation `!<path>` there.
|
|
10180
|
+
*/
|
|
10181
|
+
/** The names of the tsconfig files of a package folder. */
|
|
10182
|
+
const TSCONFIG = /^tsconfig(?:\.[\w-]+)?\.json$/;
|
|
10183
|
+
/** This function gives the rule of a line of the ignore list, as minimatch reads it: each `!` inverts the rule. */
|
|
10184
|
+
function packRule(line, index) {
|
|
10185
|
+
let bangs = 0;
|
|
10186
|
+
while (line.charAt(bangs) === "!") bangs += 1;
|
|
10187
|
+
return {
|
|
10188
|
+
glob: line.slice(bangs).replace(/\/{2,}/g, "/"),
|
|
10189
|
+
include: bangs % 2 === 1,
|
|
10190
|
+
index
|
|
10191
|
+
};
|
|
10192
|
+
}
|
|
10193
|
+
/** This function gives the regular expression of a glob, as npm reads it: with no case, and `*` also matches a dot. */
|
|
10194
|
+
function packRegExp(glob) {
|
|
10195
|
+
return new RegExp(globToRegExp(glob).source, "i");
|
|
10196
|
+
}
|
|
10197
|
+
/**
|
|
10198
|
+
* This function tells if a rule matches the path (`/`, relative to the package). A glob with no `/` matches the name
|
|
10199
|
+
* at each depth (matchBase). A `/` at the start anchors the glob, as each glob with a `/` is. A `/` at the end
|
|
10200
|
+
* matches a folder only. A rule that includes also matches a folder that holds a path that the glob can match.
|
|
10201
|
+
*/
|
|
10202
|
+
function ruleMatches(rule, path, folder) {
|
|
10203
|
+
let glob = rule.glob;
|
|
10204
|
+
if (glob.startsWith("/")) glob = glob.slice(1);
|
|
10205
|
+
if (glob.endsWith("/")) {
|
|
10206
|
+
if (!folder) return false;
|
|
10207
|
+
glob = glob.slice(0, -1);
|
|
10208
|
+
}
|
|
10209
|
+
if (glob === "") return false;
|
|
10210
|
+
const segments = path.split("/");
|
|
10211
|
+
if (!rule.glob.includes("/")) return packRegExp(glob).test(segments[segments.length - 1] ?? path);
|
|
10212
|
+
if (packRegExp(glob).test(path)) return true;
|
|
10213
|
+
if (!folder || !rule.include) return false;
|
|
10214
|
+
const parts = glob.split("/");
|
|
10215
|
+
for (let at = 0; at < parts.length; at++) {
|
|
10216
|
+
const part = parts[at] ?? "";
|
|
10217
|
+
if (part === "**" || at >= segments.length) return true;
|
|
10218
|
+
if (!packRegExp(part).test(segments[at] ?? "")) return false;
|
|
10219
|
+
}
|
|
10220
|
+
return false;
|
|
10221
|
+
}
|
|
10222
|
+
/**
|
|
10223
|
+
* This function gives the rules that npm 11 (npm-packlist 10) makes from the field `files`. The rules are for the
|
|
10224
|
+
* path and its folders. npm examines each entry on the disk. At the time of the pack, the path is a file and each of its parents
|
|
10225
|
+
* is a folder. This function takes each other entry as a pattern, and the rules of a pattern match the path in the
|
|
10226
|
+
* same way.
|
|
10227
|
+
*/
|
|
10228
|
+
function packRules(files, path) {
|
|
10229
|
+
const parts = path.split("/");
|
|
10230
|
+
const folders = new Set(parts.slice(0, -1).map((_, at) => parts.slice(0, at + 1).join("/")));
|
|
10231
|
+
const strict = [];
|
|
10232
|
+
const loose = [];
|
|
10233
|
+
files.forEach((entry, index) => {
|
|
10234
|
+
if (typeof entry !== "string") return;
|
|
10235
|
+
let file = entry;
|
|
10236
|
+
if (file.startsWith("./")) file = file.slice(1);
|
|
10237
|
+
if (file.endsWith("/*")) file += "*";
|
|
10238
|
+
const inverse = `!${file}`;
|
|
10239
|
+
let target = posix.normalize(file.replace(/^!+/, "") || ".");
|
|
10240
|
+
if (target.startsWith("/")) target = target.slice(1);
|
|
10241
|
+
if (target.endsWith("/")) target = target.slice(0, -1);
|
|
10242
|
+
if (target === path) strict.unshift(packRule(inverse, index));
|
|
10243
|
+
else if (folders.has(target)) loose.push(packRule(inverse, index), packRule(`${inverse}/**`, index));
|
|
10244
|
+
else loose.push(packRule(inverse, index));
|
|
10245
|
+
});
|
|
10246
|
+
return {
|
|
10247
|
+
strict,
|
|
10248
|
+
loose
|
|
10249
|
+
};
|
|
10250
|
+
}
|
|
10251
|
+
/**
|
|
10252
|
+
* This function gives the last rule that matches the path, or undefined when no rule matches it. The rule `*` of
|
|
10253
|
+
* npm comes first, so a path that no rule matches is not packed.
|
|
10254
|
+
*/
|
|
10255
|
+
function lastMatch(rules, path, folder) {
|
|
10256
|
+
let found;
|
|
10257
|
+
for (const rule of rules) if (ruleMatches(rule, path, folder)) found = rule;
|
|
10258
|
+
return found;
|
|
10259
|
+
}
|
|
10260
|
+
/**
|
|
10261
|
+
* This function tells if npm 11 packs `path` (relative to the package, with `/`) by the field `files`. It follows
|
|
10262
|
+
* npm-packlist 10. First comes the rule `*`, then a rule for each entry in its order. Last come the strict rules of
|
|
10263
|
+
* the entries that name the file. The last rule that matches a path decides. npm does not go into a folder that it does not take.
|
|
10264
|
+
* The function gives the index of the entry of the rule that takes the file, or -1 when npm does not pack it.
|
|
10265
|
+
*/
|
|
10266
|
+
function packedBy(files, path) {
|
|
10267
|
+
const { strict, loose } = packRules(files, path);
|
|
10268
|
+
const rules = [...loose, ...strict];
|
|
10269
|
+
const parts = path.split("/");
|
|
10270
|
+
for (let at = 1; at < parts.length; at++) if (lastMatch(rules, parts.slice(0, at).join("/"), true)?.include !== true) return -1;
|
|
10271
|
+
const rule = lastMatch(rules, path, false);
|
|
10272
|
+
return rule?.include === true ? rule.index : -1;
|
|
10273
|
+
}
|
|
10274
|
+
/**
|
|
10275
|
+
* This function gives the text of `package.json` with the entry `negation` after the entry `index` of the field
|
|
10276
|
+
* `files`, in the format of the file. It gives undefined when it cannot find the field, or when the changed text does
|
|
10277
|
+
* not parse as the manifest with the new entry.
|
|
10278
|
+
*/
|
|
10279
|
+
function withNegation(pkg, index, negation) {
|
|
10280
|
+
const files = pkg.manifest["files"];
|
|
10281
|
+
if (!Array.isArray(files)) return void 0;
|
|
10282
|
+
const expected = JSON.stringify({
|
|
10283
|
+
...pkg.manifest,
|
|
10284
|
+
files: [
|
|
10285
|
+
...files.slice(0, index + 1),
|
|
10286
|
+
negation,
|
|
10287
|
+
...files.slice(index + 1)
|
|
10288
|
+
]
|
|
10289
|
+
});
|
|
10290
|
+
const eol = pkg.text.includes("\r\n") ? "\r\n" : "\n";
|
|
10291
|
+
for (const field of pkg.text.matchAll(/"files"\s*:\s*\[/g)) {
|
|
10292
|
+
const open = (field.index ?? 0) + field[0].length;
|
|
10293
|
+
let at = open;
|
|
10294
|
+
let end = -1;
|
|
10295
|
+
for (let item = 0; item <= index; item++) {
|
|
10296
|
+
const match = /^[\s,]*("(?:[^"\\]|\\.)*")/.exec(pkg.text.slice(at));
|
|
10297
|
+
if (match === null) break;
|
|
10298
|
+
at += match[0].length;
|
|
10299
|
+
if (item === index) end = at;
|
|
10300
|
+
}
|
|
10301
|
+
if (end < 0) continue;
|
|
10302
|
+
const multiline = (/^\s*/.exec(pkg.text.slice(open))?.[0] ?? "").includes("\n");
|
|
10303
|
+
const indent = /^[ \t]*/.exec(pkg.text.slice(pkg.text.lastIndexOf("\n", end - 1) + 1))?.[0] ?? "";
|
|
10304
|
+
const separator = multiline ? `,${eol}${indent}` : ", ";
|
|
10305
|
+
const after = `${pkg.text.slice(0, end)}${separator}${JSON.stringify(negation)}${pkg.text.slice(end)}`;
|
|
10306
|
+
try {
|
|
10307
|
+
if (JSON.stringify(JSON.parse(after)) === expected) return after;
|
|
10308
|
+
} catch {}
|
|
10309
|
+
}
|
|
10310
|
+
}
|
|
10311
|
+
const packNoBuildinfo = {
|
|
10312
|
+
id: "pack-no-buildinfo",
|
|
10313
|
+
title: "npm does not pack the build info file of tsc: a public package that writes it in a folder of `files` has the negation `!<path>` there.",
|
|
10314
|
+
reason: "The build info file changes on each build, also after a bump of a dev dependency. The release stops when the packed files of an unchanged version differ from npm. On 2026-11-09 the main of splay-react went red, because only `dist/.tsbuildinfo` differed. The cue lib preset writes this file in `dist`, and `files` packs `dist`.",
|
|
10315
|
+
fix: "Add the negation of the path after its folder in `files`, for example `\"files\": [\"dist\", \"!dist/.tsbuildinfo\"]`. `conventions fix` writes it. Keep the file in `dist`: a `tsc -b` after a clean of `dist` must build again. A package with no field `files` packs each file of its folder: give it the field. A changed list of packed files needs a PATCH version.",
|
|
10316
|
+
sources: [
|
|
10317
|
+
{
|
|
10318
|
+
repo: "splay-react",
|
|
10319
|
+
rule: "pack-no-buildinfo",
|
|
10320
|
+
doc: "package.json (files, 1.0.2)"
|
|
10321
|
+
},
|
|
10322
|
+
{
|
|
10323
|
+
repo: "splay",
|
|
10324
|
+
rule: "pack-no-buildinfo",
|
|
10325
|
+
doc: "package.json (files)"
|
|
10326
|
+
},
|
|
10327
|
+
{
|
|
10328
|
+
repo: "cue",
|
|
10329
|
+
rule: "pack-no-buildinfo",
|
|
10330
|
+
doc: "npm/package/ts.cue (files, 2.1.3)"
|
|
10331
|
+
}
|
|
10332
|
+
],
|
|
10333
|
+
options: {},
|
|
10334
|
+
failsFrom: "2026-11-25",
|
|
10335
|
+
check(context) {
|
|
10336
|
+
const breaks = [];
|
|
10337
|
+
const unread = [];
|
|
10338
|
+
const all = [context.rootPackage, ...codePackages(context)];
|
|
10339
|
+
for (const pkg of all.filter((item, index) => all.findIndex((other) => other.file === item.file) === index)) {
|
|
10340
|
+
if (pkg.manifest["private"] === true) continue;
|
|
10341
|
+
const name = String(pkg.manifest["name"] ?? pkg.folder);
|
|
10342
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10343
|
+
for (const config of readdirSync(pkg.dir).filter((file) => TSCONFIG.test(file)).sort()) {
|
|
10344
|
+
const found = buildInfoFile(join(pkg.dir, config));
|
|
10345
|
+
if (found === void 0) {
|
|
10346
|
+
unread.push(`${pkg.folder === "" ? "" : `${pkg.folder}/`}${config}`);
|
|
10347
|
+
continue;
|
|
10348
|
+
}
|
|
10349
|
+
if (found === null) continue;
|
|
10350
|
+
const path = relative(pkg.dir, found).replace(/\\/g, "/");
|
|
10351
|
+
if (path === "" || path.startsWith("../") || isAbsolute(path) || path.split("/").includes("node_modules") || seen.has(path)) continue;
|
|
10352
|
+
seen.add(path);
|
|
10353
|
+
const files = pkg.manifest["files"];
|
|
10354
|
+
const line = lineOf(pkg.text, "\"files\"");
|
|
10355
|
+
if (!Array.isArray(files)) {
|
|
10356
|
+
breaks.push({
|
|
10357
|
+
file: pkg.file,
|
|
10358
|
+
message: `${name} has no field "files", so npm packs ${path}, the build info file of ${config}.`,
|
|
10359
|
+
fix: `Give ${name} the field "files" with the folders that it publishes, and "!${path}".`
|
|
10360
|
+
});
|
|
10361
|
+
continue;
|
|
10362
|
+
}
|
|
10363
|
+
const index = packedBy(files, path);
|
|
10364
|
+
if (index < 0) continue;
|
|
10365
|
+
const negationStops = packedBy([
|
|
10366
|
+
...files.slice(0, index + 1),
|
|
10367
|
+
`!${path}`,
|
|
10368
|
+
...files.slice(index + 1)
|
|
10369
|
+
], path) < 0;
|
|
10370
|
+
const after = negationStops ? withNegation(pkg, index, `!${path}`) : void 0;
|
|
10371
|
+
const fix = negationStops ? `Add "!${path}" after "${String(files[index])}" in "files".` : `Remove the entry "${String(files[index])}" of "files": it names ${path}.`;
|
|
10372
|
+
breaks.push({
|
|
10373
|
+
file: pkg.file,
|
|
10374
|
+
...line === void 0 ? {} : { line },
|
|
10375
|
+
message: `npm packs ${path}, the build info file of ${config}, by the entry "${String(files[index])}" of "files" of ${name}.`,
|
|
10376
|
+
...after === void 0 ? { fix } : { edits: [{
|
|
10377
|
+
file: pkg.file,
|
|
10378
|
+
before: pkg.text,
|
|
10379
|
+
after
|
|
10380
|
+
}] }
|
|
10381
|
+
});
|
|
10382
|
+
}
|
|
10383
|
+
}
|
|
10384
|
+
if (breaks.length === 0 && unread.length > 0) return { skipped: `The rule cannot read the extends chain of ${unread.join(", ")}. Install the dependencies.` };
|
|
10385
|
+
return breaks;
|
|
10386
|
+
}
|
|
10387
|
+
};
|
|
10063
10388
|
// src/rules/api-report-script.ts
|
|
10064
10389
|
/**
|
|
10065
10390
|
* The rule `api-report-script`: a repository with a public package has the root script that checks its API reports.
|
|
@@ -12815,37 +13140,6 @@ const ROOT_DIRS = /* @__PURE__ */ new Set([
|
|
|
12815
13140
|
"${configDir}/"
|
|
12816
13141
|
]);
|
|
12817
13142
|
/**
|
|
12818
|
-
* This function gives the value of the compiler option `name` that a tsconfig gets from the configs it extends. It gives
|
|
12819
|
-
* `null` when no config of the chain sets it. It gives `undefined` when it cannot read a config of the chain, for example
|
|
12820
|
-
* a package that is not installed.
|
|
12821
|
-
*/
|
|
12822
|
-
function inheritedOption(tsconfig, name, seen = /* @__PURE__ */ new Set()) {
|
|
12823
|
-
const json = readJsonc(tsconfig);
|
|
12824
|
-
if (json === void 0 || seen.has(tsconfig)) return void 0;
|
|
12825
|
-
const specs = Array.isArray(json.extends) ? json.extends : json.extends === void 0 ? [] : [json.extends];
|
|
12826
|
-
let found = null;
|
|
12827
|
-
for (const spec of specs) {
|
|
12828
|
-
if (typeof spec !== "string") return void 0;
|
|
12829
|
-
let file;
|
|
12830
|
-
try {
|
|
12831
|
-
file = spec.startsWith(".") || spec.startsWith("/") ? resolve(dirname(tsconfig), spec) : createRequire(tsconfig).resolve(spec);
|
|
12832
|
-
} catch {
|
|
12833
|
-
return;
|
|
12834
|
-
}
|
|
12835
|
-
if (!existsSync(file) && existsSync(`${file}.json`)) file = `${file}.json`;
|
|
12836
|
-
const parent = readJsonc(file);
|
|
12837
|
-
if (parent === void 0) return void 0;
|
|
12838
|
-
const own = parent.compilerOptions?.[name];
|
|
12839
|
-
const value = own === void 0 ? inheritedOption(file, name, /* @__PURE__ */ new Set([...seen, tsconfig])) : {
|
|
12840
|
-
value: own,
|
|
12841
|
-
file
|
|
12842
|
-
};
|
|
12843
|
-
if (value === void 0) return void 0;
|
|
12844
|
-
if (value !== null) found = value;
|
|
12845
|
-
}
|
|
12846
|
-
return found;
|
|
12847
|
-
}
|
|
12848
|
-
/**
|
|
12849
13143
|
* This function tells if a tsconfig gets a `rootDir` other than its folder from a config that it extends. It also says
|
|
12850
13144
|
* yes when it cannot read that config. A `${configDir}` is the folder of the tsconfig, the other paths are relative to
|
|
12851
13145
|
* the config that sets them.
|
|
@@ -12854,8 +13148,10 @@ function inheritsSubfolder(tsconfig) {
|
|
|
12854
13148
|
const inherited = inheritedOption(tsconfig, "rootDir");
|
|
12855
13149
|
if (inherited === null) return false;
|
|
12856
13150
|
if (inherited === void 0 || typeof inherited.value !== "string") return true;
|
|
12857
|
-
|
|
12858
|
-
|
|
13151
|
+
return optionPath(tsconfig, {
|
|
13152
|
+
file: inherited.file,
|
|
13153
|
+
value: inherited.value
|
|
13154
|
+
}) !== resolve(dirname(tsconfig));
|
|
12859
13155
|
}
|
|
12860
13156
|
/**
|
|
12861
13157
|
* This function gives the edit that adds the config files at the root of a package to its `tsconfig.test.json`. It adds
|
|
@@ -13590,6 +13886,7 @@ const RULES = [
|
|
|
13590
13886
|
setupCue,
|
|
13591
13887
|
homePackage,
|
|
13592
13888
|
licenseFile,
|
|
13889
|
+
packNoBuildinfo,
|
|
13593
13890
|
pagesSite,
|
|
13594
13891
|
pagesAfterRelease,
|
|
13595
13892
|
sharedDocs
|
|
@@ -14476,6 +14773,6 @@ function runHook(args, io) {
|
|
|
14476
14773
|
git: (gitArgs) => runGit(io.cwd, gitArgs)
|
|
14477
14774
|
}, io);
|
|
14478
14775
|
}
|
|
14479
|
-
export { unreleasedChangeRule as $,
|
|
14776
|
+
export { unreleasedChangeRule as $, mapText as $t, typedFiles as A, DEPENDENCY_FIELDS as An, lineNameHits as At, roadmapParses as B, readJsonc as Bn, licenseFile as Bt, versionTitle as C, prPathFilters as Cn, privateTextBreaks as Ct, typedScripts as D, readWorkflow as Dn, isAllowedHit as Dt, trustPolicy as E, readAction as En, firstNameMatch as Et, HOME_TIMEOUT_MS as F, inFolder as Fn, REAL_COMPARE as Ft, publishedMinor as G, parseConfig as Gn, homePackage as Gt, releaseFiles as H, runGit as Hn, mitText as Ht, blockHash as I, keyLine as In, hasImportMetaMain as It, NPM_REGISTRY as J, signaturesOf as Jt, publishedMinorRule as K, messageOf as Kt, githubFetch as L, lineOf as Ln, mainCheck as Lt, isSourcePath as M, cleanPath as Mn, parsePrivateNames as Mt, pathsOf as N, codePackages as Nn, pathNameHit as Nt, configsOfScript as O, STRICT_OPTIONS as On, isCommonUse as Ot, sourceMain as P, hasFile as Pn, noBuildOutput as Pt, unreleasedChange as Q, mapMarkdown as Qt, sharedDocsRule as R, matchesAny as Rn, LICENSE_TEXTS as Rt, setVersions as S, gateTrigger as Sn, privatePatterns as St, TRAIN_SCOPES as T, gateAfterCancel as Tn, PrivateNameListError as Tt, lockedVersions as U, specifiersOf as Un, repositoryIsPublic as Ut, requiredScripts as V, replaceLine as Vn, licenseFileOf as Vt, minorOf as W, defaultOptions as Wn, declaredName as Wt, UNSHIPPED_FILES as X, MAP_RULE as Xt, SHIPPED_FIELDS as Y, HOMES as Yt, npmLookup as Z, findHomes as Zt, workspaceProtocol as _, securityCallers as _n, PRIVATE_NAMES_FILE_VARIABLE as _t, listRules as a, serviceRunMain as an, repositoryOfRemote as at, yamlFaults as b, ACTIONS_COMMIT as bn, noLocalPaths as bt, runCli as c, SHARED_ACTIONS as cn, pushMainOnly as ct, HOOK_MARKER as d, callsSharedCi as dn, pagesSite as dt, mergeHomes as en, pipeFails as et, NO_READ_LINE as f, sharedCi as fn, apiReportScript as ft, RULES as g, SECURITY_TIMEOUT_MINUTES as gn, PRIVATE_NAMES_FILE_CONFIG as gt, prePush as h, SECURITY_SCAN_INPUTS as hn, HOME_PATTERNS as ht, formatResult as i, runCalls as in, pagesAfterRelease as it, testsRequired as j, RULE_WARN_DAYS as jn, nameMatches as jt, scriptsOf as k, cuePreset as kn, lineNameHit as kt, runFix as l, SHARED_CI as ln, PAGES_WORKFLOWS as lt, installHook as m, SECURITY_SCAN_COMMIT as mn, DEFAULT_ALLOWED as mt, annotations as n, HOME_EXPORTS as nn, isPinned as nt, readConfig as o, hasTests as on, runnerBudget as ot, PRE_PUSH_HOOK as p, setupCue as pn, packNoBuildinfo as pt, reachOf as q, repoOf as qt, createContext as r, SERVICE_PACKAGE as rn, pinnedGitDeps as rt, runChecks as s, tsconfigTest as sn, scheduleMinute as st, USAGE as t, readOverlay as tn, isGitSpecifier as tt, summaryMarkdown as u, SHARED_WORKFLOWS as un, pagesCalls as ut, GITHUB_YAML as v, securityOneJob as vn, PRIVATE_PATTERNS_VARIABLE as vt, IGNORE_AFTER as w, summaryName as wn, PRIVATE_NAME_LIST as wt, namedVersions as x, convertGate as xn, privateNamesFile as xt, workflowParses as y, withOneJob as yn, invalidPatternBreaks as yt, roadmapOfLine as z, parseJsonc as zn, authorOf as zt };
|
|
14480
14777
|
|
|
14481
|
-
//# sourceMappingURL=run-
|
|
14778
|
+
//# sourceMappingURL=run-8P3m1onp.js.map
|