@akanjs/devkit 3.2.0-rc.18 → 3.2.0-rc.19
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 +44 -4
- package/DEV_RUNTIME_KNOBS.md +4 -3
- package/akanApp/akanApp.host.test.ts +18 -2
- package/akanApp/akanApp.host.wiring.test.ts +723 -0
- package/akanApp/devIdleSuspend.test.ts +107 -20
- package/akanApp/devIdleSuspend.ts +31 -14
- package/akanApp/devIdleSuspend.watcher.test.ts +77 -0
- package/apiReport/apiReport.test.ts +29 -0
- package/apiReport/apiReportDiff.ts +35 -1
- package/app/applicationBuildReporter.ts +2 -49
- package/artifact/implicitRootLayoutRender.test.tsx +23 -3
- package/codeAgent/agent/akanSystemPrompt.ts +1 -1
- package/codeAgent/skills/akan-scaffold/SKILL.md +1 -1
- package/commandDecorators/command.ts +2 -1
- package/commandDecorators/commandBuilder.ts +1 -1
- package/commandDecorators/commandDecorators.test.ts +28 -4
- package/context/akanContext.ts +20 -527
- package/context/akanContextInspection.ts +296 -0
- package/context/akanMcpContract.ts +13 -253
- package/context/doctor/agentGuideCheck.ts +81 -0
- package/context/doctor/configLeftoverCheck.ts +35 -0
- package/context/doctor/doctorFindings.ts +70 -0
- package/context/doctor/generatedFreshness.ts +56 -0
- package/context/doctor/moduleShapeCheck.ts +88 -0
- package/context/doctor/recipeDuplicateCheck.ts +39 -0
- package/context/doctor/recipeIndexCheck.ts +87 -0
- package/context/doctor/rootShapeCheck.ts +55 -0
- package/context/doctor/workflowScope.ts +97 -0
- package/context/safeRead.ts +9 -0
- package/devkitUtils.test.ts +34 -0
- package/executors/executors.test.ts +1 -4
- package/executors/workspaceExecutor.ts +1 -2
- package/frontendBuild/hmrWatcher.stop.test.ts +36 -0
- package/frontendBuild/hmrWatcher.ts +2 -0
- package/incrementalBuilder/buildBatch.proc.ts +13 -3
- package/incrementalBuilder/buildBatchProtocol.ts +2 -0
- package/incrementalBuilder/buildBatchRunner.test.ts +61 -0
- package/incrementalBuilder/buildBatchRunner.ts +6 -3
- package/incrementalBuilder/builderBoot.ts +106 -0
- package/incrementalBuilder/builderBuildStatus.ts +23 -0
- package/incrementalBuilder/builderChannel.ts +11 -0
- package/incrementalBuilder/builderLanes.ts +157 -0
- package/incrementalBuilder/builderWatch.ts +213 -0
- package/incrementalBuilder/csrRegistry.ts +234 -0
- package/incrementalBuilder/incrementalBuilder.proc.test.ts +92 -1
- package/incrementalBuilder/incrementalBuilder.proc.ts +80 -822
- package/incrementalBuilder/ssrRegistry.ts +278 -0
- package/integration/devStability.integration.test.ts +62 -56
- package/package.json +3 -3
- package/test/testHelpers.ts +36 -0
- package/util/errorReport.ts +66 -0
- package/workflow/constantSource.ts +187 -0
- package/workflow/dictionarySource.ts +184 -0
- package/workflow/executor.ts +5 -8
- package/workflow/fieldExpression.ts +153 -0
- package/workflow/fieldLabel.ts +61 -0
- package/workflow/fieldOrder.ts +117 -0
- package/workflow/fieldType.ts +2 -1
- package/workflow/keyRename.ts +1 -1
- package/workflow/moduleIndex.ts +1 -1
- package/workflow/modulePaths.ts +27 -0
- package/workflow/mutationScaffold.ts +7 -15
- package/workflow/mutationSource.ts +2 -1
- package/workflow/plan.ts +2 -1
- package/workflow/primitiveReport.ts +78 -0
- package/workflow/serviceSource.ts +33 -0
- package/workflow/signalSource.ts +96 -0
- package/workflow/source.ts +50 -1100
- package/workflow/sourceAst.ts +30 -0
- package/workflow/sourceImports.ts +105 -0
- package/workflow/sourceText.ts +13 -0
- package/workflow/templateSource.ts +30 -0
- package/workflow/testSource.ts +31 -0
- package/workflow/types.ts +1 -1
- package/workflow/uiPolicy.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -56,6 +56,13 @@
|
|
|
56
56
|
- **The `akan-service` skill** carries a recipe for pages backed by an external HTTP API: an `adapt()` adapter in `srvkit/` that reads its base URL at boot, a `lib/_<service>` service, a `Public` `query(Any, { nullable: true })` endpoint and its dictionary label, and the page that calls it.
|
|
57
57
|
- **The README's "Inside an existing repository"** runs the creator through `npx -y bun@1.4.4 x …` on a host with only Node and npm, so nothing global is written. It also gives copy-ready `build` and `start` scripts, says a fresh clone builds without a committed env file, and says which environment a `.env`-less build is for and what a deployed host sets instead.
|
|
58
58
|
|
|
59
|
+
- a166716: The agent guide tells a coding agent to finish the task and to write a final message a reader can follow.
|
|
60
|
+
|
|
61
|
+
- `AGENTS.md`'s managed block gains two sections. **Finishing Work**: carry the task to `verify ok`, treat a failing check or a stale generated file as an obstacle to work through (never by silencing the check), ask only when the work cannot go on, and confirm before a push, a deploy or a write to a shared database. **Reporting**: lead with the outcome, name every changed file, give each check's result line, and say what was left undone.
|
|
62
|
+
- A new workspace's `AGENTS.md` asks the agent to finish the task with a small marked workaround while a framework issue is drafted.
|
|
63
|
+
- The `akan-scaffold` skill builds the request without a supporting entity nobody asked for and says why one may be needed, instead of stopping to ask.
|
|
64
|
+
- `akan code` closes a turn that changed files with those files and what `akan_verify` said.
|
|
65
|
+
|
|
59
66
|
- 61fbd7d: `get_graph` takes `since`, a git revision, and returns the Change Map: the Akan Graph of what changed since HEAD forked from that revision, working tree and untracked files included. Every node, field and edge is marked `added`, `removed` or `changed`. The unchanged nodes a changed one calls, or is called by, stay in as context, and `unmapped` lists the changed files under `apps/` or `libs/` that no node covers, each marked the same way. `since: "HEAD"` maps uncommitted work only. Files `.gitignore` covers stay out, a renamed file reads as removed and added, and a CRLF checkout of an unchanged file reads as unchanged. A revision git does not know returns a `graph-since-unknown` diagnostic, and so does one HEAD shares no commit with (a shallow clone, say) instead of comparing with its tip. A revision that starts with `-` also returns it and never reaches git.
|
|
60
67
|
|
|
61
68
|
- **`AkanGraphDiff.between(base, head)`** in `@akanjs/language` diffs two graphs. `index.graph(readText, { digests: true })` gives each member, query, component and field a hash of its body text, so an edit inside a method, or to a field's options, marks it changed and moving it does not.
|
|
@@ -181,6 +188,7 @@
|
|
|
181
188
|
- It sits behind the same gate as the other `/_akan` devtools routes, and `akan tunnel` / `akan start --share` refuse it.
|
|
182
189
|
|
|
183
190
|
- 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.
|
|
191
|
+
- 2d5d659: The API break check (`bun run api:report --base`) no longer asks for a `minor` changeset when an inferred type's union members or object members only moved. The checker orders them by when it first met each one, so a refactor that changes which file is checked first reordered them without changing the type. Reordered overloads still count as a change.
|
|
184
192
|
- 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.
|
|
185
193
|
- 222c7df: `akan lint` holds `server/`, `service/` and `signal/` of the `akanjs` package to the bare built-in `Error`s they construct or extend today (`akan.error.bare-error`): its `akan.baseline.json` records them per file and holds their total, so moving one between files passes and a new one anywhere fails. A change that removes one must lower the section too: `akan lint --no-fix` fails while the recorded total is above the code's, and `akan verify akanjs` or `akan lint akanjs` lowers it. No other package or workspace is measured by it. A baseline committed before a rule is added now adopts that rule with the debt its code held at the fork point.
|
|
186
194
|
|
|
@@ -188,6 +196,7 @@
|
|
|
188
196
|
|
|
189
197
|
- d12f556: The barrel-import rewrite maps a name that a barrel re-exports by name from another barrel (`export { migration } from "./migration"`) to the file that declares it, as it already did through `export *`. It used to stop at the inner barrel, so a page that imported one name loaded every module behind it.
|
|
190
198
|
- a480576: A file moved since the fork point keeps its `akan.baseline.json` entries, whether it was moved with `git mv` or a plain rename. The growth check reads the committed entries under the path git pairs the file with, and `--fix` rewrites the working entries there, so moving a recorded file no longer fails as new debt. A move that also rewrote more than half the file, or left a file at the old path, still reads as new, since git no longer sees it as a move.
|
|
199
|
+
- 1b04784: The dev build batch worker now waits for the runner to take its result before exiting, so a result can't be lost however fast the worker finishes. In the tests, workers that exited within milliseconds of starting could lose everything they sent and be reported as crashed.
|
|
191
200
|
- 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.
|
|
192
201
|
- 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.
|
|
193
202
|
|
|
@@ -202,6 +211,13 @@
|
|
|
202
211
|
|
|
203
212
|
In `@akanjs/devkit`, `shouldAbandonBackendRecovery` is replaced by `backendRecoveryPolicy`, which gives up after five failed backend restarts as before.
|
|
204
213
|
|
|
214
|
+
- 9134033: A failed command prints the errors inside an AggregateError, not just its message.
|
|
215
|
+
|
|
216
|
+
- A `Bun.build` failure thrown as `new AggregateError(result.logs, "…")` printed only that message. An app plugin's `syncAssets` hook is one place that throws it, and there `akan sync` printed only `[licenseNotices] server graph failed` and dropped the `Could not resolve` lines that named the cause. The CLI now prints up to 20 inner errors under the message, then `…and N more`, then the `cause` chain. Bun build and resolve logs keep their `file:line:col`, and everything prints last, where a tail of the output keeps it.
|
|
217
|
+
- Any failed command's error now prints its `cause` chain as `Caused by:` lines, an AggregateError or not. A cause or an inner error that loops back on itself prints `[circular]` and ends there.
|
|
218
|
+
- `--json` is unchanged: its `error` field stays the one-line message.
|
|
219
|
+
- `akan build`, `typecheck` and `verify` already printed inner errors. They now stop at the same 20.
|
|
220
|
+
|
|
205
221
|
- e65172d: The CLI refreshes a cloud sign-in once less than an hour, or half the token's lifetime, is left, whichever is shorter. Before, a token that lived an hour or less read as due the moment it arrived, so every command rotated the refresh token and then called the cloud unsigned. Any unexpired token is now sent with the request, except the refresh call, which carries none. `akan login` signs in again when a session is due for refresh and has no refresh token left.
|
|
206
222
|
- c3b5b3c: The framework no longer puts `@akanjs/native/core` on a web page. `isNativeApp()` and the other host checks read the platform the shell writes before the bundle runs, and a native shell still starts core with the page. A file that imports `akanjs/client/native` statically still brings core to every page that reaches it. On the minimal app this takes 15 KB raw (5.6 KB brotli) off the vendor floor and 20 KB raw (6.6 KB brotli) off every route entry. `akan build` also resolves the `production` export condition for the browser, SSR-client, CSR and MCP App view bundles, so a package such as Lexical ships its production build alone. On the minimal app the Agent editor chunk drops from 91 KB to 63 KB brotli. `akan start` is unchanged.
|
|
207
223
|
- 6d5b544: A database service now has `create<Model>Many(rows)`. It creates the rows on the same path as `create<Model>`: `_preCreate` and `_postCreate`, the document's save and create hooks, and the live and pubsub events each row's commit fires. Every row's `_preCreate` and document pre hooks run first, so a check there that queries the table does not see the batch's own rows. The rows are then written in one transaction, joining the caller's when one is open, with one multi-row INSERT per 500 rows instead of one statement per row; if the database refuses one row, none is written. Every row's `_postCreate` runs once the transaction commits, as `create<Model>`'s runs once its row is stored, so a `_postCreate` that throws leaves the rows written. A service that already declares a method of that name, itself or in a lib service it extends, keeps its own at runtime, but its signature no longer typechecks against the generated one: rename it.
|
|
@@ -253,6 +269,8 @@
|
|
|
253
269
|
|
|
254
270
|
**For an existing workspace** nothing is required. To give a fresh clone values other than the empty defaults, commit an `env/env.server.example.ts` (and `env.client.example.ts`) without secrets in it; in an older workspace, add `!**/env.client.example.ts` to `.gitignore` for the client one. If you link env files into a new worktree, link them before the first `akan` command there, or replace the defaults it wrote.
|
|
255
271
|
|
|
272
|
+
- 668a52d: Listing an app's or lib's modules (`SysExecutor.getModules`, and the constant-file readers built on it) no longer fails with `ENOENT` when the process runs outside the workspace root, and skips a dangling symlink instead of rejecting.
|
|
273
|
+
- fa42f4e: A dev server about to idle-suspend now decides again once its idle watcher has started, and stays awake if a builder request or builder message came in while the watcher was starting, or if the builder or backend stopped being ready. It used to release the builder anyway, so a `build-graph` or route request sent in that window waited for the next wake or failed. A dev file watcher stopped in the middle of a scan no longer reports what that scan found, which the next idle wake used to replay as a stale change.
|
|
256
274
|
- fd2c575: A dev server that stops no longer re-arms its idle-suspend timer or keeps a file watcher running. A wake that settles after the stop, a builder message or relayed request that arrives after it, and an idle watcher that finishes starting after it each used to re-arm the timer, report the host awake, or leave the watcher open. A request that reaches a host stopped while suspended is now refused at once instead of being held for a wake that never comes.
|
|
257
275
|
- e2b809a: The typecheck behind `akan typecheck`, `akan verify` and `akan build` now uses its incremental cache. It wrote a `.tsbuildinfo` on every run, then checked every file again anyway, so a run with nothing changed cost as much as the first: about 8 seconds on a 2,400-file project. Now a run re-checks only the files that changed and the files they affect, and reads the rest from the cache. The same project's second run takes about 1.2 seconds. The diagnostics are the same, in the same order, as a full check: options, global, syntax, type and declaration errors, an edited file's new errors and the errors it causes in files that import it. `--clean` still clears the cache first.
|
|
258
276
|
- bf28968: An app can now serve its default locale at unprefixed paths. Set `i18n.localePrefix` to `"as-needed"` in `akan.config.ts`, and `/books/OL45804W` is the English page itself. Before, every page lived under `/<locale>/…`, and an unprefixed path answered with a 307 to the locale the browser asked for. An app with one language, or with URLs fixed from outside (OAuth callbacks, QR codes, links in mail, a migrated site), could only meet them with raw `<a href>`s, which reloaded the whole page and went through that 307 on every click.
|
|
@@ -304,7 +322,7 @@
|
|
|
304
322
|
Starting the browser now has its own bound of 120 s, `startTimeoutMs` on `PreviewView.probe`. Running out of it reads `Timed out starting the <engine> browser after 120 s.`, where the engine is `chrome` or `webkit`. A browser that misses its bound may still come up late, so later pages in that process try again, but each waits only its own `timeoutMs` for the browser. Once the browser answers, the full bound applies again. So a browser that never starts holds the first page for 120 s, where before it held it for `timeoutMs` (60 s for `akan preview`, 30 s for the code agent's check).
|
|
305
323
|
|
|
306
324
|
- eefd9cb: `akan preview <app> /_akan/studio` opens Studio instead of a 404. Preview added the default locale to every path, and the server routes `/_akan/*` without one, so `/en/_akan/studio` matched no page. A path under `/_akan`, `/__csr`, `/__rsc`, `/.well-known` or the app's API prefix, a file the app's `public/` holds, and the server's own `/favicon.ico`, `/robots.txt`, `/sitemap.xml` (at the root only, the one place the server answers it) and `manifest.webmanifest` now open as written: no locale, and no CSR boot query under `--csr`. Every other path, including one that already starts with a locale or ends in a dotted segment such as `/release/1.2.3`, is a page and gets the default locale as before. The `akan-debug` skill and the `akan preview` reference say so.
|
|
307
|
-
- 01ca04b: `akan preview` opens `/openapi.json` and `/mcp` as written, as the server mounts them outside `/:lang`; before, they got the default locale and opened a 404 page. `/mcp` answers only `POST`, so its preview fails with 405, and the docs say preview cannot check it. A full URL (`http://localhost:<port>/oauth/token`) now opens its path and query with no locale and no CSR boot query, so an endpoint mounted outside the API prefix can be opened; before, a full URL was taken by its path and given the locale. Preview always stays on the app's dev server, for a path that starts with `//` too, and notes a full URL that names another server. `--csr` prints a note naming each path it opens without the CSR boot instead of dropping the flag silently. A page `--changed` finds opens as a page even at a server route's path such as `/openapi.json`, under the same locale rule as a typed page, and a trailing slash names the same page, so `/en` and `/en/` open once. A screenshot's file name carries the page's query and a short hash of the query as sent, a path that is not plain lower-case words carries a hash of the path, and a long path or query is cut with a hash, so `/a/b` and `/a-b`, `?a=b+c` and `?a=b%20c`, or `/_akan/studio?view=runtime` and `?view=signals` no longer overwrite one another and a long query no longer fails the page. The `akan-debug` skill, `akan preview --help` and the `akan preview` reference state
|
|
325
|
+
- 01ca04b: `akan preview` opens `/openapi.json` and `/mcp` as written, as the server mounts them outside `/:lang`; before, they got the default locale and opened a 404 page. `/mcp` answers only `POST`, so its preview fails with 405, and the docs say preview cannot check it. A full URL (`http://localhost:<port>/oauth/token`) now opens its path and query with no locale and no CSR boot query, so an endpoint mounted outside the API prefix can be opened; before, a full URL was taken by its path and given the locale. Preview always stays on the app's dev server, for a path that starts with `//` too, and notes a full URL that names another server. `localhost`, `127.0.0.1` and `0.0.0.0` on the dev port, which `akan start` binds, are the dev server and get no note; `*.localhost`, which can name a sub-route host, still gets one. A full URL's scheme matches in any case (`HTTP://…`). `--csr` prints a note naming each path it opens without the CSR boot instead of dropping the flag silently. A page `--changed` finds opens as a page even at a server route's path such as `/openapi.json`, under the same locale rule as a typed page, and a trailing slash names the same page, so `/en` and `/en/` open once. A path that ends in a slash outside the framework's prefix routes is a page, as the server reads it: `/openapi.json/` or `/logo.png/` misses its exact route and the locale proxy redirects it. Two paths that would write one screenshot open once, such as `/board?akanMobileTarget=preview` and `/board` under `--csr`, or `?a=1&&b=2` and `?a=1&b=2`, and a note names the path that folded; the `--csr` note names only the rows that open. A screenshot's file name carries the page's query and a short hash of the query as sent, a path that is not plain lower-case words carries a hash of the path, and a long path or query is cut with a hash, so `/a/b` and `/a-b`, `?a=b+c` and `?a=b%20c`, or `/_akan/studio?view=runtime` and `?view=signals` no longer overwrite one another and a long query no longer fails the page. The `akan-debug` skill, `akan preview --help` and the `akan preview` reference state which paths open as written.
|
|
308
326
|
- b101fcf: `akan remove-application`, `remove-library`, `remove-package`, `remove-module` and `remove-scalar` no longer delete a target they picked themselves. Left out, or named but not in the workspace, the target is refused in a terminal or not, with the choices and the line to rerun, such as `` Missing app: this command deletes files and never picks its target, so rerun it as `akan remove-application <app>` (choices: pokedex). `` Before, `akan remove-application` in a one-app workspace removed `apps/<app>` without asking, and without a terminal `akan remove-scalar <name>` removed the scalar from the only app or lib. A terminal is no longer offered a select for these commands. Other commands still take the only app, or the only app or lib without a terminal, as before. A command declares this with `destructive: true` on its target.
|
|
309
327
|
- 44149b1: `akan remove-module` now removes a service module named exactly, as in `akan remove-module pokedex:_billing` for `apps/pokedex/lib/_billing`. Before, no command could remove a service module: `remove-module` left out every `lib/_<name>` folder and refused one by name with `Invalid module name: _billing`. A service module left out or misnamed gets the same refusal as any target of a remove command, and its choices now list the service modules. `create-view`, `create-unit`, `create-template` and `create-crud-page` still take only a model module. A command opts in to service modules by taking `ModuleOrService` instead of `Module`.
|
|
310
328
|
- 4fcf44f: A new `rename-key` workflow renames a slice key or a Filter query key everywhere it is spelled. That covers the key itself, every name derived from it (`initMemoInPublic`, `memoListInPublic`, `queryByName`) in the app and every lib, and its module dictionary entry. It is the same rename the editor extension's F2 runs, so agents get it through `plan_workflow` / `apply_workflow` and the CLI through `akan workflow plan rename-key --app <app> --module <module> --slice <key> --to <newKey>` (or `--query <key>`). The plan lists each file it will change. A use that could also be another model's is left alone, and `akan verify` then reports it.
|
|
@@ -442,7 +460,11 @@
|
|
|
442
460
|
- **`ServiceOptions.serverMode`** carries a doc comment, so an editor shows the same explanation on hover.
|
|
443
461
|
|
|
444
462
|
- 6bb1610: Internal: the dev host (`AkanAppHost`) runs the backend, the builder, idle suspend, RSS recycling and dev-plan restarts through one collaborator each instead of one 126-member class. Its public members, start and stop order, restart timing and messages are unchanged.
|
|
463
|
+
- b7b141a: Internal: `akan doctor` runs one check class per family under `context/doctor/` (`rootShapeCheck.ts`, `agentGuideCheck.ts`, `configLeftoverCheck.ts`, `moduleShapeCheck.ts`, `recipeDuplicateCheck.ts`, `recipeIndexCheck.ts`, collected by `doctorFindings.ts` and scoped by `workflowScope.ts` and `generatedFreshness.ts`), and `inspect_akan_context` answers each request type through `AkanContextInspection` in `context/akanContextInspection.ts`. The doctor's diagnostics, their order, codes, severities and repair actions, the `akan context` output and every MCP answer are unchanged, and `akanContext.ts` and `akanMcpContract.ts` export the same names.
|
|
464
|
+
- 158c507: Internal: `ApplicationCommand` in `application/application.command.ts` now declares its commands through one helper per family (`workspaceTargets`, `migrationTargets`, `inspectTargets`, `buildAndTestTargets`, `nativeBuildTargets`, `startTargets`, `releaseTargets`, `updateTargets`, `databaseTargets`) instead of one 530-line builder. Every command, alias, option, default and `--help` line is unchanged, in the same order. `@akanjs/devkit/commandDecorators` now exports `CommandBuilderContext`, the type such a helper takes.
|
|
445
465
|
- 7aad7c1: `executors.ts` is split into one file per class under `executors/` and re-exports the same names, so every import of `@akanjs/devkit/executors` and the root barrel is unchanged. Each file under `executors/` also loads on its own: `akanConfig` and `scanInfo` import the `SysExecutor` subclasses when they use them, so no import order loads a subclass before its base.
|
|
466
|
+
- 34b9822: Internal: the dev builder process (`IncrementalBuilder`) runs its work lanes, the CSR and SSR dev registries, the file watcher and boot recovery through one collaborator each, in `builderLanes.ts`, `csrRegistry.ts`, `ssrRegistry.ts`, `builderWatch.ts`, `builderBoot.ts` and `builderBuildStatus.ts`, instead of one 90-member class. Behaviour is unchanged: the same messages are sent in the same order, and route builds, recycling at the memory ceiling and degraded-boot recovery work as before.
|
|
467
|
+
- 382a4c2: Internal: the workflow engine's source-editing helpers in `workflow/source.ts` are split by what they edit into `constantSource.ts`, `dictionarySource.ts`, `serviceSource.ts`, `signalSource.ts`, `templateSource.ts`, `testSource.ts`, `sourceImports.ts`, `fieldExpression.ts`, `fieldLabel.ts`, `fieldOrder.ts`, `modulePaths.ts`, `primitiveReport.ts` and `sourceText.ts`, with the shared AST lookups in `sourceAst.ts`. `workflow/source.ts` re-exports the same names, so `@akanjs/devkit/workflow` and every scaffold and `akan workflow` edit behave as before.
|
|
446
468
|
- 58f1c64: A route's client code no longer carries the UI of every module in the app and in each lib its store merges.
|
|
447
469
|
|
|
448
470
|
- **Bootstrap.** Each route's `"use client"` entry, every generated root layout and the SSR dev registry start with `import "@apps/<app>/lib/useClient"` and `import "@apps/<app>/lib/st"`, which load the client runtime and the store. They used to import `@apps/<app>/client` bare, and that bundled the whole barrel.
|
|
@@ -479,8 +501,8 @@
|
|
|
479
501
|
- A tool error carries `_meta["akanjs/failure"]: { code, statusCode }`, beside the server's own `_meta` for a 2026-07-28 client. The code is the one an HTTP caller gets:
|
|
480
502
|
- a domain `Err` by its dictionary key, such as `base.error.documentNotFound`;
|
|
481
503
|
- an `AkanError` by its code, such as `invalidArgument` for an argument the call got wrong;
|
|
482
|
-
- a 401 or 403 by its status alone (`unauthorized`, `forbidden`);
|
|
483
|
-
- a 5xx by
|
|
504
|
+
- a guard's 401 or 403 by its status alone (`unauthorized`, `forbidden`);
|
|
505
|
+
- a 5xx by the dictionary key or code token its HTTP answer carries, else by its status (`internalError`, `serviceUnavailable`). Its text is redacted but its code is not, and the code comes from the error's own JSON when that carries one, which can be a third-party library's.
|
|
484
506
|
- A JSON-RPC error carries `data.code`, which tells apart what `-32602` covers:
|
|
485
507
|
- `unknownTool`, `unknownPrompt` (an unlisted page prompt included) and `unknownResource`;
|
|
486
508
|
- `invalidArgument` for bad arguments or a missing tool name, prompt name or resource uri;
|
|
@@ -530,6 +552,7 @@
|
|
|
530
552
|
- Updated dependencies [b3f85fa]
|
|
531
553
|
- Updated dependencies [a707354]
|
|
532
554
|
- Updated dependencies [4d61170]
|
|
555
|
+
- Updated dependencies [1ef031b]
|
|
533
556
|
- Updated dependencies [c723713]
|
|
534
557
|
- Updated dependencies [0351ad4]
|
|
535
558
|
- Updated dependencies [ba417c6]
|
|
@@ -546,6 +569,7 @@
|
|
|
546
569
|
- Updated dependencies [ddd3d96]
|
|
547
570
|
- Updated dependencies [3f231a7]
|
|
548
571
|
- Updated dependencies [96f9ff6]
|
|
572
|
+
- Updated dependencies [0a81afa]
|
|
549
573
|
- Updated dependencies [af7c411]
|
|
550
574
|
- Updated dependencies [1ebc57a]
|
|
551
575
|
- Updated dependencies [c3b5b3c]
|
|
@@ -553,6 +577,7 @@
|
|
|
553
577
|
- Updated dependencies [6d5b544]
|
|
554
578
|
- Updated dependencies [73f8830]
|
|
555
579
|
- Updated dependencies [5691327]
|
|
580
|
+
- Updated dependencies [14134d3]
|
|
556
581
|
- Updated dependencies [958f175]
|
|
557
582
|
- Updated dependencies [9f30e93]
|
|
558
583
|
- Updated dependencies [ad09fac]
|
|
@@ -566,6 +591,7 @@
|
|
|
566
591
|
- Updated dependencies [e143263]
|
|
567
592
|
- Updated dependencies [e4f7876]
|
|
568
593
|
- Updated dependencies [cb0fd5b]
|
|
594
|
+
- Updated dependencies [f7be62b]
|
|
569
595
|
- Updated dependencies [24dcb1e]
|
|
570
596
|
- Updated dependencies [256b6e3]
|
|
571
597
|
- Updated dependencies [c48d780]
|
|
@@ -584,19 +610,22 @@
|
|
|
584
610
|
- Updated dependencies [b24fef3]
|
|
585
611
|
- Updated dependencies [465ccb9]
|
|
586
612
|
- Updated dependencies [513e48d]
|
|
613
|
+
- Updated dependencies [1a43215]
|
|
587
614
|
- Updated dependencies [5cd1fc3]
|
|
588
615
|
- Updated dependencies [f47cc82]
|
|
589
616
|
- Updated dependencies [cf5eeff]
|
|
617
|
+
- Updated dependencies [6b3b4e4]
|
|
590
618
|
- Updated dependencies [7f0de74]
|
|
591
|
-
- Updated dependencies [c0b84d0]
|
|
592
619
|
- Updated dependencies [1f93507]
|
|
593
620
|
- Updated dependencies [5d3cb3e]
|
|
621
|
+
- Updated dependencies [ad4571f]
|
|
594
622
|
- Updated dependencies [9a2a8c9]
|
|
595
623
|
- Updated dependencies [9a9e1fa]
|
|
596
624
|
- Updated dependencies [af133d7]
|
|
597
625
|
- Updated dependencies [463fd1e]
|
|
598
626
|
- Updated dependencies [f8de6a7]
|
|
599
627
|
- Updated dependencies [1ed9f6a]
|
|
628
|
+
- Updated dependencies [0c83204]
|
|
600
629
|
- Updated dependencies [b0ccf6f]
|
|
601
630
|
- Updated dependencies [7836476]
|
|
602
631
|
- Updated dependencies [9055634]
|
|
@@ -604,6 +633,7 @@
|
|
|
604
633
|
- Updated dependencies [a373d51]
|
|
605
634
|
- Updated dependencies [c723e7a]
|
|
606
635
|
- Updated dependencies [6c3a303]
|
|
636
|
+
- Updated dependencies [eadb12a]
|
|
607
637
|
- Updated dependencies [27440aa]
|
|
608
638
|
- Updated dependencies [bc5fdb0]
|
|
609
639
|
- Updated dependencies [e3de9ef]
|
|
@@ -614,10 +644,19 @@
|
|
|
614
644
|
- Updated dependencies [e3de9ef]
|
|
615
645
|
- Updated dependencies [e3de9ef]
|
|
616
646
|
- Updated dependencies [463fd1e]
|
|
647
|
+
- Updated dependencies [f923ffb]
|
|
648
|
+
- Updated dependencies [802bffe]
|
|
617
649
|
- Updated dependencies [99fda20]
|
|
618
650
|
- Updated dependencies [db5b284]
|
|
619
651
|
- Updated dependencies [5e08722]
|
|
620
652
|
- Updated dependencies [2bf769f]
|
|
653
|
+
- Updated dependencies [6d96075]
|
|
654
|
+
- Updated dependencies [a12577f]
|
|
655
|
+
- Updated dependencies [8e24168]
|
|
656
|
+
- Updated dependencies [48b8050]
|
|
657
|
+
- Updated dependencies [cf12100]
|
|
658
|
+
- Updated dependencies [966b5f2]
|
|
659
|
+
- Updated dependencies [2728800]
|
|
621
660
|
- Updated dependencies [91ccf38]
|
|
622
661
|
- Updated dependencies [c2af76a]
|
|
623
662
|
- Updated dependencies [df32c46]
|
|
@@ -635,6 +674,7 @@
|
|
|
635
674
|
- Updated dependencies [3b7247e]
|
|
636
675
|
- Updated dependencies [e4c3009]
|
|
637
676
|
- Updated dependencies [0d7294c]
|
|
677
|
+
- Updated dependencies [e323d6c]
|
|
638
678
|
- Updated dependencies [d9eaacc]
|
|
639
679
|
- akanjs@3.2.0
|
|
640
680
|
- @akanjs/language@3.2.0
|
package/DEV_RUNTIME_KNOBS.md
CHANGED
|
@@ -74,9 +74,10 @@ which is the one case where replacing it again cannot help; it says that too, an
|
|
|
74
74
|
| `AKAN_BUILDER_RPC_TIMEOUT_MS` | `120000` | How long the backend waits for a builder answer. Generous on purpose: a cold CSR build of every page legitimately takes tens of seconds. |
|
|
75
75
|
| `AKAN_SERVER_PAGES_SPLITTING` | off | Emit the server pages bundle as chunks instead of one file. Experimental — the memory/latency trade has not been measured on a real app. |
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
holds the SSR registry's boot build back,
|
|
79
|
-
|
|
77
|
+
Three more are read by the dev server for its end-to-end tests only; never set them. `AKAN_DEV_SSR_ARM_DELAY_MS`
|
|
78
|
+
holds the SSR registry's boot build back, `AKAN_CSR_DEV_APP_WRITE_DELAY_MS` holds a registry's `app.js` back
|
|
79
|
+
after a patch is announced, and `AKAN_DEV_BUILDER_READY_GATE` keeps a builder whose boot build succeeded from
|
|
80
|
+
reporting ready until the file it names exists.
|
|
80
81
|
|
|
81
82
|
## Observability
|
|
82
83
|
|
|
@@ -328,6 +328,22 @@ describe("a stop while the builder is starting", () => {
|
|
|
328
328
|
};
|
|
329
329
|
return builder;
|
|
330
330
|
};
|
|
331
|
+
// Not `.rejects`: on a start that never settles it waits out three ready timeouts instead of failing the test.
|
|
332
|
+
const settled = async (starting: Promise<unknown>) => {
|
|
333
|
+
let timer: Timer | undefined;
|
|
334
|
+
const pending = new Promise<string>((resolve) => {
|
|
335
|
+
timer = setTimeout(() => resolve("still starting"), 2_000);
|
|
336
|
+
});
|
|
337
|
+
const outcome = await Promise.race([
|
|
338
|
+
starting.then(
|
|
339
|
+
() => "started",
|
|
340
|
+
(error: unknown) => (error instanceof Error ? error.message : String(error)),
|
|
341
|
+
),
|
|
342
|
+
pending,
|
|
343
|
+
]);
|
|
344
|
+
clearTimeout(timer);
|
|
345
|
+
return outcome;
|
|
346
|
+
};
|
|
331
347
|
|
|
332
348
|
test("stops a builder created after the stop, and never starts it", async () => {
|
|
333
349
|
const { app } = track(await createTempApp("demo"));
|
|
@@ -345,7 +361,7 @@ describe("a stop while the builder is starting", () => {
|
|
|
345
361
|
await Bun.sleep(50);
|
|
346
362
|
await host.stop();
|
|
347
363
|
created.resolve(builder as unknown as IncrementalBuilderHost);
|
|
348
|
-
await
|
|
364
|
+
expect(await settled(starting)).toBe("dev server stopped before the builder started");
|
|
349
365
|
expect({ creates, started: builder.started, stopped: builder.stopped }).toEqual({
|
|
350
366
|
creates: 1,
|
|
351
367
|
started: 0,
|
|
@@ -374,7 +390,7 @@ describe("a stop while the builder is starting", () => {
|
|
|
374
390
|
await Bun.sleep(50);
|
|
375
391
|
expect(builder.started).toBe(1);
|
|
376
392
|
await host.stop();
|
|
377
|
-
await
|
|
393
|
+
expect(await settled(starting)).toBe("dev server stopped before the builder was ready");
|
|
378
394
|
exitLate?.();
|
|
379
395
|
await Bun.sleep(50);
|
|
380
396
|
expect({ creates, stopped: builder.stopped }).toEqual({ creates: 1, stopped: 1 });
|