@forgecart/cli 2.1.0 → 2.1.2
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/src/cli.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* CLI version, read from `package.json` (the single source of truth) so the
|
|
4
|
+
* `--version` output can never drift from the published version.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CLI_VERSION: string;
|
|
4
7
|
/**
|
|
5
8
|
* Build the `forgecart` commander program with the full command surface.
|
|
6
9
|
*
|
package/dist/src/cli.js
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
1
4
|
import { Command } from 'commander';
|
|
2
5
|
import { createInitCommand } from './commands/init.js';
|
|
3
6
|
import { createDeleteCommand, createDeployCommand, createEnvCommand, createInitApplicationCommand, createListCommand, createLogsCommand, createScaleCommand, createStatusCommand, createWhoamiCommand, } from './commands/placeholders.js';
|
|
4
7
|
import { printError } from './output.js';
|
|
5
|
-
/**
|
|
6
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the package manifest from this module's location. The depth differs
|
|
10
|
+
* by layout — `src/cli.ts` (dev) sits one level below the package root,
|
|
11
|
+
* `dist/src/cli.js` (published) two — and `dist/` never contains a
|
|
12
|
+
* `package.json`, so the first existing candidate is always the right one.
|
|
13
|
+
*/
|
|
14
|
+
function readPackageVersion() {
|
|
15
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const candidates = [
|
|
17
|
+
path.join(here, '..', 'package.json'),
|
|
18
|
+
path.join(here, '..', '..', 'package.json'),
|
|
19
|
+
];
|
|
20
|
+
const manifest = candidates.find((candidate) => fs.existsSync(candidate));
|
|
21
|
+
if (!manifest) {
|
|
22
|
+
throw new Error(`package.json not found near ${here}; cannot resolve the CLI version.`);
|
|
23
|
+
}
|
|
24
|
+
return JSON.parse(fs.readFileSync(manifest, 'utf-8')).version;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* CLI version, read from `package.json` (the single source of truth) so the
|
|
28
|
+
* `--version` output can never drift from the published version.
|
|
29
|
+
*/
|
|
30
|
+
export const CLI_VERSION = readPackageVersion();
|
|
7
31
|
/**
|
|
8
32
|
* Build the `forgecart` commander program with the full command surface.
|
|
9
33
|
*
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAm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