@l4yercak3/cli 1.2.16 → 1.2.19

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 (31) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/docs/CRM-PIPELINES-SEQUENCES-SPEC.md +429 -0
  3. package/docs/INTEGRATION_PATHS_ARCHITECTURE.md +1543 -0
  4. package/package.json +1 -1
  5. package/src/commands/login.js +26 -7
  6. package/src/commands/spread.js +251 -10
  7. package/src/detectors/database-detector.js +245 -0
  8. package/src/detectors/expo-detector.js +4 -4
  9. package/src/detectors/index.js +17 -4
  10. package/src/generators/api-only/client.js +683 -0
  11. package/src/generators/api-only/index.js +96 -0
  12. package/src/generators/api-only/types.js +618 -0
  13. package/src/generators/api-only/webhooks.js +377 -0
  14. package/src/generators/env-generator.js +23 -8
  15. package/src/generators/expo-auth-generator.js +1009 -0
  16. package/src/generators/index.js +88 -2
  17. package/src/generators/mcp-guide-generator.js +256 -0
  18. package/src/generators/quickstart/components/index.js +1699 -0
  19. package/src/generators/quickstart/components-mobile/index.js +1440 -0
  20. package/src/generators/quickstart/database/convex.js +1257 -0
  21. package/src/generators/quickstart/database/index.js +34 -0
  22. package/src/generators/quickstart/database/supabase.js +1132 -0
  23. package/src/generators/quickstart/hooks/index.js +1065 -0
  24. package/src/generators/quickstart/index.js +177 -0
  25. package/src/generators/quickstart/pages/index.js +1466 -0
  26. package/src/generators/quickstart/screens/index.js +1498 -0
  27. package/src/mcp/registry/domains/benefits.js +798 -0
  28. package/src/mcp/registry/index.js +2 -0
  29. package/tests/database-detector.test.js +221 -0
  30. package/tests/expo-detector.test.js +3 -4
  31. package/tests/generators-index.test.js +215 -3
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Quick Start Generator
3
+ * Orchestrates full-stack generation for the Quick Start path
4
+ */
5
+
6
+ const databaseGenerator = require('./database');
7
+ const hooksGenerator = require('./hooks');
8
+ const componentGenerator = require('./components');
9
+ const mobileComponentGenerator = require('./components-mobile');
10
+ const pageGenerator = require('./pages');
11
+ const screensGenerator = require('./screens');
12
+ const apiOnlyGenerator = require('../api-only');
13
+ const envGenerator = require('../env-generator');
14
+ const nextauthGenerator = require('../nextauth-generator');
15
+ const expoAuthGenerator = require('../expo-auth-generator');
16
+ const oauthGuideGenerator = require('../oauth-guide-generator');
17
+ const gitignoreGenerator = require('../gitignore-generator');
18
+
19
+ class QuickStartGenerator {
20
+ /**
21
+ * Check if framework is a mobile platform
22
+ */
23
+ isMobileFramework(frameworkType) {
24
+ return ['expo', 'react-native'].includes(frameworkType);
25
+ }
26
+
27
+ /**
28
+ * Check if framework is Next.js
29
+ */
30
+ isNextJs(frameworkType) {
31
+ return frameworkType === 'nextjs';
32
+ }
33
+
34
+ /**
35
+ * Generate all Quick Start files
36
+ * @param {Object} options - Generation options
37
+ * @returns {Promise<Object>} - Generated file paths
38
+ */
39
+ async generate(options) {
40
+ const results = {
41
+ // API Client (from api-only generator)
42
+ apiClient: null,
43
+ types: null,
44
+ webhooks: null,
45
+ index: null,
46
+
47
+ // Database
48
+ database: null,
49
+
50
+ // Hooks
51
+ hooks: null,
52
+
53
+ // Components
54
+ components: null,
55
+
56
+ // Pages (Next.js only)
57
+ pages: null,
58
+
59
+ // Screens (Expo only)
60
+ screens: null,
61
+
62
+ // Common files
63
+ envFile: null,
64
+ nextauth: null,
65
+ expoAuth: null,
66
+ oauthGuide: null,
67
+ gitignore: null,
68
+ };
69
+
70
+ const frameworkType = options.frameworkType || 'unknown';
71
+ const isMobile = this.isMobileFramework(frameworkType);
72
+ const isNextJs = this.isNextJs(frameworkType);
73
+
74
+ // 1. Generate the typed API client package
75
+ const apiOnlyResults = await apiOnlyGenerator.generate(options);
76
+ results.apiClient = apiOnlyResults.client;
77
+ results.types = apiOnlyResults.types;
78
+ results.webhooks = apiOnlyResults.webhooks;
79
+ results.index = apiOnlyResults.index;
80
+
81
+ // 2. Generate database files if database selected
82
+ if (options.selectedDatabase && options.selectedDatabase !== 'none' && options.selectedDatabase !== 'existing') {
83
+ results.database = await databaseGenerator.generate(options);
84
+ }
85
+
86
+ // 3. Generate React hooks for data fetching
87
+ if (options.features && options.features.length > 0) {
88
+ results.hooks = await hooksGenerator.generate(options);
89
+ }
90
+
91
+ // 4. Generate React components (mobile or web)
92
+ if (options.features && options.features.length > 0) {
93
+ if (isMobile) {
94
+ results.components = await mobileComponentGenerator.generate(options);
95
+ } else {
96
+ results.components = await componentGenerator.generate(options);
97
+ }
98
+ }
99
+
100
+ // 5. Generate pages (Next.js) or screens (Expo)
101
+ if (options.features && options.features.length > 0) {
102
+ if (isNextJs) {
103
+ results.pages = await pageGenerator.generate(options);
104
+ } else if (isMobile) {
105
+ results.screens = await screensGenerator.generate(options);
106
+ }
107
+ }
108
+
109
+ // 6. Generate environment file
110
+ results.envFile = envGenerator.generate(this.enhanceEnvOptions(options));
111
+
112
+ // 7. Generate auth config if OAuth is enabled
113
+ if (options.features && options.features.includes('oauth') && options.oauthProviders) {
114
+ if (isNextJs) {
115
+ // NextAuth.js for Next.js
116
+ results.nextauth = await nextauthGenerator.generate(options);
117
+ } else if (isMobile) {
118
+ // expo-auth-session for Expo/React Native
119
+ results.expoAuth = await expoAuthGenerator.generate(options);
120
+ }
121
+ }
122
+
123
+ // 8. Generate OAuth guide if OAuth is enabled
124
+ if (options.features && options.features.includes('oauth') && options.oauthProviders) {
125
+ results.oauthGuide = oauthGuideGenerator.generate({
126
+ ...options,
127
+ isMobile,
128
+ isNextJs,
129
+ });
130
+ }
131
+
132
+ // 9. Update .gitignore
133
+ results.gitignore = gitignoreGenerator.generate(options);
134
+
135
+ return results;
136
+ }
137
+
138
+ /**
139
+ * Add database-specific env vars to options
140
+ */
141
+ enhanceEnvOptions(options) {
142
+ const enhanced = { ...options };
143
+ enhanced.additionalEnvVars = enhanced.additionalEnvVars || [];
144
+
145
+ const isMobile = this.isMobileFramework(options.frameworkType);
146
+ // Use EXPO_PUBLIC_ for Expo, NEXT_PUBLIC_ for Next.js
147
+ const publicPrefix = isMobile ? 'EXPO_PUBLIC_' : 'NEXT_PUBLIC_';
148
+
149
+ if (options.selectedDatabase === 'convex') {
150
+ enhanced.additionalEnvVars.push(
151
+ { key: 'CONVEX_DEPLOYMENT', value: '', comment: 'Convex deployment URL (from npx convex dev)' },
152
+ { key: `${publicPrefix}CONVEX_URL`, value: '', comment: 'Convex public URL' }
153
+ );
154
+ } else if (options.selectedDatabase === 'supabase') {
155
+ enhanced.additionalEnvVars.push(
156
+ { key: `${publicPrefix}SUPABASE_URL`, value: '', comment: 'Supabase project URL' },
157
+ { key: `${publicPrefix}SUPABASE_ANON_KEY`, value: '', comment: 'Supabase anonymous key' },
158
+ { key: 'SUPABASE_SERVICE_ROLE_KEY', value: '', comment: 'Supabase service role key (server only)' }
159
+ );
160
+ }
161
+
162
+ if (options.features && options.features.includes('checkout')) {
163
+ enhanced.additionalEnvVars.push(
164
+ { key: 'STRIPE_SECRET_KEY', value: '', comment: 'Stripe secret key' },
165
+ { key: 'STRIPE_WEBHOOK_SECRET', value: '', comment: 'Stripe webhook signing secret' },
166
+ { key: `${publicPrefix}STRIPE_PUBLISHABLE_KEY`, value: '', comment: 'Stripe publishable key' }
167
+ );
168
+ }
169
+
170
+ // Pass mobile flag to env generator
171
+ enhanced.isMobile = isMobile;
172
+
173
+ return enhanced;
174
+ }
175
+ }
176
+
177
+ module.exports = new QuickStartGenerator();