@unifyapps/custom-component-cli 0.0.1 → 0.0.2

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/init.js CHANGED
@@ -28,6 +28,10 @@ export function initComponent(componentName) {
28
28
  const kebabName = _kebabCase(componentName);
29
29
  const capitalName = _capitalize(componentName);
30
30
 
31
+ // Read current CLI version dynamically
32
+ const cliPackageJson = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'));
33
+ const cliVersion = cliPackageJson.version;
34
+
31
35
  function copyTemplates(srcDir) {
32
36
  for (const name of readdirSync(srcDir)) {
33
37
  const srcPath = resolve(srcDir, name);
@@ -40,7 +44,12 @@ export function initComponent(componentName) {
40
44
  const destPath = resolve(projectDir, outRel);
41
45
  mkdirSync(dirname(destPath), { recursive: true });
42
46
  const template = readFileSync(srcPath, 'utf-8');
43
- const content = mustache.render(template, { componentName, kebabName, capitalName });
47
+ const content = mustache.render(template, {
48
+ componentName,
49
+ kebabName,
50
+ capitalName,
51
+ cliVersion,
52
+ });
44
53
  writeFileSync(destPath, content, 'utf-8');
45
54
  }
46
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifyapps/custom-component-cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,7 +8,7 @@
8
8
  "build": "pnpx @unifyapps/custom-component-cli build {{kebabName}}"
9
9
  },
10
10
  "dependencies": {
11
- "@unifyapps/custom-component-cli": "^0.1.1",
11
+ "@unifyapps/custom-component-cli": "^{{cliVersion}}",
12
12
  "react": "^19.2.3",
13
13
  "react-dom": "^19.2.3"
14
14
  }