Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit 8d3a697

Browse files
committed
feat!: move "tsd-lite" to peer dependency
1 parent a90ea9d commit 8d3a697

File tree

6 files changed

+67
-39
lines changed

6 files changed

+67
-39
lines changed

README.md

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
# tsd-lite-cli
88

9-
Test runner for testing TypeScript typings (CLI over
10-
[tsd-lite][intro_tsd-lite], a "per file" version of [tsd][intro_tsd]).
9+
Test runner for testing TypeScript typings. CLI over
10+
[`tsd-lite`][intro_tsd-lite], a per-file version of [`tsd`][intro_tsd].
1111

1212
- :mag: [Glob][intro_fast-glob] pattern matching
1313
- :white_check_mark: [TAP][intro_tap] compatible output
1414

15-
![tsd-lite-cli default colored tap output](docs/output-default.png "tsd-lite-cli default colored tap output")
15+
![tsd-lite-cli default colored tap output](docs/output-default.png
16+
"tsd-lite-cli default colored tap output")
1617

1718
[intro_tsd]: https://github.com/SamVerschueren/tsd
1819
[intro_tsd-lite]: https://github.com/mrazauskas/tsd-lite
@@ -24,35 +25,31 @@ Test runner for testing TypeScript typings (CLI over
2425
<!-- vim-markdown-toc GFM -->
2526

2627
- [Install](#install)
28+
- [`tsd-lite`](#tsd-lite)
29+
- [`@tsd/typescript`](#tsdtypescript)
2730
- [Usage](#usage)
28-
- [Example typing test file](#example-typing-test-file)
29-
- [CLI interface](#cli-interface)
30-
- [`--color` and `--no-color`](#--color-and---no-color)
31+
- [CLI interface](#cli-interface)
3132
- [Similar projects](#similar-projects)
3233
- [Changelog](#changelog)
3334

3435
<!-- vim-markdown-toc -->
3536

3637
## Install
3738

38-
```shell-session
39-
npm install --save-dev @tsd/typescript tsd-lite-cli
39+
```console
40+
npm install --save-dev @tsd/typescript tsd-lite tsd-lite-cli
4041
```
4142

42-
## Usage
43-
44-
Run `tsd-lite` with a glob pattern for matching test files (uses
45-
[fast-glob][usage_fast-glob] internally):
46-
47-
```shell-session
48-
npx tsd-lite 'src/**/*.test-d.ts'
49-
```
43+
Besides `tsd-lite-cli`, you also need `tsd-lite` and `@tsd/typescript` which
44+
are listed as peer dependencies.
5045

51-
[usage_fast-glob]: https://github.com/mrmlnc/fast-glob
46+
### `tsd-lite`
5247

53-
### Example typing test file
48+
Contains the actual assertion functions. For more information, see
49+
[tsd-lite][install_tsd-lite].
5450

5551
```typescript
52+
// src/concat.test-d.ts
5653
import { expectType, expectError } from "tsd-lite"
5754
import concat from "./concat.js"
5855

@@ -61,13 +58,32 @@ expectType<string>(await concat("foo", "bar"))
6158
expectError(await concat(true, false))
6259
```
6360

64-
For more information, see [tsd-lite][example_tsd-lite] for assertion syntax.
61+
[install_tsd-lite]: https://github.com/mrazauskas/tsd-lite
62+
63+
### `@tsd/typescript`
64+
65+
Compiles the TypeScript test files. It's version should be synced with the
66+
`typescript` version in your project. For more information, see
67+
[`@tsd/typescript`][install_tsd-typescript].
68+
69+
[install_tsd-typescript]: https://github.com/SamVerschueren/tsd-typescript
70+
71+
## Usage
72+
73+
Run `tsd-lite` with a glob pattern for matching test files - uses
74+
[`fast-glob`][usage_fast-glob] internally:
75+
76+
```console
77+
npx tsd-lite 'src/**/*.test-d.ts'
78+
```
79+
80+
[usage_fast-glob]: https://github.com/mrmlnc/fast-glob
6581

66-
[example_tsd-lite]: https://github.com/mrazauskas/tsd-lite
82+
### CLI interface
6783

68-
## CLI interface
84+
```console
85+
$ npx tsd-lite --help
6986

70-
```shell-session
7187
Usage: tsd-lite [options] <patterns...>
7288

7389
Test runner for testing TypeScript typings (CLI over tsd-lite, a "per file"
@@ -84,23 +100,33 @@ Options:
84100
-h, --help Print this help guide
85101
```
86102

87-
### `--color` and `--no-color`
103+
#### `--color` and `--no-color`
88104

89105
By default, `tsd-lite-cli` outputs a colored version of [Test Anything
90-
Protocol][cli_tap] for better readability. This can be disabled by setting
91-
`--no-color` when piping to other tools like `tap-spec`:
106+
Protocol][cli_tap] for better readability. Can be disabled by setting
107+
`--no-color` when piping to other tools, e.g. [`tap-spec`][cli_tap-spec].
108+
109+
```console
110+
npx tsd-lite 'src/**/*.test-d.ts' --no-color
111+
```
112+
113+
![tsd-lite-cli --no-color output](docs/output-no-color.png "tsd-lite-cli
114+
--no-color output")
92115

93-
```shell-session
116+
```console
94117
npx tsd-lite 'src/**/*.test-d.ts' --no-color | npx tap-spec
95118
```
96119

97-
![tsd-lite-cli --no-color output piped to tap-spec](docs/output-no-color_tap-spec.png "tsd-lite-cli --no-color output piped to tap-spec")
120+
![tsd-lite-cli --no-color output piped to
121+
tap-spec](docs/output-no-color_tap-spec.png "tsd-lite-cli --no-color output
122+
piped to tap-spec")
98123

99124
[cli_tap]: https://testanything.org
125+
[cli_tap-spec]: https://github.com/scottcorgan/tap-spec
100126

101127
## Similar projects
102128

103-
- [jest-runner-tsd][similar_jest-runner-tsd] - Jest runner to test TypeScript
129+
- [`jest-runner-tsd`][similar_jest-runner-tsd] - Jest runner to test TypeScript
104130
typings
105131

106132
[similar_jest-runner-tsd]: https://github.com/jest-community/jest-runner-tsd

docs/output-default.png

-15.6 KB
Loading

docs/output-no-color.png

38.3 KB
Loading

docs/output-no-color_tap-spec.png

-23.8 KB
Loading

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tsd-lite-cli",
33
"version": "2.1.0",
4-
"description": "Test runner for testing TypeScript typings (CLI over tsd-lite, a \"per file\" version of tsd)",
4+
"description": "Test runner for testing TypeScript typings. CLI over tsd-lite, a per-file version of tsd",
55
"license": "MIT",
66
"homepage": "https://github.com/asd-xiv/tsd-lite-cli/#readme",
77
"bugs": {
@@ -16,13 +16,14 @@
1616
"url": "https://github.com/andreidmt"
1717
},
1818
"keywords": [
19+
"cli",
1920
"typescript",
20-
"test",
21-
"tsd",
22-
"tsd-lite",
2321
"types",
22+
"test",
2423
"typings",
25-
"cli"
24+
"typing-test",
25+
"tsd",
26+
"tsd-lite"
2627
],
2728
"sideEffects": false,
2829
"type": "module",
@@ -60,11 +61,11 @@
6061
},
6162
"dependencies": {
6263
"commander": "^10.0.0",
63-
"fast-glob": "^3.2.12",
64-
"tsd-lite": "^0.6.0"
64+
"fast-glob": "^3.2.12"
6565
},
6666
"peerDependencies": {
67-
"@tsd/typescript": "^4.9.5"
67+
"@tsd/typescript": "^4.9.5",
68+
"tsd-lite": "^0.6.0"
6869
},
6970
"devDependencies": {
7071
"@asd14/eslint-config": "^9.2.0",

0 commit comments

Comments
 (0)