v8r 0.8.0 → 0.8.1

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## 📦 [0.8.0](https://www.npmjs.com/package/v8r/v/0.9.0) - 2021-12-25
3
+ ## 📦 [0.8.1](https://www.npmjs.com/package/v8r/v/0.8.1) - 2021-12-25
4
+
5
+ * Fix `--version` flag when installed globally
6
+
7
+ ## 📦 [0.8.0](https://www.npmjs.com/package/v8r/v/0.8.0) - 2021-12-25
4
8
 
5
9
  * Switch from CommonJS to ESModules internally
6
10
  * Requires node `^12.20.0 || ^14.13.1 || >=15.0.0`
package/README.md CHANGED
@@ -12,7 +12,7 @@ A command-line JSON and YAML validator that's on your wavelength.
12
12
 
13
13
  One-off:
14
14
  ```bash
15
- npx v8r <filename>
15
+ npx v8r@latest <filename>
16
16
  ```
17
17
 
18
18
  Local install:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v8r",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "A command-line JSON and YAML validator that's on your wavelength",
5
5
  "scripts": {
6
6
  "test": "V8R_CACHE_NAME=v8r-test c8 --reporter=text mocha \"src/**/*.spec.js\"",
package/src/cli.js CHANGED
@@ -170,6 +170,13 @@ function parseArgs(argv) {
170
170
  yargs.positional("filename", { describe: "Local file to validate" });
171
171
  }
172
172
  )
173
+ .version(
174
+ // Workaround for https://github.com/yargs/yargs/issues/1934
175
+ // TODO: remove once fixed
176
+ JSON.parse(
177
+ fs.readFileSync(new URL("../package.json", import.meta.url).pathname)
178
+ ).version
179
+ )
173
180
  .option("verbose", {
174
181
  alias: "v",
175
182
  type: "boolean",