@akanjs/cli 0.0.145 → 0.0.147
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 +191 -28
- package/cjs/src/guidelines/componentRule/componentRule.instruction.md +3 -81
- package/cjs/src/guidelines/cssRule/cssRule.instruction.md +435 -0
- package/cjs/src/guidelines/docPageRule/docPageRule.instruction.md +389 -0
- package/cjs/src/guidelines/modelConstant/modelConstant.instruction.md +335 -752
- package/cjs/src/guidelines/modelStore/modelStore.instruction.md +2 -1
- 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 +199 -36
- package/esm/src/guidelines/componentRule/componentRule.instruction.md +3 -81
- package/esm/src/guidelines/cssRule/cssRule.instruction.md +435 -0
- package/esm/src/guidelines/docPageRule/docPageRule.instruction.md +389 -0
- package/esm/src/guidelines/modelConstant/modelConstant.instruction.md +335 -752
- package/esm/src/guidelines/modelStore/modelStore.instruction.md +2 -1
- 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/componentRule/componentRule.instruction.md +3 -81
- package/src/guidelines/cssRule/cssRule.instruction.md +435 -0
- package/src/guidelines/docPageRule/docPageRule.instruction.md +389 -0
- package/src/guidelines/modelConstant/modelConstant.instruction.md +335 -752
- package/src/guidelines/modelStore/modelStore.instruction.md +2 -1
- 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
|
@@ -0,0 +1,389 @@
|
|
|
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
|
+
|
|
7
|
+
- Provide clear explanations of framework concepts, architecture, and components
|
|
8
|
+
- Offer technical reference for APIs, modules, and system functionalities
|
|
9
|
+
- Present implementation examples with real-world code snippets
|
|
10
|
+
- Establish consistent standards for documentation across the framework
|
|
11
|
+
- Support multi-language access for international developers
|
|
12
|
+
- Serve as onboarding resources for new team members
|
|
13
|
+
- Document best practices and common patterns for framework usage
|
|
14
|
+
|
|
15
|
+
## How to Create a Documentation Page
|
|
16
|
+
|
|
17
|
+
### 1. File Location and Structure
|
|
18
|
+
|
|
19
|
+
Documentation pages should be created in the following location:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
apps/angelo/app/[lang]/akanjs/(docs)/docs/[category]/[pageName]/page.tsx
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Where:
|
|
26
|
+
|
|
27
|
+
- `[lang]`: Language code (e.g., `en`, `ko`)
|
|
28
|
+
- `[category]`: Main documentation category (e.g., `systemArch`, `module`, `api`)
|
|
29
|
+
- `[pageName]`: Specific page name (e.g., `frontend`, `signal`, `authentication`)
|
|
30
|
+
|
|
31
|
+
Example path:
|
|
32
|
+
`apps/angelo/app/en/akanjs/(docs)/docs/module/signal/page.tsx`
|
|
33
|
+
|
|
34
|
+
### 2. Basic Page Structure
|
|
35
|
+
|
|
36
|
+
Each documentation page follows this basic structure:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { usePage } from "@angelo/client";
|
|
40
|
+
import { Docs } from "@angelo/ui";
|
|
41
|
+
|
|
42
|
+
export default function Page() {
|
|
43
|
+
const { l } = usePage(); // For internationalization
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<Docs.Title>
|
|
48
|
+
{l.trans({
|
|
49
|
+
en: "Main Page Title",
|
|
50
|
+
ko: "메인 페이지 제목",
|
|
51
|
+
})}
|
|
52
|
+
</Docs.Title>
|
|
53
|
+
|
|
54
|
+
<Docs.Description>
|
|
55
|
+
{l.trans({
|
|
56
|
+
en: "Introduction paragraph that explains the concept...",
|
|
57
|
+
ko: "개념을 설명하는 소개 문단...",
|
|
58
|
+
})}
|
|
59
|
+
</Docs.Description>
|
|
60
|
+
|
|
61
|
+
<div className="divider"></div>
|
|
62
|
+
|
|
63
|
+
<Docs.SubTitle>
|
|
64
|
+
{l.trans({
|
|
65
|
+
en: "Section Title",
|
|
66
|
+
ko: "섹션 제목",
|
|
67
|
+
})}
|
|
68
|
+
</Docs.SubTitle>
|
|
69
|
+
|
|
70
|
+
<Docs.Description>
|
|
71
|
+
{l.trans({
|
|
72
|
+
en: "Detailed explanation of this section...",
|
|
73
|
+
ko: "이 섹션에 대한 자세한 설명...",
|
|
74
|
+
})}
|
|
75
|
+
</Docs.Description>
|
|
76
|
+
|
|
77
|
+
<Docs.CodeSnippet
|
|
78
|
+
language="typescript"
|
|
79
|
+
code={`
|
|
80
|
+
// Code example
|
|
81
|
+
const example = "Hello Akan.js";
|
|
82
|
+
`}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
{/* Additional sections and components */}
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 3. Page Organization
|
|
92
|
+
|
|
93
|
+
Documentation pages should be organized in a hierarchical structure:
|
|
94
|
+
|
|
95
|
+
1. **Title**: Main page title (`<Docs.Title>`)
|
|
96
|
+
2. **Introduction**: Brief overview (`<Docs.Description>`)
|
|
97
|
+
3. **Sections**: Main content sections
|
|
98
|
+
- Section title (`<Docs.SubTitle>`)
|
|
99
|
+
- Section content (`<Docs.Description>`)
|
|
100
|
+
- Code examples (`<Docs.CodeSnippet>`)
|
|
101
|
+
- Subsections (`<Docs.SubSubTitle>`)
|
|
102
|
+
- Tables (`<Docs.OptionTable>`, `<Docs.IntroTable>`)
|
|
103
|
+
4. **Related Content**: Links to related documentation pages
|
|
104
|
+
|
|
105
|
+
### 4. Internationalization
|
|
106
|
+
|
|
107
|
+
All user-facing text must support multiple languages using the translation hook:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
const { l } = usePage();
|
|
111
|
+
|
|
112
|
+
<Docs.Title>
|
|
113
|
+
{l.trans({
|
|
114
|
+
en: "English Title",
|
|
115
|
+
ko: "한국어 제목",
|
|
116
|
+
// Add other languages as needed
|
|
117
|
+
})}
|
|
118
|
+
</Docs.Title>;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Utility Components
|
|
122
|
+
|
|
123
|
+
The `Docs` namespace provides specialized components for creating consistent documentation pages. Always import and use them with the `Docs` prefix:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { Docs } from "@angelo/ui";
|
|
127
|
+
// Correct usage: <Docs.Title>, NOT import { Title } from "@angelo/ui";
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 1. Title Components
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
<Docs.Title>Main Page Title</Docs.Title> // H1 equivalent
|
|
134
|
+
<Docs.SubTitle>Section Title</Docs.SubTitle> // H2 equivalent
|
|
135
|
+
<Docs.SubSubTitle>Subsection Title</Docs.SubSubTitle> // H3 equivalent
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 2. Content Components
|
|
139
|
+
|
|
140
|
+
**Description Block:**
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<Docs.Description>
|
|
144
|
+
Detailed explanatory text that supports: - Markdown-style formatting - Multi-paragraph content - HTML elements -
|
|
145
|
+
Internationalization via l.trans()
|
|
146
|
+
</Docs.Description>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Code Snippet:**
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
<Docs.CodeSnippet
|
|
153
|
+
language="typescript" // Supported: typescript, bash, and others
|
|
154
|
+
code={`
|
|
155
|
+
// Your code example with syntax highlighting
|
|
156
|
+
const example = "Hello Akan.js";
|
|
157
|
+
function demo() {
|
|
158
|
+
return example;
|
|
159
|
+
}
|
|
160
|
+
`}
|
|
161
|
+
/>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 3. Table Components
|
|
165
|
+
|
|
166
|
+
**Option Table:** For displaying configuration options, parameters, or properties
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
<Docs.OptionTable
|
|
170
|
+
items={[
|
|
171
|
+
{
|
|
172
|
+
key: "optionName", // Option identifier
|
|
173
|
+
type: "string", // Data type
|
|
174
|
+
default: "defaultVal", // Default value
|
|
175
|
+
desc: "Description", // Explanation (can use l.trans())
|
|
176
|
+
example: "example()", // Usage example
|
|
177
|
+
},
|
|
178
|
+
// Additional items...
|
|
179
|
+
]}
|
|
180
|
+
/>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Introduction Table:** For listing and describing related items
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
<Docs.IntroTable
|
|
187
|
+
type="conceptName" // Table category identifier
|
|
188
|
+
items={[
|
|
189
|
+
{
|
|
190
|
+
name: "itemName", // Item name
|
|
191
|
+
desc: "Description", // Explanation (can use l.trans())
|
|
192
|
+
example: "example()", // Usage example
|
|
193
|
+
},
|
|
194
|
+
// Additional items...
|
|
195
|
+
]}
|
|
196
|
+
/>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 4. Code Display Components
|
|
200
|
+
|
|
201
|
+
**Inline Code:**
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
<Docs.Code language="typescript">inlineCodeExample</Docs.Code>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Custom Code Block:**
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
<Docs.CodeView>
|
|
211
|
+
<Docs.Code prefix="1">// First line with line number</Docs.Code>
|
|
212
|
+
<Docs.Code prefix="2">// Second line with line number</Docs.Code>
|
|
213
|
+
</Docs.CodeView>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### 5. Layout Components
|
|
217
|
+
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
**Header and Footer:**
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
<Docs.Header>Header content</Docs.Header>
|
|
224
|
+
<Docs.Footer>Footer content</Docs.Footer>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Best Practices
|
|
228
|
+
|
|
229
|
+
### 1. Content Organization
|
|
230
|
+
|
|
231
|
+
- Begin with a clear, concise introduction that explains the purpose and importance of the topic
|
|
232
|
+
- Use a logical hierarchy of headings (Title → SubTitle → SubSubTitle)
|
|
233
|
+
- Structure content to flow from basic concepts to advanced usage
|
|
234
|
+
- Include a "Getting Started" or "Basic Usage" section near the beginning
|
|
235
|
+
- Group related information under appropriate section headings
|
|
236
|
+
- Maintain consistent terminology throughout the document
|
|
237
|
+
|
|
238
|
+
### 2. Code Examples
|
|
239
|
+
|
|
240
|
+
- Include complete, working code examples that can be copied and used directly
|
|
241
|
+
- Provide context for each code example to explain what it demonstrates
|
|
242
|
+
- Use realistic, practical examples rather than overly simplified ones
|
|
243
|
+
- Include comments in code examples to explain key points
|
|
244
|
+
- Specify the correct language for proper syntax highlighting
|
|
245
|
+
- Show both basic and advanced usage patterns
|
|
246
|
+
|
|
247
|
+
### 3. Formatting and Style
|
|
248
|
+
|
|
249
|
+
- Use sentence case for all headings (e.g., "How to use signals" not "How To Use Signals")
|
|
250
|
+
- Keep paragraphs focused on a single concept
|
|
251
|
+
- Use lists for sequential steps or related items
|
|
252
|
+
- Include whitespace (dividers, margins) to separate sections visually
|
|
253
|
+
- Apply consistent formatting across all documentation pages
|
|
254
|
+
|
|
255
|
+
### 4. Internationalization
|
|
256
|
+
|
|
257
|
+
- Wrap all user-facing text in `l.trans()` calls with at least English and Korean translations
|
|
258
|
+
- Maintain parallel structure and meaning across languages
|
|
259
|
+
- Keep translations concise but complete
|
|
260
|
+
- Use descriptive keys for translation objects
|
|
261
|
+
|
|
262
|
+
### 5. Performance and Accessibility
|
|
263
|
+
|
|
264
|
+
- Use lazy-loading for heavy components when appropriate
|
|
265
|
+
- Ensure documentation is responsive for both desktop and mobile viewing
|
|
266
|
+
- Include anchor links to specific sections for easy reference
|
|
267
|
+
- Provide alt text for images and diagrams
|
|
268
|
+
- Avoid overly complex or deeply nested components
|
|
269
|
+
|
|
270
|
+
## Complete Example
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import { usePage } from "@angelo/client";
|
|
274
|
+
import { Docs, type IntroItem, type OptionItem } from "@angelo/ui";
|
|
275
|
+
|
|
276
|
+
export default function SignalDocsPage() {
|
|
277
|
+
const { l } = usePage();
|
|
278
|
+
|
|
279
|
+
// Define configuration options
|
|
280
|
+
const signalOptions: OptionItem[] = [
|
|
281
|
+
{
|
|
282
|
+
key: "initialValue",
|
|
283
|
+
type: "T",
|
|
284
|
+
default: "undefined",
|
|
285
|
+
desc: l.trans({
|
|
286
|
+
en: "Initial value of the signal",
|
|
287
|
+
ko: "시그널의 초기값",
|
|
288
|
+
}),
|
|
289
|
+
example: "signal(0)",
|
|
290
|
+
},
|
|
291
|
+
// Additional options...
|
|
292
|
+
];
|
|
293
|
+
|
|
294
|
+
// Define feature list
|
|
295
|
+
const signalFeatures: IntroItem[] = [
|
|
296
|
+
{
|
|
297
|
+
name: "createSignal",
|
|
298
|
+
desc: l.trans({
|
|
299
|
+
en: "Creates a new reactive signal",
|
|
300
|
+
ko: "새로운 반응형 시그널을 생성",
|
|
301
|
+
}),
|
|
302
|
+
example: "const [value, setValue] = createSignal(0)",
|
|
303
|
+
},
|
|
304
|
+
// Additional features...
|
|
305
|
+
];
|
|
306
|
+
|
|
307
|
+
return (
|
|
308
|
+
<>
|
|
309
|
+
<Docs.Title>
|
|
310
|
+
{l.trans({
|
|
311
|
+
en: "Signal Module",
|
|
312
|
+
ko: "시그널 모듈",
|
|
313
|
+
})}
|
|
314
|
+
</Docs.Title>
|
|
315
|
+
|
|
316
|
+
<Docs.Description>
|
|
317
|
+
{l.trans({
|
|
318
|
+
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.",
|
|
319
|
+
ko: "시그널 모듈은 Akan.js 애플리케이션을 위한 반응형 상태 관리 기능을 제공합니다. 시그널을 통해 컴포넌트는 불필요한 재렌더링 없이 상태 변화에 효율적으로 반응할 수 있습니다.",
|
|
320
|
+
})}
|
|
321
|
+
</Docs.Description>
|
|
322
|
+
|
|
323
|
+
<div className="divider"></div>
|
|
324
|
+
|
|
325
|
+
<Docs.SubTitle>
|
|
326
|
+
{l.trans({
|
|
327
|
+
en: "Basic Usage",
|
|
328
|
+
ko: "기본 사용법",
|
|
329
|
+
})}
|
|
330
|
+
</Docs.SubTitle>
|
|
331
|
+
|
|
332
|
+
<Docs.Description>
|
|
333
|
+
{l.trans({
|
|
334
|
+
en: "Creating and using signals is straightforward:",
|
|
335
|
+
ko: "시그널 생성 및 사용은 간단합니다:",
|
|
336
|
+
})}
|
|
337
|
+
</Docs.Description>
|
|
338
|
+
|
|
339
|
+
<Docs.CodeSnippet
|
|
340
|
+
language="typescript"
|
|
341
|
+
code={`
|
|
342
|
+
// Create a signal with an initial value
|
|
343
|
+
const count = signal(0);
|
|
344
|
+
|
|
345
|
+
// Read the signal value
|
|
346
|
+
console.log(count()); // 0
|
|
347
|
+
|
|
348
|
+
// Update the signal value
|
|
349
|
+
count(1);
|
|
350
|
+
console.log(count()); // 1
|
|
351
|
+
|
|
352
|
+
// Use in a component
|
|
353
|
+
function Counter() {
|
|
354
|
+
return <div>{count()}</div>;
|
|
355
|
+
}`}
|
|
356
|
+
/>
|
|
357
|
+
|
|
358
|
+
<Docs.SubTitle>
|
|
359
|
+
{l.trans({
|
|
360
|
+
en: "Configuration Options",
|
|
361
|
+
ko: "설정 옵션",
|
|
362
|
+
})}
|
|
363
|
+
</Docs.SubTitle>
|
|
364
|
+
|
|
365
|
+
<Docs.OptionTable items={signalOptions} />
|
|
366
|
+
|
|
367
|
+
<Docs.SubTitle>
|
|
368
|
+
{l.trans({
|
|
369
|
+
en: "API Reference",
|
|
370
|
+
ko: "API 참조",
|
|
371
|
+
})}
|
|
372
|
+
</Docs.SubTitle>
|
|
373
|
+
|
|
374
|
+
<Docs.IntroTable type="function" items={signalFeatures} />
|
|
375
|
+
</>
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Troubleshooting
|
|
381
|
+
|
|
382
|
+
1. **Layout Issues**: Do not manually add `<Docs.Layout>` as it's automatically applied at the layout level
|
|
383
|
+
2. **Component Import**: Always use the namespace import `import { Docs } from "@angelo/ui"` and reference components as `<Docs.ComponentName>`
|
|
384
|
+
3. **Translation Issues**: Ensure all user-facing text uses `l.trans()` with complete translations for all supported languages
|
|
385
|
+
4. **Code Highlighting**: Verify the correct language is specified for `<Docs.CodeSnippet>` and `<Docs.Code>` components
|
|
386
|
+
5. **Style Consistency**: If your documentation looks different from others, compare with existing pages to identify styling discrepancies
|
|
387
|
+
6. **Navigation Anchors**: For long pages, include anchor links by adding hidden divs with IDs
|
|
388
|
+
|
|
389
|
+
For additional assistance, refer to existing documentation pages or contact the framework documentation team.
|