@react-native-community/cli-tools
- Version 20.0.2
- Published
- 149 kB
- 10 dependencies
- MIT license
Install
npm i @react-native-community/cli-toolsyarn add @react-native-community/cli-toolspnpm add @react-native-community/cli-toolsOverview
Overview not available.
Index
Variables
Functions
- addInteractionListener()
- askForPortChange()
- fetch()
- fetchToTemp()
- findDevServerPort()
- findProjectRoot()
- getDefaultUserTerminal()
- getLoader()
- inlineString()
- isPackagerRunning()
- launchEditor()
- logAlreadyRunningBundler()
- logChangePortInstructions()
- pauseInteractions()
- printRunDoctorTip()
- prompt()
- resolveNodeModuleDir()
- resumeInteractions()
- runSudo()
- startServerInNewWindow()
- unixifyPaths()
Classes
Type Aliases
Namespaces
Variables
variable cacheManager
const cacheManager: {    get: typeof get;    set: typeof set;    removeProjectCache: typeof removeProjectCache;    getCacheRootPath: typeof getCacheRootPath;};variable logger
const logger: {    success: (...messages: string[]) => void;    info: (...messages: string[]) => void;    warn: (...messages: string[]) => void;    error: (...messages: string[]) => void;    debug: (...messages: string[]) => void;    log: (...messages: string[]) => void;    setVerbose: (level: boolean) => void;    isVerbose: () => boolean;    hasDebugMessages: () => boolean;    disable: () => void;    enable: () => void;};variable NoopLoader
const NoopLoader: typeof OraNoop;Functions
function addInteractionListener
addInteractionListener: (callback: InteractionCallback) => void;- Used to pause/resume interaction observers while prompting (made for TerminalUI). 
function askForPortChange
askForPortChange: (    port: number,    nextPort: number) => Promise<import('prompts').Answers<string>>;function fetch
fetch: (    url: string | Request,    options?: RequestInit) => Promise<{ status: number; data: any; headers: Headers }>;function fetchToTemp
fetchToTemp: (url: string) => Promise<string>;- Downloads the given - urlto the OS's temp folder and returns the path to it.
function findDevServerPort
findDevServerPort: (    initialPort: number,    root: string) => Promise<{ port: number; startPackager: boolean }>;function findProjectRoot
findProjectRoot: (cwd?: string) => string;- Finds project root by looking for a closest - package.json.
function getDefaultUserTerminal
getDefaultUserTerminal: () => string | undefined;function getLoader
getLoader: (options?: string | Options | undefined) => Ora;function inlineString
inlineString: (str?: string) => string;function isPackagerRunning
isPackagerRunning: (    packagerPort?: string | number) => Promise<{ status: 'running'; root: string } | 'not_running' | 'unrecognized'>;- Indicates whether or not the packager is running. It returns a promise that returns one of these possible values: - - running: the packager is running -- not_running: the packager nor any process is running on the expected port. -- unrecognized: one other process is running on the port we expect the packager to be running.
function launchEditor
launchEditor: (    fileName: string,    lineNumber: number,    _watchFolders?: ReadonlyArray<string>) => void;- Copyright (c) Facebook, Inc. and its affiliates. - This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. 
function logAlreadyRunningBundler
logAlreadyRunningBundler: (port: number) => void;function logChangePortInstructions
logChangePortInstructions: () => void;function pauseInteractions
pauseInteractions: (options?: Omit<InteractionOptions, 'pause'>) => void;function printRunDoctorTip
printRunDoctorTip: () => void;function prompt
prompt: <T extends string>(    question: PromptObject,    options?: PromptOptions) => Promise<prompts.Answers<T>>;function resolveNodeModuleDir
resolveNodeModuleDir: (root: string, packageName: string) => string;- Finds a path inside - node_modules
function resumeInteractions
resumeInteractions: (options?: Omit<InteractionOptions, 'pause'>) => void;- Notify all listeners that keypress observations can start.. 
function runSudo
runSudo: (command: string) => Promise<void>;function startServerInNewWindow
startServerInNewWindow: (    port: number,    projectRoot: string,    reactNativePath: string,    terminal?: string) =>    | execa.ExecaChildProcess<string>    | execa.ExecaSyncReturnValue<string>    | undefined;function unixifyPaths
unixifyPaths: (path: string) => string;- Parameter path- string - Returns- string - This function converts Windows paths to Unix paths. 
Classes
class CLIError
class CLIError extends Error {}- A custom Error that creates a single-lined message to match current styling inside CLI. Uses original stack trace when - originalErroris passed or erase the stack if it's not defined.
constructor
constructor(msg: string, originalError?: string | Error);class UnknownProjectError
class UnknownProjectError extends Error {}- Raised when we're unable to find a package.json 
Type Aliases
type Loader
type Loader = Ora;Namespaces
namespace link
module 'build/doclink.d.ts' {}- When the user builds, we should define the target platform globally. 
function blog
blog: (    path: string,    platform: Platforms,    hashOrOverrides?: string | (Overrides & Other) | undefined) => string;function community
community: (    path: string,    platform: Platforms,    hashOrOverrides?: string | (Overrides & Other) | undefined) => string;function contributing
contributing: (    path: string,    platform: Platforms,    hashOrOverrides?: string | (Overrides & Other) | undefined) => string;function docs
docs: (    path: string,    platform: Platforms,    hashOrOverrides?: string | (Overrides & Other) | undefined) => string;function getOS
getOS: () => string;function setPlatform
setPlatform: (target: Platforms) => void;- When the user builds, we should define the target platform globally. 
function setVersion
setVersion: (reactNativeVersion: string) => void;- Can we figure out what version of react native they're using? 
function showcase
showcase: (    path: string,    platform: Platforms,    hashOrOverrides?: string | (Overrides & Other) | undefined) => string;namespace version
module 'build/releaseChecker/index.d.ts' {}- Logs out a message if the user's version is behind a stable version of React Native 
function current
current: (projectRoot: string) => SemVer | undefined;- Gets the current project's version parsed as Semver 
function latest
latest: (projectRoot: string) => Promise<Update | undefined>;- Finds the latest stables version of React Native > current version 
function logIfUpdateAvailable
logIfUpdateAvailable: (projectRoot: string) => Promise<void>;- Logs out a message if the user's version is behind a stable version of React Native 
Package Files (20)
- build/cacheManager.d.ts
- build/doclink.d.ts
- build/errors.d.ts
- build/fetch.d.ts
- build/findDevServerPort.d.ts
- build/findProjectRoot.d.ts
- build/getDefaultUserTerminal.d.ts
- build/index.d.ts
- build/isPackagerRunning.d.ts
- build/launchEditor.d.ts
- build/loader.d.ts
- build/logger.d.ts
- build/port.d.ts
- build/printRunDoctorTip.d.ts
- build/prompt.d.ts
- build/releaseChecker/index.d.ts
- build/resolveNodeModuleDir.d.ts
- build/runSudo.d.ts
- build/startServerInNewWindow.d.ts
- build/unixifyPaths.d.ts
Dependencies (10)
Dev Dependencies (5)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@react-native-community/cli-tools.
- Markdown[](https://www.jsdocs.io/package/@react-native-community/cli-tools)
- HTML<a href="https://www.jsdocs.io/package/@react-native-community/cli-tools"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
 Package analyzed in 3964 ms.
- Missing or incorrect documentation? Open an issue for this package.
