@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.
- package/dist/run.js +7 -1
- 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
|
-
|
|
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
|
*
|