Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: yargs/yargs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 08a045a741af0459810d3efee5e3cf7da82d461a
Choose a base ref
...
head repository: yargs/yargs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1ffb9279456bfac73c1b3681b0f738ada6587389
Choose a head ref

Commits on Mar 4, 2018

  1. Copy the full SHA
    11691a6 View commit details
  2. Copy the full SHA
    fb62d88 View commit details
  3. Copy the full SHA
    ea862ae View commit details
  4. docs: slight copy-edit nit

    Benjamin committed Mar 4, 2018
    Copy the full SHA
    bee18a4 View commit details
  5. Copy the full SHA
    9fd4da4 View commit details
  6. chore(release): 11.1.0

    Benjamin committed Mar 4, 2018
    Copy the full SHA
    114b288 View commit details
  7. Copy the full SHA
    32f6a62 View commit details

Commits on Mar 8, 2018

  1. Copy the full SHA
    ead118a View commit details

Commits on Apr 7, 2018

  1. fix: remove the trailing white spaces from the help output (#1090)

    BREAKING CHANGE: tests that assert against help output will need to be updated
    faressoft authored and bcoe committed Apr 7, 2018
    Copy the full SHA
    3f0746c View commit details
  2. chore: upgrade to version of yargs-parser that does not populate valu…

    …e for unset boolean (#1104)
    
    BREAKING CHANGE: yargs-parser does not populate 'false' when boolean flag is not passed
    bcoe authored Apr 7, 2018
    Copy the full SHA
    d4705f4 View commit details

Commits on Apr 23, 2018

  1. docs: grammar in advanced.md (#1108)

    aorinevo authored and bcoe committed Apr 23, 2018
    Copy the full SHA
    8edbce9 View commit details
  2. docs: update api.md (#1113)

    aorinevo authored and bcoe committed Apr 23, 2018
    Copy the full SHA
    744d299 View commit details

Commits on May 1, 2018

  1. Copy the full SHA
    9d71ac7 View commit details

Commits on May 2, 2018

  1. Copy the full SHA
    458e894 View commit details

Commits on May 10, 2018

  1. Copy the full SHA
    f13ebf4 View commit details
  2. Copy the full SHA
    036e7c5 View commit details

Commits on May 31, 2018

  1. docs: Restore correct header order (#1132) [skip ci]

    Andreas Opferkuch authored and evocateur committed May 31, 2018
    Copy the full SHA
    a881947 View commit details
  2. Copy the full SHA
    99cd33e View commit details
  3. chore: Allow v4 of y18n (#1138)

    iarna authored and evocateur committed May 31, 2018
    Copy the full SHA
    b3544cc View commit details
  4. chore: Run standard in pretest lifecycle (#1140)

    Static analysis should be done before tests. It saves times and also lints and catches errors through static analysis in tests.
    DiegoRBaquero authored and evocateur committed May 31, 2018
    Copy the full SHA
    88b6d23 View commit details

Commits on Jun 24, 2018

  1. Copy the full SHA
    a2f2eae View commit details
  2. Copy the full SHA
    e8cf970 View commit details
  3. docs: corrected version specifier in help example (#1163)

    The name of the flag: `version` and the actual version value: `1.0.1` were switched.
    kunagpal authored and bcoe committed Jun 24, 2018
    Copy the full SHA
    37b07e7 View commit details

Commits on Jun 26, 2018

  1. chore: test Node.js 6, 8 and 10 (#1160)

    BREAKING CHANGE: drop Node 6 from testing matrix, such that we'll gradually start drifting away from supporting Node 4.
    DanielRuf authored and bcoe committed Jun 26, 2018
    Copy the full SHA
    84f9d2b View commit details
  2. chore: cache node_modules (#1159)

    DanielRuf authored and bcoe committed Jun 26, 2018
    Copy the full SHA
    26080ba View commit details
  3. feat: remove setPlaceholderKeys (#1105)

    BREAKING CHANGE: Options absent from `argv` (not set via CLI argument) are now absent from the parsed result object rather tahn being set with `undefined`
    pvdlg authored and bcoe committed Jun 26, 2018
    Copy the full SHA
    6ee2c82 View commit details
  4. chore(release): 12.0.0

    Benjamin committed Jun 26, 2018
    Copy the full SHA
    53e3a94 View commit details
  5. docs: fix typo in CHANGELOG

    Benjamin committed Jun 26, 2018
    Copy the full SHA
    fc31713 View commit details

Commits on Jun 27, 2018

  1. Copy the full SHA
    58292b6 View commit details
  2. Copy the full SHA
    def00e8 View commit details

Commits on Jun 29, 2018

  1. chore: bump decamelize & find-up (#1168)

    LinusU authored and bcoe committed Jun 29, 2018
    Copy the full SHA
    52f87c0 View commit details
  2. chore: bump engines to Node.js 6.x (#1169)

    LinusU authored and bcoe committed Jun 29, 2018
    Copy the full SHA
    6ab99fe View commit details
  3. chore: explicit update of yargs-parser

    Benjamin committed Jun 29, 2018
    Copy the full SHA
    cfa7c65 View commit details
  4. chore(release): 12.0.1

    Benjamin committed Jun 29, 2018
    Copy the full SHA
    18b2fcb View commit details

Commits on Aug 11, 2018

  1. Copy the full SHA
    664b265 View commit details
  2. Copy the full SHA
    f449aea View commit details
  3. docs(advanced): fix typo (#1187)

    0x2206 authored and bcoe committed Aug 11, 2018
    Copy the full SHA
    b39836f View commit details
  4. docs: fix typo in advanced.md (#1194)

    santiagocanti authored and bcoe committed Aug 11, 2018
    Copy the full SHA
    a9820b4 View commit details
  5. Copy the full SHA
    efc0970 View commit details

Commits on Sep 4, 2018

  1. chore: explicit upgrade of insecure coveralls

    Benjamin Coe committed Sep 4, 2018
    Copy the full SHA
    5928728 View commit details
  2. chore(release): 12.0.2

    Benjamin Coe committed Sep 4, 2018
    Copy the full SHA
    6c6c27d View commit details

Commits on Sep 16, 2018

  1. fix: accept single function for middleware

    * Fixed type check in .middleware() method
    
    `if (typeof callback === 'object')` should be `if (typeof callback === 'function')`
    
    See Issue #1214 for details
    
    * middewareFactory accepts a function, not an object
    
    According to [the docs for the `.middleware()` method](http://yargs.js.org/docs/#api-middlewarecallbacks):
    
    > The `callbacks` parameter can be a function or a list of functions
    
    See Issue #1214 for more details
    
    * Added/Updated middleware tests
    
    I added a new test to verify that the `.middleware()` method works when a single function is passed, rather than an array of functions.
    
    Also enhanced an existing test to ensure that _all_ middleware is run before commands, regardless of whether it was added as an array of functions or a single function.
    JamesMessinger authored and aorinevo committed Sep 16, 2018
    Copy the full SHA
    66fd6f7 View commit details

Commits on Oct 6, 2018

  1. Copy the full SHA
    3a258bb View commit details
  2. Copy the full SHA
    da54028 View commit details
  3. Copy the full SHA
    a458fa4 View commit details
  4. Copy the full SHA
    d422eb5 View commit details
  5. Copy the full SHA
    8e3a70f View commit details
  6. Copy the full SHA
    567820b View commit details
  7. chore: update yargs-parser dependency

    Benjamin committed Oct 6, 2018
    Copy the full SHA
    e99e9ae View commit details
  8. chore(release): 12.0.3

    Benjamin committed Oct 6, 2018
    Copy the full SHA
    d72dec1 View commit details
Showing with 17,917 additions and 5,744 deletions.
  1. +0 −14 .editorconfig
  2. +21 −0 .eslintrc
  3. +68 −0 .github/workflows/ci.yaml
  4. +19 −0 .github/workflows/coverage.yaml
  5. +44 −0 .github/workflows/release-please.yml
  6. +4 −0 .gitignore
  7. +13 −0 .nycrc
  8. +0 −12 .travis.yml
  9. +148 −953 CHANGELOG.md
  10. +46 −0 CODE_OF_CONDUCT.md
  11. +2 −3 LICENSE
  12. +102 −26 README.md
  13. +0 −35 appveyor.yml
  14. +7 −0 browser.mjs
  15. +2,764 −0 build/index.cjs
  16. +2 −0 build/lib/argsert.d.ts
  17. +58 −0 build/lib/argsert.js
  18. +60 −0 build/lib/command.d.ts
  19. +358 −0 build/lib/command.js
  20. +2 −0 build/lib/completion-templates.d.ts
  21. +47 −0 build/lib/completion-templates.js
  22. +21 −0 build/lib/completion.d.ts
  23. +115 −0 build/lib/completion.js
  24. +10 −0 build/lib/middleware.d.ts
  25. +51 −0 build/lib/middleware.js
  26. +11 −0 build/lib/parse-command.d.ts
  27. +32 −0 build/lib/parse-command.js
  28. +69 −0 build/lib/typings/common-types.d.ts
  29. +9 −0 build/lib/typings/common-types.js
  30. +115 −0 build/lib/typings/yargs-parser-types.d.ts
  31. +1 −0 build/lib/typings/yargs-parser-types.js
  32. +47 −0 build/lib/usage.d.ts
  33. +514 −0 build/lib/usage.js
  34. +2 −0 build/lib/utils/apply-extends.d.ts
  35. +58 −0 build/lib/utils/apply-extends.js
  36. +1 −0 build/lib/utils/is-promise.d.ts
  37. +5 −0 build/lib/utils/is-promise.js
  38. +1 −0 build/lib/utils/levenshtein.d.ts
  39. +26 −0 build/lib/utils/levenshtein.js
  40. +1 −0 build/lib/utils/obj-filter.d.ts
  41. +10 −0 build/lib/utils/obj-filter.js
  42. +2 −0 build/lib/utils/process-argv.d.ts
  43. +17 −0 build/lib/utils/process-argv.js
  44. +1 −0 build/lib/utils/set-blocking.d.ts
  45. +10 −0 build/lib/utils/set-blocking.js
  46. +2 −0 build/lib/utils/which-module.d.ts
  47. +10 −0 build/lib/utils/which-module.js
  48. +32 −0 build/lib/validation.d.ts
  49. +301 −0 build/lib/validation.js
  50. +277 −0 build/lib/yargs-factory.d.ts
  51. +1,077 −0 build/lib/yargs-factory.js
  52. +4 −0 build/lib/yerror.d.ts
  53. +7 −0 build/lib/yerror.js
  54. +0 −28 completion.sh.hbs
  55. +7 −56 contributing.md
  56. +12 −0 deno.ts
  57. +1,227 −0 docs/CHANGELOG-historical.md
  58. +88 −17 docs/advanced.md
  59. +333 −52 docs/api.md
  60. +32 −0 docs/browser.md
  61. +51 −38 docs/examples.md
  62. +24 −0 docs/tricks.md
  63. +66 −0 docs/typescript.md
  64. +2 −2 example/boolean_single.js
  65. +10 −0 example/cmds/init.js
  66. +6 −0 example/cmds/remote.js
  67. +6 −0 example/cmds/remote_cmds/add.js
  68. +6 −0 example/cmds/remote_cmds/prune.js
  69. +6 −0 example/command_hierarchy.js
  70. +1 −1 example/help.js
  71. +13 −12 example/usage-options.js
  72. +50 −0 example/yargs.html
  73. +14 −0 helpers.mjs
  74. +11 −4 index.js → index.cjs
  75. +8 −0 index.mjs
  76. +0 −53 lib/apply-extends.js
  77. +15 −16 lib/{argsert.js → argsert.ts}
  78. +42 −0 lib/cjs.ts
  79. +0 −426 lib/command.js
  80. +552 −0 lib/command.ts
  81. +49 −0 lib/completion-templates.ts
  82. +0 −105 lib/completion.js
  83. +166 −0 lib/completion.ts
  84. +70 −0 lib/middleware.ts
  85. +0 −11 lib/obj-filter.js
  86. +44 −0 lib/parse-command.ts
  87. +91 −0 lib/platform-shims/browser.mjs
  88. +44 −0 lib/platform-shims/cjs.ts
  89. +102 −0 lib/platform-shims/deno.ts
  90. +67 −0 lib/platform-shims/esm.mjs
  91. +108 −0 lib/typings/common-types.ts
  92. +165 −0 lib/typings/yargs-parser-types.ts
  93. +0 −524 lib/usage.js
  94. +682 −0 lib/usage.ts
  95. +66 −0 lib/utils/apply-extends.ts
  96. +5 −0 lib/utils/is-promise.ts
  97. +20 −9 lib/{levenshtein.js → utils/levenshtein.ts}
  98. +14 −0 lib/utils/obj-filter.ts
  99. +36 −0 lib/utils/process-argv.ts
  100. +17 −0 lib/utils/set-blocking.ts
  101. +8 −0 lib/utils/which-module.ts
  102. +179 −72 lib/{validation.js → validation.ts}
  103. +1,751 −0 lib/yargs-factory.ts
  104. +0 −11 lib/yerror.js
  105. +7 −0 lib/yerror.ts
  106. +9 −2 locales/be.json
  107. +10 −3 locales/de.json
  108. +13 −4 locales/en.json
  109. +9 −2 locales/es.json
  110. +49 −0 locales/fi.json
  111. +39 −23 locales/fr.json
  112. +9 −2 locales/hi.json
  113. +9 −2 locales/hu.json
  114. +9 −2 locales/id.json
  115. +10 −3 locales/it.json
  116. +15 −6 locales/ja.json
  117. +9 −2 locales/ko.json
  118. +10 −3 locales/nb.json
  119. +23 −16 locales/nl.json
  120. +11 −6 locales/nn.json
  121. +2 −1 locales/pirate.json
  122. +9 −2 locales/pl.json
  123. +9 −2 locales/pt.json
  124. +8 −2 locales/pt_BR.json
  125. +9 −2 locales/ru.json
  126. +9 −2 locales/th.json
  127. +9 −2 locales/tr.json
  128. +9 −2 locales/zh_CN.json
  129. +9 −2 locales/zh_TW.json
  130. +79 −39 package.json
  131. +9 −0 renovate.json
  132. +23 −0 rollup.config.cjs
  133. +53 −30 test/{argsert.js → argsert.cjs}
  134. 0 test/{before.js → before.cjs}
  135. +406 −190 test/{command.js → command.cjs}
  136. +596 −0 test/completion.cjs
  137. +0 −307 test/completion.js
  138. +22 −0 test/deno/platform-shim.test.ts
  139. +27 −0 test/deno/yargs.test.ts
  140. +30 −0 test/esm/helpers.mjs
  141. +25 −0 test/esm/platform-shim-test.mjs
  142. +24 −0 test/esm/yargs-test.mjs
  143. +1 −1 test/fixtures/bin.js
  144. +4 −0 test/fixtures/extends/.myotherrc
  145. +4 −0 test/fixtures/extends/.myrc
  146. +12 −0 test/fixtures/extends/config_deep.json
  147. +7 −0 test/fixtures/extends/config_deep_2.json
  148. +2 −2 test/fixtures/issue-497.js
  149. +5 −2 test/fixtures/no-extension
  150. +5 −2 test/fixtures/no-require-main.js
  151. +5 −1 test/fixtures/normal-bin.js
  152. +2 −2 test/fixtures/opt-assignment-and-positional-command-arg.js
  153. +2 −3 test/fixtures/package.json
  154. +5 −1 test/fixtures/symlink-bin.js
  155. +27 −0 test/helpers.cjs
  156. +11 −11 test/helpers/{utils.js → utils.cjs}
  157. +12 −12 test/{integration.js → integration.cjs}
  158. +32 −0 test/is-promise.cjs
  159. +391 −0 test/middleware.cjs
  160. +13 −0 test/obj-filter.cjs
  161. +9 −0 test/parse-command.cjs
  162. +11 −0 test/parser.cjs
  163. +1,685 −901 test/{usage.js → usage.cjs}
  164. +378 −201 test/{validation.js → validation.cjs}
  165. +769 −305 test/{yargs.js → yargs.cjs}
  166. +19 −0 tsconfig.json
  167. +13 −0 tsconfig.test.json
  168. +7 −0 types.ts
  169. BIN yargs-logo.png
  170. +8 −0 yargs.cjs
  171. +0 −1,161 yargs.js
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"overrides": [
{
"files": "*.ts",
"parser": "@typescript-eslint/parser",
"rules": {
"no-unused-vars": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-useless-constructor": "error"
}
}
],
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint/eslint-plugin"
]
}
68 changes: 68 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
branches:
- master
pull_request:
types: [ assigned, opened, synchronize, reopened, labeled ]
name: ci
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 13, 14]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: node --version
- run: npm install --engine-strict
- run: npm test
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm test
esm:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: node --version
- run: npm install --engine-strict
- run: npm run test:esm
deno:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm install
- run: npm run compile
- uses: denolib/setup-deno@v2
with:
deno-version: v1.x
- run: |
deno --version
deno test --allow-read test/deno/*
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 13
- run: npm install
- run: npm test
- run: npm run coverage
19 changes: 19 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches:
- master
name: coverage
jobs:
coveralls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 13
- run: npm install
- run: npm test
- run: ./node_modules/.bin/c8 report --reporter=text-lcov | ./node_modules/.bin/coveralls
env:
COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}"
COVERALLS_GIT_BRANCH: "${{ github.ref }}"
44 changes: 44 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches:
- master
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: bcoe/release-please-action@v2.1.1
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: yargs
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm install
- run: npm run compile
- name: push Deno release
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN}}@github.com/yargs/yargs.git"
git checkout -b deno
git add -f build
git commit -a -m 'chore: ${{ steps.release.outputs.tag_name }} release'
git push origin +deno
git tag -a ${{ steps.release.outputs.tag_name }}-deno -m 'chore: ${{ steps.release.outputs.tag_name }} release'
git push origin ${{ steps.release.outputs.tag_name }}-deno
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://external-dot-oss-automation.appspot.com/'
if: ${{ steps.release.outputs.release_created }}
- run: npm install
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.idea/
build/
node_modules/
.nyc_output/
*.swp
test.js
coverage
package-lock.json
example.*
.DS_Store
.npmrc
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"exclude": [
"build/test/**",
"test/**"
],
"reporter": [
"html",
"text"
],
"lines": 100,
"branches": "96",
"statements": "100"
}
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

Loading