@storytype/cli 0.2.5 → 0.3.1
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 +61 -8
- package/dist/{chunk-WOGXOJML.js → chunk-PNYCPIWD.js} +349 -129
- package/dist/cli.js +439 -288
- package/dist/index.js +1 -1
- package/dist/templates/component/index.ts.hbs +3 -3
- package/dist/templates/component/spec.ts.hbs +19 -0
- package/dist/templates/component/stories.ts.hbs +11 -4
- package/package.json +14 -14
- package/src/templates/component/index.ts.hbs +3 -3
- package/src/templates/component/spec.ts.hbs +19 -0
- package/src/templates/component/stories.ts.hbs +11 -4
- package/dist/chunk-6DCDOH2S.js +0 -507
- package/dist/chunk-B35YCGV4.js +0 -509
- package/dist/chunk-C3R5YJAX.js +0 -452
- package/dist/chunk-IKQA7RO2.js +0 -460
- package/dist/chunk-MCTEMBK5.js +0 -460
- package/dist/chunk-ROL3KHCC.js +0 -544
- package/dist/chunk-U5YZ7DDR.js +0 -523
- package/dist/chunk-YXHZ2IEP.js +0 -518
package/README.md
CHANGED
|
@@ -78,13 +78,15 @@ Normalize existing component structure to follow Storytype conventions:
|
|
|
78
78
|
|
|
79
79
|
**What it does:**
|
|
80
80
|
|
|
81
|
-
1. Scans for Vue components in the directory
|
|
81
|
+
1. Scans for Vue components recursively in the directory
|
|
82
82
|
2. Checks directory names (should be kebab-case)
|
|
83
83
|
3. Checks file names (components should be PascalCase)
|
|
84
84
|
4. Detects missing files (`index.ts`, `.types.ts`, `.spec.ts`)
|
|
85
85
|
5. Uses `git mv` for tracked files (preserves history)
|
|
86
86
|
6. Creates missing files with templates
|
|
87
87
|
|
|
88
|
+
**Monorepo support:** Works recursively across all subdirectories. Container folders like `packages/`, `apps/`, `libs/` are preserved — only component directories (those with `.vue` files) are normalized.
|
|
89
|
+
|
|
88
90
|
**Examples:**
|
|
89
91
|
|
|
90
92
|
```bash
|
|
@@ -102,6 +104,9 @@ storytype normalize --files-only
|
|
|
102
104
|
|
|
103
105
|
# Show detailed changes
|
|
104
106
|
storytype normalize -v --dry-run
|
|
107
|
+
|
|
108
|
+
# Normalize a monorepo (scans packages/, apps/, libs/)
|
|
109
|
+
storytype normalize .
|
|
105
110
|
```
|
|
106
111
|
|
|
107
112
|
### `storytype init`
|
|
@@ -130,6 +135,7 @@ Analyze and score your project based on Storytype best practices.
|
|
|
130
135
|
- ✓ Components directory structure
|
|
131
136
|
- ✓ Atomic Design levels (atoms, molecules, organisms, templates, pages)
|
|
132
137
|
- ✓ Component organization
|
|
138
|
+
- ✓ Monorepo structures supported (scans `packages/`, `apps/`, `libs/`)
|
|
133
139
|
|
|
134
140
|
2. **TypeScript (30 pts)**
|
|
135
141
|
- ✓ TypeScript configuration (tsconfig.json)
|
|
@@ -200,6 +206,46 @@ Estrutura Atomic Design: 40/50 (80%)
|
|
|
200
206
|
- ⚠️ **40-59%** - Projeto precisa de melhorias significativas.
|
|
201
207
|
- 🔧 **0-39%** - Projeto precisa de reestruturação.
|
|
202
208
|
|
|
209
|
+
## Monorepo Support
|
|
210
|
+
|
|
211
|
+
The `normalize` and `analyze` commands fully support monorepo structures:
|
|
212
|
+
|
|
213
|
+
**TurboRepo / pnpm workspace:**
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
workspace/
|
|
217
|
+
├── packages/
|
|
218
|
+
│ ├── ui/src/components/Button/ ← normalized to button/
|
|
219
|
+
│ └── shared/components/srv/ ← preserved (already correct)
|
|
220
|
+
└── apps/
|
|
221
|
+
└── web/src/components/Dashboard/ ← normalized to dashboard/
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Nx monorepo:**
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
monorepo/
|
|
228
|
+
├── libs/ui/src/lib/Button/ ← normalized to button/
|
|
229
|
+
└── apps/frontend/app/components/Header/ ← normalized to header/
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**App-based structure:**
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
project/
|
|
236
|
+
└── app/components/
|
|
237
|
+
├── srv/ ← preserved (service convention)
|
|
238
|
+
└── Header/ ← normalized to header/
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Rules:**
|
|
242
|
+
|
|
243
|
+
- Directories containing `.vue` files are treated as components
|
|
244
|
+
- Container folders (`packages/`, `apps/`, `libs/`, `src/`) are never renamed
|
|
245
|
+
- Directories are normalized to **kebab-case**
|
|
246
|
+
- Files within are normalized to **PascalCase**
|
|
247
|
+
- `srv/`, `api/`, `utils/` and other convention directories are preserved
|
|
248
|
+
|
|
203
249
|
## Programmatic API
|
|
204
250
|
|
|
205
251
|
You can also use the CLI programmatically:
|
|
@@ -237,8 +283,7 @@ displayResults(analysis);
|
|
|
237
283
|
|
|
238
284
|
Follow the Atomic Design methodology:
|
|
239
285
|
|
|
240
|
-
|
|
241
|
-
src/kebab-case** for component directories: `user-profile/`, `data-table/`
|
|
286
|
+
- Use **kebab-case** for component directories: `user-profile/`, `data-table/`
|
|
242
287
|
- Use **PascalCase** for component files: `UserProfile.vue`, `DataTable.tsx`
|
|
243
288
|
- Include TypeScript types: `UserProfile.types.ts`
|
|
244
289
|
- Include tests: `UserProfile.spec.ts` or `UserProfile.test.ts`
|
|
@@ -247,8 +292,18 @@ src/kebab-case** for component directories: `user-profile/`, `data-table/`
|
|
|
247
292
|
|
|
248
293
|
**Example structure:**
|
|
249
294
|
|
|
295
|
+
```
|
|
296
|
+
src/components/
|
|
297
|
+
├── atomos/ # Basic UI atoms (Button, Input, Icon)
|
|
298
|
+
├── moleculas/ # Composed molecules (SearchField, Card)
|
|
299
|
+
├── organismos/ # Complex UI components (Header, Form, Modal)
|
|
300
|
+
├── templates/ # Page-level layouts
|
|
301
|
+
└── pages/ # Specific page instances
|
|
250
302
|
```
|
|
251
303
|
|
|
304
|
+
**Component folder example:**
|
|
305
|
+
|
|
306
|
+
```
|
|
252
307
|
src/components/atomos/user-button/
|
|
253
308
|
├── UserButton.vue
|
|
254
309
|
├── UserButton.types.ts
|
|
@@ -256,11 +311,6 @@ src/components/atomos/user-button/
|
|
|
256
311
|
├── UserButton.stories.ts
|
|
257
312
|
├── UserButton.mock.ts
|
|
258
313
|
└── index.ts
|
|
259
|
-
``ps of atoms (SearchField, Card)
|
|
260
|
-
├── organisms/ # Complex UI components (Header, Form, Modal)
|
|
261
|
-
├── templates/ # Page-level layouts
|
|
262
|
-
└── pages/ # Specific page instances
|
|
263
|
-
|
|
264
314
|
```
|
|
265
315
|
|
|
266
316
|
### Component Naming
|
|
@@ -279,4 +329,7 @@ src/components/atomos/user-button/
|
|
|
279
329
|
## License
|
|
280
330
|
|
|
281
331
|
MIT
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
|
|
282
335
|
```
|