@tarojs/cli

  • Version 3.6.20
  • Published
  • 439 kB
  • 23 dependencies
  • MIT license

Install

npm i @tarojs/cli
yarn add @tarojs/cli
pnpm add @tarojs/cli

Overview

cli tool for taro

Index

Variables

variable _default

const _default: {
doctor: { validators: ((args: any) => any)[] };
Project: typeof Project;
Creator: typeof Creator;
defineConfig: typeof defineConfig;
};

    variable doctor

    const doctor: { validators: ((args: any) => any)[] };

      Functions

      function defineConfig

      defineConfig: (config: UserConfigExport) => UserConfigExport;
      • v3.6.9 暂不支持 react native

      Classes

      class Creator

      class Creator {}

        constructor

        constructor(sourceRoot?: string);

          property fs

          fs: IMemFsEditor;

            method destinationPath

            destinationPath: (...args: string[]) => string;

              method destinationRoot

              destinationRoot: (rootPath?: string) => string;

                method init

                init: () => void;

                  method sourceRoot

                  sourceRoot: (rootPath?: string) => string;

                    method template

                    template: (
                    template: string,
                    source: string,
                    dest: string,
                    data?: Record<any, any>,
                    options?: any
                    ) => this | undefined;

                      method templatePath

                      templatePath: (...args: string[]) => string;

                        method write

                        write: () => void;

                          method writeGitKeepFile

                          writeGitKeepFile: (dirname: string) => void;

                            class Project

                            class Project extends Creator {}

                              constructor

                              constructor(options: IProjectConfOptions);

                                property askCompiler

                                askCompiler: AskMethods;

                                  property askCSS

                                  askCSS: AskMethods;

                                    property askDescription

                                    askDescription: AskMethods;

                                      property askFramework

                                      askFramework: AskMethods;

                                        property askNpm

                                        askNpm: AskMethods;

                                          property askProjectName

                                          askProjectName: AskMethods;

                                            property askTemplate

                                            askTemplate: AskMethods;

                                              property askTemplateSource

                                              askTemplateSource: AskMethods;

                                                property askTypescript

                                                askTypescript: AskMethods;

                                                  property conf

                                                  conf: IProjectConfOptions;

                                                    property rootPath

                                                    rootPath: string;

                                                      method ask

                                                      ask: () => Promise<{
                                                      projectName: string;
                                                      projectDir: string;
                                                      npm: string;
                                                      templateSource: string;
                                                      clone?: boolean | undefined;
                                                      template: string;
                                                      description?: string | undefined;
                                                      typescript?: boolean | undefined;
                                                      css: 'none' | 'sass' | 'stylus' | 'less';
                                                      date?: string | undefined;
                                                      src?: string | undefined;
                                                      sourceRoot?: string | undefined;
                                                      env?: string | undefined;
                                                      autoInstall?: boolean | undefined;
                                                      framework: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3';
                                                      compiler?: 'webpack4' | 'webpack5' | 'vite' | undefined;
                                                      }>;

                                                        method create

                                                        create: () => Promise<void>;

                                                          method fetchTemplates

                                                          fetchTemplates: (answers: IProjectConf) => Promise<ITemplates[]>;

                                                            method init

                                                            init: () => void;

                                                              method write

                                                              write: (cb?: () => void) => void;

                                                                Interfaces

                                                                interface ConfigEnv

                                                                interface ConfigEnv {}

                                                                  property command

                                                                  command: string;
                                                                  • taro 当前执行的命令

                                                                  property mode

                                                                  mode: string;
                                                                  • 当前模式 (mode)

                                                                  Type Aliases

                                                                  type UserConfigExport

                                                                  type UserConfigExport = IProjectConfig | Promise<IProjectConfig> | UserConfigFn;

                                                                    type UserConfigFn

                                                                    type UserConfigFn = (
                                                                    mergin: WebpackMerge,
                                                                    env: ConfigEnv
                                                                    ) => IProjectConfig | Promise<IProjectConfig>;

                                                                      Namespaces

                                                                      namespace @tarojs/components

                                                                      module '@tarojs/components' {}

                                                                        namespace *.css

                                                                        module '*.css' {}

                                                                          namespace *.gif

                                                                          module '*.gif' {}

                                                                            namespace *.jpeg

                                                                            module '*.jpeg' {}

                                                                              namespace *.jpg

                                                                              module '*.jpg' {}

                                                                                namespace *.json

                                                                                module '*.json' {}

                                                                                  variable value

                                                                                  const value: any;

                                                                                    namespace *.less

                                                                                    module '*.less' {}

                                                                                      namespace *.png

                                                                                      module '*.png' {}

                                                                                        namespace *.sass

                                                                                        module '*.sass' {}

                                                                                          namespace *.scss

                                                                                          module '*.scss' {}

                                                                                            namespace *.styl

                                                                                            module '*.styl' {}

                                                                                              namespace *.svg

                                                                                              module '*.svg' {}

                                                                                                Package Files (7)

                                                                                                Dependencies (23)

                                                                                                Dev Dependencies (7)

                                                                                                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/@tarojs/cli.

                                                                                                • Markdown
                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@tarojs/cli)
                                                                                                • HTML
                                                                                                  <a href="https://www.jsdocs.io/package/@tarojs/cli"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>