ph-cmd 0.35.1 → 0.35.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.
@@ -20,7 +20,8 @@ var PH_CLI_COMMANDS = [
20
20
  "uninstall",
21
21
  "service",
22
22
  "list",
23
- "inspect"
23
+ "inspect",
24
+ "version"
24
25
  ];
25
26
  var POWERHOUSE_CONFIG_FILE = "powerhouse.config.json";
26
27
  var HOME_DIR = homedir();
@@ -110,9 +111,9 @@ function getProjectInfo(debug) {
110
111
  path: projectPath
111
112
  };
112
113
  }
113
- function forwardPHCommand(packageManager, projectPath, args, isPackageScript, debug) {
114
+ function forwardPHCommand(packageManager, projectPath, args, debug) {
114
115
  const manager = packageManagers[packageManager];
115
- const command = isPackageScript ? manager.execScript : manager.execCommand;
116
+ const command = manager.execCommand;
116
117
  const execCommand = command.replace("{{arguments}}", args);
117
118
  const commandOptions = { cwd: projectPath };
118
119
  if (debug) {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5HAGY755.js";
4
4
  import {
5
5
  setupGlobalsCommand
6
- } from "./chunk-S7QYZX4U.js";
6
+ } from "./chunk-T4ZL4HJX.js";
7
7
 
8
8
  // src/commands/index.ts
9
9
  var commands = [setupGlobalsCommand, initCommand];
@@ -2,7 +2,7 @@ import {
2
2
  forwardPHCommand,
3
3
  getPackageManagerFromLockfile,
4
4
  getProjectInfo
5
- } from "./chunk-E2HJIPXL.js";
5
+ } from "./chunk-C5WXBZBP.js";
6
6
 
7
7
  // src/commands/forward.ts
8
8
  var forwardCommand = (args, options) => {
@@ -19,22 +19,17 @@ var forwardCommand = (args, options) => {
19
19
  console.log(">>> packageManager:", packageManager);
20
20
  console.log(">>> projectPath:", projectInfo.path);
21
21
  console.log(">>> args:", args);
22
- console.log(">>> isPackageScript:", options.isPackageScript ?? false);
23
22
  }
24
23
  try {
25
- forwardPHCommand(
26
- packageManager,
27
- projectInfo.path,
28
- args,
29
- options.isPackageScript ?? false,
30
- options.debug
31
- );
24
+ forwardPHCommand(packageManager, projectInfo.path, args, options.debug);
32
25
  } catch (error) {
33
26
  console.error("\u274C Failed to forward command");
34
27
  if (error.code === "ENOENT") {
35
28
  console.error("Have you run `ph setup-globals` or `ph init`?");
36
29
  }
37
- throw error;
30
+ if (options.debug) {
31
+ throw error;
32
+ }
38
33
  }
39
34
  };
40
35
 
@@ -4,7 +4,7 @@ import {
4
4
  PH_GLOBAL_PROJECT_NAME,
5
5
  POWERHOUSE_GLOBAL_DIR,
6
6
  getPackageManagerFromPath
7
- } from "./chunk-E2HJIPXL.js";
7
+ } from "./chunk-C5WXBZBP.js";
8
8
 
9
9
  // src/commands/setup-globals.ts
10
10
  import { createProject, parseVersion } from "@powerhousedao/codegen";
package/dist/cli.js CHANGED
@@ -1,27 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  forwardCommand
4
- } from "./chunk-AI5ZRXRH.js";
4
+ } from "./chunk-EGOEXVWG.js";
5
5
  import {
6
6
  registerCommands
7
- } from "./chunk-VE7YEAW3.js";
7
+ } from "./chunk-E325LGZJ.js";
8
8
  import "./chunk-5HAGY755.js";
9
- import "./chunk-S7QYZX4U.js";
10
- import {
11
- PH_CLI_COMMANDS
12
- } from "./chunk-E2HJIPXL.js";
9
+ import "./chunk-T4ZL4HJX.js";
10
+ import "./chunk-C5WXBZBP.js";
13
11
 
14
12
  // src/cli.ts
15
13
  import { Command } from "commander";
16
14
  var program = new Command();
17
15
  var defaultCommand = (options) => {
18
16
  const allArgs = process.argv.slice(2);
19
- const filteredArgs = allArgs.filter((arg) => arg !== "--verbose").filter((arg) => arg !== "--script");
20
- const command = filteredArgs.at(0);
21
- const isPackageScript = options.script ?? !PH_CLI_COMMANDS.includes(command ?? "");
17
+ const filteredArgs = allArgs.filter((arg) => arg !== "--verbose");
22
18
  const args = filteredArgs.join(" ");
23
- forwardCommand(args, { debug: !!options.verbose, isPackageScript });
19
+ forwardCommand(args, { debug: !!options.verbose });
24
20
  };
25
- program.name("ph-cmd").description("CLI tool for Powerhouse DAO").allowUnknownOption().option("--verbose", "Enable debug mode").option("--script", "Run the command as a package.json script").action(defaultCommand).version("0.35.1");
21
+ program.name("ph-cmd").description("CLI tool for Powerhouse DAO").allowUnknownOption().option("--verbose", "Enable debug mode").action(defaultCommand);
26
22
  registerCommands(program);
27
23
  program.parse(process.argv);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  forwardCommand
3
- } from "../chunk-AI5ZRXRH.js";
4
- import "../chunk-E2HJIPXL.js";
3
+ } from "../chunk-EGOEXVWG.js";
4
+ import "../chunk-C5WXBZBP.js";
5
5
  export {
6
6
  forwardCommand
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  commands,
3
3
  registerCommands
4
- } from "../chunk-VE7YEAW3.js";
4
+ } from "../chunk-E325LGZJ.js";
5
5
  import {
6
6
  init,
7
7
  initCommand
@@ -9,8 +9,8 @@ import {
9
9
  import {
10
10
  setupGlobals,
11
11
  setupGlobalsCommand
12
- } from "../chunk-S7QYZX4U.js";
13
- import "../chunk-E2HJIPXL.js";
12
+ } from "../chunk-T4ZL4HJX.js";
13
+ import "../chunk-C5WXBZBP.js";
14
14
  export {
15
15
  commands,
16
16
  registerCommands as default,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  setupGlobals,
3
3
  setupGlobalsCommand
4
- } from "../chunk-S7QYZX4U.js";
5
- import "../chunk-E2HJIPXL.js";
4
+ } from "../chunk-T4ZL4HJX.js";
5
+ import "../chunk-C5WXBZBP.js";
6
6
  export {
7
7
  setupGlobals,
8
8
  setupGlobalsCommand
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  commands
3
- } from "./chunk-VE7YEAW3.js";
3
+ } from "./chunk-E325LGZJ.js";
4
4
  import {
5
5
  init,
6
6
  initCommand
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  setupGlobals,
10
10
  setupGlobalsCommand
11
- } from "./chunk-S7QYZX4U.js";
11
+ } from "./chunk-T4ZL4HJX.js";
12
12
  import {
13
13
  HOME_DIR,
14
14
  PH_BIN,
@@ -25,7 +25,7 @@ import {
25
25
  getProjectInfo,
26
26
  isPowerhouseProject,
27
27
  packageManagers
28
- } from "./chunk-E2HJIPXL.js";
28
+ } from "./chunk-C5WXBZBP.js";
29
29
  export {
30
30
  HOME_DIR,
31
31
  PH_BIN,
package/dist/utils.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  getProjectInfo,
15
15
  isPowerhouseProject,
16
16
  packageManagers
17
- } from "./chunk-E2HJIPXL.js";
17
+ } from "./chunk-C5WXBZBP.js";
18
18
  export {
19
19
  HOME_DIR,
20
20
  PH_BIN,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ph-cmd",
3
- "version": "0.35.1",
3
+ "version": "0.35.3",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -17,8 +17,8 @@
17
17
  "author": "",
18
18
  "dependencies": {
19
19
  "commander": "^12.1.0",
20
- "@powerhousedao/scalars": "1.25.0",
21
- "@powerhousedao/codegen": "0.37.1"
20
+ "@powerhousedao/codegen": "0.37.1",
21
+ "@powerhousedao/scalars": "1.25.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "tsup": "^8.3.6"