yargs 15.3.1 → 15.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +2 -3
  3. package/README.md +5 -5
  4. package/build/lib/apply-extends.d.ts +2 -0
  5. package/build/lib/apply-extends.js +65 -0
  6. package/build/lib/argsert.d.ts +2 -0
  7. package/build/lib/argsert.js +65 -0
  8. package/build/lib/command.d.ts +64 -0
  9. package/build/lib/command.js +416 -0
  10. package/build/lib/common-types.d.ts +36 -0
  11. package/build/lib/common-types.js +25 -0
  12. package/build/lib/completion-templates.d.ts +2 -0
  13. package/{lib → build/lib}/completion-templates.js +6 -5
  14. package/build/lib/completion.d.ts +21 -0
  15. package/build/lib/completion.js +135 -0
  16. package/build/lib/is-promise.d.ts +1 -0
  17. package/build/lib/is-promise.js +9 -0
  18. package/build/lib/levenshtein.d.ts +1 -0
  19. package/{lib → build/lib}/levenshtein.js +33 -33
  20. package/build/lib/middleware.d.ts +10 -0
  21. package/build/lib/middleware.js +57 -0
  22. package/build/lib/obj-filter.d.ts +1 -0
  23. package/build/lib/obj-filter.js +14 -0
  24. package/build/lib/parse-command.d.ts +11 -0
  25. package/build/lib/parse-command.js +36 -0
  26. package/build/lib/process-argv.d.ts +2 -0
  27. package/build/lib/process-argv.js +31 -0
  28. package/build/lib/usage.d.ts +49 -0
  29. package/build/lib/usage.js +540 -0
  30. package/build/lib/validation.d.ts +34 -0
  31. package/build/lib/validation.js +330 -0
  32. package/build/lib/yargs.d.ts +274 -0
  33. package/build/lib/yargs.js +1190 -0
  34. package/build/lib/yerror.d.ts +4 -0
  35. package/build/lib/yerror.js +11 -0
  36. package/index.js +1 -1
  37. package/locales/ja.json +6 -4
  38. package/package.json +26 -13
  39. package/yargs.js +2 -1291
  40. package/lib/apply-extends.js +0 -67
  41. package/lib/argsert.js +0 -68
  42. package/lib/command.js +0 -462
  43. package/lib/completion.js +0 -132
  44. package/lib/is-promise.js +0 -3
  45. package/lib/middleware.js +0 -64
  46. package/lib/obj-filter.js +0 -11
  47. package/lib/process-argv.js +0 -34
  48. package/lib/usage.js +0 -571
  49. package/lib/validation.js +0 -394
  50. package/lib/yerror.js +0 -11
@@ -0,0 +1,4 @@
1
+ export declare class YError extends Error {
2
+ name: string;
3
+ constructor(msg?: string | null);
4
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YError = void 0;
4
+ class YError extends Error {
5
+ constructor(msg) {
6
+ super(msg || 'yargs error');
7
+ this.name = 'YError';
8
+ Error.captureStackTrace(this, YError);
9
+ }
10
+ }
11
+ exports.YError = YError;
package/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // without running as a singleton do:
4
4
  // require('yargs/yargs')(process.argv.slice(2))
5
5
  const yargs = require('./yargs')
6
- const processArgv = require('./lib/process-argv')
6
+ const processArgv = require('./build/lib/process-argv')
7
7
 
8
8
  Argv(processArgv.getProcessArgvWithoutBin())
9
9
 
package/locales/ja.json CHANGED
@@ -22,8 +22,8 @@
22
22
  "other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:"
23
23
  },
24
24
  "Missing argument value: %s": {
25
- "one": "引数が見つかりません: %s",
26
- "other": "引数が見つかりません: %s"
25
+ "one": "引数の値が見つかりません: %s",
26
+ "other": "引数の値が見つかりません: %s"
27
27
  },
28
28
  "Missing required argument: %s": {
29
29
  "one": "必須の引数が見つかりません: %s",
@@ -34,7 +34,7 @@
34
34
  "other": "未知の引数です: %s"
35
35
  },
36
36
  "Invalid values:": "不正な値です:",
37
- "Argument: %s, Given: %s, Choices: %s": "引数は %s です。指定できるのは %s つです。選択してください: %s",
37
+ "Argument: %s, Given: %s, Choices: %s": "引数は %s です。与えられた値: %s, 選択してください: %s",
38
38
  "Argument check failed: %s": "引数のチェックに失敗しました: %s",
39
39
  "Implications failed:": "オプションの組み合わせで不正が生じました:",
40
40
  "Not enough arguments following: %s": "次の引数が不足しています。: %s",
@@ -45,5 +45,7 @@
45
45
  "Did you mean %s?": "もしかして %s?",
46
46
  "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません",
47
47
  "Positionals:": "位置:",
48
- "command": "コマンド"
48
+ "command": "コマンド",
49
+ "deprecated": "非推奨",
50
+ "deprecated: %s": "非推奨: %s"
49
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yargs",
3
- "version": "15.3.1",
3
+ "version": "15.4.0",
4
4
  "description": "yargs the modern, pirate-themed, successor to optimist.",
5
5
  "main": "./index.js",
6
6
  "contributors": [
@@ -12,15 +12,13 @@
12
12
  "files": [
13
13
  "index.js",
14
14
  "yargs.js",
15
- "lib",
15
+ "build",
16
16
  "locales",
17
- "completion.sh.hbs",
18
- "completion.zsh.hbs",
19
17
  "LICENSE"
20
18
  ],
21
19
  "dependencies": {
22
20
  "cliui": "^6.0.0",
23
- "decamelize": "^1.2.0",
21
+ "decamelize": "^3.2.0",
24
22
  "find-up": "^4.1.0",
25
23
  "get-caller-file": "^2.0.1",
26
24
  "require-directory": "^2.1.1",
@@ -29,36 +27,51 @@
29
27
  "string-width": "^4.2.0",
30
28
  "which-module": "^2.0.0",
31
29
  "y18n": "^4.0.0",
32
- "yargs-parser": "^18.1.1"
30
+ "yargs-parser": "^18.1.2"
33
31
  },
34
32
  "devDependencies": {
33
+ "@types/chai": "^4.2.11",
34
+ "@types/mocha": "^7.0.2",
35
+ "@types/node": "^10.0.3",
36
+ "@typescript-eslint/eslint-plugin": "^3.0.0",
37
+ "@typescript-eslint/parser": "^3.0.0",
35
38
  "c8": "^7.0.0",
36
39
  "chai": "^4.2.0",
37
- "chalk": "^3.0.0",
40
+ "chalk": "^4.0.0",
38
41
  "coveralls": "^3.0.9",
39
42
  "cpr": "^3.0.1",
40
43
  "cross-spawn": "^7.0.0",
41
44
  "es6-promise": "^4.2.5",
45
+ "eslint": "^6.8.0",
46
+ "eslint-plugin-import": "^2.20.1",
47
+ "eslint-plugin-node": "^11.0.0",
48
+ "gts": "^2.0.0-alpha.4",
42
49
  "hashish": "0.0.4",
43
50
  "mocha": "^7.0.0",
44
- "rimraf": "^3.0.0",
45
- "standard": "^14.0.0",
51
+ "rimraf": "^3.0.2",
52
+ "standardx": "^5.0.0",
53
+ "typescript": "^3.7.0",
46
54
  "which": "^2.0.0",
47
55
  "yargs-test-extends": "^1.0.1"
48
56
  },
49
57
  "scripts": {
50
- "fix": "standard --fix",
51
- "posttest": "standard",
58
+ "fix": "standardx --fix && standardx --fix **/*.ts",
59
+ "posttest": "npm run check",
52
60
  "test": "c8 mocha --require ./test/before.js --timeout=12000 --check-leaks",
53
- "coverage": "c8 report --check-coverage"
61
+ "coverage": "c8 report --check-coverage",
62
+ "check": "standardx && standardx **/*.ts",
63
+ "compile": "rimraf build && tsc",
64
+ "prepare": "npm run compile",
65
+ "pretest": "npm run compile -- -p tsconfig.test.json"
54
66
  },
55
67
  "repository": {
56
68
  "type": "git",
57
69
  "url": "https://github.com/yargs/yargs.git"
58
70
  },
59
71
  "homepage": "https://yargs.js.org/",
60
- "standard": {
72
+ "standardx": {
61
73
  "ignore": [
74
+ "build",
62
75
  "**/example/**"
63
76
  ]
64
77
  },