@akanjs/devkit 3.2.0-rc.6 → 3.2.0-rc.7
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 +3 -0
- package/apiReport/apiReport.test.ts +14 -0
- package/apiReport/apiReportPolicy.ts +4 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
- The dev builder draws the graph on request through a new `build-graph` builder RPC, and keeps it until the next save.
|
|
132
132
|
- It sits behind the same gate as the other `/_akan` devtools routes, and `akan tunnel` / `akan start --share` refuse it.
|
|
133
133
|
|
|
134
|
+
- 2d3b958: `ApiReportPolicy.check` counts a changeset that a branch adds in place of a similar one it deletes. git's rename detection paired the two, so the added changeset was not listed and its `minor` bump did not satisfy the check.
|
|
134
135
|
- 465ccb9: `@akanjs/devkit/apiReport/apiReport` renders a package's public API, one report per entry point, from its declaration emit. The akanjs repository now commits that report for `akanjs` and checks it in CI: a removed export or a changed declaration needs a `minor` changeset that says how to upgrade.
|
|
135
136
|
- 0504209: `akan build <app> --env <env>` builds for an environment other than the workspace `.env`'s, the way the desktop and mobile builds already do. Before, the shell's `AKAN_PUBLIC_ENV` lost to the `.env`, so a new workspace could only build `local` without editing it. The local-build notice, the image guard and the README now say what a `local` build changes in a built server: no endpoint rate limits, and local defaults for Redis and the database mode. They no longer say the dev routes are served, which a built server never does.
|
|
136
137
|
- bf872ce: A variable the shell sets now outranks the workspace `.env` when `akan` builds or runs an app, as dotenv and Bun's own `.env` loading do: `AKAN_PUBLIC_ENV=main akan build <app>` builds `main` where the `.env` says `local`. The order is `--env` (for `AKAN_PUBLIC_ENV`), then the process environment (the shell, and the `.env.local` and `.env.<NODE_ENV>` Bun loads into it), then the `.env`, then the defaults; an empty export counts as unset. The bundles, the bundled server env, `akan.env.json` and the Dockerfile still take one set of values. Where an exported value outranks the `.env`, `akan build` now warns with both values instead of the old warning that listed the values it ignored, and the server-env message, the `--env` help, the local-build notice, the README and the CLI reference state the new order.
|
|
@@ -392,6 +393,7 @@
|
|
|
392
393
|
|
|
393
394
|
- d2b2291: A failed workflow no longer reports success to its caller. `akan workflow plan` exits 1 when the plan has an error, `akan workflow apply` when the apply or its `--dry-run` fails, and `akan workflow validate` when its status is `failed` (which includes `passed-with-baseline-blockers`); all three exited 0 before. A dry run of a plan with an error, such as `add-field --type Number`, reports `failed` and lists no changed or generated files, where it used to list the plan's edits under "Automatically Modified". Over MCP, `plan_workflow` names `apply_workflow` in `next` and `approval.canApplyWith` only for a plan without an error, and `apply_workflow` names `run_validation` only when the apply did not fail; a refused plan also drops its "apply this plan" and "validate the apply report" recommendations. The workflows that write into an existing module (`add-field`, `add-enum-field`, `add-mutation`, `add-slice`, `create-ui`, `rename-key`) now refuse a service module, or any folder without its `<module>.constant.ts`, at plan time and again at apply. The `workflow-module-not-database` error lists the target's database modules and points at `create-module`, and for a field at `create-scalar`. Before, `add-field` on a service module passed its plan and dry run and failed only at apply, and `create-ui` wrote a misnamed `_<service>.View.tsx` into it. The `workflow-module-missing` error now lists only database modules too, says a name that matches a service module (with or without its `_`) is one instead of asking "Did you mean \_<service>?", and points at another app or library only when it holds a database module of that name.
|
|
394
395
|
- adcdf3b: `akan workflow plan` and the `plan_workflow` MCP tool refuse a module the target app or library lacks, for every workflow that writes into an existing module (`add-field`, `add-enum-field`, `add-mutation`, `add-slice`, `create-ui`, `rename-key`). The `workflow-module-missing` error names the module, lists the modules the target has, and points at the module whose name differs only in case or by a leading `_`, at a scalar of that name, or at the app or library that holds it; only when none exists does it point at `create-module`. Before, the plan passed and its dry run reported `passed`. `add-mutation` used to plan a missing module with a warning so that a `create-module` plan could precede it; it now refuses too, so plan it after applying `create-module`. Every workflow now refuses an unknown `app` at plan time, listing the workspace's apps and libraries. `apply` and `--dry-run` check the target again before anything else, so a plan written earlier for a module that is gone fails instead of passing. `plan_workflow` now inspects the MCP server's workspace rather than the process directory.
|
|
396
|
+
- Updated dependencies [bd198af]
|
|
395
397
|
- Updated dependencies [bc792ab]
|
|
396
398
|
- Updated dependencies [31f7039]
|
|
397
399
|
- Updated dependencies [61fbd7d]
|
|
@@ -440,6 +442,7 @@
|
|
|
440
442
|
- Updated dependencies [5cd1fc3]
|
|
441
443
|
- Updated dependencies [f47cc82]
|
|
442
444
|
- Updated dependencies [7f0de74]
|
|
445
|
+
- Updated dependencies [c0b84d0]
|
|
443
446
|
- Updated dependencies [1f93507]
|
|
444
447
|
- Updated dependencies [5d3cb3e]
|
|
445
448
|
- Updated dependencies [9a9e1fa]
|
|
@@ -476,6 +476,20 @@ describe("ApiReportPolicy", () => {
|
|
|
476
476
|
expect((await policy.check("main"))?.bumped).toBe(false);
|
|
477
477
|
});
|
|
478
478
|
|
|
479
|
+
test("counts a changeset added in place of a similar one from the base", async () => {
|
|
480
|
+
const note = "Every app's client declaration names the Err type instead of spelling out its class.\n".repeat(4);
|
|
481
|
+
const { root, policy } = await makeRepo(
|
|
482
|
+
{ "demo.api.md": reportOf("export declare const a: number;", "export declare const b: number;") },
|
|
483
|
+
{ ".changeset/older.md": `---\n"akanjs": patch\n---\n\n${note}` },
|
|
484
|
+
);
|
|
485
|
+
await writeText(path.join(root, "api-report/demo/demo.api.md"), reportOf("export declare const a: number;"));
|
|
486
|
+
await rm(path.join(root, ".changeset/older.md"));
|
|
487
|
+
await writeText(path.join(root, ".changeset/newer.md"), `---\n"akanjs": minor\n---\n\n${note}`);
|
|
488
|
+
git(root, "add", "-A");
|
|
489
|
+
git(root, "commit", "-q", "-m", "drop b");
|
|
490
|
+
expect((await policy.check("main"))?.bumped).toBe(true);
|
|
491
|
+
});
|
|
492
|
+
|
|
479
493
|
test("answers null for a ref that names no commit", async () => {
|
|
480
494
|
const { policy } = await makeRepo({});
|
|
481
495
|
expect(await policy.check("origin/missing")).toBeNull();
|
|
@@ -43,9 +43,10 @@ export class ApiReportPolicy {
|
|
|
43
43
|
const breaks = ApiReportDiff.breaks(before, await this.readReports());
|
|
44
44
|
if (!breaks.length) return { breaks, bumped: false };
|
|
45
45
|
const added = [
|
|
46
|
-
...(
|
|
47
|
-
"
|
|
48
|
-
|
|
46
|
+
...(
|
|
47
|
+
(await this.#git(["diff", "--name-only", "--no-renames", "--diff-filter=A", mergeBase, "--", ".changeset"])) ??
|
|
48
|
+
""
|
|
49
|
+
).split("\n"),
|
|
49
50
|
...((await this.#git(["ls-files", "--others", "--exclude-standard", "--", ".changeset"])) ?? "").split("\n"),
|
|
50
51
|
].filter((file) => file.endsWith(".md") && !file.endsWith("README.md"));
|
|
51
52
|
const bumps = await Promise.all(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "3.2.0-rc.
|
|
3
|
+
"version": "3.2.0-rc.7",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"./*": "./*.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@akanjs/language": "3.2.0-rc.
|
|
44
|
+
"@akanjs/language": "3.2.0-rc.7",
|
|
45
45
|
"@earendil-works/pi-agent-core": "1.3.0",
|
|
46
46
|
"@earendil-works/pi-ai": "1.3.0",
|
|
47
47
|
"@earendil-works/pi-codemode": "1.3.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@earendil-works/pi-tui": "1.3.0",
|
|
51
51
|
"@inquirer/prompts": "^8.7.3",
|
|
52
52
|
"@tailwindcss/node": "^4.3.3",
|
|
53
|
-
"akanjs": "3.2.0-rc.
|
|
53
|
+
"akanjs": "3.2.0-rc.7",
|
|
54
54
|
"chalk": "^6.0.1",
|
|
55
55
|
"commander": "^15.0.0",
|
|
56
56
|
"dayjs": "^1.11.23",
|