@akanjs/devkit 3.3.0-rc.41 → 3.3.0-rc.42
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
|
@@ -211,6 +211,14 @@
|
|
|
211
211
|
An app built with the akan-native CLI's own config grants the same in its capabilities: `{ identifier: "external-view:default", allow: [{ origin: "https://board.example" }] }`, `"external-view:allow-evaluate"` and `"external-view:allow-sendKey"`. A grant of `external-view:all` or `external-view:allow-open` opens no origin unless its own `allow` lists them. A page that passed `window` to `open` passes its own window or leaves it out.
|
|
212
212
|
|
|
213
213
|
- 1712cf0: The image carries `bin`. `akan build` fetches each `bin` entry's `linux-x64` and `linux-arm64` file into the build's `bin/amd64/` and `bin/arm64/`, and the generated Dockerfile puts the folder its `TARGETARCH` names first on PATH, so an executable the server spawns is declared once for the image and the desktop app. An entry with no Linux file is still left to `docker.preRuns`; one that has both now runs the carried file, which is ahead on PATH. An app that writes its own Dockerfile adds `ENV PATH=/workspace/bin/$TARGETARCH:$PATH` itself, and the build says so. `akan start` warns when a declared executable is not on the computer's PATH. The byte budget of the `akan-runtime` skill's `runtimeRule-3.md` is raised on purpose for the new text.
|
|
214
|
+
- 612f146: The generated image starts the server under an init, and the runtime guide covers a device on a LAN.
|
|
215
|
+
|
|
216
|
+
The Dockerfile `akan build` writes now installs `tini` and ends in `ENTRYPOINT ["tini","-s","--"]` before its `CMD`. With `bun` as PID 1, a process whose parent died first (the `ffmpeg` of a killed `sh -c '… | ffmpeg'`) was re-parented to it and stayed `<defunct>` for the life of the container, because Bun never waits for a child it did not start. tini reaps them, passes signals on to the server and exits with its code; `-s` keeps that working under `docker run --init` or a shared process namespace. `docker.command` is still the `CMD`, and `docker run <image> bun main.js ops …` runs as before. An app whose `docker` is a whole Dockerfile is not changed and adds an init itself.
|
|
217
|
+
|
|
218
|
+
The runtime guide gains two things. The image section says a device node needs its group as well as `--device` (`--group-add` with the host's numeric gid, or `supplementalGroups` in a pod), since the server is uid 1000 with no other group. A new section, "An Image On A Device", is the recipe for a board reached by IP with no domain: build `--env main` rather than `local`, what the serve domain is for when nothing resolves it, `AKAN_PUBLIC_OPERATION_MODE=edge`, the secrets to hand over, the two directories to put on volumes (`/workspace/sqlite`, `/workspace/local`), and that a browser session needs HTTPS outside operation mode `local`.
|
|
219
|
+
|
|
220
|
+
The guide's `runtimeRule-2.md` reference is 3987 bytes larger, and its budget is raised to match.
|
|
221
|
+
|
|
214
222
|
- 8d75f2b: The public surface 3.2.0 deprecated is removed. `akanjs` and `@akanjs/devkit` publish only the subpaths their `exports` name, with no wildcard, so a file becomes public only when an entry names it.
|
|
215
223
|
|
|
216
224
|
- **`@akanjs/devkit` has no root aliases and no `./*` or `./*.ts`.** It publishes `@akanjs/devkit` (types only), `biome.base.json`, the facets `akanApp`, `akanConfig`, `artifact`, `cloud`, `codeAgent`, `commandDecorators`, `executors`, `frontendBuild`, `incrementalBuilder`, `mobile`, `pipeline`, `preview`, `transforms` and `workflow`, and the files `app/applicationBuildRunner`, `cloud/cloudApi`, `cloud/cloudUpdates`, `commandDecorators/exitCodeError`, `mobile/desktopRelease`, `mobile/serverBundleSecrets` and `transforms/serverEnvProfile`. `util/fileEditor`, `util/selectModel` and `workspace/getRelatedCnsts` are named too, and deprecated: nothing in akanjs uses them.
|
|
@@ -260,7 +260,7 @@ describe("AkanAppConfig", () => {
|
|
|
260
260
|
.map(([key, value]) => `ENV ${key}=${value}`)
|
|
261
261
|
.join("\n");
|
|
262
262
|
expect(config.dockerfile).toContain(
|
|
263
|
-
`COPY . .\n${writeDirsStep}\n${envBlock}\nUSER 1000:1000\nCMD ["bun","main.js"]`,
|
|
263
|
+
`COPY . .\n${writeDirsStep}\n${envBlock}\nUSER 1000:1000\nENTRYPOINT ["tini","-s","--"]\nCMD ["bun","main.js"]`,
|
|
264
264
|
);
|
|
265
265
|
});
|
|
266
266
|
|
|
@@ -276,10 +276,10 @@ describe("AkanAppConfig", () => {
|
|
|
276
276
|
});
|
|
277
277
|
|
|
278
278
|
test("writes the Dockerfile instructions it wrote before its env came from getProductionEnv", () => {
|
|
279
|
-
//? 9adfb95c's output for this config, less the blank lines its empty interpolations left, its floating tag and root.
|
|
279
|
+
//? 9adfb95c's output for this config, less the blank lines its empty interpolations left, its floating tag and root, plus the init.
|
|
280
280
|
const before = [
|
|
281
281
|
`FROM ${DEFAULT_DOCKER_IMAGE}`,
|
|
282
|
-
"RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata && rm -rf /var/lib/apt/lists/*",
|
|
282
|
+
"RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata tini && rm -rf /var/lib/apt/lists/*",
|
|
283
283
|
"RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime",
|
|
284
284
|
"ARG TARGETARCH",
|
|
285
285
|
"",
|
|
@@ -305,6 +305,7 @@ describe("AkanAppConfig", () => {
|
|
|
305
305
|
"ENV AKAN_LOG_TO_FILE=0",
|
|
306
306
|
"",
|
|
307
307
|
"USER 1000:1000",
|
|
308
|
+
'ENTRYPOINT ["tini","-s","--"]',
|
|
308
309
|
'CMD ["bun","main.js"]',
|
|
309
310
|
];
|
|
310
311
|
const lines = (text: string) => text.split("\n").filter((line) => line !== "");
|
|
@@ -318,11 +319,11 @@ describe("AkanAppConfig", () => {
|
|
|
318
319
|
).toThrow("the native apps ship that bundle");
|
|
319
320
|
});
|
|
320
321
|
|
|
321
|
-
test("installs only ca-certificates and
|
|
322
|
+
test("installs only ca-certificates, tzdata and the init in the default image", () => {
|
|
322
323
|
const config = new AkanAppConfig(app, [], packageJson, {}, baseDevEnv);
|
|
323
324
|
|
|
324
325
|
expect(config.dockerfile).toContain(
|
|
325
|
-
"RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata && rm -rf /var/lib/apt/lists/*",
|
|
326
|
+
"RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata tini && rm -rf /var/lib/apt/lists/*",
|
|
326
327
|
);
|
|
327
328
|
// The Chromium/ffmpeg toolchain moved to per-app `preRuns`; keeping it here paid for it in every image.
|
|
328
329
|
for (const dropped of ["libnss3", "ffmpeg", "build-essential", "redis", "xdg-utils"])
|
|
@@ -348,7 +349,7 @@ describe("AkanAppConfig", () => {
|
|
|
348
349
|
const userAt = instructions.indexOf("USER 1000:1000");
|
|
349
350
|
|
|
350
351
|
expect(instructions.filter((line) => line.startsWith("USER "))).toEqual(["USER 1000:1000"]);
|
|
351
|
-
expect(instructions.slice(userAt + 1)).toEqual(['CMD ["bun","main.js"]']);
|
|
352
|
+
expect(instructions.slice(userAt + 1)).toEqual(['ENTRYPOINT ["tini","-s","--"]', 'CMD ["bun","main.js"]']);
|
|
352
353
|
for (const rootStep of ["apt-get update", "apt-get install -y ffmpeg", "bun install", "echo after"])
|
|
353
354
|
expect(instructions.findIndex((line) => line.includes(rootStep))).toBeLessThan(userAt);
|
|
354
355
|
expect(instructions.filter((line) => line.includes("--chown"))).toEqual([]);
|
package/akanConfig/akanConfig.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { AkanWorkers } from "./akanWorkers";
|
|
|
13
13
|
import { DesktopServerConfig } from "./desktopServerConfig";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_DOCKER_IMAGE,
|
|
16
|
+
DOCKER_INIT,
|
|
16
17
|
DOCKER_RUN_USER,
|
|
17
18
|
DOCKER_WRITE_DIRS,
|
|
18
19
|
dockerImageScript,
|
|
@@ -503,7 +504,7 @@ export class AkanAppConfig implements AppConfigResult {
|
|
|
503
504
|
const isLocal = (environment ?? this.baseDevEnv.env) === "local";
|
|
504
505
|
const envLines = Object.entries(env).map(([key, value]) => `ENV ${key}=${value}`);
|
|
505
506
|
return `${imageScript}${isLocal ? `\n${AkanAppConfig.localImageGuard}` : ""}
|
|
506
|
-
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata && rm -rf /var/lib/apt/lists/*
|
|
507
|
+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata tini && rm -rf /var/lib/apt/lists/*
|
|
507
508
|
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
|
508
509
|
ARG TARGETARCH
|
|
509
510
|
${preRunScripts.join("\n")}
|
|
@@ -515,7 +516,8 @@ COPY . .
|
|
|
515
516
|
RUN mkdir -p ${DOCKER_WRITE_DIRS.join(" ")} && chown ${DOCKER_RUN_USER} ${DOCKER_WRITE_DIRS.join(" ")}
|
|
516
517
|
${envLines.join("\n")}
|
|
517
518
|
USER ${DOCKER_RUN_USER}
|
|
518
|
-
|
|
519
|
+
ENTRYPOINT ${JSON.stringify(DOCKER_INIT)}
|
|
520
|
+
CMD ${JSON.stringify(command)}`;
|
|
519
521
|
}
|
|
520
522
|
static #importGeneration = 0;
|
|
521
523
|
// Bun caches dynamic imports by path; a fresh query string re-evaluates the config module (its imports stay cached).
|
|
@@ -9,6 +9,8 @@ export const BUN_IMAGE_PIN = {
|
|
|
9
9
|
export const DEFAULT_DOCKER_IMAGE = `oven/bun:${BUN_IMAGE_PIN.version}-slim@${BUN_IMAGE_PIN.digest}`;
|
|
10
10
|
//? oven/bun's `bun` user, numeric so a kubelet can check `runAsNonRoot` without reading the image's passwd file.
|
|
11
11
|
export const DOCKER_RUN_USER = "1000:1000";
|
|
12
|
+
//? Bun as PID 1 never waits for a process re-parented to it, which stays defunct; `-s` reaps under another init too.
|
|
13
|
+
export const DOCKER_INIT = ["tini", "-s", "--"];
|
|
12
14
|
//? The directories the server writes, its code staying read-only; an empty named volume mounted on one takes its owner.
|
|
13
15
|
export const DOCKER_WRITE_DIRS = [
|
|
14
16
|
"/workspace/sqlite",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "3.3.0-rc.
|
|
3
|
+
"version": "3.3.0-rc.42",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"./workspace/getRelatedCnsts": "./workspace/getRelatedCnsts.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@akanjs/language": "3.3.0-rc.
|
|
53
|
+
"@akanjs/language": "3.3.0-rc.42",
|
|
54
54
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
55
55
|
"@earendil-works/pi-ai": "1.5.2",
|
|
56
56
|
"@earendil-works/pi-codemode": "1.5.2",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@earendil-works/pi-tui": "1.5.2",
|
|
60
60
|
"@inquirer/prompts": "^8.7.3",
|
|
61
61
|
"@tailwindcss/node": "^4.3.3",
|
|
62
|
-
"akanjs": "3.3.0-rc.
|
|
62
|
+
"akanjs": "3.3.0-rc.42",
|
|
63
63
|
"chalk": "^6.0.1",
|
|
64
64
|
"commander": "^15.0.0",
|
|
65
65
|
"dayjs": "^1.11.23",
|