@akanjs/cli 0.9.60-canary.9 → 1.0.1-canary.0
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 +1 -12
- package/cjs/index.js +16 -47
- package/cjs/src/guidelines/scalarConstant/scalarConstant.generate.json +24 -20
- package/cjs/src/guidelines/scalarConstant/scalarConstant.instruction.md +284 -326
- package/cjs/src/guidelines/scalarDictionary/scalarDictionary.generate.json +32 -32
- package/cjs/src/guidelines/scalarDictionary/scalarDictionary.instruction.md +175 -249
- package/cjs/src/templates/app/app/[lang]/page.js +19 -36
- package/cjs/src/templates/workspaceRoot/package.json.template +6 -5
- package/esm/index.js +16 -47
- package/esm/src/guidelines/scalarConstant/scalarConstant.generate.json +24 -20
- package/esm/src/guidelines/scalarConstant/scalarConstant.instruction.md +284 -326
- package/esm/src/guidelines/scalarDictionary/scalarDictionary.generate.json +32 -32
- package/esm/src/guidelines/scalarDictionary/scalarDictionary.instruction.md +175 -249
- package/esm/src/templates/app/app/[lang]/page.js +19 -36
- package/esm/src/templates/workspaceRoot/package.json.template +6 -5
- package/package.json +6 -4
- package/src/guidelines/scalarConstant/scalarConstant.instruction.md +284 -326
- package/src/guidelines/scalarDictionary/scalarDictionary.instruction.md +175 -249
- package/src/library/library.command.d.ts +0 -2
- package/src/library/library.runner.d.ts +0 -2
- package/src/library/library.script.d.ts +0 -2
- package/src/scalar/scalar.command.d.ts +1 -1
- package/cjs/src/guidelines/fieldDecorator/fieldDecorator.generate.json +0 -135
- package/cjs/src/guidelines/fieldDecorator/fieldDecorator.instruction.md +0 -606
- package/esm/src/guidelines/fieldDecorator/fieldDecorator.generate.json +0 -135
- package/esm/src/guidelines/fieldDecorator/fieldDecorator.instruction.md +0 -606
- package/src/guidelines/fieldDecorator/fieldDecorator.instruction.md +0 -606
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The official command-line interface for the Akan.js ecosystem, providing powerfu
|
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
|
-
- Node.js >=
|
|
9
|
+
- Node.js >=20.x
|
|
10
10
|
- pnpm >=10.x
|
|
11
11
|
- docker
|
|
12
12
|
- (temporary) access permission to akan-team github organization
|
|
@@ -64,13 +64,11 @@ Complete workspace and project management:
|
|
|
64
64
|
Full-stack application development and deployment:
|
|
65
65
|
|
|
66
66
|
- **🔧 Application Management**
|
|
67
|
-
|
|
68
67
|
- `create-application` - Scaffold new applications with templates
|
|
69
68
|
- `remove-application` - Clean application removal
|
|
70
69
|
- `sync-application` - Synchronize application dependencies
|
|
71
70
|
|
|
72
71
|
- **🏗️ Build System**
|
|
73
|
-
|
|
74
72
|
- `build` - Complete application build
|
|
75
73
|
- `build-backend` - Server-side build optimization
|
|
76
74
|
- `build-frontend` - Client-side build with Next.js
|
|
@@ -79,7 +77,6 @@ Full-stack application development and deployment:
|
|
|
79
77
|
- `build-android` - Android native app compilation
|
|
80
78
|
|
|
81
79
|
- **🚀 Development Server**
|
|
82
|
-
|
|
83
80
|
- `start` - Full-stack development server
|
|
84
81
|
- `start-backend` - GraphQL backend server
|
|
85
82
|
- `start-frontend` - Next.js frontend server with Turbo support
|
|
@@ -88,7 +85,6 @@ Full-stack application development and deployment:
|
|
|
88
85
|
- `start-android` - Android emulator with live reload
|
|
89
86
|
|
|
90
87
|
- **📦 Release Management**
|
|
91
|
-
|
|
92
88
|
- `release-ios` - iOS App Store deployment
|
|
93
89
|
- `release-android` - Google Play deployment
|
|
94
90
|
- `release-source` - Source code release with versioning
|
|
@@ -104,7 +100,6 @@ Full-stack application development and deployment:
|
|
|
104
100
|
Modular library system for code reusability:
|
|
105
101
|
|
|
106
102
|
- **📦 Library Operations**
|
|
107
|
-
|
|
108
103
|
- `create-library` - Create new shared libraries
|
|
109
104
|
- `remove-library` - Clean library removal
|
|
110
105
|
- `sync-library` - Synchronize library dependencies
|
|
@@ -119,7 +114,6 @@ Modular library system for code reusability:
|
|
|
119
114
|
AI-powered module generation and management:
|
|
120
115
|
|
|
121
116
|
- **🤖 Smart Module Creation**
|
|
122
|
-
|
|
123
117
|
- `create-module` - Generate modules with AI assistance
|
|
124
118
|
- `create-scalar` - Create scalar data models
|
|
125
119
|
- `remove-module` - Module cleanup with dependency checks
|
|
@@ -141,12 +135,10 @@ Dynamic page scaffolding:
|
|
|
141
135
|
Seamless cloud services and AI integration:
|
|
142
136
|
|
|
143
137
|
- **🔐 Authentication**
|
|
144
|
-
|
|
145
138
|
- `login` / `logout` - Cloud service authentication
|
|
146
139
|
- User session and credential management
|
|
147
140
|
|
|
148
141
|
- **🤖 AI Development Assistant**
|
|
149
|
-
|
|
150
142
|
- `set-llm` / `reset-llm` - Configure AI language models
|
|
151
143
|
- `ask` - Interactive AI development assistance
|
|
152
144
|
|
|
@@ -244,9 +236,6 @@ akan set-llm
|
|
|
244
236
|
|
|
245
237
|
# Get AI development help
|
|
246
238
|
akan ask "How do I implement user authentication with JWT?"
|
|
247
|
-
|
|
248
|
-
# Deploy to cloud
|
|
249
|
-
akan deploy-akan
|
|
250
239
|
```
|
|
251
240
|
|
|
252
241
|
### Database Operations
|
package/cjs/index.js
CHANGED
|
@@ -1750,7 +1750,8 @@ ${errorMessages}`);
|
|
|
1750
1750
|
const diagnostics = [
|
|
1751
1751
|
...program2.getSemanticDiagnostics(),
|
|
1752
1752
|
...program2.getSyntacticDiagnostics(),
|
|
1753
|
-
|
|
1753
|
+
// Only check declaration diagnostics when declaration emit is enabled
|
|
1754
|
+
...this.config.options.declaration ? program2.getDeclarationDiagnostics() : []
|
|
1754
1755
|
];
|
|
1755
1756
|
const errors = diagnostics.filter((diagnostic) => diagnostic.category === ts3.DiagnosticCategory.Error);
|
|
1756
1757
|
const warnings = diagnostics.filter((diagnostic) => diagnostic.category === ts3.DiagnosticCategory.Warning);
|
|
@@ -4047,7 +4048,11 @@ var LibraryRunner = class {
|
|
|
4047
4048
|
lib.workspace.unsetTsPaths("lib", lib.name);
|
|
4048
4049
|
}
|
|
4049
4050
|
async installLibrary(workspace, libName) {
|
|
4050
|
-
|
|
4051
|
+
workspace.mkdir("node_modules/.akan");
|
|
4052
|
+
if (workspace.exists("node_modules/.akan/akanjs"))
|
|
4053
|
+
await workspace.removeDir("node_modules/.akan/akanjs");
|
|
4054
|
+
await workspace.exec(`cd node_modules/.akan && git clone git@github.com:akan-team/akanjs.git`);
|
|
4055
|
+
await workspace.cp(`node_modules/.akan/akanjs/libs/${libName}`, `libs/${libName}`);
|
|
4051
4056
|
await workspace.cp(`libs/${libName}/env/env.server.example.ts`, `libs/${libName}/env/env.server.testing.ts`);
|
|
4052
4057
|
workspace.setTsPaths("lib", libName);
|
|
4053
4058
|
await workspace.commit(`Add ${libName} library`);
|
|
@@ -4079,16 +4084,6 @@ var LibraryRunner = class {
|
|
|
4079
4084
|
await lib.workspace.spawn("pnpm", ["install", "--reporter=silent"]);
|
|
4080
4085
|
await lib.workspace.commit(`Merge ${lib.name} library dependencies`);
|
|
4081
4086
|
}
|
|
4082
|
-
async pushLibrary(lib, branch) {
|
|
4083
|
-
await lib.workspace.exec(
|
|
4084
|
-
`git subtree push --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
4085
|
-
);
|
|
4086
|
-
}
|
|
4087
|
-
async pullLibrary(lib, branch) {
|
|
4088
|
-
await lib.workspace.exec(
|
|
4089
|
-
`git subtree pull --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
4090
|
-
);
|
|
4091
|
-
}
|
|
4092
4087
|
#getEnv(lib, env = {}) {
|
|
4093
4088
|
const rootEnv = import_dotenv2.default.parse(lib.workspace.readFile(".env"));
|
|
4094
4089
|
return {
|
|
@@ -4144,19 +4139,6 @@ var LibraryScript = class {
|
|
|
4144
4139
|
await this.#runner.mergeLibraryDependencies(lib);
|
|
4145
4140
|
mergeSpinner.succeed(`${libName} library (libs/${libName}) dependencies merged to root package.json`);
|
|
4146
4141
|
}
|
|
4147
|
-
async pushLibrary(lib, branch) {
|
|
4148
|
-
const pushSpinner = lib.spinning("Pushing library...");
|
|
4149
|
-
await this.#runner.pushLibrary(lib, branch);
|
|
4150
|
-
pushSpinner.succeed(`Library ${lib.name} (libs/${lib.name}) pushed to ${branch} branch`);
|
|
4151
|
-
}
|
|
4152
|
-
async pullLibrary(lib, branch) {
|
|
4153
|
-
const pullSpinner = lib.spinning("Pulling library...");
|
|
4154
|
-
await this.#runner.pullLibrary(lib, branch);
|
|
4155
|
-
pullSpinner.succeed(`Library ${lib.name} (libs/${lib.name}) pulled from ${branch} branch`);
|
|
4156
|
-
const mergeSpinner = lib.spinning("Merging library dependencies...");
|
|
4157
|
-
await this.#runner.mergeLibraryDependencies(lib);
|
|
4158
|
-
mergeSpinner.succeed(`Library ${lib.name} (libs/${lib.name}) dependencies merged to root package.json`);
|
|
4159
|
-
}
|
|
4160
4142
|
async testLibrary(lib) {
|
|
4161
4143
|
const spinner = lib.spinning("Testing library...");
|
|
4162
4144
|
await this.#runner.testLibrary(lib);
|
|
@@ -6049,12 +6031,6 @@ var LibraryCommand = class {
|
|
|
6049
6031
|
async installLibrary(libName, workspace) {
|
|
6050
6032
|
await this.libraryScript.installLibrary(workspace, libName);
|
|
6051
6033
|
}
|
|
6052
|
-
async pushLibrary(lib, branch) {
|
|
6053
|
-
await this.libraryScript.pushLibrary(lib, branch);
|
|
6054
|
-
}
|
|
6055
|
-
async pullLibrary(lib, branch) {
|
|
6056
|
-
await this.libraryScript.pullLibrary(lib, branch);
|
|
6057
|
-
}
|
|
6058
6034
|
};
|
|
6059
6035
|
__decorateClass([
|
|
6060
6036
|
Target.Public(),
|
|
@@ -6074,16 +6050,6 @@ __decorateClass([
|
|
|
6074
6050
|
__decorateParam(0, Argument("libName", { desc: "name of library", nullable: true })),
|
|
6075
6051
|
__decorateParam(1, Workspace())
|
|
6076
6052
|
], LibraryCommand.prototype, "installLibrary", 1);
|
|
6077
|
-
__decorateClass([
|
|
6078
|
-
Target.Public({ devOnly: true }),
|
|
6079
|
-
__decorateParam(0, Lib()),
|
|
6080
|
-
__decorateParam(1, Option("branch", { desc: "branch to push", default: "main" }))
|
|
6081
|
-
], LibraryCommand.prototype, "pushLibrary", 1);
|
|
6082
|
-
__decorateClass([
|
|
6083
|
-
Target.Public(),
|
|
6084
|
-
__decorateParam(0, Lib()),
|
|
6085
|
-
__decorateParam(1, Option("branch", { desc: "branch to pull", default: "main" }))
|
|
6086
|
-
], LibraryCommand.prototype, "pullLibrary", 1);
|
|
6087
6053
|
LibraryCommand = __decorateClass([
|
|
6088
6054
|
Commands()
|
|
6089
6055
|
], LibraryCommand);
|
|
@@ -7330,8 +7296,8 @@ var ScalarPrompt = class extends Prompter {
|
|
|
7330
7296
|
}
|
|
7331
7297
|
async requestCreateConstant() {
|
|
7332
7298
|
const constantFiles = await this.sys.getConstantFilesWithLibs();
|
|
7333
|
-
const description = await (0, import_prompts10.input)({ message: "description of scalar
|
|
7334
|
-
const schemaDescription = await (0, import_prompts10.input)({ message: "schema description of scalar
|
|
7299
|
+
const description = await (0, import_prompts10.input)({ message: "description of scalar" });
|
|
7300
|
+
const schemaDescription = await (0, import_prompts10.input)({ message: "schema description of scalar" });
|
|
7335
7301
|
await this.sys.applyTemplate({
|
|
7336
7302
|
basePath: "./lib/__scalar",
|
|
7337
7303
|
template: "__scalar",
|
|
@@ -7492,7 +7458,9 @@ var ScalarScript = class {
|
|
|
7492
7458
|
// pkgs/@akanjs/cli/src/scalar/scalar.command.ts
|
|
7493
7459
|
var ScalarCommand = class {
|
|
7494
7460
|
scalarScript = new ScalarScript();
|
|
7495
|
-
async createScalar(scalarName, sys3) {
|
|
7461
|
+
async createScalar(scalarName, ai, sys3) {
|
|
7462
|
+
if (ai)
|
|
7463
|
+
await this.scalarScript.createScalarWithAi(sys3, lowerlize(scalarName.replace(/ /g, "")));
|
|
7496
7464
|
await this.scalarScript.createScalar(sys3, lowerlize(scalarName.replace(/ /g, "")));
|
|
7497
7465
|
}
|
|
7498
7466
|
async removeScalar(scalarName, sys3) {
|
|
@@ -7501,12 +7469,13 @@ var ScalarCommand = class {
|
|
|
7501
7469
|
};
|
|
7502
7470
|
__decorateClass([
|
|
7503
7471
|
Target.Public(),
|
|
7504
|
-
__decorateParam(0, Argument("scalarName", { desc: "name of scalar
|
|
7505
|
-
__decorateParam(1,
|
|
7472
|
+
__decorateParam(0, Argument("scalarName", { desc: "name of scalar" })),
|
|
7473
|
+
__decorateParam(1, Option("ai", { type: "boolean", default: false, desc: "use ai to create scalar" })),
|
|
7474
|
+
__decorateParam(2, Sys())
|
|
7506
7475
|
], ScalarCommand.prototype, "createScalar", 1);
|
|
7507
7476
|
__decorateClass([
|
|
7508
7477
|
Target.Public(),
|
|
7509
|
-
__decorateParam(0, Argument("scalarName", { desc: "name of scalar
|
|
7478
|
+
__decorateParam(0, Argument("scalarName", { desc: "name of scalar" })),
|
|
7510
7479
|
__decorateParam(1, Sys())
|
|
7511
7480
|
], ScalarCommand.prototype, "removeScalar", 1);
|
|
7512
7481
|
ScalarCommand = __decorateClass([
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"type": "source",
|
|
17
|
-
"description": "scalar
|
|
18
|
-
"path": "pkgs/@akanjs/constant/src/
|
|
17
|
+
"description": "via() function and scalar implementation",
|
|
18
|
+
"path": "pkgs/@akanjs/constant/src/baseGql.ts"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"type": "source",
|
|
@@ -72,30 +72,34 @@
|
|
|
72
72
|
"Purpose of scalar constants in Akan.js",
|
|
73
73
|
"File structure and location conventions",
|
|
74
74
|
"Naming standards for directories, files, classes and enums",
|
|
75
|
-
"Required imports and
|
|
76
|
-
"
|
|
77
|
-
"Field definitions with
|
|
78
|
-
"Field options reference table",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
75
|
+
"Required imports from @akanjs/constant and @akanjs/base",
|
|
76
|
+
"Basic syntax with via() function",
|
|
77
|
+
"Field definitions with field() helper function",
|
|
78
|
+
"Field options reference table (default, min, max, minlength, maxlength, validate, example)",
|
|
79
|
+
"Available field types (String, Int, Float, Boolean, Date, ID)",
|
|
80
|
+
"Array fields using bracket notation [Type]",
|
|
81
|
+
"Optional fields using .optional() chain method",
|
|
82
|
+
"Enum definition with enumOf(name, values) class pattern",
|
|
83
|
+
"Instance methods in scalar classes",
|
|
82
84
|
"Static methods in scalar classes",
|
|
83
|
-
"Validation rules and checklists",
|
|
84
85
|
"Common mistakes and fixes",
|
|
86
|
+
"Implementation checklist",
|
|
85
87
|
"Full examples of scalar.constant.ts files"
|
|
86
88
|
],
|
|
87
89
|
"rules": [
|
|
88
|
-
"One scalar.constant.ts should contain only one
|
|
89
|
-
"The directory and filename convention is camelCase, such as `
|
|
90
|
-
"The class name should be PascalCase, matching the camelCase directory name (e.g.,
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
90
|
+
"One scalar.constant.ts should contain only one scalar class extending via(). If you need more than one scalar model, make another scalar.constant.ts file.",
|
|
91
|
+
"The directory and filename convention is camelCase, such as `encourageInfo/encourageInfo.constant.ts`",
|
|
92
|
+
"The class name should be PascalCase, matching the camelCase directory name (e.g., EncourageInfo for encourageInfo)",
|
|
93
|
+
"Use `extends via((field) => ({...}))` pattern to define scalar classes, not decorators",
|
|
94
|
+
"Import `via` from `@akanjs/constant` and `enumOf`, `ID`, `Int`, `Float`, `dayjs` from `@akanjs/base`",
|
|
95
|
+
"The values of enum strings must be camelCase (e.g., 'waitPay', not 'WAIT_PAY')",
|
|
96
|
+
"Define enums using class pattern: `export class EnumName extends enumOf('enumName', [...] as const) {}`",
|
|
97
|
+
"The first argument of enumOf() is the enum name string used in dictionary/GraphQL",
|
|
98
|
+
"Use .optional() chain method for nullable fields, not { nullable: true } option",
|
|
97
99
|
"Use bracket notation for arrays ([Type]) rather than generics (Array<Type>)",
|
|
98
|
-
"
|
|
100
|
+
"Use factory functions for dynamic defaults: { default: () => dayjs() }, not { default: dayjs() }",
|
|
101
|
+
"Always export both the scalar class and enum classes",
|
|
102
|
+
"Add 'as const' to enum value arrays for better TypeScript type inference"
|
|
99
103
|
]
|
|
100
104
|
},
|
|
101
105
|
"page": "/[lang]/akanjs/(docs)/docs/scalar/constant/page.tsx"
|