@cosmicdrift/kumiko-framework 0.215.2 → 0.215.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-framework",
3
- "version": "0.215.2",
3
+ "version": "0.215.4",
4
4
  "description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -194,7 +194,7 @@
194
194
  "./package.json": "./package.json"
195
195
  },
196
196
  "dependencies": {
197
- "@cosmicdrift/kumiko-types": "0.215.2",
197
+ "@cosmicdrift/kumiko-types": "0.215.4",
198
198
  "bullmq": "^5.76.7",
199
199
  "bun-types": "^1.3.13",
200
200
  "hono": "^4.13.1",
@@ -210,7 +210,7 @@
210
210
  "zod": "^4.4.3"
211
211
  },
212
212
  "devDependencies": {
213
- "@cosmicdrift/kumiko-dispatcher-live": "0.215.2",
213
+ "@cosmicdrift/kumiko-dispatcher-live": "0.215.4",
214
214
  "bun-types": "^1.3.13",
215
215
  "pino-pretty": "^13.1.3"
216
216
  },
@@ -151,6 +151,47 @@ describe("upgrade command — framework core changelog", () => {
151
151
  expect(spy.errs.join("\n")).toContain("Invalid version format");
152
152
  expect(spy.logs).toEqual([]);
153
153
  });
154
+
155
+ test("--json installedVersion reflects the actually installed version, not an echo of --from", async () => {
156
+ const cwd = tmp({
157
+ "packages/framework/src/changes.json": CORE_ENTRY,
158
+ "packages/bundled-features/package.json": JSON.stringify({ version: "0.190.0" }),
159
+ });
160
+ const spy = makeSpyOutput();
161
+
162
+ const exit = await runUpgradeCli(["--from", "0.165.0", "--json"], cwd, spy.out);
163
+
164
+ expect(exit).toBe(0);
165
+ const result = JSON.parse(spy.logs.join("\n"));
166
+ expect(result.currentVersion).toBe("0.165.0");
167
+ expect(result.installedVersion).toBe("0.190.0");
168
+ });
169
+
170
+ test("--json without --from: currentVersion and installedVersion both come from the installed package", async () => {
171
+ const cwd = tmp({
172
+ "packages/framework/src/changes.json": CORE_ENTRY,
173
+ "packages/bundled-features/package.json": JSON.stringify({ version: "0.190.0" }),
174
+ });
175
+ const spy = makeSpyOutput();
176
+
177
+ const exit = await runUpgradeCli(["--json"], cwd, spy.out);
178
+
179
+ expect(exit).toBe(0);
180
+ const result = JSON.parse(spy.logs.join("\n"));
181
+ expect(result.currentVersion).toBe("0.190.0");
182
+ expect(result.installedVersion).toBe("0.190.0");
183
+ });
184
+
185
+ test("--json installedVersion is null when nothing is installed and --from is given", async () => {
186
+ const cwd = tmp({ "packages/framework/src/changes.json": CORE_ENTRY });
187
+ const spy = makeSpyOutput();
188
+
189
+ const exit = await runUpgradeCli(["--from", "0.165.0", "--json"], cwd, spy.out);
190
+
191
+ expect(exit).toBe(0);
192
+ const result = JSON.parse(spy.logs.join("\n"));
193
+ expect(result.installedVersion).toBeNull();
194
+ });
154
195
  });
155
196
 
156
197
  describe("upgrade command — enterprise package layout", () => {
@@ -355,7 +355,10 @@ export async function runUpgradeCli(
355
355
  const verbose = getFlag(args, "verbose");
356
356
  const fromFlag = getStringFlag(args, "from");
357
357
 
358
- const currentVersion = fromFlag ?? readCurrentVersion(cwd);
358
+ // Always resolve the actually installed version, even when --from is set,
359
+ // so --json can report both the filter baseline and what's really there.
360
+ const installedVersion = readCurrentVersion(cwd);
361
+ const currentVersion = fromFlag ?? installedVersion;
359
362
  if (!currentVersion) {
360
363
  out.err("");
361
364
  out.err(" Could not detect Kumiko version.");
@@ -401,7 +404,7 @@ export async function runUpgradeCli(
401
404
  }
402
405
 
403
406
  if (jsonMode) {
404
- out.log(JSON.stringify({ currentVersion, pending }, null, 2));
407
+ out.log(JSON.stringify({ currentVersion, installedVersion, pending }, null, 2));
405
408
  return 0;
406
409
  }
407
410