@vscode/vscode-settings-history 0.0.2-0

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 ADDED
@@ -0,0 +1,111 @@
1
+ # @vscode/vscode-settings-history
2
+
3
+ Tracks VS Code settings schema changes across versions using [RFC 6902 JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). Each VS Code release is diffed against its base version, producing a compact changelog of added, removed, and modified settings (including schema and default changes).
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ pnpm add @vscode/vscode-settings-history
9
+ ```
10
+
11
+ ## What's in the package
12
+
13
+ - **`types.d.ts`** — TypeScript types (`SettingsHistory`, `VersionedEdit`, `SettingSchema`, `PatchOperation`)
14
+ - **`dist/history.json`** — the changelog (array of versioned JSON Patches)
15
+ - **`dist/vscode-settings.d.ts`** — generated versioned settings types with `Patch<>` utility (use via `@vscode/vscode-settings-history/settings`)
16
+
17
+ ## Usage
18
+
19
+ ### Types
20
+
21
+ ```ts
22
+ import type {
23
+ SettingsHistory,
24
+ VersionedEdit,
25
+ SettingSchema,
26
+ PatchOperation,
27
+ } from '@vscode/vscode-settings-history';
28
+ ```
29
+
30
+ ### Generated versioned settings types
31
+
32
+ ```ts
33
+ import type {
34
+ LatestVscodeSettings,
35
+ VscodeSettingsFor,
36
+ VscodeVersion,
37
+ } from '@vscode/vscode-settings-history/settings';
38
+
39
+ // Type-safe settings for a specific version
40
+ const settings: VscodeSettingsFor<'1.115'> = {
41
+ 'editor.fontSize': 14,
42
+ };
43
+ ```
44
+
45
+ ### History data
46
+
47
+ ```ts
48
+ import history from '@vscode/vscode-settings-history/history.json';
49
+ ```
50
+
51
+ ### Format
52
+
53
+ `history.json` is an array of versioned edits. Each entry contains RFC 6902 patch operations relative to a base version:
54
+
55
+ ```jsonc
56
+ [
57
+ {
58
+ "version": "1.114",
59
+ "base": "initial", // diffs from {}
60
+ "patch": [
61
+ { "op": "add", "path": "/editor.fontSize", "value": { "type": "number", "default": 14 } },
62
+ // ... 1832 ops (full baseline)
63
+ ]
64
+ },
65
+ {
66
+ "version": "1.115",
67
+ "base": { "version": "1.114" }, // diffs from 1.114
68
+ "patch": [
69
+ { "op": "remove", "path": "/update.statusBar" },
70
+ { "op": "replace", "path": "/editor.fontSize/default", "value": 16 },
71
+ { "op": "add", "path": "/editor.newFeature", "value": { "type": "boolean" } },
72
+ // ... only what changed
73
+ ]
74
+ }
75
+ ]
76
+ ```
77
+
78
+ Replay from `{}` by applying patches to reconstruct the full state at any version. Branching is supported via explicit `base` pointers (e.g. patch releases like `1.114.1` base on `1.114`, not `1.115`).
79
+
80
+ ## CLI (dev only, not shipped)
81
+
82
+ Extract settings from a VS Code version and update the history:
83
+
84
+ ```sh
85
+ npx tsx src/cli/extract.ts extract # latest stable
86
+ npx tsx src/cli/extract.ts extract --version 1.116.0 # specific version
87
+ npx tsx src/cli/extract.ts extract --from-schema schema.json --version 1.116
88
+ ```
89
+
90
+ Regenerate `.d.ts` from existing history:
91
+
92
+ ```sh
93
+ npx tsx src/cli/extract.ts generate --history ./dist/history.json --out-dts ./dist/vscode-settings.d.ts
94
+ ```
95
+
96
+ ## Development
97
+
98
+ ```sh
99
+ pnpm install
100
+ pnpm test # vitest
101
+ ```
102
+
103
+ No build step — the package ships a hand-written `types.d.ts` and `dist/history.json` (produced by the CI extract pipeline).
104
+
105
+ ## Publishing
106
+
107
+ Published automatically via Azure Pipelines:
108
+
109
+ - **Nightly scheduled** (`publish-nightly-scheduled.yml`): runs daily, checks for new VS Code releases, publishes a prerelease (`next` tag) if a new version is detected.
110
+ - **Nightly on-push** (`publish-nightly.yml`): can be manually triggered with the settings-history flag enabled.
111
+ - **Stable** (`publish-stable.yml`): manually triggered to promote to `latest` tag.