@akanjs/cli 0.0.146 → 0.0.148
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 +7 -26
- package/cjs/index.js +186 -21
- package/cjs/src/guidelines/cssRule/cssRule.instruction.md +1 -1
- package/cjs/src/guidelines/docPageRule/docPageRule.instruction.md +59 -52
- package/cjs/src/guidelines/modelConstant/modelConstant.instruction.md +335 -752
- package/cjs/src/guidelines/modelTemplate/modelTemplate.instruction.md +418 -391
- package/cjs/src/guidelines/modelUnit/modelUnit.instruction.md +0 -292
- package/cjs/src/guidelines/scalarModule/scalarModule.instruction.md +84 -0
- package/cjs/src/templates/app/main.js +1 -2
- package/esm/index.js +194 -29
- package/esm/src/guidelines/cssRule/cssRule.instruction.md +1 -1
- package/esm/src/guidelines/docPageRule/docPageRule.instruction.md +59 -52
- package/esm/src/guidelines/modelConstant/modelConstant.instruction.md +335 -752
- package/esm/src/guidelines/modelTemplate/modelTemplate.instruction.md +418 -391
- package/esm/src/guidelines/modelUnit/modelUnit.instruction.md +0 -292
- package/esm/src/guidelines/scalarModule/scalarModule.instruction.md +84 -0
- package/esm/src/templates/app/main.js +1 -2
- package/package.json +1 -1
- package/src/guideline/guideline.command.d.ts +3 -1
- package/src/guideline/guideline.prompt.d.ts +15 -1
- package/src/guideline/guideline.runner.d.ts +17 -3
- package/src/guideline/guideline.script.d.ts +8 -2
- package/src/guidelines/cssRule/cssRule.instruction.md +1 -1
- package/src/guidelines/docPageRule/docPageRule.instruction.md +59 -52
- package/src/guidelines/modelConstant/modelConstant.instruction.md +335 -752
- package/src/guidelines/modelTemplate/modelTemplate.instruction.md +418 -391
- package/src/guidelines/modelUnit/modelUnit.instruction.md +0 -292
- package/src/guidelines/scalarModule/scalarModule.instruction.md +84 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# ⚡
|
|
1
|
+
# ⚡ Akan.js CLI
|
|
2
2
|
|
|
3
|
-
The official command-line interface for the
|
|
3
|
+
The official command-line interface for the Akan.js ecosystem, providing powerful development tools for creating, managing, and deploying modern web applications with ease.
|
|
4
4
|
|
|
5
5
|
## 🚀 Get Started
|
|
6
6
|
|
|
@@ -42,7 +42,7 @@ akan set-llm
|
|
|
42
42
|
# create module
|
|
43
43
|
akan create-module
|
|
44
44
|
|
|
45
|
-
# create scalar
|
|
45
|
+
# create scalar
|
|
46
46
|
akan create-scalar
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -55,7 +55,7 @@ The `@akanjs/cli` is a comprehensive development toolkit that streamlines the en
|
|
|
55
55
|
Complete workspace and project management:
|
|
56
56
|
|
|
57
57
|
- **🚀 Project Initialization**
|
|
58
|
-
- `create-workspace` - Create new
|
|
58
|
+
- `create-workspace` - Create new Akan.js workspace with organization setup
|
|
59
59
|
- `generate-mongo` - Generate MongoDB configuration and setup
|
|
60
60
|
- `lint` / `lint-all` - Code linting with auto-fix capabilities
|
|
61
61
|
|
|
@@ -151,7 +151,7 @@ Seamless cloud services and AI integration:
|
|
|
151
151
|
- `ask` - Interactive AI development assistance
|
|
152
152
|
|
|
153
153
|
- **🚀 Deployment**
|
|
154
|
-
- `deploy-akan` - Deploy to
|
|
154
|
+
- `deploy-akan` - Deploy to Akan.js cloud infrastructure
|
|
155
155
|
- `update` - Update CLI and cloud integrations
|
|
156
156
|
|
|
157
157
|
### 📦 **Package Operations** (`package`)
|
|
@@ -265,25 +265,6 @@ akan pull-database web-app --env debug --dump
|
|
|
265
265
|
akan dbup
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
-
## 🏗️ Architecture
|
|
269
|
-
|
|
270
|
-
The CLI follows a modular command structure:
|
|
271
|
-
|
|
272
|
-
```
|
|
273
|
-
pkgs/@akanjs/cli/
|
|
274
|
-
├── src/
|
|
275
|
-
│ ├── workspace/ # Workspace management commands
|
|
276
|
-
│ ├── application/ # Application lifecycle commands
|
|
277
|
-
│ ├── library/ # Library management commands
|
|
278
|
-
│ ├── module/ # AI-powered module generation
|
|
279
|
-
│ ├── page/ # Page scaffolding commands
|
|
280
|
-
│ ├── package/ # NPM package operations
|
|
281
|
-
│ ├── cloud/ # Cloud services integration
|
|
282
|
-
│ └── templates/ # Code generation templates
|
|
283
|
-
├── index.ts # CLI entry point
|
|
284
|
-
└── package.json # Dependencies and configuration
|
|
285
|
-
```
|
|
286
|
-
|
|
287
268
|
## 🤖 AI-Powered Development
|
|
288
269
|
|
|
289
270
|
The CLI integrates advanced AI capabilities:
|
|
@@ -314,7 +295,7 @@ The CLI integrates advanced AI capabilities:
|
|
|
314
295
|
|
|
315
296
|
## 📄 License
|
|
316
297
|
|
|
317
|
-
This project is part of the
|
|
298
|
+
This project is part of the Akan.js ecosystem. See the main repository for license information.
|
|
318
299
|
|
|
319
300
|
## 🔗 Related Packages
|
|
320
301
|
|
|
@@ -327,5 +308,5 @@ This project is part of the AkanJS ecosystem. See the main repository for licens
|
|
|
327
308
|
---
|
|
328
309
|
|
|
329
310
|
<p align="center">
|
|
330
|
-
<strong>Built with ❤️ by the
|
|
311
|
+
<strong>Built with ❤️ by the Akan.js team</strong>
|
|
331
312
|
</p>
|
package/cjs/index.js
CHANGED
|
@@ -602,7 +602,7 @@ var withBase = (appName, config, libs, routes = []) => {
|
|
|
602
602
|
eslint: { ...config.eslint, ignoreDuringBuilds: true },
|
|
603
603
|
env: {
|
|
604
604
|
...config.env,
|
|
605
|
-
basePaths: routes.map(({ basePath: basePath2 }) => basePath2).join(",")
|
|
605
|
+
basePaths: [...new Set(routes.map(({ basePath: basePath2 }) => basePath2))].join(",")
|
|
606
606
|
},
|
|
607
607
|
transpilePackages: ["swiper", "ssr-window", "dom7"],
|
|
608
608
|
reactStrictMode: commandType === "start" ? false : true,
|
|
@@ -768,6 +768,7 @@ CMD ["npm", "start"]`,
|
|
|
768
768
|
config.libs ?? [],
|
|
769
769
|
config.frontend?.routes
|
|
770
770
|
),
|
|
771
|
+
routes: config.frontend?.routes,
|
|
771
772
|
explicitDependencies: config.frontend?.explicitDependencies ?? []
|
|
772
773
|
},
|
|
773
774
|
mobile: {
|
|
@@ -1251,7 +1252,10 @@ ${errorMessages}`);
|
|
|
1251
1252
|
];
|
|
1252
1253
|
const errors = diagnostics.filter((diagnostic) => diagnostic.category === ts3.DiagnosticCategory.Error);
|
|
1253
1254
|
const warnings = diagnostics.filter((diagnostic) => diagnostic.category === ts3.DiagnosticCategory.Warning);
|
|
1254
|
-
|
|
1255
|
+
const fileDiagnostics = diagnostics.filter((diagnostic) => diagnostic.file?.fileName === filePath);
|
|
1256
|
+
const fileErrors = fileDiagnostics.filter((diagnostic) => diagnostic.category === ts3.DiagnosticCategory.Error);
|
|
1257
|
+
const fileWarnings = fileDiagnostics.filter((diagnostic) => diagnostic.category === ts3.DiagnosticCategory.Warning);
|
|
1258
|
+
return { diagnostics, errors, warnings, fileDiagnostics, fileErrors, fileWarnings };
|
|
1255
1259
|
}
|
|
1256
1260
|
/**
|
|
1257
1261
|
* Format diagnostics for console output
|
|
@@ -1678,9 +1682,9 @@ var Executor = class _Executor {
|
|
|
1678
1682
|
typeCheck(filePath) {
|
|
1679
1683
|
const path9 = this.getPath(filePath);
|
|
1680
1684
|
const typeChecker = this.getTypeChecker();
|
|
1681
|
-
const {
|
|
1682
|
-
const message = typeChecker.formatDiagnostics(
|
|
1683
|
-
return {
|
|
1685
|
+
const { fileDiagnostics, fileErrors, fileWarnings } = typeChecker.check(path9);
|
|
1686
|
+
const message = typeChecker.formatDiagnostics(fileDiagnostics);
|
|
1687
|
+
return { fileDiagnostics, fileErrors, fileWarnings, message };
|
|
1684
1688
|
}
|
|
1685
1689
|
getLinter() {
|
|
1686
1690
|
this.linter ??= new Linter(this.cwdPath);
|
|
@@ -3105,7 +3109,7 @@ ${validate.map((v) => `- ${v}`).join("\n")}`;
|
|
|
3105
3109
|
writes.map(async ({ filePath }) => {
|
|
3106
3110
|
const typeCheckResult = executor.typeCheck(filePath);
|
|
3107
3111
|
const lintResult = await executor.lint(filePath);
|
|
3108
|
-
const needFix2 = !!typeCheckResult.
|
|
3112
|
+
const needFix2 = !!typeCheckResult.fileErrors.length || !!lintResult.errors.length;
|
|
3109
3113
|
return { filePath, typeCheckResult, lintResult, needFix: needFix2 };
|
|
3110
3114
|
})
|
|
3111
3115
|
);
|
|
@@ -3139,7 +3143,7 @@ ${fileCheck.lintResult.message}`
|
|
|
3139
3143
|
throw new Error("Failed to create scalar");
|
|
3140
3144
|
}
|
|
3141
3145
|
#getTypescriptCodes(text) {
|
|
3142
|
-
const codes = text.match(/```typescript([\s\S]*?)```/g);
|
|
3146
|
+
const codes = text.match(/```(typescript|tsx)([\s\S]*?)```/g);
|
|
3143
3147
|
if (!codes)
|
|
3144
3148
|
return [];
|
|
3145
3149
|
const result = codes.map((code) => {
|
|
@@ -3264,6 +3268,9 @@ var Prompter = class {
|
|
|
3264
3268
|
const content = await import_promises2.default.readFile(filePath, "utf-8");
|
|
3265
3269
|
return content;
|
|
3266
3270
|
}
|
|
3271
|
+
static async getUpdateRequest(guideName) {
|
|
3272
|
+
return await (0, import_prompts5.input)({ message: `What do you want to update in ${guideName}?` });
|
|
3273
|
+
}
|
|
3267
3274
|
async makeTsFileUpdatePrompt({ context: context2, request }) {
|
|
3268
3275
|
return `You are a senior developer writing TypeScript-based programs using Akan.js, an in-house framework. Here's an overview of the Akan.js framework:
|
|
3269
3276
|
${await this.getDocumentation("framework")}
|
|
@@ -3580,6 +3587,8 @@ var ApplicationRunner = class {
|
|
|
3580
3587
|
async #getViteConfig(app, command) {
|
|
3581
3588
|
const { env } = await this.#prepareCommand(app, command, "csr");
|
|
3582
3589
|
const tsconfig = app.workspace.getTsConfig();
|
|
3590
|
+
const akanConfig = await app.getConfig();
|
|
3591
|
+
const basePaths = akanConfig.frontend.routes ? [...new Set(akanConfig.frontend.routes.map(({ basePath: basePath2 }) => basePath2))].join(",") : void 0;
|
|
3583
3592
|
const processEnv = env;
|
|
3584
3593
|
const akanjsPrefix = process.env.USE_AKANJS_PKGS === "true" ? `${app.workspace.workspaceRoot}/pkgs/` : "";
|
|
3585
3594
|
const config = vite.defineConfig({
|
|
@@ -3643,7 +3652,8 @@ var ApplicationRunner = class {
|
|
|
3643
3652
|
APP_OPERATION_MODE: processEnv.APP_OPERATION_MODE ?? "local",
|
|
3644
3653
|
AKAN_WORKSPACE_ROOT: app.workspace.workspaceRoot,
|
|
3645
3654
|
AKAN_APP_ROOT: app.cwdPath,
|
|
3646
|
-
RENDER_ENV: "csr"
|
|
3655
|
+
RENDER_ENV: "csr",
|
|
3656
|
+
basePaths
|
|
3647
3657
|
},
|
|
3648
3658
|
"process.platform": JSON.stringify("browser"),
|
|
3649
3659
|
"process.version": JSON.stringify(process.version)
|
|
@@ -3953,7 +3963,11 @@ var ApplicationScript = class {
|
|
|
3953
3963
|
await this.syncApplication(app);
|
|
3954
3964
|
if (app.workspace.getBaseDevEnv().env === "local")
|
|
3955
3965
|
await this.dbup(app.workspace);
|
|
3956
|
-
await Promise.all([
|
|
3966
|
+
await Promise.all([
|
|
3967
|
+
this.startBackend(app, { open: open2, sync: false }),
|
|
3968
|
+
this.startFrontend(app, { open: open2, sync: false }),
|
|
3969
|
+
this.startCsr(app, { open: open2, sync: false })
|
|
3970
|
+
]);
|
|
3957
3971
|
}
|
|
3958
3972
|
async buildBackend(app, { sync = true } = {}) {
|
|
3959
3973
|
if (sync)
|
|
@@ -5494,7 +5508,9 @@ var GuidelinePrompt = class extends Prompter {
|
|
|
5494
5508
|
});
|
|
5495
5509
|
const paths = [];
|
|
5496
5510
|
for await (const path9 of matchingPaths) {
|
|
5497
|
-
|
|
5511
|
+
const fileContent = import_fs12.default.readFileSync(path9, "utf-8");
|
|
5512
|
+
const textFilter = filterText ? new RegExp(filterText) : null;
|
|
5513
|
+
if (filterText && !textFilter?.test(fileContent))
|
|
5498
5514
|
continue;
|
|
5499
5515
|
paths.push(path9);
|
|
5500
5516
|
}
|
|
@@ -5547,10 +5563,39 @@ ${guideJson.update.rules.map((rule) => `- ${rule}`).join("\n")}
|
|
|
5547
5563
|
|
|
5548
5564
|
=> Now, you need to write the file content here. Let's go.
|
|
5549
5565
|
`;
|
|
5550
|
-
return { request, writePath };
|
|
5566
|
+
return { guideJson, request, writePath };
|
|
5551
5567
|
}
|
|
5552
|
-
async
|
|
5553
|
-
const
|
|
5568
|
+
async requestUpdateInstruction(updateRequest) {
|
|
5569
|
+
const guideJson = await Prompter.getGuideJson(this.name);
|
|
5570
|
+
const resultPath = `${__dirname}/src/guidelines/${this.name}/${guideJson.update.filePath}`;
|
|
5571
|
+
const writePath = `${this.workspace.workspaceRoot}/pkgs/@akanjs/cli/src/guidelines/${this.name}/${guideJson.update.filePath}`;
|
|
5572
|
+
const isResultExists = this.workspace.exists(writePath);
|
|
5573
|
+
if (!isResultExists)
|
|
5574
|
+
throw new Error(`${guideJson.update.filePath} file does not exist. Please create it first.`);
|
|
5575
|
+
const existingResult = this.workspace.readFile(resultPath);
|
|
5576
|
+
const request = `
|
|
5577
|
+
I am a developer of akanjs framework, a full-stack framework for building web applications.
|
|
5578
|
+
I want to update a ${guideJson.update.filePath} file for ${guideJson.description}.
|
|
5579
|
+
This file is a programming guideline for Akan.js framwork users.
|
|
5580
|
+
|
|
5581
|
+
# ${guideJson.title} Workflow
|
|
5582
|
+
- 1. Read already-written ${guideJson.update.filePath} file.
|
|
5583
|
+
- 2. Write the updated file content of the ${guideJson.update.filePath} with the update request.
|
|
5584
|
+
|
|
5585
|
+
## 1. Read already-written ${guideJson.update.filePath} file.
|
|
5586
|
+
\`\`\`markdown
|
|
5587
|
+
${existingResult}
|
|
5588
|
+
\`\`\`
|
|
5589
|
+
|
|
5590
|
+
## 2. Write the updated file content of the ${guideJson.update.filePath} with the update request.
|
|
5591
|
+
Request: ${updateRequest}
|
|
5592
|
+
|
|
5593
|
+
=> Now, you need to write the file content here. Let's go.
|
|
5594
|
+
`;
|
|
5595
|
+
return { guideJson, request, writePath };
|
|
5596
|
+
}
|
|
5597
|
+
async requestCreateDocumentPage(page) {
|
|
5598
|
+
const writePath = `apps/angelo/app${page}`;
|
|
5554
5599
|
if (!this.workspace.exists(writePath))
|
|
5555
5600
|
this.workspace.writeFile(
|
|
5556
5601
|
writePath,
|
|
@@ -5592,6 +5637,69 @@ Please return only the file result in the following format for easy parsing.
|
|
|
5592
5637
|
// File: ${writePath}
|
|
5593
5638
|
...pageContent
|
|
5594
5639
|
\`\`\`
|
|
5640
|
+
`;
|
|
5641
|
+
return { request, writePath };
|
|
5642
|
+
}
|
|
5643
|
+
async requestUpdateDocumentPage(page, updateRequest) {
|
|
5644
|
+
const writePath = `apps/angelo/app${page}`;
|
|
5645
|
+
if (!this.workspace.exists(writePath))
|
|
5646
|
+
this.workspace.writeFile(
|
|
5647
|
+
writePath,
|
|
5648
|
+
`export default function Page() {
|
|
5649
|
+
return <div>No Content</div>;
|
|
5650
|
+
}
|
|
5651
|
+
`
|
|
5652
|
+
);
|
|
5653
|
+
const instruction = await Prompter.getInstruction(this.name);
|
|
5654
|
+
const pageContent = this.workspace.getLocalFile(writePath);
|
|
5655
|
+
const request = `
|
|
5656
|
+
I'm updating a documentation website for the Akan.js framework.
|
|
5657
|
+
|
|
5658
|
+
I want to update the Next.js server-side page located at ${writePath}.
|
|
5659
|
+
Below is the content of the currently written page. You should update stale infos and preserve the existing content.
|
|
5660
|
+
\`\`\`tsx
|
|
5661
|
+
// File: ${writePath}
|
|
5662
|
+
${pageContent.content}
|
|
5663
|
+
\`\`\`
|
|
5664
|
+
|
|
5665
|
+
The existing instruction is below.
|
|
5666
|
+
\`\`\`markdown
|
|
5667
|
+
${instruction}
|
|
5668
|
+
\`\`\`
|
|
5669
|
+
|
|
5670
|
+
Please update this page with the request below.
|
|
5671
|
+
${updateRequest}
|
|
5672
|
+
|
|
5673
|
+
Please return only the file result in the following format for easy parsing.
|
|
5674
|
+
\`\`\`tsx
|
|
5675
|
+
// File: ${writePath}
|
|
5676
|
+
...pageContent
|
|
5677
|
+
\`\`\`
|
|
5678
|
+
`;
|
|
5679
|
+
return { request, writePath };
|
|
5680
|
+
}
|
|
5681
|
+
async requestReapplyInstruction(filePath) {
|
|
5682
|
+
const guideJson = await Prompter.getGuideJson(this.name);
|
|
5683
|
+
const writePath = `${this.workspace.workspaceRoot}/pkgs/@akanjs/cli/src/guidelines/${this.name}/${guideJson.update.filePath}`;
|
|
5684
|
+
if (!guideJson.page)
|
|
5685
|
+
throw new Error(`${this.name} does not have a page.`);
|
|
5686
|
+
const pagePath = `apps/angelo/app${guideJson.page}`;
|
|
5687
|
+
const pageFile = this.workspace.getLocalFile(pagePath);
|
|
5688
|
+
const request = `
|
|
5689
|
+
I want to apply information in the Next.js page to markdown instruction file.
|
|
5690
|
+
|
|
5691
|
+
Here's the newest information in the Next.js page.
|
|
5692
|
+
\`\`\`tsx
|
|
5693
|
+
// File: ${pagePath}
|
|
5694
|
+
${pageFile.content}
|
|
5695
|
+
\`\`\`
|
|
5696
|
+
|
|
5697
|
+
Here's the existing instruction file.
|
|
5698
|
+
\`\`\`markdown
|
|
5699
|
+
${await Prompter.getInstruction(this.name)}
|
|
5700
|
+
\`\`\`
|
|
5701
|
+
|
|
5702
|
+
Please update the instruction file with the information in the Next.js page.
|
|
5595
5703
|
`;
|
|
5596
5704
|
return { request, writePath };
|
|
5597
5705
|
}
|
|
@@ -5602,19 +5710,45 @@ var GuidelineRunner = class {
|
|
|
5602
5710
|
async generateInstruction(workspace, guideName) {
|
|
5603
5711
|
const session = new AiSession("generateInstruction", { workspace, cacheKey: guideName });
|
|
5604
5712
|
const prompt = new GuidelinePrompt(workspace, guideName);
|
|
5605
|
-
const { request, writePath } = await prompt.requestCreateInstruction();
|
|
5713
|
+
const { guideJson, request, writePath } = await prompt.requestCreateInstruction();
|
|
5714
|
+
const guidelineContent = await session.editMarkdown(request);
|
|
5715
|
+
workspace.writeFile(writePath, guidelineContent);
|
|
5716
|
+
return { guideJson, session };
|
|
5717
|
+
}
|
|
5718
|
+
async updateInstruction(workspace, guideName, { updateRequest }) {
|
|
5719
|
+
const session = new AiSession("updateInstruction", { workspace, cacheKey: guideName });
|
|
5720
|
+
const prompt = new GuidelinePrompt(workspace, guideName);
|
|
5721
|
+
const { guideJson, request, writePath } = await prompt.requestUpdateInstruction(updateRequest);
|
|
5606
5722
|
const guidelineContent = await session.editMarkdown(request);
|
|
5607
5723
|
workspace.writeFile(writePath, guidelineContent);
|
|
5724
|
+
return { guideJson, session };
|
|
5608
5725
|
}
|
|
5609
|
-
async
|
|
5726
|
+
async generateDocument(workspace, guideName) {
|
|
5610
5727
|
const session = new AiSession("deployDocPages", { workspace, cacheKey: guideName });
|
|
5611
5728
|
const guideJson = await Prompter.getGuideJson(guideName);
|
|
5612
5729
|
const prompt = new GuidelinePrompt(workspace, guideName);
|
|
5613
5730
|
if (!guideJson.page)
|
|
5614
5731
|
return Promise.resolve({});
|
|
5615
|
-
const { request } = await prompt.
|
|
5732
|
+
const { request } = await prompt.requestCreateDocumentPage(guideJson.page);
|
|
5616
5733
|
await session.writeTypescripts(request, workspace);
|
|
5617
5734
|
}
|
|
5735
|
+
async updateDocument(workspace, guideName, { updateRequest, session }) {
|
|
5736
|
+
const guideJson = await Prompter.getGuideJson(guideName);
|
|
5737
|
+
if (!guideJson.page)
|
|
5738
|
+
throw new Error(`${guideName} does not have a page.`);
|
|
5739
|
+
const prompt = new GuidelinePrompt(workspace, guideName);
|
|
5740
|
+
const { request, writePath } = await prompt.requestUpdateDocumentPage(guideJson.page, updateRequest);
|
|
5741
|
+
const guidelineContent = await session.editMarkdown(request);
|
|
5742
|
+
workspace.writeFile(writePath, guidelineContent);
|
|
5743
|
+
}
|
|
5744
|
+
async reapplyInstruction(workspace, guideName) {
|
|
5745
|
+
const session = new AiSession("reapplyInstruction", { workspace, cacheKey: guideName });
|
|
5746
|
+
const guideJson = await Prompter.getGuideJson(guideName);
|
|
5747
|
+
const prompt = new GuidelinePrompt(workspace, guideName);
|
|
5748
|
+
const { request, writePath } = await prompt.requestReapplyInstruction(guideJson.update.filePath);
|
|
5749
|
+
const guidelineContent = await session.editMarkdown(request);
|
|
5750
|
+
workspace.writeFile(writePath, guidelineContent);
|
|
5751
|
+
}
|
|
5618
5752
|
};
|
|
5619
5753
|
|
|
5620
5754
|
// pkgs/@akanjs/cli/src/guideline/guideline.script.ts
|
|
@@ -5624,9 +5758,23 @@ var GuidelineScript = class {
|
|
|
5624
5758
|
const guideName = name ?? await Prompter.selectGuideline();
|
|
5625
5759
|
await this.#runner.generateInstruction(workspace, guideName);
|
|
5626
5760
|
}
|
|
5627
|
-
async
|
|
5761
|
+
async updateInstruction(workspace, name = null, updateRequest) {
|
|
5762
|
+
const guideName = name ?? await Prompter.selectGuideline();
|
|
5763
|
+
const { guideJson, session } = await this.#runner.updateInstruction(workspace, guideName, { updateRequest });
|
|
5764
|
+
if (guideJson.page)
|
|
5765
|
+
await this.updateDocument(workspace, guideName, { updateRequest, session });
|
|
5766
|
+
}
|
|
5767
|
+
async generateDocument(workspace, name = null) {
|
|
5768
|
+
const guideName = name ?? await Prompter.selectGuideline();
|
|
5769
|
+
await this.#runner.generateDocument(workspace, guideName);
|
|
5770
|
+
}
|
|
5771
|
+
async updateDocument(workspace, name = null, { updateRequest, session }) {
|
|
5628
5772
|
const guideName = name ?? await Prompter.selectGuideline();
|
|
5629
|
-
await this.#runner.
|
|
5773
|
+
await this.#runner.updateDocument(workspace, guideName, { updateRequest, session });
|
|
5774
|
+
}
|
|
5775
|
+
async reapplyInstruction(workspace, name = null) {
|
|
5776
|
+
const guideName = name ?? await Prompter.selectGuideline();
|
|
5777
|
+
await this.#runner.reapplyInstruction(workspace, guideName);
|
|
5630
5778
|
}
|
|
5631
5779
|
};
|
|
5632
5780
|
|
|
@@ -5636,8 +5784,14 @@ var GuidelineCommand = class {
|
|
|
5636
5784
|
async generateInstruction(name, workspace) {
|
|
5637
5785
|
await this.guidelineScript.generateInstruction(workspace, name);
|
|
5638
5786
|
}
|
|
5639
|
-
async
|
|
5640
|
-
await this.guidelineScript.
|
|
5787
|
+
async updateInstruction(name, request, workspace) {
|
|
5788
|
+
await this.guidelineScript.updateInstruction(workspace, name, request);
|
|
5789
|
+
}
|
|
5790
|
+
async generateDocument(name, workspace) {
|
|
5791
|
+
await this.guidelineScript.generateDocument(workspace, name);
|
|
5792
|
+
}
|
|
5793
|
+
async reapplyInstruction(name, workspace) {
|
|
5794
|
+
await this.guidelineScript.reapplyInstruction(workspace, name);
|
|
5641
5795
|
}
|
|
5642
5796
|
};
|
|
5643
5797
|
__decorateClass([
|
|
@@ -5645,11 +5799,22 @@ __decorateClass([
|
|
|
5645
5799
|
__decorateParam(0, Argument("name", { ask: "name of the instruction", nullable: true })),
|
|
5646
5800
|
__decorateParam(1, Workspace())
|
|
5647
5801
|
], GuidelineCommand.prototype, "generateInstruction", 1);
|
|
5802
|
+
__decorateClass([
|
|
5803
|
+
Target.Public(),
|
|
5804
|
+
__decorateParam(0, Argument("name", { ask: "name of the instruction", nullable: true })),
|
|
5805
|
+
__decorateParam(1, Option("request", { ask: "What do you want to update?" })),
|
|
5806
|
+
__decorateParam(2, Workspace())
|
|
5807
|
+
], GuidelineCommand.prototype, "updateInstruction", 1);
|
|
5808
|
+
__decorateClass([
|
|
5809
|
+
Target.Public(),
|
|
5810
|
+
__decorateParam(0, Argument("name", { ask: "name of the instruction", nullable: true })),
|
|
5811
|
+
__decorateParam(1, Workspace())
|
|
5812
|
+
], GuidelineCommand.prototype, "generateDocument", 1);
|
|
5648
5813
|
__decorateClass([
|
|
5649
5814
|
Target.Public(),
|
|
5650
5815
|
__decorateParam(0, Argument("name", { ask: "name of the instruction", nullable: true })),
|
|
5651
5816
|
__decorateParam(1, Workspace())
|
|
5652
|
-
], GuidelineCommand.prototype, "
|
|
5817
|
+
], GuidelineCommand.prototype, "reapplyInstruction", 1);
|
|
5653
5818
|
GuidelineCommand = __decorateClass([
|
|
5654
5819
|
Commands()
|
|
5655
5820
|
], GuidelineCommand);
|
|
@@ -180,7 +180,7 @@ export const Card = ({ className, project, href }: ModelProps<"project", cnst.Li
|
|
|
180
180
|
className={clsx(
|
|
181
181
|
"border-base-300 bg-base-100 flex flex-col gap-3 rounded-lg border-2 p-4",
|
|
182
182
|
"hover:border-primary transition-all hover:shadow-md",
|
|
183
|
-
"focus:ring-primary focus:
|
|
183
|
+
"focus:ring-primary focus:ring-2 focus:outline-hidden",
|
|
184
184
|
className
|
|
185
185
|
)}
|
|
186
186
|
>
|