runtime-pin-check 0.1.0 → 0.1.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/README.md +51 -84
- package/dist/{chunk-DBYFB476.js → chunk-TRO76P2I.js} +27 -16
- package/dist/chunk-TRO76P2I.js.map +1 -0
- package/dist/cli.d.ts +5 -2
- package/dist/cli.js +102 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DBYFB476.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`.tool-versions`) บอกทุกจุดพร้อม **ไฟล์:บรรทัด** เทียบด้วย semver จริง แยกผลต่อโปรเจกต์ใน monorepo และมี `--fix` ที่แก้เฉพาะ
|
|
8
8
|
ตัวเลขเวอร์ชัน ไม่แตะไบต์อื่น ไม่ใช้ AI ไม่ต้องใช้เครือข่าย และไม่ต้องมี API key ตอนรัน
|
|
9
9
|
|
|
10
|
-
> ติดตั้ง: `npm install -D runtime-pin-check` หรือรันทันที `npx runtime-pin-check`
|
|
10
|
+
> ติดตั้ง: `npm install -D runtime-pin-check` หรือรันทันที `npx runtime-pin-check`
|
|
11
11
|
|
|
12
12
|
## ผลลัพธ์จริง
|
|
13
13
|
|
|
@@ -55,7 +55,7 @@ runtime-pin-check: 6 pins in 1 project root, checked on 2026-11-25 (end-of-life
|
|
|
55
55
|
|
|
56
56
|
## ต่างจากเครื่องมืออื่นอย่างไร
|
|
57
57
|
|
|
58
|
-
EOL
|
|
58
|
+
EOL **ไม่ใช่จุดเด่นของเรา** เครื่องมืออื่นทำให้ Node อยู่แล้ว (ดูตารางด้านล่าง) สิ่งที่เรามีและเครื่องมือที่เรารันเทียบไม่มี:
|
|
59
59
|
|
|
60
60
|
1. **เทียบข้ามไฟล์ทั้งสามภาษา** (Node, Python, Go) ด้วย semver พร้อม `ไฟล์:บรรทัด` ของทุก source
|
|
61
61
|
2. **`--fix` ที่ปลอดภัยกับ range และคงไบต์เดิม** เขียนทับเฉพาะ pin ที่เป็นเลขเวอร์ชันตรง ๆ (`22`, `22.11.0`, `node:22-alpine`) ส่วน range
|
|
@@ -75,7 +75,7 @@ EOL และ GitHub Action **ไม่ใช่จุดเด่นของ
|
|
|
75
75
|
| `ARG NODE_VERSION=24` ใน `FROM` | อ่านค่า | พลาด (เห็นแค่ 22.11.0) | อ่านเป็นข้อความดิบ `node:${NODE_VERSION}-alpine` |
|
|
76
76
|
| `--fix` | แก้ pin ตรง ๆ คงไบต์เดิม | `--save` แก้ช่องเดียว (`engines`) | ในการรันของ recon เสนอแก้ `engines ">=22 <23"` เป็น `"20"` |
|
|
77
77
|
| EOL | มี (offline, Node/Python/Go) | มีสำหรับ Node | ไม่มี |
|
|
78
|
-
| GitHub Action |
|
|
78
|
+
| GitHub Action | ไม่มี (รัน CLI ใน workflow ได้) | มี | ไม่ได้ตรวจ |
|
|
79
79
|
| 40 repo จริง: จำนวน finding | 139 | 29 | 1,397 |
|
|
80
80
|
| ใน 26 จุดขัดกันจริงของเรา เครื่องมือนั้นอ้างไฟล์:บรรทัดเดียวกันกี่จุด | — | 5 | 24 |
|
|
81
81
|
|
|
@@ -85,14 +85,15 @@ EOL และ GitHub Action **ไม่ใช่จุดเด่นของ
|
|
|
85
85
|
|
|
86
86
|
## ใช้งาน
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
ต้องใช้ Node 22 ขึ้นไป:
|
|
89
89
|
|
|
90
90
|
```bash
|
|
91
|
-
|
|
92
|
-
npm
|
|
93
|
-
node dist/cli.js [dir] [options]
|
|
91
|
+
npx runtime-pin-check [dir] [options]
|
|
92
|
+
# หรือติดตั้งในโปรเจกต์: npm install -D runtime-pin-check แล้วรัน npx runtime-pin-check
|
|
94
93
|
```
|
|
95
94
|
|
|
95
|
+
จากซอร์ส (สำหรับพัฒนาโปรเจกต์นี้): `npm ci && npm run build` แล้วรัน `node dist/cli.js [dir] [options]`
|
|
96
|
+
|
|
96
97
|
| ตัวเลือก | ความหมาย |
|
|
97
98
|
|---|---|
|
|
98
99
|
| `[dir]` | โฟลเดอร์ที่สแกน (ค่าเริ่มต้น `.`) |
|
|
@@ -100,7 +101,8 @@ node dist/cli.js [dir] [options]
|
|
|
100
101
|
| `--runtime node,python,go` | ตรวจเฉพาะบางภาษา |
|
|
101
102
|
| `--fail-on error\|warning\|info` | รหัสออก `1` เมื่อมี finding ระดับนี้ขึ้นไป (ค่าเริ่มต้น `error`) |
|
|
102
103
|
| `--date YYYY-MM-DD` | ตรวจ EOL และ alias `lts/*` ณ วันนั้น (ค่าเริ่มต้น วันนี้ตาม UTC) ใช้ทำผลซ้ำได้ |
|
|
103
|
-
| `--include-fixtures` | สแกนโฟลเดอร์ fixture ด้วย (
|
|
104
|
+
| `--include-fixtures` | สแกนโฟลเดอร์ fixture ด้วย (ปกติข้ามโฟลเดอร์ชื่อ `fixtures`, `fixture`, `__fixtures__`, `test_fixtures`, `test-fixtures`, `testdata`, `test_data`, `_testdata` ทุกระดับ แต่ไม่ข้าม `test/` หรือ `tests/`) |
|
|
105
|
+
| `--version` | พิมพ์เวอร์ชัน |
|
|
104
106
|
| `--exclude <glob>` | ข้ามพาธที่ตรง (ใส่ซ้ำได้ เช่น `examples`, `docs/**`) |
|
|
105
107
|
| `--fix --to <version>` | แก้ pin เป็นเวอร์ชันนี้ (ใช้ร่วมกับ `--runtime <หนึ่งภาษา>`, `--dry-run`, `--fix-ranges`) |
|
|
106
108
|
|
|
@@ -139,49 +141,19 @@ left alone (1); nothing is guessed:
|
|
|
139
141
|
`--dry-run` พิมพ์ diff แล้วไม่เขียนไฟล์ ถ้าไม่ใส่ จะเขียนจริง เฉพาะบรรทัดที่เปลี่ยน ไบต์อื่นของไฟล์คงเดิม (รวม BOM ถ้ามี) pin ที่โปรแกรมไม่เข้าใจ
|
|
140
142
|
ถูกข้าม พร้อมบอกเหตุผล ไม่เดา
|
|
141
143
|
|
|
142
|
-
###
|
|
144
|
+
### ใช้ใน CI
|
|
143
145
|
|
|
144
|
-
|
|
145
|
-
จะรัน `npm ci && npm run build` ก่อน) การตั้ง Node 24 เปลี่ยน `node` ของ step ถัดไปใน job ของคุณด้วย CLI ต้องใช้ Node 22 ขึ้นไป
|
|
146
|
+
ไม่มี GitHub Action แยก ให้รัน CLI เป็น step ธรรมดา (ต้องใช้ Node 22 ขึ้นไป):
|
|
146
147
|
|
|
147
148
|
```yaml
|
|
148
|
-
- uses: actions/checkout@
|
|
149
|
-
- uses:
|
|
149
|
+
- uses: actions/checkout@v4
|
|
150
|
+
- uses: actions/setup-node@v4
|
|
150
151
|
with:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
exclude: |
|
|
154
|
-
examples
|
|
155
|
-
docs/**
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
ตัวอย่างไฟล์เต็มอยู่ที่ `examples/workflows/pin-check.yml`
|
|
159
|
-
|
|
160
|
-
| input | ค่าเริ่มต้น | เทียบกับ CLI |
|
|
161
|
-
|---|---|---|
|
|
162
|
-
| `path` | `.` | `[dir]` |
|
|
163
|
-
| `fail-on` | `error` | `--fail-on` |
|
|
164
|
-
| `runtime` | ว่าง (ทั้งสามภาษา) | `--runtime` |
|
|
165
|
-
| `date` | ว่าง (วันนี้ UTC) | `--date` |
|
|
166
|
-
| `exclude` | ว่าง | `--exclude` หนึ่งบรรทัดต่อหนึ่งพาธ |
|
|
167
|
-
| `include-fixtures` | `false` | `--include-fixtures` |
|
|
168
|
-
|
|
169
|
-
ค่า input ส่งผ่าน environment ไม่ถูกต่อเข้าไปในสคริปต์ รายงานแบบข้อความถูกใส่ใน job summary ด้วย CI ของ repository นี้ทดสอบ Action กับ `examples/clean-demo`
|
|
170
|
-
(ต้องผ่าน) และ `examples/conflict-demo` (ต้องล้ม) และสแกน repository ตัวเอง
|
|
171
|
-
|
|
172
|
-
#### การออก release ของ Action (สำหรับผู้ดูแลโปรเจกต์)
|
|
173
|
-
|
|
174
|
-
`dist/` ไม่ถูก commit บน `main` ถ้าจะให้ผู้ใช้ไม่ต้อง build ตอนรัน ให้ออก release ที่ tree มี `dist/`:
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
git switch -c release/v0.1.0
|
|
178
|
-
npm ci && npm run build
|
|
179
|
-
git add -f dist # dist/ ถูก ignore บน main
|
|
180
|
-
git commit -m "build: dist for v0.1.0"
|
|
181
|
-
git tag v0.1.0
|
|
152
|
+
node-version: 22
|
|
153
|
+
- run: npx runtime-pin-check .
|
|
182
154
|
```
|
|
183
155
|
|
|
184
|
-
|
|
156
|
+
ใน GitHub Actions (`GITHUB_ACTIONS=true`) จะพิมพ์ annotation ให้ด้วย และ step จะล้มตามรหัสออกด้านบน
|
|
185
157
|
|
|
186
158
|
## รหัส finding
|
|
187
159
|
|
|
@@ -201,10 +173,10 @@ git tag v0.1.0
|
|
|
201
173
|
|
|
202
174
|
- **Node:** `.nvmrc`, `.node-version`, `package.json` (`engines.node`, `volta.node`, `devEngines.runtime`), `.tool-versions`, `mise.toml`,
|
|
203
175
|
`Dockerfile*` (`FROM node:` รวม multi-stage และ `ARG` ที่ใช้ใน `FROM`), `.github/workflows/*.yml` (`actions/setup-node`, ค่าใน matrix เป็น source แยก),
|
|
204
|
-
`.gitlab-ci.yml` (`image: node:`)
|
|
176
|
+
`.gitlab-ci.yml` (`image: node:` ระดับบนสุด, `default:` และของแต่ละ job)
|
|
205
177
|
- **Python:** `.python-version`, `pyproject.toml` (`project.requires-python`, `tool.poetry.dependencies.python`), `.tool-versions`, `mise.toml`,
|
|
206
|
-
`Dockerfile*`, `actions/setup-python`, `runtime.txt` ยังไม่อ่าน `Pipfile`, `setup.py`/`setup.cfg`, `tox.ini` และ action อื่นเช่น `astral-sh/setup-uv`
|
|
207
|
-
- **Go:** `go.mod` (`go` และ `toolchain`), `.tool-versions`, `mise.toml`, `Dockerfile*` (`FROM golang:`), `actions/setup-go` ยังไม่อ่าน `go.work` และ `GOTOOLCHAIN`
|
|
178
|
+
`Dockerfile*`, `.gitlab-ci.yml` (`image: python:`), `actions/setup-python`, `runtime.txt` ยังไม่อ่าน `Pipfile`, `setup.py`/`setup.cfg`, `tox.ini` และ action อื่นเช่น `astral-sh/setup-uv`
|
|
179
|
+
- **Go:** `go.mod` (`go` และ `toolchain`), `.tool-versions`, `mise.toml`, `Dockerfile*` (`FROM golang:`), `.gitlab-ci.yml` (`image: golang:`), `actions/setup-go` ยังไม่อ่าน `go.work` และ `GOTOOLCHAIN`
|
|
208
180
|
- Docker image: ตีความเป็นภาษาก็ต่อเมื่อเป็น image ทางการและ mirror ที่รู้จัก ถ้าเป็น image อื่นจะไม่เดา
|
|
209
181
|
|
|
210
182
|
## ผูกไฟล์กับโปรเจกต์อย่างไร (สำคัญใน monorepo)
|
|
@@ -249,6 +221,12 @@ TI (ถูกตามข้อเท็จจริงแต่ผู้ดู
|
|
|
249
221
|
ส่วนใหญ่เป็นขั้นตอน CI ที่ root ซึ่งไม่มี manifest และไม่มีพาธบอกว่าเป็นของโปรเจกต์ไหน ตัวอย่างความขัดแย้งจริงที่เราพลาดเพราะเรื่องนี้ เช่น node 18 เทียบ 20 ใน workflow สองไฟล์ที่ root ที่ไม่มี manifest ของ Node
|
|
250
222
|
- **ขีดจำกัดที่ยังมี:** repository ที่มี Dockerfile หนึ่งไฟล์ต่อ runtime หนึ่งรุ่น (เช่น cypress-docker-images) ยังเทียบกับ pin ที่ root และให้ finding เท็จ
|
|
251
223
|
- **job ที่ประกาศ `defaults.run.working-directory` แต่ override บาง step กลับไปที่ root** ถูกผูกกับโฟลเดอร์ default ทั้ง job (ตั้งใจ: นี่คือวิธีที่ monorepo ประกาศว่า job รับใช้โปรเจกต์ไหน)
|
|
224
|
+
- **pin ที่ root ซึ่งโปรเจกต์ลูกทุกตัวรับต่อ อาจถูกรายงานซ้ำหนึ่งครั้งต่อโปรเจกต์** เช่น `.nvmrc` ที่ root เทียบกับ Dockerfile ใน `examples/*` แต่ละตัว
|
|
225
|
+
แต่ละรายการถูกต้องตามกติกา แต่ใน monorepo ที่มีโปรเจกต์ตัวอย่างหลายสิบตัวจะยาว ใช้ `--exclude examples` ถ้าไม่ต้องการตรวจโฟลเดอร์ตัวอย่าง
|
|
226
|
+
- **Dockerfile หลาย stage ที่ใช้ Node คนละรุ่นโดยตั้งใจ** (เช่น build ด้วย 24 แล้วรันด้วย 22) ถูกรายงานเป็น `VERSION_CONFLICT` "across 1 file" ตามกติกา
|
|
227
|
+
- **`mise.toml` และ `.tool-versions` ที่ระบุหลายเวอร์ชัน** (`python = ["3.12", "3.11"]`) อ่านเฉพาะตัวแรก ซึ่งเป็นตัวที่ใช้จริง ตัวที่เหลือไม่ถูกเทียบ
|
|
228
|
+
- แถว source ในรายงานแสดงค่าตามที่เขียนในไฟล์ เช่น `${{ env.PYTHON_VERSION }}` แม้ข้อความหัวเรื่องจะแสดงค่าที่แปลงแล้ว
|
|
229
|
+
- PyPy และ GraalPy (`pypy-3.11` ใน `actions/setup-python`) ไม่ถูกเทียบกับ pin ของ CPython ระบบรายงานเป็น `UNPARSEABLE` พร้อมเหตุผล
|
|
252
230
|
- ไม่มี precision ของเครื่องมืออื่นให้เทียบ เพราะไม่ได้ติดป้าย finding ของเขา
|
|
253
231
|
- diagnostic ที่เป็นเท็จ 2 รายการใน 1 จาก 40 repo (YAML หลายเอกสารใต้ `.github/workflows/resources/` ที่ไม่ใช่ workflow) ถูกแก้ใน `f80ed6e` วัดซ้ำบน 40 repo เดิมแล้ว: finding เหมือน `483d4fb` ทุก repo และ diagnostic เหลือ 0
|
|
254
232
|
แต่ยังไม่มี diagnostic จริง (ไฟล์พังจริง) ใน 40 repo นี้ จึงยังไม่มีหลักฐานจาก repo จริงว่า diagnostic จับไฟล์พังได้ (มีเฉพาะ unit test)
|
|
@@ -281,7 +259,7 @@ Finds **Node, Python and Go** versions that are pinned inconsistently across one
|
|
|
281
259
|
`.python-version`, `pyproject.toml`, `go.mod`, GitHub Actions workflows, `.gitlab-ci.yml`, `mise.toml`, `.tool-versions`), with **file and line** for every
|
|
282
260
|
pin, real semver comparison, results per project in a monorepo, and a `--fix` that changes only the version digits and no other byte. No AI, no network, no API key at run time.
|
|
283
261
|
|
|
284
|
-
> Install: `npm install -D runtime-pin-check`, or run `npx runtime-pin-check`.
|
|
262
|
+
> Install: `npm install -D runtime-pin-check`, or run `npx runtime-pin-check`.
|
|
285
263
|
|
|
286
264
|
### What it looks like
|
|
287
265
|
|
|
@@ -298,7 +276,7 @@ and `Dockerfile` against `package.json` `>=22 <23`, and for `.python-version` 3.
|
|
|
298
276
|
|
|
299
277
|
### How it differs
|
|
300
278
|
|
|
301
|
-
End-of-life checks
|
|
279
|
+
End-of-life checks are **not** what sets this apart: other tools already provide them for Node. What this adds, and the tools we ran against lack:
|
|
302
280
|
|
|
303
281
|
1. **Cross-file comparison for all three runtimes** with semver and `file:line` for every source.
|
|
304
282
|
2. **A `--fix` that is safe with ranges and byte-preserving**: it rewrites only plain version pins (`22`, `22.11.0`, `node:22-alpine`); ranges (`>=22 <23`) are
|
|
@@ -318,7 +296,7 @@ Compared with **engines-gauge 1.1.0** and **conflic 1.1.6**. Every cell comes fr
|
|
|
318
296
|
| `ARG NODE_VERSION=24` used in `FROM` | value resolved | missed (saw only 22.11.0) | raw text `node:${NODE_VERSION}-alpine` |
|
|
319
297
|
| `--fix` | rewrites plain pins, bytes preserved | `--save` edits one field (`engines`) | in the recon run it proposed `engines ">=22 <23"` -> `"20"` |
|
|
320
298
|
| End-of-life | yes (offline; Node, Python, Go) | yes, for Node | no |
|
|
321
|
-
| GitHub Action |
|
|
299
|
+
| GitHub Action | no (run the CLI in a workflow) | yes | not checked |
|
|
322
300
|
| 40 real repos: findings | 139 | 29 | 1,397 |
|
|
323
301
|
| Of our 26 true drift findings, how many the tool reports at the same file:line | — | 5 | 24 |
|
|
324
302
|
|
|
@@ -328,53 +306,36 @@ test/fixtures/testdata folders; (4) the space is crowded and moving fast: recon
|
|
|
328
306
|
|
|
329
307
|
### Use
|
|
330
308
|
|
|
331
|
-
|
|
309
|
+
Node 22 or newer:
|
|
332
310
|
|
|
333
311
|
```bash
|
|
334
|
-
|
|
335
|
-
npm
|
|
336
|
-
node dist/cli.js [dir] [options]
|
|
312
|
+
npx runtime-pin-check [dir] [options]
|
|
313
|
+
# or install it in a project: npm install -D runtime-pin-check, then npx runtime-pin-check
|
|
337
314
|
```
|
|
338
315
|
|
|
316
|
+
From source (to work on this project): `npm ci && npm run build`, then `node dist/cli.js [dir] [options]`.
|
|
317
|
+
|
|
339
318
|
Options are listed in the Thai table above and in `--help`: `--json`, `--runtime node,python,go`, `--fail-on error|warning|info` (default `error`), `--date YYYY-MM-DD`,
|
|
340
|
-
`--include-fixtures`, `--exclude <glob>` (repeatable), and `--fix --to <version>` with `--runtime <one>`, `--dry-run`, `--fix-ranges`. Exit codes: `0` nothing at or above `--fail-on`,
|
|
319
|
+
`--include-fixtures` (fixture folders such as `fixtures`, `__fixtures__`, `test_fixtures`, `testdata`, `test_data` are skipped by default; `test/` and `tests/` are not), `--exclude <glob>` (repeatable), `--version`, and `--fix --to <version>` with `--runtime <one>`, `--dry-run`, `--fix-ranges`. Exit codes: `0` nothing at or above `--fail-on`,
|
|
341
320
|
`1` findings, `2` usage or I/O error. With `GITHUB_ACTIONS=true` it also prints `::error file=…,line=…::` annotations. To scan this repository itself leave out the deliberate
|
|
342
321
|
conflicts: `node dist/cli.js . --exclude examples`.
|
|
343
322
|
|
|
344
323
|
`--fix` demo (`--dry-run` prints the diff and writes nothing): the Thai section shows `node dist/cli.js examples/conflict-demo --fix --to 22 --runtime node --dry-run` changing
|
|
345
324
|
`.nvmrc` 20 -> 22 and `Dockerfile` `node:18-alpine` -> `node:22-alpine`, and leaving `package.json`'s `">=22 <23"` alone because it is a range.
|
|
346
325
|
|
|
347
|
-
####
|
|
326
|
+
#### In CI
|
|
348
327
|
|
|
349
|
-
|
|
350
|
-
Setting up Node 24 changes `node` for the later steps of your job too; the CLI needs Node 22 or newer.
|
|
328
|
+
There is no separate GitHub Action; run the CLI as a plain step (Node 22 or newer):
|
|
351
329
|
|
|
352
330
|
```yaml
|
|
353
|
-
- uses: actions/checkout@
|
|
354
|
-
- uses:
|
|
331
|
+
- uses: actions/checkout@v4
|
|
332
|
+
- uses: actions/setup-node@v4
|
|
355
333
|
with:
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
exclude: |
|
|
359
|
-
examples
|
|
360
|
-
docs/**
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
Inputs: `path` (default `.`), `fail-on` (`error`), `runtime` (empty = all), `date` (empty = today, UTC), `exclude` (one path per line), `include-fixtures` (`false`); each maps to the CLI flag of the same name.
|
|
364
|
-
Inputs travel through the environment, never into the script text. The text report is also added to the job summary. A full sample is in `examples/workflows/pin-check.yml`. This repository's CI runs
|
|
365
|
-
the Action on `examples/clean-demo` (must pass), on `examples/conflict-demo` (must fail), and on the repository itself.
|
|
366
|
-
|
|
367
|
-
**Releasing the Action (for the maintainer).** `dist/` is not committed on `main`. To let users skip the build, release a tree that contains it:
|
|
368
|
-
|
|
369
|
-
```bash
|
|
370
|
-
git switch -c release/v0.1.0
|
|
371
|
-
npm ci && npm run build
|
|
372
|
-
git add -f dist # dist/ is ignored on main
|
|
373
|
-
git commit -m "build: dist for v0.1.0"
|
|
374
|
-
git tag v0.1.0
|
|
334
|
+
node-version: 22
|
|
335
|
+
- run: npx runtime-pin-check .
|
|
375
336
|
```
|
|
376
337
|
|
|
377
|
-
|
|
338
|
+
Under GitHub Actions (`GITHUB_ACTIONS=true`) it also prints annotations, and the step fails by the exit codes above.
|
|
378
339
|
|
|
379
340
|
### Finding codes
|
|
380
341
|
|
|
@@ -386,10 +347,10 @@ Broken YAML, TOML or JSON is reported as a file-level diagnostic (in `--json` an
|
|
|
386
347
|
### What it reads
|
|
387
348
|
|
|
388
349
|
- **Node:** `.nvmrc`, `.node-version`, `package.json` (`engines.node`, `volta.node`, `devEngines.runtime`), `.tool-versions`, `mise.toml`, `Dockerfile*` (`FROM node:`, multi-stage, `ARG` used in `FROM`),
|
|
389
|
-
`.github/workflows/*.yml` (`actions/setup-node`; each matrix value is its own source), `.gitlab-ci.yml` (`image: node:`).
|
|
390
|
-
- **Python:** `.python-version`, `pyproject.toml` (`project.requires-python`, `tool.poetry.dependencies.python`), `.tool-versions`, `mise.toml`, `Dockerfile*`, `actions/setup-python`, `runtime.txt`.
|
|
350
|
+
`.github/workflows/*.yml` (`actions/setup-node`; each matrix value is its own source), `.gitlab-ci.yml` (`image: node:` at the top level, under `default:` and in each job).
|
|
351
|
+
- **Python:** `.python-version`, `pyproject.toml` (`project.requires-python`, `tool.poetry.dependencies.python`), `.tool-versions`, `mise.toml`, `Dockerfile*`, `.gitlab-ci.yml` (`image: python:`), `actions/setup-python`, `runtime.txt`.
|
|
391
352
|
Not read: `Pipfile`, `setup.py`/`setup.cfg`, `tox.ini`, other actions such as `astral-sh/setup-uv`.
|
|
392
|
-
- **Go:** `go.mod` (`go` and `toolchain`), `.tool-versions`, `mise.toml`, `Dockerfile*` (`FROM golang:`), `actions/setup-go`. Not read: `go.work`, `GOTOOLCHAIN`.
|
|
353
|
+
- **Go:** `go.mod` (`go` and `toolchain`), `.tool-versions`, `mise.toml`, `Dockerfile*` (`FROM golang:`), `.gitlab-ci.yml` (`image: golang:`), `actions/setup-go`. Not read: `go.work`, `GOTOOLCHAIN`.
|
|
393
354
|
- Docker images count as a runtime only when they are official images or well-known mirrors; other images are ignored, not guessed.
|
|
394
355
|
|
|
395
356
|
### How files are tied to projects
|
|
@@ -429,6 +390,12 @@ Known limits, stated plainly:
|
|
|
429
390
|
mostly root-level CI steps in repositories whose root has no manifest and where nothing names the project. A real conflict we miss because of this: node 18 against 20 in two workflows at the root of a repository with no Node manifest.
|
|
430
391
|
- **A Dockerfile per runtime release** (for example cypress-docker-images) still compares with the root pin and produces a false finding.
|
|
431
392
|
- **A job that declares `defaults.run.working-directory` but overrides one step back to the root** is bound to the default folder for the whole job. This is deliberate: it is how a monorepo says which project a job serves.
|
|
393
|
+
- **A root pin that every child project inherits can be reported once per project.** For example a root `.nvmrc` against the Dockerfile of each `examples/*` project:
|
|
394
|
+
each finding is correct under the rules, but a monorepo with dozens of example projects gets a long list. Use `--exclude examples` to leave example folders out.
|
|
395
|
+
- **A multi-stage Dockerfile that uses different Node versions on purpose** (build on 24, run on 22) is reported as a `VERSION_CONFLICT` "across 1 file", as the rules say.
|
|
396
|
+
- **`mise.toml` and `.tool-versions` entries that list several versions** (`python = ["3.12", "3.11"]`) are read for the first one only, the one that is used; the others are not compared.
|
|
397
|
+
- A source row shows the value as written in the file, for example `${{ env.PYTHON_VERSION }}`, even where the headline shows the resolved value.
|
|
398
|
+
- PyPy and GraalPy (`pypy-3.11` in `actions/setup-python`) are not compared with CPython pins; they are reported as `UNPARSEABLE` with that reason.
|
|
432
399
|
- No precision for other tools: we did not label their findings.
|
|
433
400
|
- Two false diagnostics in 1 of the 40 repositories (multi-document YAML under `.github/workflows/resources/` that is not a workflow) were fixed in `f80ed6e` and re-measured on the same 40 repositories: the findings are identical to `483d4fb` in every repository and the diagnostics dropped to 0. There is still no real diagnostic (a genuinely broken file) among the 40, so no evidence from real repositories that diagnostics catch broken files (unit tests only).
|
|
434
401
|
- This README quotes no timings (milliseconds); they depend on the machine. Every figure here can be reproduced with the stated command.
|
|
@@ -25,7 +25,10 @@ var PARTIAL = /^(\d+)(?:\.(\d+))?(?:\.[xX*])?$/;
|
|
|
25
25
|
function versionPart(text, runtime) {
|
|
26
26
|
let t = text.trim();
|
|
27
27
|
if (runtime === "go") t = t.replace(/^go(?=\d)/, "");
|
|
28
|
-
if (runtime === "python")
|
|
28
|
+
if (runtime === "python") {
|
|
29
|
+
t = t.replace(/^python-?(?=\d)/i, "");
|
|
30
|
+
t = t.replace(/^(\d+\.\d+(?:\.\d+)?)t$/i, "$1");
|
|
31
|
+
}
|
|
29
32
|
return t.replace(/^[vV](?=\d)/, "");
|
|
30
33
|
}
|
|
31
34
|
function plainVersion(text) {
|
|
@@ -95,6 +98,9 @@ function parseConstraint(raw, runtime) {
|
|
|
95
98
|
const text = versionPart(raw, runtime);
|
|
96
99
|
if (text === "") return { kind: "unknown", reason: "empty value" };
|
|
97
100
|
if (ALIAS.test(text)) return { kind: "alias", alias: text.toLowerCase() };
|
|
101
|
+
if (runtime === "python" && /^(pypy|graalpy)/i.test(text)) {
|
|
102
|
+
return { kind: "unknown", reason: "a PyPy/GraalPy build; its version is not compared with CPython pins" };
|
|
103
|
+
}
|
|
98
104
|
const plain = plainVersion(text);
|
|
99
105
|
if (plain) return plain;
|
|
100
106
|
if (/\$\{|\$\(|\{\{/.test(text)) return { kind: "unknown", reason: "contains a variable or template expression" };
|
|
@@ -356,28 +362,33 @@ function versionConflict(out, scope, pins, ranges) {
|
|
|
356
362
|
`${scope.runtime}: ${groups} different versions across ${plural(files, "file")}: ${text}; no version satisfies all of them.`
|
|
357
363
|
);
|
|
358
364
|
}
|
|
365
|
+
function precisionOf(c) {
|
|
366
|
+
return c.kind === "exact" ? 3 : c.kind === "partial" ? c.version.split(".").length : 0;
|
|
367
|
+
}
|
|
359
368
|
function precisionMismatch(out, scope, pins) {
|
|
369
|
+
const plain = pins.filter((p) => precisionOf(p.source.constraint) > 0);
|
|
370
|
+
const groups = [];
|
|
371
|
+
for (const coarse of [...plain].sort((a, b) => byPosition(a.source, b.source))) {
|
|
372
|
+
const level = precisionOf(coarse.source.constraint);
|
|
373
|
+
if (level === 3) continue;
|
|
374
|
+
const finer = plain.filter((p) => precisionOf(p.source.constraint) > level && overlaps(coarse.range, p.range)).map((p) => p.source).sort(byPosition);
|
|
375
|
+
const covered = groups.some((g) => g.finer.includes(coarse.source) && finer.every((f) => g.finer.includes(f)));
|
|
376
|
+
if (finer.length > 0 && !covered) groups.push({ coarse: coarse.source, finer });
|
|
377
|
+
}
|
|
378
|
+
if (groups.length === 0) return;
|
|
360
379
|
const involved = /* @__PURE__ */ new Set();
|
|
361
|
-
for (
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const b = pins[j];
|
|
365
|
-
const ca = a.source.constraint;
|
|
366
|
-
const cb = b.source.constraint;
|
|
367
|
-
if ((ca.kind === "exact" || ca.kind === "partial") && (cb.kind === "exact" || cb.kind === "partial") && ca.version !== cb.version && overlaps(a.range, b.range)) {
|
|
368
|
-
involved.add(a.source);
|
|
369
|
-
involved.add(b.source);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
380
|
+
for (const g of groups) {
|
|
381
|
+
involved.add(g.coarse);
|
|
382
|
+
for (const f of g.finer) involved.add(f);
|
|
372
383
|
}
|
|
373
|
-
|
|
374
|
-
const
|
|
384
|
+
const pin = (s) => `${describeConstraint(s.constraint)} (${where(s)})`;
|
|
385
|
+
const text = groups.map((g) => `${pin(g.coarse)} includes ${g.finer.map(pin).join(", ")}`).join("; ");
|
|
375
386
|
out.add(
|
|
376
387
|
"PRECISION_MISMATCH",
|
|
377
388
|
scope.runtime,
|
|
378
389
|
[...involved],
|
|
379
390
|
scope.root,
|
|
380
|
-
`${scope.runtime}:
|
|
391
|
+
`${scope.runtime}: pins that agree but are written at different precision: ${text}.`
|
|
381
392
|
);
|
|
382
393
|
}
|
|
383
394
|
function checkAlone(out, source, scope, options) {
|
|
@@ -563,4 +574,4 @@ export {
|
|
|
563
574
|
findProjectRoots,
|
|
564
575
|
projectRootsOf
|
|
565
576
|
};
|
|
566
|
-
//# sourceMappingURL=chunk-
|
|
577
|
+
//# sourceMappingURL=chunk-TRO76P2I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constraint.ts","../src/compare.ts","../src/scan.ts"],"sourcesContent":["/**\n * Turns the raw text of a version pin into a `Constraint`, and a constraint into a semver range.\n * Node pins use npm semver syntax; Python pins use PEP 440 specifiers (plus Poetry's `^`/`~`);\n * Go pins use `1.22`, `1.22.3` or `go1.22.3`. Nothing here guesses: text that does not fit\n * becomes an `unknown` constraint carrying the reason.\n */\nimport semver from 'semver'\nimport type { Constraint, Runtime } from './types'\n\n/** Aliases that float to whatever is newest: reported as FLOATING_ALIAS, never compared. */\nconst FLOATING = new Set(['latest', 'node', 'stable', 'current', 'system', 'oldstable'])\n\n/** Alias words each runtime accepts in version files and CI inputs. */\nconst ALIAS = /^(lts\\/\\*|lts\\/[a-z][a-z-]*|lts|latest|node|stable|current|system|oldstable)$/i\n\n/** Docker tag words that name an image variant, not a version (`python:slim`, `golang:alpine`). */\nconst DOCKER_VARIANTS = new Set([\n 'alpine',\n 'slim',\n 'bookworm',\n 'bullseye',\n 'buster',\n 'stretch',\n 'jessie',\n 'trixie',\n 'noble',\n 'jammy',\n 'focal',\n 'windowsservercore',\n 'nanoserver',\n])\n\n/** True for `latest`, `node`, `stable` and the like: pins that move by themselves. */\nexport function isFloatingAlias(alias: string): boolean {\n return FLOATING.has(alias.toLowerCase())\n}\n\nconst EXACT = /^\\d+\\.\\d+\\.\\d+$/\nconst PARTIAL = /^(\\d+)(?:\\.(\\d+))?(?:\\.[xX*])?$/\n\nfunction versionPart(text: string, runtime: Runtime): string {\n let t = text.trim()\n if (runtime === 'go') t = t.replace(/^go(?=\\d)/, '')\n if (runtime === 'python') {\n t = t.replace(/^python-?(?=\\d)/i, '')\n // CPython free-threaded builds (`3.14t`, actions/setup-python) are that CPython version.\n t = t.replace(/^(\\d+\\.\\d+(?:\\.\\d+)?)t$/i, '$1')\n }\n return t.replace(/^[vV](?=\\d)/, '')\n}\n\n/** Exact or partial when the text is a plain version (`22`, `22.11`, `22.x`, `v22.11.0`). */\nfunction plainVersion(text: string): Constraint | undefined {\n if (EXACT.test(text)) return { kind: 'exact', version: text }\n const m = PARTIAL.exec(text)\n if (m) return { kind: 'partial', version: m[2] === undefined ? (m[1] as string) : `${m[1]}.${m[2]}` }\n return undefined\n}\n\nfunction pad(version: string): string {\n const parts = version.split('.')\n while (parts.length < 3) parts.push('0')\n return parts.slice(0, 3).join('.')\n}\n\n/** One PEP 440 / Poetry clause as semver, '' for a clause semver cannot express (`!=`), undefined if invalid. */\nfunction pythonClause(clause: string): string | undefined {\n const m = /^(~=|===|==|!=|<=|>=|<|>|\\^|~)?\\s*(\\d+(?:\\.\\d+){0,3})(\\.\\*)?$/.exec(clause.trim())\n if (!m) return undefined\n const op = m[1] ?? '=='\n const version = m[2] as string\n const wildcard = m[3] !== undefined\n const parts = version.split('.').map(Number)\n if (parts.length > 3) return undefined\n if (wildcard && op !== '==' && op !== '!=') return undefined\n switch (op) {\n case '===':\n return undefined\n case '!=':\n // An exclusion only narrows the range; semver has no \"not equal\", so it is left out.\n return ''\n case '==':\n // PEP 440 pads with zeros: '==3.10' is 3.10.0 only; '==3.10.*' is the whole 3.10 series.\n return wildcard ? partialRange(version) : `=${pad(version)}`\n case '~=': {\n if (parts.length < 2) return undefined\n const upper = parts.slice(0, -1)\n upper[upper.length - 1] = (upper[upper.length - 1] as number) + 1\n return `>=${pad(version)} <${pad(upper.join('.'))}-0`\n }\n case '<':\n return `<${pad(version)}-0`\n case '<=':\n return `<=${pad(version)}`\n case '>':\n return `>${pad(version)}`\n case '>=':\n return `>=${pad(version)}`\n case '^':\n case '~':\n return semver.validRange(`${op}${version}`) ?? undefined\n default:\n return undefined\n }\n}\n\nfunction pythonRange(text: string): string | undefined {\n const alternatives: string[] = []\n for (const alt of text.split(/\\|\\|?/)) {\n const clauses = alt.split(',').map((c) => c.trim()).filter((c) => c !== '')\n if (clauses.length === 0) return undefined\n const converted: string[] = []\n for (const clause of clauses) {\n const r = pythonClause(clause)\n if (r === undefined) return undefined\n if (r !== '') converted.push(r)\n }\n alternatives.push(converted.length > 0 ? converted.join(' ') : '*')\n }\n return semver.validRange(alternatives.join(' || ')) ?? undefined\n}\n\n/**\n * Parses the raw text of one pin for a runtime.\n *\n * @example\n * parseConstraint('v22', 'node') // { kind: 'partial', version: '22' }\n * parseConstraint('>=20 <23', 'node') // { kind: 'range', range: '>=20.0.0 <23.0.0-0' }\n * parseConstraint('>=3.10,<3.14', 'python') // { kind: 'range', range: '>=3.10.0 <3.14.0-0' }\n * parseConstraint('go1.24.4', 'go') // { kind: 'exact', version: '1.24.4' }\n * parseConstraint('lts/iron', 'node') // { kind: 'alias', alias: 'lts/iron' }\n */\nexport function parseConstraint(raw: string, runtime: Runtime): Constraint {\n const text = versionPart(raw, runtime)\n if (text === '') return { kind: 'unknown', reason: 'empty value' }\n if (ALIAS.test(text)) return { kind: 'alias', alias: text.toLowerCase() }\n if (runtime === 'python' && /^(pypy|graalpy)/i.test(text)) {\n return { kind: 'unknown', reason: 'a PyPy/GraalPy build; its version is not compared with CPython pins' }\n }\n const plain = plainVersion(text)\n if (plain) return plain\n if (/\\$\\{|\\$\\(|\\{\\{/.test(text)) return { kind: 'unknown', reason: 'contains a variable or template expression' }\n const range = runtime === 'python' ? pythonRange(text) : semver.validRange(text)\n if (range) return { kind: 'range', range }\n return { kind: 'unknown', reason: `not a ${runtime} version or version range` }\n}\n\n/**\n * The constraint of a Docker image tag: the version part only (`22-alpine` → partial 22,\n * `22.11.0-bookworm-slim` → exact, `lts-alpine` → alias lts). A missing tag or a variant-only tag\n * (`slim`, `alpine`) means `latest`. A digest (`@sha256:…`) is ignored.\n */\nexport function dockerTagConstraint(tag: string | undefined, runtime: Runtime): Constraint {\n const t = (tag ?? '').split('@')[0]?.trim() ?? ''\n if (t === '') return { kind: 'alias', alias: 'latest' }\n if (/\\$\\{?[A-Za-z_]/.test(t)) return { kind: 'unknown', reason: 'tag contains an unresolved variable' }\n const head = t.split('-')[0] as string\n const plain = plainVersion(versionPart(head, runtime))\n if (plain) return plain\n const word = head.toLowerCase()\n // A variant may carry its own OS version (`alpine3.20`, `windowsservercore1809`): still no runtime version.\n if (DOCKER_VARIANTS.has(word.replace(/[\\d.]+$/, ''))) return { kind: 'alias', alias: 'latest' }\n if (ALIAS.test(word)) return { kind: 'alias', alias: word }\n // Node images are also tagged by LTS codename (`node:iron`, `node:jod-alpine`).\n if (runtime === 'node' && /^[a-z]+$/.test(word)) return { kind: 'alias', alias: `lts/${word}` }\n return { kind: 'unknown', reason: 'tag has no recognisable version' }\n}\n\nfunction partialRange(version: string): string {\n const parts = version.split('.').map(Number)\n if (parts.length === 1) return `>=${parts[0]}.0.0 <${(parts[0] as number) + 1}.0.0-0`\n if (parts.length === 2) return `>=${parts[0]}.${parts[1]}.0 <${parts[0]}.${(parts[1] as number) + 1}.0-0`\n return `=${pad(version)}`\n}\n\n/**\n * The semver range a constraint allows, for comparison (`partial 22` → `>=22.0.0 <23.0.0-0`).\n * Aliases and unknown constraints have none and return undefined.\n */\nexport function toRange(c: Constraint): string | undefined {\n switch (c.kind) {\n case 'exact':\n return c.version\n case 'partial':\n return partialRange(c.version)\n case 'range':\n return c.range\n default:\n return undefined\n }\n}\n\n/** Human-readable form of a constraint for messages (`22`, `>=20 <23`, `lts/iron`). */\nexport function describeConstraint(c: Constraint): string {\n switch (c.kind) {\n case 'exact':\n case 'partial':\n return c.version\n case 'range':\n return c.range\n case 'alias':\n return c.alias\n case 'unknown':\n return `unparseable (${c.reason})`\n }\n}\n","/**\n * Per-scope comparison (docs/TASKS.md, Domain model and Finding codes). Sources are grouped by\n * project root and runtime; within a group every pair of pins is checked for overlap.\n * EOL findings are not produced here (rpc-eol adds them).\n */\nimport semver from 'semver'\nimport { describeConstraint, isFloatingAlias, toRange } from './constraint'\nimport type { CompareOptions, Finding, FindingCode, Runtime, Scope, Severity, Source, SourceRef } from './types'\n\nconst MANIFESTS = new Set(['package.json', 'pyproject.toml', 'go.mod'])\n\nfunction dirOf(file: string): string {\n const i = file.lastIndexOf('/')\n return i < 0 ? '.' : file.slice(0, i)\n}\n\nfunction baseOf(file: string): string {\n return file.slice(file.lastIndexOf('/') + 1)\n}\n\nfunction normalizeDir(dir: string): string {\n const d = dir.replace(/\\\\/g, '/').replace(/^\\.\\/+/, '').replace(/\\/+$/, '')\n return d === '' ? '.' : d\n}\n\n/**\n * True for a repo-level CI or tool file that applies to every project root: anything under\n * `.github/` (any letter case: `.GitHub/` exists in the wild), `.gitlab-ci.yml`, and root-level\n * version files (`.nvmrc`, `.tool-versions`, `mise.toml` …). Root manifests and Dockerfiles belong\n * to the repo-root project only.\n */\nexport function isSharedFile(file: string): boolean {\n const f = file.replace(/\\\\/g, '/')\n if (/^\\.github\\//i.test(f)) return true\n if (f.includes('/')) return false\n const base = baseOf(f)\n if (MANIFESTS.has(base)) return false\n if (/^dockerfile/i.test(base) || /\\.dockerfile$/i.test(base)) return false\n return true\n}\n\n/** The deepest project root that contains `dir` (`.` when none does). */\nfunction deepestRoot(dir: string, roots: readonly string[]): string {\n let best = '.'\n for (const r of roots) {\n if (r === '.') continue\n if ((dir === r || dir.startsWith(`${r}/`)) && r.length > best.length) best = r\n }\n return best\n}\n\n/**\n * The project roots a source applies to. After `bindSources` this is `source.boundTo` (`[]` for an\n * UNBOUND source). Without binding it falls back to the pre-A12 rule: the deepest containing root,\n * or every root for a shared CI/tool file (only the `workingDirectory` root when a step sets one).\n *\n * @param roots - Project roots from `findProjectRoots` (relative, `.` = repo root).\n */\nexport function scopesOf(source: Source, roots: readonly string[]): string[] {\n if (source.boundTo !== undefined) return [...source.boundTo]\n const all = roots.length > 0 ? [...roots] : ['.']\n if (isSharedFile(source.file)) {\n if (source.workingDirectory === undefined) return all\n return [deepestRoot(normalizeDir(source.workingDirectory), all)]\n }\n return [deepestRoot(dirOf(source.file.replace(/\\\\/g, '/')), all)]\n}\n\n/** Tool pin files that version managers look up from the working directory upwards. */\nfunction toolPinKind(file: string): string | undefined {\n const base = baseOf(file)\n if (base === '.nvmrc' || base === '.node-version' || base === '.python-version' || base === '.tool-versions') return base\n if (/^\\.?mise(\\.[\\w-]+)?\\.toml$/i.test(base)) return 'mise'\n return undefined\n}\n\n/** CI files at the repo root: `.github/**` (any letter case) and `.gitlab-ci.yml`. */\nfunction isRootCiFile(file: string): boolean {\n return /^\\.github\\//i.test(file) || /^\\.gitlab-ci\\.ya?ml$/i.test(file)\n}\n\n/** A Dockerfile (`Dockerfile`, `Dockerfile.dev`, `api.Dockerfile`) or a Compose file, in any folder. */\nfunction isContainerFile(file: string): boolean {\n const base = baseOf(file)\n return /^dockerfile/i.test(base) || /\\.dockerfile$/i.test(base) || /^(docker-)?compose(\\.[\\w-]+)*\\.ya?ml$/i.test(base)\n}\n\n/** Paths written as globs (`**\\/package-lock.json`) name no single project (A14): ignored. */\nfunction isGlobPath(path: string): boolean {\n return /[*?[{]/.test(path)\n}\n\n/** The parent directories of `dir`, nearest first, up to but not including `stop`. */\nfunction dirsBetween(dir: string, stop: string): string[] {\n const out: string[] = []\n let d = dir\n while (d !== stop && d !== '.') {\n out.push(d)\n const i = d.lastIndexOf('/')\n d = i < 0 ? '.' : d.slice(0, i)\n }\n return out\n}\n\n/**\n * Binds every source to the project roots it really belongs to (docs/TASKS.md A12) and returns\n * copies with `boundTo` set. Precision over recall: when the files do not say which project a\n * source serves, it is UNBOUND (`[]`) and is never compared with other pins.\n *\n * - A file inside a project root binds to its nearest enclosing root only.\n * - A tool pin file (`.nvmrc`, `.node-version`, `.python-version`, `.tool-versions`, `mise.toml`)\n * also binds to every project root below its directory that has no pin file of the same kind\n * for that runtime on the way down (nvm, pyenv, asdf and mise look upwards).\n * - A root CI setup step (`.github/**`, `.gitlab-ci.yml`), and any Dockerfile or Compose file whose\n * nearest project root is the repo root (root, `docker/`, `deploy/`, `.devcontainer/` …; A14),\n * binds to its `workingDirectory` root when set; else to the repo root if the repo root has a\n * manifest for that runtime (`package.json`, `pyproject.toml`/`setup.py`/`setup.cfg`, `go.mod`);\n * else to the roots named by `source.paths` (glob paths ignored); else it is UNBOUND.\n *\n * @param roots - Project roots (relative, `.` = repo root).\n * @param manifests - `manifestRuntimesOf(files)`: runtimes whose manifest each directory holds.\n */\nexport function bindSources(\n sources: readonly Source[],\n roots: readonly string[],\n manifests: ReadonlyMap<string, ReadonlySet<Runtime>>,\n): Source[] {\n const all = roots.length > 0 ? [...roots] : ['.']\n const pinDirs = new Set<string>()\n for (const s of sources) {\n const kind = toolPinKind(s.file)\n if (kind) pinDirs.add(`${s.runtime}\\u0000${kind}\\u0000${dirOf(s.file)}`)\n }\n const bindOne = (s: Source): string[] => {\n const file = s.file.replace(/\\\\/g, '/')\n const dir = dirOf(file)\n const kind = toolPinKind(file)\n // A12 + A14: root CI, and any Dockerfile/Compose file whose nearest project root is the repo root\n // (docker/, deploy/, .devcontainer/ …), say nothing about which project they serve by location.\n if (isRootCiFile(file) || (!kind && isContainerFile(file) && deepestRoot(dir, all) === '.')) {\n if (s.workingDirectory !== undefined) return [deepestRoot(normalizeDir(s.workingDirectory), all)]\n if (manifests.get('.')?.has(s.runtime)) return ['.']\n const named = (s.paths ?? []).filter((p) => !isGlobPath(p)).map((p) => deepestRoot(normalizeDir(p), all))\n return [...new Set(named)].sort()\n }\n if (kind) {\n const below = all.filter((r) => r === dir || dir === '.' || r.startsWith(`${dir}/`))\n if (below.length === 0) return [deepestRoot(dir, all)]\n return below.filter((r) => !dirsBetween(r, dir).some((d) => pinDirs.has(`${s.runtime}\\u0000${kind}\\u0000${d}`)))\n }\n return [deepestRoot(dir, all)]\n }\n return sources.map((s) => ({ ...s, boundTo: bindOne(s) }))\n}\n\n/** Groups sources by project root and runtime, in a stable order. */\nexport function groupByScope(sources: readonly Source[], roots: readonly string[]): Scope[] {\n const groups = new Map<string, Scope>()\n for (const source of sources) {\n for (const root of scopesOf(source, roots)) {\n const key = `${root}\\u0000${source.runtime}`\n let g = groups.get(key)\n if (!g) groups.set(key, (g = { root, runtime: source.runtime, sources: [] }))\n g.sources.push(source)\n }\n }\n return [...groups.values()].sort((a, b) => (a.root === b.root ? a.runtime.localeCompare(b.runtime) : a.root < b.root ? -1 : 1))\n}\n\nfunction ref(s: Source): SourceRef {\n return { file: s.file, line: s.line, raw: s.raw, constraint: s.constraint }\n}\n\nfunction where(s: Source): string {\n return `${s.file}:${s.line}`\n}\n\nfunction byPosition(a: Source, b: Source): number {\n return a.file === b.file ? a.line - b.line : a.file < b.file ? -1 : 1\n}\n\nconst SEVERITY: Record<FindingCode, Severity> = {\n VERSION_CONFLICT: 'error',\n OUTSIDE_RANGE: 'error',\n PRECISION_MISMATCH: 'info',\n EOL_RUNTIME: 'warning',\n EOL_SOON: 'info',\n FLOATING_ALIAS: 'info',\n UNPARSEABLE: 'info',\n}\n\nconst SEVERITY_ORDER: Record<Severity, number> = { error: 0, warning: 1, info: 2 }\n\n/** A source ready for comparison: its range, and whether it is a pin (one version or a prefix). */\ninterface Comparable {\n source: Source\n range: string\n pin: boolean\n}\n\nfunction comparable(source: Source, options: CompareOptions): Comparable | undefined {\n const c = source.constraint\n if (c.kind === 'alias') {\n if (isFloatingAlias(c.alias)) return undefined\n const range = options.resolveAlias?.(source.runtime, c.alias)\n return range && semver.validRange(range) ? { source, range, pin: true } : undefined\n }\n const range = toRange(c)\n if (range === undefined) return undefined\n return { source, range, pin: c.kind === 'exact' || c.kind === 'partial' }\n}\n\nfunction overlaps(a: string, b: string): boolean {\n try {\n return semver.intersects(a, b)\n } catch {\n // Both ranges were validated; treat a library failure as \"no evidence of a conflict\".\n return true\n }\n}\n\nfunction pinText(s: Source): string {\n return `${s.runtime} ${describeConstraint(s.constraint)}`\n}\n\nclass Collector {\n private readonly found = new Map<string, Finding>()\n\n /** `scope` undefined = an UNBOUND source: the finding gets no scope. */\n add(code: FindingCode, runtime: Runtime, sources: Source[], scope: string | undefined, message: string): void {\n const ordered = [...sources].sort(byPosition)\n const key = `${code}\\u0000${runtime}\\u0000${ordered.map((s) => `${where(s)}\\u0000${s.raw}`).join('\\u0001')}`\n const existing = this.found.get(key)\n if (existing) {\n if (scope !== undefined && !existing.scopes.includes(scope)) existing.scopes.push(scope)\n return\n }\n this.found.set(key, { code, severity: SEVERITY[code], runtime, sources: ordered.map(ref), scopes: scope === undefined ? [] : [scope], message })\n }\n\n findings(): Finding[] {\n const list = [...this.found.values()]\n for (const f of list) f.scopes.sort()\n return list.sort(\n (a, b) =>\n SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity] ||\n (a.sources[0]?.file ?? '').localeCompare(b.sources[0]?.file ?? '') ||\n (a.sources[0]?.line ?? 0) - (b.sources[0]?.line ?? 0) ||\n a.code.localeCompare(b.code),\n )\n }\n}\n\nfunction outsideRange(out: Collector, scope: Scope, pin: Comparable, range: Comparable): void {\n if (overlaps(pin.range, range.range)) return\n out.add(\n 'OUTSIDE_RANGE',\n scope.runtime,\n [pin.source, range.source],\n scope.root,\n `${where(pin.source)} pins ${pinText(pin.source)}, outside the range ${describeConstraint(range.source.constraint)} required by ${where(range.source)}.`,\n )\n}\n\n/** True when some two of the comparables have no version in common. */\nfunction anyDisjoint(list: readonly Comparable[]): boolean {\n for (let i = 0; i < list.length; i++) {\n for (let j = i + 1; j < list.length; j++) if (!overlaps((list[i] as Comparable).range, (list[j] as Comparable).range)) return true\n }\n return false\n}\n\n/** `18 (.nvmrc:1), 22 (Dockerfile:1, Dockerfile:7)`: sources grouped by the version they pin. */\nfunction groupedList(sources: readonly Source[]): { text: string; groups: number; files: number } {\n const groups = new Map<string, Source[]>()\n for (const s of [...sources].sort(byPosition)) {\n const key = describeConstraint(s.constraint)\n const list = groups.get(key)\n if (list) list.push(s)\n else groups.set(key, [s])\n }\n const text = [...groups].map(([version, list]) => `${version} (${list.map(where).join(', ')})`).join(', ')\n return { text, groups: groups.size, files: new Set(sources.map((s) => s.file)).size }\n}\n\nfunction plural(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? '' : 's'}`\n}\n\n/**\n * One VERSION_CONFLICT for the scope (docs/TASKS.md A10): every pin when two pins cannot both hold,\n * plus every range source when two ranges have nothing in common, grouped by version.\n */\nfunction versionConflict(out: Collector, scope: Scope, pins: readonly Comparable[], ranges: readonly Comparable[]): void {\n const involved: Source[] = []\n if (anyDisjoint(pins)) involved.push(...pins.map((p) => p.source))\n if (anyDisjoint(ranges)) involved.push(...ranges.map((r) => r.source))\n if (involved.length === 0) return\n const { text, groups, files } = groupedList(involved)\n out.add(\n 'VERSION_CONFLICT',\n scope.runtime,\n involved,\n scope.root,\n `${scope.runtime}: ${groups} different versions across ${plural(files, 'file')}: ${text}; no version satisfies all of them.`,\n )\n}\n\n/** How many version components a plain pin states: `22` → 1, `22.11` → 2, `22.11.0` → 3. */\nfunction precisionOf(c: Source['constraint']): number {\n return c.kind === 'exact' ? 3 : c.kind === 'partial' ? c.version.split('.').length : 0\n}\n\n/**\n * One PRECISION_MISMATCH for the scope: each coarser pin with the finer pins it includes\n * (`24 (.nvmrc:1) includes 24.22.2 (a.yml:9)`). Only pins that really agree are put together:\n * a 24.x pin and a 26.x pin never share a group (rpc-harden F1).\n */\nfunction precisionMismatch(out: Collector, scope: Scope, pins: readonly Comparable[]): void {\n const plain = pins.filter((p) => precisionOf(p.source.constraint) > 0)\n const groups: { coarse: Source; finer: Source[] }[] = []\n for (const coarse of [...plain].sort((a, b) => byPosition(a.source, b.source))) {\n const level = precisionOf(coarse.source.constraint)\n if (level === 3) continue\n const finer = plain\n .filter((p) => precisionOf(p.source.constraint) > level && overlaps(coarse.range, p.range))\n .map((p) => p.source)\n .sort(byPosition)\n // 22.11 inside a group led by 22 adds nothing when its finer pins are already listed there.\n const covered = groups.some((g) => g.finer.includes(coarse.source) && finer.every((f) => g.finer.includes(f)))\n if (finer.length > 0 && !covered) groups.push({ coarse: coarse.source, finer })\n }\n if (groups.length === 0) return\n const involved = new Set<Source>()\n for (const g of groups) {\n involved.add(g.coarse)\n for (const f of g.finer) involved.add(f)\n }\n const pin = (s: Source) => `${describeConstraint(s.constraint)} (${where(s)})`\n const text = groups.map((g) => `${pin(g.coarse)} includes ${g.finer.map(pin).join(', ')}`).join('; ')\n out.add(\n 'PRECISION_MISMATCH',\n scope.runtime,\n [...involved],\n scope.root,\n `${scope.runtime}: pins that agree but are written at different precision: ${text}.`,\n )\n}\n\n/**\n * The findings one source earns on its own (UNPARSEABLE, FLOATING_ALIAS, an alias the resolver\n * cannot place), or the source ready for comparison.\n */\nfunction checkAlone(out: Collector, source: Source, scope: string | undefined, options: CompareOptions): Comparable | undefined {\n const c = source.constraint\n if (c.kind === 'unknown') {\n out.add('UNPARSEABLE', source.runtime, [source], scope, `${where(source)}: could not read \"${source.raw}\" as a ${source.runtime} version (${c.reason}).`)\n return undefined\n }\n if (c.kind === 'alias' && isFloatingAlias(c.alias)) {\n out.add(\n 'FLOATING_ALIAS',\n source.runtime,\n [source],\n scope,\n `${where(source)} pins ${source.runtime} to \"${source.raw}\", which moves with every new release; pin a version instead.`,\n )\n return undefined\n }\n const cmp = comparable(source, options)\n if (!cmp && c.kind === 'alias' && options.resolveAlias) {\n // Constraint 9: with a resolver, an alias it cannot resolve is reported, never skipped.\n out.add(\n 'UNPARSEABLE',\n source.runtime,\n [source],\n scope,\n `${where(source)}: the ${source.runtime} alias \"${source.raw}\" does not match any release line in the bundled data.`,\n )\n }\n return cmp\n}\n\n/**\n * Compares the sources of every project root and runtime and returns the findings, most severe\n * first. A finding that several roots share (a root-level file against another) is reported once\n * with every root in `scopes`.\n *\n * Rules (docs/TASKS.md A10): a pin (exact/partial/resolved alias) outside a range source →\n * OUTSIDE_RANGE, one per (pin, range) pair since each is a separate fix; pins that cannot all hold,\n * or ranges with nothing in common → ONE VERSION_CONFLICT per runtime and scope listing every pin\n * (and every range) grouped by version; agreeing pins written at different precision → ONE\n * PRECISION_MISMATCH per runtime and scope. CI matrix entries are checked only against ranges. `latest`/`node`/`stable` → FLOATING_ALIAS and are not compared;\n * text the extractor could not parse → UNPARSEABLE. Scopes with a single source produce nothing.\n * Sources bound by `bindSources` are grouped by `boundTo`; UNBOUND ones (`boundTo: []`) only get\n * UNPARSEABLE / FLOATING_ALIAS findings, with no scope (docs/TASKS.md A12).\n *\n * @param sources - Every source found in the repo.\n * @param roots - Project roots (relative, `.` = repo root); defaults to the repo root only.\n */\nexport function compareSources(sources: readonly Source[], roots: readonly string[] = ['.'], options: CompareOptions = {}): Finding[] {\n const out = new Collector()\n // UNBOUND sources (A12): their own problems are still reported, they are compared with nothing.\n for (const source of [...sources].sort(byPosition)) {\n if (source.boundTo !== undefined && source.boundTo.length === 0) checkAlone(out, source, undefined, options)\n }\n for (const scope of groupByScope(sources, roots)) {\n const pins: Comparable[] = []\n const matrix: Comparable[] = []\n for (const source of [...scope.sources].sort(byPosition)) {\n const cmp = checkAlone(out, source, scope.root, options)\n if (cmp) (source.matrix ? matrix : pins).push(cmp)\n }\n const fixed = pins.filter((p) => p.pin)\n const ranges = pins.filter((p) => !p.pin)\n for (const p of [...fixed, ...matrix]) for (const r of ranges) outsideRange(out, scope, p, r)\n versionConflict(out, scope, fixed, ranges)\n precisionMismatch(out, scope, fixed)\n }\n return out.findings()\n}\n","/**\n * Finds project roots and walks repo files (docs/TASKS.md, Domain model: Scope).\n */\nimport { readdir } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport type { Runtime } from './types'\n\n/** Directories never entered: dependencies, VCS data, build output, virtualenvs. */\nexport const IGNORED_DIRS: ReadonlySet<string> = new Set(['node_modules', '.git', 'dist', 'build', 'vendor', '.venv'])\n\n/** Manifests that say which runtime a directory's project uses (A12 root-CI rule). */\nconst MANIFEST_RUNTIME: Readonly<Record<string, Runtime>> = {\n 'package.json': 'node',\n 'pyproject.toml': 'python',\n 'setup.py': 'python',\n 'setup.cfg': 'python',\n 'go.mod': 'go',\n}\n\n/**\n * For every directory that has one, the runtimes whose manifest it holds (`package.json` → node,\n * `pyproject.toml`/`setup.py`/`setup.cfg` → python, `go.mod` → go). Keys are relative dirs, `.` = root.\n */\nexport function manifestRuntimesOf(files: readonly string[]): Map<string, Set<Runtime>> {\n const out = new Map<string, Set<Runtime>>()\n for (const file of files) {\n const i = file.lastIndexOf('/')\n const runtime = MANIFEST_RUNTIME[file.slice(i + 1)]\n if (!runtime) continue\n const dir = i < 0 ? '.' : file.slice(0, i)\n let set = out.get(dir)\n if (!set) out.set(dir, (set = new Set()))\n set.add(runtime)\n }\n return out\n}\n\n/** Files whose presence makes a directory a project root. */\nexport const ROOT_MARKERS: ReadonlySet<string> = new Set(['package.json', 'pyproject.toml', 'go.mod'])\n\n/**\n * Directory names skipped by default because they hold test fixtures, not the project's own pins\n * (docs/TASKS.md A12): `fixtures`, `fixture`, `__fixtures__`, `testdata`, `test_data`, `_testdata`,\n * `test-fixtures`, `test_fixtures`, `testfixtures`, any letter case. Matched per directory segment.\n */\nexport const FIXTURE_DIR = /^(_?test[-_]?data|test[-_]?fixtures?|__fixtures__|fixtures?|testdata)$/i\n\n/** True when a directory name is a fixture folder (see `FIXTURE_DIR`). */\nexport function isFixtureDir(name: string): boolean {\n return FIXTURE_DIR.test(name)\n}\n\n/** Options of `scanFiles` / `walkFiles`. */\nexport interface ScanOptions {\n /** Also scan fixture folders (`FIXTURE_DIR`; default false). */\n includeFixtures?: boolean\n /**\n * Extra paths to skip, as globs relative to the scanned directory: `*` and `?` stay inside one\n * path segment, `**` crosses segments. A pattern without `/` matches a file or directory name at\n * any depth (`examples`, `*.Dockerfile`); a pattern with `/` matches the whole relative path\n * (`docs/**`, `services/legacy`). A matching directory is skipped with everything under it.\n */\n exclude?: readonly string[]\n}\n\n/** What a scan found, and how many files it skipped because of fixture or `exclude` rules. */\nexport interface ScanResult {\n files: string[]\n /** Files under directories or matching paths skipped by the fixture rule or `exclude`. */\n excluded: number\n}\n\nfunction escapeRegex(text: string): string {\n return text.replace(/[.+^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/** Converts one exclude glob to a test on a relative path (see `ScanOptions.exclude`). */\nexport function globMatcher(glob: string): (path: string) => boolean {\n const pattern = glob.trim().replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '')\n let re = ''\n for (let i = 0; i < pattern.length; i++) {\n const c = pattern[i] as string\n if (c === '*') {\n if (pattern[i + 1] === '*') {\n i++\n if (pattern[i + 1] === '/') {\n i++\n re += '(?:.*/)?'\n } else {\n re += '.*'\n }\n } else {\n re += '[^/]*'\n }\n } else if (c === '?') {\n re += '[^/]'\n } else {\n re += escapeRegex(c)\n }\n }\n const regex = new RegExp(`^${re}$`)\n if (!pattern.includes('/')) return (path) => regex.test(path.slice(path.lastIndexOf('/') + 1))\n return (path) => regex.test(path)\n}\n\nasync function countFiles(abs: string): Promise<number> {\n let n = 0\n for (const entry of await readdir(abs, { withFileTypes: true })) {\n if (entry.isSymbolicLink()) continue\n if (entry.isDirectory()) n += await countFiles(join(abs, entry.name))\n else if (entry.isFile()) n++\n }\n return n\n}\n\n/**\n * Every file under `dir`, as a path relative to `dir` with '/' separators, sorted, and the number\n * of files skipped by the fixture rule and `exclude`. Never enters `IGNORED_DIRS` (not counted) or\n * symbolic links (so a link cycle cannot hang the walk).\n */\nexport async function scanFiles(dir: string, options: ScanOptions = {}): Promise<ScanResult> {\n const files: string[] = []\n let excluded = 0\n const matchers = (options.exclude ?? []).filter((g) => g.trim() !== '').map(globMatcher)\n const skip = (path: string) => matchers.some((m) => m(path))\n async function visit(rel: string): Promise<void> {\n const abs = rel === '' ? dir : join(dir, rel)\n const entries = await readdir(abs, { withFileTypes: true })\n for (const entry of entries) {\n if (entry.isSymbolicLink()) continue\n const path = rel === '' ? entry.name : `${rel}/${entry.name}`\n if (entry.isDirectory()) {\n if (IGNORED_DIRS.has(entry.name)) continue\n if ((!options.includeFixtures && isFixtureDir(entry.name)) || skip(path)) {\n excluded += await countFiles(join(abs, entry.name))\n continue\n }\n await visit(path)\n } else if (entry.isFile()) {\n if (skip(path)) excluded++\n else files.push(path)\n }\n }\n }\n await visit('')\n return { files: files.sort(), excluded }\n}\n\n/** The files `scanFiles` keeps (fixtures and `exclude` matches left out unless asked for). */\nexport async function walkFiles(dir: string, options: ScanOptions = {}): Promise<string[]> {\n return (await scanFiles(dir, options)).files\n}\n\n/**\n * The project roots of a repo: `.` (the repo root, always) plus every directory that contains a\n * `package.json`, `pyproject.toml` or `go.mod` outside the `IGNORED_DIRS`. Relative paths with\n * '/' separators, sorted.\n *\n * @param files - Optional result of `walkFiles(dir)`, to avoid walking twice.\n */\nexport async function findProjectRoots(dir: string, files?: readonly string[]): Promise<string[]> {\n const list = files ?? (await walkFiles(dir))\n return projectRootsOf(list)\n}\n\n/** The project roots implied by a list of relative file paths (see `findProjectRoots`). */\nexport function projectRootsOf(files: readonly string[]): string[] {\n const roots = new Set<string>(['.'])\n for (const file of files) {\n const i = file.lastIndexOf('/')\n const base = file.slice(i + 1)\n if (!ROOT_MARKERS.has(base)) continue\n const parts = file.split('/').slice(0, -1)\n if (parts.some((p) => IGNORED_DIRS.has(p))) continue\n roots.add(i < 0 ? '.' : file.slice(0, i))\n }\n return [...roots].sort()\n}\n"],"mappings":";AAMA,OAAO,YAAY;AAInB,IAAM,WAAW,oBAAI,IAAI,CAAC,UAAU,QAAQ,UAAU,WAAW,UAAU,WAAW,CAAC;AAGvF,IAAM,QAAQ;AAGd,IAAM,kBAAkB,oBAAI,IAAI;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,SAAS,gBAAgB,OAAwB;AACtD,SAAO,SAAS,IAAI,MAAM,YAAY,CAAC;AACzC;AAEA,IAAM,QAAQ;AACd,IAAM,UAAU;AAEhB,SAAS,YAAY,MAAc,SAA0B;AAC3D,MAAI,IAAI,KAAK,KAAK;AAClB,MAAI,YAAY,KAAM,KAAI,EAAE,QAAQ,aAAa,EAAE;AACnD,MAAI,YAAY,UAAU;AACxB,QAAI,EAAE,QAAQ,oBAAoB,EAAE;AAEpC,QAAI,EAAE,QAAQ,4BAA4B,IAAI;AAAA,EAChD;AACA,SAAO,EAAE,QAAQ,eAAe,EAAE;AACpC;AAGA,SAAS,aAAa,MAAsC;AAC1D,MAAI,MAAM,KAAK,IAAI,EAAG,QAAO,EAAE,MAAM,SAAS,SAAS,KAAK;AAC5D,QAAM,IAAI,QAAQ,KAAK,IAAI;AAC3B,MAAI,EAAG,QAAO,EAAE,MAAM,WAAW,SAAS,EAAE,CAAC,MAAM,SAAa,EAA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AAU,GAAG;AAC1C,SAAO,eAAe,IAAI;AAC5B;AAGO,SAAS,eAAe,OAAoC;AACjE,QAAM,QAAQ,oBAAI,IAAY,CAAC,GAAG,CAAC;AACnC,aAAW,QAAQ,OAAO;AACxB,UAAM,IAAI,KAAK,YAAY,GAAG;AAC9B,UAAM,OAAO,KAAK,MAAM,IAAI,CAAC;AAC7B,QAAI,CAAC,aAAa,IAAI,IAAI,EAAG;AAC7B,UAAM,QAAQ,KAAK,MAAM,GAAG,EAAE,MAAM,GAAG,EAAE;AACzC,QAAI,MAAM,KAAK,CAAC,MAAM,aAAa,IAAI,CAAC,CAAC,EAAG;AAC5C,UAAM,IAAI,IAAI,IAAI,MAAM,KAAK,MAAM,GAAG,CAAC,CAAC;AAAA,EAC1C;AACA,SAAO,CAAC,GAAG,KAAK,EAAE,KAAK;AACzB;","names":["semver","range","semver"]}
|
package/dist/cli.d.ts
CHANGED
|
@@ -28,7 +28,9 @@ interface CheckReport {
|
|
|
28
28
|
resolveAlias: AliasResolver;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/** The package version, from package.json at build time. */
|
|
32
|
+
declare const VERSION: string;
|
|
33
|
+
declare const USAGE = "Usage: runtime-pin-check [dir] [options]\n\nFinds Node, Python and Go version pins that disagree across a repo's files.\n\nOptions:\n --json print the result as JSON\n --runtime node,python,go only these runtimes (default: all)\n --fail-on error|warning|info exit 1 when a finding is at or above this level (default: error)\n --date YYYY-MM-DD check end-of-life and LTS aliases as of this date (default: today, UTC)\n --include-fixtures also scan fixture folders (skipped by default: fixtures/, fixture/,\n __fixtures__/, test_fixtures/, test-fixtures/, testdata/, test_data/ ...)\n --exclude <glob> skip matching paths (repeatable; 'examples', 'docs/**', '*.Dockerfile')\n --fix --to <version> rewrite pins to <version> (with --runtime <one>, --dry-run, --fix-ranges)\n -v, --version print the version\n -h, --help show this help\n\nExit codes: 0 no finding at or above --fail-on, 1 findings, 2 usage or I/O error.\n";
|
|
32
34
|
/** Where `run` writes and what it reads from the environment; tests replace it. */
|
|
33
35
|
interface CliIo {
|
|
34
36
|
stdout: (text: string) => void;
|
|
@@ -50,6 +52,7 @@ interface CliOptions {
|
|
|
50
52
|
dryRun: boolean;
|
|
51
53
|
fixRanges: boolean;
|
|
52
54
|
help: boolean;
|
|
55
|
+
version: boolean;
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Parses the arguments (without `node` and the script path).
|
|
@@ -97,4 +100,4 @@ declare function runFix(options: CliOptions, io: CliIo): Promise<number>;
|
|
|
97
100
|
*/
|
|
98
101
|
declare function run(argv: readonly string[], io?: CliIo): Promise<number>;
|
|
99
102
|
|
|
100
|
-
export { type CliIo, type CliOptions, type ReadResult, USAGE, checkDirectory, collectSources, parseCliArgs, readDirectory, run, runFix };
|
|
103
|
+
export { type CliIo, type CliOptions, type ReadResult, USAGE, VERSION, checkDirectory, collectSources, parseCliArgs, readDirectory, run, runFix };
|