@vc-shell/create-vc-app 1.1.99-alpha.1 → 1.2.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 (83) hide show
  1. package/README.md +26 -552
  2. package/dist/index.js +530 -1900
  3. package/dist/templates/base/_package.json +5 -5
  4. package/dist/templates/base/src/main.ts +4 -0
  5. package/dist/templates/mocks/sample-data/constants.ts +89 -0
  6. package/dist/templates/mocks/sample-data/index.ts +2 -0
  7. package/dist/templates/mocks/sample-data/methods.ts +65 -0
  8. package/dist/templates/modules/classic-module/composables/index.ts +2 -0
  9. package/dist/templates/modules/classic-module/composables/use{{ModuleNamePascalCase}}Details/index.ts +24 -0
  10. package/dist/templates/modules/classic-module/composables/use{{ModuleNamePascalCase}}List/index.ts +47 -0
  11. package/dist/templates/modules/classic-module/index.ts +8 -0
  12. package/dist/templates/modules/classic-module/locales/en.json +37 -0
  13. package/dist/templates/modules/classic-module/locales/index.ts +2 -0
  14. package/dist/templates/modules/classic-module/pages/details.vue +87 -0
  15. package/dist/templates/modules/classic-module/pages/index.ts +2 -0
  16. package/dist/templates/modules/classic-module/pages/list.vue +257 -0
  17. package/dist/templates/sample/classic-module/composables/index.ts +2 -0
  18. package/dist/templates/sample/classic-module/composables/useDetails/index.ts +54 -0
  19. package/dist/templates/sample/classic-module/composables/useList/index.ts +62 -0
  20. package/dist/templates/sample/classic-module/index.ts +8 -0
  21. package/dist/templates/sample/classic-module/locales/en.json +67 -0
  22. package/dist/templates/sample/classic-module/locales/index.ts +2 -0
  23. package/dist/templates/sample/classic-module/pages/details.vue +238 -0
  24. package/dist/templates/sample/classic-module/pages/index.ts +2 -0
  25. package/dist/templates/sample/classic-module/pages/list.vue +300 -0
  26. package/dist/templates/sample/overrides/main.ts +52 -0
  27. package/package.json +7 -12
  28. package/dist/cli/argv.d.ts +0 -4
  29. package/dist/cli/argv.d.ts.map +0 -1
  30. package/dist/cli/constants.d.ts +0 -4
  31. package/dist/cli/constants.d.ts.map +0 -1
  32. package/dist/cli/errors.d.ts +0 -12
  33. package/dist/cli/errors.d.ts.map +0 -1
  34. package/dist/cli/help.d.ts +0 -3
  35. package/dist/cli/help.d.ts.map +0 -1
  36. package/dist/cli/run.d.ts +0 -2
  37. package/dist/cli/run.d.ts.map +0 -1
  38. package/dist/cli/runtime.d.ts +0 -7
  39. package/dist/cli/runtime.d.ts.map +0 -1
  40. package/dist/cli/types.d.ts +0 -30
  41. package/dist/cli/types.d.ts.map +0 -1
  42. package/dist/cli/utils.d.ts +0 -4
  43. package/dist/cli/utils.d.ts.map +0 -1
  44. package/dist/cli/validation.d.ts +0 -5
  45. package/dist/cli/validation.d.ts.map +0 -1
  46. package/dist/commands/generate-blade.d.ts +0 -16
  47. package/dist/commands/generate-blade.d.ts.map +0 -1
  48. package/dist/templates/base/ai-guides/.cursorrules-vc-shell +0 -529
  49. package/dist/templates/base/ai-guides/README.md +0 -360
  50. package/dist/templates/base/ai-guides/guides/AI_GUIDE.md +0 -195
  51. package/dist/templates/base/ai-guides/guides/blade-patterns.md +0 -384
  52. package/dist/templates/base/ai-guides/guides/complete-workflow.md +0 -781
  53. package/dist/templates/base/ai-guides/guides/composables-reference.md +0 -338
  54. package/dist/templates/base/ai-guides/guides/troubleshooting.md +0 -529
  55. package/dist/templates/base/ai-guides/guides/ui-components-reference.md +0 -903
  56. package/dist/templates/base/ai-guides/prompts/adapt-existing-module.md +0 -1026
  57. package/dist/templates/base/ai-guides/prompts/advanced-scenarios.md +0 -852
  58. package/dist/templates/base/ai-guides/prompts/api-client-generation.md +0 -877
  59. package/dist/templates/base/ai-guides/prompts/cli-usage.md +0 -640
  60. package/dist/templates/base/ai-guides/prompts/quick-start-scenarios.md +0 -773
  61. package/dist/templates/base/ai-guides/prompts/simple-modifications.md +0 -987
  62. package/dist/templates/blades/details/blade.vue +0 -175
  63. package/dist/templates/blades/grid/blade.vue +0 -340
  64. package/dist/templates/composables/details-composable.ts +0 -101
  65. package/dist/templates/composables/grid-composable.ts +0 -244
  66. package/dist/templates/module/components/index.ts +0 -2
  67. package/dist/templates/module/components/widgets/index.ts +0 -2
  68. package/dist/templates/module/composables/index.ts +0 -3
  69. package/dist/templates/module/index.ts +0 -13
  70. package/dist/templates/module/locales/en.json +0 -65
  71. package/dist/templates/module/locales/index.ts +0 -4
  72. package/dist/templates/module/pages/index.ts +0 -3
  73. package/dist/templates/widgets/widget.vue +0 -113
  74. package/dist/utils/form-builder.d.ts +0 -69
  75. package/dist/utils/form-builder.d.ts.map +0 -1
  76. package/dist/utils/format.d.ts +0 -24
  77. package/dist/utils/format.d.ts.map +0 -1
  78. package/dist/utils/naming.d.ts +0 -44
  79. package/dist/utils/naming.d.ts.map +0 -1
  80. package/dist/utils/register-module.d.ts +0 -21
  81. package/dist/utils/register-module.d.ts.map +0 -1
  82. package/dist/workflows/create-app.d.ts +0 -14
  83. package/dist/workflows/create-app.d.ts.map +0 -1
@@ -1,360 +0,0 @@
1
- # VC-Shell AI Guidance System
2
-
3
- Comprehensive AI guidance system for the VC-Shell framework, allowing clients without framework knowledge to create and modify applications using natural language.
4
-
5
- ## What is this?
6
-
7
- This system provides AI assistants with complete knowledge of the VC-Shell framework, including:
8
-
9
- - All 45 UI components with their props and events
10
- - Blade system with 4 required props
11
- - Module patterns and composables
12
- - Correct API integration
13
- - Form validation with VeeValidate
14
- - CLI usage and automation
15
- - Complete development workflow
16
- - And much more
17
-
18
- ## Getting Started in 5 Minutes
19
-
20
- ### 1. Create Your Application
21
-
22
- ```bash
23
- npx create-vc-app my-app
24
- ```
25
-
26
- ### 2. Let AI Build Your First Module
27
-
28
- Open your AI assistant and say:
29
-
30
- ```
31
- Create a products module with list and details views.
32
- Add fields: name, price, category, description.
33
- ```
34
-
35
- ### 3. Run and Test
36
-
37
- ```bash
38
- cd my-app
39
- yarn
40
- yarn serve
41
- ```
42
-
43
- **Open:** `http://localhost:8080/apps/my-app/`
44
-
45
- ✅ **Done!** You now have a working application with a products module.
46
-
47
- ---
48
-
49
- ## How to Use This System
50
-
51
- ### For New Projects
52
-
53
- When creating a new application via `create-vc-app`, the AI guidance system is automatically included in your project at `ai-guides/`.
54
-
55
- ### For Existing Projects
56
-
57
- Copy the `.cursorrules-vc-shell` file to your project root and rename it to `.cursorrules`.
58
-
59
- ### Choose Your Prompt
60
-
61
- Use this decision tree to find the right prompt:
62
-
63
- ```
64
- Need to...
65
- ├── Create new app?
66
- │ └── See: prompts/cli-usage.md (Section: Create New Application)
67
-
68
- ├── Generate module?
69
- │ ├── Common type? (products, orders, etc.)
70
- │ │ └── See: prompts/quick-start-scenarios.md
71
- │ └── Custom module?
72
- │ └── See: prompts/cli-usage.md (Section: Generate Module)
73
-
74
- ├── Connect to API?
75
- │ ├── VirtoCommerce Platform?
76
- │ │ └── See: prompts/api-client-generation.md (VirtoCommerce)
77
- │ ├── Custom REST API?
78
- │ │ └── See: prompts/api-client-generation.md (Custom API)
79
- │ └── GraphQL?
80
- │ └── See: prompts/api-client-generation.md (GraphQL)
81
-
82
- ├── Modify existing module?
83
- │ ├── Simple changes? (add field, change control)
84
- │ │ └── See: prompts/simple-modifications.md
85
- │ └── Complex changes? (dynamic forms, workflows)
86
- │ └── See: prompts/advanced-scenarios.md
87
-
88
- ├── Having issues?
89
- │ └── See: guides/troubleshooting.md
90
-
91
- └── Want full walkthrough?
92
- └── See: guides/complete-workflow.md
93
- ```
94
-
95
- ## System Structure
96
-
97
- ### Main files
98
-
99
- - **`.cursorrules-vc-shell`** - Main file with complete framework knowledge
100
- - **`README.md`** - This overview file
101
-
102
- ### Prompt Templates (`prompts/`)
103
-
104
- **Getting Started:**
105
-
106
- - **`cli-usage.md`** - Complete CLI reference with examples
107
- - **`quick-start-scenarios.md`** - Ready-to-use prompts for common modules (10 scenarios)
108
- - **`api-client-generation.md`** - Connecting to APIs (VirtoCommerce, REST, GraphQL)
109
-
110
- **Customization:**
111
-
112
- - **`simple-modifications.md`** - Universal prompt templates for any modification (65+ templates)
113
- - **`adapt-existing-module.md`** - Complete guide for adapting existing modules to your needs
114
- - **`advanced-scenarios.md`** - Complex patterns (dynamic forms, wizards, workflows)
115
-
116
- ### Technical Guides (`guides/`)
117
-
118
- **Essential:**
119
-
120
- - **`complete-workflow.md`** - Full development workflow from creation to deployment
121
- - **`troubleshooting.md`** - Solutions for common issues
122
-
123
- **Reference:**
124
-
125
- - **`blade-patterns.md`** - Complete blade patterns and examples
126
- - **`composables-reference.md`** - All composables with usage examples
127
- - **`ui-components-reference.md`** - Reference for all 45 UI components
128
- - **`AI_GUIDE.md`** - Quick reference for AI assistants
129
-
130
- ## Real-World Examples
131
-
132
- ### Example 1: E-commerce from Scratch
133
-
134
- **User said:**
135
-
136
- ```
137
- Create a complete e-commerce application.
138
- I need: products, categories, orders, customers modules.
139
- Each with list and edit views.
140
- Use create-vc-app CLI to generate everything.
141
- ```
142
-
143
- **AI did:**
144
-
145
- 1. Created app with `npx create-vc-app my-shop`
146
- 2. Generated 4 modules using CLI
147
- 3. Created appropriate form fields for each
148
- 4. Set up module registration
149
- 5. Result: Working app with 4 modules in ~5 minutes
150
-
151
- ### Example 2: Custom API Integration
152
-
153
- **User said:**
154
-
155
- ```
156
- Connect my products module to my backend at https://api.myshop.com
157
-
158
- My API uses:
159
- - JWT authentication
160
- - GET /api/v1/products (list with pagination)
161
- - POST /api/v1/products (create)
162
- - PUT /api/v1/products/{id} (update)
163
- - DELETE /api/v1/products/{id} (delete)
164
-
165
- Response format: { data: [], total: number }
166
- ```
167
-
168
- **AI did:**
169
-
170
- 1. Created custom API client in `src/api_client/`
171
- 2. Updated composables to use the API
172
- 3. Added authentication headers
173
- 4. Handled pagination correctly
174
- 5. Result: Module connected to real backend
175
-
176
- ### Example 3: Modify Existing Module
177
-
178
- **User said:**
179
-
180
- ```
181
- I have this products module [shows code].
182
- Add these fields:
183
- - SKU (text, required, unique)
184
- - Weight (number with kg units)
185
- - Tags (multiple values)
186
- - Images (gallery with 5 max)
187
- Remove the "oldDescription" field.
188
- ```
189
-
190
- **AI did:**
191
-
192
- 1. Analyzed existing code structure
193
- 2. Added new form fields with correct components
194
- 3. Added validation rules
195
- 4. Updated locales
196
- 5. Removed old field
197
- 6. Result: Updated module with new fields
198
-
199
- ### Example 4: Complex Workflow
200
-
201
- **User said:**
202
-
203
- ```
204
- Create document approval workflow:
205
- Draft → Submit → Approve/Reject → Publish
206
-
207
- Rules:
208
- - Authors can create and submit
209
- - Reviewers can approve/reject
210
- - Admins can override any state
211
- Show approval history timeline.
212
- ```
213
-
214
- **AI did:**
215
-
216
- 1. Implemented state machine
217
- 2. Created role-based permissions
218
- 3. Added state transition validation
219
- 4. Built history timeline component
220
- 5. Added notifications for state changes
221
- 6. Result: Complete approval system
222
-
223
- ---
224
-
225
- ## Tips for Better AI Results
226
-
227
- ### ✅ Do This:
228
-
229
- ```
230
- Create an orders module using create-vc-app CLI.
231
-
232
- Requirements:
233
- - Grid blade with columns: order number, customer, total, status, date
234
- - Details blade with these fields:
235
- - Order number (text, read-only)
236
- - Customer (text, required)
237
- - Total (currency, required)
238
- - Status (select: pending, shipped, delivered)
239
- - Date (date picker, default today)
240
-
241
- Connect to API at https://api.example.com/orders
242
- ```
243
-
244
- **Why it works:**
245
-
246
- - Specific about tool (CLI)
247
- - Clear structure
248
- - Detailed requirements
249
- - Mentions API connection
250
-
251
- ### ❌ Don't Do This:
252
-
253
- ```
254
- Make a orders thing
255
- ```
256
-
257
- **Why it doesn't work:**
258
-
259
- - Too vague
260
- - No context
261
- - No requirements
262
- - No mention of framework/CLI
263
-
264
- ### More Tips:
265
-
266
- 1. **Be Specific:** Describe exact fields and types
267
- 2. **Mention CLI:** Say "use create-vc-app CLI" or "generate with CLI"
268
- 3. **Provide API Info:** Include endpoints and authentication
269
- 4. **Show Examples:** Reference similar modules or show code snippets
270
- 5. **Break It Down:** For complex features, describe step by step
271
-
272
- ## System Capabilities
273
-
274
- ### What AI can do
275
-
276
- - Create complete modules from scratch
277
- - Modify existing blades
278
- - Connect to any API (REST, GraphQL)
279
- - Generate API clients
280
- - Register modules in applications
281
- - Create forms with validation
282
- - Configure tables and filters
283
- - Add authentication
284
- - Customize UI
285
- - And much more!
286
-
287
- ### Key Features
288
-
289
- - **Natural language** - simply describe what you want
290
- - **Complete framework knowledge** - AI knows all 45 components
291
- - **Universality** - works with any modules and APIs
292
- - **Automatic integration** - works out of the box in new projects
293
- - **Self-sufficiency** - no need to refer to external documentation
294
-
295
- ## Quick Start
296
-
297
- ### 1. Creating a new project
298
-
299
- ```bash
300
- npx create-vc-app my-app
301
- cd my-app
302
- ```
303
-
304
- AI guidance is already included! Now you can use AI for development.
305
-
306
- ### 2. Adding a module
307
-
308
- Open AI chat and write:
309
-
310
- ```
311
- Create an orders module with list and edit forms
312
- ```
313
-
314
- ### 3. Modifying existing module
315
-
316
- ```
317
- Add "SKU" field and category filter to products module
318
- ```
319
-
320
- ### 4. Connecting to API
321
-
322
- ```
323
- Connect module to my API: https://api.example.com
324
- ```
325
-
326
- ## Technical Details
327
-
328
- ### Blade System
329
-
330
- - **4 required props**: expanded, closable, param, options
331
- - **Events**: parent:call, close:blade, collapse:blade, expand:blade
332
- - **Toolbar**: IBladeToolbar[] with id, title, icon, onClick, disabled, loading
333
-
334
- ### Module Structure
335
-
336
- ```
337
- src/modules/[name]/
338
- ├── pages/list.vue, details.vue, index.ts
339
- ├── composables/use[Name]List/, use[Name]Details/, index.ts
340
- ├── locales/en.json, index.ts
341
- └── index.ts (createAppModule)
342
- ```
343
-
344
- ### API Integration
345
-
346
- 1. Add to `.env.local`: `APP_PLATFORM_URL=https://platform-url/`
347
- 2. Run: `yarn generate-api-client`
348
- 3. Use: `const { getApiClient } = useApiClient(Client)`
349
-
350
- ### Form Validation
351
-
352
- ```vue
353
- <Field name="field" v-slot="{ errors, errorMessage, handleChange }" :rules="{ required: true }">
354
- <VcInput
355
- :model-value="data.field"
356
- :error-message="errorMessage"
357
- @update:model-value="(v) => { data.field = v; handleChange(v); }"
358
- />
359
- </Field>
360
- ```
@@ -1,195 +0,0 @@
1
- # AI Development Guide
2
-
3
- Welcome to your new VC-Shell project! This project is already configured with AI guidance that will help you develop applications quickly.
4
-
5
- ## What can AI do?
6
-
7
- The AI in this project knows everything about the VC-Shell framework and can:
8
-
9
- ### 🚀 Create modules from scratch
10
- ```
11
- Create a product management module:
12
- - List with table (name, price, category, status)
13
- - Edit form with fields: name, description, price
14
- - API: /api/products
15
- - Add to menu with "inventory" icon
16
- ```
17
-
18
- ### ✏️ Modify existing blades
19
- ```
20
- Add these fields to product form:
21
- - SKU (text, required)
22
- - Weight (number with units)
23
- - Category (select from list)
24
- - "In Stock" toggle
25
- ```
26
-
27
- ### 🔌 Connect to any API
28
- ```
29
- Connect module to my API:
30
- - URL: https://my-backend.com/api
31
- - Authentication: Bearer token
32
- - Endpoints: GET /items, POST /items, PUT /items/{id}
33
- ```
34
-
35
- ### 🎨 Customize UI
36
- ```
37
- Make module mobile-friendly:
38
- - Responsive table
39
- - Touch-friendly buttons
40
- - Mobile navigation
41
- ```
42
-
43
- ## Project Structure
44
-
45
- ```
46
- src/
47
- ├── modules/ # Your modules
48
- │ └── [name]/
49
- │ ├── pages/ # Blades (list.vue, details.vue)
50
- │ ├── composables/ # Business logic
51
- │ ├── locales/ # Translations
52
- │ └── index.ts # Module registration
53
- ├── core/ # Framework core
54
- ├── shared/ # Shared components
55
- └── ui/ # UI components
56
- ```
57
-
58
- ## Prompt Examples
59
-
60
- ### Simple Modifications
61
- ```
62
- Add "email" field to product form
63
- Modify table - add "status" column
64
- Make "price" field required
65
- Add "Duplicate" button to toolbar
66
- ```
67
-
68
- ### Complex Tasks
69
- ```
70
- Create orders module with tabs:
71
- - "General" tab: customer, date, status
72
- - "Items" tab: items table
73
- - "Shipping" tab: address, shipping method
74
- - "Payment" tab: payment method, status
75
- ```
76
-
77
- ### API Integration
78
- ```
79
- Create API client for my backend:
80
- - Swagger URL: https://api.example.com/swagger.json
81
- - Authentication: JWT token
82
- - Integrate into products module
83
- ```
84
-
85
- ## Workflow
86
-
87
- ### 1. Creating a Module
88
- 1. Describe what you need to AI
89
- 2. AI will create complete module structure
90
- 3. Module will be automatically registered in the app
91
-
92
- ### 2. Modifying Existing Module
93
- 1. Attach file or specify path
94
- 2. Describe changes
95
- 3. AI will update code while preserving functionality
96
-
97
- ### 3. Connecting to API
98
- 1. Specify API URL and format
99
- 2. AI will generate client
100
- 3. Update module to work with new API
101
-
102
- ## Useful Commands
103
-
104
- ```bash
105
- # Development
106
- yarn dev
107
-
108
- # Build
109
- yarn build
110
-
111
- # Generate API client
112
- yarn generate-api-client
113
-
114
- # Type checking
115
- yarn type-check
116
-
117
- # Linting
118
- yarn lint
119
- ```
120
-
121
- ## API Configuration
122
-
123
- 1. Add to `.env.local`:
124
- ```
125
- APP_PLATFORM_URL=https://your-api-url.com/
126
- ```
127
-
128
- 2. Run generation:
129
- ```bash
130
- yarn generate-api-client
131
- ```
132
-
133
- 3. Use in modules:
134
- ```typescript
135
- const { getApiClient } = useApiClient(GeneratedClient);
136
- const client = getApiClient();
137
- ```
138
-
139
- ## Tips for Working with AI
140
-
141
- ### ✅ Good Prompts
142
- - Describe specifically what you need
143
- - Specify field types and validation
144
- - Specify API endpoints
145
- - Describe UI requirements
146
-
147
- ### ❌ Avoid
148
- - Too generic descriptions
149
- - Contradictory requirements
150
- - Unspecified API details
151
-
152
- ### 💡 Examples of Good Prompts
153
-
154
- **Creating a Module:**
155
- ```
156
- Create customers module:
157
- - List: name, email, phone, status, registration date
158
- - Form: name (required), email (required, validation), phone, status (active/inactive)
159
- - API: GET /clients, POST /clients, PUT /clients/{id}, DELETE /clients/{id}
160
- - Add to menu with "people" icon
161
- ```
162
-
163
- **Modification:**
164
- ```
165
- In products module add:
166
- - Category filter (dropdown)
167
- - Search by name (input field)
168
- - "Export to Excel" button
169
- - Product image column
170
- ```
171
-
172
- **API Integration:**
173
- ```
174
- Connect module to GraphQL API:
175
- - Endpoint: https://api.example.com/graphql
176
- - Authentication: Bearer token in Authorization header
177
- - Queries: products query, createProduct mutation, updateProduct mutation
178
- - Update composables to work with GraphQL
179
- ```
180
-
181
- ## Getting Help
182
-
183
- If AI doesn't understand your request:
184
- 1. Clarify details
185
- 2. Provide examples
186
- 3. Describe desired result
187
- 4. Specify constraints
188
-
189
- ## Additional Resources
190
-
191
- - Full documentation: `/docs/ai-guides/`
192
- - Prompt examples: `/docs/ai-guides/prompts/`
193
- - Technical guides: `/docs/ai-guides/guides/`
194
-
195
- Happy coding! 🚀