@absolutejs/changelog 0.1.2 → 0.3.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/CHANGELOG.md CHANGED
@@ -6,6 +6,52 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.3.0 — 2026-09-10
10
+
11
+ ### Breaking
12
+
13
+ - **builtSurface reads the entry points a manifest declares instead of a directory** (`builtSurface`)
14
+ _Migration:_ Drop the second argument; the manifest's types and exports say where to look.
15
+ - **surfaceOfFiles takes a package's files and entry points rather than a list of sources** (`surfaceOfFiles`, `surfaceOfArchive`, `typeEntriesOf`)
16
+ _Migration:_ Pass a Map of path to source and the entry points to read from; surfaceOfArchive now returns undefined for an archive with no resolvable entry point.
17
+
18
+ ### Removed
19
+
20
+ - **exportedDeclarations is gone: a surface is now read from the entry points, not file by file** (`exportedDeclarations`)
21
+ _Migration:_ Use surfaceOfFiles, which takes the package's files and its entry points.
22
+
23
+ ### Added
24
+
25
+ - **Reconciliation reports every declaration that moved, not only changed parameters and members** (`Unannounced`, `reconcile`)
26
+ - **applyMigration and applyMigrations accept the file's path, so a .ts file is not parsed as TSX** (`applyMigration`, `applyMigrations`)
27
+ - **declaresTypes says whether a package claims to ship types, so a gate can tell 'none to check' from 'not built'** (`declaresTypes`)
28
+ - **isPackageName, for callers that take a package name from somewhere they do not control** (`isPackageName`)
29
+
30
+ ### Fixed
31
+
32
+ - **Bound the download and the decompression of a package archive, and time out a hung registry** (`packageArchive`)
33
+ - **Keep typescript out of the bundle, so the package is 46 KB rather than 9 MB**
34
+ - **Refuse a package name that is not one, so a manifest cannot send the registry client outside its scope** (`isPackageName`, `packageVersions`)
35
+
36
+ ### Internal
37
+
38
+ - **loadUnreleased infers its result type rather than annotating it** (`loadUnreleased`)
39
+
40
+ ## 0.2.0 — 2026-09-10
41
+
42
+ ### Added
43
+
44
+ - **Adopting writes a prepublishOnly gate, so no publish can go round the check**
45
+ - **Entries can be written against the package's own API, so a symbol that is not an export is a compile error** (`Change`, `change`)
46
+ - **Reconciliation reports migrations that do not describe what the package did** (`Reconciliation`)
47
+ - **The gate catches a package that stopped shipping the documents, and files in the entry directory that no release will read** (`strayEntries`)
48
+ - **The gate checks that a migration describes what the package actually did** (`reconcile`)
49
+
50
+ ### Fixed
51
+
52
+ - **Compare against the newest published version, not the one being published** (`packageVersions`)
53
+ - **Read a document written against an older contract rather than refusing it** (`parseChangelog`)
54
+
9
55
  ## 0.1.2 — 2026-09-10
10
56
 
11
57
  ### Fixed
package/README.md CHANGED
@@ -78,6 +78,27 @@ export const change: Change = {
78
78
  The import is type-only, so an entry has nothing to resolve at run time and
79
79
  the gate works in a checkout with no dependencies installed.
80
80
 
81
+ ### Checked where you type it
82
+
83
+ An entry can be written against the package's own API, and `add` scaffolds it
84
+ that way when it finds one:
85
+
86
+ ```ts
87
+ import type * as Api from "../../src/index";
88
+ import type { Change } from "@absolutejs/changelog";
89
+
90
+ export const change: Change<typeof Api> = {
91
+ kind: "fixed",
92
+ summary: "stops throwing on an empty list",
93
+ symbols: ["listen"], // completed from the package's exports
94
+ };
95
+ ```
96
+
97
+ Suggested rather than required, for two reasons: a `removed` entry names
98
+ something that has just stopped existing, and `typeof Api` cannot see
99
+ type-only exports at all. The gate is the certain half — it reads the
100
+ published `.d.ts`, which carries them.
101
+
81
102
  ### The kinds
82
103
 
83
104
  `breaking` and `removed` cost a consumer work, and the type refuses them
@@ -120,10 +141,26 @@ bunx absolute-changelog check
120
141
  - `CHANGELOG.md` is what the entries say it should be — it is generated, and
121
142
  editing it is how the two copies drift;
122
143
  - the version in `package.json` and the newest release agree;
123
- - the entries name every export that moved since the last published version.
124
-
125
- `--offline` skips the last one, which is the only one that talks to the
126
- registry.
144
+ - `package.json` still ships both documents, and nothing is sitting in the
145
+ entry directory that no release will read;
146
+ - the entries name every export that moved since the newest **published**
147
+ version — not the one in `package.json`, which between `release` and
148
+ `publish` is a version nobody can fetch;
149
+ - and every migration describes what actually happened: a rename whose
150
+ destination this version does not export, a rename whose source is still
151
+ exported, a move to an entry point the package does not have, a removal of
152
+ something still there.
153
+
154
+ That last one is what makes an applicable migration safe to apply. A migration
155
+ that reads correctly and rewrites working code into something that does not
156
+ compile is the whole risk of automating an upgrade, and it fails the release
157
+ instead.
158
+
159
+ `--offline` skips the two that talk to the registry.
160
+
161
+ `adopt` also writes `prepublishOnly`, so the gate runs however a publish was
162
+ started — a release script, a bare `npm publish`, a CI job. A rule that can be
163
+ walked around eventually is.
127
164
 
128
165
  ## Reading somebody else's
129
166
 
package/changelog.json CHANGED
@@ -1,42 +1,196 @@
1
1
  {
2
- "contract": 1,
3
- "name": "@absolutejs/changelog",
4
- "releases": [
5
- {
6
- "changes": [
7
- {
8
- "kind": "fixed",
9
- "summary": "Keep each package.json's own indentation when writing it back",
10
- "symbols": ["writeJsonLike"]
11
- }
12
- ],
13
- "date": "2026-09-10",
14
- "version": "0.1.2"
15
- },
16
- {
17
- "changes": [
18
- {
19
- "kind": "fixed",
20
- "summary": "Fall back to the full packument when the registry has not built the abbreviated one yet",
21
- "symbols": ["packageVersions"]
22
- },
23
- {
24
- "kind": "fixed",
25
- "summary": "Keep the formatter off the generated changelog copies when adopting"
26
- }
27
- ],
28
- "date": "2026-09-10",
29
- "version": "0.1.1"
30
- },
31
- {
32
- "changes": [
33
- {
34
- "kind": "added",
35
- "summary": "The changelog contract: typed entries, a gate that checks them against the package's own types, and migrations as data"
36
- }
37
- ],
38
- "date": "2026-09-10",
39
- "version": "0.1.0"
40
- }
41
- ]
2
+ "contract": 1,
3
+ "name": "@absolutejs/changelog",
4
+ "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "added",
9
+ "summary": "Reconciliation reports every declaration that moved, not only changed parameters and members",
10
+ "symbols": [
11
+ "Unannounced",
12
+ "reconcile"
13
+ ]
14
+ },
15
+ {
16
+ "kind": "added",
17
+ "summary": "applyMigration and applyMigrations accept the file's path, so a .ts file is not parsed as TSX",
18
+ "symbols": [
19
+ "applyMigration",
20
+ "applyMigrations"
21
+ ]
22
+ },
23
+ {
24
+ "kind": "added",
25
+ "summary": "declaresTypes says whether a package claims to ship types, so a gate can tell 'none to check' from 'not built'",
26
+ "symbols": [
27
+ "declaresTypes"
28
+ ]
29
+ },
30
+ {
31
+ "kind": "added",
32
+ "summary": "isPackageName, for callers that take a package name from somewhere they do not control",
33
+ "symbols": [
34
+ "isPackageName"
35
+ ]
36
+ },
37
+ {
38
+ "kind": "breaking",
39
+ "migration": {
40
+ "instruction": "Drop the second argument; the manifest's types and exports say where to look.",
41
+ "manual": true
42
+ },
43
+ "summary": "builtSurface reads the entry points a manifest declares instead of a directory",
44
+ "symbols": [
45
+ "builtSurface"
46
+ ]
47
+ },
48
+ {
49
+ "kind": "breaking",
50
+ "migration": {
51
+ "instruction": "Pass a Map of path to source and the entry points to read from; surfaceOfArchive now returns undefined for an archive with no resolvable entry point.",
52
+ "manual": true
53
+ },
54
+ "summary": "surfaceOfFiles takes a package's files and entry points rather than a list of sources",
55
+ "symbols": [
56
+ "surfaceOfFiles",
57
+ "surfaceOfArchive",
58
+ "typeEntriesOf"
59
+ ]
60
+ },
61
+ {
62
+ "kind": "fixed",
63
+ "summary": "Bound the download and the decompression of a package archive, and time out a hung registry",
64
+ "symbols": [
65
+ "packageArchive"
66
+ ]
67
+ },
68
+ {
69
+ "kind": "fixed",
70
+ "summary": "Keep typescript out of the bundle, so the package is 46 KB rather than 9 MB"
71
+ },
72
+ {
73
+ "kind": "fixed",
74
+ "summary": "Refuse a package name that is not one, so a manifest cannot send the registry client outside its scope",
75
+ "symbols": [
76
+ "isPackageName",
77
+ "packageVersions"
78
+ ]
79
+ },
80
+ {
81
+ "kind": "internal",
82
+ "summary": "loadUnreleased infers its result type rather than annotating it",
83
+ "symbols": [
84
+ "loadUnreleased"
85
+ ]
86
+ },
87
+ {
88
+ "kind": "removed",
89
+ "migration": {
90
+ "instruction": "Use surfaceOfFiles, which takes the package's files and its entry points.",
91
+ "manual": true
92
+ },
93
+ "summary": "exportedDeclarations is gone: a surface is now read from the entry points, not file by file",
94
+ "symbols": [
95
+ "exportedDeclarations"
96
+ ]
97
+ }
98
+ ],
99
+ "date": "2026-09-10",
100
+ "version": "0.3.0"
101
+ },
102
+ {
103
+ "changes": [
104
+ {
105
+ "kind": "added",
106
+ "summary": "Adopting writes a prepublishOnly gate, so no publish can go round the check"
107
+ },
108
+ {
109
+ "kind": "fixed",
110
+ "summary": "Compare against the newest published version, not the one being published",
111
+ "symbols": [
112
+ "packageVersions"
113
+ ]
114
+ },
115
+ {
116
+ "kind": "added",
117
+ "summary": "Entries can be written against the package's own API, so a symbol that is not an export is a compile error",
118
+ "symbols": [
119
+ "Change",
120
+ "change"
121
+ ]
122
+ },
123
+ {
124
+ "kind": "fixed",
125
+ "summary": "Read a document written against an older contract rather than refusing it",
126
+ "symbols": [
127
+ "parseChangelog"
128
+ ]
129
+ },
130
+ {
131
+ "kind": "added",
132
+ "summary": "Reconciliation reports migrations that do not describe what the package did",
133
+ "symbols": [
134
+ "Reconciliation"
135
+ ]
136
+ },
137
+ {
138
+ "kind": "added",
139
+ "summary": "The gate catches a package that stopped shipping the documents, and files in the entry directory that no release will read",
140
+ "symbols": [
141
+ "strayEntries"
142
+ ]
143
+ },
144
+ {
145
+ "kind": "added",
146
+ "summary": "The gate checks that a migration describes what the package actually did",
147
+ "symbols": [
148
+ "reconcile"
149
+ ]
150
+ }
151
+ ],
152
+ "date": "2026-09-10",
153
+ "version": "0.2.0"
154
+ },
155
+ {
156
+ "changes": [
157
+ {
158
+ "kind": "fixed",
159
+ "summary": "Keep each package.json's own indentation when writing it back",
160
+ "symbols": [
161
+ "writeJsonLike"
162
+ ]
163
+ }
164
+ ],
165
+ "date": "2026-09-10",
166
+ "version": "0.1.2"
167
+ },
168
+ {
169
+ "changes": [
170
+ {
171
+ "kind": "fixed",
172
+ "summary": "Fall back to the full packument when the registry has not built the abbreviated one yet",
173
+ "symbols": [
174
+ "packageVersions"
175
+ ]
176
+ },
177
+ {
178
+ "kind": "fixed",
179
+ "summary": "Keep the formatter off the generated changelog copies when adopting"
180
+ }
181
+ ],
182
+ "date": "2026-09-10",
183
+ "version": "0.1.1"
184
+ },
185
+ {
186
+ "changes": [
187
+ {
188
+ "kind": "added",
189
+ "summary": "The changelog contract: typed entries, a gate that checks them against the package's own types, and migrations as data"
190
+ }
191
+ ],
192
+ "date": "2026-09-10",
193
+ "version": "0.1.0"
194
+ }
195
+ ]
42
196
  }
package/dist/apply.d.ts CHANGED
@@ -16,11 +16,8 @@ export type MigrationResult = {
16
16
  export declare const applyMigration: (source: string, input: {
17
17
  migration: Migration;
18
18
  packageName: string;
19
- }) => {
20
- changed: boolean;
21
- notes: string[];
22
- source: string;
23
- };
19
+ path?: string;
20
+ }) => MigrationResult;
24
21
  /**
25
22
  * Apply migrations in order.
26
23
  *
@@ -31,4 +28,5 @@ export declare const applyMigration: (source: string, input: {
31
28
  export declare const applyMigrations: (source: string, input: {
32
29
  migrations: readonly Migration[];
33
30
  packageName: string;
31
+ path?: string;
34
32
  }) => MigrationResult;