@adlas/create-app 1.0.0

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.
Files changed (79) hide show
  1. package/README.md +476 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +39 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/figma.d.ts +16 -0
  7. package/dist/commands/figma.d.ts.map +1 -0
  8. package/dist/commands/figma.js +172 -0
  9. package/dist/commands/figma.js.map +1 -0
  10. package/dist/commands/index.d.ts +5 -0
  11. package/dist/commands/index.d.ts.map +1 -0
  12. package/dist/commands/index.js +5 -0
  13. package/dist/commands/index.js.map +1 -0
  14. package/dist/commands/init.d.ts +8 -0
  15. package/dist/commands/init.d.ts.map +1 -0
  16. package/dist/commands/init.js +1471 -0
  17. package/dist/commands/init.js.map +1 -0
  18. package/dist/commands/swagger.d.ts +16 -0
  19. package/dist/commands/swagger.d.ts.map +1 -0
  20. package/dist/commands/swagger.js +404 -0
  21. package/dist/commands/swagger.js.map +1 -0
  22. package/dist/commands/update.d.ts +15 -0
  23. package/dist/commands/update.d.ts.map +1 -0
  24. package/dist/commands/update.js +93 -0
  25. package/dist/commands/update.js.map +1 -0
  26. package/package.json +63 -0
  27. package/templates/.vscode/extensions.json +9 -0
  28. package/templates/.vscode/launch.json +26 -0
  29. package/templates/.vscode/settings.json +67 -0
  30. package/templates/.vscode/tasks.json +21 -0
  31. package/templates/boilerplate/config/fonts.ts +10 -0
  32. package/templates/boilerplate/config/navigationUrls.ts +47 -0
  33. package/templates/boilerplate/config/site.ts +96 -0
  34. package/templates/boilerplate/libs/I18n.ts +15 -0
  35. package/templates/boilerplate/libs/I18nNavigation.ts +5 -0
  36. package/templates/boilerplate/libs/I18nRouting.ts +9 -0
  37. package/templates/boilerplate/libs/env.ts +21 -0
  38. package/templates/boilerplate/libs/react-query/ReactQueryProvider.tsx +21 -0
  39. package/templates/boilerplate/libs/react-query/index.ts +2 -0
  40. package/templates/boilerplate/libs/react-query/queryClient.ts +62 -0
  41. package/templates/boilerplate/libs/react-query/queryKeys.ts +5 -0
  42. package/templates/boilerplate/public/images/index.ts +1 -0
  43. package/templates/boilerplate/reset.d.ts +2 -0
  44. package/templates/boilerplate/styles/globals.css +308 -0
  45. package/templates/boilerplate/types/i18n.ts +10 -0
  46. package/templates/boilerplate/types/locale.ts +8 -0
  47. package/templates/boilerplate/utils/file/fileConfig.ts +123 -0
  48. package/templates/boilerplate/utils/file/fileValidation.ts +78 -0
  49. package/templates/boilerplate/utils/file/imageCompression.ts +182 -0
  50. package/templates/boilerplate/utils/file/index.ts +3 -0
  51. package/templates/boilerplate/utils/helpers.ts +55 -0
  52. package/templates/boilerplate/validations/auth.validation.ts +92 -0
  53. package/templates/boilerplate/validations/commonValidations.ts +258 -0
  54. package/templates/boilerplate/validations/zodErrorMap.ts +101 -0
  55. package/templates/configs/.env.example +8 -0
  56. package/templates/configs/.prettierignore +23 -0
  57. package/templates/configs/.prettierrc.cjs +26 -0
  58. package/templates/configs/.prettierrc.icons.cjs +11 -0
  59. package/templates/configs/Dockerfile +6 -0
  60. package/templates/configs/commitlint.config.ts +8 -0
  61. package/templates/configs/eslint.config.mjs +119 -0
  62. package/templates/configs/knip.config.ts +32 -0
  63. package/templates/configs/lefthook.yml +42 -0
  64. package/templates/configs/lint-staged.config.js +8 -0
  65. package/templates/configs/next.config.template.ts +77 -0
  66. package/templates/configs/next.config.ts +43 -0
  67. package/templates/configs/package.json +75 -0
  68. package/templates/configs/postcss.config.mjs +15 -0
  69. package/templates/configs/svgr.config.mjs +129 -0
  70. package/templates/configs/tsconfig.json +75 -0
  71. package/templates/docs/AI_QUICK_REFERENCE.md +379 -0
  72. package/templates/docs/ARCHITECTURE_PATTERNS.md +927 -0
  73. package/templates/docs/DOCUMENTATION_INDEX.md +411 -0
  74. package/templates/docs/FIGMA_TO_CODE_GUIDE.md +768 -0
  75. package/templates/docs/IMPLEMENTATION_GUIDE.md +892 -0
  76. package/templates/docs/PROJECT_OVERVIEW.md +302 -0
  77. package/templates/docs/REFACTOR_PROGRESS.md +1113 -0
  78. package/templates/docs/SHADCN_TO_HEROUI_MIGRATION.md +1375 -0
  79. package/templates/docs/UI_COMPONENTS_GUIDE.md +893 -0
@@ -0,0 +1,172 @@
1
+ import chalk from 'chalk';
2
+ import ora from 'ora';
3
+ import fs from 'fs-extra';
4
+ /**
5
+ * Figma Command - Generate UI components from Figma design
6
+ *
7
+ * This uses Claude with Figma MCP to:
8
+ * 1. Fetch Figma design
9
+ * 2. Analyze components and screens
10
+ * 3. Generate React components using HeroUI
11
+ * 4. Follow architecture patterns from docs/
12
+ */
13
+ export async function figmaCommand(figmaUrl, options) {
14
+ console.log(chalk.blue.bold('\n🎨 Figma UI Generator\n'));
15
+ const spinner = ora();
16
+ try {
17
+ // Validate Figma URL
18
+ if (!figmaUrl.includes('figma.com')) {
19
+ throw new Error('Invalid Figma URL');
20
+ }
21
+ // Check if docs exist
22
+ const docsExist = await fs.pathExists('docs/ARCHITECTURE_PATTERNS.md');
23
+ if (!docsExist) {
24
+ throw new Error('Documentation not found. Run this command in an Adlas project.');
25
+ }
26
+ // Ensure output directory exists
27
+ await fs.ensureDir(options.output);
28
+ spinner.start('Preparing Figma integration...');
29
+ // Create a temporary file with instructions for Claude
30
+ const instructionsPath = '.adlas-figma-instructions.md';
31
+ const instructions = generateFigmaInstructions(figmaUrl, options);
32
+ await fs.writeFile(instructionsPath, instructions);
33
+ spinner.succeed('Instructions prepared');
34
+ // Print next steps for user
35
+ console.log(chalk.green('\n✨ Ready to generate UI from Figma!\n'));
36
+ console.log(chalk.blue('Next steps:\n'));
37
+ console.log(chalk.gray('1. Open Claude Code or Claude in your IDE'));
38
+ console.log(chalk.gray('2. Give Claude this prompt:\n'));
39
+ console.log(chalk.white('---\n'));
40
+ console.log(chalk.cyan(`Read .adlas-figma-instructions.md and start implementing the UI from Figma.
41
+
42
+ Figma URL: ${figmaUrl}
43
+ Output directory: ${options.output}
44
+
45
+ Please:
46
+ 1. Use Figma MCP to fetch the design
47
+ 2. Follow the architecture patterns in docs/ARCHITECTURE_PATTERNS.md
48
+ 3. Use HeroUI components from docs/UI_COMPONENTS_GUIDE.md
49
+ 4. Generate components in the specified output directory
50
+ 5. Create proper service modules if needed
51
+
52
+ ${options.pages ? `Focus on these pages: ${options.pages.join(', ')}` : 'Start with the most important pages/screens'}
53
+ `));
54
+ console.log(chalk.white('---\n'));
55
+ console.log(chalk.yellow('💡 Tip: Claude will read the Figma design and generate components automatically!\n'));
56
+ }
57
+ catch (error) {
58
+ spinner.fail('Failed to prepare Figma integration');
59
+ console.error(chalk.red('\nError:'), error.message);
60
+ process.exit(1);
61
+ }
62
+ }
63
+ function generateFigmaInstructions(figmaUrl, options) {
64
+ return `# Figma UI Implementation Instructions
65
+
66
+ **Figma URL:** ${figmaUrl}
67
+ **Output Directory:** ${options.output}
68
+ ${options.pages ? `**Focus Pages:** ${options.pages.join(', ')}\n` : ''}
69
+
70
+ ## Your Task
71
+
72
+ Implement UI components from the Figma design following these steps:
73
+
74
+ ### Step 1: Analyze Figma Design
75
+
76
+ Use Figma MCP to:
77
+ 1. Fetch the Figma file: ${figmaUrl}
78
+ 2. List all frames/screens
79
+ 3. Identify components and their hierarchy
80
+ 4. Extract design tokens (colors, spacing, typography)
81
+
82
+ ### Step 2: Plan Implementation
83
+
84
+ For each screen/page:
85
+ 1. Identify reusable components
86
+ 2. Determine if service modules are needed
87
+ 3. Plan component structure following docs/ARCHITECTURE_PATTERNS.md
88
+
89
+ ### Step 3: Generate Components
90
+
91
+ For each component:
92
+ 1. **Use HeroUI components** - Reference docs/UI_COMPONENTS_GUIDE.md
93
+ 2. **Follow patterns** - Use docs/ARCHITECTURE_PATTERNS.md structure
94
+ 3. **Extract to features** - Create in ${options.output}
95
+ 4. **Add TypeScript types** - Proper interfaces and types
96
+ 5. **Make responsive** - Mobile-first approach
97
+
98
+ ### Step 4: Service Modules (if needed)
99
+
100
+ If the page needs data fetching:
101
+ 1. Create service module in src/services/[module-name]/
102
+ 2. Define types in [module-name].types.ts
103
+ 3. Create queries in [module-name].queries.ts using React Query
104
+ 4. Add store in [module-name].store.ts if state management needed
105
+
106
+ ### Important Guidelines
107
+
108
+ ✅ **DO:**
109
+ - Use HeroUI components exclusively (Button, Input, Card, etc.)
110
+ - Follow the service module pattern
111
+ - Add proper TypeScript types
112
+ - Make components responsive
113
+ - Extract reusable components
114
+ - Follow naming conventions from docs
115
+
116
+ ❌ **DON'T:**
117
+ - Use other UI libraries
118
+ - Create inline styles
119
+ - Skip TypeScript types
120
+ - Create monolithic components
121
+ - Ignore the documentation patterns
122
+
123
+ ### Example Structure
124
+
125
+ For a "Product List" page from Figma:
126
+
127
+ \`\`\`
128
+ ${options.output}/product/
129
+ ├── ProductCard.tsx # Individual product card
130
+ ├── ProductGrid.tsx # Grid of products
131
+ ├── ProductFilters.tsx # Filter sidebar
132
+ └── ProductSearch.tsx # Search input
133
+
134
+ src/services/product/
135
+ ├── product.types.ts # Types
136
+ ├── product.queries.ts # React Query hooks
137
+ └── product.store.ts # Zustand store (if needed)
138
+
139
+ src/app/[locale]/(website)/products/
140
+ └── page.tsx # Page using the components
141
+ \`\`\`
142
+
143
+ ### Workflow
144
+
145
+ 1. Start with the main/home page (or specified pages)
146
+ 2. Break down into components
147
+ 3. Implement one component at a time
148
+ 4. Test and refine
149
+ 5. Move to next page
150
+ 6. Document any decisions made
151
+
152
+ ### Questions to Ask Before Starting
153
+
154
+ 1. What screens/pages are in the Figma file?
155
+ 2. Which page should we start with?
156
+ 3. Are there any specific requirements or priorities?
157
+ 4. Should I create service modules for data fetching?
158
+
159
+ ### After Implementation
160
+
161
+ Update this file with:
162
+ - [x] Pages implemented
163
+ - [ ] Components created
164
+ - [ ] Service modules added
165
+ - [ ] Any issues or notes
166
+
167
+ ---
168
+
169
+ **Ready?** Let's build amazing UI from Figma! 🚀
170
+ `;
171
+ }
172
+ //# sourceMappingURL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AC,EAAE;;;;;;;;;2BAS5C,QAAQ;;;;;;;;;;;;;;;;;yCAiBM,OAAO,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCrD,OAAO,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Cf,CAAC;AACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { initCommand } from './init.js';
2
+ export { figmaCommand } from './figma.js';
3
+ export { swaggerCommand } from './swagger.js';
4
+ export { updateCommand } from './update.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { initCommand } from './init.js';
2
+ export { figmaCommand } from './figma.js';
3
+ export { swaggerCommand } from './swagger.js';
4
+ export { updateCommand } from './update.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ interface InitOptions {
2
+ projectType?: string;
3
+ skipInstall?: boolean;
4
+ skipGit?: boolean;
5
+ }
6
+ export declare function initCommand(projectName: string | undefined, options: InitOptions): Promise<void>;
7
+ export {};
8
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAyBA,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6EtG"}