website icon indicating copy to clipboard operation
website copied to clipboard

Include --ignore-optional doc

Open allcentury opened this issue 7 years ago • 5 comments

Resolves #265.

Two changes:

  1. Fix broken link to optionalDependencies
  2. Include documentation for the --ignore-optional CLI command

Looks like this (locally):

screen shot 2016-11-17 at 9 05 30 am

allcentury avatar Nov 17 '16 14:11 allcentury

Shouldn't this be on the yarn install page?

jamiebuilds avatar Nov 17 '16 18:11 jamiebuilds

@thejameskyle This is in reference to yarn help add in the CLI which outputs:

▶ yarn help add

  Usage: yarn add [packages ...] [flags]

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    --offline
    --prefer-offline
    --strict-semver
    --json
    --global-folder <path>
    --modules-folder <path>     rather than installing modules into the node_modules folder relative to the cwd, output them here
    --cache-folder <path>       specify a custom folder to store the yarn cache
    --mutex <type>[:specifier]  use a mutex to ensure only one yarn instance is executing
    --no-emoji                  disable emoji in output
    --har                       save HAR output of network traffic
    --ignore-platform           ignore platform checks
    --ignore-engines            ignore engines check
    --ignore-scripts
    --ignore-optional
    --force                     ignore all caches
    --flat                      only allow one version of a package
    --prod, --production
    --no-lockfile               don't read or generate a lockfile
    --pure-lockfile             don't generate a lockfile
    --dev                       save package to your `devDependencies`
    --peer                      save package to your `peerDependencies`
    --optional                  save package to your `optionalDependencies`
    --exact
    --tilde

  Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

However I see the same list when I run yarn help install

▶ yarn help install

  Usage: yarn install [flags]

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    --offline
    --prefer-offline
    --strict-semver
    --json
    --global-folder <path>
    --modules-folder <path>     rather than installing modules into the node_modules folder relative to the cwd, output them here
    --cache-folder <path>       specify a custom folder to store the yarn cache
    --mutex <type>[:specifier]  use a mutex to ensure only one yarn instance is executing
    --no-emoji                  disable emoji in output
    --har                       save HAR output of network traffic
    --ignore-platform           ignore platform checks
    --ignore-engines            ignore engines check
    --ignore-scripts
    --ignore-optional
    --force                     ignore all caches
    --flat                      only allow one version of a package
    --prod, --production
    --no-lockfile               don't read or generate a lockfile
    --pure-lockfile             don't generate a lockfile
    -g, --global                DEPRECATED
    -S, --save                  DEPRECATED - save package to your `dependencies`
    -D, --save-dev              DEPRECATED - save package to your `devDependencies`
    -P, --save-peer             DEPRECATED - save package to your `peerDependencies`
    -O, --save-optional         DEPRECATED - save package to your `optionalDependencies`
    -E, --save-exact            DEPRECATED
    -T, --save-tilde            DEPRECATED

  Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

add is replacing install right? Would you recommend this go in two places or something else?

allcentury avatar Nov 17 '16 19:11 allcentury

add is not replacing install. install has been broken up into separate commands.

Internally add uses a lot of the same logic that install has, I wouldn't be surprised if was using the same content even if some of those flags don't make sense in add

@kittens did you intend this? yarn add [package] --ignore-optional is confusing.

jamiebuilds avatar Nov 18 '16 00:11 jamiebuilds

@Daniel15 I moved this to the yarn install CLI documentation.

allcentury avatar Jan 05 '17 16:01 allcentury

The PR looks good to me, but given https://github.com/yarnpkg/yarn/issues/2666 it could be good clarify whether --ignore-optional is intended to work only for the top-level package or also for all dependencies as well.

markstos avatar Feb 08 '17 15:02 markstos