Skip to content

Include --ignore-optional doc #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

allcentury
Copy link

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

Resolves yarnpkg#265.

Two changes:

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

Shouldn't this be on the yarn install page?

@allcentury
Copy link
Author

allcentury commented Nov 17, 2016

@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?

@jamiebuilds
Copy link
Contributor

jamiebuilds commented Nov 18, 2016

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.

Copy link
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the documentation for yarn install, not yarn add.

@allcentury
Copy link
Author

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

@allcentury allcentury changed the title Incldue --ignore-optional doc Include --ignore-optional doc Jan 9, 2017
@markstos
Copy link
Contributor

markstos commented Feb 8, 2017

The PR looks good to me, but given yarnpkg/yarn#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants