Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [20.9.0, 22, 24]
node-version: [20.19.0, 22, 24]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ format and uses semantic versioning when versioned releases are published.
- Tightened template file validation and aligned generated workflow action
versions.

### Fixed

- Load the CLI version from its TypeScript module instead of a JSON import
attribute, and align the documented Node.js 20 minimum with the installed
development toolchain at Node.js 20.19.

## Release Links

- Unreleased:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ MIT © [Roger Chappel](https://github.com/rogerchappel)

## Development

Typegap supports Node.js 20.9+ and 22 or newer. Node.js 21
Typegap supports Node.js 20.19+ and 22 or newer. Node.js 21
is not supported because the shipped runtime dependency set does not support
those releases.

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"homepage": "https://github.com/rogerchappel/typegap#readme",
"engines": {
"node": "^20.9.0 || >=22.0.0"
"node": "^20.19.0 || >=22.0.0"
},
"dependencies": {
"@typescript-eslint/typescript-estree": "^8.0.0",
Expand Down
7 changes: 7 additions & 0 deletions src/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, it, expect } from 'vitest';
import { execSync } from 'node:child_process';
import { readFileSync } from 'node:fs';

describe('CLI integration', () => {
const cli = 'npx tsx src/cli.ts';
Expand All @@ -10,6 +11,12 @@ describe('CLI integration', () => {
expect(output).toContain('TypeScript type coverage auditor');
});

it('reports the package version', () => {
const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) as { version: string };
const output = execSync(`${cli} --version`, { encoding: 'utf-8' });
expect(output.trim()).toBe(packageJson.version);
});

it('scans the fixtures directory', () => {
const output = execSync(`${cli} fixtures/fully-typed`, { encoding: 'utf-8' });
expect(output).toContain('100.0%');
Expand Down
4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import { resolve } from 'node:path';
import { existsSync } from 'node:fs';
import { analyzeDirectory } from './analyzer.js';
import { generateReport, saveBaseline } from './reporter.js';
import packageJson from '../package.json' with { type: 'json' };
import { version } from './version.js';

const program = new Command();

program
.name('typegap')
.description('TypeScript type coverage auditor — find the holes without compiling')
.version(packageJson.version)
.version(version)
.argument('[directory]', 'directory to scan', '.')
.option('--ignore <patterns>', 'glob patterns to ignore (comma-separated)')
.option('--format <type>', 'output format: text or json', 'text')
Expand Down
Loading