@absolutejs/changelog 0.8.2 → 0.9.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,13 @@ 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.9.0 — 2026-11-19
10
+
11
+ ### Added
12
+
13
+ - **A change can name the calls or files it reaches** (`Change`, `Reach`, `findCalls`)
14
+ A change can say where it matters in a project's code when importing the package is not the answer: calls to some methods on an instance of a class (`reaches.calls`, found with `findCalls`), or files matching globs (`reaches.files`). A change to Elysia's `setup` hook then reaches the projects that call `.setup()`, not every project that imports `prepare`.
15
+
9
16
  ## 0.8.2 — 2026-11-19
10
17
 
11
18
  ### Fixed
package/changelog.json CHANGED
@@ -2,6 +2,22 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/changelog",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "detail": "A change can say where it matters in a project's code when importing the package is not the answer: calls to some methods on an instance of a class (`reaches.calls`, found with `findCalls`), or files matching globs (`reaches.files`). A change to Elysia's `setup` hook then reaches the projects that call `.setup()`, not every project that imports `prepare`.",
9
+ "kind": "added",
10
+ "summary": "A change can name the calls or files it reaches",
11
+ "symbols": [
12
+ "Change",
13
+ "Reach",
14
+ "findCalls"
15
+ ]
16
+ }
17
+ ],
18
+ "date": "2026-11-19",
19
+ "version": "0.9.0"
20
+ },
5
21
  {
6
22
  "changes": [
7
23
  {
@@ -3,6 +3,7 @@ import type { Migration } from "./types";
3
3
  type MethodsMigration = Extract<Migration, {
4
4
  methods: unknown;
5
5
  }>;
6
+ type Owner = MethodsMigration["methods"]["owner"];
6
7
  type Result = {
7
8
  changed: boolean;
8
9
  notes: string[];
@@ -13,4 +14,18 @@ export declare const applyMethods: (input: {
13
14
  methods: MethodsMigration["methods"];
14
15
  source: string;
15
16
  }) => Result;
17
+ /**
18
+ * Where a file calls these methods on an instance of the owner, one line
19
+ * each: what a change that names its calls (`reaches.calls`) is looked for
20
+ * by, and what a method rename is shown at before it is applied.
21
+ */
22
+ export declare const findCalls: (input: {
23
+ methods: readonly string[];
24
+ owner: Owner;
25
+ path: string;
26
+ source: string;
27
+ }) => {
28
+ line: number;
29
+ method: string;
30
+ }[];
16
31
  export {};
package/dist/cli.js CHANGED
@@ -169,6 +169,37 @@ var readMigration = (value, where, problems) => {
169
169
  problems.push(`${where}: migration says neither rename, moved, resubpath, methods, dependencies nor manual`);
170
170
  return;
171
171
  };
172
+ var nonEmptyText = (value) => {
173
+ if (!Array.isArray(value))
174
+ return;
175
+ const [first, ...rest] = value.filter((entry) => isText(entry));
176
+ if (first === undefined || rest.length + 1 !== value.length)
177
+ return;
178
+ const list = [first, ...rest];
179
+ return list;
180
+ };
181
+ var readReach = (value, where, problems) => {
182
+ if (value === undefined)
183
+ return;
184
+ const calls = isRecord(value) && isRecord(value.calls) && isRecord(value.calls.owner) ? {
185
+ methods: nonEmptyText(value.calls.methods),
186
+ owner: value.calls.owner
187
+ } : undefined;
188
+ const files = isRecord(value) ? nonEmptyText(value.files) : undefined;
189
+ const callsRead = calls?.methods !== undefined && isText(calls.owner.export) && isText(calls.owner.module) ? {
190
+ methods: calls.methods,
191
+ owner: { export: calls.owner.export, module: calls.owner.module }
192
+ } : undefined;
193
+ if (!isRecord(value) || value.calls !== undefined && callsRead === undefined || value.files !== undefined && files === undefined || callsRead === undefined && files === undefined) {
194
+ problems.push(`${where}: reaches names neither calls nor files`);
195
+ return;
196
+ }
197
+ const reach = {
198
+ ...callsRead === undefined ? {} : { calls: callsRead },
199
+ ...files === undefined ? {} : { files }
200
+ };
201
+ return reach;
202
+ };
172
203
  var readChange = (value, where, problems) => {
173
204
  if (!isRecord(value)) {
174
205
  problems.push(`${where}: not an object`);
@@ -183,8 +214,10 @@ var readChange = (value, where, problems) => {
183
214
  problems.push(`${where}: needs a summary`);
184
215
  return;
185
216
  }
217
+ const reaches = readReach(value.reaches, where, problems);
186
218
  const shared = {
187
219
  ...isText(value.detail) ? { detail: value.detail } : {},
220
+ ...reaches === undefined ? {} : { reaches },
188
221
  ...isText(value.reference) ? { reference: value.reference } : {},
189
222
  summary: value.summary
190
223
  };
@@ -994,6 +1027,7 @@ var renderChangelogJson = (changelog) => `${JSON.stringify({
994
1027
  ...change.detail === undefined ? {} : { detail: change.detail },
995
1028
  kind: change.kind,
996
1029
  ...isDisruptive(change) ? { migration: change.migration } : {},
1030
+ ...change.reaches === undefined ? {} : { reaches: change.reaches },
997
1031
  ...change.reference === undefined ? {} : { reference: change.reference },
998
1032
  summary: change.summary,
999
1033
  ...change.symbols && change.symbols.length > 0 ? { symbols: change.symbols } : {}
@@ -1388,5 +1422,5 @@ await main().catch((error) => {
1388
1422
  process.exit(1);
1389
1423
  });
1390
1424
 
1391
- //# debugId=F85103537D4064B364756E2164756E21
1425
+ //# debugId=364D985C300E901F64756E2164756E21
1392
1426
  //# sourceMappingURL=cli.js.map