@pungoyal/kite-cli 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/run.js +7 -1
  2. package/package.json +1 -1
package/dist/run.js CHANGED
@@ -1,9 +1,15 @@
1
+ import { readFileSync } from 'node:fs';
1
2
  import { Command, CommanderError } from 'commander';
2
3
  import { createContext } from './context.js';
3
4
  import { AbortedError, ExitCode, KiteCliError } from './core/errors.js';
4
5
  import { redactString } from './core/redact.js';
5
6
  import { Io } from './output/io.js';
6
- const VERSION = '0.1.0';
7
+ // Read from package.json so `npm version` is the single source of truth and
8
+ // `kite --version` can never drift. `../package.json` resolves to the package
9
+ // root from source (tests) and from dist/ (published), since package.json always
10
+ // ships with the package.
11
+ const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
12
+ .version;
7
13
  /**
8
14
  * Build and execute the CLI.
9
15
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pungoyal/kite-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Unofficial command-line interface for the Zerodha Kite Connect API — not affiliated with or endorsed by Zerodha",
5
5
  "keywords": [
6
6
  "zerodha",