@basou/cli 0.44.0 → 0.45.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.
- package/dist/index.js +421 -152
- package/dist/index.js.map +1 -1
- package/dist/program.d.ts +33 -1
- package/dist/program.js +423 -152
- package/dist/program.js.map +1 -1
- package/package.json +2 -2
package/dist/program.d.ts
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
|
|
3
|
+
type BuildStamp = {
|
|
4
|
+
version: string;
|
|
5
|
+
commit: string;
|
|
6
|
+
committedAt: string;
|
|
7
|
+
};
|
|
8
|
+
/** The build's own record of itself, or `undefined` when running from source. */
|
|
9
|
+
declare const BASOU_BUILD: BuildStamp | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The version of the code that is RUNNING.
|
|
12
|
+
*
|
|
13
|
+
* This used to read `package.json` at runtime, on the reasoning that a constant
|
|
14
|
+
* could go stale past a package bump — true, and it fixed that. But it answers
|
|
15
|
+
* with what the SOURCE says, and source moves without a rebuild: `git pull` or
|
|
16
|
+
* `git checkout` leaves `dist` untouched while `package.json` advances. One
|
|
17
|
+
* workspace ran a build a release and a half behind for a full day while
|
|
18
|
+
* `--version` confidently reported the newest release, because the built code
|
|
19
|
+
* and the number it printed came from different places.
|
|
20
|
+
*
|
|
21
|
+
* So the built bundle answers from its own stamp, and only a source checkout —
|
|
22
|
+
* where the source IS the running code — falls back to `package.json`. Neither
|
|
23
|
+
* reading can now disagree with what is executing.
|
|
24
|
+
*/
|
|
3
25
|
declare const BASOU_CLI_VERSION: string;
|
|
26
|
+
/**
|
|
27
|
+
* What `--version` prints. The version stays the FIRST token, so anything
|
|
28
|
+
* parsing the old single-line output with `cut`/`awk` keeps working, and the
|
|
29
|
+
* build identity follows it.
|
|
30
|
+
*
|
|
31
|
+
* The commit is the part that carries the information: two builds of the same
|
|
32
|
+
* version number are exactly the case that went unnoticed, and the version
|
|
33
|
+
* alone cannot tell them apart.
|
|
34
|
+
*/
|
|
35
|
+
declare const BASOU_VERSION_LINE: string;
|
|
4
36
|
/**
|
|
5
37
|
* Build the fully-registered `basou` command tree WITHOUT parsing argv.
|
|
6
38
|
*
|
|
@@ -12,4 +44,4 @@ declare const BASOU_CLI_VERSION: string;
|
|
|
12
44
|
*/
|
|
13
45
|
declare function buildProgram(): Command;
|
|
14
46
|
|
|
15
|
-
export { BASOU_CLI_VERSION, buildProgram };
|
|
47
|
+
export { BASOU_BUILD, BASOU_CLI_VERSION, BASOU_VERSION_LINE, buildProgram };
|