@akanjs/cli 2.4.2-rc.1 → 2.4.2-rc.3
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-ghh1q9an.js +103 -0
- package/{agent.command-ash7wabs.js → agent.command-de4r6vk8.js} +6 -6
- package/{application.command-zm47j93m.js → application.command-nfsfm96y.js} +14 -4
- package/buildBatch.proc.js +1 -1
- package/{capacitorApp-wc75rvfm.js → capacitorApp-yg9b4ajz.js} +2 -2
- package/{cloud.command-vwpzten0.js → cloud.command-1qf95x67.js} +7 -7
- package/commandManifest.json +1 -1
- package/{context.command-j0kq87xa.js → context.command-hhjyjtp7.js} +13 -13
- package/{guideline.command-1m4jwhv0.js → guideline.command-vj956kfr.js} +3 -3
- package/incrementalBuilder.proc.js +1 -1
- package/{index-tnngmzgf.js → index-04as43rp.js} +5 -5
- package/index-0wae5ebk.js +65 -0
- package/{index-xjkjcbhd.js → index-7ppn9v4n.js} +3 -3
- package/{index-mpj63mbw.js → index-acwxfncv.js} +4 -4
- package/{index-en4zpzdm.js → index-d0h48d2f.js} +1 -1
- package/{index-f1x6fe2e.js → index-dgeaqwmw.js} +1 -1
- package/{index-31183bxt.js → index-fbv96xaw.js} +21 -7
- package/{index-t5rn8q9f.js → index-h5cvg9z9.js} +3 -3
- package/{index-0wgpfp7t.js → index-h6eav7zx.js} +7 -7
- package/{index-2nb022xv.js → index-h971erkm.js} +3 -3
- package/{index-ckywhpvp.js → index-pfnh87f9.js} +1 -1
- package/{index-n08vr4hh.js → index-s9s0n5fz.js} +2 -2
- package/{index-xdf6rxyt.js → index-v9jqrdd1.js} +2 -2
- package/{index-ehjhzg5y.js → index-xftstr5s.js} +1 -1
- package/{index-s6nk9815.js → index-xwfg9bam.js} +1 -1
- package/{index-8dsjmcbp.js → index-y1e79mz3.js} +11 -11
- package/{index-31e8cwjq.js → index-z36qzgzp.js} +2 -2
- package/{index-cp26p7qd.js → index-z5v766nx.js} +3 -3
- package/{index-smt4re0s.js → index-zfp1gz9f.js} +1 -1
- package/{index-79v9jwqe.js → index-zn9rh7sh.js} +4 -3
- package/index.js +18 -18
- package/{library.command-39eq3brk.js → library.command-68ah07a3.js} +3 -3
- package/{localRegistry.command-34zvgkys.js → localRegistry.command-84dz000g.js} +8 -8
- package/{module.command-vwahdkzr.js → module.command-t68xhamx.js} +6 -6
- package/{package.command-wkwd5x5p.js → package.command-00ncttab.js} +3 -3
- package/package.json +2 -2
- package/{page.command-9w85hrg0.js → page.command-1096s18n.js} +3 -3
- package/{primitive.command-2hnr8h7f.js → primitive.command-02eqpx6t.js} +7 -7
- package/{quality.command-4kerz7mh.js → quality.command-r9cageqb.js} +30 -5
- package/{repair.command-zmwshmvr.js → repair.command-7dynpnf1.js} +5 -5
- package/{scalar.command-9kanb73t.js → scalar.command-3kxy3fkh.js} +5 -5
- package/templates/workspaceRoot/AGENTS.md.template +8 -1
- package/{workflow.command-4areq0ex.js → workflow.command-yy0d9gk3.js} +10 -10
- package/{workspace.command-02x93b10.js → workspace.command-stv9g4a0.js} +21 -21
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
workflowRunArtifactPath,
|
|
4
4
|
workflowSyncDir
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-pfnh87f9.js";
|
|
6
6
|
import {
|
|
7
7
|
AppExecutor,
|
|
8
8
|
LibExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-xwfg9bam.js";
|
|
10
10
|
import {
|
|
11
11
|
FileSys
|
|
12
12
|
} from "./index-67546d0j.js";
|
|
@@ -2546,7 +2546,7 @@ class AppExecutor extends SysExecutor {
|
|
|
2546
2546
|
return pageKeys;
|
|
2547
2547
|
const isDevOnly = (key) => devOnlyKeys.has(key) || devOnlyDirs.some((dir) => key.startsWith(dir));
|
|
2548
2548
|
const dropped = pageKeys.filter(isDevOnly);
|
|
2549
|
-
this.
|
|
2549
|
+
this.verbose(`[route] excluded ${dropped.length} dev-only route file(s) from the build: ${dropped.join(", ")}`);
|
|
2550
2550
|
return pageKeys.filter((key) => !isDevOnly(key));
|
|
2551
2551
|
}
|
|
2552
2552
|
async getPageRoots() {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
RepairRunner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-7ppn9v4n.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowRunner
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-h971erkm.js";
|
|
8
8
|
import {
|
|
9
9
|
ScalarScript
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-z5v766nx.js";
|
|
11
11
|
import {
|
|
12
12
|
PrimitiveScript
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-acwxfncv.js";
|
|
14
14
|
import {
|
|
15
15
|
ModuleScript
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-04as43rp.js";
|
|
17
17
|
import {
|
|
18
18
|
isPlaceholderAppId
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-zfp1gz9f.js";
|
|
20
20
|
import {
|
|
21
21
|
AkanContextAnalyzer,
|
|
22
22
|
akanMcpInstallConfigPaths,
|
|
@@ -27,17 +27,17 @@ import {
|
|
|
27
27
|
renderDoctorText,
|
|
28
28
|
resourceList,
|
|
29
29
|
upsertCodexMcpServerBlock
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-v9jqrdd1.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-pfnh87f9.js";
|
|
38
38
|
import {
|
|
39
39
|
Prompter
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-xftstr5s.js";
|
|
41
41
|
import {
|
|
42
42
|
getMobileTargets
|
|
43
43
|
} from "./index-76rn3g2c.js";
|
|
@@ -45,10 +45,10 @@ import {
|
|
|
45
45
|
CommandContainer,
|
|
46
46
|
runner,
|
|
47
47
|
script
|
|
48
|
-
} from "./index-
|
|
48
|
+
} from "./index-d0h48d2f.js";
|
|
49
49
|
import {
|
|
50
50
|
AppExecutor
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-xwfg9bam.js";
|
|
52
52
|
|
|
53
53
|
// pkgs/@akanjs/cli/context/context.script.ts
|
|
54
54
|
import { Logger } from "akanjs/common";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-d0h48d2f.js";
|
|
6
6
|
import {
|
|
7
7
|
PkgExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-xwfg9bam.js";
|
|
9
9
|
import {
|
|
10
10
|
TypeScriptDependencyScanner
|
|
11
11
|
} from "./index-46tjzh6s.js";
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
createPassedPrimitiveReport,
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
scalarChangedFiles
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-pfnh87f9.js";
|
|
10
10
|
import {
|
|
11
11
|
Prompter
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-xftstr5s.js";
|
|
13
13
|
import {
|
|
14
14
|
AiSession
|
|
15
15
|
} from "./index-nsj2ftxj.js";
|
|
16
16
|
import {
|
|
17
17
|
runner,
|
|
18
18
|
script
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-d0h48d2f.js";
|
|
20
20
|
|
|
21
21
|
// pkgs/@akanjs/cli/scalar/scalar.prompt.ts
|
|
22
22
|
import { input } from "@inquirer/prompts";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-v9jqrdd1.js";
|
|
5
5
|
import {
|
|
6
6
|
Prompter
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-xftstr5s.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-d0h48d2f.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/agent/agent.script.ts
|
|
14
14
|
import { Logger } from "akanjs/common";
|
|
@@ -79,6 +79,7 @@ ${sampleCleanup}## Akan Module Abstracts
|
|
|
79
79
|
- Update the abstract when business invariants, workflows, or public behavior change.
|
|
80
80
|
- Do not update the abstract for formatting-only, import-only, or style-only changes.
|
|
81
81
|
- Service modules live in \`lib/_<service>\`, but their abstract file is \`<service>.abstract.md\`.
|
|
82
|
+
- Keep an abstract short. Run \`akan compact <app-or-lib>\` to rewrite bloated abstracts down to the invariants the code cannot show; \`akan quality scan\` warns past 300 lines.
|
|
82
83
|
|
|
83
84
|
## Generated Files
|
|
84
85
|
|
package/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
getTargetCommandNames,
|
|
5
5
|
getTargetMetas,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-d0h48d2f.js";
|
|
8
|
+
import"./index-xwfg9bam.js";
|
|
9
9
|
import"./index-67546d0j.js";
|
|
10
10
|
import"./index-6pz1j0zj.js";
|
|
11
11
|
import {
|
|
@@ -17,22 +17,22 @@ import path from "path";
|
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
19
19
|
var commandModules = {
|
|
20
|
-
workspace: async () => (await import("./workspace.command-
|
|
21
|
-
agent: async () => (await import("./agent.command-
|
|
22
|
-
application: async () => (await import("./application.command-
|
|
23
|
-
library: async () => (await import("./library.command-
|
|
24
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
25
|
-
package: async () => (await import("./package.command-
|
|
26
|
-
module: async () => (await import("./module.command-
|
|
27
|
-
page: async () => (await import("./page.command-
|
|
28
|
-
context: async () => (await import("./context.command-
|
|
29
|
-
cloud: async () => (await import("./cloud.command-
|
|
30
|
-
guideline: async () => (await import("./guideline.command-
|
|
31
|
-
scalar: async () => (await import("./scalar.command-
|
|
32
|
-
primitive: async () => (await import("./primitive.command-
|
|
33
|
-
quality: async () => (await import("./quality.command-
|
|
34
|
-
repair: async () => (await import("./repair.command-
|
|
35
|
-
workflow: async () => (await import("./workflow.command-
|
|
20
|
+
workspace: async () => (await import("./workspace.command-stv9g4a0.js")).WorkspaceCommand,
|
|
21
|
+
agent: async () => (await import("./agent.command-de4r6vk8.js")).AgentCommand,
|
|
22
|
+
application: async () => (await import("./application.command-nfsfm96y.js")).ApplicationCommand,
|
|
23
|
+
library: async () => (await import("./library.command-68ah07a3.js")).LibraryCommand,
|
|
24
|
+
localRegistry: async () => (await import("./localRegistry.command-84dz000g.js")).LocalRegistryCommand,
|
|
25
|
+
package: async () => (await import("./package.command-00ncttab.js")).PackageCommand,
|
|
26
|
+
module: async () => (await import("./module.command-t68xhamx.js")).ModuleCommand,
|
|
27
|
+
page: async () => (await import("./page.command-1096s18n.js")).PageCommand,
|
|
28
|
+
context: async () => (await import("./context.command-hhjyjtp7.js")).ContextCommand,
|
|
29
|
+
cloud: async () => (await import("./cloud.command-1qf95x67.js")).CloudCommand,
|
|
30
|
+
guideline: async () => (await import("./guideline.command-vj956kfr.js")).GuidelineCommand,
|
|
31
|
+
scalar: async () => (await import("./scalar.command-3kxy3fkh.js")).ScalarCommand,
|
|
32
|
+
primitive: async () => (await import("./primitive.command-02eqpx6t.js")).PrimitiveCommand,
|
|
33
|
+
quality: async () => (await import("./quality.command-r9cageqb.js")).QualityCommand,
|
|
34
|
+
repair: async () => (await import("./repair.command-7dynpnf1.js")).RepairCommand,
|
|
35
|
+
workflow: async () => (await import("./workflow.command-yy0d9gk3.js")).WorkflowCommand
|
|
36
36
|
};
|
|
37
37
|
var commandModuleIds = Object.keys(commandModules);
|
|
38
38
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LibraryScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-s9s0n5fz.js";
|
|
5
5
|
import {
|
|
6
6
|
Lib,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-d0h48d2f.js";
|
|
10
|
+
import"./index-xwfg9bam.js";
|
|
11
11
|
import"./index-67546d0j.js";
|
|
12
12
|
import"./index-6pz1j0zj.js";
|
|
13
13
|
import"./index-r24hmh0q.js";
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner,
|
|
4
4
|
getNpmRegistryUrl
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-h5cvg9z9.js";
|
|
6
|
+
import {
|
|
7
|
+
PackageScript
|
|
8
|
+
} from "./index-z36qzgzp.js";
|
|
6
9
|
import"./index-nsj2ftxj.js";
|
|
7
10
|
import {
|
|
8
11
|
ApplicationScript
|
|
9
|
-
} from "./index-
|
|
12
|
+
} from "./index-fbv96xaw.js";
|
|
10
13
|
import"./index-76rn3g2c.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import {
|
|
13
|
-
PackageScript
|
|
14
|
-
} from "./index-31e8cwjq.js";
|
|
14
|
+
import"./index-s9s0n5fz.js";
|
|
15
15
|
import {
|
|
16
16
|
Workspace,
|
|
17
17
|
command,
|
|
18
18
|
runner,
|
|
19
19
|
script
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-d0h48d2f.js";
|
|
21
21
|
import"./index-fgc8r6dj.js";
|
|
22
22
|
import {
|
|
23
23
|
PkgExecutor
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-xwfg9bam.js";
|
|
25
25
|
import"./index-46tjzh6s.js";
|
|
26
26
|
import"./index-67546d0j.js";
|
|
27
27
|
import"./index-bjpxzr6s.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-04as43rp.js";
|
|
5
|
+
import"./index-dgeaqwmw.js";
|
|
6
6
|
import"./index-ss469dec.js";
|
|
7
7
|
import {
|
|
8
8
|
renderPrimitiveReport
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-pfnh87f9.js";
|
|
10
|
+
import"./index-xftstr5s.js";
|
|
11
11
|
import"./index-nsj2ftxj.js";
|
|
12
12
|
import {
|
|
13
13
|
Module,
|
|
14
14
|
Sys,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-d0h48d2f.js";
|
|
17
|
+
import"./index-xwfg9bam.js";
|
|
18
18
|
import"./index-67546d0j.js";
|
|
19
19
|
import"./index-6pz1j0zj.js";
|
|
20
20
|
import"./index-r24hmh0q.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PackageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-z36qzgzp.js";
|
|
5
5
|
import {
|
|
6
6
|
Pkg,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-d0h48d2f.js";
|
|
10
|
+
import"./index-xwfg9bam.js";
|
|
11
11
|
import"./index-46tjzh6s.js";
|
|
12
12
|
import"./index-67546d0j.js";
|
|
13
13
|
import"./index-6pz1j0zj.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.4.2-rc.
|
|
3
|
+
"version": "2.4.2-rc.3",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/openai": "^1.4.6",
|
|
35
35
|
"@tailwindcss/node": "^4.3.0",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "2.4.2-rc.
|
|
37
|
+
"akanjs": "2.4.2-rc.3",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"daisyui": "5.5.23",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-dgeaqwmw.js";
|
|
5
5
|
import {
|
|
6
6
|
App,
|
|
7
7
|
Module,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-d0h48d2f.js";
|
|
10
|
+
import"./index-xwfg9bam.js";
|
|
11
11
|
import"./index-67546d0j.js";
|
|
12
12
|
import"./index-6pz1j0zj.js";
|
|
13
13
|
import"./index-r24hmh0q.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PrimitiveScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-acwxfncv.js";
|
|
5
|
+
import"./index-04as43rp.js";
|
|
6
|
+
import"./index-dgeaqwmw.js";
|
|
7
7
|
import"./index-ss469dec.js";
|
|
8
8
|
import {
|
|
9
9
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-pfnh87f9.js";
|
|
11
|
+
import"./index-xftstr5s.js";
|
|
12
12
|
import"./index-nsj2ftxj.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-d0h48d2f.js";
|
|
17
|
+
import"./index-xwfg9bam.js";
|
|
18
18
|
import"./index-67546d0j.js";
|
|
19
19
|
import"./index-6pz1j0zj.js";
|
|
20
20
|
import"./index-r24hmh0q.js";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
AbstractDoc
|
|
4
|
+
} from "./index-0wae5ebk.js";
|
|
2
5
|
import {
|
|
3
6
|
Workspace,
|
|
4
7
|
command,
|
|
5
8
|
runner,
|
|
6
9
|
script
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
10
|
+
} from "./index-d0h48d2f.js";
|
|
11
|
+
import"./index-xwfg9bam.js";
|
|
9
12
|
import"./index-67546d0j.js";
|
|
10
13
|
import"./index-6pz1j0zj.js";
|
|
11
14
|
import"./index-r24hmh0q.js";
|
|
@@ -87,6 +90,7 @@ var RULE_FIXES = {
|
|
|
87
90
|
"akan.global.duplicate-exported-function-body": "Extract the shared implementation into a single exported helper and import it, instead of copying the body.",
|
|
88
91
|
"akan.file.recommended-max-lines": "Split the file by responsibility \u2014 move Zones, Utils, or subcomponents into sibling files.",
|
|
89
92
|
"akan.file.max-lines": "Break the file into smaller focused modules; keep one primary responsibility per file.",
|
|
93
|
+
"akan.file.abstract-max-lines": "Run `akan compact <app-or-lib>` to rewrite the abstract with the AI editor, keeping only the invariants and workflows the source files cannot show.",
|
|
90
94
|
"akan.file.placeholder-export": "Remove the placeholder export; generated indexes should only re-export real modules.",
|
|
91
95
|
"akan.file.dictionary-stale-text": "Replace the scaffold text with real localized copy for this dictionary entry.",
|
|
92
96
|
"akan.file.global-declaration": "Move the global declaration into an approved low-level integration file (e.g. webkit) and keep it isolated.",
|
|
@@ -108,17 +112,19 @@ function getRuleFix(rule) {
|
|
|
108
112
|
class AkanQualityScanner {
|
|
109
113
|
async scan(workspaceRoot) {
|
|
110
114
|
const targetFiles = await this.#collectTargetFiles(workspaceRoot);
|
|
111
|
-
const sourceFiles = await Promise.all(targetFiles.map((file) => this.#readSourceFile(workspaceRoot, file)));
|
|
115
|
+
const sourceFiles = await Promise.all(targetFiles.filter((file) => !AbstractDoc.isAbstractPath(file)).map((file) => this.#readSourceFile(workspaceRoot, file)));
|
|
116
|
+
const abstractFiles = await Promise.all(targetFiles.filter((file) => AbstractDoc.isAbstractPath(file)).map((file) => this.#readTextFile(workspaceRoot, file)));
|
|
112
117
|
const warnings = [
|
|
113
118
|
...this.#scanGlobalQuality(sourceFiles),
|
|
114
119
|
...sourceFiles.flatMap((sourceFile) => this.#scanSingleFileQuality(sourceFile)),
|
|
115
120
|
...sourceFiles.flatMap((sourceFile) => this.#scanComponentQuality(sourceFile)),
|
|
116
121
|
...sourceFiles.flatMap((sourceFile) => this.#scanConventionQuality(sourceFile)),
|
|
117
|
-
...sourceFiles.flatMap((sourceFile) => this.#scanLayoutQuality(sourceFile))
|
|
122
|
+
...sourceFiles.flatMap((sourceFile) => this.#scanLayoutQuality(sourceFile)),
|
|
123
|
+
...abstractFiles.flatMap((abstractFile) => this.#scanAbstractQuality(abstractFile))
|
|
118
124
|
];
|
|
119
125
|
return {
|
|
120
126
|
workspaceRoot,
|
|
121
|
-
scannedFiles: sourceFiles.length,
|
|
127
|
+
scannedFiles: sourceFiles.length + abstractFiles.length,
|
|
122
128
|
warnings: warnings.map((warning) => ({ ...warning, fix: warning.fix ?? getRuleFix(warning.rule) })).sort(compareWarnings),
|
|
123
129
|
suggestedRules: SUGGESTED_RULES
|
|
124
130
|
};
|
|
@@ -153,6 +159,8 @@ class AkanQualityScanner {
|
|
|
153
159
|
}
|
|
154
160
|
if ((relativePath.endsWith(".ts") || relativePath.endsWith(".tsx")) && !relativePath.endsWith(".d.ts")) {
|
|
155
161
|
files.push(relativePath);
|
|
162
|
+
} else if (AbstractDoc.isAbstractPath(relativePath)) {
|
|
163
|
+
files.push(relativePath);
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
166
|
}
|
|
@@ -166,6 +174,9 @@ class AkanQualityScanner {
|
|
|
166
174
|
sourceFile: ts.createSourceFile(file, content, ts.ScriptTarget.Latest, true, getScriptKind(file))
|
|
167
175
|
};
|
|
168
176
|
}
|
|
177
|
+
async#readTextFile(workspaceRoot, file) {
|
|
178
|
+
return { file, content: await readFile(path.join(workspaceRoot, file), "utf8") };
|
|
179
|
+
}
|
|
169
180
|
#scanGlobalQuality(sourceFiles) {
|
|
170
181
|
const exportedFunctionLikes = sourceFiles.flatMap((sourceFile) => getExportedFunctionLikes(sourceFile));
|
|
171
182
|
const warnings = [];
|
|
@@ -304,6 +315,20 @@ class AkanQualityScanner {
|
|
|
304
315
|
}
|
|
305
316
|
return warnings;
|
|
306
317
|
}
|
|
318
|
+
#scanAbstractQuality({ file, content }) {
|
|
319
|
+
const lineCount = AbstractDoc.lineCountOf(content);
|
|
320
|
+
if (lineCount <= AbstractDoc.maxLines)
|
|
321
|
+
return [];
|
|
322
|
+
return [
|
|
323
|
+
{
|
|
324
|
+
rule: "akan.file.abstract-max-lines",
|
|
325
|
+
scope: "file",
|
|
326
|
+
severity: "warning",
|
|
327
|
+
file,
|
|
328
|
+
message: `Abstract has ${lineCount} lines. Keep abstracts under ${AbstractDoc.maxLines} lines and compact them periodically.`
|
|
329
|
+
}
|
|
330
|
+
];
|
|
331
|
+
}
|
|
307
332
|
#scanLayoutQuality(sourceFile) {
|
|
308
333
|
const segments = sourceFile.file.split("/");
|
|
309
334
|
const warnings = [];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
RepairRunner
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-7ppn9v4n.js";
|
|
5
|
+
import"./index-v9jqrdd1.js";
|
|
6
|
+
import"./index-pfnh87f9.js";
|
|
7
7
|
import {
|
|
8
8
|
Workspace,
|
|
9
9
|
command,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-d0h48d2f.js";
|
|
12
|
+
import"./index-xwfg9bam.js";
|
|
13
13
|
import"./index-67546d0j.js";
|
|
14
14
|
import"./index-6pz1j0zj.js";
|
|
15
15
|
import"./index-r24hmh0q.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ScalarScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-z5v766nx.js";
|
|
5
5
|
import"./index-ss469dec.js";
|
|
6
6
|
import {
|
|
7
7
|
renderPrimitiveReport
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-pfnh87f9.js";
|
|
9
|
+
import"./index-xftstr5s.js";
|
|
10
10
|
import"./index-nsj2ftxj.js";
|
|
11
11
|
import {
|
|
12
12
|
Sys,
|
|
13
13
|
command
|
|
14
|
-
} from "./index-
|
|
15
|
-
import"./index-
|
|
14
|
+
} from "./index-d0h48d2f.js";
|
|
15
|
+
import"./index-xwfg9bam.js";
|
|
16
16
|
import"./index-67546d0j.js";
|
|
17
17
|
import"./index-6pz1j0zj.js";
|
|
18
18
|
import"./index-r24hmh0q.js";
|
|
@@ -531,7 +531,8 @@ export class TaskService extends serve(db.task, ({ plug }) => ({
|
|
|
531
531
|
For a custom adapter class (not a predefined role), pass the class itself, e.g. `ipfsApi: plug(IpfsApi)`
|
|
532
532
|
(see `libs/shared/lib/file/file.service.ts`). Injecting a file/image field is usually simpler than calling
|
|
533
533
|
storage directly: declare `image: field(File).optional()` (or `images: field([File])`) on the model and let the
|
|
534
|
-
store's generated `upload<Field>On<Model>(fileList)` action handle the upload.
|
|
534
|
+
store's generated `upload<Field>On<Model>(fileList)` action handle the upload. Add `{ cascade: "remove" }` to that
|
|
535
|
+
field when the file belongs to the model alone, and removing the model removes the file and its stored object.
|
|
535
536
|
|
|
536
537
|
---
|
|
537
538
|
|
|
@@ -748,6 +749,12 @@ A short list of things the type system does not always catch:
|
|
|
748
749
|
`secret` / `hidden` / `resolve()` fields with `text` throw at class-build time — the mirror is plaintext. Search
|
|
749
750
|
runs on sqlite/libsql only; `q.search()` against Postgres throws. `thumb` is mirrored for rendering and is not
|
|
750
751
|
indexed.
|
|
752
|
+
- **`cascade: "remove"` takes a relation's target down with its owner.** Declare it on the relation itself —
|
|
753
|
+
`image: field(File, { cascade: "remove" })`, arrays included. The removal runs through the **target's service**,
|
|
754
|
+
so the target's own `_postRemove` runs too; that is how removing a model also deletes the file's stored object.
|
|
755
|
+
Only a relation accepts it: a `String`, an `ID`, or a scalar throws while the class is being built. Nothing
|
|
756
|
+
checks for other references to the same target, so declaring it asserts exclusive ownership. Document removal is
|
|
757
|
+
soft but the storage delete is not, and query-level removal fires no hooks and therefore no cascade.
|
|
751
758
|
- **`q.search()` is a filter node, not a slice requirement.** Prefer
|
|
752
759
|
`bySearch: filter().arg("text", String).query((text, q) => q.search(text, { prefix: true }))` — the generated
|
|
753
760
|
`listBySearch` / `countBySearch` / `queryBySearch` / `insightBySearch` come for free. Only add a search slice when
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
WorkflowRunner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-h971erkm.js";
|
|
5
5
|
import {
|
|
6
6
|
ScalarScript
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-z5v766nx.js";
|
|
8
8
|
import {
|
|
9
9
|
PrimitiveScript
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-acwxfncv.js";
|
|
11
11
|
import {
|
|
12
12
|
ModuleScript
|
|
13
|
-
} from "./index-
|
|
14
|
-
import"./index-
|
|
13
|
+
} from "./index-04as43rp.js";
|
|
14
|
+
import"./index-dgeaqwmw.js";
|
|
15
15
|
import"./index-ss469dec.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-v9jqrdd1.js";
|
|
17
17
|
import {
|
|
18
18
|
createWorkflowStepRegistry
|
|
19
|
-
} from "./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
} from "./index-pfnh87f9.js";
|
|
20
|
+
import"./index-xftstr5s.js";
|
|
21
21
|
import"./index-nsj2ftxj.js";
|
|
22
22
|
import {
|
|
23
23
|
Workspace,
|
|
24
24
|
command,
|
|
25
25
|
script
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
} from "./index-d0h48d2f.js";
|
|
27
|
+
import"./index-xwfg9bam.js";
|
|
28
28
|
import"./index-67546d0j.js";
|
|
29
29
|
import"./index-6pz1j0zj.js";
|
|
30
30
|
import"./index-r24hmh0q.js";
|