@akanjs/cli 0.0.145 → 0.0.146

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.
@@ -0,0 +1,382 @@
1
+ # Akan.js Documentation Page Creation Guide
2
+
3
+ ## Purpose of Documentation Pages in Akan.js
4
+
5
+ Documentation pages serve as the comprehensive knowledge base for Akan.js framework developers. They:
6
+ - Provide clear explanations of framework concepts, architecture, and components
7
+ - Offer technical reference for APIs, modules, and system functionalities
8
+ - Present implementation examples with real-world code snippets
9
+ - Establish consistent standards for documentation across the framework
10
+ - Support multi-language access for international developers
11
+ - Serve as onboarding resources for new team members
12
+ - Document best practices and common patterns for framework usage
13
+
14
+ ## How to Create a Documentation Page
15
+
16
+ ### 1. File Location and Structure
17
+
18
+ Documentation pages should be created in the following location:
19
+ ```
20
+ apps/angelo/app/[lang]/akanjs/(docs)/docs/[category]/[pageName]/page.tsx
21
+ ```
22
+
23
+ Where:
24
+ - `[lang]`: Language code (e.g., `en`, `ko`)
25
+ - `[category]`: Main documentation category (e.g., `systemArch`, `module`, `api`)
26
+ - `[pageName]`: Specific page name (e.g., `frontend`, `signal`, `authentication`)
27
+
28
+ Example path:
29
+ `apps/angelo/app/en/akanjs/(docs)/docs/module/signal/page.tsx`
30
+
31
+ ### 2. Basic Page Structure
32
+
33
+ Each documentation page follows this basic structure:
34
+
35
+ ```tsx
36
+ import { usePage } from "@angelo/client";
37
+ import { Docs } from "@/ui/Docs";
38
+
39
+ export default function Page() {
40
+ const { l } = usePage(); // For internationalization
41
+
42
+ return (
43
+ <>
44
+ <Docs.Title>
45
+ {l.trans({
46
+ en: "Main Page Title",
47
+ ko: "메인 페이지 제목"
48
+ })}
49
+ </Docs.Title>
50
+
51
+ <Docs.Description>
52
+ {l.trans({
53
+ en: "Introduction paragraph that explains the concept...",
54
+ ko: "개념을 설명하는 소개 문단..."
55
+ })}
56
+ </Docs.Description>
57
+
58
+ <div className="divider"></div>
59
+
60
+ <Docs.SubTitle>
61
+ {l.trans({
62
+ en: "Section Title",
63
+ ko: "섹션 제목"
64
+ })}
65
+ </Docs.SubTitle>
66
+
67
+ <Docs.Description>
68
+ {l.trans({
69
+ en: "Detailed explanation of this section...",
70
+ ko: "이 섹션에 대한 자세한 설명..."
71
+ })}
72
+ </Docs.Description>
73
+
74
+ <Docs.CodeSnippet
75
+ language="typescript"
76
+ code={`
77
+ // Code example
78
+ const example = "Hello Akan.js";
79
+ `}
80
+ />
81
+
82
+ {/* Additional sections and components */}
83
+ </>
84
+ );
85
+ }
86
+ ```
87
+
88
+ ### 3. Page Organization
89
+
90
+ Documentation pages should be organized in a hierarchical structure:
91
+
92
+ 1. **Title**: Main page title (`<Docs.Title>`)
93
+ 2. **Introduction**: Brief overview (`<Docs.Description>`)
94
+ 3. **Sections**: Main content sections
95
+ - Section title (`<Docs.SubTitle>`)
96
+ - Section content (`<Docs.Description>`)
97
+ - Code examples (`<Docs.CodeSnippet>`)
98
+ - Subsections (`<Docs.SubSubTitle>`)
99
+ - Tables (`<Docs.OptionTable>`, `<Docs.IntroTable>`)
100
+ 4. **Related Content**: Links to related documentation pages
101
+
102
+ ### 4. Internationalization
103
+
104
+ All user-facing text must support multiple languages using the translation hook:
105
+
106
+ ```tsx
107
+ const { l } = usePage();
108
+
109
+ <Docs.Title>
110
+ {l.trans({
111
+ en: "English Title",
112
+ ko: "한국어 제목"
113
+ // Add other languages as needed
114
+ })}
115
+ </Docs.Title>
116
+ ```
117
+
118
+ ## Utility Components
119
+
120
+ The `Docs` namespace provides specialized components for creating consistent documentation pages. Always import and use them with the `Docs` prefix:
121
+
122
+ ```tsx
123
+ import { Docs } from "@/ui/Docs";
124
+ // Correct usage: <Docs.Title>, NOT import { Title } from "@/ui/Docs";
125
+ ```
126
+
127
+ ### 1. Title Components
128
+
129
+ ```tsx
130
+ <Docs.Title>Main Page Title</Docs.Title> // H1 equivalent
131
+ <Docs.SubTitle>Section Title</Docs.SubTitle> // H2 equivalent
132
+ <Docs.SubSubTitle>Subsection Title</Docs.SubSubTitle> // H3 equivalent
133
+ ```
134
+
135
+ ### 2. Content Components
136
+
137
+ **Description Block:**
138
+ ```tsx
139
+ <Docs.Description>
140
+ Detailed explanatory text that supports:
141
+ - Markdown-style formatting
142
+ - Multi-paragraph content
143
+ - HTML elements
144
+ - Internationalization via l.trans()
145
+ </Docs.Description>
146
+ ```
147
+
148
+ **Code Snippet:**
149
+ ```tsx
150
+ <Docs.CodeSnippet
151
+ language="typescript" // Supported: typescript, bash, and others
152
+ code={`
153
+ // Your code example with syntax highlighting
154
+ const example = "Hello Akan.js";
155
+ function demo() {
156
+ return example;
157
+ }
158
+ `}
159
+ />
160
+ ```
161
+
162
+ ### 3. Table Components
163
+
164
+ **Option Table:** For displaying configuration options, parameters, or properties
165
+ ```tsx
166
+ <Docs.OptionTable
167
+ items={[
168
+ {
169
+ key: "optionName", // Option identifier
170
+ type: "string", // Data type
171
+ default: "defaultVal", // Default value
172
+ desc: "Description", // Explanation (can use l.trans())
173
+ example: "example()" // Usage example
174
+ },
175
+ // Additional items...
176
+ ]}
177
+ />
178
+ ```
179
+
180
+ **Introduction Table:** For listing and describing related items
181
+ ```tsx
182
+ <Docs.IntroTable
183
+ type="conceptName" // Table category identifier
184
+ items={[
185
+ {
186
+ name: "itemName", // Item name
187
+ desc: "Description", // Explanation (can use l.trans())
188
+ example: "example()" // Usage example
189
+ },
190
+ // Additional items...
191
+ ]}
192
+ />
193
+ ```
194
+
195
+ ### 4. Code Display Components
196
+
197
+ **Inline Code:**
198
+ ```tsx
199
+ <Docs.Code language="typescript">inlineCodeExample</Docs.Code>
200
+ ```
201
+
202
+ **Custom Code Block:**
203
+ ```tsx
204
+ <Docs.CodeView>
205
+ <Docs.Code prefix="1">// First line with line number</Docs.Code>
206
+ <Docs.Code prefix="2">// Second line with line number</Docs.Code>
207
+ </Docs.CodeView>
208
+ ```
209
+
210
+ ### 5. Layout Components
211
+
212
+ The document layout is automatically applied through the parent layout.tsx file, so you don't need to use `<Docs.Layout>` in your page component.
213
+
214
+ **Header and Footer:**
215
+ ```tsx
216
+ <Docs.Header>Header content</Docs.Header>
217
+ <Docs.Footer>Footer content</Docs.Footer>
218
+ ```
219
+
220
+ ## Best Practices
221
+
222
+ ### 1. Content Organization
223
+
224
+ - Begin with a clear, concise introduction that explains the purpose and importance of the topic
225
+ - Use a logical hierarchy of headings (Title → SubTitle → SubSubTitle)
226
+ - Structure content to flow from basic concepts to advanced usage
227
+ - Include a "Getting Started" or "Basic Usage" section near the beginning
228
+ - Group related information under appropriate section headings
229
+ - Maintain consistent terminology throughout the document
230
+
231
+ ### 2. Code Examples
232
+
233
+ - Include complete, working code examples that can be copied and used directly
234
+ - Provide context for each code example to explain what it demonstrates
235
+ - Use realistic, practical examples rather than overly simplified ones
236
+ - Include comments in code examples to explain key points
237
+ - Specify the correct language for proper syntax highlighting
238
+ - Show both basic and advanced usage patterns
239
+
240
+ ### 3. Formatting and Style
241
+
242
+ - Use sentence case for all headings (e.g., "How to use signals" not "How To Use Signals")
243
+ - Keep paragraphs focused on a single concept
244
+ - Use lists for sequential steps or related items
245
+ - Include whitespace (dividers, margins) to separate sections visually
246
+ - Apply consistent formatting across all documentation pages
247
+
248
+ ### 4. Internationalization
249
+
250
+ - Wrap all user-facing text in `l.trans()` calls with at least English and Korean translations
251
+ - Maintain parallel structure and meaning across languages
252
+ - Keep translations concise but complete
253
+ - Use descriptive keys for translation objects
254
+
255
+ ### 5. Performance and Accessibility
256
+
257
+ - Use lazy-loading for heavy components when appropriate
258
+ - Ensure documentation is responsive for both desktop and mobile viewing
259
+ - Include anchor links to specific sections for easy reference
260
+ - Provide alt text for images and diagrams
261
+ - Avoid overly complex or deeply nested components
262
+
263
+ ## Complete Example
264
+
265
+ ```tsx
266
+ import { usePage } from "@angelo/client";
267
+ import { Docs, type IntroItem, type OptionItem } from "@/ui/Docs";
268
+
269
+ export default function SignalDocsPage() {
270
+ const { l } = usePage();
271
+
272
+ // Define configuration options
273
+ const signalOptions: OptionItem[] = [
274
+ {
275
+ key: "initialValue",
276
+ type: "T",
277
+ default: "undefined",
278
+ desc: l.trans({
279
+ en: "Initial value of the signal",
280
+ ko: "시그널의 초기값"
281
+ }),
282
+ example: "signal(0)"
283
+ },
284
+ // Additional options...
285
+ ];
286
+
287
+ // Define feature list
288
+ const signalFeatures: IntroItem[] = [
289
+ {
290
+ name: "createSignal",
291
+ desc: l.trans({
292
+ en: "Creates a new reactive signal",
293
+ ko: "새로운 반응형 시그널을 생성"
294
+ }),
295
+ example: "const [value, setValue] = createSignal(0)"
296
+ },
297
+ // Additional features...
298
+ ];
299
+
300
+ return (
301
+ <>
302
+ <Docs.Title>
303
+ {l.trans({
304
+ en: "Signal Module",
305
+ ko: "시그널 모듈"
306
+ })}
307
+ </Docs.Title>
308
+
309
+ <Docs.Description>
310
+ {l.trans({
311
+ en: "The Signal module provides reactive state management capabilities for Akan.js applications. Signals allow components to efficiently respond to state changes without unnecessary re-renders.",
312
+ ko: "시그널 모듈은 Akan.js 애플리케이션을 위한 반응형 상태 관리 기능을 제공합니다. 시그널을 통해 컴포넌트는 불필요한 재렌더링 없이 상태 변화에 효율적으로 반응할 수 있습니다."
313
+ })}
314
+ </Docs.Description>
315
+
316
+ <div className="divider"></div>
317
+
318
+ <Docs.SubTitle>
319
+ {l.trans({
320
+ en: "Basic Usage",
321
+ ko: "기본 사용법"
322
+ })}
323
+ </Docs.SubTitle>
324
+
325
+ <Docs.Description>
326
+ {l.trans({
327
+ en: "Creating and using signals is straightforward:",
328
+ ko: "시그널 생성 및 사용은 간단합니다:"
329
+ })}
330
+ </Docs.Description>
331
+
332
+ <Docs.CodeSnippet
333
+ language="typescript"
334
+ code={`
335
+ // Create a signal with an initial value
336
+ const count = signal(0);
337
+
338
+ // Read the signal value
339
+ console.log(count()); // 0
340
+
341
+ // Update the signal value
342
+ count(1);
343
+ console.log(count()); // 1
344
+
345
+ // Use in a component
346
+ function Counter() {
347
+ return <div>{count()}</div>;
348
+ }`}
349
+ />
350
+
351
+ <Docs.SubTitle>
352
+ {l.trans({
353
+ en: "Configuration Options",
354
+ ko: "설정 옵션"
355
+ })}
356
+ </Docs.SubTitle>
357
+
358
+ <Docs.OptionTable items={signalOptions} />
359
+
360
+ <Docs.SubTitle>
361
+ {l.trans({
362
+ en: "API Reference",
363
+ ko: "API 참조"
364
+ })}
365
+ </Docs.SubTitle>
366
+
367
+ <Docs.IntroTable type="function" items={signalFeatures} />
368
+ </>
369
+ );
370
+ }
371
+ ```
372
+
373
+ ## Troubleshooting
374
+
375
+ 1. **Layout Issues**: Do not manually add `<Docs.Layout>` as it's automatically applied at the layout level
376
+ 2. **Component Import**: Always use the namespace import `import { Docs } from "@/ui/Docs"` and reference components as `<Docs.ComponentName>`
377
+ 3. **Translation Issues**: Ensure all user-facing text uses `l.trans()` with complete translations for all supported languages
378
+ 4. **Code Highlighting**: Verify the correct language is specified for `<Docs.CodeSnippet>` and `<Docs.Code>` components
379
+ 5. **Style Consistency**: If your documentation looks different from others, compare with existing pages to identify styling discrepancies
380
+ 6. **Navigation Anchors**: For long pages, include anchor links by adding hidden divs with IDs
381
+
382
+ For additional assistance, refer to existing documentation pages or contact the framework documentation team.
@@ -24,7 +24,7 @@ Model stores follow a consistent architecture pattern:
24
24
 
25
25
  ┌─────────────────┐ ┌─────────────────┐
26
26
  │ st.ts │ ──→ │ Components │
27
- (Store Registry) │ │ (React/UI)
27
+ │(Store Registry) │ │ (React/UI)
28
28
  └─────────────────┘ └─────────────────┘
29
29
  ```
30
30
 
@@ -466,6 +466,7 @@ initProductChat(productId: string) {
466
466
  - Implement retry logic for critical operations
467
467
 
468
468
  5. **Testing**:
469
+
469
470
  - Mock stores with initial state for unit tests
470
471
 
471
472
  ```typescript
package/esm/index.js CHANGED
@@ -5554,26 +5554,32 @@ ${guideJson.update.rules.map((rule) => `- ${rule}`).join("\n")}
5554
5554
  const instruction = await Prompter.getInstruction(this.name);
5555
5555
  const pageContent = this.workspace.getLocalFile(writePath);
5556
5556
  const request = `
5557
- \uB098\uB294 Akan.js \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uB300\uD55C documentation \uC6F9\uC0AC\uC774\uD2B8\uB97C \uB9CC\uB4E4\uACE0 \uC788\uC5B4.
5557
+ I'm creating a documentation website for the Akan.js framework.
5558
5558
 
5559
- 1. Akan.js \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uB300\uD55C \uAC1C\uC694
5559
+ 1. Overview of the Akan.js framework
5560
5560
  ${await this.getDocumentation("framework")}
5561
5561
 
5562
- \uB098\uB294 ${writePath}\uC5D0 \uC788\uB294 Next.js \uC11C\uBC84\uC0AC\uC774\uB4DC \uD398\uC774\uC9C0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uB824\uACE0 \uD574.
5563
- \uC544\uB798\uB294 \uD604\uC7AC \uC791\uC131\uB41C \uD398\uC774\uC9C0\uC758 \uB0B4\uC6A9\uC774\uC57C.
5562
+ 2. Documentation page writing method
5563
+ ${await this.getDocumentation("docPageRule")}
5564
+
5565
+ 3. CSS rule with TailwindCSS and DaisyUI
5566
+ ${await this.getDocumentation("cssRule")}
5567
+
5568
+ I want to update the Next.js server-side page located at ${writePath}.
5569
+ Below is the content of the currently written page.
5564
5570
  \`\`\`tsx
5565
5571
  // File: ${writePath}
5566
5572
  ${pageContent.content}
5567
5573
  \`\`\`
5568
5574
 
5569
- \uD574\uB2F9 \uD398\uC774\uC9C0\uC5D0 \uC544\uB798 \uB0B4\uC6A9\uC744 \uCD5C\uC2E0\uD654 \uD574\uC11C \uC5C5\uB370\uC774\uD2B8\uD574\uC918. \uADFC\uC0AC\uD55C \uB514\uC790\uC778\uC73C\uB85C \uC801\uC6A9\uC774 \uD544\uC694\uD574.
5575
+ Please update this page with the latest content below. A great design application is needed.
5570
5576
  ${instruction}
5571
5577
 
5572
- CSS\uADDC\uCE59\uC740 \uB2E4\uC74C\uC744 \uB530\uB77C\uC11C \uC791\uC131\uD574\uC918.
5573
- - tailwindcss\uB97C \uC0AC\uC6A9\uD560 \uAC83
5574
- - daisyui \uB77C\uC774\uBE0C\uB7EC\uB9AC\uC758 className\uC744 \uC0AC\uC6A9\uD560 \uAC83
5578
+ Please follow these CSS rules when writing:
5579
+ - Use tailwindcss
5580
+ - Use className from the daisyui library
5575
5581
 
5576
- \uD30C\uC2F1\uD558\uAE30 \uC27D\uAC8C \uD30C\uC77C \uACB0\uACFC\uB9CC \uB2E4\uC74C\uACFC \uAC19\uC740 \uD615\uC2DD\uC73C\uB85C \uBC18\uD658\uD574\uC918.
5582
+ Please return only the file result in the following format for easy parsing.
5577
5583
  \`\`\`tsx
5578
5584
  // File: ${writePath}
5579
5585
  ...pageContent
@@ -5592,14 +5598,14 @@ var GuidelineRunner = class {
5592
5598
  const guidelineContent = await session.editMarkdown(request);
5593
5599
  workspace.writeFile(writePath, guidelineContent);
5594
5600
  }
5595
- async deployDocPages(workspace, guideName) {
5601
+ async deployDocPage(workspace, guideName) {
5596
5602
  const session = new AiSession("deployDocPages", { workspace, cacheKey: guideName });
5597
5603
  const guideJson = await Prompter.getGuideJson(guideName);
5598
5604
  const prompt = new GuidelinePrompt(workspace, guideName);
5599
- const { request, writePath } = await prompt.requestUpdateDocumentPage(guideJson.page);
5600
- const guidelineContent = await session.editMarkdown(request);
5601
- workspace.writeFile(writePath, guidelineContent);
5602
- return Promise.resolve({});
5605
+ if (!guideJson.page)
5606
+ return Promise.resolve({});
5607
+ const { request } = await prompt.requestUpdateDocumentPage(guideJson.page);
5608
+ await session.writeTypescripts(request, workspace);
5603
5609
  }
5604
5610
  };
5605
5611
 
@@ -5610,9 +5616,9 @@ var GuidelineScript = class {
5610
5616
  const guideName = name ?? await Prompter.selectGuideline();
5611
5617
  await this.#runner.generateInstruction(workspace, guideName);
5612
5618
  }
5613
- async deployDocPages(workspace, name = null) {
5619
+ async deployDocPage(workspace, name = null) {
5614
5620
  const guideName = name ?? await Prompter.selectGuideline();
5615
- await this.#runner.deployDocPages(workspace, guideName);
5621
+ await this.#runner.deployDocPage(workspace, guideName);
5616
5622
  }
5617
5623
  };
5618
5624
 
@@ -5622,8 +5628,8 @@ var GuidelineCommand = class {
5622
5628
  async generateInstruction(name, workspace) {
5623
5629
  await this.guidelineScript.generateInstruction(workspace, name);
5624
5630
  }
5625
- async deployDocs(name, workspace) {
5626
- await this.guidelineScript.deployDocPages(workspace, name);
5631
+ async deployDoc(name, workspace) {
5632
+ await this.guidelineScript.deployDocPage(workspace, name);
5627
5633
  }
5628
5634
  };
5629
5635
  __decorateClass([
@@ -5635,7 +5641,7 @@ __decorateClass([
5635
5641
  Target.Public(),
5636
5642
  __decorateParam(0, Argument("name", { ask: "name of the instruction", nullable: true })),
5637
5643
  __decorateParam(1, Workspace())
5638
- ], GuidelineCommand.prototype, "deployDocs", 1);
5644
+ ], GuidelineCommand.prototype, "deployDoc", 1);
5639
5645
  GuidelineCommand = __decorateClass([
5640
5646
  Commands()
5641
5647
  ], GuidelineCommand);
@@ -5,10 +5,9 @@
5
5
  1. [Component Architecture](#component-architecture)
6
6
  2. [Component Types](#component-types)
7
7
  3. [File Naming Conventions](#file-naming-conventions)
8
- 4. [CSS Rule with TailwindCSS and DaisyUI](#css-rule-with-tailwindcss-and-daisyui)
9
- 5. [Utility Functions](#utility-functions)
10
- 6. [Best Practices](#best-practices)
11
- 7. [Complete Examples](#complete-examples)
8
+ 4. [Utility Functions](#utility-functions)
9
+ 5. [Best Practices](#best-practices)
10
+ 6. [Complete Examples](#complete-examples)
12
11
 
13
12
  ---
14
13
 
@@ -248,83 +247,6 @@ Akan.js uses a strict naming convention to maintain consistency:
248
247
 
249
248
  ---
250
249
 
251
- ## CSS Rule with TailwindCSS and DaisyUI
252
-
253
- Akan.js uses TailwindCSS with DaisyUI for styling. Follow these guidelines:
254
-
255
- ### 1. Class Management
256
-
257
- Always use `clsx` for conditional and composite classes:
258
-
259
- ```tsx
260
- import { clsx } from "@akanjs/client";
261
-
262
- className={clsx(
263
- "base-classes",
264
- condition && "conditional-class",
265
- variant === "primary" ? "primary-class" : "secondary-class",
266
- className // Always include passed className for composition
267
- )}
268
- ```
269
-
270
- ### 2. Color System
271
-
272
- Use DaisyUI's theme colors instead of hardcoded values. This ensures theme consistency and dark/light mode compatibility:
273
-
274
- ```tsx
275
- // Good - uses theme colors
276
- className = "bg-primary text-base-100";
277
-
278
- // Bad - uses hardcoded colors
279
- className = "bg-[#C33C32] text-[#FFFFFF]";
280
- ```
281
-
282
- DaisyUI provides semantic colors:
283
-
284
- - `primary`, `secondary`, `accent` - Brand colors
285
- - `base-100` through `base-900` - Background/text variants
286
- - `info`, `success`, `warning`, `error` - Status colors
287
-
288
- ### 3. Responsive Design
289
-
290
- Use Tailwind's responsive prefixes:
291
-
292
- ```tsx
293
- <div className="flex-col md:flex-row">
294
- <div className="w-full md:w-1/2 lg:w-1/3">Responsive width</div>
295
- <div className="hidden lg:block">Only visible on large screens</div>
296
- </div>
297
- ```
298
-
299
- ### 4. Animation
300
-
301
- Use Tailwind animation classes with transitions:
302
-
303
- ```tsx
304
- <div className="transition-all duration-300 hover:scale-105">
305
- Hover effect
306
- </div>
307
-
308
- <div className="animate-pulse">Loading indicator</div>
309
- ```
310
-
311
- ### 5. Component Styling
312
-
313
- Use DaisyUI components for consistent UIs:
314
-
315
- ```tsx
316
- <button className="btn btn-primary btn-sm">Primary Button</button>
317
-
318
- <div className="card bg-base-200 shadow-md">
319
- <div className="card-body">
320
- <h2 className="card-title">Card Title</h2>
321
- <p>Card content</p>
322
- </div>
323
- </div>
324
- ```
325
-
326
- ---
327
-
328
250
  ## Utility Functions
329
251
 
330
252
  Akan.js provides several utility modules for common frontend tasks: