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.
Files changed (2) hide show
  1. package/dist/cli.mjs +10 -11
  2. 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
- function getVersion() {
539
- try {
540
- const packagePath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
541
- return JSON.parse(readFileSync(packagePath, "utf-8")).version ?? "unknown";
542
- } catch {
543
- return "unknown";
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(`lastgen ${getVersion()}\n`);
627
+ process.stdout.write(VERSION + "\n");
629
628
  return;
630
629
  }
631
630
  if (opts.help || !opts.command) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lastgen",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Check if you started coding before or after AI agents",
5
5
  "type": "module",
6
6
  "bin": {