@react-native-community/cli-tools
Advanced tools
Comparing version 13.6.3 to 13.6.4
@@ -28,3 +28,2 @@ "use strict"; | ||
} | ||
var _resolveNodeModuleDir = _interopRequireDefault(require("./resolveNodeModuleDir")); | ||
var _logger = _interopRequireDefault(require("./logger")); | ||
@@ -38,2 +37,3 @@ function _chalk() { | ||
} | ||
var _findPackageDependencyDir = require("./findPackageDependencyDir"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -54,3 +54,13 @@ const ERROR = `a dev server manually by running ${_chalk().default.bold('npm start')} or ${_chalk().default.bold('yarn start')} in other terminal window.`; | ||
const packagerEnvFileExportContent = isWindows ? `set RCT_METRO_PORT=${port}\nset PROJECT_ROOT=${projectRoot}\nset REACT_NATIVE_PATH=${reactNativePath}` : `export RCT_METRO_PORT=${port}\nexport PROJECT_ROOT="${projectRoot}"\nexport REACT_NATIVE_PATH="${reactNativePath}"`; | ||
const nodeModulesPath = (0, _resolveNodeModuleDir.default)(projectRoot, '.bin'); | ||
let generatedPath = (0, _findPackageDependencyDir.findPackageDependencyDir)('.generated', { | ||
startDir: projectRoot | ||
}); | ||
if (!generatedPath) { | ||
const newPath = _path().default.join(projectRoot, 'node_modules', '.generated'); | ||
_fs().default.mkdirSync(newPath, { | ||
recursive: true, | ||
mode: 0o755 | ||
}); | ||
generatedPath = newPath; | ||
} | ||
const cliPluginMetroPath = _path().default.join(_path().default.dirname(require.resolve('@react-native-community/cli-tools/package.json')), 'build'); | ||
@@ -61,3 +71,3 @@ | ||
*/ | ||
const packagerEnvFile = _path().default.join(nodeModulesPath, `${packagerEnvFilename}`); | ||
const packagerEnvFile = _path().default.join(generatedPath, `${packagerEnvFilename}`); | ||
@@ -68,3 +78,3 @@ /** | ||
*/ | ||
const launchPackagerScript = _path().default.join(nodeModulesPath, scriptFile); | ||
const launchPackagerScript = _path().default.join(generatedPath, scriptFile); | ||
const procConfig = { | ||
@@ -83,3 +93,3 @@ cwd: _path().default.dirname(packagerEnvFile) | ||
/** | ||
* Copy files into `node_modules/.bin`. | ||
* Copy files into `node_modules/.generated`. | ||
*/ | ||
@@ -89,5 +99,5 @@ | ||
if (isWindows) { | ||
_fs().default.copyFileSync(_path().default.join(cliPluginMetroPath, 'launchPackager.bat'), _path().default.join(nodeModulesPath, 'launchPackager.bat')); | ||
_fs().default.copyFileSync(_path().default.join(cliPluginMetroPath, 'launchPackager.bat'), _path().default.join(generatedPath, 'launchPackager.bat')); | ||
} else { | ||
_fs().default.copyFileSync(_path().default.join(cliPluginMetroPath, 'launchPackager.command'), _path().default.join(nodeModulesPath, 'launchPackager.command')); | ||
_fs().default.copyFileSync(_path().default.join(cliPluginMetroPath, 'launchPackager.command'), _path().default.join(generatedPath, 'launchPackager.command')); | ||
} | ||
@@ -94,0 +104,0 @@ } catch (error) { |
{ | ||
"name": "@react-native-community/cli-tools", | ||
"version": "13.6.3", | ||
"version": "13.6.4", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "main": "build/index.js", | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "13.6.3", | ||
"@react-native-community/cli-types": "13.6.4", | ||
"@types/lodash": "^4.14.149", | ||
@@ -42,3 +42,3 @@ "@types/mime": "^2.0.1", | ||
}, | ||
"gitHead": "1f588a2f3cf35acbff48f9c39bb4c64f843b3549" | ||
"gitHead": "a31b57ec24073420cef566c8bff2c6ae3e87c14f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
199477
2234