You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(readme): rewrite READMEs and tidy license metadata
Restructure root, npm package, and VS Code extension READMEs with centered heroes, logo, static MIT badges, and clearer quick-start sections.
Standardize root LICENSE text, trim changelog boilerplate, and document the intentional empty-object intersection in global.d.ts.
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) where noted below. Version numbers refer to the published package or extension manifest, not necessarily every commit on `main`.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+
Copyright (c) 2026 Marco Antolini
4
4
5
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+
Permission is hereby granted, free of charge, to any person obtaining a copy
6
+
of this software and associated documentation files (the "Software"), to deal
7
+
in the Software without restriction, including without limitation the rights
8
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+
copies of the Software, and to permit persons to whom the Software is
10
+
furnished to do so, subject to the following conditions:
6
11
7
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+
The above copyright notice and this permission notice shall be included in all
13
+
copies or substantial portions of the Software.
14
+
15
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Without `Prettify`, hovering an intersection often shows `{ a: string } & { b: number } & …`. With `Prettify`, the same hover tends to show a single object: `{ a: string; b: number; … }`. This uses the well-known mapped-type pattern ([Total TypeScript — Prettify](https://www.totaltypescript.com/concepts/the-prettify-helper)); it affects type display only and has no runtime cost.
15
+
## What is this?
6
16
7
-
## Install
17
+
Without `Prettify`, hovering an intersection often shows `{ a: string } & { b: number } & …`. With `Prettify`, the same hover tends to show a single object: `{ a: string; b: number; … }`.
8
18
9
-
| Approach | When to use it | Setup |
10
-
|----------|----------------|--------|
11
-
|**[VS Code / Cursor extension](packages/vscode-extension)**| Editor-only, no npm dependency | Install or load the extension — `Prettify` is injected for you |
12
-
|**[npm package](packages/ts-hover-prettify)**|`tsc`, CI, other editors, explicit control |`npm add -D ts-hover-prettify` + a one-line global types file |
19
+
This monorepo ships two ways to use the same mapped-type pattern ([Total TypeScript — Prettify](https://www.totaltypescript.com/concepts/the-prettify-helper)): an [npm package](packages/ts-hover-prettify) for `tsc`, CI, and any editor, and a [VS Code / Cursor extension](packages/vscode-extension) that injects the type with zero npm setup. It affects type display only and has no runtime cost.
13
20
14
-
You only need one approach per project. Do not mix the extension’s auto-generated `.vscode/ts-hover-prettify.d.ts` with a manual npm setup unless you know they stay in sync.
21
+
## Quick Start
22
+
23
+
Pick one approach per project — do not mix the extension’s auto-generated `.vscode/ts-hover-prettify.d.ts` with a manual npm setup unless you know they stay in sync.
15
24
16
25
### Extension (zero-config)
17
26
18
27
1. Install **TS Hover Prettify** (`marcoantolini.ts-hover-prettify-vscode`) from a `.vsix` or, after release, from the Marketplace / Open VSX.
19
28
2. Open a TypeScript workspace and wrap types with `Prettify<…>`.
20
29
3. Hover the alias. Run **TypeScript: Restart TS Server** if hovers do not update after install.
21
30
22
-
On first use the extension may create `.vscode/ts-hover-prettify.d.ts` and append that path to `tsconfig.json``include` or `files` when those arrays already exist. Projects without `include`/`files` still receive `Prettify` via the TypeScript server plugin.
Local extension debugging: open `packages/vscode-extension`, press **F5**, then open `examples/intersected-types` in the Extension Development Host.
81
81
82
-
- Change runtime values or emitted JavaScript.
83
-
- Rewrite hovers for types you never wrapped (aliases, inferred types, etc. stay as TypeScript prints them).
84
-
- Replace dedicated “expand any hover” extensions or VS Code’s experimental expandable hover (`typescript.experimental.expandableHover` with a recent TypeScript workspace version).
82
+
## Architecture
83
+
84
+
```mermaid
85
+
graph TD
86
+
Root[ts-hover-prettify monorepo]
87
+
Root --> Lib[packages/ts-hover-prettify]
88
+
Root --> Ext[packages/vscode-extension]
89
+
Root --> ExExt[examples/intersected-types]
90
+
Root --> ExNpm[examples/intersected-types-npm]
91
+
Ext --> Lib
92
+
ExNpm --> Lib
93
+
ExExt --> Ext
94
+
```
85
95
86
-
## Repository layout
96
+
## Project Structure
87
97
88
98
```
89
-
packages/
90
-
ts-hover-prettify/ # npm library
91
-
vscode-extension/ # VS Code / Cursor extension (ts-hover-prettify-vscode)
99
+
.github/
100
+
workflows/
101
+
.changeset/
92
102
examples/
93
-
intersected-types/ # extension workflow (no committed prettify.d.ts)
Local extension debugging: open `packages/vscode-extension`, press **F5**, then open `examples/intersected-types` in the Extension Development Host.
130
+
**Does**
131
+
132
+
- Improve hover (and related quick info) for types you explicitly wrap in `Prettify<…>`.
133
+
- Work with strict TypeScript projects; the utility type is a few lines of types-only code.
134
+
135
+
**Does not**
136
+
137
+
- Change runtime values or emitted JavaScript.
138
+
- Rewrite hovers for types you never wrapped (aliases, inferred types, etc. stay as TypeScript prints them).
139
+
- Replace dedicated “expand any hover” extensions or VS Code’s experimental expandable hover (`typescript.experimental.expandableHover` with a recent TypeScript workspace version).
111
140
112
141
## Release
113
142
@@ -116,7 +145,13 @@ Local extension debugging: open `packages/vscode-extension`, press **F5**, then
116
145
|**npm** (`ts-hover-prettify`) |[Changesets](https://github.com/changesets/changesets) on `main` / `master` — [`.github/workflows/publish.yml`](.github/workflows/publish.yml)|
117
146
|**Extension** (`ts-hover-prettify-vscode`) | Git tag `vscode-v*` or manual workflow — [`.github/workflows/publish-extension.yml`](.github/workflows/publish-extension.yml)|
118
147
119
-
Changelog: [CHANGELOG.md](CHANGELOG.md).
148
+
## Contributing
149
+
150
+
Issues and pull requests are welcome on [GitHub](https://github.com/MarcoAntolini/ts-hover-prettify).
Copy file name to clipboardExpand all lines: packages/ts-hover-prettify/CHANGELOG.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,6 @@
8
8
9
9
All notable changes to **ts-hover-prettify** are documented here.
10
10
11
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Provide the `Prettify<T>` utility type so TypeScript hovers show a single object shape instead of a chain of intersections.
13
+
## What is this?
6
14
7
-
This package is for projects where you want the type in source control or need `tsc` / CI without the [VS Code extension](../vscode-extension). The extension injects the same type automatically; pick one approach per repo.
15
+
This package exports the `Prettify<T>` utility type for projects where you want the type in source control or need `tsc` / CI without the [VS Code extension](../vscode-extension). The extension injects the same type automatically — pick one approach per repo.
8
16
9
-
## Install
17
+
The mapped-type pattern only affects how TypeScript prints types in the language service. It is erased at compile time and does not change JavaScript output.
18
+
19
+
## Quick Start
10
20
11
21
```bash
12
-
npm add -D ts-hover-prettify
13
-
#pnpm add -D ts-hover-prettify
22
+
pnpm add -D ts-hover-prettify
23
+
#npm add -D ts-hover-prettify
14
24
# yarn add -D ts-hover-prettify
15
25
```
16
26
17
-
## Setup
18
-
19
27
### Global `Prettify` (recommended)
20
28
21
29
Create a declaration file included by your `tsconfig.json`, for example `prettify.d.ts`:
@@ -24,7 +32,7 @@ Create a declaration file included by your `tsconfig.json`, for example `prettif
24
32
import"ts-hover-prettify/global";
25
33
```
26
34
27
-
Add it to `compilerOptions.types`, or to top-level `include` / `files`, for example:
35
+
Add it to `compilerOptions.types`, or to top-level `include` / `files`:
28
36
29
37
```json
30
38
{
@@ -68,7 +76,7 @@ export type Prettify<T> = {
68
76
} & {};
69
77
```
70
78
71
-
Implementation matches the common community pattern (also documented as `Compute`, `Expand`, etc.). It only affects how TypeScript prints types in the language service; it is erased at compile time and does not change JavaScript output.
79
+
Implementation matches the common community pattern (also documented as `Compute`, `Expand`, etc.).
72
80
73
81
## Behaviour and limits
74
82
@@ -80,6 +88,22 @@ Implementation matches the common community pattern (also documented as `Compute
80
88
81
89
Use the [ts-hover-prettify-vscode](../vscode-extension) extension instead of this package if you only need editor hovers and accept workspace injection of `.vscode/ts-hover-prettify.d.ts`.
82
90
91
+
## Documentation
92
+
93
+
| Resource | Description |
94
+
|----------|-------------|
95
+
|[Root README](../../README.md)| Monorepo overview and install options |
Copy file name to clipboardExpand all lines: packages/vscode-extension/CHANGELOG.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
3
3
All notable changes to **ts-hover-prettify-vscode** are documented here.
4
4
5
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
0 commit comments