@akanjs/cli 3.0.0-alpha.87 → 3.0.0-alpha.89
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 +1 -1
- package/{abstractCompactor-pwc6d6yk.js → abstractCompactor-cefxzggj.js} +2 -2
- package/{agent.command-180hh0ye.js → agent.command-r93wmq7m.js} +6 -6
- package/{application.command-v8dywdqh.js → application.command-5nqfqgdn.js} +9 -8
- package/{applicationBuildRunner-27wyznpv.js → applicationBuildRunner-b21m07fs.js} +4 -3
- package/{applicationReleasePackager-ktjt0erc.js → applicationReleasePackager-3wh58n2m.js} +2 -2
- package/buildBatch.proc.js +4 -4
- package/{capacitorApp-kwa67kzs.js → capacitorApp-gzcx6txb.js} +3 -3
- package/{cloud.command-12k4wy4x.js → cloud.command-g0pk0k60.js} +11 -11
- package/{context.command-dk2m2sjx.js → context.command-qd8kqrnh.js} +14 -14
- package/{dependencyScanner-c64m6fxp.js → dependencyScanner-shs82ynp.js} +2 -2
- package/devTui-2xf0meaq.js +552 -0
- package/devTuiView-7jy8f30g.js +9 -0
- package/{guideline.command-w6ddv13r.js → guideline.command-f38x8jhw.js} +4 -4
- package/guidelines/agentRule/agentRule.instruction.md +9 -1
- package/guidelines/conventions/conventions.instruction.md +30 -0
- package/guidelines/modelStore/modelStore.instruction.md +12 -0
- package/guidelines/modelTemplate/modelTemplate.instruction.md +5 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +37 -0
- package/incrementalBuilder.proc.js +8 -5
- package/{index-5y7qba1c.js → index-0emb9eat.js} +3 -3
- package/{index-cd5x18qh.js → index-3vvbv974.js} +4 -4
- package/{index-v0s24t8j.js → index-5xdqxbn9.js} +3 -3
- package/{index-k86zc21w.js → index-9bwhxrqf.js} +6 -6
- package/{index-ft1sfjz0.js → index-cezy7yb3.js} +66 -7
- package/{index-a6c5pc4p.js → index-d61rcfa2.js} +614 -62
- package/{index-gz0c482j.js → index-deekbtkj.js} +6 -6
- package/{index-saheq2bs.js → index-e82dyeqy.js} +1 -1
- package/{index-j9vnq8tr.js → index-h759vjfa.js} +3 -3
- package/{index-z3c9mmw4.js → index-jydtyzva.js} +2 -2
- package/{index-mfm35dhh.js → index-kcxmv48c.js} +1 -1
- package/{index-6c3ex9qw.js → index-kfnr6c19.js} +4 -4
- package/{index-1kzsn94d.js → index-mpmyqm1y.js} +1 -1
- package/{index-wet2ytnr.js → index-n85fer99.js} +2 -2
- package/{index-b2nt0w0k.js → index-pgsswppj.js} +1 -1
- package/{index-m9c7k0gm.js → index-pvb4vdwr.js} +1 -1
- package/{index-ayy5ecax.js → index-q0y2jq9j.js} +13 -1
- package/{index-k1n0h7dk.js → index-q8sn827n.js} +254 -126
- package/{index-dq6wq1tv.js → index-r50qen0z.js} +10 -10
- package/{index-5n0hf8r9.js → index-rntcdss1.js} +3 -3
- package/{index-a8h184wr.js → index-sjak5v5b.js} +6 -6
- package/{index-x23688ar.js → index-w8kmx1b6.js} +8 -4
- package/{index-qcracvc9.js → index-y74k5anj.js} +3 -3
- package/{index-xxe90kqy.js → index-zkvpaggp.js} +2 -2
- package/index.js +20 -20
- package/{library.command-wpedct6c.js → library.command-em103wtn.js} +4 -4
- package/{localRegistry.command-3cew8f75.js → localRegistry.command-gz8apn4y.js} +10 -10
- package/{module.command-8n4kct3e.js → module.command-451pztkc.js} +7 -7
- package/{package.command-fcbd0b1d.js → package.command-rfhyf38t.js} +5 -5
- package/package.json +2 -2
- package/{page.command-x4379grq.js → page.command-kt19da5g.js} +4 -4
- package/{primitive.command-8etmnqhq.js → primitive.command-pgy69ere.js} +8 -8
- package/{quality.command-hfx7z8yr.js → quality.command-gpe2vqb5.js} +3 -3
- package/{repair.command-j0fs5qkz.js → repair.command-2sbrz187.js} +6 -6
- package/{scalar.command-2emk89eh.js → scalar.command-jcf4e5sv.js} +6 -6
- package/{subspace.command-nr32nm35.js → subspace.command-kqzqtk0p.js} +6 -6
- package/{workflow.command-cvpmzwjg.js → workflow.command-m4z25a2p.js} +11 -11
- package/{workspace.command-rqnms515.js → workspace.command-dqgj9zbk.js} +22 -22
|
@@ -17,6 +17,11 @@ Generate form and interaction fragments bound to store form state and generated
|
|
|
17
17
|
- Do not call service or signal directly from inputs.
|
|
18
18
|
- Do not duplicate validation that belongs in constants or service invariants.
|
|
19
19
|
- Do not build page layout here when Zone should compose it.
|
|
20
|
+
- Do not persist typed values yourself. The edit shells (`Load.Edit`, `Model.EditModal`, `Model.New`) save the
|
|
21
|
+
whole `<model>Form` and recover it on the next open; a Template that reaches for `localStorage` or a per-field
|
|
22
|
+
cache saves a fragment of a form and restores it over whatever the server just returned.
|
|
23
|
+
- The `Field.*` `cache` prop and the `Input` `cacheKey` prop are deprecated and store nothing. Turn recovery off
|
|
24
|
+
with `draft={false}` on the shell, or name a scope with `draft="<scope>"`; do not reintroduce a field-level one.
|
|
20
25
|
|
|
21
26
|
## Review Checklist
|
|
22
27
|
- The instruction points to current docs pages, not removed docs routes.
|
|
@@ -42,6 +42,43 @@ const config: AppConfig = { web: false }; // api only
|
|
|
42
42
|
reached for any of them. An app that needs one declares it in `docker.preRuns` / `docker.postRuns`, which are
|
|
43
43
|
emitted around the `bun install` — that is the migration for a `puppeteer` or `ffmpeg` app.
|
|
44
44
|
|
|
45
|
+
## Route Prefixes — Where The API Is Mounted
|
|
46
|
+
|
|
47
|
+
Signal endpoints hang off `/api` and the websocket upgrade off `/api/ws`. Both move, and both have to move in
|
|
48
|
+
three places at once: the route table the replica builds, the gateway's own upgrade check, and the `fetchClient`
|
|
49
|
+
in every browser tab. That last one is the constraint the design is built around.
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
// apps/<app>/main.ts — the deployment's answer
|
|
53
|
+
await new AkanApp({ prefix: "/backend", websocketPrefix: "/socket" }).start();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// apps/<app>/akan.config.ts — the build's answer, for the bundles a server never gets to correct
|
|
58
|
+
const config: AppConfig = { api: { prefix: "/backend", websocketPrefix: "/socket" } };
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- **Three sources, narrowest first.** `globalThis.__AKAN_PREFIX__`, then `AKAN_API_PREFIX` / `AKAN_WS_PREFIX`,
|
|
62
|
+
then `AKAN_PUBLIC_API_PREFIX` / `AKAN_PUBLIC_WS_PREFIX`, then `/api` and `/ws`. Read them through
|
|
63
|
+
`getApiPrefix()` / `getWsPrefix()` from `akanjs/base`; never write either literal again.
|
|
64
|
+
- **`AKAN_API_PREFIX` is deliberately outside the `AKAN_PUBLIC_*` namespace.** Only that namespace is inlined
|
|
65
|
+
into client bundles at build time, so a name inside it could never act as a runtime override — and only a name
|
|
66
|
+
inside it can reach a prebuilt bundle at all. The two jobs need two names.
|
|
67
|
+
- **`new AkanApp({ prefix })` reaches the browser through the page, not through a prop.** `FetchClient` fixes its
|
|
68
|
+
origin when the module graph initializes, before any component renders, so a React prop — a `System.Provider`
|
|
69
|
+
value, anything out of `implicitRootLayout` — is always too late. The value rides the SSR classic bootstrap
|
|
70
|
+
script instead, the one thing guaranteed to run ahead of every module script, and is omitted when it matches
|
|
71
|
+
what the bundle already assumes. `akan.config.ts` is what a Capacitor bundle or a statically served CSR shell
|
|
72
|
+
follows, because neither is rendered by a server that could tell it otherwise.
|
|
73
|
+
- **A prefix is a path segment.** A blank value or a bare `/` is refused: `/` would be mounted ahead of the SSR
|
|
74
|
+
catch-all and swallow every page route. A prefix whose first segment is a declared basePath is refused at
|
|
75
|
+
`init()` for the same reason in the other direction.
|
|
76
|
+
- **The prefix is fixed before `init()`.** `setPrefix` / `setWebsocketPrefix` throw once the server has started,
|
|
77
|
+
because `init()` is where the route table and the devtools routes are built.
|
|
78
|
+
- `robots.txt`, the locale redirect's API bypass and the OpenAPI `servers` URL all derive from it. The blob
|
|
79
|
+
storage default (`/api/localFile/getBlob`) does **not**: those URLs are stored in rows, so moving the prefix
|
|
80
|
+
does not move what was already written.
|
|
81
|
+
|
|
45
82
|
## The Process Model — Gateway And Solo
|
|
46
83
|
|
|
47
84
|
A container runs one process per replica, a gateway in front of them when there is more than one, and one RSC
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
CodegenLock,
|
|
3
4
|
WorkspaceExecutor,
|
|
4
5
|
AppExecutor
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
6
|
+
} from "./index-q8sn827n.js";
|
|
7
|
+
import"./index-q0y2jq9j.js";
|
|
7
8
|
import"./index-6wwzs1bc.js";
|
|
8
9
|
import {
|
|
9
10
|
GraphClientEntryDiscovery,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
AutoImportSync,
|
|
12
13
|
DevChangePlanner,
|
|
13
14
|
DevGeneratedIndexSync
|
|
14
|
-
} from "./index-
|
|
15
|
+
} from "./index-w8kmx1b6.js";
|
|
15
16
|
import {
|
|
16
17
|
HmrWatcher,
|
|
17
18
|
WatchRootResolver
|
|
@@ -352,12 +353,14 @@ class IncrementalBuilder {
|
|
|
352
353
|
if (rawKinds.size === 0)
|
|
353
354
|
return;
|
|
354
355
|
const generation = ++this.#generation;
|
|
355
|
-
const autoImport = await this.#
|
|
356
|
+
const [autoImport, indexSync] = await CodegenLock.run(this.#app.workspace.workspaceRoot, `hmr-batch:${this.#app.name}`, async () => {
|
|
357
|
+
const auto = await this.#autoImportSync.syncForBatch(batch.files);
|
|
358
|
+
return [auto, await this.#generatedIndexSync.syncForBatch(batch.files)];
|
|
359
|
+
});
|
|
356
360
|
for (const error of autoImport.errors)
|
|
357
361
|
this.#logger.error(error);
|
|
358
362
|
if (autoImport.changedFiles.length > 0)
|
|
359
363
|
this.#logger.verbose(`[auto-import] inserted imports into ${autoImport.changedFiles.length} file(s)`);
|
|
360
|
-
const indexSync = await this.#generatedIndexSync.syncForBatch(batch.files);
|
|
361
364
|
await this.#watcher?.absorb([...autoImport.changedFiles, ...indexSync.changedFiles]);
|
|
362
365
|
const { files, kinds, expandedBatch, devPlan, event, hasSyncErrors } = prepareDevWatchBatch({
|
|
363
366
|
generation,
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
isScannedRootEntry,
|
|
8
8
|
AppExecutor,
|
|
9
9
|
LibExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-q8sn827n.js";
|
|
11
11
|
import {
|
|
12
12
|
FileSys
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-q0y2jq9j.js";
|
|
14
14
|
import {
|
|
15
15
|
collectRecipeSources2,
|
|
16
16
|
scanRecipes2,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
workflowRunArtifactPath,
|
|
21
21
|
workflowSyncDir
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-e82dyeqy.js";
|
|
23
23
|
|
|
24
24
|
// pkgs/@akanjs/devkit/akanContext.ts
|
|
25
25
|
import { readdir } from "fs/promises";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-cezy7yb3.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
8
8
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-q8sn827n.js";
|
|
10
10
|
import {
|
|
11
11
|
compactDiagnostics,
|
|
12
12
|
createPrimitiveWriteReport,
|
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
hasSignalFactoryEntry,
|
|
40
40
|
insertSignalFactoryEntry,
|
|
41
41
|
addFieldUiPolicyForType
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-e82dyeqy.js";
|
|
43
43
|
import {
|
|
44
44
|
ModuleScript
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-9bwhxrqf.js";
|
|
46
46
|
|
|
47
47
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
48
48
|
import { capitalize } from "akanjs/common";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-cezy7yb3.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-e82dyeqy.js";
|
|
11
11
|
import {
|
|
12
12
|
AiSession
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-n85fer99.js";
|
|
14
14
|
import {
|
|
15
15
|
Prompter
|
|
16
16
|
} from "./index-h7yw2z9n.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
FileSys
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-q0y2jq9j.js";
|
|
5
5
|
import {
|
|
6
6
|
AiSession
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-n85fer99.js";
|
|
8
8
|
import {
|
|
9
9
|
ModuleExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-q8sn827n.js";
|
|
11
11
|
import {
|
|
12
12
|
runner,
|
|
13
13
|
script
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-cezy7yb3.js";
|
|
15
15
|
import {
|
|
16
16
|
sourceFile,
|
|
17
17
|
moduleSourcePaths,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
createPassedPrimitiveReport,
|
|
20
20
|
bilingualLabelForField,
|
|
21
21
|
bilingualDescriptionForField
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-e82dyeqy.js";
|
|
23
23
|
import {
|
|
24
24
|
PageScript
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-mpmyqm1y.js";
|
|
26
26
|
import {
|
|
27
27
|
Prompter
|
|
28
28
|
} from "./index-h7yw2z9n.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
FileSys
|
|
4
|
+
} from "./index-q0y2jq9j.js";
|
|
2
5
|
import {
|
|
3
6
|
Executor,
|
|
4
7
|
WorkspaceExecutor,
|
|
@@ -6,10 +9,7 @@ import {
|
|
|
6
9
|
LibExecutor,
|
|
7
10
|
PkgExecutor,
|
|
8
11
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
10
|
-
import {
|
|
11
|
-
FileSys
|
|
12
|
-
} from "./index-ayy5ecax.js";
|
|
12
|
+
} from "./index-q8sn827n.js";
|
|
13
13
|
import {
|
|
14
14
|
getDirname2
|
|
15
15
|
} from "./index-6wwzs1bc.js";
|
|
@@ -51,6 +51,7 @@ var normalizePrimitiveArgType = (type) => {
|
|
|
51
51
|
throw new Error(`Invalid primitive argument type: ${type}`);
|
|
52
52
|
};
|
|
53
53
|
var App = createInternalArgToken("App");
|
|
54
|
+
var Apps = createInternalArgToken("Apps");
|
|
54
55
|
var Lib = createInternalArgToken("Lib");
|
|
55
56
|
var Sys = createInternalArgToken("Sys");
|
|
56
57
|
var Exec = createInternalArgToken("Exec");
|
|
@@ -59,11 +60,29 @@ var Module = createInternalArgToken("Module");
|
|
|
59
60
|
var Workspace = createInternalArgToken("Workspace");
|
|
60
61
|
|
|
61
62
|
// pkgs/@akanjs/devkit/commandDecorators/command.ts
|
|
62
|
-
import
|
|
63
|
+
import path2 from "path";
|
|
63
64
|
import { Logger } from "akanjs/common";
|
|
64
65
|
import chalk2 from "chalk";
|
|
65
66
|
import { program } from "commander";
|
|
66
67
|
|
|
68
|
+
// pkgs/@akanjs/devkit/appSelectionMemory.ts
|
|
69
|
+
import path from "path";
|
|
70
|
+
class AppSelectionMemory {
|
|
71
|
+
static pathIn(workspaceRoot) {
|
|
72
|
+
return path.join(workspaceRoot, "local", ".akan", "lastStart.json");
|
|
73
|
+
}
|
|
74
|
+
static async read(workspaceRoot) {
|
|
75
|
+
const stored = await Bun.file(AppSelectionMemory.pathIn(workspaceRoot)).json().catch(() => null);
|
|
76
|
+
const apps = stored?.apps;
|
|
77
|
+
return Array.isArray(apps) ? apps.filter((name) => typeof name === "string") : [];
|
|
78
|
+
}
|
|
79
|
+
static async write(workspaceRoot, apps) {
|
|
80
|
+
await FileSys.writeJson(AppSelectionMemory.pathIn(workspaceRoot), { apps }).catch(() => {
|
|
81
|
+
return;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
67
86
|
// pkgs/@akanjs/devkit/commandDecorators/dependencyBuilder.ts
|
|
68
87
|
var capitalize = (value) => value.slice(0, 1).toUpperCase() + value.slice(1);
|
|
69
88
|
var createDependencyKey = (refName, kind) => `${refName}${capitalize(kind)}`;
|
|
@@ -261,6 +280,8 @@ var formatCommandHelp = (command, key) => {
|
|
|
261
280
|
return "";
|
|
262
281
|
if (arg.type === "Module")
|
|
263
282
|
return "[sys:module]";
|
|
283
|
+
if (arg.type === "Apps")
|
|
284
|
+
return "[apps...]";
|
|
264
285
|
if (arg.type === "Argument") {
|
|
265
286
|
return `[${camelToKebabCase2(arg.name)}]`;
|
|
266
287
|
}
|
|
@@ -287,6 +308,9 @@ var formatCommandHelp = (command, key) => {
|
|
|
287
308
|
} else if (arg.type === "Module") {
|
|
288
309
|
argName = "sys:module";
|
|
289
310
|
argDesc = "Module in format: app-name:module-name or lib-name:module-name";
|
|
311
|
+
} else if (arg.type === "Apps") {
|
|
312
|
+
argName = "apps...";
|
|
313
|
+
argDesc = "App names, space- or comma-separated, or all. Omit to pick them interactively";
|
|
290
314
|
} else {
|
|
291
315
|
argName = arg.type.toLowerCase();
|
|
292
316
|
argDesc = `${arg.type} name in this workspace`;
|
|
@@ -380,6 +404,7 @@ var prompts = async () => await import("@inquirer/prompts");
|
|
|
380
404
|
var select = (config, context) => prompts().then((m) => m.select(config, context));
|
|
381
405
|
var confirm = (config, context) => prompts().then((m) => m.confirm(config, context));
|
|
382
406
|
var input = (config, context) => prompts().then((m) => m.input(config, context));
|
|
407
|
+
var checkbox = (config, context) => prompts().then((m) => m.checkbox(config, context));
|
|
383
408
|
var assertEnumChoice = (argMeta, value) => {
|
|
384
409
|
const enumChoices = argMeta.argsOption.enum;
|
|
385
410
|
if (!enumChoices || typeof enumChoices === "function")
|
|
@@ -474,6 +499,31 @@ var assertCurrentDirectoryIsWorkspaceRoot = async () => {
|
|
|
474
499
|
].join(`
|
|
475
500
|
`));
|
|
476
501
|
};
|
|
502
|
+
var parseAppNameList = (value) => (Array.isArray(value) ? value : value === undefined ? [] : [value]).flatMap((entry) => entry.split(",")).map((entry) => entry.trim()).filter(Boolean);
|
|
503
|
+
var getAppsArgumentValue = async (value, workspace) => {
|
|
504
|
+
const appNames = await workspace.getApps();
|
|
505
|
+
if (appNames.length === 0)
|
|
506
|
+
throw new Error("No apps found in this workspace (apps/<appName>/akan.config.ts)");
|
|
507
|
+
const requested = parseAppNameList(value);
|
|
508
|
+
if (requested.includes("all"))
|
|
509
|
+
return appNames.map((name) => AppExecutor.from(workspace, name));
|
|
510
|
+
if (requested.length) {
|
|
511
|
+
const unknown = requested.filter((name) => !appNames.includes(name));
|
|
512
|
+
if (unknown.length)
|
|
513
|
+
throw new Error(`Unknown app${unknown.length > 1 ? "s" : ""}: ${unknown.join(", ")}. Available: ${appNames.join(", ")}, all`);
|
|
514
|
+
return [...new Set(requested)].map((name) => AppExecutor.from(workspace, name));
|
|
515
|
+
}
|
|
516
|
+
if (appNames.length === 1 && appNames[0])
|
|
517
|
+
return [AppExecutor.from(workspace, appNames[0])];
|
|
518
|
+
const remembered = new Set(await AppSelectionMemory.read(workspace.workspaceRoot));
|
|
519
|
+
const picked = await checkbox({
|
|
520
|
+
message: "Select the apps to run (space to toggle, enter to confirm)",
|
|
521
|
+
choices: appNames.map((name) => ({ name, value: name, checked: remembered.has(name) })),
|
|
522
|
+
required: true
|
|
523
|
+
});
|
|
524
|
+
await AppSelectionMemory.write(workspace.workspaceRoot, picked);
|
|
525
|
+
return picked.map((name) => AppExecutor.from(workspace, name));
|
|
526
|
+
};
|
|
477
527
|
var getInternalArgumentValue = async (argMeta, value, workspace) => {
|
|
478
528
|
if (argMeta.type === "Workspace")
|
|
479
529
|
return workspace;
|
|
@@ -578,7 +628,7 @@ var runCommands = async (...commands) => {
|
|
|
578
628
|
process.exit(1);
|
|
579
629
|
});
|
|
580
630
|
const __dirname2 = getDirname2(import.meta.url);
|
|
581
|
-
const packageJsonCandidates = [`${
|
|
631
|
+
const packageJsonCandidates = [`${path2.dirname(Bun.main)}/package.json`, `${__dirname2}/../package.json`];
|
|
582
632
|
let cliPackageJson = null;
|
|
583
633
|
for (const packageJsonPath of packageJsonCandidates) {
|
|
584
634
|
if (!await FileSys.fileExists(packageJsonPath))
|
|
@@ -625,6 +675,8 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`)
|
|
|
625
675
|
continue;
|
|
626
676
|
else if (argMeta.type === "Module") {
|
|
627
677
|
programCommand = programCommand.argument(`[sys-name:module-name]`, `${argMeta.type} in this workspace (apps|libs)/<sys-name>/lib/<module-name>`);
|
|
678
|
+
} else if (argMeta.type === "Apps") {
|
|
679
|
+
programCommand = programCommand.argument(`[apps...]`, `apps in this workspace apps/<appName>, or all (space- or comma-separated; omit to pick interactively)`);
|
|
628
680
|
} else {
|
|
629
681
|
const sysType = argMeta.type.toLowerCase();
|
|
630
682
|
programCommand = programCommand.argument(`[${sysType}]`, `${sysType} in this workspace ${sysType}s/<${sysType}Name>`);
|
|
@@ -649,10 +701,17 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`)
|
|
|
649
701
|
commandArgs[argMeta.idx] = await getOptionValue(argMeta, opt, commandContext);
|
|
650
702
|
else if (argMeta.type === "Argument")
|
|
651
703
|
commandArgs[argMeta.idx] = await getArgumentValue(argMeta, cmdArgs[argMeta.idx]);
|
|
704
|
+
else if (argMeta.type === "Apps")
|
|
705
|
+
commandArgs[argMeta.idx] = await getAppsArgumentValue(cmdArgs[argMeta.idx], workspace);
|
|
652
706
|
else
|
|
653
707
|
commandArgs[argMeta.idx] = await getInternalArgumentValue(argMeta, cmdArgs[argMeta.idx], workspace);
|
|
654
708
|
if (commandArgs[argMeta.idx] instanceof AppExecutor)
|
|
655
709
|
process.env.AKAN_PUBLIC_APP_NAME = commandArgs[argMeta.idx].name;
|
|
710
|
+
else if (Array.isArray(commandArgs[argMeta.idx])) {
|
|
711
|
+
const apps = commandArgs[argMeta.idx];
|
|
712
|
+
if (apps.length === 1 && apps[0])
|
|
713
|
+
process.env.AKAN_PUBLIC_APP_NAME = apps[0].name;
|
|
714
|
+
}
|
|
656
715
|
assignCommandContext(commandContext, argMeta, commandArgs[argMeta.idx]);
|
|
657
716
|
if (opt.verbose)
|
|
658
717
|
Executor.setVerbose(true);
|
|
@@ -772,4 +831,4 @@ function command(refName, depsOrBuilder, builder) {
|
|
|
772
831
|
}
|
|
773
832
|
return CommandBase;
|
|
774
833
|
}
|
|
775
|
-
export { getTargetMetas, getTargetCommandNames, App, Lib, Sys, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, runCommands, command };
|
|
834
|
+
export { getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, runCommands, command };
|