Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InitCommand

Hierarchy

Properties

assumeFreshProject

assumeFreshProject: boolean = Option.Boolean(`--assume-fresh-project`, false, {hidden: true})

cwd

cwd: undefined | string = Option.String(`--cwd`, {hidden: true})

install

install: string | false | true = Option.String(`-i,--install`, false, {tolerateBoolean: true,description: `Initialize a package with a specific bundle that will be locked in the project`,})

private

private: boolean = Option.Boolean(`-p,--private`, false, {description: `Initialize a private package`,})

usev2

usev2: boolean = Option.Boolean(`-2`, false, {hidden: true})

workspace

workspace: boolean = Option.Boolean(`-w,--workspace`, false, {description: `Initialize a workspace root with a \`packages/\` directory`,})

yes

yes: undefined | false | true = Option.Boolean(`-y,--yes`, {hidden: true})

Static paths

paths: string[][] = [[`init`],]

Static usage

usage: Usage = Command.Usage({description: `create a new package`,details: `This command will setup a new package in your local directory.If the \`-p,--private\` or \`-w,--workspace\` options are set, the package will be private by default.If the \`-w,--workspace\` option is set, the package will be configured to accept a set of workspaces in the \`packages/\` directory.If the \`-i,--install\` option is given a value, Yarn will first download it using \`yarn set version\` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be \`latest\`.The initial settings of the manifest can be changed by using the \`initScope\` and \`initFields\` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via \`initEditorConfig\`, and will initialize a Git repository in the current directory.`,examples: [[`Create a new package in the local directory`,`yarn init`,], [`Create a new private package in the local directory`,`yarn init -p`,], [`Create a new package and store the Yarn release inside`,`yarn init -i=latest`,], [`Create a new private package and defines it as a workspace root`,`yarn init -w`,]],})

Methods

execute

  • execute(): Promise<number | void>

executeProxy

  • executeProxy(configuration: Configuration, version: string): Promise<number>

executeRegular

Generated using TypeDoc