rn-cn-ui 1.0.1 → 1.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.
Files changed (2) hide show
  1. package/bin/cli.js +22 -0
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -47,6 +47,28 @@ async function main() {
47
47
  fs.mkdirSync(targetBaseDir, { recursive: true });
48
48
  }
49
49
 
50
+ // Ensure utils.ts exists
51
+ const utilsDir = path.join(process.cwd(), 'src', 'lib');
52
+ const utilsPath = path.join(utilsDir, 'utils.ts');
53
+
54
+ if (!fs.existsSync(utilsPath)) {
55
+ console.log('utils.ts not found. Creating...');
56
+ if (!fs.existsSync(utilsDir)) {
57
+ fs.mkdirSync(utilsDir, { recursive: true });
58
+ }
59
+
60
+ const utilsUrl = `${BASE_URL}/src/lib/utils.ts`;
61
+ const utilsResponse = await fetch(utilsUrl);
62
+
63
+ if (utilsResponse.ok) {
64
+ const utilsContent = await utilsResponse.text();
65
+ fs.writeFileSync(utilsPath, utilsContent);
66
+ console.log('✓ Created src/lib/utils.ts');
67
+ } else {
68
+ console.error('Failed to download utils.ts. Please create src/lib/utils.ts manually.');
69
+ }
70
+ }
71
+
50
72
  // 3. Fetch and write files
51
73
  for (const file of config.files) {
52
74
  const fileUrl = `${BASE_URL}/${file}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-cn-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A high-quality, open-source UI library for React Native, inspired by shadcn/ui.",
5
5
  "main": "index.js",
6
6
  "bin": {