@mark1russell7/conventions 0.4.0 → 0.6.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 +5 -0
- package/build/cli.js +1 -1
- package/build/index.d.ts +12 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/{run-AxDtnOOy.js → run-BYTCunT5.js} +913 -4
- package/build/run-BYTCunT5.js.map +1 -0
- package/package.json +2 -1
- package/build/run-AxDtnOOy.js.map +0 -1
package/README.md
CHANGED
|
@@ -35,6 +35,9 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
35
35
|
| `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`. |
|
|
36
36
|
| `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`. |
|
|
37
37
|
| `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. | fleet `typed-everything` (STRATEGY.md, direction 15). |
|
|
38
|
+
| `typed-files` | Each TypeScript file that git keeps (`.ts`, `.tsx`, `.mts`, `.cts`, not `.d.ts`) is in the program of a tsconfig that a `typecheck` script names: the tests, the e2e specs, the scripts, the benches and the configs too. The rule reads the configs of each `tsc`, `tsgo` or `vue-tsc` (`-p`, `--project`, `-b`, or `tsconfig.json`) and of `svelte-check --tsconfig`, follows their `references`, and lists the files with `tsc --listFilesOnly`. A file that a covered file imports is covered. A config that does not exist, and a repository where no typecheck names a config, are a break. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
39
|
+
| `tests-required` | No test runner passes when it finds no test: no `passWithNoTests: true` in a config of vitest, vite, jest or Playwright, and no `--passWithNoTests` in `package.json`. With the option, a broken include pattern turns the test gate green with no test run. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
40
|
+
| `roadmap-parses` | Each roadmap that a workflow gives to the Status page (a `roadmap:` key) parses as `@mark1russell7/site-pages` reads it. The rule uses the parser of site-pages. Thus a pull request finds a bad row, and the Pages job on `main` does not stop on it. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
38
41
|
|
|
39
42
|
The rule `release-files` needs the base of the change. On a pull request, the checkout is a merge commit, and the rule reads its two parents (`fetch-depth` 2 or more). In other runs, give `--base <ref>`. Without a base, the rule shows `skip`.
|
|
40
43
|
|
|
@@ -83,6 +86,8 @@ An unknown rule, an unknown option, or an exception or a changed option without
|
|
|
83
86
|
| `typed-scripts.javascript` | `[".js", ".mjs", ".cjs", ".jsx"]` | The extensions of JavaScript source. |
|
|
84
87
|
| `typed-scripts.shell` | `[".sh", ".bash", ".zsh", ".ps1"]` | The extensions of shell scripts. |
|
|
85
88
|
| `typed-scripts.shellLines` | `1` | The most lines of code of a shell script (a launcher). Empty lines and comments do not count. |
|
|
89
|
+
| `typed-files.configs` | `[]` | More tsconfig files, relative to the root, that CI examines with another command (for example a script that the typecheck starts). |
|
|
90
|
+
| `roadmap-parses.roadmaps` | `[]` | More roadmap files, relative to the root, for a roadmap that no workflow names. |
|
|
86
91
|
|
|
87
92
|
## Commands
|
|
88
93
|
|
package/build/cli.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -152,14 +152,26 @@ export declare function isPinned(spec: string, fullSha: boolean): boolean;
|
|
|
152
152
|
export declare const pinnedGitDeps: Rule;
|
|
153
153
|
export declare const releaseFiles: Rule;
|
|
154
154
|
export declare const requiredScripts: Rule;
|
|
155
|
+
/** This function gives the value of a `roadmap: <file>` line, or undefined for another line, an empty value or an expression. */
|
|
156
|
+
export declare function roadmapOfLine(line: string): string | undefined;
|
|
157
|
+
export declare const roadmapParses: Rule;
|
|
155
158
|
/** This function gives each path in the value of an entry field (a string, or the strings in an object). */
|
|
156
159
|
export declare function pathsOf(value: unknown): string[];
|
|
157
160
|
/** This function tells if a path is a source file: a file in `src/`, or a TypeScript file that is not a declaration file. */
|
|
158
161
|
export declare function isSourcePath(path: string): boolean;
|
|
159
162
|
export declare const sourceMain: Rule;
|
|
163
|
+
export declare const testsRequired: Rule;
|
|
160
164
|
/** This function tells if git tracks a test file in the package folder `folder` (`""` is the root). */
|
|
161
165
|
export declare function hasTests(files: readonly string[], folder: string): boolean;
|
|
162
166
|
export declare const tsconfigTest: Rule;
|
|
167
|
+
/** This function gives the configs that one `typecheck` script examines, relative to the folder of the package. */
|
|
168
|
+
export declare function configsOfScript(script: string): string[];
|
|
169
|
+
/**
|
|
170
|
+
* This function gives the text of the script `name` and of each script of the same package that it
|
|
171
|
+
* starts (`pnpm run typecheck:scripts`), once each.
|
|
172
|
+
*/
|
|
173
|
+
export declare function scriptsOf(scripts: Readonly<Record<string, unknown>>, name: string, seen?: Set<string>): string[];
|
|
174
|
+
export declare const typedFiles: Rule;
|
|
163
175
|
export declare const typedScripts: Rule;
|
|
164
176
|
export declare const workspaceProtocol: Rule;
|
|
165
177
|
/** Each rule of the check. */
|
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/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/source-main.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-scripts.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;;KAIC;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;EAC1C,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,KAAK,oDAAoD;;UC9K9E;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;UAIH;;WAEN;;WAEA,OAAO,SAAS,eAAe;;;wBAW1B,eAAe,MAAM,OAAO;;;;;;;wBAU5B,YAAY,gBAAgB,gBAAgB,SAAS;;qBCnCxD;qBA2FA,WAAW;qBC/FX,eAAe;;qBCYf;;qBAGA,wBAAwB;qBAOxB,cAAc;;wBCnBX,eAAe;;;;;wBAaf,SAAS,cAAc;qBAqB1B,eAAe;qBCEf,cAAc;qBCrBd,iBAAiB;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.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/workspace-protocol.ts","../src/rules/index.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;;KAIC;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;EAC1C,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,KAAK,oDAAoD;;UC9K9E;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;UAIH;;WAEN;;WAEA,OAAO,SAAS,eAAe;;;wBAW1B,eAAe,MAAM,OAAO;;;;;;;wBAU5B,YAAY,gBAAgB,gBAAgB,SAAS;;qBCnCxD;qBA2FA,WAAW;qBC/FX,eAAe;;qBCYf;;qBAGA,wBAAwB;qBAOxB,cAAc;;wBCnBX,eAAe;;;;;wBAaf,SAAS,cAAc;qBAqB1B,eAAe;qBCEf,cAAc;qBCrBd,iBAAiB;;wBCJd,cAAc;qBAajB,eAAe;;wBCvBZ,QAAQ;;wBAQR,aAAa;qBAKhB,YAAY;qBCVZ,eAAe;;wBCHZ,SAAS,0BAA0B;qBAKtC,cAAc;;wBC4CX,gBAAgB;;;;;wBA4BhB,UAAU,SAAS,SAAS,0BAA0B,cAAc,OAAM;qBA+C7E,YAAY;qBChGZ,cAAc;qBC9Bd,mBAAmB;;qBCWnB,gBAAgB;;UCPZ;WACN;WACA;WACA;;WAEA;WACA,iBAAiB;;WAEjB;;WAEA;;;UAIM;WACN,gBAAgB;;WAEhB;;;UAIM;;WAEN;;WAEA;;WAEA;WACA,MAAM,SAAS;;WAEf,iBAAiB;;;wBAaZ,WAAW,cAAc,iBAAgB,SAAiB;;wBAO1D,cAAc,cAAc,QAAQ,mBAAmB,UAAS,KAAK,gCAAqC;;wBAwB1G,UAAU,SAAS,eAAe;;wBA0ClC,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBAwBG,OAAO,yBAAyB,IAAI;;;;;;wBCxNpC,aAAa,eAAe;;;;;wBA+C5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { k as DEFAULT_ALLOWED, F as DEPENDENCY_FIELDS, A as HOME_PATTERNS, u as RULES, N as STRICT_OPTIONS, t as USAGE, n as annotations, I as cleanPath, L as codePackages, p as configsOfScript, r as createContext, P as cuePreset, Z as defaultOptions, i as formatResult, q as globFolders, J as globToRegExp, R as hasFile, g as hasTests, z as inFolder, E as isGitSpecifier, D as isPinned, y as isSourcePath, B as keyLine, V as lineOf, a as listRules, H as matchesAny, M as noBuildOutput, j as noLocalPaths, Y as packageFolders, Q as parseConfig, U as parseJsonc, b as pathsOf, O as pinnedGitDeps, o as readConfig, W as readJsonc, T as releaseFiles, w as requiredScripts, S as roadmapOfLine, C as roadmapParses, s as runChecks, c as runCli, G as runGit, m as scriptsOf, x as sourceMain, K as specifiersOf, l as summaryMarkdown, v as testsRequired, _ as tsconfigTest, h as typedFiles, f as typedScripts, X as workspaceGlobs, d as workspaceProtocol } from "./run-BYTCunT5.js";
|