@akanjs/cli 3.0.0-beta.25 → 3.0.0-beta.26

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/.build-stamp CHANGED
@@ -1 +1 @@
1
- ebb85e20e2ce0664a89d89b8a4118186e1277010b003f7c8a8222101af0c5263
1
+ 2c02e63aa5466798c5de1ca1a641b776ce09e613629d2e311bae25a91063f81a
package/README.ko.md ADDED
@@ -0,0 +1,72 @@
1
+ # @akanjs/cli
2
+
3
+ [문서](https://akanjs.com/docs) | [npm](https://www.npmjs.com/package/@akanjs/cli) | [런타임](https://www.npmjs.com/package/akanjs)
4
+
5
+ Akan.js 워크스페이스를 위한 command-line tooling입니다.
6
+
7
+ `@akanjs/cli`는 Akan 애플리케이션, 라이브러리, 프레임워크 패키지를 생성, 빌드, 테스트, 린트,
8
+ 릴리즈, 유지보수하는 데 사용하는 `akan` 실행 파일을 제공합니다. Bun-first CLI 패키지이며 Akan
9
+ 개발 tooling을 내부에 번들링하므로, 애플리케이션 런타임은 더 작은 `akanjs` 패키지에만 의존할 수
10
+ 있습니다.
11
+
12
+ ## 설치
13
+
14
+ 새 워크스페이스를 바로 만들 수 있습니다.
15
+
16
+ ```bash
17
+ bunx create-akan-workspace@latest
18
+ ```
19
+
20
+ 또는 CLI를 전역으로 설치할 수 있습니다.
21
+
22
+ ```bash
23
+ bun install -g @akanjs/cli@latest
24
+ akan --help
25
+ ```
26
+
27
+ ## 자주 쓰는 명령
28
+
29
+ ```bash
30
+ akan create-workspace <workspace-name>
31
+ akan start <app-name>
32
+ akan build <app-name>
33
+ akan test <app-or-lib-or-pkg>
34
+ akan lint <app-or-lib-or-pkg>
35
+ akan create-application <app-name>
36
+ akan create-library <lib-name>
37
+ akan create-module <module-name>
38
+ akan create-scalar <scalar-name>
39
+ ```
40
+
41
+ 패키지 유지보수 명령도 같은 실행 파일에서 제공합니다.
42
+
43
+ ```bash
44
+ akan build-package akanjs
45
+ akan build-package @akanjs/cli
46
+ akan build-package @akanjs/devkit
47
+ akan build-package create-akan-workspace
48
+ akan verify-akan-publish-packages
49
+ akan smoke-registry --test=true --tag=rc
50
+ ```
51
+
52
+ Akan framework 패키지는 반드시 `dist/pkgs/*` 산출물 기준으로 publish합니다. `verify-akan-publish-packages`는
53
+ 빌드된 패키지에 `npm pack --dry-run --json`을 실행하고, `deploy-akan` 또는 local registry smoke 전에 필요한
54
+ metadata를 검증합니다.
55
+ 저장소 릴리즈에서는 root `akan` bootstrap script가 CLI dist를 덮어쓰지 않도록
56
+ `bun run release:build-packages && bun run release:verify-packages`를 우선 사용합니다.
57
+
58
+ ## 패키지 경계
59
+
60
+ - 애플리케이션과 런타임 코드는 `akanjs`를 사용합니다.
61
+ - 사용자-facing 실행 패키지는 `@akanjs/cli`입니다.
62
+ - `@akanjs/devkit`은 published CLI 사용을 위해 CLI 안에 번들링됩니다. 일반 CLI 사용자가 별도의
63
+ runtime dependency로 설치할 필요는 없습니다.
64
+
65
+ ## 요구사항
66
+
67
+ - [Bun](https://bun.sh) `>=1.4.0`
68
+ - TypeScript 기반 Akan 워크스페이스
69
+
70
+ ## 라이선스
71
+
72
+ MIT
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @akanjs/cli
2
+
3
+ [Docs](https://akanjs.com/docs) | [npm](https://www.npmjs.com/package/@akanjs/cli) | [Runtime](https://www.npmjs.com/package/akanjs)
4
+
5
+ Command-line tooling for Akan.js workspaces.
6
+
7
+ `@akanjs/cli` provides the `akan` executable used to create, build, test, lint, release, and maintain Akan
8
+ applications, libraries, and framework packages. It is a Bun-first CLI package and bundles Akan development
9
+ tooling internally so application runtimes can depend on the smaller `akanjs` package.
10
+
11
+ ## Install
12
+
13
+ Create a new workspace:
14
+
15
+ ```bash
16
+ bunx create-akan-workspace@latest
17
+ ```
18
+
19
+ Or install the CLI globally:
20
+
21
+ ```bash
22
+ bun install -g @akanjs/cli@latest
23
+ akan --help
24
+ ```
25
+
26
+ ## Common Commands
27
+
28
+ ```bash
29
+ akan create-workspace <workspace-name>
30
+ akan start <app-name>
31
+ akan build <app-name>
32
+ akan test <app-or-lib-or-pkg>
33
+ akan lint <app-or-lib-or-pkg>
34
+ akan create-application <app-name>
35
+ akan create-library <lib-name>
36
+ akan create-module <module-name>
37
+ akan create-scalar <scalar-name>
38
+ ```
39
+
40
+ ## Agent And MCP Commands
41
+
42
+ ```bash
43
+ akan context --format markdown
44
+ akan context --format json --module <module-name>
45
+ akan doctor --format json
46
+ akan guideline list
47
+ akan guideline show framework
48
+ akan agent install cursor
49
+ akan mcp
50
+ ```
51
+
52
+ These commands expose Akan workspace structure, module abstracts, diagnostics, and guideline instructions for
53
+ coding agents. The MCP server is read-only and is intended to provide context rather than edit files directly.
54
+
55
+ Package maintenance commands are also exposed through the same executable:
56
+
57
+ ```bash
58
+ akan build-package akanjs
59
+ akan build-package @akanjs/cli
60
+ akan build-package @akanjs/devkit
61
+ akan build-package create-akan-workspace
62
+ akan verify-akan-publish-packages
63
+ akan smoke-registry --test=true --tag=rc
64
+ ```
65
+
66
+ Publish Akan framework packages from `dist/pkgs/*` only. `verify-akan-publish-packages` runs `npm pack --dry-run --json`
67
+ against the built packages and checks metadata that must be correct before `deploy-akan` or local registry smoke.
68
+ For repository releases, prefer `bun run release:build-packages && bun run release:verify-packages` so the CLI package
69
+ artifact is built last and is not overwritten by the root `akan` bootstrap script.
70
+
71
+ ## Package Boundary
72
+
73
+ - Use `akanjs` from application and runtime code.
74
+ - Use `@akanjs/cli` as the user-facing executable package.
75
+ - `@akanjs/devkit` is bundled into the CLI for published CLI usage; it is not required as a separate
76
+ runtime dependency for ordinary CLI users.
77
+ - The `akan code` agent follows that same split: its engine, tools and skills are a devkit facet
78
+ (`@akanjs/devkit/codeAgent`), and `@akanjs/cli/code` is the terminal host plus the SDK entry that
79
+ re-exports both.
80
+
81
+ ## Requirements
82
+
83
+ - [Bun](https://bun.sh) `>=1.4.0`
84
+ - A TypeScript Akan workspace
85
+
86
+ ## License
87
+
88
+ MIT
@@ -16,7 +16,7 @@ import"./index-48k96p55.js";
16
16
  import"./index-5mm3g24t.js";
17
17
  import {
18
18
  ApplicationScript
19
- } from "./index-pb10njz7.js";
19
+ } from "./index-cfj73ck1.js";
20
20
  import"./index-7md2g9vw.js";
21
21
  import"./index-860zjnr1.js";
22
22
 
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  Spinner
4
4
  } from "./index-0n9q1f23.js";
5
- import"./index-dt1x62ec.js";
5
+ import"./index-cd9qt2t6.js";
6
6
  import {
7
7
  AllRoutesBuilder,
8
8
  CsrArtifactBuilder,
9
9
  FontPruner,
10
10
  precompressArtifacts,
11
11
  SsrBaseArtifactBuilder
12
- } from "./index-4mgbzgb5.js";
12
+ } from "./index-wvebzf0y.js";
13
13
  import"./index-52w0fvh8.js";
14
14
  import"./index-n68jx79w.js";
15
15
 
@@ -14,14 +14,14 @@ import {
14
14
  PagesBundleBuilder,
15
15
  CsrDevBundler,
16
16
  SsrDevBundler
17
- } from "./index-dt1x62ec.js";
17
+ } from "./index-cd9qt2t6.js";
18
18
  import"./index-52w0fvh8.js";
19
19
  import {
20
20
  CsrArtifactBuilder,
21
21
  CssCompiler,
22
22
  FontOptimizer,
23
23
  SsrBaseArtifactBuilder
24
- } from "./index-4mgbzgb5.js";
24
+ } from "./index-wvebzf0y.js";
25
25
  import"./index-n68jx79w.js";
26
26
 
27
27
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -13,14 +13,14 @@ import {
13
13
  } from "./index-56xwsgyn.js";
14
14
  import"./index-48k96p55.js";
15
15
  import"./index-5mm3g24t.js";
16
- import"./index-pb10njz7.js";
16
+ import"./index-cfj73ck1.js";
17
17
  import"./index-ys6f0bvh.js";
18
18
  import"./index-7md2g9vw.js";
19
19
  import"./index-2ahj896a.js";
20
20
  import"./index-per2kqy9.js";
21
21
  import {
22
22
  CloudScript2
23
- } from "./index-8k93esfr.js";
23
+ } from "./index-mq74nzf8.js";
24
24
  import"./index-860zjnr1.js";
25
25
 
26
26
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript2
4
- } from "./index-8k93esfr.js";
4
+ } from "./index-mq74nzf8.js";
5
5
  import"./index-56xwsgyn.js";
6
6
  import"./index-per2kqy9.js";
7
- import"./index-pb10njz7.js";
7
+ import"./index-cfj73ck1.js";
8
8
  import"./index-860zjnr1.js";
9
9
  import"./index-5mm3g24t.js";
10
10
  import"./index-ys6f0bvh.js";
@@ -20,7 +20,7 @@ import {
20
20
  DevChangePlanner,
21
21
  DevGeneratedIndexSync,
22
22
  SsrDevBundler
23
- } from "./index-dt1x62ec.js";
23
+ } from "./index-cd9qt2t6.js";
24
24
  import {
25
25
  prepareDevWatchBatch
26
26
  } from "./index-a5vmm6x4.js";
@@ -3477,11 +3477,13 @@ class CsrDevModuleCompiler {
3477
3477
  static #factory(id, code) {
3478
3478
  const prefix = CsrDevPaths.modulePrefix;
3479
3479
  let patched = code.replaceAll(`import("${prefix}`, `__akanImport("${prefix}`).replace(/^\/\/# debugId=.*$/m, "");
3480
+ const marker = patched.search(/^\/\/ /m);
3481
+ const body = marker < 0 ? "" : patched.slice(marker);
3480
3482
  for (const [name, params, method] of CsrDevModuleCompiler.#helperPatches) {
3481
3483
  const definition = `var ${name} = ${params} => {`;
3482
3484
  if (patched.includes(definition))
3483
3485
  patched = patched.replace(definition, `var ${name} = __akan.${method}, __bun${name} = ${params} => {`);
3484
- else if (patched.includes(`${name}(`))
3486
+ else if (patched.includes(`${name}(`) && !new RegExp(`\\b(?:var|let|const|function)\\s+${name}\\b`).test(body))
3485
3487
  throw new Error(`[csr-dev] ${id}: Bun's ${name} helper no longer reads "${definition}"; CsrDevModuleCompiler must follow`);
3486
3488
  }
3487
3489
  if (CsrDevModuleCompiler.#storeRoot.test(id))
@@ -244,17 +244,29 @@ class IncrementalBuilderHost {
244
244
  #manualStop = false;
245
245
  #inFlight = new Map;
246
246
  #startOptions = {};
247
- constructor({ app, entry, env, stdio = "inherit", onMessage, onOutput }) {
247
+ constructor({
248
+ app,
249
+ entry,
250
+ env,
251
+ stdio = "inherit",
252
+ onMessage,
253
+ onOutput,
254
+ patcherOff = false
255
+ }) {
248
256
  this.app = app;
249
257
  this.entry = entry;
250
258
  this.env = env;
251
259
  this.#stdio = stdio;
252
260
  this.#onMessage = onMessage;
253
261
  this.#onOutput = onOutput ?? null;
262
+ this.#patcherOff = patcherOff;
254
263
  }
255
264
  get status() {
256
265
  return this.#status;
257
266
  }
267
+ get patcherOff() {
268
+ return this.#patcherOff;
269
+ }
258
270
  get pid() {
259
271
  return this.#proc?.pid ?? null;
260
272
  }
@@ -452,7 +464,8 @@ class IncrementalBuilderHost {
452
464
  }
453
465
  static async create(app, env, onMessage, {
454
466
  stdio = "inherit",
455
- onOutput
467
+ onOutput,
468
+ patcherOff = false
456
469
  } = {}) {
457
470
  const candidates = [
458
471
  path.join(app.workspace.workspaceRoot, "pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts"),
@@ -462,7 +475,7 @@ class IncrementalBuilderHost {
462
475
  ];
463
476
  for (const c of candidates)
464
477
  if (await Bun.file(c).exists())
465
- return new IncrementalBuilderHost({ app, entry: c, env, stdio, onMessage, onOutput });
478
+ return new IncrementalBuilderHost({ app, entry: c, env, stdio, onMessage, onOutput, patcherOff });
466
479
  throw new Error(`[cli] frontend builder entry not found; looked in: ${candidates.join(", ")}`);
467
480
  }
468
481
  }
@@ -703,6 +716,7 @@ class AkanAppHost {
703
716
  #bootLatch = new DevBootLatch(() => this.#onDevEvent?.({ app: this.app.name, booted: true }));
704
717
  #backend = null;
705
718
  #builder = null;
719
+ #patcherOff = false;
706
720
  #backendReady = false;
707
721
  #plannedBackendStops = new WeakSet;
708
722
  #restartTimer = null;
@@ -1600,6 +1614,7 @@ ${this.#backendStderrTail.join(`
1600
1614
  this.#pendingBuildStatusReplay = [];
1601
1615
  await this.#stopBackend();
1602
1616
  this.#stopBuilder();
1617
+ this.#patcherOff = false;
1603
1618
  if (refreshConfig) {
1604
1619
  await this.app.getConfig({ refresh: true });
1605
1620
  const { env } = await this.app.prepareCommand("start");
@@ -1715,7 +1730,8 @@ ${this.#backendStderrTail.join(`
1715
1730
  this.#enqueueBuilderMessage(msg);
1716
1731
  }, {
1717
1732
  stdio: this.stdio,
1718
- onOutput: (kind, text) => void (kind === "stderr" ? process.stderr : process.stdout).write(text)
1733
+ onOutput: (kind, text) => void (kind === "stderr" ? process.stderr : process.stdout).write(text),
1734
+ patcherOff: this.#patcherOff
1719
1735
  });
1720
1736
  try {
1721
1737
  await this.#waitForBuilderReady(attempt, { announceBootState });
@@ -1801,6 +1817,8 @@ ${this.#backendStderrTail.join(`
1801
1817
  this.#cancelRssRecycle();
1802
1818
  if (!this.#builder)
1803
1819
  return;
1820
+ if (this.#builder.patcherOff)
1821
+ this.#patcherOff = true;
1804
1822
  this.#builder.stop();
1805
1823
  this.#builder = null;
1806
1824
  }
@@ -1828,7 +1846,7 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
1828
1846
 
1829
1847
  // pkgs/@akanjs/cli/application/application.runner.ts
1830
1848
  import { Logger as Logger3 } from "akanjs/common";
1831
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-tm0vba5t.js")).ApplicationBuildRunner;
1849
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-412y0345.js")).ApplicationBuildRunner;
1832
1850
  var loadPrompts = async () => await import("@inquirer/prompts");
1833
1851
 
1834
1852
  class ApplicationRunner extends runner("application") {
@@ -11,7 +11,7 @@ import {
11
11
  } from "./index-0n9q1f23.js";
12
12
  import {
13
13
  ApplicationScript
14
- } from "./index-pb10njz7.js";
14
+ } from "./index-cfj73ck1.js";
15
15
  import {
16
16
  PackageScript
17
17
  } from "./index-per2kqy9.js";
@@ -16,7 +16,7 @@ import {
16
16
  CsrEntryFiles,
17
17
  PagesEntrySourceGenerator,
18
18
  PagesBundleBuilder
19
- } from "./index-dt1x62ec.js";
19
+ } from "./index-cd9qt2t6.js";
20
20
  import {
21
21
  SOURCE_EXTS
22
22
  } from "./index-48k96p55.js";
package/index.js CHANGED
@@ -13,18 +13,18 @@ import path from "path";
13
13
 
14
14
  // pkgs/@akanjs/cli/commandModules.ts
15
15
  var commandModules = {
16
- workspace: async () => (await import("./workspace.command-p44d21qf.js")).WorkspaceCommand,
16
+ workspace: async () => (await import("./workspace.command-d8he10tv.js")).WorkspaceCommand,
17
17
  agent: async () => (await import("./agent.command-rp505zxa.js")).AgentCommand,
18
18
  code: async () => (await import("./code.command-jhrjttm1.js")).CodeCommand,
19
- application: async () => (await import("./application.command-2x9jqy0k.js")).ApplicationCommand,
19
+ application: async () => (await import("./application.command-afajz1m5.js")).ApplicationCommand,
20
20
  library: async () => (await import("./library.command-sv6g1h2g.js")).LibraryCommand,
21
- localRegistry: async () => (await import("./localRegistry.command-4kj56531.js")).LocalRegistryCommand,
21
+ localRegistry: async () => (await import("./localRegistry.command-fm41vdtw.js")).LocalRegistryCommand,
22
22
  package: async () => (await import("./package.command-xmw605b1.js")).PackageCommand,
23
23
  module: async () => (await import("./module.command-ccdeder9.js")).ModuleCommand,
24
24
  page: async () => (await import("./page.command-ky7vafsn.js")).PageCommand,
25
25
  context: async () => (await import("./context.command-xncdvv7n.js")).ContextCommand,
26
- cloud: async () => (await import("./cloud.command-j6m607bp.js")).CloudCommand,
27
- subspace: async () => (await import("./subspace.command-ygfdqpbj.js")).SubspaceCommand,
26
+ cloud: async () => (await import("./cloud.command-yz0h8a2e.js")).CloudCommand,
27
+ subspace: async () => (await import("./subspace.command-y1p56wyv.js")).SubspaceCommand,
28
28
  guideline: async () => (await import("./guideline.command-d5qmxx29.js")).GuidelineCommand,
29
29
  scalar: async () => (await import("./scalar.command-t09gmck8.js")).ScalarCommand,
30
30
  primitive: async () => (await import("./primitive.command-bh6j8nfs.js")).PrimitiveCommand,
@@ -13,7 +13,7 @@ import"./index-48k96p55.js";
13
13
  import"./index-5mm3g24t.js";
14
14
  import {
15
15
  ApplicationScript
16
- } from "./index-pb10njz7.js";
16
+ } from "./index-cfj73ck1.js";
17
17
  import"./index-ys6f0bvh.js";
18
18
  import"./index-7md2g9vw.js";
19
19
  import"./index-94s080qm.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.0.0-beta.25",
3
+ "version": "3.0.0-beta.26",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "0.86.1",
40
40
  "@inquirer/prompts": "^8.4.3",
41
41
  "@tailwindcss/node": "^4.3.0",
42
- "akanjs": "3.0.0-beta.25",
42
+ "akanjs": "3.0.0-beta.26",
43
43
  "chalk": "^5.6.2",
44
44
  "commander": "^14.0.3",
45
45
  "dayjs": "^1.11.20",
@@ -62,4 +62,4 @@
62
62
  "bun": {
63
63
  "platform": "bun"
64
64
  }
65
- }
65
+ }
@@ -716,7 +716,7 @@ class SubspaceRunner extends runner("subspace") {
716
716
  if (!asked)
717
717
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
718
718
  const { libs } = await subspace.slice();
719
- const { CloudScript } = await import("./cloud.script-r5t7nhee.js");
719
+ const { CloudScript } = await import("./cloud.script-zez2b8am.js");
720
720
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
721
721
  host,
722
722
  workspaceId,
@@ -44,7 +44,7 @@ import {
44
44
  } from "./index-5mm3g24t.js";
45
45
  import {
46
46
  ApplicationScript
47
- } from "./index-pb10njz7.js";
47
+ } from "./index-cfj73ck1.js";
48
48
  import"./index-ys6f0bvh.js";
49
49
  import"./index-7md2g9vw.js";
50
50
  import"./index-2ahj896a.js";
@@ -57,7 +57,7 @@ import {
57
57
  } from "./index-56xwsgyn.js";
58
58
  import {
59
59
  CloudScript2
60
- } from "./index-8k93esfr.js";
60
+ } from "./index-mq74nzf8.js";
61
61
  import"./index-7yxndzea.js";
62
62
  import"./index-t02g6dpn.js";
63
63
  import"./index-v4hnkqz9.js";