@react-native-community/cli-tools

  • Version 11.3.8
  • Published
  • 156 kB
  • 9 dependencies
  • MIT license

Install

npm i @react-native-community/cli-tools
yarn add @react-native-community/cli-tools
pnpm add @react-native-community/cli-tools

Overview

Overview not available.

Index

Variables

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 fetch

      fetch: (
      url: string | Request,
      options?: FetchOptions
      ) => Promise<{ status: number; data: any; headers: Headers }>;

        function fetchToTemp

        fetchToTemp: (url: string) => Promise<string>;
        • Downloads the given url to the OS's temp folder and returns the path to it.

        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 hookStdout

            hookStdout: (callback: Function) => () => void;

              function inlineString

              inlineString: (str?: string) => string;

                function isPackagerRunning

                isPackagerRunning: (
                packagerPort?: string | number
                ) => Promise<'running' | '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 launchDebugger

                launchDebugger: (url: string) => Promise<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 launchDefaultBrowser

                launchDefaultBrowser: (url: string) => Promise<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 launchEditor

                launchEditor: (
                fileName: string,
                lineNumber: number,
                projectRoots: 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 printRunDoctorTip

                printRunDoctorTip: () => void;

                  function resolveNodeModuleDir

                  resolveNodeModuleDir: (root: string, packageName: string) => string;
                  • Finds a path inside node_modules

                  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 originalError is 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

                      module 'build/doclink.d.ts' {}
                      • When the user builds, we should define the target platform globally.

                      function blog

                      blog: (
                      path: string,
                      hashOrOverrides?: string | (Overrides & Other) | undefined
                      ) => string;

                        function community

                        community: (
                        path: string,
                        hashOrOverrides?: string | (Overrides & Other) | undefined
                        ) => string;

                          function contributing

                          contributing: (
                          path: string,
                          hashOrOverrides?: string | (Overrides & Other) | undefined
                          ) => string;

                            function docs

                            docs: (
                            path: string,
                            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,
                                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 (16)

                                  Dependencies (9)

                                  Dev Dependencies (6)

                                  Peer Dependencies (0)

                                  No peer dependencies.

                                  Badge

                                  To add a badge like this onejsDocs.io badgeto 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
                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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>