@akanjs/cli 3.0.0-alpha.9 → 3.0.0-alpha.91
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/README.ko.md +1 -1
- package/README.md +1 -1
- package/{abstractCompactor-e5yq60qz.js → abstractCompactor-cefxzggj.js} +3 -5
- package/{agent.command-f0gqkfgz.js → agent.command-r93wmq7m.js} +11 -13
- package/{application.command-x903m2qq.js → application.command-5nqfqgdn.js} +62 -38
- package/{applicationBuildRunner-ha3y8ew8.js → applicationBuildRunner-b21m07fs.js} +23 -20
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-3wh58n2m.js} +8 -9
- package/buildBatch.proc.js +12 -14
- package/capacitorApp-gzcx6txb.js +12 -0
- package/{cloud.command-zs6kyf83.js → cloud.command-g0pk0k60.js} +15 -18
- package/commandManifest.json +1 -1
- package/{context.command-fmepgjzg.js → context.command-qd8kqrnh.js} +19 -23
- package/dependencyScanner-shs82ynp.js +8 -0
- package/devTui-2xf0meaq.js +552 -0
- package/devTuiView-7jy8f30g.js +9 -0
- package/getDirname-dr3jz1xg.js +7 -0
- package/{guideline.command-n6sw0a0c.js → guideline.command-f38x8jhw.js} +16 -18
- package/guidelines/agentRule/agentRule.generate.json +31 -0
- package/guidelines/agentRule/agentRule.instruction.md +533 -0
- package/guidelines/conventions/conventions.instruction.md +406 -197
- package/guidelines/cssRule/cssRule.instruction.md +7 -0
- package/guidelines/framework/framework.generate.json +3 -2
- package/guidelines/framework/framework.instruction.md +1 -9
- package/guidelines/mcpRule/mcpRule.generate.json +25 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +217 -0
- package/guidelines/modelStore/modelStore.instruction.md +12 -0
- package/guidelines/modelTemplate/modelTemplate.instruction.md +5 -0
- package/guidelines/queryRule/queryRule.generate.json +31 -0
- package/guidelines/queryRule/queryRule.instruction.md +143 -0
- package/guidelines/runtimeRule/runtimeRule.generate.json +25 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +213 -0
- package/guidelines/ssrRule/ssrRule.instruction.md +49 -5
- package/guidelines/transportRule/transportRule.generate.json +31 -0
- package/guidelines/transportRule/transportRule.instruction.md +60 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +51 -760
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +33 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +402 -0
- package/incrementalBuilder.proc.js +26 -25
- package/{index-774gcx29.js → index-0emb9eat.js} +41 -34
- package/index-3d9y066c.js +76 -0
- package/{index-3vta1tqa.js → index-3vvbv974.js} +32 -32
- package/{index-76rn3g2c.js → index-47pj3aee.js} +4 -4
- package/{index-y4vkyhvv.js → index-5xdqxbn9.js} +14 -14
- package/{index-1577bej2.js → index-6wwzs1bc.js} +2 -2
- package/{index-wnp7hwq7.js → index-92zztqy1.js} +7 -7
- package/{index-jhpa13zj.js → index-9bwhxrqf.js} +57 -57
- package/{index-bjpxzr6s.js → index-9wtbw98m.js} +6 -3
- package/{index-fgc8r6dj.js → index-a5vmm6x4.js} +3 -1
- package/{index-xys926f2.js → index-by5gpp8x.js} +4 -4
- package/{index-kdh76j26.js → index-cezy7yb3.js} +100 -32
- package/{index-62955kn5.js → index-d61rcfa2.js} +758 -127
- package/{index-82jrh4hj.js → index-deekbtkj.js} +13 -13
- package/{index-rxkpk7n4.js → index-e82dyeqy.js} +4 -4
- package/{index-qzdjd4ct.js → index-h759vjfa.js} +18 -18
- package/{index-j37qq1f2.js → index-h7yw2z9n.js} +7 -7
- package/{index-qb61h0k7.js → index-jydtyzva.js} +1098 -1360
- package/{index-46tjzh6s.js → index-kcxmv48c.js} +29 -29
- package/{index-4m0bphac.js → index-kfnr6c19.js} +31 -30
- package/{index-xmmzf150.js → index-mpmyqm1y.js} +1 -1
- package/{index-xjd3rqzj.js → index-n68jx79w.js} +6 -15
- package/{index-0cj2zxbm.js → index-n85fer99.js} +12 -11
- package/{index-779ske1y.js → index-pgsswppj.js} +27 -27
- package/index-pvb4vdwr.js +159 -0
- package/{index-67546d0j.js → index-q0y2jq9j.js} +14 -2
- package/{index-z8ptfkzv.js → index-q8sn827n.js} +969 -240
- package/{index-5sn5w2mt.js → index-r50qen0z.js} +94 -61
- package/{index-eyyf2149.js → index-rntcdss1.js} +36 -37
- package/{index-gcv8ncfh.js → index-sjak5v5b.js} +16 -12
- package/{index-j9cxndc0.js → index-w8kmx1b6.js} +20 -11
- package/{index-jf2ya7r2.js → index-y74k5anj.js} +8 -8
- package/{index-d43t8af2.js → index-zkvpaggp.js} +58 -25
- package/index.js +22 -25
- package/{library.command-cv9gdbmg.js → library.command-em103wtn.js} +11 -10
- package/{localRegistry.command-d8fg36zc.js → localRegistry.command-gz8apn4y.js} +20 -23
- package/{module.command-qyr1s9cn.js → module.command-451pztkc.js} +13 -16
- package/{package.command-wsjx0k47.js → package.command-rfhyf38t.js} +8 -10
- package/package.json +5 -7
- package/{page.command-rdzg65rm.js → page.command-kt19da5g.js} +7 -9
- package/{primitive.command-89g38b53.js → primitive.command-pgy69ere.js} +13 -16
- package/{quality.command-0cs2z92d.js → quality.command-gpe2vqb5.js} +226 -105
- package/recipeScanner-fpagtgc1.js +11 -0
- package/{repair.command-6fphxfwj.js → repair.command-2sbrz187.js} +12 -14
- package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-ze6x894c.js} +0 -2
- package/{scalar.command-xfer69s6.js → scalar.command-jcf4e5sv.js} +11 -14
- package/subspace.command-kqzqtk0p.js +755 -0
- package/templates/app/env/env.client.debug.ts.template +1 -5
- package/templates/app/env/env.client.develop.ts.template +1 -5
- package/templates/app/env/env.client.local.ts.template +1 -5
- package/templates/app/env/env.client.main.ts.template +1 -5
- package/templates/app/env/env.client.testing.ts.template +1 -5
- package/templates/app/env/env.client.type.ts +2 -6
- package/templates/app/env/env.server.debug.ts.template +1 -5
- package/templates/app/env/env.server.develop.ts.template +1 -5
- package/templates/app/env/env.server.local.ts.template +1 -5
- package/templates/app/env/env.server.main.ts.template +1 -5
- package/templates/app/main.ts +3 -1
- package/templates/appSample/lib/task/task.signal.ts +11 -6
- package/templates/appSample/srvkit/AuthGuard.ts +9 -5
- package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +5 -5
- package/templates/crudPages/[__model__Id]/page.tsx +10 -13
- package/templates/crudPages/new/page.tsx +5 -5
- package/templates/crudPages/page.tsx +9 -9
- package/templates/crudSinglePage/page.tsx +11 -7
- package/templates/env/_env.server.type.ts +7 -5
- package/templates/lib/db.ts +1 -1
- package/templates/lib/dict.ts +1 -1
- package/templates/lib/sig.ts +1 -1
- package/templates/lib/srv.ts +6 -2
- package/templates/module/__model__.dictionary.ts +4 -1
- package/templates/module/__model__.signal.ts +2 -3
- package/templates/module/__model__.store.ts +1 -2
- package/templates/workspaceRoot/.gitignore.template +0 -1
- package/templates/workspaceRoot/.husky/pre-commit.template +16 -0
- package/templates/workspaceRoot/.vscode/settings.json.template +1 -1
- package/templates/workspaceRoot/AGENTS.md.template +4 -0
- package/templates/workspaceRoot/CLAUDE.md.template +19 -0
- package/templates/workspaceRoot/biome.json.template +2 -1
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
- package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
- package/templates/workspaceRoot/package.json.template +2 -4
- package/typeChecker-3xgrzc2v.js +7 -0
- package/typecheck.proc.js +4 -5
- package/{workflow.command-2ygfqt4f.js → workflow.command-m4z25a2p.js} +22 -25
- package/{workspace.command-88m0zs64.js → workspace.command-dqgj9zbk.js} +96 -81
- package/capacitorApp-9xswcgx7.js +0 -61
- package/dependencyScanner-f6grrep3.js +0 -9
- package/getDirname-m9s0cmhq.js +0 -8
- package/index-mxvakhsm.js +0 -66
- package/index-r24hmh0q.js +0 -4
- package/recipeScanner-tghkzrrt.js +0 -12
- package/typeChecker-kravn7ns.js +0 -8
- /package/{index-0wae5ebk.js → index-meh558jy.js} +0 -0
- /package/{index-ss469dec.js → index-nz8prx9g.js} +0 -0
|
@@ -47,25 +47,21 @@ See `docs/GENERATED.md` for the generated file list.
|
|
|
47
47
|
|
|
48
48
|
## House Style
|
|
49
49
|
|
|
50
|
-
`AGENTS.md` holds the full style guide. The rules
|
|
50
|
+
`AGENTS.md` holds the full style guide, and `akan lint` enforces most of it. The four rules that surprise people,
|
|
51
|
+
because the failure is silent rather than an error:
|
|
51
52
|
|
|
52
53
|
- **Never hand-order Tailwind classes** — the linter sorts them, including inside `cn()`, and its output looks
|
|
53
|
-
unnatural on purpose.
|
|
54
|
+
unnatural on purpose. Do not reorder it back.
|
|
54
55
|
- **Never use a colour outside the semantic vocabulary** — `bg-red-500`, `bg-[#3b82f6]` and `text-base-content`
|
|
55
56
|
compile to no CSS at all, so the element renders unstyled with no error. Use `bg-primary`, `text-foreground/70`
|
|
56
57
|
and the other tokens defined in `page/*/styles.css`.
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
`className?: string` first. No `React.FC`, no non-null assertions, no `as any`.
|
|
65
|
-
- `cond ? <X/> : null`, never `{cond && <X/>}` — the latter renders the string `"false"` in a className context.
|
|
66
|
-
- Put display and predicate logic on the `Light<Model>` constant class; keep document chain methods
|
|
67
|
-
validate → mutate → `return this` without `save()`; keep services to load → chain → save.
|
|
68
|
-
- Do not narrate code in comments. Do document vendor quirks, infrastructure constraints, and security reasoning.
|
|
58
|
+
- **`cond ? <X/> : null`, never `{cond && <X/>}`** — the latter renders the string `"false"` in a className context.
|
|
59
|
+
- **Never wrap a form setter in a pass-through arrow** — `onChange={st.do.setXOnY}` publishes the field to agents
|
|
60
|
+
and E2E selectors; `onChange={(v) => st.do.setXOnY(v)}` runs identically and publishes nothing.
|
|
61
|
+
|
|
62
|
+
Two more that are hard errors: **never `throw new Error`** (throw `new Err("<module>.error.<key>")` with an
|
|
63
|
+
`[en, ko]` dictionary entry), and **never import a third-party package** from a page, a barrel, or a module file —
|
|
64
|
+
re-export it through a one-line shim in the lib's `common/`, `webkit/`, or `ui/` first.
|
|
69
65
|
|
|
70
66
|
## Abstract Documents
|
|
71
67
|
|
|
@@ -9,20 +9,21 @@ sync or build can overwrite local changes.
|
|
|
9
9
|
| --- | --- |
|
|
10
10
|
| `apps/*/client.ts` | App-wide client entrypoint for generated fetch, store, and client runtime exports. |
|
|
11
11
|
| `apps/*/server.ts` | App-wide server entrypoint for generated server, service, signal, database, and dictionary exports. |
|
|
12
|
+
| `libs/*/client.ts`, `libs/*/server.ts`, `libs/*/index.ts` | The same entrypoints for a library. |
|
|
12
13
|
|
|
13
|
-
##
|
|
14
|
+
## Module Barrels (apps and libs alike)
|
|
14
15
|
|
|
15
16
|
| File | Purpose |
|
|
16
17
|
| --- | --- |
|
|
17
|
-
| `apps/*/lib/cnst.ts` | Re-exports constants and model shapes from module `*.constant.ts` files. |
|
|
18
|
-
| `apps/*/lib/db.ts` | Re-exports database models from module `*.document.ts` files. |
|
|
19
|
-
| `apps/*/lib/dict.ts` | Re-exports dictionaries from module `*.dictionary.ts` files. |
|
|
20
|
-
| `apps/*/lib/srv.ts` | Re-exports services from module `*.service.ts` files. |
|
|
21
|
-
| `apps/*/lib/sig.ts` | Re-exports endpoints, slices, and internals from module `*.signal.ts` files. |
|
|
22
|
-
| `apps/*/lib/st.ts` | Re-exports stores from module `*.store.ts` files. |
|
|
23
|
-
| `apps/*/lib/useClient.ts` | Client-safe generated imports for fetch, message, signal, and store usage. |
|
|
24
|
-
| `apps/*/lib/useServer.ts` | Server-safe generated imports for service, database, signal, and dictionary usage. |
|
|
25
|
-
| `apps/*/lib/**/index.ts` | Per-module generated barrel files. |
|
|
18
|
+
| `{apps,libs}/*/lib/cnst.ts` | Re-exports constants and model shapes from module `*.constant.ts` files. |
|
|
19
|
+
| `{apps,libs}/*/lib/db.ts` | Re-exports database models from module `*.document.ts` files. |
|
|
20
|
+
| `{apps,libs}/*/lib/dict.ts` | Re-exports dictionaries from module `*.dictionary.ts` files. |
|
|
21
|
+
| `{apps,libs}/*/lib/srv.ts` | Re-exports services from module `*.service.ts` files. |
|
|
22
|
+
| `{apps,libs}/*/lib/sig.ts` | Re-exports endpoints, slices, and internals from module `*.signal.ts` files. |
|
|
23
|
+
| `{apps,libs}/*/lib/st.ts` | Re-exports stores from module `*.store.ts` files. |
|
|
24
|
+
| `{apps,libs}/*/lib/useClient.ts` | Client-safe generated imports for fetch, message, signal, and store usage. |
|
|
25
|
+
| `{apps,libs}/*/lib/useServer.ts` | Server-safe generated imports for service, database, signal, and dictionary usage. |
|
|
26
|
+
| `{apps,libs}/*/lib/**/index.ts` | Per-module generated barrel files. |
|
|
26
27
|
|
|
27
28
|
## Shared Surface Barrels
|
|
28
29
|
|
|
@@ -32,6 +33,7 @@ sync or build can overwrite local changes.
|
|
|
32
33
|
| `*/webkit/index.ts` | Re-exports webkit/browser helper files. |
|
|
33
34
|
| `*/srvkit/index.ts` | Re-exports server-kit helper files. |
|
|
34
35
|
| `*/common/index.ts` | Re-exports common helper files. |
|
|
36
|
+
| `*/plugin/index.ts` | Re-exports `<name>.plugin.ts` declarations. |
|
|
35
37
|
|
|
36
38
|
## How To Change Generated Output
|
|
37
39
|
|
|
@@ -31,8 +31,6 @@
|
|
|
31
31
|
"dependencies": {},
|
|
32
32
|
"devDependencies": {},
|
|
33
33
|
"patchedDependencies": {
|
|
34
|
-
"react-dom@19.2.7": "patches/react-dom@19.2.7.patch"
|
|
35
|
-
"zod@3.25.76": "patches/zod@3.25.76.patch",
|
|
36
|
-
"zod@4.4.3": "patches/zod@4.4.3.patch"
|
|
34
|
+
"react-dom@19.2.7": "patches/react-dom@19.2.7.patch"
|
|
37
35
|
}
|
|
38
|
-
}
|
|
36
|
+
}
|
package/typecheck.proc.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-r24hmh0q.js";
|
|
3
|
+
TypeChecker2
|
|
4
|
+
} from "./index-92zztqy1.js";
|
|
6
5
|
|
|
7
6
|
// pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
|
|
8
7
|
import { Logger } from "akanjs/common";
|
|
@@ -12,7 +11,7 @@ try {
|
|
|
12
11
|
const cwdPath = process.env.AKAN_TYPECHECK_CWD;
|
|
13
12
|
if (!cwdPath)
|
|
14
13
|
throw new Error("AKAN_TYPECHECK_CWD is required");
|
|
15
|
-
const typeChecker = new
|
|
14
|
+
const typeChecker = new TypeChecker2({ cwdPath });
|
|
16
15
|
const { fileDiagnostics, fileErrors, fileWarnings } = typeChecker.check(filePath);
|
|
17
16
|
const message = typeChecker.formatDiagnostics(fileDiagnostics);
|
|
18
17
|
Logger.rawLog(JSON.stringify({
|
|
@@ -26,7 +25,7 @@ try {
|
|
|
26
25
|
const configPath = process.env.AKAN_TYPECHECK_TSCONFIG;
|
|
27
26
|
if (!configPath)
|
|
28
27
|
throw new Error("AKAN_TYPECHECK_TSCONFIG is required");
|
|
29
|
-
const result =
|
|
28
|
+
const result = TypeChecker2.checkProject(configPath);
|
|
30
29
|
if (result.errors.length > 0) {
|
|
31
30
|
console.error(result.message);
|
|
32
31
|
process.exit(1);
|
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Workspace,
|
|
4
|
+
script,
|
|
5
|
+
command
|
|
6
|
+
} from "./index-cezy7yb3.js";
|
|
7
|
+
import"./index-q0y2jq9j.js";
|
|
8
|
+
import"./index-q8sn827n.js";
|
|
9
|
+
import"./index-6wwzs1bc.js";
|
|
8
10
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./index-
|
|
11
|
+
createWorkflowStepRegistry
|
|
12
|
+
} from "./index-e82dyeqy.js";
|
|
13
|
+
import"./index-n85fer99.js";
|
|
11
14
|
import {
|
|
12
15
|
ModuleScript
|
|
13
|
-
} from "./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-0cj2zxbm.js";
|
|
17
|
-
import"./index-774gcx29.js";
|
|
16
|
+
} from "./index-9bwhxrqf.js";
|
|
17
|
+
import"./index-mpmyqm1y.js";
|
|
18
|
+
import"./index-h7yw2z9n.js";
|
|
18
19
|
import {
|
|
19
|
-
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-j37qq1f2.js";
|
|
20
|
+
PrimitiveScript
|
|
21
|
+
} from "./index-3vvbv974.js";
|
|
22
22
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
import"./index-1577bej2.js";
|
|
31
|
-
import"./index-67546d0j.js";
|
|
32
|
-
import"./index-r24hmh0q.js";
|
|
23
|
+
ScalarScript
|
|
24
|
+
} from "./index-5xdqxbn9.js";
|
|
25
|
+
import"./index-by5gpp8x.js";
|
|
26
|
+
import"./index-0emb9eat.js";
|
|
27
|
+
import {
|
|
28
|
+
WorkflowRunner
|
|
29
|
+
} from "./index-h759vjfa.js";
|
|
33
30
|
|
|
34
31
|
// pkgs/@akanjs/cli/workflow/workflow.script.ts
|
|
35
32
|
import { Logger } from "akanjs/common";
|
|
@@ -1,93 +1,84 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-jf2ya7r2.js";
|
|
6
|
-
import"./index-qzdjd4ct.js";
|
|
7
|
-
import"./index-y4vkyhvv.js";
|
|
8
|
-
import"./index-3vta1tqa.js";
|
|
9
|
-
import"./index-jhpa13zj.js";
|
|
10
|
-
import"./index-ss469dec.js";
|
|
11
|
-
import"./index-xmmzf150.js";
|
|
3
|
+
FileSys
|
|
4
|
+
} from "./index-q0y2jq9j.js";
|
|
12
5
|
import {
|
|
13
|
-
|
|
14
|
-
} from "./index-
|
|
6
|
+
GlobalConfig
|
|
7
|
+
} from "./index-n85fer99.js";
|
|
15
8
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
Exec,
|
|
10
|
+
Workspace,
|
|
11
|
+
runner,
|
|
12
|
+
script,
|
|
13
|
+
command
|
|
14
|
+
} from "./index-cezy7yb3.js";
|
|
19
15
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
extractAgentBlock,
|
|
17
|
+
collectScopeRecipeSources,
|
|
18
|
+
renderScopeAgentBlock,
|
|
19
|
+
WorkspaceExecutor,
|
|
20
|
+
SysExecutor,
|
|
21
|
+
AppExecutor,
|
|
22
|
+
LibExecutor,
|
|
23
|
+
PkgExecutor
|
|
24
|
+
} from "./index-q8sn827n.js";
|
|
25
|
+
import"./index-6wwzs1bc.js";
|
|
23
26
|
import {
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
countBlocking,
|
|
28
|
+
formatStyleContract,
|
|
29
|
+
ThemeValidator
|
|
30
|
+
} from "./index-n68jx79w.js";
|
|
31
|
+
import {
|
|
32
|
+
collectRecipeSources2,
|
|
33
|
+
scanRecipes2
|
|
34
|
+
} from "./index-by5gpp8x.js";
|
|
35
|
+
import"./index-e82dyeqy.js";
|
|
36
|
+
import"./index-0emb9eat.js";
|
|
37
|
+
import"./index-h7yw2z9n.js";
|
|
26
38
|
import {
|
|
27
39
|
AgentScript
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-774gcx29.js";
|
|
30
|
-
import"./index-rxkpk7n4.js";
|
|
31
|
-
import"./index-j37qq1f2.js";
|
|
40
|
+
} from "./index-rntcdss1.js";
|
|
32
41
|
import {
|
|
33
42
|
ApplicationScript
|
|
34
|
-
} from "./index-
|
|
43
|
+
} from "./index-d61rcfa2.js";
|
|
35
44
|
import {
|
|
36
45
|
LibraryScript
|
|
37
|
-
} from "./index-
|
|
38
|
-
import"./index-
|
|
39
|
-
import
|
|
40
|
-
Exec,
|
|
41
|
-
Workspace,
|
|
42
|
-
command,
|
|
43
|
-
runner,
|
|
44
|
-
script
|
|
45
|
-
} from "./index-kdh76j26.js";
|
|
46
|
-
import"./index-fgc8r6dj.js";
|
|
46
|
+
} from "./index-zkvpaggp.js";
|
|
47
|
+
import"./index-9wtbw98m.js";
|
|
48
|
+
import"./index-kcxmv48c.js";
|
|
47
49
|
import {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
formatStyleContract
|
|
51
|
-
} from "./index-xjd3rqzj.js";
|
|
52
|
-
import"./index-bjpxzr6s.js";
|
|
50
|
+
PackageScript
|
|
51
|
+
} from "./index-sjak5v5b.js";
|
|
53
52
|
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
SysExecutor,
|
|
58
|
-
WorkspaceExecutor,
|
|
59
|
-
collectScopeRecipeSources,
|
|
60
|
-
extractAgentBlock,
|
|
61
|
-
renderScopeAgentBlock
|
|
62
|
-
} from "./index-z8ptfkzv.js";
|
|
63
|
-
import"./index-mxvakhsm.js";
|
|
53
|
+
getNpmRegistryUrl,
|
|
54
|
+
getLatestPackageVersion
|
|
55
|
+
} from "./index-kfnr6c19.js";
|
|
64
56
|
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} from "./index-xys926f2.js";
|
|
68
|
-
import"./index-1577bej2.js";
|
|
69
|
-
import"./index-46tjzh6s.js";
|
|
57
|
+
CloudScript
|
|
58
|
+
} from "./index-deekbtkj.js";
|
|
70
59
|
import {
|
|
71
|
-
|
|
72
|
-
} from "./index-
|
|
73
|
-
import"./index-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
import
|
|
77
|
-
import
|
|
60
|
+
ContextScript
|
|
61
|
+
} from "./index-r50qen0z.js";
|
|
62
|
+
import"./index-pgsswppj.js";
|
|
63
|
+
import"./index-y74k5anj.js";
|
|
64
|
+
import"./index-h759vjfa.js";
|
|
65
|
+
import"./index-9bwhxrqf.js";
|
|
66
|
+
import"./index-mpmyqm1y.js";
|
|
67
|
+
import"./index-3vvbv974.js";
|
|
68
|
+
import"./index-5xdqxbn9.js";
|
|
69
|
+
import"./index-pvb4vdwr.js";
|
|
78
70
|
|
|
79
71
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
80
72
|
import path from "path";
|
|
81
73
|
|
|
82
74
|
// pkgs/@akanjs/devkit/biomeBase.ts
|
|
83
|
-
var biomeVersion = "2.
|
|
75
|
+
var biomeVersion = "2.5.12";
|
|
84
76
|
|
|
85
77
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
86
78
|
var defaultWorkspacePeerDependencies = new Set([
|
|
87
79
|
"@react-spring/web",
|
|
88
80
|
"@use-gesture/react",
|
|
89
81
|
"chance",
|
|
90
|
-
"croner",
|
|
91
82
|
"react",
|
|
92
83
|
"react-dom",
|
|
93
84
|
"react-icons",
|
|
@@ -99,6 +90,7 @@ var defaultWorkspacePeerDependencies = new Set([
|
|
|
99
90
|
"tailwindcss",
|
|
100
91
|
"typescript"
|
|
101
92
|
]);
|
|
93
|
+
var defaultMaxDiagnostics = 200;
|
|
102
94
|
|
|
103
95
|
class WorkspaceRunner extends runner("workspace") {
|
|
104
96
|
async generateAgentRules(workspace, { overwrite = false, cursorRules = true } = {}) {
|
|
@@ -236,24 +228,35 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
236
228
|
}
|
|
237
229
|
throw new Error(`[workspace] failed to locate akanjs package.json from ${import.meta.dir}`);
|
|
238
230
|
}
|
|
239
|
-
async lint(exec, workspace, { fix = true } = {}) {
|
|
231
|
+
async lint(exec, workspace, { fix = true, maxDiagnostics = defaultMaxDiagnostics } = {}) {
|
|
232
|
+
const configPath = await WorkspaceRunner.resolveBiomeConfigPath(workspace);
|
|
240
233
|
await workspace.spawn("./node_modules/.bin/biome", [
|
|
241
234
|
"check",
|
|
242
235
|
...fix ? ["--write"] : [],
|
|
243
236
|
"--no-errors-on-unmatched",
|
|
237
|
+
`--max-diagnostics=${maxDiagnostics > 0 ? maxDiagnostics : "none"}`,
|
|
238
|
+
...configPath ? ["--config-path", configPath] : [],
|
|
244
239
|
exec.cwdPath
|
|
245
240
|
]);
|
|
246
241
|
await this.#enforceStyleContract(exec);
|
|
247
242
|
await this.#enforceRecipeGate(exec);
|
|
248
243
|
await this.#enforceAgentsIndex(exec);
|
|
249
244
|
}
|
|
245
|
+
static async resolveBiomeConfigPath(workspace) {
|
|
246
|
+
for (const fileName of ["biome.json", "biome.jsonc"]) {
|
|
247
|
+
const configPath = path.join(workspace.workspaceRoot, fileName);
|
|
248
|
+
if (await Bun.file(configPath).exists())
|
|
249
|
+
return configPath;
|
|
250
|
+
}
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
250
253
|
async#enforceAgentsIndex(exec) {
|
|
251
254
|
if (!(exec instanceof SysExecutor))
|
|
252
255
|
return;
|
|
253
256
|
const scope = { type: exec.type, name: exec.name };
|
|
254
257
|
const scanInfo = await exec.scan({ write: false });
|
|
255
258
|
const sources = await collectScopeRecipeSources(exec.workspace.workspaceRoot, scope, scanInfo.getScanResult().libDeps);
|
|
256
|
-
const expected = renderScopeAgentBlock(scope,
|
|
259
|
+
const expected = renderScopeAgentBlock(scope, scanRecipes2(sources));
|
|
257
260
|
const existing = await exec.exists("AGENTS.md") ? await exec.readFile("AGENTS.md") : null;
|
|
258
261
|
const actual = existing ? extractAgentBlock(existing) : null;
|
|
259
262
|
if (actual === expected.trim())
|
|
@@ -266,12 +269,12 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
266
269
|
return;
|
|
267
270
|
const uiDir = path.join(cwdPath, "ui");
|
|
268
271
|
const sources = [
|
|
269
|
-
...await
|
|
270
|
-
...await
|
|
272
|
+
...await collectRecipeSources2(uiDir, "ui/Recipe"),
|
|
273
|
+
...await collectRecipeSources2(uiDir, "ui/recipe", "recipe")
|
|
271
274
|
];
|
|
272
275
|
if (sources.length === 0)
|
|
273
276
|
return;
|
|
274
|
-
const offenders =
|
|
277
|
+
const offenders = scanRecipes2(sources).filter((recipe) => !Object.values(recipe.variants).some((values) => values.length >= 2 || values.length === 1 && values[0] === "true"));
|
|
275
278
|
if (offenders.length === 0)
|
|
276
279
|
return;
|
|
277
280
|
throw new Error(`[recipeGate] variant-less recipe(s): ${offenders.map((recipe) => recipe.name).join(", ")}
|
|
@@ -282,15 +285,18 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
282
285
|
if (!cwdPath)
|
|
283
286
|
return;
|
|
284
287
|
const stylesCssPath = path.join(cwdPath, "page", "styles.css");
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
if (!await Bun.file(stylesCssPath).exists())
|
|
289
|
+
return;
|
|
290
|
+
const violations = {
|
|
291
|
+
theme: new ThemeValidator().validate(await Bun.file(stylesCssPath).text())
|
|
292
|
+
};
|
|
287
293
|
const blocking = countBlocking(violations);
|
|
288
294
|
if (blocking === 0)
|
|
289
295
|
return;
|
|
290
296
|
throw new Error(`[themeValidator] ${blocking} blocking contrast violation(s):
|
|
291
297
|
${formatStyleContract(violations)}
|
|
292
298
|
|
|
293
|
-
` + "
|
|
299
|
+
` + "Raise the foreground/background contrast of these theme token values to the WCAG threshold.");
|
|
294
300
|
}
|
|
295
301
|
async writeTopLevelEnv(workspace, devProjectId) {
|
|
296
302
|
await workspace.writeFile(".env", `AKAN_WORKSPACE_ID=${devProjectId}
|
|
@@ -314,6 +320,8 @@ AKAN_PUBLIC_LOG_LEVEL=debug
|
|
|
314
320
|
}
|
|
315
321
|
|
|
316
322
|
// pkgs/@akanjs/cli/workspace/workspace.script.ts
|
|
323
|
+
import path2 from "path";
|
|
324
|
+
import { Logger } from "akanjs/common";
|
|
317
325
|
class WorkspaceScript extends script("workspace", [
|
|
318
326
|
WorkspaceRunner,
|
|
319
327
|
ApplicationScript,
|
|
@@ -376,28 +384,29 @@ class WorkspaceScript extends script("workspace", [
|
|
|
376
384
|
await this.agentScript.agent(workspace, "install", "agents-md", { force: overwrite });
|
|
377
385
|
spinner.succeed(`Agent rules ready (${files.length} file${files.length === 1 ? "" : "s"})`);
|
|
378
386
|
}
|
|
379
|
-
async lint(exec, workspace, { fix = true } = {}) {
|
|
387
|
+
async lint(exec, workspace, { fix = true, maxDiagnostics } = {}) {
|
|
380
388
|
if (exec instanceof AppExecutor)
|
|
381
389
|
await this.applicationScript.sync(exec);
|
|
382
390
|
else if (exec instanceof LibExecutor)
|
|
383
391
|
await this.libraryScript.syncLibrary(exec);
|
|
384
392
|
const spinner = workspace.spinning(`Linting${fix ? " with fix" : ""}...`);
|
|
385
393
|
try {
|
|
386
|
-
await this.workspaceRunner.lint(exec, workspace, { fix });
|
|
394
|
+
await this.workspaceRunner.lint(exec, workspace, { fix, maxDiagnostics });
|
|
387
395
|
spinner.succeed("Lint completed with no errors");
|
|
388
396
|
} catch (error) {
|
|
389
397
|
spinner.fail("Lint failed with errors");
|
|
390
398
|
throw error;
|
|
391
399
|
}
|
|
392
400
|
}
|
|
393
|
-
async lintAll(workspace, { fix = true } = {}) {
|
|
401
|
+
async lintAll(workspace, { fix = true, maxDiagnostics } = {}) {
|
|
394
402
|
const [appNames, libNames, pkgNames] = await workspace.getExecs();
|
|
403
|
+
const options = { fix, maxDiagnostics };
|
|
395
404
|
await Promise.all(appNames.map((appName) => this.applicationScript.sync(AppExecutor.from(workspace, appName))));
|
|
396
405
|
await Promise.all(libNames.map((libName) => this.libraryScript.syncLibrary(LibExecutor.from(workspace, libName))));
|
|
397
406
|
await Promise.all([
|
|
398
|
-
...appNames.map((appName) => this.workspaceRunner.lint(AppExecutor.from(workspace, appName), workspace,
|
|
399
|
-
...libNames.map((libName) => this.workspaceRunner.lint(LibExecutor.from(workspace, libName), workspace,
|
|
400
|
-
...pkgNames.filter((pkgName) => pkgName !== "contract").map((pkgName) => this.workspaceRunner.lint(PkgExecutor.from(workspace, pkgName), workspace,
|
|
407
|
+
...appNames.map((appName) => this.workspaceRunner.lint(AppExecutor.from(workspace, appName), workspace, options)),
|
|
408
|
+
...libNames.map((libName) => this.workspaceRunner.lint(LibExecutor.from(workspace, libName), workspace, options)),
|
|
409
|
+
...pkgNames.filter((pkgName) => pkgName !== "contract").map((pkgName) => this.workspaceRunner.lint(PkgExecutor.from(workspace, pkgName), workspace, options))
|
|
401
410
|
]);
|
|
402
411
|
}
|
|
403
412
|
async syncAll(workspace) {
|
|
@@ -479,11 +488,17 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
|
|
|
479
488
|
}).option("overwrite", Boolean, { desc: "Overwrite existing agent rule files", default: false }).option("cursorRules", Boolean, { desc: "Generate .cursor/rules/akan.mdc", default: true }).with(Workspace).exec(async function(overwrite, cursorRules, workspace) {
|
|
480
489
|
await this.workspaceScript.generateAgentRules(workspace, { overwrite, cursorRules });
|
|
481
490
|
}),
|
|
482
|
-
lint: target({ desc: "Lint and fix code in a specific app/lib/pkg" }).with(Exec).option("fix", Boolean, { default: true }).
|
|
483
|
-
|
|
491
|
+
lint: target({ desc: "Lint and fix code in a specific app/lib/pkg" }).with(Exec).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, {
|
|
492
|
+
desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
|
|
493
|
+
default: defaultMaxDiagnostics
|
|
494
|
+
}).with(Workspace).exec(async function(exec, fix, maxDiagnostics, workspace) {
|
|
495
|
+
await this.workspaceScript.lint(exec, workspace, { fix, maxDiagnostics });
|
|
484
496
|
}),
|
|
485
|
-
lintAll: target({ desc: "Lint and fix code in all apps and libraries" }).option("fix", Boolean, { default: true }).
|
|
486
|
-
|
|
497
|
+
lintAll: target({ desc: "Lint and fix code in all apps and libraries" }).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, {
|
|
498
|
+
desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
|
|
499
|
+
default: defaultMaxDiagnostics
|
|
500
|
+
}).with(Workspace).exec(async function(fix, maxDiagnostics, workspace) {
|
|
501
|
+
await this.workspaceScript.lintAll(workspace, { fix, maxDiagnostics });
|
|
487
502
|
}),
|
|
488
503
|
syncAll: target({ desc: "Sync dependencies and configuration for all apps and libraries" }).with(Workspace).exec(async function(workspace) {
|
|
489
504
|
await this.workspaceScript.syncAll(workspace);
|
package/capacitorApp-9xswcgx7.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
ANDROID_MIN_SDK_VERSION,
|
|
4
|
-
CapacitorApp,
|
|
5
|
-
PLACEHOLDER_APP_IDS,
|
|
6
|
-
SWIFTUICORE_MIN_IOS_MAJOR,
|
|
7
|
-
assertJsonSerializable,
|
|
8
|
-
buildIosNativeRunCommand,
|
|
9
|
-
classifyIosRunFailure,
|
|
10
|
-
clearRootCapacitorConfigs,
|
|
11
|
-
formatAndroidReleaseSigningError,
|
|
12
|
-
formatIosRunFailureMessage,
|
|
13
|
-
getAdbDeviceStateIssues,
|
|
14
|
-
getAndroidLocalServerHost,
|
|
15
|
-
getMissingAndroidReleaseSigningKeys,
|
|
16
|
-
isPlaceholderAppId,
|
|
17
|
-
materializeCapacitorConfig,
|
|
18
|
-
parseDevicectlDevices,
|
|
19
|
-
parseIosRuntimeMajor,
|
|
20
|
-
parseSimctlDevices,
|
|
21
|
-
raiseGradleMinSdkVersion,
|
|
22
|
-
rootCapacitorConfigFilenames,
|
|
23
|
-
rootCapacitorConfigPaths,
|
|
24
|
-
sanitizeIosNativeRunEnv,
|
|
25
|
-
selectLocalDevHost,
|
|
26
|
-
sortIosRunTargets,
|
|
27
|
-
writeRootCapacitorConfig
|
|
28
|
-
} from "./index-779ske1y.js";
|
|
29
|
-
import"./index-76rn3g2c.js";
|
|
30
|
-
import"./index-z8ptfkzv.js";
|
|
31
|
-
import"./index-mxvakhsm.js";
|
|
32
|
-
import"./index-1577bej2.js";
|
|
33
|
-
import"./index-67546d0j.js";
|
|
34
|
-
import"./index-r24hmh0q.js";
|
|
35
|
-
export {
|
|
36
|
-
writeRootCapacitorConfig,
|
|
37
|
-
sortIosRunTargets,
|
|
38
|
-
selectLocalDevHost,
|
|
39
|
-
sanitizeIosNativeRunEnv,
|
|
40
|
-
rootCapacitorConfigPaths,
|
|
41
|
-
rootCapacitorConfigFilenames,
|
|
42
|
-
raiseGradleMinSdkVersion,
|
|
43
|
-
parseSimctlDevices,
|
|
44
|
-
parseIosRuntimeMajor,
|
|
45
|
-
parseDevicectlDevices,
|
|
46
|
-
materializeCapacitorConfig,
|
|
47
|
-
isPlaceholderAppId,
|
|
48
|
-
getMissingAndroidReleaseSigningKeys,
|
|
49
|
-
getAndroidLocalServerHost,
|
|
50
|
-
getAdbDeviceStateIssues,
|
|
51
|
-
formatIosRunFailureMessage,
|
|
52
|
-
formatAndroidReleaseSigningError,
|
|
53
|
-
clearRootCapacitorConfigs,
|
|
54
|
-
classifyIosRunFailure,
|
|
55
|
-
buildIosNativeRunCommand,
|
|
56
|
-
assertJsonSerializable,
|
|
57
|
-
SWIFTUICORE_MIN_IOS_MAJOR,
|
|
58
|
-
PLACEHOLDER_APP_IDS,
|
|
59
|
-
CapacitorApp,
|
|
60
|
-
ANDROID_MIN_SDK_VERSION
|
|
61
|
-
};
|
package/getDirname-m9s0cmhq.js
DELETED
package/index-mxvakhsm.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// pkgs/@akanjs/devkit/spinner.ts
|
|
3
|
-
import ora from "ora";
|
|
4
|
-
|
|
5
|
-
class Spinner {
|
|
6
|
-
static padding = 12;
|
|
7
|
-
static oraOptions = { discardStdin: false };
|
|
8
|
-
static canAnimate(stream = process.stderr) {
|
|
9
|
-
return !stream.isTTY || stream.columns > 0;
|
|
10
|
-
}
|
|
11
|
-
spinner;
|
|
12
|
-
stopWatch = null;
|
|
13
|
-
startAt = new Date;
|
|
14
|
-
prefix;
|
|
15
|
-
message;
|
|
16
|
-
enableSpin;
|
|
17
|
-
constructor(message, { prefix = "", indent = 0, enableSpin = true } = {}) {
|
|
18
|
-
Spinner.padding = Math.max(Spinner.padding, prefix.length);
|
|
19
|
-
this.prefix = prefix;
|
|
20
|
-
this.message = message;
|
|
21
|
-
this.spinner = ora({ ...Spinner.oraOptions, text: message });
|
|
22
|
-
this.spinner.prefixText = prefix.padStart(Spinner.padding, " ");
|
|
23
|
-
this.spinner.indent = indent;
|
|
24
|
-
this.enableSpin = enableSpin && Spinner.canAnimate();
|
|
25
|
-
}
|
|
26
|
-
start() {
|
|
27
|
-
this.startAt = new Date;
|
|
28
|
-
if (this.enableSpin) {
|
|
29
|
-
this.spinner.start();
|
|
30
|
-
this.stopWatch = setInterval(() => {
|
|
31
|
-
this.spinner.prefixText = this.prefix.padStart(Spinner.padding, " ");
|
|
32
|
-
this.spinner.text = `${this.message} (${this.#getElapsedTimeStr({ floor: true })})`;
|
|
33
|
-
}, 1000);
|
|
34
|
-
} else
|
|
35
|
-
this.spinner.info();
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
succeed(message) {
|
|
39
|
-
this.spinner.succeed(`${message} (${this.#getElapsedTimeStr()})`);
|
|
40
|
-
this.#reset();
|
|
41
|
-
}
|
|
42
|
-
fail(message) {
|
|
43
|
-
this.spinner.fail(`${message} (${this.#getElapsedTimeStr()})`);
|
|
44
|
-
this.#reset();
|
|
45
|
-
}
|
|
46
|
-
isSpinning() {
|
|
47
|
-
return this.spinner.isSpinning;
|
|
48
|
-
}
|
|
49
|
-
#reset() {
|
|
50
|
-
if (this.stopWatch)
|
|
51
|
-
clearInterval(this.stopWatch);
|
|
52
|
-
this.stopWatch = null;
|
|
53
|
-
}
|
|
54
|
-
#getElapsedTimeStr({ floor = false } = {}) {
|
|
55
|
-
const ms = Date.now() - this.startAt.getTime();
|
|
56
|
-
if (ms < 1000)
|
|
57
|
-
return `${ms}ms`;
|
|
58
|
-
const s = Math.floor(ms / 1000);
|
|
59
|
-
if (s < 60)
|
|
60
|
-
return `${floor ? Math.floor(ms / 1000) : Math.floor(ms / 100) / 10}s`;
|
|
61
|
-
const m = Math.floor(s / 60);
|
|
62
|
-
return `${m}m ${s % 60}s`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { Spinner };
|
package/index-r24hmh0q.js
DELETED