react-native-country-select 0.3.6 → 0.3.7
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/README.md
CHANGED
|
@@ -65,12 +65,16 @@
|
|
|
65
65
|
|
|
66
66
|
## Installation
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
To use this library, make sure you have **react-native-country-select** installed along with its required dependency **react-native-safe-area-context**:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install react-native-country-select react-native-safe-area-context
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Since **react-native-safe-area-context** includes native code, you’ll need to install the iOS pods on macOS to complete the linking:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx pod-install ios
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
<br>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-country-select",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "🌍 React Native country picker with flags, search, TypeScript, i18n, and offline support. Lightweight, customizable, and designed with a modern UI.",
|
|
5
5
|
"main": "lib/index.tsx",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -26,9 +26,6 @@
|
|
|
26
26
|
"react native country picker",
|
|
27
27
|
"react native country select"
|
|
28
28
|
],
|
|
29
|
-
"scripts": {
|
|
30
|
-
"postinstall": "node scripts/install-react-native-safe-area-context.js"
|
|
31
|
-
},
|
|
32
29
|
"repository": {
|
|
33
30
|
"type": "git",
|
|
34
31
|
"url": "git+https://github.com/AstrOOnauta/react-native-country-select.git"
|
|
@@ -46,10 +43,5 @@
|
|
|
46
43
|
"react": "*",
|
|
47
44
|
"react-native": "*",
|
|
48
45
|
"react-native-safe-area-context": ">=4.0.0"
|
|
49
|
-
},
|
|
50
|
-
"peerDependenciesMeta": {
|
|
51
|
-
"react-native-safe-area-context": {
|
|
52
|
-
"optional": false
|
|
53
|
-
}
|
|
54
46
|
}
|
|
55
47
|
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
const { execSync } = require('child_process');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
// Navigate to the project root directory (outside node_modules)
|
|
6
|
-
function findProjectRoot() {
|
|
7
|
-
let current = process.cwd();
|
|
8
|
-
|
|
9
|
-
// If we're inside node_modules, go up until we're out
|
|
10
|
-
while (current.includes('node_modules')) {
|
|
11
|
-
current = path.dirname(current);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Look for the project's package.json
|
|
15
|
-
while (!fs.existsSync(path.join(current, 'package.json'))) {
|
|
16
|
-
const next = path.dirname(current);
|
|
17
|
-
if (next === current) break;
|
|
18
|
-
current = next;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return current;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const root = findProjectRoot();
|
|
25
|
-
process.chdir(root);
|
|
26
|
-
|
|
27
|
-
// Check if react-native-safe-area-context is already installed
|
|
28
|
-
function isPackageInstalled() {
|
|
29
|
-
const packagePath = path.join(
|
|
30
|
-
root,
|
|
31
|
-
'node_modules',
|
|
32
|
-
'react-native-safe-area-context'
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
if (fs.existsSync(packagePath)) {
|
|
36
|
-
console.log(
|
|
37
|
-
'✅ react-native-safe-area-context is already installed!\n'
|
|
38
|
-
);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// If already installed, do nothing
|
|
46
|
-
if (isPackageInstalled()) {
|
|
47
|
-
process.exit(0);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function detectPackageManager() {
|
|
51
|
-
if (fs.existsSync(path.join(root, 'bun.lockb'))) return 'bun';
|
|
52
|
-
if (fs.existsSync(path.join(root, 'pnpm-lock.yaml'))) return 'pnpm';
|
|
53
|
-
if (fs.existsSync(path.join(root, 'yarn.lock'))) return 'yarn';
|
|
54
|
-
return 'npm';
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const pm = detectPackageManager();
|
|
58
|
-
|
|
59
|
-
const commands = {
|
|
60
|
-
npm: 'npm install react-native-safe-area-context@latest --save',
|
|
61
|
-
yarn: 'yarn add react-native-safe-area-context@latest',
|
|
62
|
-
pnpm: 'pnpm add react-native-safe-area-context@latest',
|
|
63
|
-
bun: 'bun add react-native-safe-area-context@latest',
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const command = commands[pm] || commands.npm;
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
console.log(`\n🔧 Detected package manager: ${pm}`);
|
|
70
|
-
console.log(`📦 Installing react-native-safe-area-context using:`);
|
|
71
|
-
console.log(`➡️ ${command}\n`);
|
|
72
|
-
|
|
73
|
-
execSync(command, { stdio: 'inherit' });
|
|
74
|
-
|
|
75
|
-
console.log(
|
|
76
|
-
`\n✅ react-native-safe-area-context installed successfully!\n`
|
|
77
|
-
);
|
|
78
|
-
} catch (err) {
|
|
79
|
-
console.error(
|
|
80
|
-
'\n⚠️ Could not automatically install react-native-safe-area-context'
|
|
81
|
-
);
|
|
82
|
-
console.error('Please install it manually by running:\n');
|
|
83
|
-
console.error(` ${command}\n`);
|
|
84
|
-
}
|