Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -2,6 +2,60 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="7.0.0"></a>
# [7.0.0](https://github.com/yargs/yargs-parser/compare/v6.0.1...v7.0.0) (2017-05-02)
### Chores
* revert populate-- logic ([#91](https://github.com/yargs/yargs-parser/issues/91)) ([6003e6d](https://github.com/yargs/yargs-parser/commit/6003e6d))
### BREAKING CHANGES
* populate-- now defaults to false.
<a name="6.0.1"></a>
## [6.0.1](https://github.com/yargs/yargs-parser/compare/v6.0.0...v6.0.1) (2017-05-01)
### Bug Fixes
* default '--' to undefined when not provided; this is closer to the array API ([#90](https://github.com/yargs/yargs-parser/issues/90)) ([4e739cc](https://github.com/yargs/yargs-parser/commit/4e739cc))
<a name="6.0.0"></a>
# [6.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v6.0.0) (2017-05-01)
### Bug Fixes
* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f))
* parsing hints should apply for dot notation keys ([#86](https://github.com/yargs/yargs-parser/issues/86)) ([3e47d62](https://github.com/yargs/yargs-parser/commit/3e47d62))
### Chores
* upgrade to newest version of camelcase ([#87](https://github.com/yargs/yargs-parser/issues/87)) ([f1903aa](https://github.com/yargs/yargs-parser/commit/f1903aa))
### Features
* add -- option which allows arguments after the -- flag to be returned separated from positional arguments ([#84](https://github.com/yargs/yargs-parser/issues/84)) ([2572ca8](https://github.com/yargs/yargs-parser/commit/2572ca8))
* when parsing stops, we now populate "--" by default ([#88](https://github.com/yargs/yargs-parser/issues/88)) ([cd666db](https://github.com/yargs/yargs-parser/commit/cd666db))
### BREAKING CHANGES
* rather than placing arguments in "_", when parsing is stopped via "--"; we now populate an array called "--" by default.
* camelcase now requires Node 4+.
* environment variables will now override config files (args, env, config-file, config-object)
<a name="5.0.0"></a>
# [5.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v5.0.0) (2017-02-18)

View File

@@ -11,7 +11,7 @@ The mighty option parser used by [yargs](https://github.com/yargs/yargs).
visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.
<img width="250" src="https://github.com/yargs/yargs-parser/blob/master/yargs-logo.png">
<img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png">
## Example
@@ -72,12 +72,14 @@ Parses command line arguments returning a simple mapping of keys and values.
* `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).
* `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).
* `opts.number`: keys should be treated as numbers.
* `opts['--']`: arguments after the end-of-options flag `--` will be set to the `argv.['--']` array instead of being set to the `argv._` array.
**returns:**
* `obj`: an object representing the parsed value of `args`
* `key/value`: key value pairs for each argument and their aliases.
* `_`: an array representing the positional arguments.
* [optional] `--`: an array with arguments after the end-of-options flag `--`.
### require('yargs-parser').detailed(args, opts={})
@@ -100,6 +102,7 @@ yargs engine.
* `configuration`: the configuration loaded from the `yargs` stanza in package.json.
<a name="configuration"></a>
### Configuration
The yargs-parser applies several automated transformations on the keys provided
@@ -247,6 +250,27 @@ node example.js -x 1 2 -x 3 4
{ _: [], x: [[1, 2], [3, 4]] }
```
### populate --
* default: `false`.
* key: `populate--`
Should unparsed flags be stored in `--` or `_`.
_If disabled:_
```sh
node example.js a -b -- x y
{ _: [ 'a', 'x', 'y' ], b: true }
```
_If enabled:_
```sh
node example.js a -b -- x y
{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }
```
## Special Thanks
The yargs project evolves from optimist and minimist. It owes its

View File

@@ -17,11 +17,14 @@ function parse (args, opts) {
'parse-numbers': true,
'boolean-negation': true,
'duplicate-arguments-array': true,
'flatten-duplicate-arrays': true
'flatten-duplicate-arrays': true,
'populate--': false
}, opts.configuration)
var defaults = opts.default || {}
var configObjects = opts.configObjects || []
var envPrefix = opts.envPrefix
var notFlagsOption = configuration['populate--']
var notFlagsArgv = notFlagsOption ? '--' : '_'
var newAliases = {}
// allow a i18n handler to be passed in, default to a fake one (util.format).
var __ = opts.__ || function (str) {
@@ -289,8 +292,10 @@ function parse (args, opts) {
if (!hasKey(argv, key.split('.'))) setArg(key, 0)
})
// '--' defaults to undefined.
if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = []
notFlags.forEach(function (key) {
argv._.push(key)
argv[notFlagsArgv].push(key)
})
// how many arguments should we consume, based
@@ -558,7 +563,7 @@ function parse (args, opts) {
var key = keys[keys.length - 1]
var isTypeArray = checkAllAliases(key, flags.arrays)
var isTypeArray = checkAllAliases(keys.join('.'), flags.arrays)
var isValueArray = Array.isArray(value)
var duplicate = configuration['duplicate-arguments-array']

View File

@@ -21,9 +21,7 @@
"saveSpec": null,
"fetchSpec": "3.0.0"
},
"_requiredBy": [
"/react-scripts/yargs-parser"
],
"_requiredBy": [],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
"_spec": "3.0.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI",

View File

@@ -1,31 +1,31 @@
{
"_args": [
[
"yargs-parser@5.0.0",
"yargs-parser@7.0.0",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI"
]
],
"_from": "yargs-parser@5.0.0",
"_id": "yargs-parser@5.0.0",
"_from": "yargs-parser@7.0.0",
"_id": "yargs-parser@7.0.0",
"_inBundle": false,
"_integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=",
"_integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=",
"_location": "/react-scripts/yargs-parser",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "yargs-parser@5.0.0",
"raw": "yargs-parser@7.0.0",
"name": "yargs-parser",
"escapedName": "yargs-parser",
"rawSpec": "5.0.0",
"rawSpec": "7.0.0",
"saveSpec": null,
"fetchSpec": "5.0.0"
"fetchSpec": "7.0.0"
},
"_requiredBy": [
"/react-scripts/yargs"
],
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz",
"_spec": "5.0.0",
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz",
"_spec": "7.0.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI",
"author": {
"name": "Ben Coe",
@@ -35,7 +35,7 @@
"url": "https://github.com/yargs/yargs-parser/issues"
},
"dependencies": {
"camelcase": "^3.0.0"
"camelcase": "^4.1.0"
},
"description": "the mighty option parser used by yargs",
"devDependencies": {
@@ -43,7 +43,7 @@
"coveralls": "^2.11.12",
"mocha": "^3.0.1",
"nyc": "^10.0.0",
"standard": "^8.0.0",
"standard": "^10.0.2",
"standard-version": "^4.0.0"
},
"files": [
@@ -74,5 +74,5 @@
"release": "standard-version",
"test": "nyc mocha test/*.js"
},
"version": "5.0.0"
"version": "7.0.0"
}