plusui-native 0.2.49 → 0.2.50
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 +4 -4
- package/templates/manager.js +27 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.50",
|
|
4
4
|
"description": "PlusUI CLI - Build C++ desktop apps modern UI ",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"semver": "^7.6.0",
|
|
28
28
|
"which": "^4.0.0",
|
|
29
29
|
"execa": "^8.0.1",
|
|
30
|
-
"plusui-native-builder": "^0.1.
|
|
31
|
-
"plusui-native-bindgen": "^0.1.
|
|
30
|
+
"plusui-native-builder": "^0.1.49",
|
|
31
|
+
"plusui-native-bindgen": "^0.1.49"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-bindgen": "^0.1.
|
|
34
|
+
"plusui-native-bindgen": "^0.1.49"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/templates/manager.js
CHANGED
|
@@ -93,8 +93,11 @@ export class TemplateManager {
|
|
|
93
93
|
await this.runNpmInstall(projectPath);
|
|
94
94
|
console.log(chalk.green('✓ Dependencies installed\n'));
|
|
95
95
|
|
|
96
|
-
// 7.
|
|
97
|
-
|
|
96
|
+
// 7. Start dev server in the created project immediately
|
|
97
|
+
process.chdir(projectPath);
|
|
98
|
+
console.log(chalk.green(`✓ Changed directory to: ${projectPath}`));
|
|
99
|
+
console.log(chalk.blue('Starting development server...'));
|
|
100
|
+
await this.runPlusuiDev(projectPath);
|
|
98
101
|
|
|
99
102
|
return { success: true, path: projectPath };
|
|
100
103
|
}
|
|
@@ -187,16 +190,29 @@ export class TemplateManager {
|
|
|
187
190
|
});
|
|
188
191
|
}
|
|
189
192
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
async runPlusuiDev(projectPath) {
|
|
194
|
+
return new Promise((resolve, reject) => {
|
|
195
|
+
const plusuiCmd = process.platform === 'win32' ? 'plusui.cmd' : 'plusui';
|
|
196
|
+
|
|
197
|
+
const devProc = spawn(plusuiCmd, ['dev'], {
|
|
198
|
+
cwd: projectPath,
|
|
199
|
+
stdio: 'inherit',
|
|
200
|
+
shell: true,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
devProc.on('close', (code, signal) => {
|
|
204
|
+
// Normal shutdown via Ctrl+C should not be treated as an error.
|
|
205
|
+
if (signal === 'SIGINT' || code === 0 || code === null) {
|
|
206
|
+
resolve();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
reject(new Error(`plusui dev exited with code ${code}`));
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
devProc.on('error', reject);
|
|
213
|
+
});
|
|
199
214
|
}
|
|
215
|
+
|
|
200
216
|
}
|
|
201
217
|
|
|
202
218
|
|