plusui-native 0.2.15 → 0.2.16

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.15",
3
+ "version": "0.2.16",
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.14",
31
- "plusui-native-bindgen": "^0.1.14"
30
+ "plusui-native-builder": "^0.1.15",
31
+ "plusui-native-bindgen": "^0.1.15"
32
32
  },
33
33
  "peerDependencies": {
34
- "plusui-native-bindgen": "^0.1.14"
34
+ "plusui-native-bindgen": "^0.1.15"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -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,27 @@ export class TemplateManager {
43
53
 
44
54
  await mkdir(projectPath, { recursive: true });
45
55
 
46
- // 3. Prepare template variables
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
+ // 4. Prepare template variables
47
68
  const variables = {
48
69
  PROJECT_NAME: projectName,
49
70
  PROJECT_NAME_LOWER: projectName.toLowerCase(),
50
- PROJECT_VERSION: '0.1.0'
71
+ PROJECT_VERSION: '0.1.0',
72
+ PLUSUI_CLI_VERSION: cliVersionRange,
73
+ PLUSUI_CORE_VERSION: coreVersionRange
51
74
  };
52
75
 
53
- // 4. Copy template files
76
+ // 5. Copy template files
54
77
  await this.copyTemplate(templatePath, projectPath, variables);
55
78
 
56
79
  // 5. Copy base files
@@ -17,8 +17,8 @@
17
17
  "clean": "plusui clean"
18
18
  },
19
19
  "dependencies": {
20
- "plusui-native": "^0.2.14",
21
- "plusui-native-core": "^0.1.14"
20
+ "plusui-native": "{{PLUSUI_CLI_VERSION}}",
21
+ "plusui-native-core": "{{PLUSUI_CORE_VERSION}}"
22
22
  }
23
23
  }
24
24
 
@@ -17,8 +17,8 @@
17
17
  "clean": "plusui clean"
18
18
  },
19
19
  "dependencies": {
20
- "plusui-native": "^0.2.14",
21
- "plusui-native-core": "^0.1.14"
20
+ "plusui-native": "{{PLUSUI_CLI_VERSION}}",
21
+ "plusui-native-core": "{{PLUSUI_CORE_VERSION}}"
22
22
  }
23
23
  }
24
24