@adlas/create-app 1.0.44 → 1.0.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adlas/create-app",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Adlas project initializer with Figma and Swagger integration",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",
@@ -6,11 +6,52 @@ This document provides comprehensive guidelines for converting Figma designs to
6
6
 
7
7
  ## 🎯 Core Principles
8
8
 
9
- 1. **Use ONLY existing components** - Never create custom implementations when project components exist
10
- 2. **Follow project structure** - Place files in correct locations as defined below
11
- 3. **Match coding patterns** - Use the same patterns found in existing code
12
- 4. **Maintain consistency** - Follow naming conventions and code style
13
- 5. **Type safety first** - Use TypeScript strictly, no `any` types
9
+ 1. **Use HeroUI components first** - Always prefer HeroUI components. Only use Tailwind CSS for custom styling when HeroUI doesn't provide the component
10
+ 2. **Use ONLY existing components** - Never create custom implementations when project components exist
11
+ 3. **i18n for ALL text** - ALL labels, placeholders, titles, error messages MUST use translation keys
12
+ 4. **Navigation from config** - NEVER hardcode URLs. Always use `NAVIGATION_URLS` from config
13
+ 5. **HeroUI icons only** - Use icons from HeroUI Figma Kit: https://www.figma.com/design/kFGcjHsNKZx7zh2NxEJXYt/HeroUI-Figma-Kit--Community---Community-?node-id=10-1849
14
+ 6. **Follow project structure** - Place files in correct locations as defined below
15
+ 7. **Match coding patterns** - Use the same patterns found in existing code
16
+ 8. **Type safety first** - Use TypeScript strictly, no `any` types
17
+
18
+ ---
19
+
20
+ ## 🎨 Component Priority & Usage Strategy
21
+
22
+ ### 1. Check HeroUI First
23
+ Before creating ANY component, check if HeroUI provides it:
24
+ - **HeroUI Documentation**: https://heroui.com/docs/components
25
+ - **HeroUI Figma Kit**: https://www.figma.com/design/kFGcjHsNKZx7zh2NxEJXYt/HeroUI-Figma-Kit--Community---Community-
26
+
27
+ ### 2. Component Selection Flow
28
+ ```
29
+ 1. Does HeroUI have this component?
30
+ → YES: Use HeroUI component (via @/components/ui wrapper if exists)
31
+ → NO: Go to step 2
32
+
33
+ 2. Does project have wrapper in src/components/ui/?
34
+ → YES: Use the wrapper
35
+ → NO: Go to step 3
36
+
37
+ 3. Build with Tailwind CSS utilities
38
+ → Use HeroUI theme colors and patterns
39
+ → Follow mobile-first responsive design
40
+ ```
41
+
42
+ ### 3. Example Decision Tree
43
+ ```tsx
44
+ // Need a Button?
45
+ import { Button } from '@/components/ui'; // ✅ Use HeroUI Button wrapper
46
+
47
+ // Need an Input?
48
+ import { Input } from '@/components/ui'; // ✅ Use HeroUI Input wrapper
49
+
50
+ // Need a Card?
51
+ // HeroUI has Card, but check if wrapper exists in project
52
+ // If not, use Tailwind utilities with HeroUI colors:
53
+ <div className="rounded-lg bg-white p-6 shadow-md"> // ✅ Custom with Tailwind
54
+ ```
14
55
 
15
56
  ---
16
57
 
@@ -172,18 +213,23 @@ import { Modal, Chip, Breadcrumbs, Tabs, Icon } from '@/components/ui';
172
213
  ```
173
214
 
174
215
  ### Icons
216
+
217
+ **IMPORTANT**: ALL icons MUST come from HeroUI Figma Kit
218
+ - **Figma Source**: https://www.figma.com/design/kFGcjHsNKZx7zh2NxEJXYt/HeroUI-Figma-Kit--Community---Community-?node-id=10-1849
219
+ - **Available in project**: ChevronDown, ChevronRight, Close, Eye, EyeSlash
220
+
175
221
  ```tsx
176
222
  import { ChevronDownIcon, ChevronRightIcon, CloseIcon, EyeIcon, EyeSlashIcon } from '@/components/icons';
177
223
 
178
224
  <ChevronDownIcon className="h-4 w-4" />
179
225
  ```
180
226
 
181
- **For other icons**: Use `lucide-react` package:
182
- ```tsx
183
- import { Search, Menu, User } from 'lucide-react';
227
+ **For icons not yet in project**:
228
+ 1. Find the icon in HeroUI Figma Kit
229
+ 2. Create a new icon component in `src/components/icons/` following the existing pattern
230
+ 3. Export it from `src/components/icons/index.ts`
184
231
 
185
- <Search className="h-5 w-5" />
186
- ```
232
+ **DO NOT use Lucide, Font Awesome, or other icon libraries**
187
233
 
188
234
  ---
189
235
 
@@ -315,30 +361,85 @@ export default function LoginForm() {
315
361
 
316
362
  ## 🌐 Internationalization (i18n)
317
363
 
318
- ### Navigation
364
+ **CRITICAL**: ALL text content MUST use i18n translation keys
365
+
366
+ ### Navigation with i18n
319
367
  ```tsx
320
368
  import { Link } from '@/libs/I18nNavigation';
369
+ import { NAVIGATION_URLS } from '@/config/navigationUrls';
370
+
371
+ // ✅ CORRECT - Using NAVIGATION_URLS
372
+ <Link href={NAVIGATION_URLS.ABOUT}>About</Link>
321
373
 
374
+ // ❌ WRONG - Hardcoded URL
322
375
  <Link href="/about">About</Link>
323
376
  ```
324
377
 
325
- ### Translations
378
+ ### Translations for ALL text
326
379
  ```tsx
327
380
  import { useTranslations } from 'next-intl';
328
381
 
329
382
  function MyComponent() {
330
383
  const t = useTranslations();
331
384
 
332
- return <h1>{t('welcome')}</h1>;
385
+ return (
386
+ <div>
387
+ {/* ✅ CORRECT - Using translation key */}
388
+ <h1>{t('welcome')}</h1>
389
+ <p>{t('description')}</p>
390
+
391
+ {/* ❌ WRONG - Hardcoded text */}
392
+ <h1>Welcome</h1>
393
+ </div>
394
+ );
395
+ }
396
+ ```
397
+
398
+ ### Form labels, placeholders, errors - ALL must use i18n
399
+ ```tsx
400
+ import { useTranslations } from 'next-intl';
401
+
402
+ function LoginForm() {
403
+ const t = useTranslations();
404
+
405
+ return (
406
+ <form>
407
+ {/* ✅ CORRECT */}
408
+ <Input
409
+ label={t('email')}
410
+ placeholder={t('enterEmail')}
411
+ errorMessage={errors.email?.message ? t(errors.email.message) : undefined}
412
+ />
413
+
414
+ {/* ❌ WRONG - Hardcoded text */}
415
+ <Input
416
+ label="Email"
417
+ placeholder="Enter your email"
418
+ errorMessage="Invalid email"
419
+ />
420
+ </form>
421
+ );
333
422
  }
334
423
  ```
335
424
 
336
- ### Navigation URLs
425
+ ### Navigation URLs Reference
337
426
  ```tsx
338
427
  import { NAVIGATION_URLS } from '@/config/navigationUrls';
339
428
 
429
+ // Available URLs (based on project type):
430
+ NAVIGATION_URLS.ROOT // '/'
431
+ NAVIGATION_URLS.ABOUT // '/about'
432
+ NAVIGATION_URLS.CONTACT // '/contact'
433
+ NAVIGATION_URLS.PRODUCTS.INDEX // '/products'
434
+ NAVIGATION_URLS.PRODUCTS.DETAIL('123') // '/products/123'
435
+ NAVIGATION_URLS.AUTH.LOGIN // '/auth/login'
436
+ NAVIGATION_URLS.DASHBOARD.INDEX // '/dashboard'
437
+
438
+ // ✅ ALWAYS use NAVIGATION_URLS
340
439
  <Link href={NAVIGATION_URLS.PRODUCTS.INDEX}>Products</Link>
341
- <Link href={NAVIGATION_URLS.PRODUCTS.DETAIL('123')}>Product Detail</Link>
440
+
441
+ // ❌ NEVER hardcode URLs
442
+ <Link href="/products">Products</Link>
342
443
  ```
343
444
 
344
445
  ---
@@ -416,24 +517,30 @@ import { Footer, Navbar } from '@/components/layout';
416
517
  ## ⚠️ CRITICAL RULES
417
518
 
418
519
  ### ❌ DO NOT
419
- 1. ❌ Create custom input components when `Input`, `Select`, etc. exist
420
- 2. ❌ Use CSS modules or styled-components
421
- 3. ❌ Import from `@heroui/react` directly (use `@/components/ui` wrappers)
422
- 4. ❌ Create duplicate utility functions (check `src/utils/helpers.ts` first)
423
- 5. ❌ Use `any` type in TypeScript
424
- 6. ❌ Hardcode URLs (use `NAVIGATION_URLS` from config)
425
- 7. ❌ Ignore responsive design (always implement mobile-first)
426
- 8. ❌ Skip form validation (always use Zod schemas)
520
+ 1. ❌ Use non-HeroUI icons (Lucide, Font Awesome, etc.) - ONLY use HeroUI Figma Kit icons
521
+ 2. ❌ Hardcode ANY text - ALL text MUST use i18n translation keys
522
+ 3. ❌ Hardcode URLs - ALWAYS use `NAVIGATION_URLS` from config
523
+ 4. ❌ Create custom components when HeroUI provides them - check HeroUI first, then project components
524
+ 5. ❌ Use CSS modules or styled-components - ONLY Tailwind CSS
525
+ 6. ❌ Import from `@heroui/react` directly (use `@/components/ui` wrappers)
526
+ 7. ❌ Create duplicate utility functions (check `src/utils/helpers.ts` first)
527
+ 8. ❌ Use `any` type in TypeScript
528
+ 9. ❌ Ignore responsive design (always implement mobile-first)
529
+ 10. ❌ Skip form validation (always use Zod schemas)
427
530
 
428
531
  ### ✅ DO
429
- 1. ✅ Use existing UI components from `src/components/ui/`
430
- 2. ✅ Follow Tailwind CSS utility-first approach
431
- 3. ✅ Implement TypeScript strictly with proper types
432
- 4. ✅ Use `'use client'` directive for interactive components
433
- 5. ✅ Follow mobile-first responsive design
434
- 6. ✅ Use semantic color classes from HeroUI theme
435
- 7. ✅ Implement proper loading and error states
436
- 8. ✅ Follow existing code patterns and naming conventions
532
+ 1. ✅ Use HeroUI components first (check HeroUI library before creating custom components)
533
+ 2. ✅ Use icons ONLY from HeroUI Figma Kit
534
+ 3. ✅ Use i18n translation keys for ALL text (labels, placeholders, titles, errors, etc.)
535
+ 4. ✅ Use `NAVIGATION_URLS` for ALL navigation links
536
+ 5. ✅ Use existing UI components from `src/components/ui/`
537
+ 6. ✅ Use Tailwind CSS ONLY for styling (no CSS modules, no styled-components)
538
+ 7. ✅ Implement TypeScript strictly with proper types
539
+ 8. ✅ Use `'use client'` directive for interactive components
540
+ 9. ✅ Follow mobile-first responsive design
541
+ 10. ✅ Use semantic color classes from HeroUI theme
542
+ 11. ✅ Implement proper loading and error states
543
+ 12. ✅ Follow existing code patterns and naming conventions
437
544
 
438
545
  ---
439
546
 
@@ -441,18 +548,38 @@ import { Footer, Navbar } from '@/components/layout';
441
548
 
442
549
  When converting Figma to code, ensure:
443
550
 
551
+ ### Component & Styling
552
+ - [ ] Checked HeroUI library first for component availability
553
+ - [ ] Used HeroUI components via `src/components/ui/` wrappers
554
+ - [ ] Used ONLY HeroUI Figma Kit icons (no Lucide, Font Awesome, etc.)
555
+ - [ ] Applied Tailwind CSS classes only (no custom CSS, no CSS modules)
556
+ - [ ] Followed HeroUI theme colors (bg-background, bg-primary, etc.)
557
+
558
+ ### Content & Navigation
559
+ - [ ] ALL text uses i18n translation keys (no hardcoded text)
560
+ - [ ] ALL labels use `t('labelKey')`
561
+ - [ ] ALL placeholders use `t('placeholderKey')`
562
+ - [ ] ALL error messages use `t('errorKey')`
563
+ - [ ] ALL titles and headings use `t('titleKey')`
564
+ - [ ] ALL URLs use `NAVIGATION_URLS` from config (no hardcoded URLs)
565
+
566
+ ### Structure & Types
444
567
  - [ ] Page created in correct location (`src/app/[locale]/...`)
445
- - [ ] Used existing UI components from `src/components/ui/`
446
- - [ ] Applied Tailwind CSS classes only (no custom CSS)
447
- - [ ] Implemented responsive design (mobile-first)
448
568
  - [ ] Added TypeScript types for all data structures
449
569
  - [ ] Used `'use client'` for interactive components
450
- - [ ] Implemented forms with Zod validation if needed
451
- - [ ] Used i18n for all text content
452
- - [ ] Added proper loading and error states
453
- - [ ] Followed semantic color system
454
- - [ ] Used navigation URLs from config
455
- - [ ] Tested on multiple breakpoints
570
+ - [ ] No `any` types used
571
+
572
+ ### Forms & Validation
573
+ - [ ] Implemented forms with Zod validation schemas
574
+ - [ ] Form labels use i18n
575
+ - [ ] Form placeholders use i18n
576
+ - [ ] Form errors use i18n
577
+
578
+ ### Responsive & States
579
+ - [ ] Implemented responsive design (mobile-first)
580
+ - [ ] Added proper loading states
581
+ - [ ] Added proper error states
582
+ - [ ] Tested on multiple breakpoints (mobile, tablet, desktop)
456
583
 
457
584
  ---
458
585
 
@@ -460,14 +587,26 @@ When converting Figma to code, ensure:
460
587
 
461
588
  Before finalizing code, verify:
462
589
 
463
- 1. **No direct HeroUI imports** - Only through `@/components/ui`
464
- 2. **Consistent spacing** - Use `space-y-*` and `space-x-*` utilities
465
- 3. **Proper TypeScript** - No `any`, all props typed
466
- 4. **Mobile-first** - Base styles for mobile, then `md:`, `lg:`, etc.
467
- 5. **Color usage** - Use theme colors, not arbitrary values
468
- 6. **Component reuse** - Don't duplicate existing components
469
- 7. **Form validation** - Zod schemas for all forms
470
- 8. **i18n ready** - All text uses translation keys
590
+ ### Icons & Components
591
+ 1. **Icons from HeroUI only** - Check all icons come from HeroUI Figma Kit
592
+ 2. **HeroUI components first** - Verify HeroUI library was checked before custom implementation
593
+ 3. **No direct HeroUI imports** - Only through `@/components/ui`
594
+ 4. **Component reuse** - Don't duplicate existing components
595
+
596
+ ### i18n & Navigation
597
+ 5. **Zero hardcoded text** - ALL text uses `t('key')`
598
+ 6. **Zero hardcoded URLs** - ALL links use `NAVIGATION_URLS`
599
+ 7. **Form fields i18n** - Labels, placeholders, errors all use translation keys
600
+
601
+ ### Styling & Layout
602
+ 8. **Tailwind only** - No CSS modules, no styled-components
603
+ 9. **HeroUI theme colors** - Use semantic colors, not arbitrary values
604
+ 10. **Consistent spacing** - Use `space-y-*` and `space-x-*` utilities
605
+ 11. **Mobile-first** - Base styles for mobile, then `md:`, `lg:`, etc.
606
+
607
+ ### TypeScript & Validation
608
+ 12. **Proper TypeScript** - No `any`, all props typed
609
+ 13. **Form validation** - Zod schemas for all forms
471
610
 
472
611
  ---
473
612