react-native-eject
Advanced tools
Comparing version 0.2.0 to 1.0.0
@@ -30,2 +30,12 @@ "use strict"; | ||
function eject() { | ||
const doesTemplateExist = fs_1.default.existsSync(path_1.default.resolve('node_modules/@react-native-community/template')); | ||
if (!doesTemplateExist) { | ||
const pkgJson = require(path_1.default.resolve('package.json')); | ||
const version = pkgJson.dependencies['react-native'] ?? 'VERSION'; | ||
cli_tools_1.logger.error('You need to install `@react-native-community/template@' + | ||
version + | ||
'` ' + | ||
'before ejecting.'); | ||
process.exit(1); | ||
} | ||
const doesIOSExist = fs_1.default.existsSync(path_1.default.resolve('ios')); | ||
@@ -42,3 +52,3 @@ const doesAndroidExist = fs_1.default.existsSync(path_1.default.resolve('android')); | ||
} | ||
catch (e) { | ||
catch { | ||
cli_tools_1.logger.error('Eject requires an `app.json` config file to be located at ' + | ||
@@ -64,7 +74,7 @@ `${path_1.default.resolve('app.json')}, and it must at least specify a \`name\` for the project ` + | ||
cli_tools_1.logger.info('Generating the iOS folder.'); | ||
(0, copyProjectTemplateAndReplace_js_1.default)(path_1.default.resolve('node_modules', 'react-native', 'template', 'ios'), path_1.default.resolve('ios'), appName, templateOptions); | ||
(0, copyProjectTemplateAndReplace_js_1.default)(path_1.default.resolve('node_modules', '@react-native-community/template', 'template', 'ios'), path_1.default.resolve('ios'), appName, templateOptions); | ||
} | ||
if (!doesAndroidExist) { | ||
cli_tools_1.logger.info('Generating the Android folder.'); | ||
(0, copyProjectTemplateAndReplace_js_1.default)(path_1.default.resolve('node_modules', 'react-native', 'template', 'android'), path_1.default.resolve('android'), appName, templateOptions); | ||
(0, copyProjectTemplateAndReplace_js_1.default)(path_1.default.resolve('node_modules', '@react-native-community/template', 'template', 'android'), path_1.default.resolve('android'), appName, templateOptions); | ||
} | ||
@@ -71,0 +81,0 @@ } |
{ | ||
"name": "react-native-eject", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "Single command to eject a React Native app", | ||
@@ -28,12 +28,12 @@ "main": "dist/eject.js", | ||
"devDependencies": { | ||
"@react-native-community/cli": "^9.3.2", | ||
"@types/node": "^18.11.10", | ||
"@react-native-community/cli": "^15.0.0", | ||
"@types/node": "^22.7.9", | ||
"@typescript-eslint/eslint-plugin": "^5.45.0", | ||
"@typescript-eslint/parser": "^5.45.0", | ||
"eslint": "^8.29.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"prettier": "^2.8.0", | ||
"typescript": "^4.7.3" | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"prettier": "^3.3.3", | ||
"typescript": "5.1.6" | ||
} | ||
} |
@@ -17,2 +17,3 @@ # react-native-eject | ||
| -------------------- | ---------------------------------------------------------------- | -------------- | | ||
| ^1.0.0 | [^15.0.0](https://github.com/react-native-community/cli) | ^0.75.0 | | ||
| ^0.2.0 | [^9.0.0](https://github.com/react-native-community/cli/tree/9.x) | ^0.70.0 | | ||
@@ -19,0 +20,0 @@ | ^0.1.2 | [^8.0.0](https://github.com/react-native-community/cli/tree/8.x) | ^0.69.0 | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
28289
646
0
42
0
5