@wireservers-ui/react-natives 1.0.1-rc1 → 1.0.1-rc3

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.
Files changed (2) hide show
  1. package/bin/cli.js +25 -5
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -27,6 +27,18 @@ const pm = detectPackageManager();
27
27
  const installCmd = pm === "yarn" ? "yarn add" : `${pm} install`;
28
28
  let needsReinstall = false;
29
29
 
30
+ function getInstalledReactVersion() {
31
+ const reactPkgPath = path.join(cwd, "node_modules", "react", "package.json");
32
+ if (!fs.existsSync(reactPkgPath)) return null;
33
+
34
+ try {
35
+ const reactPkg = JSON.parse(fs.readFileSync(reactPkgPath, "utf8"));
36
+ return typeof reactPkg.version === "string" ? reactPkg.version : null;
37
+ } catch {
38
+ return null;
39
+ }
40
+ }
41
+
30
42
  console.log(`\nšŸš€ Initializing @wireservers-ui/react-natives...\n`);
31
43
  console.log(` Package manager: ${pm}`);
32
44
 
@@ -64,6 +76,11 @@ if (needsReinstall) {
64
76
 
65
77
  // ── 2. Install peer dependencies ───────────────────────────────────────────
66
78
  console.log("\nšŸ“¦ Installing peer dependencies...\n");
79
+ const reactVersion = getInstalledReactVersion();
80
+ const reactDomPackage = reactVersion
81
+ ? `react-dom@${reactVersion}`
82
+ : "react-dom";
83
+
67
84
  const peers = [
68
85
  "nativewind@^4",
69
86
  "tailwindcss@^3",
@@ -72,7 +89,7 @@ const peers = [
72
89
  "react-native-reanimated",
73
90
  "react-native-worklets",
74
91
  "react-native-svg",
75
- "react-dom",
92
+ reactDomPackage,
76
93
  "react-native-web",
77
94
  ];
78
95
 
@@ -92,6 +109,7 @@ module.exports = {
92
109
  "./App.{js,jsx,ts,tsx}",
93
110
  "./app/**/*.{js,jsx,ts,tsx}",
94
111
  "./components/**/*.{js,jsx,ts,tsx}",
112
+ "./node_modules/@wireservers-ui/react-natives/src/**/*.{js,jsx,ts,tsx}",
95
113
  ],
96
114
  presets: [require("@wireservers-ui/react-natives/tailwind-preset")],
97
115
  };
@@ -326,7 +344,7 @@ writeFile("App.tsx", appTsx);
326
344
 
327
345
  // ── Done ───────────────────────────────────────────────────────────────────
328
346
  console.log("\nāœ… Setup complete!\n");
329
- console.log(" Created/updated:");
347
+ console.log(" Created if missing (existing files were preserved):");
330
348
  console.log(" • tailwind.config.js");
331
349
  console.log(" • global.css (with theme variables)");
332
350
  console.log(" • nativewind-env.d.ts");
@@ -339,10 +357,12 @@ console.log(" npx expo start --clear\n");
339
357
  // ── Helpers ────────────────────────────────────────────────────────────────
340
358
  function writeFile(name, content) {
341
359
  const filePath = path.join(cwd, name);
360
+ if (fs.existsSync(filePath)) {
361
+ console.log(` ā­ļø ${name} already exists, skipping`);
362
+ return;
363
+ }
342
364
  fs.writeFileSync(filePath, content, "utf8");
343
- console.log(
344
- ` āœļø ${fs.existsSync(filePath) ? "Updated" : "Created"} ${name}`,
345
- );
365
+ console.log(` āœļø Created ${name}`);
346
366
  }
347
367
 
348
368
  function writeIfMissing(name, content) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireservers-ui/react-natives",
3
- "version": "1.0.1-rc1",
3
+ "version": "1.0.1-rc3",
4
4
  "description": "A comprehensive React Native component library built with NativeWind and Tailwind Variants",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",