@akanjs/cli 3.0.0-alpha.3 → 3.0.0-alpha.31
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-20e0cwbs.js} +2 -2
- package/{agent.command-yv00p0s0.js → agent.command-e835fjem.js} +8 -7
- package/{application.command-0qsczf4k.js → application.command-sjtbk6tr.js} +6 -5
- package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-7gnfz7ww.js} +6 -7
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
- package/buildBatch.proc.js +5 -4
- package/{capacitorApp-4r9sm3qg.js → capacitorApp-qv7g3dp2.js} +29 -26
- package/{cloud.command-dxfv18sa.js → cloud.command-y0e4eyqz.js} +10 -9
- package/{context.command-8d9e3k6b.js → context.command-vn87jb08.js} +16 -15
- package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
- package/getDirname-ka11hm7e.js +8 -0
- package/{guideline.command-3jbkxzh6.js → guideline.command-s4hn2bsy.js} +7 -6
- package/guidelines/conventions/conventions.generate.json +25 -0
- package/guidelines/conventions/conventions.instruction.md +986 -0
- package/guidelines/cssRule/cssRule.instruction.md +7 -0
- package/guidelines/framework/framework.instruction.md +1 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +972 -0
- package/incrementalBuilder.proc.js +6 -5
- package/{index-1pvex4az.js → index-0h212yqe.js} +13 -13
- package/index-1577bej2.js +7 -0
- package/{index-k95xkh4p.js → index-33zce8gt.js} +8 -4
- package/{index-2q1f5j9k.js → index-3dp7x6rc.js} +3 -3
- package/{index-7c6k4yvg.js → index-73rnbwgg.js} +15 -7
- package/{index-e16gnn26.js → index-8d2sv6pw.js} +13 -13
- package/{index-hgna5rjy.js → index-8vkkm7v0.js} +124 -65
- package/{index-bekddz9q.js → index-9jsnb4vw.js} +4 -4
- package/{index-nm6wghb6.js → index-becx1t0k.js} +6 -6
- package/{index-a00jg8x8.js → index-g9e2fhw2.js} +49 -32
- package/{index-pyt2b4nw.js → index-hg0qvhmx.js} +152 -241
- package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
- package/{index-ej426mcr.js → index-k6fvbcj1.js} +37 -6
- package/{index-yzmhasdb.js → index-mykmf6wd.js} +8 -8
- package/{index-t3723f99.js → index-mz5jtaq7.js} +86 -17
- package/{index-8hsbnyes.js → index-n706txcv.js} +5 -3
- package/{index-bbkek1bp.js → index-qc0tnhs2.js} +1 -1
- package/{index-rh16j3c7.js → index-qnv0aqmm.js} +12 -8
- package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
- package/{index-zasydjxd.js → index-t71zvmt9.js} +9 -11
- package/{index-rzwcpcc3.js → index-tsmjxph2.js} +1 -1
- package/{index-ec09pws3.js → index-x33gnap3.js} +4 -4
- package/{index-mr5s7mqd.js → index-xyrb7pk5.js} +3 -3
- package/index.js +20 -19
- package/{library.command-ebdj1vnm.js → library.command-v5cyaw9t.js} +5 -4
- package/{localRegistry.command-gb178ne8.js → localRegistry.command-53t758pt.js} +9 -8
- package/{module.command-9c1bnsx4.js → module.command-pq6w84xg.js} +9 -8
- package/{package.command-t93p4jkj.js → package.command-qkcs60ts.js} +5 -4
- package/package.json +3 -4
- package/{page.command-k3k0meh2.js → page.command-qj5bfnh9.js} +5 -4
- package/{primitive.command-de6nktdt.js → primitive.command-bw0nes6x.js} +10 -9
- package/{quality.command-z5kth2wa.js → quality.command-f8drhx6c.js} +11 -41
- package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
- package/{repair.command-ehf2g112.js → repair.command-mzwtejpk.js} +7 -6
- package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-7fycdqyv.js} +3 -39
- package/{scalar.command-7a2jtv33.js → scalar.command-rm6k3c65.js} +8 -7
- 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/page/styles.css.template +3 -3
- package/templates/appSample/srvkit/AuthGuard.ts +9 -5
- package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
- package/templates/crudPages/new/page.tsx +1 -1
- package/templates/crudSinglePage/page.tsx +1 -1
- 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/lib/useClient.ts +9 -3
- package/templates/module/__Model__.Util.tsx +1 -1
- package/templates/module/__Model__.Zone.tsx +3 -5
- package/templates/workspaceRoot/AGENTS.md.template +0 -963
- package/templates/workspaceRoot/CLAUDE.md.template +19 -0
- package/templates/workspaceRoot/biome.json.template +4 -198
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
- package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/{workflow.command-e0tt0vk2.js → workflow.command-g2cgcgxn.js} +15 -14
- package/{workspace.command-fpda0evj.js → workspace.command-f7jerqb2.js} +69 -51
- package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
- package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
- package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
- package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
- package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
- package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
- package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
- package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
- package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
- package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
- package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
- package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
- package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
- package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
- /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
# <%= repoName %> — Claude Code Guide
|
|
2
2
|
|
|
3
3
|
@AGENTS.md
|
|
4
|
+
|
|
5
|
+
## Comments — Overrides Your Default
|
|
6
|
+
|
|
7
|
+
Write **no comments** unless the comment passes the test below. This is the rule agents break most often here, so it
|
|
8
|
+
is repeated outside the guide: a diff that adds a comment the test rejects is a diff to redo.
|
|
9
|
+
|
|
10
|
+
Before typing `//`, `/*`, or a doc block, ask — **does this sentence carry a fact that is nowhere in the code?**
|
|
11
|
+
|
|
12
|
+
- Restates the identifier, the signature, or the line under it → delete it.
|
|
13
|
+
- Labels a section (`// helpers`, `// state`) or narrates a step (`// fetch the user`, `// then save`) → delete it.
|
|
14
|
+
- JSDoc on an ordinary function, or a why/how preamble on ordinary logic → delete it.
|
|
15
|
+
- Explains the edit you just made, for whoever reads the diff → say it in your reply, not in the file.
|
|
16
|
+
- Names a vendor or protocol quirk, an infrastructure constraint, a library gotcha, security reasoning, a math
|
|
17
|
+
derivation, a domain field's business meaning, a state transition, or why an obvious alternative was rejected →
|
|
18
|
+
keep it, one line.
|
|
19
|
+
|
|
20
|
+
That keep-list is exact — `Comments` in the guide is the full version. "It aids readability" and "this logic is
|
|
21
|
+
subtle" are not on it: rename or split the code instead. When you edit an existing file, match its density; if the
|
|
22
|
+
surrounding code carries none, your diff carries none.
|
|
@@ -1,215 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.5.
|
|
3
|
-
"
|
|
4
|
-
"enabled": true,
|
|
5
|
-
"clientKind": "git",
|
|
6
|
-
"useIgnoreFile": false
|
|
7
|
-
},
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
|
|
3
|
+
"extends": ["@akanjs/devkit/biome.base.json"],
|
|
8
4
|
"files": {
|
|
9
5
|
"includes": [
|
|
10
6
|
"**/*.ts",
|
|
11
7
|
"**/*.tsx",
|
|
12
8
|
"**/*.json",
|
|
13
9
|
"**/*.jsonc",
|
|
14
|
-
"!**/env.client.local.ts",
|
|
15
|
-
"!**/env.client.debug.ts",
|
|
16
|
-
"!**/env.client.develop.ts",
|
|
17
|
-
"!**/env.client.main.ts",
|
|
18
|
-
"!**/env.client.testing.ts",
|
|
19
|
-
"!**/env.server.local.ts",
|
|
20
|
-
"!**/env.server.develop.ts",
|
|
21
|
-
"!**/env.server.main.ts",
|
|
22
|
-
"!**/env.server.testing.ts",
|
|
23
|
-
"!**/env.server.type.ts",
|
|
24
|
-
"!apps/*/lib/cnst.ts",
|
|
25
|
-
"!apps/*/lib/dict.ts",
|
|
26
|
-
"!apps/*/lib/db.ts",
|
|
27
|
-
"!apps/*/lib/srv.ts",
|
|
28
|
-
"!apps/*/lib/st.ts",
|
|
29
|
-
"!apps/*/lib/sig.ts",
|
|
30
|
-
"!apps/*/lib/useClient.ts",
|
|
31
|
-
"!apps/*/lib/useServer.ts",
|
|
32
|
-
"!apps/*/client.ts",
|
|
33
|
-
"!apps/*/server.ts",
|
|
34
|
-
"!apps/*/lib/*/index.tsx",
|
|
35
|
-
"!libs/*/lib/cnst.ts",
|
|
36
|
-
"!libs/*/lib/dict.ts",
|
|
37
|
-
"!libs/*/lib/db.ts",
|
|
38
|
-
"!libs/*/lib/srv.ts",
|
|
39
|
-
"!libs/*/lib/st.ts",
|
|
40
|
-
"!libs/*/lib/sig.ts",
|
|
41
|
-
"!libs/*/lib/useClient.ts",
|
|
42
|
-
"!libs/*/lib/useServer.ts",
|
|
43
|
-
"!libs/*/client.ts",
|
|
44
|
-
"!libs/*/server.ts",
|
|
45
|
-
"!libs/*/index.ts",
|
|
46
|
-
"!libs/*/lib/*/index.tsx",
|
|
47
10
|
"!infra/master/createRecords.ts",
|
|
48
11
|
"!pkgs/contract/env.ts",
|
|
49
12
|
"!!**/node_modules",
|
|
50
13
|
"!!**/dist",
|
|
51
14
|
"!!**/.akan",
|
|
15
|
+
"!!**/.claude",
|
|
52
16
|
"!!**/dump",
|
|
53
17
|
"!!**/local",
|
|
54
18
|
"!!**/ios/DerivedData"
|
|
55
19
|
]
|
|
56
|
-
}
|
|
57
|
-
"formatter": {
|
|
58
|
-
"enabled": true,
|
|
59
|
-
"indentStyle": "space",
|
|
60
|
-
"indentWidth": 2,
|
|
61
|
-
"lineWidth": 120
|
|
62
|
-
},
|
|
63
|
-
"linter": {
|
|
64
|
-
"enabled": true,
|
|
65
|
-
"rules": {
|
|
66
|
-
"preset": "recommended",
|
|
67
|
-
"suspicious": {
|
|
68
|
-
"noConsole": {
|
|
69
|
-
"level": "error",
|
|
70
|
-
"options": {
|
|
71
|
-
"allow": ["assert", "error", "info", "warn"]
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"noArrayIndexKey": "off",
|
|
75
|
-
"noShadowRestrictedNames": "off",
|
|
76
|
-
"noUnnecessaryConditions": {
|
|
77
|
-
"level": "error"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"correctness": {
|
|
81
|
-
"noUnusedFunctionParameters": "off",
|
|
82
|
-
"noUnusedImports": {
|
|
83
|
-
"level": "error",
|
|
84
|
-
"fix": "safe"
|
|
85
|
-
},
|
|
86
|
-
"useParseIntRadix": "off",
|
|
87
|
-
"useExhaustiveDependencies": "off",
|
|
88
|
-
"useHookAtTopLevel": "off"
|
|
89
|
-
},
|
|
90
|
-
"nursery": {
|
|
91
|
-
"useSortedClasses": {
|
|
92
|
-
"level": "error",
|
|
93
|
-
"fix": "safe",
|
|
94
|
-
"options": {
|
|
95
|
-
"attributes": ["classList"],
|
|
96
|
-
"functions": ["clsx", "cn"]
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"a11y": "off",
|
|
101
|
-
"complexity": {
|
|
102
|
-
"noStaticOnlyClass": "off"
|
|
103
|
-
},
|
|
104
|
-
"style": {
|
|
105
|
-
"useTemplate": {
|
|
106
|
-
"level": "warn",
|
|
107
|
-
"fix": "safe"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"domains": {
|
|
112
|
-
"project": "recommended",
|
|
113
|
-
"react": "recommended",
|
|
114
|
-
"test": "recommended",
|
|
115
|
-
"types": "all"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
"javascript": {
|
|
119
|
-
"parser": {
|
|
120
|
-
"unsafeParameterDecoratorsEnabled": true
|
|
121
|
-
},
|
|
122
|
-
"formatter": {
|
|
123
|
-
"quoteStyle": "double"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"assist": {
|
|
127
|
-
"enabled": true,
|
|
128
|
-
"actions": {
|
|
129
|
-
"source": {
|
|
130
|
-
"organizeImports": "on"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"overrides": [
|
|
135
|
-
{
|
|
136
|
-
"includes": [
|
|
137
|
-
"apps/**/*.ts",
|
|
138
|
-
"apps/**/*.tsx",
|
|
139
|
-
"libs/**/*.ts",
|
|
140
|
-
"libs/**/*.tsx",
|
|
141
|
-
"!**/*.test.ts",
|
|
142
|
-
"!**/*.test.tsx",
|
|
143
|
-
"!**/*.spec.ts",
|
|
144
|
-
"!**/*.spec.tsx",
|
|
145
|
-
"!**/*.constant.ts",
|
|
146
|
-
"!**/common/**"
|
|
147
|
-
],
|
|
148
|
-
"plugins": ["./node_modules/@akanjs/devkit/lint/no-throw-raw-error.grit"]
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
"includes": ["**/page/**/*.ts", "**/page/**/*.tsx", "**/*.Unit.tsx", "**/*.View.tsx"],
|
|
152
|
-
"plugins": [
|
|
153
|
-
"./node_modules/@akanjs/devkit/lint/no-import-client-functions.grit",
|
|
154
|
-
"./node_modules/@akanjs/devkit/lint/no-use-client-in-server.grit"
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"includes": ["**/page/**/*.ts", "**/page/**/*.tsx"],
|
|
159
|
-
"plugins": ["./node_modules/@akanjs/devkit/lint/non-scalar-props-restricted.grit"]
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"includes": ["**/*.constant.ts", "**/*.document.ts", "**/*.service.ts", "**/*.store.ts"],
|
|
163
|
-
"plugins": ["./node_modules/@akanjs/devkit/lint/no-js-private-class-method.grit"]
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"includes": ["**/*.signal.ts"],
|
|
167
|
-
"plugins": ["./node_modules/@akanjs/devkit/lint/no-redeclare-predefined-endpoint.grit"]
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"includes": [
|
|
171
|
-
"**/*.constant.ts",
|
|
172
|
-
"**/*.dictionary.ts",
|
|
173
|
-
"**/*.document.ts",
|
|
174
|
-
"**/*.service.ts",
|
|
175
|
-
"**/*.signal.ts",
|
|
176
|
-
"**/*.store.ts",
|
|
177
|
-
"**/*.Template.tsx",
|
|
178
|
-
"**/*.Unit.tsx",
|
|
179
|
-
"**/*.Util.tsx",
|
|
180
|
-
"**/*.View.tsx",
|
|
181
|
-
"**/*.Zone.tsx"
|
|
182
|
-
],
|
|
183
|
-
"plugins": ["./node_modules/@akanjs/devkit/lint/no-deep-internal-import.grit"]
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"includes": [
|
|
187
|
-
"**/page/**/*.ts",
|
|
188
|
-
"**/page/**/*.tsx",
|
|
189
|
-
"**/index.ts",
|
|
190
|
-
"**/index.tsx",
|
|
191
|
-
"**/cnst.ts",
|
|
192
|
-
"**/db.ts",
|
|
193
|
-
"**/dict.ts",
|
|
194
|
-
"**/option.ts",
|
|
195
|
-
"**/sig.ts",
|
|
196
|
-
"**/srv.ts",
|
|
197
|
-
"**/st.ts",
|
|
198
|
-
"**/*.constant.ts",
|
|
199
|
-
"**/*.dictionary.ts",
|
|
200
|
-
"**/*.document.ts",
|
|
201
|
-
"**/*.service.ts",
|
|
202
|
-
"**/*.signal.ts",
|
|
203
|
-
"**/*.signal.test.ts",
|
|
204
|
-
"**/*.service.test.ts",
|
|
205
|
-
"**/*.store.ts",
|
|
206
|
-
"**/*.Template.tsx",
|
|
207
|
-
"**/*.Unit.tsx",
|
|
208
|
-
"**/*.Util.tsx",
|
|
209
|
-
"**/*.View.tsx",
|
|
210
|
-
"**/*.Zone.tsx"
|
|
211
|
-
],
|
|
212
|
-
"plugins": ["./node_modules/@akanjs/devkit/lint/no-import-external-library.grit"]
|
|
213
|
-
}
|
|
214
|
-
]
|
|
20
|
+
}
|
|
215
21
|
}
|
|
@@ -49,8 +49,11 @@ See `docs/GENERATED.md` for the generated file list.
|
|
|
49
49
|
|
|
50
50
|
`AGENTS.md` holds the full style guide. The rules agents break most often:
|
|
51
51
|
|
|
52
|
-
- **Never hand-order Tailwind classes** — the linter sorts them, including inside `
|
|
52
|
+
- **Never hand-order Tailwind classes** — the linter sorts them, including inside `cn()`, and its output looks
|
|
53
53
|
unnatural on purpose.
|
|
54
|
+
- **Never use a colour outside the semantic vocabulary** — `bg-red-500`, `bg-[#3b82f6]` and `text-base-content`
|
|
55
|
+
compile to no CSS at all, so the element renders unstyled with no error. Use `bg-primary`, `text-foreground/70`
|
|
56
|
+
and the other tokens defined in `page/*/styles.css`.
|
|
54
57
|
- **Never `throw new Error`** — throw `new Err("<module>.error.<key>")` with an `[en, ko]` entry in the module
|
|
55
58
|
dictionary. `common/` cannot import `Err`, so keep throwing code out of it.
|
|
56
59
|
- **Never import a third-party package** from a page, a barrel, or a module file. Re-export it through a one-line
|
package/typecheck.proc.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
WorkflowRunner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-3dp7x6rc.js";
|
|
5
|
+
import {
|
|
6
|
+
ScalarScript
|
|
7
|
+
} from "./index-x33gnap3.js";
|
|
5
8
|
import {
|
|
6
9
|
PrimitiveScript
|
|
7
|
-
} from "./index-
|
|
10
|
+
} from "./index-9jsnb4vw.js";
|
|
8
11
|
import {
|
|
9
12
|
ModuleScript
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-bbkek1bp.js";
|
|
12
|
-
import {
|
|
13
|
-
ScalarScript
|
|
14
|
-
} from "./index-ec09pws3.js";
|
|
13
|
+
} from "./index-mykmf6wd.js";
|
|
15
14
|
import"./index-ss469dec.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
15
|
+
import"./index-qc0tnhs2.js";
|
|
16
|
+
import"./index-sh01r3pm.js";
|
|
17
|
+
import"./index-g9e2fhw2.js";
|
|
18
18
|
import {
|
|
19
19
|
createWorkflowStepRegistry
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-
|
|
20
|
+
} from "./index-tsmjxph2.js";
|
|
21
|
+
import"./index-j37qq1f2.js";
|
|
22
22
|
import {
|
|
23
23
|
Workspace,
|
|
24
24
|
command,
|
|
25
25
|
script
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
} from "./index-n706txcv.js";
|
|
27
|
+
import"./index-8vkkm7v0.js";
|
|
28
28
|
import"./index-mxvakhsm.js";
|
|
29
29
|
import"./index-xys926f2.js";
|
|
30
|
+
import"./index-1577bej2.js";
|
|
30
31
|
import"./index-67546d0j.js";
|
|
31
|
-
import"./index-
|
|
32
|
+
import"./index-yb2wsc7f.js";
|
|
32
33
|
|
|
33
34
|
// pkgs/@akanjs/cli/workflow/workflow.script.ts
|
|
34
35
|
import { Logger } from "akanjs/common";
|
|
@@ -1,48 +1,48 @@
|
|
|
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-0h212yqe.js";
|
|
5
|
+
import"./index-xyrb7pk5.js";
|
|
6
|
+
import"./index-3dp7x6rc.js";
|
|
7
|
+
import"./index-x33gnap3.js";
|
|
8
|
+
import"./index-9jsnb4vw.js";
|
|
9
|
+
import"./index-mykmf6wd.js";
|
|
10
|
+
import"./index-ss469dec.js";
|
|
11
|
+
import"./index-qc0tnhs2.js";
|
|
10
12
|
import {
|
|
11
13
|
CloudScript
|
|
12
|
-
} from "./index-
|
|
14
|
+
} from "./index-becx1t0k.js";
|
|
13
15
|
import {
|
|
14
16
|
getLatestPackageVersion,
|
|
15
17
|
getNpmRegistryUrl
|
|
16
|
-
} from "./index-
|
|
18
|
+
} from "./index-t71zvmt9.js";
|
|
17
19
|
import {
|
|
18
20
|
PackageScript
|
|
19
|
-
} from "./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-ss469dec.js";
|
|
22
|
-
import"./index-t3723f99.js";
|
|
21
|
+
} from "./index-33zce8gt.js";
|
|
22
|
+
import"./index-mz5jtaq7.js";
|
|
23
23
|
import {
|
|
24
24
|
GlobalConfig
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-sh01r3pm.js";
|
|
26
26
|
import {
|
|
27
27
|
AgentScript
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
28
|
+
} from "./index-k6fvbcj1.js";
|
|
29
|
+
import"./index-g9e2fhw2.js";
|
|
30
|
+
import"./index-tsmjxph2.js";
|
|
31
|
+
import"./index-j37qq1f2.js";
|
|
32
32
|
import {
|
|
33
33
|
ApplicationScript
|
|
34
|
-
} from "./index-
|
|
35
|
-
import"./index-76rn3g2c.js";
|
|
34
|
+
} from "./index-8d2sv6pw.js";
|
|
36
35
|
import {
|
|
37
36
|
LibraryScript
|
|
38
|
-
} from "./index-
|
|
37
|
+
} from "./index-73rnbwgg.js";
|
|
38
|
+
import"./index-76rn3g2c.js";
|
|
39
39
|
import {
|
|
40
40
|
Exec,
|
|
41
41
|
Workspace,
|
|
42
42
|
command,
|
|
43
43
|
runner,
|
|
44
44
|
script
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-n706txcv.js";
|
|
46
46
|
import"./index-fgc8r6dj.js";
|
|
47
47
|
import {
|
|
48
48
|
ThemeValidator,
|
|
@@ -59,29 +59,30 @@ import {
|
|
|
59
59
|
collectScopeRecipeSources,
|
|
60
60
|
extractAgentBlock,
|
|
61
61
|
renderScopeAgentBlock
|
|
62
|
-
} from "./index-
|
|
62
|
+
} from "./index-8vkkm7v0.js";
|
|
63
63
|
import"./index-mxvakhsm.js";
|
|
64
64
|
import {
|
|
65
65
|
collectRecipeSources,
|
|
66
66
|
scanRecipes
|
|
67
67
|
} from "./index-xys926f2.js";
|
|
68
|
+
import"./index-1577bej2.js";
|
|
68
69
|
import"./index-46tjzh6s.js";
|
|
69
70
|
import {
|
|
70
71
|
FileSys
|
|
71
72
|
} from "./index-67546d0j.js";
|
|
72
|
-
import"./index-
|
|
73
|
-
|
|
74
|
-
// pkgs/@akanjs/cli/workspace/workspace.script.ts
|
|
75
|
-
import path2 from "path";
|
|
76
|
-
import { Logger } from "akanjs/common";
|
|
73
|
+
import"./index-yb2wsc7f.js";
|
|
77
74
|
|
|
78
75
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
79
76
|
import path from "path";
|
|
77
|
+
|
|
78
|
+
// pkgs/@akanjs/devkit/biomeBase.ts
|
|
79
|
+
var biomeVersion = "2.5.8";
|
|
80
|
+
|
|
81
|
+
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
80
82
|
var defaultWorkspacePeerDependencies = new Set([
|
|
81
83
|
"@react-spring/web",
|
|
82
84
|
"@use-gesture/react",
|
|
83
85
|
"chance",
|
|
84
|
-
"croner",
|
|
85
86
|
"react",
|
|
86
87
|
"react-dom",
|
|
87
88
|
"react-icons",
|
|
@@ -93,6 +94,7 @@ var defaultWorkspacePeerDependencies = new Set([
|
|
|
93
94
|
"tailwindcss",
|
|
94
95
|
"typescript"
|
|
95
96
|
]);
|
|
97
|
+
var defaultMaxDiagnostics = 200;
|
|
96
98
|
|
|
97
99
|
class WorkspaceRunner extends runner("workspace") {
|
|
98
100
|
async generateAgentRules(workspace, { overwrite = false, cursorRules = true } = {}) {
|
|
@@ -113,17 +115,14 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
113
115
|
dict,
|
|
114
116
|
overwrite
|
|
115
117
|
}));
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
return [
|
|
119
|
-
...created,
|
|
120
|
-
...await workspace.applyTemplate({
|
|
118
|
+
if (cursorRules)
|
|
119
|
+
created.push(...await workspace.applyTemplate({
|
|
121
120
|
basePath: ".cursor/rules",
|
|
122
121
|
template: "workspaceRoot/.cursor/rules/akan.mdc.template",
|
|
123
122
|
dict,
|
|
124
123
|
overwrite
|
|
125
|
-
})
|
|
126
|
-
|
|
124
|
+
}));
|
|
125
|
+
return created;
|
|
127
126
|
}
|
|
128
127
|
async createWorkspace(repoName, appName, {
|
|
129
128
|
dirname = ".",
|
|
@@ -137,10 +136,7 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
137
136
|
const normalizedRegistryUrl = registryUrl ? getNpmRegistryUrl(registryUrl) : undefined;
|
|
138
137
|
const workspace = WorkspaceExecutor.fromRoot({ workspaceRoot, repoName });
|
|
139
138
|
const templateSpinner = workspace.spinning(`Creating workspace template files in ${dirname}/${repoName}...`);
|
|
140
|
-
const
|
|
141
|
-
getLatestPackageVersion("@biomejs/biome", "latest", normalizedRegistryUrl),
|
|
142
|
-
getLatestPackageVersion("@types/bun", "latest", normalizedRegistryUrl)
|
|
143
|
-
]);
|
|
139
|
+
const latestTypesBunVersion = await getLatestPackageVersion("@types/bun", "latest", normalizedRegistryUrl);
|
|
144
140
|
await workspace.applyTemplate({
|
|
145
141
|
basePath: ".",
|
|
146
142
|
template: "workspaceRoot",
|
|
@@ -164,7 +160,7 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
164
160
|
},
|
|
165
161
|
devDependencies: {
|
|
166
162
|
...rootPackageJson.devDependencies,
|
|
167
|
-
"@biomejs/biome":
|
|
163
|
+
"@biomejs/biome": biomeVersion,
|
|
168
164
|
"@types/bun": latestTypesBunVersion,
|
|
169
165
|
"@akanjs/devkit": akanVersion,
|
|
170
166
|
...typescript ? { typescript } : {}
|
|
@@ -236,17 +232,28 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
236
232
|
}
|
|
237
233
|
throw new Error(`[workspace] failed to locate akanjs package.json from ${import.meta.dir}`);
|
|
238
234
|
}
|
|
239
|
-
async lint(exec, workspace, { fix = true } = {}) {
|
|
235
|
+
async lint(exec, workspace, { fix = true, maxDiagnostics = defaultMaxDiagnostics } = {}) {
|
|
236
|
+
const configPath = await WorkspaceRunner.resolveBiomeConfigPath(workspace);
|
|
240
237
|
await workspace.spawn("./node_modules/.bin/biome", [
|
|
241
238
|
"check",
|
|
242
239
|
...fix ? ["--write"] : [],
|
|
243
240
|
"--no-errors-on-unmatched",
|
|
241
|
+
`--max-diagnostics=${maxDiagnostics > 0 ? maxDiagnostics : "none"}`,
|
|
242
|
+
...configPath ? ["--config-path", configPath] : [],
|
|
244
243
|
exec.cwdPath
|
|
245
244
|
]);
|
|
246
245
|
await this.#enforceStyleContract(exec);
|
|
247
246
|
await this.#enforceRecipeGate(exec);
|
|
248
247
|
await this.#enforceAgentsIndex(exec);
|
|
249
248
|
}
|
|
249
|
+
static async resolveBiomeConfigPath(workspace) {
|
|
250
|
+
for (const fileName of ["biome.json", "biome.jsonc"]) {
|
|
251
|
+
const configPath = path.join(workspace.workspaceRoot, fileName);
|
|
252
|
+
if (await Bun.file(configPath).exists())
|
|
253
|
+
return configPath;
|
|
254
|
+
}
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
250
257
|
async#enforceAgentsIndex(exec) {
|
|
251
258
|
if (!(exec instanceof SysExecutor))
|
|
252
259
|
return;
|
|
@@ -314,6 +321,8 @@ AKAN_PUBLIC_LOG_LEVEL=debug
|
|
|
314
321
|
}
|
|
315
322
|
|
|
316
323
|
// pkgs/@akanjs/cli/workspace/workspace.script.ts
|
|
324
|
+
import path2 from "path";
|
|
325
|
+
import { Logger } from "akanjs/common";
|
|
317
326
|
class WorkspaceScript extends script("workspace", [
|
|
318
327
|
WorkspaceRunner,
|
|
319
328
|
ApplicationScript,
|
|
@@ -372,30 +381,33 @@ class WorkspaceScript extends script("workspace", [
|
|
|
372
381
|
async generateAgentRules(workspace, { overwrite = false, cursorRules = true } = {}) {
|
|
373
382
|
const spinner = workspace.spinning("Generating agent rules...");
|
|
374
383
|
const files = await this.workspaceRunner.generateAgentRules(workspace, { overwrite, cursorRules });
|
|
384
|
+
if (files.some((file) => file.filePath.endsWith("AGENTS.md")))
|
|
385
|
+
await this.agentScript.agent(workspace, "install", "agents-md", { force: overwrite });
|
|
375
386
|
spinner.succeed(`Agent rules ready (${files.length} file${files.length === 1 ? "" : "s"})`);
|
|
376
387
|
}
|
|
377
|
-
async lint(exec, workspace, { fix = true } = {}) {
|
|
388
|
+
async lint(exec, workspace, { fix = true, maxDiagnostics } = {}) {
|
|
378
389
|
if (exec instanceof AppExecutor)
|
|
379
390
|
await this.applicationScript.sync(exec);
|
|
380
391
|
else if (exec instanceof LibExecutor)
|
|
381
392
|
await this.libraryScript.syncLibrary(exec);
|
|
382
393
|
const spinner = workspace.spinning(`Linting${fix ? " with fix" : ""}...`);
|
|
383
394
|
try {
|
|
384
|
-
await this.workspaceRunner.lint(exec, workspace, { fix });
|
|
395
|
+
await this.workspaceRunner.lint(exec, workspace, { fix, maxDiagnostics });
|
|
385
396
|
spinner.succeed("Lint completed with no errors");
|
|
386
397
|
} catch (error) {
|
|
387
398
|
spinner.fail("Lint failed with errors");
|
|
388
399
|
throw error;
|
|
389
400
|
}
|
|
390
401
|
}
|
|
391
|
-
async lintAll(workspace, { fix = true } = {}) {
|
|
402
|
+
async lintAll(workspace, { fix = true, maxDiagnostics } = {}) {
|
|
392
403
|
const [appNames, libNames, pkgNames] = await workspace.getExecs();
|
|
404
|
+
const options = { fix, maxDiagnostics };
|
|
393
405
|
await Promise.all(appNames.map((appName) => this.applicationScript.sync(AppExecutor.from(workspace, appName))));
|
|
394
406
|
await Promise.all(libNames.map((libName) => this.libraryScript.syncLibrary(LibExecutor.from(workspace, libName))));
|
|
395
407
|
await Promise.all([
|
|
396
|
-
...appNames.map((appName) => this.workspaceRunner.lint(AppExecutor.from(workspace, appName), workspace,
|
|
397
|
-
...libNames.map((libName) => this.workspaceRunner.lint(LibExecutor.from(workspace, libName), workspace,
|
|
398
|
-
...pkgNames.filter((pkgName) => pkgName !== "contract").map((pkgName) => this.workspaceRunner.lint(PkgExecutor.from(workspace, pkgName), workspace,
|
|
408
|
+
...appNames.map((appName) => this.workspaceRunner.lint(AppExecutor.from(workspace, appName), workspace, options)),
|
|
409
|
+
...libNames.map((libName) => this.workspaceRunner.lint(LibExecutor.from(workspace, libName), workspace, options)),
|
|
410
|
+
...pkgNames.filter((pkgName) => pkgName !== "contract").map((pkgName) => this.workspaceRunner.lint(PkgExecutor.from(workspace, pkgName), workspace, options))
|
|
399
411
|
]);
|
|
400
412
|
}
|
|
401
413
|
async syncAll(workspace) {
|
|
@@ -477,11 +489,17 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
|
|
|
477
489
|
}).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) {
|
|
478
490
|
await this.workspaceScript.generateAgentRules(workspace, { overwrite, cursorRules });
|
|
479
491
|
}),
|
|
480
|
-
lint: target({ desc: "Lint and fix code in a specific app/lib/pkg" }).with(Exec).option("fix", Boolean, { default: true }).
|
|
481
|
-
|
|
492
|
+
lint: target({ desc: "Lint and fix code in a specific app/lib/pkg" }).with(Exec).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, {
|
|
493
|
+
desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
|
|
494
|
+
default: defaultMaxDiagnostics
|
|
495
|
+
}).with(Workspace).exec(async function(exec, fix, maxDiagnostics, workspace) {
|
|
496
|
+
await this.workspaceScript.lint(exec, workspace, { fix, maxDiagnostics });
|
|
482
497
|
}),
|
|
483
|
-
lintAll: target({ desc: "Lint and fix code in all apps and libraries" }).option("fix", Boolean, { default: true }).
|
|
484
|
-
|
|
498
|
+
lintAll: target({ desc: "Lint and fix code in all apps and libraries" }).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, {
|
|
499
|
+
desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
|
|
500
|
+
default: defaultMaxDiagnostics
|
|
501
|
+
}).with(Workspace).exec(async function(fix, maxDiagnostics, workspace) {
|
|
502
|
+
await this.workspaceScript.lintAll(workspace, { fix, maxDiagnostics });
|
|
485
503
|
}),
|
|
486
504
|
syncAll: target({ desc: "Sync dependencies and configuration for all apps and libraries" }).with(Workspace).exec(async function(workspace) {
|
|
487
505
|
await this.workspaceScript.syncAll(workspace);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Akan page routing conventions
|
|
3
|
-
globs: apps/**/page/**/*.{ts,tsx,js,jsx}
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Akan Page Routing
|
|
8
|
-
|
|
9
|
-
- `apps/<app>/page` may contain route modules only. Do not add helper logic or component-only files there.
|
|
10
|
-
- Route source files under `page/` must use `.tsx`. Do not add `logic.ts`, `.js`, or `.jsx` files under `page/`.
|
|
11
|
-
- Route pages use `_index.tsx`; layouts use `_layout.tsx`.
|
|
12
|
-
- Reserved `_*.tsx` route filenames are limited to `_index.tsx` and `_layout.tsx`; do not add files like `_Component.tsx` or `_helper.tsx`.
|
|
13
|
-
- Page filenames must not start with an uppercase letter. Move helper components like `Component.tsx` to app `ui`, `common`, or `lib` instead.
|
|
14
|
-
- Dynamic segments use `[id]`; route groups use directories like `(user)`, `(public)`, `(tab)`, or `(detail)`.
|
|
15
|
-
- Page modules should usually export `default`, `pageConfig`, `head`, `generateHead`, or `Loading`.
|
|
16
|
-
- Prefer `export default function Page` or `export default async function Page` for page components.
|
|
17
|
-
- Before changing route behavior, check nearby routes for the expected pattern.
|
|
18
|
-
|
|
19
|
-
## Page Body Shape
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
interface PageProps {
|
|
23
|
-
params: { taskId: string };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default async function Page({ params }: PageProps) {
|
|
27
|
-
const { l } = usePage();
|
|
28
|
-
getSelf({ unauthorize: "/signin" });
|
|
29
|
-
const { taskId } = params;
|
|
30
|
-
const [{ task }] = await Promise.all([fetch.viewTask(taskId)]);
|
|
31
|
-
return <Task.View.General task={task} />;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const pageConfig = { transition: "stack" } satisfies PageConfig;
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
- There is no `loader=` / `render=` page prop. Pages are `export default async function Page`.
|
|
38
|
-
- Declare `interface PageProps { params: {...}; searchParams?: {...} }` immediately above the default export.
|
|
39
|
-
- Body order: `usePage()`, auth, destructure params, fetch, return.
|
|
40
|
-
- Run independent fetches through `Promise.all`, even when there is only one.
|
|
41
|
-
- Gate auth at `_layout.tsx`; repeating `getSelf({ unauthorize: "/signin" })` in the page is fine and common.
|
|
42
|
-
- Keep `async` even when nothing is awaited — it marks a real server page.
|
|
43
|
-
- No `useState`, no `useEffect`, and no comments in page files.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: sync-enforced Akan app/lib layout and generated index conventions
|
|
3
|
-
globs: apps/**/*,libs/**/*
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Akan Sync Conventions
|
|
8
|
-
|
|
9
|
-
- `apps/<appName>` root may only contain these files: `akan.app.json`, `akan.config.ts`, `capacitor.config.ts`, `client.ts`, `main.ts`, `package.json`, `server.ts`, `tsconfig.json`.
|
|
10
|
-
- `apps/<appName>` root may only contain these folders: `.akan`, `android`, `common`, `env`, `ios`, `lib`, `page`, `private`, `public`, `script`, `srvkit`, `ui`, `webkit`.
|
|
11
|
-
- Do not add `apps/*/base`; place shared app utilities under `apps/*/common`.
|
|
12
|
-
- `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`.
|
|
13
|
-
- Domain module folders are `lib/<model>` for database modules, `lib/_<service>` for service modules, and `lib/__scalar/<scalar>` for scalar modules.
|
|
14
|
-
- Database module UI files are limited to `<Model>.Template.tsx`, `<Model>.Unit.tsx`, `<Model>.Util.tsx`, `<Model>.View.tsx`, and `<Model>.Zone.tsx`.
|
|
15
|
-
- Service module UI files are limited to `<Service>.Util.tsx` and `<Service>.Zone.tsx`.
|
|
16
|
-
- Scalar module UI files are limited to `<Scalar>.Template.tsx` and `<Scalar>.Unit.tsx`.
|
|
17
|
-
- Module `*.test.ts`, `*.test.tsx`, `*.spec.ts`, and `*.spec.tsx` files are allowed.
|
|
18
|
-
- `ui/index.ts`, `webkit/index.ts`, `srvkit/index.ts`, `common/index.ts`, and module `lib/**/index.ts` files are generated by `akan sync`; do not hand-edit or track them.
|
|
19
|
-
- Generated facet indexes export only 1-depth files/folders with `export * from "./name";`.
|
|
20
|
-
|
|
21
|
-
## Layer Placement
|
|
22
|
-
|
|
23
|
-
| Folder | Admission test | Naming |
|
|
24
|
-
|---|---|---|
|
|
25
|
-
| `common/` | pure, isomorphic, zero-dependency; may import only sibling `common/*` and `akanjs/base`. Cannot import `Err`, so keep throwing code out of it. | camelCase file, filename equals the single export |
|
|
26
|
-
| `webkit/` | touches `window` / `navigator` / Capacitor, or is a React hook | `use<Thing>.tsx` — `.tsx` even with no JSX |
|
|
27
|
-
| `srvkit/` | touches `node:*`, `Bun`, `process.env`, a secret, or a server SDK | camelCase file, PascalCase class |
|
|
28
|
-
| `ui/` | renders JSX and is not bound to one model | PascalCase component, camelCase sidecar (`swipeCard.util.ts`) |
|
|
29
|
-
|
|
30
|
-
- Hooks return a named object of async closures, never a tuple.
|
|
31
|
-
- Only layer-root `index.ts` barrels are generated. A `ui/<Folder>/index.tsx` that builds a namespace is hand-written source; the distinguishing test is that a generated barrel contains nothing but `export * from "./X";` lines.
|
|
32
|
-
- `ui/<Folder>/index_.tsx` (trailing underscore) is the `"use client"` + `lazy()` boundary, with a server-safe `index.tsx` beside it. Collapsing the pair into one file breaks RSC.
|
|
33
|
-
- Never add a sibling helper file inside `lib/<model>/`; helpers belong in one of the folders above.
|