Do you want to request a feature or report a bug?
Feature
What is the current behavior?
I feel like this is staring me in the face and I'm just not seeing it. I can't find documentation that explains what settings are available. e.g., npm configuration documentation explains how to set 'http-proxy' or an auth token in .npmrc. I don't see these options on https://yarnpkg.com/en/docs/cli/config/ I assume I could just copy and paste my .npmrc file and rename it .yarnrc... but is that true?
What is the expected behavior?
I expected more complete documentation that explains how to use an auth token and an http-proxy and also lists all other configuration settings that I don't know I need yet.
Please mention your node.js, yarn and operating system version.
node.js v6.10.2
yarn 0.23.4
The following file works w/ npm
.npmrc
strict-ssl=false
registry=http://my.internal.packages/npm/registry
always-auth=true
//my.internal.packages/npm/:_authToken=<A-GIANT-HASH-VALUE>
I copied it and renamed it '.yarnrc' and when I run yarn config list
I get errors:
yarn config v0.23.4
error An unexpected error occurred: "Unknown token 1:0 in C:\\Users\\me\\.ya
rnrc".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\me\\Desktop\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/config for documentation about this command.
C:\Users\229915\Desktop>yarn config list
yarn config v0.23.4
error An unexpected error occurred: "Invalid value type 2:0 in C:\\Users\\me\\.yarnrc".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\me\\Desktop\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/config for documentation about this command.
Yeah, we definitely need help in this, a PR to the website is very much welcome.
I'll PR what I can figure out. It's very flexible, that is it will add any keys to my config that I specify in the command line: yarn config set big-hairy-ape "https://github.com"
I'm looking for the keys that are actually consumed by yarn. I'll begin by searching the source code for references to the keys found when I run yarn config list
``
{ 'version-tag-prefix': 'v',
'version-git-tag': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.yarnpkg.com',
'strict-ssl': true,
'user-agent': 'yarn/0.23.4 npm/? node/v6.10.1 linux x64',
lastUpdateCheck: 1494186430539 }
```
Looks like .yarnrc also differs from .npmrc in that it doesn't use INI format KEY=VALUE
but instead is space delimited: KEY "VALUE"
; It also wraps the value in quotes if it was input using yarn config set
.
yarn config set little-ape 5
.yarnrc:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
big-hairy-ape "https://github.com"
lastUpdateCheck 1494186430539
little-ape "5"
with a bit of grepping and regex string replacement I was able to create a list of keys. Most are kebab case. lastUpdateCheck seems to be the exception to the rule.
registry: 'registry'
save-prefix: 'save-prefix'
ignore-scripts: 'ignore-scripts'
ignore-platform: 'ignore-platform'
ignore-engines: 'ignore-engines'
ignore-optional: 'ignore-optional'
force: 'force'
disable-self-update-check: 'disable-self-update-check'
lastUpdateCheck: 'lastUpdateCheck'
name: 'init-author-name'
email: 'init-author-email'
url: 'init-author-url'
default: 'init-version'
default: 'init-license'
version-git-tag: 'version-git-tag'
message: 'version-git-/message'
constsign: 'version-sign-git-tag'
constprefix: 'version-tag-prefix'
registry: 'registry'
noProgressConfig: 'no-progress'
always-auth: 'always-auth'
network-concurrency: 'network-concurrency'
child-concurrency: 'child-concurrency'
network-timeout: 'network-timeout'
userAgent: 'user-agent'
httpProxy: 'proxy'
httpsProxy: 'https-proxy'
strictSSL: 'strict-ssl'
ca: 'ca'
cafile: 'cafile'
cert: 'cert'
key: 'key'
cache-folder: 'cache-folder'
yarn-offline-mirror-pruning: 'yarn-offline-mirror-pruning'
production: 'production'
registry: 'registry'
customEnv: 'env'
yarn config set
@gforceg's comment doesn't include the prefix
key, so I wonder if there are others that might be missed? Right now I'm on the hunt for one that lets me change the name of the symlink folder (after the prefix) from bin
to .bin
.
Please put this list on your website!
@gforceg I realize this is years old, but great work on putting together this list of keys. Thank you! Were you able to ever figure out which key to use for setting the auth token? I tried key
but that didn't seem to work.
@fotijr Nope. I only used yarn briefly before switching back to npm. I suspect that yarn uses npm's config for handling these things but I can't say for sure.
https://yarnpkg.com/lang/en/docs/cli/config/#toc-yarn-config-list
Closing this issue out since I have moved on to other things. Sorry if you all thought I was working on this. 馃槥
Most helpful comment
with a bit of grepping and regex string replacement I was able to create a list of keys. Most are kebab case. lastUpdateCheck seems to be the exception to the rule.