plusui-native 0.2.15 → 0.2.17
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": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
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.16",
|
|
31
|
+
"plusui-native-bindgen": "^0.1.16"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-bindgen": "^0.1.
|
|
34
|
+
"plusui-native-bindgen": "^0.1.16"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/templates/manager.js
CHANGED
|
@@ -12,6 +12,16 @@ const __dirname = dirname(__filename);
|
|
|
12
12
|
export class TemplateManager {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.templatesDir = __dirname;
|
|
15
|
+
this.cliPackageJson = null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async loadCliVersion() {
|
|
19
|
+
if (!this.cliPackageJson) {
|
|
20
|
+
const packageJsonPath = join(this.templatesDir, '..', 'package.json');
|
|
21
|
+
const content = await readFile(packageJsonPath, 'utf8');
|
|
22
|
+
this.cliPackageJson = JSON.parse(content);
|
|
23
|
+
}
|
|
24
|
+
return this.cliPackageJson.version;
|
|
15
25
|
}
|
|
16
26
|
|
|
17
27
|
async create(projectName, options = {}) {
|
|
@@ -43,14 +53,33 @@ export class TemplateManager {
|
|
|
43
53
|
|
|
44
54
|
await mkdir(projectPath, { recursive: true });
|
|
45
55
|
|
|
46
|
-
// 3.
|
|
56
|
+
// 3. Get current package versions
|
|
57
|
+
const cliVersion = await this.loadCliVersion();
|
|
58
|
+
|
|
59
|
+
// Use version ranges that match latest published versions
|
|
60
|
+
// For CLI (plusui-native): Use major.minor.0 to get latest compatible
|
|
61
|
+
const [major, minor, patch] = cliVersion.split('.');
|
|
62
|
+
const cliVersionRange = `^${major}.${minor}.0`;
|
|
63
|
+
|
|
64
|
+
// Core version follows 0.1.x pattern when CLI is 0.2.x
|
|
65
|
+
const coreVersionRange = `^${major}.1.0`;
|
|
66
|
+
|
|
67
|
+
// Builder and bindgen also follow 0.1.x pattern
|
|
68
|
+
const builderVersionRange = `^${major}.1.0`;
|
|
69
|
+
const bindgenVersionRange = `^${major}.1.0`;
|
|
70
|
+
|
|
71
|
+
// 4. Prepare template variables
|
|
47
72
|
const variables = {
|
|
48
73
|
PROJECT_NAME: projectName,
|
|
49
74
|
PROJECT_NAME_LOWER: projectName.toLowerCase(),
|
|
50
|
-
PROJECT_VERSION: '0.1.0'
|
|
75
|
+
PROJECT_VERSION: '0.1.0',
|
|
76
|
+
PLUSUI_CLI_VERSION: cliVersionRange,
|
|
77
|
+
PLUSUI_CORE_VERSION: coreVersionRange,
|
|
78
|
+
PLUSUI_BUILDER_VERSION: builderVersionRange,
|
|
79
|
+
PLUSUI_BINDGEN_VERSION: bindgenVersionRange
|
|
51
80
|
};
|
|
52
81
|
|
|
53
|
-
//
|
|
82
|
+
// 5. Copy template files
|
|
54
83
|
await this.copyTemplate(templatePath, projectPath, variables);
|
|
55
84
|
|
|
56
85
|
// 5. Copy base files
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
"clean": "plusui clean"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"plusui-native": "
|
|
21
|
-
"plusui-native-core": "
|
|
20
|
+
"plusui-native": "{{PLUSUI_CLI_VERSION}}",
|
|
21
|
+
"plusui-native-core": "{{PLUSUI_CORE_VERSION}}"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"plusui-native-builder": "{{PLUSUI_BUILDER_VERSION}}",
|
|
25
|
+
"plusui-native-bindgen": "{{PLUSUI_BINDGEN_VERSION}}"
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
"clean": "plusui clean"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"plusui-native": "
|
|
21
|
-
"plusui-native-core": "
|
|
20
|
+
"plusui-native": "{{PLUSUI_CLI_VERSION}}",
|
|
21
|
+
"plusui-native-core": "{{PLUSUI_CORE_VERSION}}"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"plusui-native-builder": "{{PLUSUI_BUILDER_VERSION}}",
|
|
25
|
+
"plusui-native-bindgen": "{{PLUSUI_BINDGEN_VERSION}}"
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
|