plusui-native 0.2.77 → 0.2.78
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 +22 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.78",
|
|
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-connect": "^0.1.
|
|
30
|
+
"plusui-native-builder": "^0.1.77",
|
|
31
|
+
"plusui-native-connect": "^0.1.77"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-connect": "^0.1.
|
|
34
|
+
"plusui-native-connect": "^0.1.77"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/templates/manager.js
CHANGED
|
@@ -81,7 +81,16 @@ export class TemplateManager {
|
|
|
81
81
|
const template = options.template || 'react';
|
|
82
82
|
const templatePath = join(this.templatesDir, template);
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
// Determine target path and actual project name
|
|
85
|
+
let targetDirName = projectName;
|
|
86
|
+
let projectPath = resolve(projectName);
|
|
87
|
+
|
|
88
|
+
if (projectName === '.') {
|
|
89
|
+
targetDirName = require('path').basename(process.cwd());
|
|
90
|
+
projectPath = process.cwd();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
console.log(chalk.bold(`\nCreating PlusUI project: ${targetDirName}\n`));
|
|
85
94
|
|
|
86
95
|
// 1. Check environment first
|
|
87
96
|
console.log(chalk.blue('Checking environment...'));
|
|
@@ -98,21 +107,24 @@ export class TemplateManager {
|
|
|
98
107
|
|
|
99
108
|
// 2. Create project directory
|
|
100
109
|
console.log(chalk.blue('Creating project structure...'));
|
|
101
|
-
const projectPath = resolve(projectName);
|
|
102
110
|
|
|
103
|
-
if (
|
|
104
|
-
|
|
111
|
+
if (projectName !== '.') {
|
|
112
|
+
if (existsSync(projectPath)) {
|
|
113
|
+
throw new Error(`Directory ${projectName} already exists`);
|
|
114
|
+
}
|
|
115
|
+
await mkdir(projectPath, { recursive: true });
|
|
116
|
+
} else {
|
|
117
|
+
// Warn but proceed if using current directory
|
|
118
|
+
console.log(chalk.yellow(`Initializing in current directory...`));
|
|
105
119
|
}
|
|
106
120
|
|
|
107
|
-
await mkdir(projectPath, { recursive: true });
|
|
108
|
-
|
|
109
121
|
// 3. Resolve package versions for generated app dependencies
|
|
110
122
|
const resolvedVersions = await this.resolveTemplatePackageVersions();
|
|
111
|
-
|
|
123
|
+
|
|
112
124
|
// 4. Prepare template variables
|
|
113
125
|
const variables = {
|
|
114
|
-
PROJECT_NAME:
|
|
115
|
-
PROJECT_NAME_LOWER:
|
|
126
|
+
PROJECT_NAME: targetDirName,
|
|
127
|
+
PROJECT_NAME_LOWER: targetDirName.toLowerCase(),
|
|
116
128
|
PROJECT_VERSION: '0.1.0',
|
|
117
129
|
PLUSUI_CLI_VERSION: resolvedVersions.cli,
|
|
118
130
|
PLUSUI_CORE_VERSION: resolvedVersions.core,
|
|
@@ -192,7 +204,7 @@ export class TemplateManager {
|
|
|
192
204
|
async runNpmInstall(projectPath) {
|
|
193
205
|
return new Promise((resolve, reject) => {
|
|
194
206
|
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
195
|
-
|
|
207
|
+
|
|
196
208
|
// Install root dependencies
|
|
197
209
|
const rootProc = spawn(npm, ['install'], {
|
|
198
210
|
cwd: projectPath,
|