create-propelkit 1.0.4 → 1.0.5

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": "create-propelkit",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Initialize a PropelKit SaaS project with AI PM",
5
5
  "bin": "./bin/cli.js",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -8,6 +8,7 @@ const { runSetupWizard } = require('./setup-wizard');
8
8
  const { launchClaude } = require('./launcher');
9
9
  const { validateLicense } = require('./license-validator');
10
10
  const { askPaymentProcessor, askPaymentKeys } = require('./payment-config');
11
+ const { runLovableFlow } = require('./lovable-flow');
11
12
  const messages = require('./messages');
12
13
 
13
14
  async function main() {
@@ -105,7 +106,10 @@ async function main() {
105
106
  await runSetupWizard(projectDir);
106
107
  messages.starterWizardComplete();
107
108
  } else {
108
- // Pro: Launch Claude Code directly - AI PM handles everything
109
+ // Pro: Step 6.1 - Lovable design choice
110
+ await runLovableFlow(projectDir);
111
+
112
+ // Pro: Step 6.2 - Launch Claude Code directly - AI PM handles everything
109
113
  messages.proLaunchingAIPM(projectDir);
110
114
 
111
115
  // Give user time to read the instructions
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Lovable Flow Module
3
+ *
4
+ * Handles Lovable UI design approach prompts for CLI wizard.
5
+ * Called during PRO tier setup, before launching AI PM.
6
+ */
7
+
8
+ const inquirer = require('inquirer');
9
+ const chalk = require('chalk');
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+ const { updateBlueprint } = require('./blueprint-manager');
13
+
14
+ /**
15
+ * Ask user about Lovable UI design approach
16
+ * @returns {Promise<'make-new'|'have-existing'|'skip'>}
17
+ */
18
+ async function askLovableChoice() {
19
+ console.log('');
20
+ console.log(chalk.cyan.bold('UI Design Approach'));
21
+ console.log(chalk.dim('Choose how you want to create your user interface'));
22
+ console.log('');
23
+
24
+ const { choice } = await inquirer.prompt([
25
+ {
26
+ type: 'list',
27
+ name: 'choice',
28
+ message: 'How would you like to handle UI design?',
29
+ choices: [
30
+ {
31
+ name: 'Make new UI with Lovable - AI will help you design beautiful interfaces',
32
+ value: 'make-new'
33
+ },
34
+ {
35
+ name: 'Have existing designs - Paste your Lovable code into lovable-import/',
36
+ value: 'have-existing'
37
+ },
38
+ {
39
+ name: 'Skip for now - Focus on backend first, design later',
40
+ value: 'skip'
41
+ }
42
+ ]
43
+ }
44
+ ]);
45
+
46
+ return choice;
47
+ }
48
+
49
+ /**
50
+ * Display guidance based on Lovable choice
51
+ * @param {string} choice - 'make-new' | 'have-existing' | 'skip'
52
+ */
53
+ function displayLovableGuidance(choice) {
54
+ console.log('');
55
+
56
+ if (choice === 'make-new') {
57
+ console.log(chalk.cyan('The AI PM will help you design your UI.'));
58
+ console.log('');
59
+ console.log(chalk.dim('Tips for great Lovable prompts:'));
60
+ console.log(chalk.dim(' - Look at competitors for inspiration (what works? what doesn\'t?)'));
61
+ console.log(chalk.dim(' - Be specific about your brand colors and typography'));
62
+ console.log(chalk.dim(' - Describe the vibe: professional, playful, minimal, bold'));
63
+ console.log(chalk.dim(' - Mention specific UI patterns you like (sidebars, cards, modals)'));
64
+ console.log('');
65
+ console.log(chalk.dim('The AI PM will guide you through extensive design questions.'));
66
+ } else if (choice === 'have-existing') {
67
+ console.log(chalk.cyan('Paste your Lovable code into lovable-import/ when ready.'));
68
+ console.log('');
69
+ console.log(chalk.dim('The AI PM will detect and integrate your designs automatically.'));
70
+ console.log(chalk.dim('Integration includes:'));
71
+ console.log(chalk.dim(' - Translation from React/Vite to Next.js App Router'));
72
+ console.log(chalk.dim(' - Backend wiring analysis'));
73
+ console.log(chalk.dim(' - Component organization'));
74
+ console.log('');
75
+ console.log(chalk.dim('You can paste code before or after AI PM starts.'));
76
+ } else {
77
+ console.log(chalk.yellow('Design skipped for now.'));
78
+ console.log('');
79
+ console.log(chalk.dim('You can add UI later using:'));
80
+ console.log(chalk.dim(' - AI PM design flow (during conversation)'));
81
+ console.log(chalk.dim(' - Paste code into lovable-import/ anytime'));
82
+ console.log('');
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Create lovable-import directory in project
88
+ * @param {string} projectDir - Project directory path
89
+ */
90
+ function createLovableImportDir(projectDir) {
91
+ const lovableDir = path.join(projectDir, 'lovable-import');
92
+ if (!fs.existsSync(lovableDir)) {
93
+ fs.mkdirSync(lovableDir, { recursive: true });
94
+
95
+ // Add README to explain the folder
96
+ const readmePath = path.join(lovableDir, 'README.md');
97
+ const readmeContent = `# Lovable Import Directory
98
+
99
+ Paste your Lovable-generated code here.
100
+
101
+ ## What to paste
102
+
103
+ Export your project from Lovable and paste all React components and files here.
104
+ The AI PM will automatically:
105
+
106
+ 1. **Detect** the code when you're ready
107
+ 2. **Translate** from React/Vite to Next.js App Router
108
+ 3. **Integrate** with PropelKit backend APIs
109
+ 4. **Generate** an integration report
110
+
111
+ ## Folder structure
112
+
113
+ Paste your Lovable export maintaining the original structure:
114
+ \`\`\`
115
+ lovable-import/
116
+ ├── src/
117
+ │ ├── components/
118
+ │ ├── pages/
119
+ │ └── ...
120
+ ├── package.json
121
+ └── ...
122
+ \`\`\`
123
+
124
+ ## Need help?
125
+
126
+ The AI PM will guide you through the integration process.
127
+ `;
128
+ fs.writeFileSync(readmePath, readmeContent);
129
+
130
+ console.log(chalk.dim(`Created lovable-import/ directory`));
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Persist Lovable choice to blueprint.json
136
+ * @param {string} projectDir - Project directory path
137
+ * @param {string} choice - 'make-new' | 'have-existing' | 'skip'
138
+ */
139
+ function persistLovableChoice(projectDir, choice) {
140
+ updateBlueprint(projectDir, { lovableChoice: choice });
141
+ }
142
+
143
+ /**
144
+ * Run complete Lovable flow in CLI wizard
145
+ * @param {string} projectDir - Project directory path
146
+ * @returns {Promise<string>} - The choice made ('make-new' | 'have-existing' | 'skip')
147
+ */
148
+ async function runLovableFlow(projectDir) {
149
+ const choice = await askLovableChoice();
150
+ displayLovableGuidance(choice);
151
+ createLovableImportDir(projectDir);
152
+ persistLovableChoice(projectDir, choice);
153
+ return choice;
154
+ }
155
+
156
+ module.exports = {
157
+ askLovableChoice,
158
+ displayLovableGuidance,
159
+ createLovableImportDir,
160
+ persistLovableChoice,
161
+ runLovableFlow
162
+ };