@powerhousedao/ph-cli 6.0.0-dev.57 → 6.0.0-dev.59

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 (112) hide show
  1. package/dist/src/services/connect-build.d.ts.map +1 -1
  2. package/dist/src/services/connect-build.js +5 -5
  3. package/dist/src/services/connect-build.js.map +1 -1
  4. package/dist/src/services/connect-preview.d.ts.map +1 -1
  5. package/dist/src/services/connect-preview.js +5 -5
  6. package/dist/src/services/connect-preview.js.map +1 -1
  7. package/dist/src/services/connect-studio.d.ts +1 -1
  8. package/dist/src/services/connect-studio.d.ts.map +1 -1
  9. package/dist/src/services/connect-studio.js +5 -5
  10. package/dist/src/services/connect-studio.js.map +1 -1
  11. package/dist/src/utils/assign-env-vars.d.ts.map +1 -1
  12. package/dist/src/utils/assign-env-vars.js +1 -1
  13. package/dist/src/utils/assign-env-vars.js.map +1 -1
  14. package/dist/src/utils/resolve-connect-dirs.d.ts +7 -0
  15. package/dist/src/utils/resolve-connect-dirs.d.ts.map +1 -0
  16. package/dist/src/utils/resolve-connect-dirs.js +16 -0
  17. package/dist/src/utils/resolve-connect-dirs.js.map +1 -0
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +13 -21
  20. package/dist/scripts/generate-docs-legacy.d.ts +0 -2
  21. package/dist/scripts/generate-docs-legacy.d.ts.map +0 -1
  22. package/dist/scripts/generate-docs-legacy.js +0 -72
  23. package/dist/scripts/generate-docs-legacy.js.map +0 -1
  24. package/dist/scripts/generate-docs-legacy.ts +0 -84
  25. package/dist/src/cli.old.d.ts +0 -3
  26. package/dist/src/cli.old.d.ts.map +0 -1
  27. package/dist/src/cli.old.js +0 -30
  28. package/dist/src/cli.old.js.map +0 -1
  29. package/dist/src/commands/legacy/access-token.old.d.ts +0 -9
  30. package/dist/src/commands/legacy/access-token.old.d.ts.map +0 -1
  31. package/dist/src/commands/legacy/access-token.old.js +0 -94
  32. package/dist/src/commands/legacy/access-token.old.js.map +0 -1
  33. package/dist/src/commands/legacy/connect.old.d.ts +0 -19
  34. package/dist/src/commands/legacy/connect.old.d.ts.map +0 -1
  35. package/dist/src/commands/legacy/connect.old.js +0 -85
  36. package/dist/src/commands/legacy/connect.old.js.map +0 -1
  37. package/dist/src/commands/legacy/generate.old.d.ts +0 -9
  38. package/dist/src/commands/legacy/generate.old.d.ts.map +0 -1
  39. package/dist/src/commands/legacy/generate.old.js +0 -41
  40. package/dist/src/commands/legacy/generate.old.js.map +0 -1
  41. package/dist/src/commands/legacy/help.old.d.ts +0 -3
  42. package/dist/src/commands/legacy/help.old.d.ts.map +0 -1
  43. package/dist/src/commands/legacy/help.old.js +0 -9
  44. package/dist/src/commands/legacy/help.old.js.map +0 -1
  45. package/dist/src/commands/legacy/inspect.old.d.ts +0 -6
  46. package/dist/src/commands/legacy/inspect.old.d.ts.map +0 -1
  47. package/dist/src/commands/legacy/inspect.old.js +0 -21
  48. package/dist/src/commands/legacy/inspect.old.js.map +0 -1
  49. package/dist/src/commands/legacy/install.old.d.ts +0 -16
  50. package/dist/src/commands/legacy/install.old.d.ts.map +0 -1
  51. package/dist/src/commands/legacy/install.old.js +0 -127
  52. package/dist/src/commands/legacy/install.old.js.map +0 -1
  53. package/dist/src/commands/legacy/list.old.d.ts +0 -9
  54. package/dist/src/commands/legacy/list.old.d.ts.map +0 -1
  55. package/dist/src/commands/legacy/list.old.js +0 -36
  56. package/dist/src/commands/legacy/list.old.js.map +0 -1
  57. package/dist/src/commands/legacy/login.old.d.ts +0 -12
  58. package/dist/src/commands/legacy/login.old.d.ts.map +0 -1
  59. package/dist/src/commands/legacy/login.old.js +0 -193
  60. package/dist/src/commands/legacy/login.old.js.map +0 -1
  61. package/dist/src/commands/legacy/migrate.old.d.ts +0 -11
  62. package/dist/src/commands/legacy/migrate.old.d.ts.map +0 -1
  63. package/dist/src/commands/legacy/migrate.old.js +0 -15
  64. package/dist/src/commands/legacy/migrate.old.js.map +0 -1
  65. package/dist/src/commands/legacy/service.old.d.ts +0 -5
  66. package/dist/src/commands/legacy/service.old.d.ts.map +0 -1
  67. package/dist/src/commands/legacy/service.old.js +0 -67
  68. package/dist/src/commands/legacy/service.old.js.map +0 -1
  69. package/dist/src/commands/legacy/switchboard.old.d.ts +0 -9
  70. package/dist/src/commands/legacy/switchboard.old.d.ts.map +0 -1
  71. package/dist/src/commands/legacy/switchboard.old.js +0 -77
  72. package/dist/src/commands/legacy/switchboard.old.js.map +0 -1
  73. package/dist/src/commands/legacy/uninstall.old.d.ts +0 -15
  74. package/dist/src/commands/legacy/uninstall.old.d.ts.map +0 -1
  75. package/dist/src/commands/legacy/uninstall.old.js +0 -120
  76. package/dist/src/commands/legacy/uninstall.old.js.map +0 -1
  77. package/dist/src/commands/legacy/vetra.old.d.ts +0 -23
  78. package/dist/src/commands/legacy/vetra.old.d.ts.map +0 -1
  79. package/dist/src/commands/legacy/vetra.old.js +0 -35
  80. package/dist/src/commands/legacy/vetra.old.js.map +0 -1
  81. package/dist/src/commands/register-commands.d.ts +0 -5
  82. package/dist/src/commands/register-commands.d.ts.map +0 -1
  83. package/dist/src/commands/register-commands.js +0 -32
  84. package/dist/src/commands/register-commands.js.map +0 -1
  85. package/dist/src/services/legacy/connect.old.d.ts +0 -2
  86. package/dist/src/services/legacy/connect.old.d.ts.map +0 -1
  87. package/dist/src/services/legacy/connect.old.js +0 -2
  88. package/dist/src/services/legacy/connect.old.js.map +0 -1
  89. package/dist/src/services/legacy/generate.old.d.ts +0 -30
  90. package/dist/src/services/legacy/generate.old.d.ts.map +0 -1
  91. package/dist/src/services/legacy/generate.old.js +0 -115
  92. package/dist/src/services/legacy/generate.old.js.map +0 -1
  93. package/dist/src/services/legacy/inspect.old.d.ts +0 -5
  94. package/dist/src/services/legacy/inspect.old.d.ts.map +0 -1
  95. package/dist/src/services/legacy/inspect.old.js +0 -49
  96. package/dist/src/services/legacy/inspect.old.js.map +0 -1
  97. package/dist/src/services/legacy/migrate.old.d.ts +0 -3
  98. package/dist/src/services/legacy/migrate.old.d.ts.map +0 -1
  99. package/dist/src/services/legacy/migrate.old.js +0 -289
  100. package/dist/src/services/legacy/migrate.old.js.map +0 -1
  101. package/dist/src/services/legacy/switchboard.old.d.ts +0 -54
  102. package/dist/src/services/legacy/switchboard.old.d.ts.map +0 -1
  103. package/dist/src/services/legacy/switchboard.old.js +0 -79
  104. package/dist/src/services/legacy/switchboard.old.js.map +0 -1
  105. package/dist/src/services/legacy/vetra.old.d.ts +0 -15
  106. package/dist/src/services/legacy/vetra.old.d.ts.map +0 -1
  107. package/dist/src/services/legacy/vetra.old.js +0 -176
  108. package/dist/src/services/legacy/vetra.old.js.map +0 -1
  109. package/dist/test/utils.test.d.ts +0 -2
  110. package/dist/test/utils.test.d.ts.map +0 -1
  111. package/dist/test/utils.test.js +0 -133
  112. package/dist/test/utils.test.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/ph-cli",
3
- "version": "6.0.0-dev.57",
3
+ "version": "6.0.0-dev.59",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -15,8 +15,7 @@
15
15
  "node": ">=24.0.0"
16
16
  },
17
17
  "bin": {
18
- "ph-cli": "dist/src/cli.js",
19
- "ph-cli-legacy": "dist/src/cli.old.js"
18
+ "ph-cli": "dist/src/cli.js"
20
19
  },
21
20
  "files": [
22
21
  "dist"
@@ -32,47 +31,40 @@
32
31
  "devDependencies": {
33
32
  "@types/node": "25.2.3",
34
33
  "@types/pg": "8.16.0",
35
- "@types/npm-package-arg": "6.1.4",
36
34
  "concurrently": "9.2.1",
37
35
  "copyfiles": "2.4.1",
38
36
  "nodemon": "3.1.11",
39
37
  "vitest": "3.2.4",
40
38
  "@types/bun": "1.3.9",
41
- "document-drive": "6.0.0-dev.57",
42
- "document-model": "6.0.0-dev.57"
39
+ "document-drive": "6.0.0-dev.59",
40
+ "document-model": "6.0.0-dev.59"
43
41
  },
44
42
  "dependencies": {
45
- "chalk": "5.6.2",
46
43
  "cmd-ts": "0.15.0",
47
44
  "colorette": "2.0.20",
48
45
  "commander": "12.1.0",
49
46
  "kysely": "0.28.11",
50
47
  "pg": "8.18.0",
51
- "npm-package-arg": "13.0.2",
52
48
  "package-manager-detector": "1.6.0",
53
49
  "read-pkg": "10.1.0",
54
50
  "ts-morph": "27.0.2",
55
51
  "vite": "7.3.1",
56
52
  "write-package": "7.2.0",
57
- "@powerhousedao/shared": "6.0.0-dev.57",
58
- "@powerhousedao/codegen": "6.0.0-dev.57",
59
- "@powerhousedao/builder-tools": "6.0.0-dev.57",
60
- "@powerhousedao/config": "6.0.0-dev.57",
61
- "@powerhousedao/common": "6.0.0-dev.57",
62
- "@powerhousedao/reactor": "6.0.0-dev.57",
63
- "@powerhousedao/switchboard": "6.0.0-dev.57",
64
- "@renown/sdk": "6.0.0-dev.57"
53
+ "@powerhousedao/codegen": "6.0.0-dev.59",
54
+ "@powerhousedao/common": "6.0.0-dev.59",
55
+ "@powerhousedao/config": "6.0.0-dev.59",
56
+ "@powerhousedao/reactor": "6.0.0-dev.59",
57
+ "@powerhousedao/switchboard": "6.0.0-dev.59",
58
+ "@powerhousedao/shared": "6.0.0-dev.59",
59
+ "@renown/sdk": "6.0.0-dev.59"
65
60
  },
66
61
  "scripts": {
67
62
  "tsc": "tsc",
68
63
  "lint": "eslint",
69
- "generate-docs-legacy": "bun run scripts/generate-docs-legacy.ts",
70
64
  "generate-docs": "bun run scripts/generate-commands-docs.ts",
71
- "build:cli": "bun generate-docs && bun generate-docs-legacy && bun copy-scripts",
65
+ "build:cli": "bun generate-docs && bun copy-scripts",
72
66
  "copy-scripts": "copyfiles scripts/* dist/",
73
67
  "dev": "concurrently -P 'pnpm -w run tsc --watch' 'nodemon --watch \"../..\" -e ts,tsx,js,json dist/src/cli.js -- {@}' --",
74
- "cli": "node ./dist/src/cli.js",
75
- "cli-legacy": "node ./dist/src/cli.old.js",
76
- "test": "vitest --run"
68
+ "cli": "node ./dist/src/cli.js"
77
69
  }
78
70
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=generate-docs-legacy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-docs-legacy.d.ts","sourceRoot":"","sources":["../../scripts/generate-docs-legacy.ts"],"names":[],"mappings":""}
@@ -1,72 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { fileURLToPath } from "url";
4
- /**
5
- * Generate COMMANDS.md file from the help texts in help.ts
6
- */
7
- async function generateCommandsMd() {
8
- try {
9
- // Define paths for ES modules
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = path.dirname(__filename);
12
- const rootDir = path.resolve(__dirname, "..");
13
- const helpFilePath = path.join(rootDir, "src", "help.ts");
14
- const outputPath = path.join(rootDir, "COMMANDS-LEGACY.md");
15
- // Read the help.ts file
16
- const helpFileContent = fs.readFileSync(helpFilePath, "utf8");
17
- // Extract all help text constants using regex
18
- const helpTextRegex = /export const (\w+)Help = `([\s\S]+?)`;/g;
19
- const commands = [];
20
- let match;
21
- while ((match = helpTextRegex.exec(helpFileContent)) !== null) {
22
- const commandName = match[1];
23
- const helpContent = match[2];
24
- commands.push({ name: commandName, content: helpContent });
25
- }
26
- // Sort commands alphabetically
27
- commands.sort((a, b) => a.name.localeCompare(b.name));
28
- // Generate the markdown content
29
- let markdown = "# Powerhouse CLI Commands\n\n";
30
- markdown +=
31
- "This document provides detailed information about the available commands in the Powerhouse CLI.\n\n";
32
- markdown += "## Table of Contents\n\n";
33
- // Add table of contents
34
- commands.forEach((command) => {
35
- const displayName = formatCommandName(command.name);
36
- const anchor = displayName.toLowerCase().replace(/\s+/g, "-");
37
- markdown += `- [${displayName}](#${anchor})\n`;
38
- });
39
- markdown += "\n";
40
- // Add command details
41
- commands.forEach((command) => {
42
- const displayName = formatCommandName(command.name);
43
- markdown += `## ${displayName}\n\n`;
44
- markdown += "```\n";
45
- markdown += command.content.trim();
46
- markdown += "\n```\n\n";
47
- });
48
- // Add footer
49
- markdown += "---\n\n";
50
- markdown +=
51
- "*This document was automatically generated from the help text in the codebase.*\n";
52
- // Write to COMMANDS.md
53
- fs.writeFileSync(outputPath, markdown);
54
- console.log(`✅ COMMANDS.md has been generated at ${outputPath}`);
55
- }
56
- catch (error) {
57
- console.error("Failed to generate COMMANDS.md:", error);
58
- process.exit(1);
59
- }
60
- }
61
- /**
62
- * Format command name for display (e.g., "setupGlobals" -> "Setup Globals")
63
- */
64
- function formatCommandName(commandName) {
65
- // Convert camelCase to separate words with spaces
66
- const name = commandName.replace(/([A-Z])/g, " $1").trim();
67
- // Capitalize first letter and convert the rest to lowercase
68
- return name.charAt(0).toUpperCase() + name.slice(1);
69
- }
70
- // Run the script
71
- generateCommandsMd();
72
- //# sourceMappingURL=generate-docs-legacy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-docs-legacy.js","sourceRoot":"","sources":["../../scripts/generate-docs-legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,KAAK,UAAU,kBAAkB;IAC/B,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAE5D,w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MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACpD,QAAQ,IAAI,MAAM,WAAW,MAAM,CAAC;YACpC,QAAQ,IAAI,OAAO,CAAC;YACpB,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACnC,QAAQ,IAAI,WAAW,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,aAAa;QACb,QAAQ,IAAI,SAAS,CAAC;QACtB,QAAQ;YACN,mFAAmF,CAAC;QAEtF,uBAAuB;QACvB,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEvC,OAAO,CAAC,GAAG,CAAC,uCAAuC,UAAU,EAAE,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,kDAAkD;IAClD,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3D,4DAA4D;IAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,iBAAiB;AACjB,kBAAkB,EAAE,CAAC"}
@@ -1,84 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { fileURLToPath } from "url";
4
-
5
- /**
6
- * Generate COMMANDS.md file from the help texts in help.ts
7
- */
8
- async function generateCommandsMd() {
9
- try {
10
- // Define paths for ES modules
11
- const __filename = fileURLToPath(import.meta.url);
12
- const __dirname = path.dirname(__filename);
13
- const rootDir = path.resolve(__dirname, "..");
14
- const helpFilePath = path.join(rootDir, "src", "help.ts");
15
- const outputPath = path.join(rootDir, "COMMANDS-LEGACY.md");
16
-
17
- // Read the help.ts file
18
- const helpFileContent = fs.readFileSync(helpFilePath, "utf8");
19
-
20
- // Extract all help text constants using regex
21
- const helpTextRegex = /export const (\w+)Help = `([\s\S]+?)`;/g;
22
- const commands: { name: string; content: string }[] = [];
23
-
24
- let match;
25
- while ((match = helpTextRegex.exec(helpFileContent)) !== null) {
26
- const commandName = match[1];
27
- const helpContent = match[2];
28
- commands.push({ name: commandName, content: helpContent });
29
- }
30
-
31
- // Sort commands alphabetically
32
- commands.sort((a, b) => a.name.localeCompare(b.name));
33
-
34
- // Generate the markdown content
35
- let markdown = "# Powerhouse CLI Commands\n\n";
36
- markdown +=
37
- "This document provides detailed information about the available commands in the Powerhouse CLI.\n\n";
38
- markdown += "## Table of Contents\n\n";
39
-
40
- // Add table of contents
41
- commands.forEach((command) => {
42
- const displayName = formatCommandName(command.name);
43
- const anchor = displayName.toLowerCase().replace(/\s+/g, "-");
44
- markdown += `- [${displayName}](#${anchor})\n`;
45
- });
46
-
47
- markdown += "\n";
48
-
49
- // Add command details
50
- commands.forEach((command) => {
51
- const displayName = formatCommandName(command.name);
52
- markdown += `## ${displayName}\n\n`;
53
- markdown += "```\n";
54
- markdown += command.content.trim();
55
- markdown += "\n```\n\n";
56
- });
57
-
58
- // Add footer
59
- markdown += "---\n\n";
60
- markdown +=
61
- "*This document was automatically generated from the help text in the codebase.*\n";
62
-
63
- // Write to COMMANDS.md
64
- fs.writeFileSync(outputPath, markdown);
65
-
66
- console.log(`✅ COMMANDS.md has been generated at ${outputPath}`);
67
- } catch (error) {
68
- console.error("Failed to generate COMMANDS.md:", error);
69
- process.exit(1);
70
- }
71
- }
72
-
73
- /**
74
- * Format command name for display (e.g., "setupGlobals" -> "Setup Globals")
75
- */
76
- function formatCommandName(commandName: string): string {
77
- // Convert camelCase to separate words with spaces
78
- const name = commandName.replace(/([A-Z])/g, " $1").trim();
79
- // Capitalize first letter and convert the rest to lowercase
80
- return name.charAt(0).toUpperCase() + name.slice(1);
81
- }
82
-
83
- // Run the script
84
- generateCommandsMd();
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=cli.old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.old.d.ts","sourceRoot":"","sources":["../../src/cli.old.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env node
2
- import { assertNodeVersion } from "@powerhousedao/common/clis";
3
- import { Command } from "commander";
4
- import { registerCommands } from "./commands/register-commands.js";
5
- console.log("Running legacy ph-cli...");
6
- // Ensure minimum Node.js version
7
- assertNodeVersion();
8
- const program = new Command();
9
- program
10
- .name("ph-cli")
11
- .description("The Powerhouse CLI (ph-cli) is a command-line interface tool that provides essential commands for managing Powerhouse projects. The tool and it's commands are fundamental for creating, building, and running Document Models as a builder in studio mode.")
12
- .allowUnknownOption(true)
13
- .option("--verbose, --debug", "Enable debug mode");
14
- program.version(process.env.WORKSPACE_VERSION || process.env.npm_package_version);
15
- registerCommands(program);
16
- // Logs full error only on debug mode. Otherwise logs only error message
17
- program.parseAsync(process.argv).catch((error) => {
18
- const isDebug = process.argv.find((arg) => ["--verbose", "--debug"].includes(arg));
19
- if (isDebug) {
20
- console.error(error);
21
- return;
22
- }
23
- const errorMessage = error instanceof Error
24
- ? error.message
25
- : typeof error === "string"
26
- ? error
27
- : JSON.stringify(error, null, 2);
28
- console.error(errorMessage);
29
- });
30
- //# sourceMappingURL=cli.old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.old.js","sourceRoot":"","sources":["../../src/cli.old.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAExC,iCAAiC;AACjC,iBAAiB,EAAE,CAAC;AAEpB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CACV,6PAA6P,CAC9P;KACA,kBAAkB,CAAC,IAAI,CAAC;KACxB,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;AAErD,OAAO,CAAC,OAAO,CACb,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAoB,CAClE,CAAC;AAEF,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAE1B,wEAAwE;AACxE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACxC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CACvC,CAAC;IACF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK;QACpB,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;YACzB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEvC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { CommandActionType } from "../../types.js";
3
- export type AccessTokenOptions = {
4
- expiry?: string;
5
- audience?: string;
6
- };
7
- export declare const accessToken: CommandActionType<[AccessTokenOptions]>;
8
- export declare function accessTokenCommand(program: Command): Command;
9
- //# sourceMappingURL=access-token.old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"access-token.old.d.ts","sourceRoot":"","sources":["../../../../src/commands/legacy/access-token.old.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,CAAC,kBAAkB,CAAC,CA0D/D,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAY5D"}
@@ -1,94 +0,0 @@
1
- import { accessTokenHelp } from "../../help.js";
2
- import { setCustomHelp } from "../../utils.js";
3
- const SECONDS_IN_DAY = 24 * 60 * 60;
4
- const DEFAULT_EXPIRY_DAYS = 7;
5
- const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;
6
- /**
7
- * Parse expiry string to seconds
8
- * Supports formats: "7d" (days), "24h" (hours), "3600" (seconds), "3600s" (seconds)
9
- */
10
- function parseExpiry(expiry) {
11
- const trimmed = expiry.trim().toLowerCase();
12
- // Check for day format (e.g., "7d")
13
- if (trimmed.endsWith("d")) {
14
- const days = parseInt(trimmed.slice(0, -1), 10);
15
- if (isNaN(days) || days <= 0) {
16
- throw new Error(`Invalid expiry format: ${expiry}. Days must be a positive number.`);
17
- }
18
- return days * SECONDS_IN_DAY;
19
- }
20
- // Check for hour format (e.g., "24h")
21
- if (trimmed.endsWith("h")) {
22
- const hours = parseInt(trimmed.slice(0, -1), 10);
23
- if (isNaN(hours) || hours <= 0) {
24
- throw new Error(`Invalid expiry format: ${expiry}. Hours must be a positive number.`);
25
- }
26
- return hours * 60 * 60;
27
- }
28
- // Check for seconds format (e.g., "3600s" or just "3600")
29
- const numericValue = trimmed.endsWith("s") ? trimmed.slice(0, -1) : trimmed;
30
- const seconds = parseInt(numericValue, 10);
31
- if (isNaN(seconds) || seconds <= 0) {
32
- throw new Error(`Invalid expiry format: ${expiry}. Expected a positive number or format like "7d", "24h", "3600s".`);
33
- }
34
- return seconds;
35
- }
36
- export const accessToken = async (options) => {
37
- const { getRenown } = await import("../../services/auth.js");
38
- const renown = await getRenown();
39
- const user = renown.user;
40
- // Require Renown authentication - user must have done 'ph login'
41
- if (!user || !user.credential) {
42
- throw new Error("Not authenticated. Run 'ph login' first to authenticate with Renown. A Renown credential is required to generate valid bearer tokens.");
43
- }
44
- const address = user.address;
45
- // Parse expiry
46
- let expiresIn = DEFAULT_EXPIRY_SECONDS;
47
- if (options.expiry) {
48
- try {
49
- expiresIn = parseExpiry(options.expiry);
50
- }
51
- catch (e) {
52
- console.error(e.message);
53
- process.exit(1);
54
- }
55
- }
56
- // Generate the bearer token
57
- const token = await renown.getBearerToken({
58
- expiresIn,
59
- aud: options.audience,
60
- }, true);
61
- // Calculate human-readable expiry
62
- const expiryDays = Math.floor(expiresIn / SECONDS_IN_DAY);
63
- const expiryHours = Math.floor((expiresIn % SECONDS_IN_DAY) / 3600);
64
- let expiryStr;
65
- if (expiryDays > 0) {
66
- expiryStr =
67
- expiryHours > 0
68
- ? `${expiryDays} day${expiryDays > 1 ? "s" : ""} and ${expiryHours} hour${expiryHours > 1 ? "s" : ""}`
69
- : `${expiryDays} day${expiryDays > 1 ? "s" : ""}`;
70
- }
71
- else if (expiryHours > 0) {
72
- expiryStr = `${expiryHours} hour${expiryHours > 1 ? "s" : ""}`;
73
- }
74
- else {
75
- expiryStr = `${expiresIn} seconds`;
76
- }
77
- // Output token info to stderr, token itself to stdout for piping
78
- console.error(`CLI DID: ${renown.did}`);
79
- console.error(`ETH Address: ${address}`);
80
- console.error(`Token expires in: ${expiryStr}`);
81
- console.error("");
82
- // Output just the token to stdout (for easy piping/copying)
83
- console.log(token);
84
- };
85
- export function accessTokenCommand(program) {
86
- const cmd = program
87
- .command("access-token")
88
- .description("Generate a bearer token for API authentication")
89
- .option("--expiry <duration>", `Token expiry duration. Supports: "7d" (days), "24h" (hours), "3600" or "3600s" (seconds). Default: ${DEFAULT_EXPIRY_DAYS}d`)
90
- .option("--audience <url>", "Target audience URL for the token (optional)")
91
- .action(accessToken);
92
- return setCustomHelp(cmd, accessTokenHelp);
93
- }
94
- //# sourceMappingURL=access-token.old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"access-token.old.js","sourceRoot":"","sources":["../../../../src/commands/legacy/access-token.old.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACpC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,sBAAsB,GAAG,mBAAmB,GAAG,cAAc,CAAC;AAEpE;;;GAGG;AACH,SAAS,WAAW,CAAC,MAAc;IACjC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE5C,oCAAoC;IACpC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,0BAA0B,MAAM,mCAAmC,CACpE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,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AW,QAAQ,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACjE,CAAC;SAAM,CAAC;QACN,SAAS,GAAG,GAAG,SAAS,UAAU,CAAC;IACrC,CAAC;IAED,iEAAiE;IACjE,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,KAAK,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,KAAK,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAElB,4DAA4D;IAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,gDAAgD,CAAC;SAC7D,MAAM,CACL,qBAAqB,EACrB,sGAAsG,mBAAmB,GAAG,CAC7H;SACA,MAAM,CAAC,kBAAkB,EAAE,8CAA8C,CAAC;SAC1E,MAAM,CAAC,WAAW,CAAC,CAAC;IAEvB,OAAO,aAAa,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;AAC7C,CAAC"}
@@ -1,19 +0,0 @@
1
- import type { ConnectBuildOptions, ConnectCommonOptions, ConnectPreviewOptions, ConnectStudioOptions } from "@powerhousedao/builder-tools";
2
- import { Command } from "commander";
3
- import type { CommandActionType } from "../../types.js";
4
- type CliConnectCommonOptions = Pick<ConnectCommonOptions, "base" | "mode" | "configFile" | "projectRoot" | "viteConfigFile">;
5
- type CliConnectStudioOptions = ConnectStudioOptions["devServerOptions"] & CliConnectCommonOptions;
6
- type CliConnectBuildOptions = Omit<ConnectBuildOptions, keyof ConnectCommonOptions> & CliConnectCommonOptions;
7
- type CliConnectPreviewOptions = Omit<ConnectPreviewOptions, keyof ConnectCommonOptions> & CliConnectCommonOptions;
8
- export declare const connectStudioCommand: CommandActionType<[
9
- CliConnectStudioOptions
10
- ], void>;
11
- export declare const buildConnectCommand: CommandActionType<[
12
- CliConnectBuildOptions
13
- ], void>;
14
- export declare const previewConnectCommand: CommandActionType<[
15
- CliConnectPreviewOptions
16
- ], void>;
17
- export declare function connectCommand(program: Command): Command;
18
- export {};
19
- //# sourceMappingURL=connect.old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connect.old.d.ts","sourceRoot":"","sources":["../../../../src/commands/legacy/connect.old.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,KAAK,uBAAuB,GAAG,IAAI,CACjC,oBAAoB,EACpB,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,gBAAgB,CAClE,CAAC;AAEF,KAAK,uBAAuB,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,GACrE,uBAAuB,CAAC;AAE1B,KAAK,sBAAsB,GAAG,IAAI,CAChC,mBAAmB,EACnB,MAAM,oBAAoB,CAC3B,GACC,uBAAuB,CAAC;AAE1B,KAAK,wBAAwB,GAAG,IAAI,CAClC,qBAAqB,EACrB,MAAM,oBAAoB,CAC3B,GACC,uBAAuB,CAAC;AAa1B,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAClD;IAAC,uBAAuB;CAAC,EACzB,IAAI,CAGL,CAAC;AA2BF,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,CACjD;IAAC,sBAAsB;CAAC,EACxB,IAAI,CAGL,CAAC;AA0BF,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CACnD;IAAC,wBAAwB;CAAC,EAC1B,IAAI,CAGL,CAAC;AAyBF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,WAQ9C"}
@@ -1,85 +0,0 @@
1
- import { Command } from "commander";
2
- import { connectBuildHelp, connectPreviewHelp, connectStudioHelp, } from "../../help.js";
3
- import { setCustomHelp } from "../../utils.js";
4
- async function startConnectStudio(options = {}) {
5
- const { startConnectStudio } = await import("../../services/legacy/connect.old.js");
6
- const { port, host, open, cors, strictPort, force, ...otherOptions } = options;
7
- return startConnectStudio({
8
- ...otherOptions,
9
- devServerOptions: { port, host, open, cors, strictPort, force },
10
- });
11
- }
12
- export const connectStudioCommand = (options) => {
13
- return startConnectStudio(options);
14
- };
15
- const studioCommand = new Command("studio")
16
- .description("Starts Connect Studio (default)")
17
- .option("--port <port>", "Port to run the server on", "3000")
18
- .option("--host", "Expose the server to the network")
19
- .option("--open", "Open browser on startup")
20
- .option("--cors", `Enable CORS`)
21
- .option("--strictPort", `Exit if specified port is already in use`)
22
- .option("--force", `Force the optimizer to ignore the cache and re-bundle`)
23
- .option("--mode <mode>", `Vite mode to use`)
24
- .option("--config-file <configFile>", "Path to the powerhouse.config.js file")
25
- .option("--vite-config-file <viteConfigFile>", "Path to the vite config file")
26
- .option("--project-root <projectRoot>", "The root directory of the project", process.cwd())
27
- .action(connectStudioCommand);
28
- setCustomHelp(studioCommand, connectStudioHelp);
29
- async function buildConnect(options) {
30
- const { buildConnect } = await import("../../services/legacy/connect.old.js");
31
- return buildConnect(options);
32
- }
33
- export const buildConnectCommand = (options) => {
34
- return buildConnect(options);
35
- };
36
- const buildCommand = new Command("build")
37
- .description("Build Connect project")
38
- .option("--outDir <outDir>", "Output directory. Defaults to '.ph/connect-build/dist/'")
39
- .option("--base <base>", "Base path for the app")
40
- .option("--mode <mode>", `Vite mode to use`)
41
- .option("--config-file <configFile>", "Path to the powerhouse.config.js file")
42
- .option("--vite-config-file <viteConfigFile>", "Path to the vite config file")
43
- .option("--project-root <projectRoot>", "The root directory of the project", process.cwd())
44
- .action(buildConnectCommand);
45
- setCustomHelp(buildCommand, connectBuildHelp);
46
- async function previewConnect(options) {
47
- const { previewConnect } = await import("../../services/legacy/connect.old.js");
48
- return previewConnect(options);
49
- }
50
- export const previewConnectCommand = (options) => {
51
- return previewConnect(options).then();
52
- };
53
- const previewCommand = new Command("preview")
54
- .description("Preview built Connect project")
55
- .option("--outDir <outDir>", "Output directory. Defaults to '.ph/connect-build/dist/'")
56
- .option("--port <port>", "Port to run the server on", "4173")
57
- .option("--host", "Expose the server to the network")
58
- .option("--open", "Open browser on startup")
59
- .option("--strictPort", `Exit if specified port is already in use`)
60
- .option("--base <base>", "Base path for the app")
61
- .option("--mode <mode>", `Vite mode to use`)
62
- .option("--config-file <configFile>", "Path to the powerhouse.config.js file")
63
- .option("--vite-config-file <viteConfigFile>", "Path to the vite config file")
64
- .option("--project-root <projectRoot>", "The root directory of the project", process.cwd())
65
- .action(previewConnectCommand);
66
- setCustomHelp(previewCommand, connectPreviewHelp);
67
- export function connectCommand(program) {
68
- return program
69
- .command("connect")
70
- .description("Powerhouse Connect commands")
71
- .allowUnknownOption(true)
72
- .addCommand(studioCommand, { isDefault: true })
73
- .addCommand(buildCommand)
74
- .addCommand(previewCommand);
75
- }
76
- if (process.argv.at(2) === "spawn") {
77
- const optionsArg = process.argv.at(3);
78
- const options = optionsArg
79
- ? JSON.parse(optionsArg)
80
- : {};
81
- startConnectStudio(options).catch((e) => {
82
- throw e;
83
- });
84
- }
85
- //# sourceMappingURL=connect.old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connect.old.js","sourceRoot":"","sources":["../../../../src/commands/legacy/connect.old.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAsB/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@@ -1,9 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { GenerateOptions } from "../../services/legacy/generate.old.js";
3
- import type { CommandActionType } from "../../types.js";
4
- export declare const generate: CommandActionType<[
5
- string | string[] | undefined,
6
- GenerateOptions
7
- ]>;
8
- export declare function generateCommand(program: Command): void;
9
- //# sourceMappingURL=generate.old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.old.d.ts","sourceRoot":"","sources":["../../../../src/commands/legacy/generate.old.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAcxD,eAAO,MAAM,QAAQ,EAAE,iBAAiB,CACtC;IAAC,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAAE,eAAe;CAAC,CAGjD,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,QA6C/C"}
@@ -1,41 +0,0 @@
1
- import { generateHelp } from "../../help.js";
2
- import { setCustomHelp } from "../../utils.js";
3
- async function startGenerate(filePath, options) {
4
- const Generate = await import("../../services/legacy/generate.old.js");
5
- const { startGenerate } = Generate;
6
- const resolvedPath = Array.isArray(filePath) ? filePath.join(" ") : filePath;
7
- return startGenerate(resolvedPath, options);
8
- }
9
- export const generate = async (filePath, options) => {
10
- return startGenerate(filePath, options);
11
- };
12
- export function generateCommand(program) {
13
- const cmd = program
14
- .command("generate")
15
- .description("Generate code from the document models")
16
- .argument("[document-model-file...]", "Path to the document model file")
17
- .option("-i, --interactive", "Run the command in interactive mode")
18
- .option("--editors <type>", "Path to the editors directory")
19
- .option("-e, --editor <type>", "Editor Name")
20
- .option("--file <path>", "File path to document model")
21
- .option("--processors <type>", "Path to the processors directory")
22
- .option("-p, --processor <type>", "Processor Name")
23
- .option("--processor-type <type>", "Processor Type: 'relationalDb' or 'analytics'")
24
- .option("-s, --subgraph <type>", "Subgraph Name")
25
- .option("--document-models <type>", "Path to the document models directory")
26
- .option("--document-types <type>", "Supported document types by the editor")
27
- .option("-is, --import-script <type>", "Import Script Name")
28
- .option("-sf, --skip-format", "Skip formatting the generated code")
29
- .option("-f, --force", "Overwrite operation reducers")
30
- .option("-w, --watch", "Watch the generated code")
31
- .option("-d, --drive-editor <name>", "Generate a drive editor with the specified name")
32
- .option("--allowed-document-types <types>", "Supported document types for a drive editor")
33
- .option("--migration-file <path>", "Path to the migration file")
34
- .option("--schema-file <path>", "Path to the output file. Defaults to './schema.ts'")
35
- .option("--use-hygen", "Use legacy hygen codegen")
36
- .option("--use-versioning", "Allow upgrading document models with versioning");
37
- // Use the setCustomHelp utility to apply custom help formatting
38
- setCustomHelp(cmd, generateHelp);
39
- cmd.action(generate);
40
- }
41
- //# sourceMappingURL=generate.old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.old.js","sourceRoot":"","sources":["../../../../src/commands/legacy/generate.old.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,KAAK,UAAU,aAAa,CAC1B,QAAuC,EACvC,OAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,uCAAuC,CAAC,CAAC;IACvE,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,OAAO,aAAa,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAEjB,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IA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,CAAC,CAAC;IAEjC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function helpCommand(program: Command): void;
3
- //# sourceMappingURL=help.old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help.old.d.ts","sourceRoot":"","sources":["../../../../src/commands/legacy/help.old.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAO3C"}
@@ -1,9 +0,0 @@
1
- export function helpCommand(program) {
2
- program
3
- .command("help")
4
- .description("Display help information")
5
- .action(() => {
6
- program.help();
7
- });
8
- }
9
- //# sourceMappingURL=help.old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help.old.js","sourceRoot":"","sources":["../../../../src/commands/legacy/help.old.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { InspectOptions } from "../../services/legacy/inspect.old.js";
3
- import type { CommandActionType } from "../../types.js";
4
- export declare const inspect: CommandActionType<[string, InspectOptions]>;
5
- export declare function inspectCommand(program: Command): void;
6
- //# sourceMappingURL=inspect.old.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspect.old.d.ts","sourceRoot":"","sources":["../../../../src/commands/legacy/inspect.old.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASxD,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAK/D,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAU9C"}