@absolutejs/changelog 0.7.1 → 0.8.1

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,20 @@ 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.8.1 — 2026-11-19
10
+
11
+ ### Fixed
12
+
13
+ - **Moving dependencies changes only their versions in package.json** (`applyDependencyMigrations`)
14
+ 0.8.0 wrote package.json back through JSON.stringify, which reflowed one-line arrays such as `"files": ["dist"]`. Now only the version strings change, inside their own section.
15
+
16
+ ## 0.8.0 — 2026-11-19
17
+
18
+ ### Added
19
+
20
+ - **Migrations can rename a class's methods and move dependencies** (`Migration`, `applyMigration`, `applyDependencyMigrations`, `isDependencyMigration`)
21
+ A method renamed on a class's instances (`new Elysia().beforeHandle(...)` to `.onBeforeHandle(...)`) and a peer that has to move with a release (Elysia to 2.0.0-rc.0) are now data a project can have applied, like a renamed export. A method is renamed only where the file shows its receiver is an instance; a dependency moves only where it is a version range below the one asked for.
22
+
9
23
  ## 0.7.1 — 2026-10-07
10
24
 
11
25
  ### Fixed
package/changelog.json CHANGED
@@ -2,6 +2,37 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/changelog",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "detail": "0.8.0 wrote package.json back through JSON.stringify, which reflowed one-line arrays such as `\"files\": [\"dist\"]`. Now only the version strings change, inside their own section.",
9
+ "kind": "fixed",
10
+ "summary": "Moving dependencies changes only their versions in package.json",
11
+ "symbols": [
12
+ "applyDependencyMigrations"
13
+ ]
14
+ }
15
+ ],
16
+ "date": "2026-11-19",
17
+ "version": "0.8.1"
18
+ },
19
+ {
20
+ "changes": [
21
+ {
22
+ "detail": "A method renamed on a class's instances (`new Elysia().beforeHandle(...)` to `.onBeforeHandle(...)`) and a peer that has to move with a release (Elysia to 2.0.0-rc.0) are now data a project can have applied, like a renamed export. A method is renamed only where the file shows its receiver is an instance; a dependency moves only where it is a version range below the one asked for.",
23
+ "kind": "added",
24
+ "summary": "Migrations can rename a class's methods and move dependencies",
25
+ "symbols": [
26
+ "Migration",
27
+ "applyMigration",
28
+ "applyDependencyMigrations",
29
+ "isDependencyMigration"
30
+ ]
31
+ }
32
+ ],
33
+ "date": "2026-11-19",
34
+ "version": "0.8.0"
35
+ },
5
36
  {
6
37
  "changes": [
7
38
  {
package/dist/apply.d.ts CHANGED
@@ -17,7 +17,11 @@ export declare const applyMigration: (source: string, input: {
17
17
  migration: Migration;
18
18
  packageName: string;
19
19
  path?: string;
20
- }) => MigrationResult;
20
+ }) => {
21
+ changed: boolean;
22
+ notes: string[];
23
+ source: string;
24
+ };
21
25
  /**
22
26
  * Apply migrations in order.
23
27
  *
@@ -0,0 +1,13 @@
1
+ import { type Migration } from "./types";
2
+ export type DependencyEdit = {
3
+ from: string;
4
+ name: string;
5
+ section: string;
6
+ to: string;
7
+ };
8
+ type Outcome = {
9
+ edits: DependencyEdit[];
10
+ manifest: string;
11
+ };
12
+ export declare const applyDependencyMigrations: (manifest: string, migrations: readonly Migration[]) => Outcome;
13
+ export {};
@@ -0,0 +1,16 @@
1
+ import ts from "typescript";
2
+ import type { Migration } from "./types";
3
+ type MethodsMigration = Extract<Migration, {
4
+ methods: unknown;
5
+ }>;
6
+ type Result = {
7
+ changed: boolean;
8
+ notes: string[];
9
+ source: string;
10
+ };
11
+ export declare const applyMethods: (input: {
12
+ file: ts.SourceFile;
13
+ methods: MethodsMigration["methods"];
14
+ source: string;
15
+ }) => Result;
16
+ export {};
package/dist/cli.js CHANGED
@@ -28,6 +28,7 @@ var CHANGELOG_CONTRACT = 1;
28
28
  var CHANGELOG_FILE = "changelog.json";
29
29
  var CHANGELOG_MARKDOWN = "CHANGELOG.md";
30
30
  var UNRELEASED_DIRECTORY = "changelog/unreleased";
31
+ var isDependencyMigration = (migration) => ("dependencies" in migration);
31
32
  var isDisruptive = (change) => change.kind === "breaking" || change.kind === "removed";
32
33
  var isMechanical = (migration) => !("manual" in migration);
33
34
 
@@ -145,9 +146,27 @@ var readMigration = (value, where, problems) => {
145
146
  instruction,
146
147
  resubpath: { from: resubpath.from, to: resubpath.to }
147
148
  };
149
+ const { methods } = value;
150
+ if (isRecord(methods) && isRecord(methods.owner) && isText(methods.owner.module) && isText(methods.owner.export) && isRecord(methods.renames) && Object.keys(methods.renames).length > 0 && Object.values(methods.renames).every(isText))
151
+ return {
152
+ instruction,
153
+ methods: {
154
+ owner: { export: methods.owner.export, module: methods.owner.module },
155
+ renames: Object.fromEntries(Object.entries(methods.renames).filter((entry) => isText(entry[1])))
156
+ }
157
+ };
158
+ const { dependencies } = value;
159
+ if (isRecord(dependencies) && isText(dependencies.range) && Array.isArray(dependencies.names) && dependencies.names.length > 0 && dependencies.names.every(isText)) {
160
+ const [first, ...rest] = dependencies.names.filter((name) => isText(name));
161
+ if (first !== undefined)
162
+ return {
163
+ dependencies: { names: [first, ...rest], range: dependencies.range },
164
+ instruction
165
+ };
166
+ }
148
167
  if (value.manual === true)
149
168
  return { instruction, manual: true };
150
- problems.push(`${where}: migration says neither rename, moved, resubpath nor manual`);
169
+ problems.push(`${where}: migration says neither rename, moved, resubpath, methods, dependencies nor manual`);
151
170
  return;
152
171
  };
153
172
  var readChange = (value, where, problems) => {
@@ -926,6 +945,10 @@ var migrationLine = (migration) => {
926
945
  return `Import \`${migration.moved.symbol}\` from \`${migration.moved.to}\` instead of \`${migration.moved.from}\`.`;
927
946
  if ("resubpath" in migration)
928
947
  return `Import from \`${migration.resubpath.to}\` instead of \`${migration.resubpath.from}\`.`;
948
+ if ("methods" in migration)
949
+ return `${Object.entries(migration.methods.renames).map(([before, after]) => `\`.${before}()\` is now \`.${after}()\``).join(", ")} on \`${migration.methods.owner.export}\`.`;
950
+ if ("dependencies" in migration)
951
+ return `Move ${migration.dependencies.names.map((name) => `\`${name}\``).join(", ")} to \`${migration.dependencies.range}\`.`;
929
952
  return migration.instruction;
930
953
  };
931
954
  var renderChange = (change) => {
@@ -1365,5 +1388,5 @@ await main().catch((error) => {
1365
1388
  process.exit(1);
1366
1389
  });
1367
1390
 
1368
- //# debugId=D76B4516336E7D1B64756E2164756E21
1391
+ //# debugId=F85103537D4064B364756E2164756E21
1369
1392
  //# sourceMappingURL=cli.js.map