@react-native-community/cli-tools
Advanced tools
Comparing version 13.4.0 to 13.5.0
import execa from 'execa'; | ||
import { CLIError } from './errors'; | ||
declare function startServerInNewWindow(port: number, projectRoot: string, reactNativePath: string, terminal?: string): CLIError | execa.ExecaChildProcess<string> | execa.ExecaSyncReturnValue<string> | undefined; | ||
declare function startServerInNewWindow(port: number, projectRoot: string, reactNativePath: string, terminal?: string): execa.ExecaChildProcess<string> | execa.ExecaSyncReturnValue<string> | undefined; | ||
export default startServerInNewWindow; | ||
//# sourceMappingURL=startServerInNewWindow.d.ts.map |
@@ -28,9 +28,17 @@ "use strict"; | ||
} | ||
var _errors = require("./errors"); | ||
var _resolveNodeModuleDir = _interopRequireDefault(require("./resolveNodeModuleDir")); | ||
var _logger = _interopRequireDefault(require("./logger")); | ||
function _chalk() { | ||
const data = _interopRequireDefault(require("chalk")); | ||
_chalk = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const ERROR = `a dev server manually by running ${_chalk().default.bold('npm start')} or ${_chalk().default.bold('yarn start')} in other terminal window.`; | ||
function startServerInNewWindow(port, projectRoot, reactNativePath, terminal) { | ||
if (!terminal) { | ||
throw new _errors.CLIError('Cannot start server in new window because no terminal app was specified.'); | ||
_logger.default.error('Cannot start server in new windows because no terminal app was specified, use --terminal to specify, or start ' + ERROR); | ||
return; | ||
} | ||
@@ -81,3 +89,4 @@ | ||
} catch (error) { | ||
return new _errors.CLIError(`Couldn't copy the script for running bundler. Please check if the "${scriptFile}" file exists in the "node_modules/@react-native-community/cli-tools" folder and try again.`, error); | ||
_logger.default.error(`Couldn't copy the script for running bundler. Please check if the "${scriptFile}" file exists in the "node_modules/@react-native-community/cli-tools" folder, or start ` + ERROR, error); | ||
return; | ||
} | ||
@@ -110,3 +119,3 @@ if (process.platform === 'darwin') { | ||
} | ||
_logger.default.error(`Cannot start the packager. Unknown platform ${process.platform}`); | ||
_logger.default.error(`Cannot start the packager. Unknown platform ${process.platform}. Try starting ` + ERROR); | ||
return; | ||
@@ -113,0 +122,0 @@ } |
{ | ||
"name": "@react-native-community/cli-tools", | ||
"version": "13.4.0", | ||
"version": "13.5.0", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "main": "build/index.js", | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "13.4.0", | ||
"@react-native-community/cli-types": "13.5.0", | ||
"@types/lodash": "^4.14.149", | ||
@@ -41,3 +41,3 @@ "@types/mime": "^2.0.1", | ||
}, | ||
"gitHead": "13e37351f1959b9cc96f325d938e3930895049dd" | ||
"gitHead": "092c37cf27ebbf019e710f8aa118f673066f273c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
196478
111
2179