@powerhousedao/ph-cli 0.40.54-dev.2 → 0.40.54-dev.3
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/package.json +3 -2
- package/dist/scripts/generate-version.d.ts +2 -0
- package/dist/scripts/generate-version.d.ts.map +1 -0
- package/dist/scripts/generate-version.js +13 -0
- package/dist/scripts/generate-version.js.map +1 -0
- package/dist/src/cli.js +5 -9
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +0 -2
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/version.d.ts +2 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/src/version.js +3 -0
- package/dist/src/version.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/dist/src/commands/version.d.ts +0 -10
- package/dist/src/commands/version.d.ts.map +0 -1
- package/dist/src/commands/version.js +0 -39
- package/dist/src/commands/version.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/ph-cli",
|
|
3
|
-
"version": "0.40.54-dev.
|
|
3
|
+
"version": "0.40.54-dev.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -24,17 +24,18 @@
|
|
|
24
24
|
"colorette": "^2.0.20",
|
|
25
25
|
"commander": "^12.1.0",
|
|
26
26
|
"pm2": "^5.4.3",
|
|
27
|
-
"@powerhousedao/builder-tools": "0.9.32-dev.0",
|
|
28
27
|
"@powerhousedao/codegen": "0.49.3-dev.2",
|
|
28
|
+
"@powerhousedao/builder-tools": "0.9.32-dev.0",
|
|
29
29
|
"@powerhousedao/config": "1.27.0-dev.6",
|
|
30
30
|
"@powerhousedao/connect": "1.0.20-dev.0",
|
|
31
31
|
"document-drive": "1.29.11-dev.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"document-model": "2.28.1-dev.6",
|
|
33
|
+
"@powerhousedao/reactor-local": "1.27.38-dev.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate-commands-md": "tsx scripts/generate-commands-md.ts",
|
|
37
|
-
"
|
|
37
|
+
"generate-version": "tsx scripts/generate-version.ts",
|
|
38
|
+
"prebuild": "npm run generate-commands-md && npm run generate-version",
|
|
38
39
|
"build": "tsc --build",
|
|
39
40
|
"dev": "concurrently -P 'pnpm -w run build:tsc --watch' 'nodemon --watch \"../..\" -e ts,tsx,js,json dist/src/cli.js -- {@}' --",
|
|
40
41
|
"lint": "eslint .",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Command } from "commander";
|
|
2
|
-
import { type CommandActionType } from "../types.js";
|
|
3
|
-
export declare function getVersion(debug: boolean): string;
|
|
4
|
-
export declare const version: CommandActionType<[
|
|
5
|
-
{
|
|
6
|
-
debug?: boolean;
|
|
7
|
-
}
|
|
8
|
-
]>;
|
|
9
|
-
export declare function versionCommand(program: Command): void;
|
|
10
|
-
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,UAoBxC;AAED,eAAO,MAAM,OAAO,EAAE,iBAAiB,CACrC;IACE;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF,CAQF,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAW9C"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { versionHelp } from "../help.js";
|
|
5
|
-
import { findNodeProjectRoot, setCustomHelp } from "../utils.js";
|
|
6
|
-
export function getVersion(debug) {
|
|
7
|
-
const root = findNodeProjectRoot(fileURLToPath(import.meta.url));
|
|
8
|
-
if (debug) {
|
|
9
|
-
console.debug("\n>>> root", root);
|
|
10
|
-
}
|
|
11
|
-
if (!root) {
|
|
12
|
-
throw new Error("Root directory of 'ph-cli' not found.");
|
|
13
|
-
}
|
|
14
|
-
const packageJsonPath = path.join(root, "package.json");
|
|
15
|
-
const file = fs.readFileSync(packageJsonPath, "utf-8");
|
|
16
|
-
const packageJson = JSON.parse(file);
|
|
17
|
-
if (!packageJson.version) {
|
|
18
|
-
throw new Error(`Version not found in packageJsonPath`);
|
|
19
|
-
}
|
|
20
|
-
return packageJson.version;
|
|
21
|
-
}
|
|
22
|
-
export const version = async (options) => {
|
|
23
|
-
if (options.debug) {
|
|
24
|
-
console.log(">>> command arguments", { options });
|
|
25
|
-
}
|
|
26
|
-
const version = getVersion(options.debug ?? false);
|
|
27
|
-
console.log("PH CLI version:", version);
|
|
28
|
-
};
|
|
29
|
-
export function versionCommand(program) {
|
|
30
|
-
const cmd = program
|
|
31
|
-
.command("version")
|
|
32
|
-
.alias("v")
|
|
33
|
-
.description("Display the current version of the PH CLI.")
|
|
34
|
-
.option("--debug", "Show additional logs");
|
|
35
|
-
// Use the setCustomHelp utility to apply custom help formatting
|
|
36
|
-
setCustomHelp(cmd, versionHelp);
|
|
37
|
-
cmd.action(version);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/commands/version.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,C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