@avi2dg/checks 0.54.0 → 0.54.1
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of `@avi2dg/checks`, newest first, written by the release from its conventional commits.
|
|
4
4
|
|
|
5
|
+
## 0.54.1
|
|
6
|
+
|
|
7
|
+
Released 2026-10-27.
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
- resolve the lint gate tools from the repository's own install [#9](https://github.com/avi2d/checks/pull/9)
|
|
12
|
+
|
|
5
13
|
## 0.54.0
|
|
6
14
|
|
|
7
15
|
Released 2026-10-27.
|
|
@@ -21,7 +21,7 @@ A `tsconfig.json` that does not extend `@avi2dg/checks/tsconfig.effect.json`, or
|
|
|
21
21
|
It reads the working tree: the `*.ts`, `*.tsx` and `*.astro` files `git ls-files` lists, and the files `oxlint --debug=files` walks.
|
|
22
22
|
It walks without naming a path, since an explicit path bypasses the ignore files whose skips it looks for.
|
|
23
23
|
It reads the program from `tsc --listFilesOnly -p tsconfig.json`, and passes over the program when the repository tracks no `.ts` or `.tsx` file or the root holds no `tsconfig.json`.
|
|
24
|
-
oxlint and tsc
|
|
24
|
+
The gate runs oxlint and tsc from the repository's own `node_modules/.bin`, so they need no `PATH` entry.
|
|
25
25
|
|
|
26
26
|
## Arguments
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ It takes none.
|
|
|
33
33
|
| --- | --- |
|
|
34
34
|
| 0 | the repository tracks no `.ts`, `.tsx` or `.astro` file, or oxlint walks each one and the program holds both ts-reset rules, the repository tracks no `.ts` or `.tsx` file or the root holds no `tsconfig.json` |
|
|
35
35
|
| 1 | oxlint skips a tracked file, or the program drops a ts-reset rule |
|
|
36
|
-
| 2 | oxlint cannot walk the tree, or tsc cannot list the program after oxlint walks every tracked file, as when
|
|
36
|
+
| 2 | oxlint cannot walk the tree, or tsc cannot list the program after oxlint walks every tracked file, as when the repository's install lacks either tool or a config does not parse |
|
|
37
37
|
|
|
38
38
|
## Sample output
|
|
39
39
|
|
|
@@ -21,7 +21,7 @@ Two uploads that overlap can still leave `latest` on the older version, since th
|
|
|
21
21
|
That hold ends early in two cases.
|
|
22
22
|
One is when the 45 minute wait times out.
|
|
23
23
|
The other is when polling fails past the retry bound or the dispatch of the release workflow fails after GitHub accepted it.
|
|
24
|
-
In those cases an unfinished publisher can overlap the next release, and if latest lands on the older version
|
|
24
|
+
In those cases an unfinished publisher can overlap the next release, and if `latest` lands on the older version, `npm dist-tag add <package>@<newer version> latest` repairs it.
|
|
25
25
|
|
|
26
26
|
## What it reads
|
|
27
27
|
|
|
@@ -140,7 +140,7 @@ The concurrency group holds from reading the branch until the release workflow i
|
|
|
140
140
|
That hold ends early in two cases.
|
|
141
141
|
One is when the 45 minute wait times out.
|
|
142
142
|
The other is when polling fails past the retry bound or the dispatch of the release workflow fails after GitHub accepted it.
|
|
143
|
-
In those cases an unfinished publisher can overlap the next release, and if latest lands on the older version
|
|
143
|
+
In those cases an unfinished publisher can overlap the next release, and if `latest` lands on the older version, `npm dist-tag add <package>@<newer version> latest` repairs it.
|
|
144
144
|
[checks-release-publish](checks-release-publish.md) stays the guard for a release workflow dispatched or rerun by hand.
|
|
145
145
|
A run that waits behind it checks out the branch's tip when it starts, so it releases on top of what landed.
|
|
146
146
|
The job waits on the checks it dispatched and on the release workflow, so a hosted runner bills the minutes those workflows take.
|
package/package.json
CHANGED
|
@@ -68,6 +68,15 @@ export function repeatedLines(clones: readonly Clone[]): ReadonlyMap<string, num
|
|
|
68
68
|
return new Map([...lines].map(([file, covered]) => [file, covered.size]));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
const jscpdBinary = Effect.fn("jscpdBinary")(function* () {
|
|
72
|
+
const path = yield* Path.Path;
|
|
73
|
+
const main = yield* Effect.try({
|
|
74
|
+
try: () => new URL("./run-jscpd.js", import.meta.resolve("jscpd/package.json")),
|
|
75
|
+
catch: () => new JscpdUnreadable({ message: "cannot resolve jscpd, a peer dependency of the kit" }),
|
|
76
|
+
});
|
|
77
|
+
return yield* path.fromFileUrl(main);
|
|
78
|
+
});
|
|
79
|
+
|
|
71
80
|
// jscpd reads files from disk, and the working tree need not hold the revision: a merge checkout or an uncommitted edit.
|
|
72
81
|
// Both ends scan under the head's config, so a changed file set never reads as a change in repetition.
|
|
73
82
|
// jscpd refuses a missing path, so a path in `emptied` the revision lacks is created empty.
|
|
@@ -87,7 +96,7 @@ const scan = Effect.fn("scan")(
|
|
|
87
96
|
const flags = ["--silent", "--no-tips", "--no-gitignore", "--absolute", "--reporters", "json", "--output", output];
|
|
88
97
|
const thresholds = ["--min-tokens", `${MIN_TOKENS}`, "--min-lines", `${MIN_LINES}`];
|
|
89
98
|
|
|
90
|
-
const run = yield* collect(
|
|
99
|
+
const run = yield* collect(process.execPath, [yield* jscpdBinary(), ...flags, ...thresholds], tree).pipe(
|
|
91
100
|
Effect.mapError((cause) => new JscpdUnreadable({ message: `cannot run jscpd: ${cause.message}` })),
|
|
92
101
|
);
|
|
93
102
|
const reportPath = path.join(output, REPORT);
|
|
@@ -12,8 +12,12 @@ if ! [ -s "$tmp/expected" ]; then
|
|
|
12
12
|
exit 0
|
|
13
13
|
fi
|
|
14
14
|
|
|
15
|
+
root="$(git rev-parse --show-toplevel)"
|
|
16
|
+
oxlint="$root/node_modules/.bin/oxlint"
|
|
17
|
+
tsc="$root/node_modules/.bin/tsc"
|
|
18
|
+
|
|
15
19
|
# Explicit paths bypass ignore files, so only an unscoped walk proves coverage.
|
|
16
|
-
if ! oxlint --debug=files > "$tmp/walk" 2> "$tmp/walk-error"; then
|
|
20
|
+
if ! "$oxlint" --debug=files > "$tmp/walk" 2> "$tmp/walk-error"; then
|
|
17
21
|
echo "lint-coverage: oxlint could not walk the tree:"
|
|
18
22
|
cat "$tmp/walk" "$tmp/walk-error"
|
|
19
23
|
exit 2
|
|
@@ -44,7 +48,7 @@ if ! [ -f tsconfig.json ]; then
|
|
|
44
48
|
exit "$status"
|
|
45
49
|
fi
|
|
46
50
|
|
|
47
|
-
if ! tsc --listFilesOnly -p tsconfig.json > "$tmp/program" 2> "$tmp/program-error"; then
|
|
51
|
+
if ! "$tsc" --listFilesOnly -p tsconfig.json > "$tmp/program" 2> "$tmp/program-error"; then
|
|
48
52
|
echo "lint-coverage: tsc could not list the program tsconfig.json builds:"
|
|
49
53
|
# tsc lists each file of the program as an absolute path beside its errors.
|
|
50
54
|
grep -v '^/' "$tmp/program" || true
|