@akanjs/cli 2.2.10 → 2.2.12
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/README.md +15 -0
- package/guidelines/moduleOverview/moduleOverview.instruction.md +5 -1
- package/incrementalBuilder.proc.js +532 -253
- package/index.js +1039 -339
- package/package.json +2 -2
- package/templates/__scalar/__model__/__model__.abstract.md +28 -0
- package/templates/module/__model__.abstract.md +28 -0
- package/templates/service/__model__.abstract.md +28 -0
- package/templates/workspaceRoot/.cursor/rules/akan.mdc.template +26 -0
- package/templates/workspaceRoot/AGENTS.md.template +88 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@langchain/openai": "^1.4.6",
|
|
36
36
|
"@tailwindcss/node": "^4.3.0",
|
|
37
37
|
"@trapezedev/project": "^7.1.4",
|
|
38
|
-
"akanjs": "2.2.
|
|
38
|
+
"akanjs": "2.2.12",
|
|
39
39
|
"chalk": "^5.6.2",
|
|
40
40
|
"commander": "^14.0.3",
|
|
41
41
|
"daisyui": "^5.5.20",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Scalar Abstract
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Describe the embedded value object or reusable data concept this scalar owns.
|
|
6
|
+
|
|
7
|
+
## Domain Rules
|
|
8
|
+
|
|
9
|
+
- Keep durable validation and meaning rules here.
|
|
10
|
+
- Avoid repeating field types that are already clear in the constant file.
|
|
11
|
+
|
|
12
|
+
## Data Meaning
|
|
13
|
+
|
|
14
|
+
Explain the meaning of the scalar fields and when this scalar should be used.
|
|
15
|
+
|
|
16
|
+
## Workflows
|
|
17
|
+
|
|
18
|
+
Describe lifecycle or normalization behavior when relevant.
|
|
19
|
+
|
|
20
|
+
## Agent Notes
|
|
21
|
+
|
|
22
|
+
- Read this abstract before changing the scalar.
|
|
23
|
+
- Update this file when validation meaning, public behavior, or reuse rules change.
|
|
24
|
+
- Do not update this file for formatting-only, import-only, or style-only changes.
|
|
25
|
+
|
|
26
|
+
## Related Modules
|
|
27
|
+
|
|
28
|
+
- None yet.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Module Abstract
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Describe the business concept this module owns.
|
|
6
|
+
|
|
7
|
+
## Domain Rules
|
|
8
|
+
|
|
9
|
+
- Keep durable business invariants here.
|
|
10
|
+
- Avoid repeating field types that are already clear in the constant file.
|
|
11
|
+
|
|
12
|
+
## Data Meaning
|
|
13
|
+
|
|
14
|
+
Explain the meaning of important data only when the code does not make the intent obvious.
|
|
15
|
+
|
|
16
|
+
## Workflows
|
|
17
|
+
|
|
18
|
+
Describe create, update, approval, deletion, state transition, or other business flows.
|
|
19
|
+
|
|
20
|
+
## Agent Notes
|
|
21
|
+
|
|
22
|
+
- Read this abstract before changing the module.
|
|
23
|
+
- Update this file when business invariants, workflows, or public behavior change.
|
|
24
|
+
- Do not update this file for formatting-only, import-only, or style-only changes.
|
|
25
|
+
|
|
26
|
+
## Related Modules
|
|
27
|
+
|
|
28
|
+
- None yet.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Service Abstract
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Describe the business workflow or integration this service owns.
|
|
6
|
+
|
|
7
|
+
## Domain Rules
|
|
8
|
+
|
|
9
|
+
- Keep durable business invariants here.
|
|
10
|
+
- Avoid repeating implementation details already clear in the service or signal files.
|
|
11
|
+
|
|
12
|
+
## Data Meaning
|
|
13
|
+
|
|
14
|
+
Explain important input, output, and state meanings only when the code does not make the intent obvious.
|
|
15
|
+
|
|
16
|
+
## Workflows
|
|
17
|
+
|
|
18
|
+
Describe the service workflows, background jobs, external calls, or state transitions.
|
|
19
|
+
|
|
20
|
+
## Agent Notes
|
|
21
|
+
|
|
22
|
+
- Read this abstract before changing the service module.
|
|
23
|
+
- Keep business behavior in service code and expose callable actions through signals.
|
|
24
|
+
- Update this file when business invariants, workflows, or public behavior change.
|
|
25
|
+
|
|
26
|
+
## Related Modules
|
|
27
|
+
|
|
28
|
+
- None yet.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Akan.js workspace conventions for coding agents
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Akan.js Workspace Rules
|
|
7
|
+
|
|
8
|
+
- Keep edits inside the established Akan structure: `apps/<app>`, `libs/<lib>`, `pkgs/*`, and `infra`.
|
|
9
|
+
- Pages live under `apps/<app>/page`; index routes use `_index.tsx`, and nested layouts use `_layout.tsx`.
|
|
10
|
+
- Database domain modules live under `lib/<model>`.
|
|
11
|
+
- Service modules live under `lib/_<service>`.
|
|
12
|
+
- Scalar modules live under `lib/__scalar/<scalar>`.
|
|
13
|
+
- Module abstracts live beside module code as `<model>.abstract.md`, `<service>.abstract.md`, or
|
|
14
|
+
`<scalar>.abstract.md`. Read them before changing module behavior.
|
|
15
|
+
- Do not hand-edit generated Akan files such as `akan.app.json`, `client.ts`, `server.ts`, generated facet indexes,
|
|
16
|
+
`lib/cnst.ts`, `lib/dict.ts`, `lib/db.ts`, `lib/srv.ts`, `lib/st.ts`, `lib/sig.ts`, `lib/useClient.ts`, or
|
|
17
|
+
`lib/useServer.ts`.
|
|
18
|
+
- For new domain behavior, inspect sibling `constant`, `dictionary`, `signal`, `document`, `service`, `store`, and UI
|
|
19
|
+
module files before changing shape.
|
|
20
|
+
- Update `*.abstract.md` when business invariants, workflows, or public behavior change. Do not update it for
|
|
21
|
+
formatting-only, import-only, or style-only changes.
|
|
22
|
+
- Respect server/client import boundaries. Use `akanjs/server` only in server-side code and `akanjs/client` only in
|
|
23
|
+
client/page runtime code.
|
|
24
|
+
- Treat `AKAN_PUBLIC_*` env vars as public values. Do not store secrets in them.
|
|
25
|
+
- Verify changes with the smallest relevant command: `akan lint <target>`, `akan test <target>`, or
|
|
26
|
+
`akan build <app-name>`.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# <%= repoName %> Agent Guide
|
|
2
|
+
|
|
3
|
+
This is an Akan.js workspace. Akan is convention-driven: keep business intent in the expected place and let
|
|
4
|
+
the framework generate the repeated surfaces.
|
|
5
|
+
|
|
6
|
+
## Workspace Layout
|
|
7
|
+
|
|
8
|
+
- `apps/<app>` contains application pages, app UI, app domain modules, env files, and `akan.config.ts`.
|
|
9
|
+
- `libs/<lib>` contains shared domain and utility code reused by apps.
|
|
10
|
+
- `apps/<app>/page` contains file-routed pages. Index pages use `_index.tsx`; nested layouts use `_layout.tsx`.
|
|
11
|
+
- `apps/<app>/lib/<model>` contains database-backed domain modules.
|
|
12
|
+
- `apps/<app>/lib/_<service>` contains service modules that are not database document models.
|
|
13
|
+
- `apps/<app>/lib/__scalar/<scalar>` contains reusable scalar/value types.
|
|
14
|
+
- Module abstracts live beside module code as `<model>.abstract.md`, `<service>.abstract.md`, or
|
|
15
|
+
`<scalar>.abstract.md`.
|
|
16
|
+
|
|
17
|
+
## Generated Files
|
|
18
|
+
|
|
19
|
+
Do not hand-edit generated Akan files. Regenerate them through Akan scan, lint, start, build, or the matching
|
|
20
|
+
CLI command instead.
|
|
21
|
+
|
|
22
|
+
Common generated files include:
|
|
23
|
+
|
|
24
|
+
- `apps/*/akan.app.json`
|
|
25
|
+
- `libs/*/akan.lib.json`
|
|
26
|
+
- `pkgs/*/akan.pkg.json`
|
|
27
|
+
- `apps/*/client.ts`
|
|
28
|
+
- `apps/*/server.ts`
|
|
29
|
+
- `apps/*/lib/cnst.ts`
|
|
30
|
+
- `apps/*/lib/dict.ts`
|
|
31
|
+
- `apps/*/lib/db.ts`
|
|
32
|
+
- `apps/*/lib/srv.ts`
|
|
33
|
+
- `apps/*/lib/st.ts`
|
|
34
|
+
- `apps/*/lib/sig.ts`
|
|
35
|
+
- `apps/*/lib/useClient.ts`
|
|
36
|
+
- `apps/*/lib/useServer.ts`
|
|
37
|
+
- `apps/*/ui/index.ts`
|
|
38
|
+
- `apps/*/webkit/index.ts`
|
|
39
|
+
- `apps/*/srvkit/index.ts`
|
|
40
|
+
- `apps/*/common/index.ts`
|
|
41
|
+
- module `index.ts` and `index.tsx` files generated by scan
|
|
42
|
+
|
|
43
|
+
## Domain Module Responsibilities
|
|
44
|
+
|
|
45
|
+
Use the local module shape before adding a new abstraction.
|
|
46
|
+
|
|
47
|
+
- `<model>.constant.ts` defines model, enum, scalar, and schema intent.
|
|
48
|
+
- `<model>.abstract.md` defines business intent, domain rules, workflows, and agent notes that are not obvious
|
|
49
|
+
from code.
|
|
50
|
+
- `<model>.dictionary.ts` defines labels, descriptions, messages, and i18n metadata.
|
|
51
|
+
- `<model>.signal.ts` defines typed endpoint contracts.
|
|
52
|
+
- `<model>.document.ts` owns persistence and document queries.
|
|
53
|
+
- `<model>.service.ts` owns business logic.
|
|
54
|
+
- `<model>.store.ts` owns domain state and actions.
|
|
55
|
+
- `<Model>.Template.tsx` owns form-oriented UI.
|
|
56
|
+
- `<Model>.Unit.tsx` owns list/item UI.
|
|
57
|
+
- `<Model>.View.tsx` owns detail UI.
|
|
58
|
+
- `<Model>.Zone.tsx` owns page/container integration.
|
|
59
|
+
- `<model>.Util.tsx` owns small module UI helpers.
|
|
60
|
+
|
|
61
|
+
## Agent Workflow
|
|
62
|
+
|
|
63
|
+
1. Read the nearby module and convention before creating files. If `*.abstract.md` exists, read it first.
|
|
64
|
+
2. Put new files in the established Akan location instead of adding parallel architecture.
|
|
65
|
+
3. Prefer CLI generation commands for new apps, libraries, modules, scalars, pages, and generated references.
|
|
66
|
+
4. Keep server-only logic out of client surfaces and client-only code out of server imports.
|
|
67
|
+
5. Treat `AKAN_PUBLIC_*` env vars as public. Never put secrets in them.
|
|
68
|
+
6. Add or update tests when behavior, contracts, or CLI output changes.
|
|
69
|
+
7. Update `*.abstract.md` when business invariants, workflows, or public behavior change.
|
|
70
|
+
8. Run the smallest relevant verification command after changes.
|
|
71
|
+
|
|
72
|
+
## Common Commands
|
|
73
|
+
|
|
74
|
+
Run commands from the workspace root unless a task says otherwise.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
akan start <app-name>
|
|
78
|
+
akan build <app-name>
|
|
79
|
+
akan test <app-or-lib-or-pkg>
|
|
80
|
+
akan lint <app-or-lib-or-pkg>
|
|
81
|
+
akan lint-all
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
For the default generated app, start with:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
akan start <%= appName %>
|
|
88
|
+
```
|