@akanjs/cli 3.0.0-alpha.45 → 3.0.0-alpha.46
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/{agent.command-e835fjem.js → agent.command-nqs3bw0g.js} +5 -5
- package/{application.command-sjtbk6tr.js → application.command-cfx525a9.js} +4 -4
- package/buildBatch.proc.js +1 -1
- package/{capacitorApp-qv7g3dp2.js → capacitorApp-927ahhz2.js} +2 -2
- package/{cloud.command-y0e4eyqz.js → cloud.command-4mkbvey2.js} +7 -7
- package/{context.command-vn87jb08.js → context.command-6kn3tady.js} +12 -12
- package/{guideline.command-s4hn2bsy.js → guideline.command-pjdrndqk.js} +2 -2
- package/guidelines/conventions/conventions.instruction.md +6 -4
- package/incrementalBuilder.proc.js +1 -1
- package/{index-g9e2fhw2.js → index-24h5bqpj.js} +15 -15
- package/{index-t71zvmt9.js → index-3h0d06v8.js} +3 -3
- package/{index-qc0tnhs2.js → index-4z05haak.js} +1 -1
- package/{index-tsmjxph2.js → index-5em412h5.js} +1 -1
- package/{index-xyrb7pk5.js → index-5fe016p2.js} +3 -3
- package/{index-73rnbwgg.js → index-6bs24rb4.js} +2 -2
- package/{index-x33gnap3.js → index-7w5vv8jk.js} +2 -2
- package/{index-33zce8gt.js → index-7zd96bng.js} +2 -2
- package/{index-0h212yqe.js → index-866yqz3y.js} +10 -10
- package/{index-n706txcv.js → index-8rr621r2.js} +1 -1
- package/{index-8vkkm7v0.js → index-90zyjrby.js} +73 -21
- package/{index-9jsnb4vw.js → index-97cw8sg1.js} +4 -4
- package/{index-3dp7x6rc.js → index-k7sm38v6.js} +3 -3
- package/{index-becx1t0k.js → index-xc6bbz6e.js} +5 -5
- package/{index-k6fvbcj1.js → index-xe3ychw5.js} +3 -3
- package/{index-mykmf6wd.js → index-xrdrttjb.js} +4 -4
- package/{index-8d2sv6pw.js → index-yay1fd05.js} +4 -4
- package/{index-mz5jtaq7.js → index-zgkey4d0.js} +1 -1
- package/index.js +18 -18
- package/{library.command-v5cyaw9t.js → library.command-7h3yezwc.js} +3 -3
- package/{localRegistry.command-53t758pt.js → localRegistry.command-tet9rxqb.js} +6 -6
- package/{module.command-pq6w84xg.js → module.command-4g11k3xd.js} +5 -5
- package/{package.command-qkcs60ts.js → package.command-z7dd6vy2.js} +3 -3
- package/package.json +2 -2
- package/{page.command-qj5bfnh9.js → page.command-y996708m.js} +3 -3
- package/{primitive.command-bw0nes6x.js → primitive.command-4fcn8k83.js} +6 -6
- package/{quality.command-g1s2wt8b.js → quality.command-hx5af2yn.js} +41 -20
- package/{repair.command-mzwtejpk.js → repair.command-ysxd8pef.js} +5 -5
- package/{scalar.command-rm6k3c65.js → scalar.command-3chgxybs.js} +4 -4
- package/{workflow.command-g2cgcgxn.js → workflow.command-endxfzv5.js} +9 -9
- package/{workspace.command-f7jerqb2.js → workspace.command-f2966kvr.js} +18 -18
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a449ecf4ed04e054d920f6f80354679ed20e1dd7aa0876766c212592a816bc2a
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AgentScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-xe3ychw5.js";
|
|
5
|
+
import"./index-24h5bqpj.js";
|
|
6
|
+
import"./index-5em412h5.js";
|
|
7
7
|
import"./index-j37qq1f2.js";
|
|
8
8
|
import {
|
|
9
9
|
Workspace,
|
|
10
10
|
command
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-8rr621r2.js";
|
|
12
|
+
import"./index-90zyjrby.js";
|
|
13
13
|
import"./index-mxvakhsm.js";
|
|
14
14
|
import"./index-xys926f2.js";
|
|
15
15
|
import"./index-1577bej2.js";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "./index-0wae5ebk.js";
|
|
5
5
|
import {
|
|
6
6
|
ApplicationScript
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-yay1fd05.js";
|
|
8
|
+
import"./index-6bs24rb4.js";
|
|
9
9
|
import {
|
|
10
10
|
getMobileTargetChoices
|
|
11
11
|
} from "./index-76rn3g2c.js";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
Sys,
|
|
16
16
|
Workspace,
|
|
17
17
|
command
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-8rr621r2.js";
|
|
19
19
|
import"./index-fgc8r6dj.js";
|
|
20
20
|
import"./index-bjpxzr6s.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-90zyjrby.js";
|
|
22
22
|
import"./index-mxvakhsm.js";
|
|
23
23
|
import"./index-1577bej2.js";
|
|
24
24
|
import"./index-67546d0j.js";
|
package/buildBatch.proc.js
CHANGED
|
@@ -25,9 +25,9 @@ import {
|
|
|
25
25
|
selectLocalDevHost,
|
|
26
26
|
sortIosRunTargets,
|
|
27
27
|
writeRootCapacitorConfig
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-zgkey4d0.js";
|
|
29
29
|
import"./index-76rn3g2c.js";
|
|
30
|
-
import"./index-
|
|
30
|
+
import"./index-90zyjrby.js";
|
|
31
31
|
import"./index-mxvakhsm.js";
|
|
32
32
|
import"./index-1577bej2.js";
|
|
33
33
|
import"./index-67546d0j.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-xc6bbz6e.js";
|
|
5
|
+
import"./index-3h0d06v8.js";
|
|
6
|
+
import"./index-7zd96bng.js";
|
|
7
7
|
import {
|
|
8
8
|
GlobalConfig
|
|
9
9
|
} from "./index-sh01r3pm.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
import"./index-yay1fd05.js";
|
|
11
|
+
import"./index-6bs24rb4.js";
|
|
12
12
|
import"./index-76rn3g2c.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-8rr621r2.js";
|
|
17
17
|
import"./index-fgc8r6dj.js";
|
|
18
18
|
import"./index-bjpxzr6s.js";
|
|
19
|
-
import"./index-
|
|
19
|
+
import"./index-90zyjrby.js";
|
|
20
20
|
import"./index-mxvakhsm.js";
|
|
21
21
|
import"./index-1577bej2.js";
|
|
22
22
|
import"./index-46tjzh6s.js";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ContextScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
4
|
+
} from "./index-866yqz3y.js";
|
|
5
|
+
import"./index-5fe016p2.js";
|
|
6
|
+
import"./index-k7sm38v6.js";
|
|
7
|
+
import"./index-7w5vv8jk.js";
|
|
8
|
+
import"./index-97cw8sg1.js";
|
|
9
|
+
import"./index-xrdrttjb.js";
|
|
10
10
|
import"./index-ss469dec.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
import"./index-4z05haak.js";
|
|
12
|
+
import"./index-zgkey4d0.js";
|
|
13
13
|
import"./index-sh01r3pm.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
14
|
+
import"./index-24h5bqpj.js";
|
|
15
|
+
import"./index-5em412h5.js";
|
|
16
16
|
import"./index-j37qq1f2.js";
|
|
17
17
|
import"./index-76rn3g2c.js";
|
|
18
18
|
import {
|
|
19
19
|
Workspace,
|
|
20
20
|
command
|
|
21
|
-
} from "./index-
|
|
22
|
-
import"./index-
|
|
21
|
+
} from "./index-8rr621r2.js";
|
|
22
|
+
import"./index-90zyjrby.js";
|
|
23
23
|
import"./index-mxvakhsm.js";
|
|
24
24
|
import"./index-xys926f2.js";
|
|
25
25
|
import"./index-1577bej2.js";
|
|
@@ -1176,17 +1176,19 @@ export const pageConfig = { transition: "stack" } satisfies PageConfig;
|
|
|
1176
1176
|
|
|
1177
1177
|
## Akan Sync Conventions (`apps/**`, `libs/**`)
|
|
1178
1178
|
|
|
1179
|
-
- `apps/<appName>` root may only contain these files: `AGENTS.md`, `CLAUDE.md`, `akan.app.json`, `akan.config.ts`, `capacitor.config.ts`, `client.ts`, `main.ts`, `package.json`, `server.ts`, `tsconfig.json`.
|
|
1179
|
+
- `apps/<appName>` root may only contain these files: `AGENTS.md`, `CLAUDE.md`, `akan.app.json`, `akan.config.ts`, `capacitor.config.ts`, `client.ts`, `main.ts`, `package.json`, `server.ts`, `tsconfig.json`, `tsconfig.tsbuildinfo`.
|
|
1180
1180
|
- `apps/<appName>` root may only contain these folders: `.akan`, `android`, `common`, `env`, `ios`, `lib`, `mobile`, `page`, `plugin`, `private`, `public`, `script`, `secrets`, `srvkit`, `ui`, `webkit`.
|
|
1181
|
-
-
|
|
1181
|
+
- `libs/<libName>` root may only contain these files: `AGENTS.md`, `CLAUDE.md`, `README.md`, `akan.config.ts`, `akan.lib.json`, `client.ts`, `index.ts`, `package.json`, `server.ts`, `tsconfig.json`, `tsconfig.spec.json`, `tsconfig.tsbuildinfo`.
|
|
1182
|
+
- `libs/<libName>` root may only contain these folders: `common`, `env`, `lib`, `page`, `plugin`, `private`, `public`, `srvkit`, `ui`, `webkit`. A library is never booted or packaged as an app, so the run and mobile entries an app carries (`main.ts`, `capacitor.config.ts`, `.akan`, `android`, `ios`, `mobile`, `script`, `secrets`) are rejected there.
|
|
1183
|
+
- Both allowlists have one source — `pkgs/@akanjs/devkit/workspaceLayout.ts`. `akan sync` (error), `akan doctor`
|
|
1182
1184
|
(diagnostic), and `akan quality scan` (warning) all read it, so add a new root entry there and mirror it into this
|
|
1183
1185
|
list, never into one of the three call sites.
|
|
1184
1186
|
- `akan sync` maintains a scoped agent guide per app/lib: `apps/<app>/AGENTS.md` / `libs/<lib>/AGENTS.md`. The
|
|
1185
1187
|
section between the `akan:agent` markers (the `## Recipes In Scope` index) is generated — do not hand-edit it;
|
|
1186
1188
|
content outside the markers is yours. `akan lint` fails when the generated section is stale.
|
|
1187
1189
|
- The `plugin/` facet holds Akan plugin declarations; files use the `<name>.plugin.ts` convention (e.g. `pushNotification.plugin.ts`) and are re-exported from the generated `plugin/index.ts` barrel.
|
|
1188
|
-
- Do not add `apps/*/base`; place shared
|
|
1189
|
-
- `apps/*/lib` and `libs/*/lib` root files are limited to generated/support files: `cnst.ts`, `db.ts`, `dict.ts`, `option.ts`, `sig.ts`, `srv.ts`, `st.ts`, `useClient.ts`, `useServer.ts`.
|
|
1190
|
+
- Do not add `apps/*/base` or `libs/*/base`; place shared utilities under that app or lib's own `common/`.
|
|
1191
|
+
- `apps/*/lib` and `libs/*/lib` root files are limited to generated/support files: `cnst.ts`, `db.ts`, `dict.ts`, `option.ts`, `sig.ts`, `srv.ts`, `st.ts`, `useClient.ts`, `useServer.ts` — plus a `<model>.signal.test.ts` / `.spec.ts`, the one hand-written file that belongs there because the suite boots the whole barrel.
|
|
1190
1192
|
- Domain module folders are `lib/<model>` for database modules, `lib/_<service>` for service modules, and `lib/__scalar/<scalar>` for scalar modules.
|
|
1191
1193
|
- Database module UI files are limited to `<Model>.Template.tsx`, `<Model>.Unit.tsx`, `<Model>.Util.tsx`, `<Model>.View.tsx`, and `<Model>.Zone.tsx`.
|
|
1192
1194
|
- Service module UI files are limited to `<Service>.Util.tsx` and `<Service>.Zone.tsx`.
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
workflowRunArtifactPath,
|
|
4
4
|
workflowSyncDir
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-5em412h5.js";
|
|
6
6
|
import {
|
|
7
7
|
AppExecutor,
|
|
8
8
|
LibExecutor,
|
|
9
|
-
appRootAllowedDirs,
|
|
10
|
-
appRootAllowedFiles,
|
|
11
9
|
extractBlockVersion,
|
|
12
|
-
|
|
13
|
-
readDevkitVersion
|
|
14
|
-
|
|
10
|
+
isScannedRootEntry,
|
|
11
|
+
readDevkitVersion,
|
|
12
|
+
rootAllowedDirs,
|
|
13
|
+
rootAllowedFiles
|
|
14
|
+
} from "./index-90zyjrby.js";
|
|
15
15
|
import {
|
|
16
16
|
collectRecipeSources,
|
|
17
17
|
findInlineRecipeDuplicates,
|
|
@@ -404,19 +404,19 @@ class AkanContextAnalyzer {
|
|
|
404
404
|
repairAction("generated", "akan repair generated --app <app-or-lib>", "Refresh generated Akan files.", true),
|
|
405
405
|
repairAction("format", "akan repair format --target <app-or-lib-or-pkg>", "Run the formatter/linter repair path.", true)
|
|
406
406
|
];
|
|
407
|
-
for (const
|
|
408
|
-
const
|
|
409
|
-
for (const entry of await safeReadDir(
|
|
410
|
-
if (!
|
|
407
|
+
for (const sys of [...context.apps, ...context.libs]) {
|
|
408
|
+
const sysPath = path.join(workspace.workspaceRoot, sys.path);
|
|
409
|
+
for (const entry of await safeReadDir(sysPath)) {
|
|
410
|
+
if (!isScannedRootEntry(sys.type, entry.name))
|
|
411
411
|
continue;
|
|
412
|
-
const allowed = entry.isDirectory() ?
|
|
412
|
+
const allowed = entry.isDirectory() ? rootAllowedDirs[sys.type].has(entry.name) : rootAllowedFiles[sys.type].has(entry.name);
|
|
413
413
|
if (!allowed) {
|
|
414
|
-
const action = repairAction("module-shape", `akan repair module-shape --app ${
|
|
414
|
+
const action = repairAction("module-shape", `akan repair module-shape --app ${sys.name}`, `Review ${sys.type} root shape and remove or move the unknown entry.`, false);
|
|
415
415
|
diagnostics.push({
|
|
416
416
|
severity: "error",
|
|
417
|
-
code:
|
|
418
|
-
path: `${
|
|
419
|
-
message: `Unexpected ${entry.isDirectory() ? "folder" : "file"} in
|
|
417
|
+
code: `${sys.type}-root-unknown-entry`,
|
|
418
|
+
path: `${sys.path}/${entry.name}`,
|
|
419
|
+
message: `Unexpected ${entry.isDirectory() ? "folder" : "file"} in ${sys.type} root: ${sys.path}/${entry.name}`,
|
|
420
420
|
repairActions: [action]
|
|
421
421
|
});
|
|
422
422
|
repairActions.push(action);
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
} from "./index-sh01r3pm.js";
|
|
8
8
|
import {
|
|
9
9
|
openBrowser
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-yay1fd05.js";
|
|
11
11
|
import {
|
|
12
12
|
runner
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-8rr621r2.js";
|
|
14
14
|
import {
|
|
15
15
|
AppExecutor,
|
|
16
16
|
WorkspaceExecutor
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-90zyjrby.js";
|
|
18
18
|
|
|
19
19
|
// pkgs/@akanjs/cli/npmRegistry.ts
|
|
20
20
|
var defaultNpmRegistry = "https://registry.npmjs.org";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-24h5bqpj.js";
|
|
5
5
|
import {
|
|
6
6
|
createRepairReport,
|
|
7
7
|
generatedFilePathsForTarget,
|
|
8
8
|
renderRepairReport,
|
|
9
9
|
writeGeneratedSyncState,
|
|
10
10
|
writeWorkflowRunArtifact
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-5em412h5.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-8rr621r2.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/repair/repair.runner.ts
|
|
17
17
|
var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-8rr621r2.js";
|
|
6
6
|
import {
|
|
7
7
|
LibExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-90zyjrby.js";
|
|
9
9
|
|
|
10
10
|
// pkgs/@akanjs/cli/semver.ts
|
|
11
11
|
var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
createPassedPrimitiveReport,
|
|
10
10
|
generatedFilesForSync,
|
|
11
11
|
scalarChangedFiles
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-5em412h5.js";
|
|
13
13
|
import {
|
|
14
14
|
Prompter
|
|
15
15
|
} from "./index-j37qq1f2.js";
|
|
16
16
|
import {
|
|
17
17
|
runner,
|
|
18
18
|
script
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-8rr621r2.js";
|
|
20
20
|
|
|
21
21
|
// pkgs/@akanjs/cli/scalar/scalar.prompt.ts
|
|
22
22
|
import { input } from "@inquirer/prompts";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-8rr621r2.js";
|
|
6
6
|
import {
|
|
7
7
|
PkgExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-90zyjrby.js";
|
|
9
9
|
import {
|
|
10
10
|
TypeScriptDependencyScanner
|
|
11
11
|
} from "./index-46tjzh6s.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
RepairRunner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-5fe016p2.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowRunner
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-k7sm38v6.js";
|
|
8
8
|
import {
|
|
9
9
|
ScalarScript
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-7w5vv8jk.js";
|
|
11
11
|
import {
|
|
12
12
|
PrimitiveScript
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-97cw8sg1.js";
|
|
14
14
|
import {
|
|
15
15
|
ModuleScript
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-xrdrttjb.js";
|
|
17
17
|
import {
|
|
18
18
|
isPlaceholderAppId
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-zgkey4d0.js";
|
|
20
20
|
import {
|
|
21
21
|
AkanContextAnalyzer,
|
|
22
22
|
akanMcpInstallConfigPaths,
|
|
@@ -27,14 +27,14 @@ import {
|
|
|
27
27
|
renderDoctorText,
|
|
28
28
|
resourceList,
|
|
29
29
|
upsertCodexMcpServerBlock
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-24h5bqpj.js";
|
|
31
31
|
import {
|
|
32
32
|
buildAkanModuleContextIndex,
|
|
33
33
|
createWorkflowBaselineSummary,
|
|
34
34
|
createWorkflowStepRegistry,
|
|
35
35
|
jsonText,
|
|
36
36
|
toolingRolloutGate
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-5em412h5.js";
|
|
38
38
|
import {
|
|
39
39
|
Prompter
|
|
40
40
|
} from "./index-j37qq1f2.js";
|
|
@@ -45,10 +45,10 @@ import {
|
|
|
45
45
|
CommandContainer,
|
|
46
46
|
runner,
|
|
47
47
|
script
|
|
48
|
-
} from "./index-
|
|
48
|
+
} from "./index-8rr621r2.js";
|
|
49
49
|
import {
|
|
50
50
|
AppExecutor
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-90zyjrby.js";
|
|
52
52
|
|
|
53
53
|
// pkgs/@akanjs/cli/context/context.script.ts
|
|
54
54
|
import { Logger } from "akanjs/common";
|
|
@@ -33,6 +33,7 @@ import path5 from "path";
|
|
|
33
33
|
import { pathToFileURL } from "url";
|
|
34
34
|
import {
|
|
35
35
|
capitalize,
|
|
36
|
+
getPageSourceFileViolation,
|
|
36
37
|
isRouteSourceFile,
|
|
37
38
|
Logger,
|
|
38
39
|
parseRouteModuleKey,
|
|
@@ -332,7 +333,7 @@ class AkanAppConfig {
|
|
|
332
333
|
subRoutes = new Map;
|
|
333
334
|
basePaths = new Set;
|
|
334
335
|
branches = new Set(["debug", "develop", "main"]);
|
|
335
|
-
constructor(app, libs, rootPackageJson, config, baseDevEnv, plugins = []) {
|
|
336
|
+
constructor(app, libs, rootPackageJson, config, baseDevEnv, plugins = [], libExternalLibs = []) {
|
|
336
337
|
this.app = app;
|
|
337
338
|
this.rootPackageJson = rootPackageJson;
|
|
338
339
|
this.libs = libs;
|
|
@@ -340,7 +341,7 @@ class AkanAppConfig {
|
|
|
340
341
|
this.plugins = plugins;
|
|
341
342
|
this.#applyRoutes(config?.routes);
|
|
342
343
|
this.defaultDatabaseMode = config?.defaultDatabaseMode ?? "single";
|
|
343
|
-
this.externalLibs = config?.externalLibs ?? [];
|
|
344
|
+
this.externalLibs = [...new Set([...config?.externalLibs ?? [], ...libExternalLibs])];
|
|
344
345
|
this.barrelImports = [
|
|
345
346
|
...DEFAULT_BARREL_IMPORTS,
|
|
346
347
|
...WORKSPACE_BARREL_FACETS.map((facet) => `@apps/${app.name}/${facet}`),
|
|
@@ -529,7 +530,15 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
529
530
|
]);
|
|
530
531
|
const resolved = typeof configImp === "function" ? configImp(app) : configImp;
|
|
531
532
|
const { plugins, ...config } = resolved ?? {};
|
|
532
|
-
|
|
533
|
+
const libExternalLibs = await AkanAppConfig.#collectLibExternalLibs(app, libs, bustImportCache);
|
|
534
|
+
return new AkanAppConfig(app, libs, rootPackageJson, config, baseDevEnv, plugins ?? [], libExternalLibs);
|
|
535
|
+
}
|
|
536
|
+
static async#collectLibExternalLibs(app, libs, bustImportCache) {
|
|
537
|
+
const libConfigs = await Promise.all(libs.map(async (libName) => LibExecutor.from(app, libName).getConfig({ refresh: bustImportCache }).catch((error) => {
|
|
538
|
+
app.logger.warn(`Skipped libs/${libName}/akan.config.ts externalLibs: ${String(error)}`);
|
|
539
|
+
return null;
|
|
540
|
+
})));
|
|
541
|
+
return libConfigs.flatMap((libConfig) => libConfig?.externalLibs ?? []);
|
|
533
542
|
}
|
|
534
543
|
#resolveProductionDependencyVersion(lib) {
|
|
535
544
|
const rootVersion = this.rootPackageJson.dependencies?.[lib] ?? this.rootPackageJson.devDependencies?.[lib];
|
|
@@ -633,8 +642,8 @@ class AkanLibConfig {
|
|
|
633
642
|
this.externalLibs = config?.externalLibs ?? [];
|
|
634
643
|
this.plugins = plugins;
|
|
635
644
|
}
|
|
636
|
-
static async from(lib) {
|
|
637
|
-
const
|
|
645
|
+
static async from(lib, { bustImportCache = false } = {}) {
|
|
646
|
+
const configImp = await AkanAppConfig.importConfigModule(lib.cwdPath, { bustImportCache });
|
|
638
647
|
const resolved = typeof configImp === "function" ? configImp(lib) : configImp;
|
|
639
648
|
const { plugins, ...config } = resolved ?? {};
|
|
640
649
|
return new AkanLibConfig(lib, config, plugins ?? []);
|
|
@@ -997,6 +1006,34 @@ var appRootAllowedDirs = new Set([
|
|
|
997
1006
|
"ui",
|
|
998
1007
|
"webkit"
|
|
999
1008
|
]);
|
|
1009
|
+
var libRootAllowedFiles = new Set([
|
|
1010
|
+
"AGENTS.md",
|
|
1011
|
+
"CLAUDE.md",
|
|
1012
|
+
"README.md",
|
|
1013
|
+
"akan.config.ts",
|
|
1014
|
+
"akan.lib.json",
|
|
1015
|
+
"client.ts",
|
|
1016
|
+
"index.ts",
|
|
1017
|
+
"package.json",
|
|
1018
|
+
"server.ts",
|
|
1019
|
+
"tsconfig.json",
|
|
1020
|
+
"tsconfig.spec.json",
|
|
1021
|
+
"tsconfig.tsbuildinfo"
|
|
1022
|
+
]);
|
|
1023
|
+
var libRootAllowedDirs = new Set([
|
|
1024
|
+
"common",
|
|
1025
|
+
"env",
|
|
1026
|
+
"lib",
|
|
1027
|
+
"page",
|
|
1028
|
+
"plugin",
|
|
1029
|
+
"private",
|
|
1030
|
+
"public",
|
|
1031
|
+
"srvkit",
|
|
1032
|
+
"ui",
|
|
1033
|
+
"webkit"
|
|
1034
|
+
]);
|
|
1035
|
+
var rootAllowedFiles = { app: appRootAllowedFiles, lib: libRootAllowedFiles };
|
|
1036
|
+
var rootAllowedDirs = { app: appRootAllowedDirs, lib: libRootAllowedDirs };
|
|
1000
1037
|
var libFacetRootAllowedFiles = new Set([
|
|
1001
1038
|
"cnst.ts",
|
|
1002
1039
|
"db.ts",
|
|
@@ -1008,7 +1045,9 @@ var libFacetRootAllowedFiles = new Set([
|
|
|
1008
1045
|
"useClient.ts",
|
|
1009
1046
|
"useServer.ts"
|
|
1010
1047
|
]);
|
|
1011
|
-
var
|
|
1048
|
+
var libFacetRootTestPattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
1049
|
+
var isAllowedLibFacetRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || libFacetRootTestPattern.test(filename);
|
|
1050
|
+
var isScannedRootEntry = (type, name) => !name.startsWith(".") || rootAllowedDirs[type].has(name);
|
|
1012
1051
|
|
|
1013
1052
|
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
1014
1053
|
var databaseFileTypes = [
|
|
@@ -1037,10 +1076,8 @@ var moduleUiFileTypes = {
|
|
|
1037
1076
|
scalar: new Set(["Template", "Unit"])
|
|
1038
1077
|
};
|
|
1039
1078
|
var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
|
|
1040
|
-
var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
1041
1079
|
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-rbs2407b.js")).TypeScriptDependencyScanner.from(exec);
|
|
1042
1080
|
var isAllowedTestFile = (filename) => testFilePattern.test(filename);
|
|
1043
|
-
var isAllowedLibRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
|
|
1044
1081
|
var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
|
|
1045
1082
|
async function clearGeneratedRootCapacitorConfigs(exec) {
|
|
1046
1083
|
if (exec.type !== "app")
|
|
@@ -1057,17 +1094,20 @@ async function assertScanConvention(exec, libRoot) {
|
|
|
1057
1094
|
const addViolation = (relativePath, reason) => {
|
|
1058
1095
|
violations.push(`${getScanPath(exec, relativePath)}: ${reason}`);
|
|
1059
1096
|
};
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
});
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1097
|
+
const allowedRootFiles = rootAllowedFiles[exec.type];
|
|
1098
|
+
const allowedRootDirs = rootAllowedDirs[exec.type];
|
|
1099
|
+
const { files, dirs } = await exec.getFilesAndDirs(".");
|
|
1100
|
+
files.filter((filename) => !allowedRootFiles.has(filename)).forEach((filename) => {
|
|
1101
|
+
addViolation(filename, `unsupported ${exec.type} root file`);
|
|
1102
|
+
});
|
|
1103
|
+
dirs.filter((dirname) => !allowedRootDirs.has(dirname)).forEach((dirname) => {
|
|
1104
|
+
addViolation(dirname, `unsupported ${exec.type} root folder`);
|
|
1105
|
+
});
|
|
1106
|
+
if (exec.type === "lib")
|
|
1107
|
+
for (const { relativePath, reason } of await exec.getPageConventionViolations())
|
|
1108
|
+
addViolation(relativePath, reason);
|
|
1109
|
+
libRoot.files.filter((filename) => !isAllowedLibFacetRootFile(filename)).forEach((filename) => {
|
|
1110
|
+
addViolation(path4.join("lib", filename), "unsupported lib facet root file");
|
|
1071
1111
|
});
|
|
1072
1112
|
libRoot.dirs.filter((dirname) => dirname.startsWith("__") && !internalLibDirs.has(dirname)).forEach((dirname) => {
|
|
1073
1113
|
addViolation(path4.join("lib", dirname), "unsupported internal lib folder");
|
|
@@ -2348,6 +2388,18 @@ class SysExecutor extends Executor {
|
|
|
2348
2388
|
const path6 = this.type === "app" ? `apps/${this.name}/lib` : `libs/${this.name}/lib`;
|
|
2349
2389
|
return await this.workspace.getDirInModule(path6, this.name);
|
|
2350
2390
|
}
|
|
2391
|
+
async getPageConventionViolations() {
|
|
2392
|
+
if (!await this.exists("page"))
|
|
2393
|
+
return [];
|
|
2394
|
+
const violations = [];
|
|
2395
|
+
for (const entry of await this.getAllFiles("**/*", { cwd: this.getPath("page") })) {
|
|
2396
|
+
const relativePath = entry.split(path5.sep).join("/");
|
|
2397
|
+
const reason = getPageSourceFileViolation(relativePath);
|
|
2398
|
+
if (reason)
|
|
2399
|
+
violations.push({ relativePath: `page/${relativePath}`, reason });
|
|
2400
|
+
}
|
|
2401
|
+
return violations;
|
|
2402
|
+
}
|
|
2351
2403
|
#scanInfo = null;
|
|
2352
2404
|
hasScanInfo() {
|
|
2353
2405
|
return this.#scanInfo !== null;
|
|
@@ -2922,7 +2974,7 @@ class LibExecutor extends SysExecutor {
|
|
|
2922
2974
|
async getConfig({ refresh } = {}) {
|
|
2923
2975
|
if (this.#akanConfig && !refresh)
|
|
2924
2976
|
return this.#akanConfig;
|
|
2925
|
-
this.#akanConfig = await AkanLibConfig.from(this);
|
|
2977
|
+
this.#akanConfig = await AkanLibConfig.from(this, { bustImportCache: refresh });
|
|
2926
2978
|
return this.#akanConfig;
|
|
2927
2979
|
}
|
|
2928
2980
|
}
|
|
@@ -3062,4 +3114,4 @@ class ModuleExecutor extends Executor {
|
|
|
3062
3114
|
}
|
|
3063
3115
|
}
|
|
3064
3116
|
|
|
3065
|
-
export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE,
|
|
3117
|
+
export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, isScannedRootEntry, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-xrdrttjb.js";
|
|
5
5
|
import {
|
|
6
6
|
addFieldUiPolicyForType,
|
|
7
7
|
coerceFieldDefault,
|
|
@@ -34,15 +34,15 @@ import {
|
|
|
34
34
|
sourceFile,
|
|
35
35
|
validationCommandsForTarget,
|
|
36
36
|
viaBuilderParameterName
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-5em412h5.js";
|
|
38
38
|
import {
|
|
39
39
|
script
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-8rr621r2.js";
|
|
41
41
|
import {
|
|
42
42
|
AppExecutor,
|
|
43
43
|
LibExecutor,
|
|
44
44
|
ModuleExecutor
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-90zyjrby.js";
|
|
46
46
|
|
|
47
47
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
48
48
|
import { capitalize } from "akanjs/common";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-24h5bqpj.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowExecutor,
|
|
7
7
|
compactWorkflowInputs,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
workflowCommandsForPlan,
|
|
24
24
|
workflowPlanApproval,
|
|
25
25
|
writeWorkflowRunArtifact
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-5em412h5.js";
|
|
27
27
|
import {
|
|
28
28
|
runner
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-8rr621r2.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/cli/workflow/workflow.runner.ts
|
|
32
32
|
import { mkdir, readFile, writeFile } from "fs/promises";
|