lastgen 1.2.1 → 1.3.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/cli.mjs +10 -11
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { parseArgs, styleText } from "node:util";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
2
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
import { createServer } from "node:http";
|
|
3
6
|
import { dirname, extname, join } from "node:path";
|
|
4
7
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { createHash } from "node:crypto";
|
|
6
|
-
import { createServer } from "node:http";
|
|
7
8
|
//#region src/core/types.ts
|
|
8
9
|
/**
|
|
9
10
|
* @fileoverview Shared interfaces, constants, and type definitions for lastgen.
|
|
@@ -535,14 +536,12 @@ function serve(port = 3e3) {
|
|
|
535
536
|
/**
|
|
536
537
|
* @fileoverview CLI argument parsing and command routing using built-in parseArgs.
|
|
537
538
|
*/
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
}
|
|
539
|
+
const pkg = createRequire(import.meta.url)("../package.json");
|
|
540
|
+
const buildInfo = [];
|
|
541
|
+
buildInfo.push(`commit: ${"389e4cd7746c6add8cd1a5fae255a7875a3a036d".substring(0, 7)}`);
|
|
542
|
+
buildInfo.push(`built: 2026-03-10T23:44:21+04:00`);
|
|
543
|
+
const buildString = buildInfo.length > 0 ? ` (${buildInfo.join(", ")})` : "";
|
|
544
|
+
const VERSION = `lastgen ${pkg.version}${buildString}`;
|
|
546
545
|
const HELP_BRIEF = `
|
|
547
546
|
_ _
|
|
548
547
|
| | __ _ ___ | |_ __ _ ___ _ __
|
|
@@ -625,7 +624,7 @@ function parseCli(argv) {
|
|
|
625
624
|
async function run(argv) {
|
|
626
625
|
const opts = parseCli(argv);
|
|
627
626
|
if (opts.version) {
|
|
628
|
-
process.stdout.write(
|
|
627
|
+
process.stdout.write(VERSION + "\n");
|
|
629
628
|
return;
|
|
630
629
|
}
|
|
631
630
|
if (opts.help || !opts.command) {
|