yargs 16.2.0 → 16.2.2

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 (3) hide show
  1. package/package.json +27 -26
  2. package/yargs +5 -9
  3. package/yargs.cjs +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yargs",
3
- "version": "16.2.0",
3
+ "version": "16.2.2",
4
4
  "description": "yargs the modern, pirate-themed, successor to optimist.",
5
5
  "main": "./index.cjs",
6
6
  "exports": {
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "./yargs": [
20
20
  {
21
- "require": "./yargs"
21
+ "require": "./yargs.cjs"
22
22
  },
23
- "./yargs"
23
+ "./yargs.cjs"
24
24
  ]
25
25
  },
26
26
  "type": "module",
@@ -38,6 +38,7 @@
38
38
  "helpers/*",
39
39
  "index.mjs",
40
40
  "yargs",
41
+ "yargs.cjs",
41
42
  "build",
42
43
  "locales",
43
44
  "LICENSE",
@@ -54,34 +55,35 @@
54
55
  "yargs-parser": "^20.2.2"
55
56
  },
56
57
  "devDependencies": {
57
- "@types/chai": "^4.2.11",
58
- "@types/mocha": "^8.0.0",
59
- "@types/node": "^14.11.2",
60
- "@wessberg/rollup-plugin-ts": "^1.3.2",
61
- "c8": "^7.0.0",
62
- "chai": "^4.2.0",
63
- "chalk": "^4.0.0",
64
- "coveralls": "^3.0.9",
65
- "cpr": "^3.0.1",
66
- "cross-env": "^7.0.2",
67
- "cross-spawn": "^7.0.0",
68
- "gts": "^3.0.0",
58
+ "@types/babel__traverse": "7.0.16",
59
+ "@types/chai": "4.2.14",
60
+ "@types/mocha": "8.0.4",
61
+ "@types/node": "14.14.0",
62
+ "@wessberg/rollup-plugin-ts": "1.3.8",
63
+ "chai": "4.2.0",
64
+ "chalk": "4.1.0",
65
+ "coveralls": "3.1.0",
66
+ "cpr": "3.0.1",
67
+ "cross-env": "7.0.2",
68
+ "cross-spawn": "7.0.3",
69
+ "gts": "3.0.3",
69
70
  "hashish": "0.0.4",
70
- "mocha": "^8.0.0",
71
- "rimraf": "^3.0.2",
72
- "rollup": "^2.23.0",
73
- "rollup-plugin-cleanup": "^3.1.1",
71
+ "mocha": "8.2.1",
72
+ "rimraf": "3.0.2",
73
+ "prettier": "2.2.1",
74
+ "rollup": "2.34.1",
75
+ "rollup-plugin-cleanup": "3.2.1",
74
76
  "standardx": "^5.0.0",
75
- "typescript": "^4.0.2",
76
- "which": "^2.0.0",
77
- "yargs-test-extends": "^1.0.1"
77
+ "typescript": "4.1.2",
78
+ "which": "2.0.2",
79
+ "yargs-test-extends": "1.0.1"
78
80
  },
79
81
  "scripts": {
80
82
  "fix": "gts fix && npm run fix:js",
81
83
  "fix:js": "standardx --fix '**/*.mjs' && standardx --fix '**/*.cjs' && standardx --fix './*.mjs' && standardx --fix './*.cjs'",
82
84
  "posttest": "npm run check",
83
- "test": "c8 mocha ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks",
84
- "test:esm": "c8 mocha ./test/esm/*.mjs --check-leaks",
85
+ "test": "mocha ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks",
86
+ "test:esm": "mocha ./test/esm/*.mjs --check-leaks",
85
87
  "coverage": "c8 report --check-coverage",
86
88
  "prepare": "npm run compile",
87
89
  "pretest": "npm run compile -- -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
@@ -89,8 +91,7 @@
89
91
  "postcompile": "npm run build:cjs",
90
92
  "build:cjs": "rollup -c rollup.config.cjs",
91
93
  "postbuild:cjs": "rimraf ./build/index.cjs.d.ts",
92
- "check": "gts lint && npm run check:js",
93
- "check:js": "standardx '**/*.mjs' && standardx '**/*.cjs' && standardx './*.mjs' && standardx './*.cjs'",
94
+ "check": "gts lint",
94
95
  "clean": "gts clean"
95
96
  },
96
97
  "repository": {
package/yargs CHANGED
@@ -1,9 +1,5 @@
1
- // TODO: consolidate on using a helpers file at some point in the future, which
2
- // is the approach currently used to export Parser and applyExtends for ESM:
3
- const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')
4
- Yargs.applyExtends = (config, cwd, mergeExtends) => {
5
- return applyExtends(config, cwd, mergeExtends, cjsPlatformShim)
6
- }
7
- Yargs.hideBin = processArgv.hideBin
8
- Yargs.Parser = Parser
9
- module.exports = Yargs
1
+ // This file gets hit in node versions below node 12.17.0
2
+ // when require('yargs/yargs') from CommonJS
3
+ // because conditional exports not fully supported and treats as filename.
4
+
5
+ module.exports = require('./yargs.cjs');
package/yargs.cjs ADDED
@@ -0,0 +1,15 @@
1
+ // TODO: consolidate on using a helpers file at some point in the future, which
2
+ // is the approach currently used to export Parser and applyExtends for ESM:
3
+ const {
4
+ applyExtends,
5
+ cjsPlatformShim,
6
+ Parser,
7
+ Yargs,
8
+ processArgv,
9
+ } = require('./build/index.cjs');
10
+ Yargs.applyExtends = (config, cwd, mergeExtends) => {
11
+ return applyExtends(config, cwd, mergeExtends, cjsPlatformShim);
12
+ };
13
+ Yargs.hideBin = processArgv.hideBin;
14
+ Yargs.Parser = Parser;
15
+ module.exports = Yargs;