@powerhousedao/ph-cli 6.2.3-dev.15 → 6.2.3-dev.17

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 (35) hide show
  1. package/dist/cli.mjs +150 -17
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/generate-piece-B8Kbsshu.mjs +61 -0
  4. package/dist/generate-piece-B8Kbsshu.mjs.map +1 -0
  5. package/dist/generate-piece-action-DZ14j8Gi.mjs +26 -0
  6. package/dist/generate-piece-action-DZ14j8Gi.mjs.map +1 -0
  7. package/dist/generate-piece-trigger-CvzZOIPh.mjs +27 -0
  8. package/dist/generate-piece-trigger-CvzZOIPh.mjs.map +1 -0
  9. package/dist/{generate-processor-_WOx-mMe.mjs → generate-processor-BK7moaDe.mjs} +3 -3
  10. package/dist/{generate-processor-_WOx-mMe.mjs.map → generate-processor-BK7moaDe.mjs.map} +1 -1
  11. package/dist/{generate-subgraph-BsHUstpl.mjs → generate-subgraph-CCXHyg4b.mjs} +3 -3
  12. package/dist/{generate-subgraph-BsHUstpl.mjs.map → generate-subgraph-CCXHyg4b.mjs.map} +1 -1
  13. package/dist/{init-BZP6gvYd.mjs → init-B3Tp7X17.mjs} +4 -4
  14. package/dist/{init-BZP6gvYd.mjs.map → init-B3Tp7X17.mjs.map} +1 -1
  15. package/dist/{inspect-C51aBFiq.mjs → inspect-B8eX-XPA.mjs} +4 -4
  16. package/dist/{inspect-C51aBFiq.mjs.map → inspect-B8eX-XPA.mjs.map} +1 -1
  17. package/dist/{migrate-jGKfE02L.mjs → migrate-CM_3Luws.mjs} +3 -3
  18. package/dist/{migrate-jGKfE02L.mjs.map → migrate-CM_3Luws.mjs.map} +1 -1
  19. package/dist/{registry-auth-DxEWCJu2.mjs → registry-auth-C9en-6FX.mjs} +3 -3
  20. package/dist/{registry-auth-DxEWCJu2.mjs.map → registry-auth-C9en-6FX.mjs.map} +1 -1
  21. package/dist/scripts/generate-commands-docs.ts +6 -0
  22. package/dist/{switchboard-CJMoMzWx.mjs → switchboard-Cabg_xYF.mjs} +3 -3
  23. package/dist/{switchboard-CJMoMzWx.mjs.map → switchboard-Cabg_xYF.mjs.map} +1 -1
  24. package/dist/switchboard-DTJkt8lG.mjs +4 -0
  25. package/dist/{switchboard-migrate-NQ7LHWSi.mjs → switchboard-migrate-RN3lGK4Q.mjs} +3 -3
  26. package/dist/{switchboard-migrate-NQ7LHWSi.mjs.map → switchboard-migrate-RN3lGK4Q.mjs.map} +1 -1
  27. package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-BWLfgYuv.mjs} +3 -3
  28. package/dist/{switchboard-reset-BcQXlcVf.mjs.map → switchboard-reset-BWLfgYuv.mjs.map} +1 -1
  29. package/dist/{utils-BzwczAW-.mjs → utils-B6flWWiG.mjs} +3 -3
  30. package/dist/{utils-C4isxXSO.mjs → utils-jTHrApMW.mjs} +3 -3
  31. package/dist/{utils-C4isxXSO.mjs.map → utils-jTHrApMW.mjs.map} +1 -1
  32. package/dist/{vetra-CMrdPGVJ.mjs → vetra-DCD3t7Qh.mjs} +5 -5
  33. package/dist/{vetra-CMrdPGVJ.mjs.map → vetra-DCD3t7Qh.mjs.map} +1 -1
  34. package/package.json +11 -11
  35. package/dist/switchboard-iRFugh8I.mjs +0 -4
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="52da3f87-0474-5ba1-90c7-7f6d6b7a8b1f")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="61a4e538-407a-541a-bdb1-5323d64da65e")}catch(e){}}();
4
4
  import { initCliTelemetry } from "@powerhousedao/shared/clis/telemetry";
5
5
  import { assertNodeVersion } from "@powerhousedao/shared/clis/utils";
6
- import { boolean, command, flag, multioption, oneOf, option, optional, run, string, subcommands } from "cmd-ts";
6
+ import { boolean, command, flag, multioption, oneOf, option, optional, positional, run, string, subcommands } from "cmd-ts";
7
7
  import { AGENTS, accessTokenArgs, buildArgs, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, initArgs, inspectArgs, installArgs, listArgs, loginArgs, migrateArgs, phCliHelpCommands, publishArgs, registryLoginArgs, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs } from "@powerhousedao/shared/clis/args";
8
8
  import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
9
9
  import { Directory, File } from "cmd-ts/dist/cjs/batteries/fs.js";
@@ -15,7 +15,7 @@ import { createInterface } from "node:readline/promises";
15
15
  import { bold, yellow } from "colorette";
16
16
  //#region src/get-version.ts
17
17
  function getVersion() {
18
- return "6.2.3-dev.15";
18
+ return "6.2.3-dev.17";
19
19
  }
20
20
  //#endregion
21
21
  //#region src/utils/constants.ts
@@ -391,6 +391,136 @@ const generateMigrationFileCmd = command({
391
391
  process.exit(0);
392
392
  }
393
393
  });
394
+ //#endregion
395
+ //#region src/commands/generate-piece-action.ts
396
+ const generatePieceActionCmd = command({
397
+ name: "piece-action",
398
+ description: "Generate an action inside an existing piece",
399
+ args: {
400
+ namePositional: positional({
401
+ type: optional(string),
402
+ displayName: "name",
403
+ description: "The name of the action, e.g. get-record"
404
+ }),
405
+ name: option({
406
+ type: optional(string),
407
+ long: "name",
408
+ short: "n",
409
+ description: "The name of the action to generate"
410
+ }),
411
+ piece: option({
412
+ type: optional(string),
413
+ long: "piece",
414
+ short: "p",
415
+ description: "The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece."
416
+ }),
417
+ ...debugArgs
418
+ },
419
+ handler: async (args) => {
420
+ const { startGeneratePieceAction } = await import("./generate-piece-action-DZ14j8Gi.mjs");
421
+ await startGeneratePieceAction(args, process.cwd());
422
+ process.exit(0);
423
+ }
424
+ });
425
+ //#endregion
426
+ //#region src/commands/generate-piece-trigger.ts
427
+ const generatePieceTriggerCmd = command({
428
+ name: "piece-trigger",
429
+ description: "Generate a trigger inside an existing piece",
430
+ args: {
431
+ namePositional: positional({
432
+ type: optional(string),
433
+ displayName: "name",
434
+ description: "The name of the trigger, e.g. new-record"
435
+ }),
436
+ name: option({
437
+ type: optional(string),
438
+ long: "name",
439
+ short: "n",
440
+ description: "The name of the trigger to generate"
441
+ }),
442
+ piece: option({
443
+ type: optional(string),
444
+ long: "piece",
445
+ short: "p",
446
+ description: "The piece directory under pieces/ to add the trigger to. Optional when the project ships exactly one piece."
447
+ }),
448
+ strategy: option({
449
+ type: oneOf(["polling", "webhook"]),
450
+ long: "strategy",
451
+ description: "How the trigger fires: polled on a schedule, or delivered to a webhook",
452
+ defaultValue: () => "polling",
453
+ defaultValueIsSerializable: true
454
+ }),
455
+ ...debugArgs
456
+ },
457
+ handler: async (args) => {
458
+ const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-CvzZOIPh.mjs");
459
+ await startGeneratePieceTrigger(args, process.cwd());
460
+ process.exit(0);
461
+ }
462
+ });
463
+ //#endregion
464
+ //#region src/commands/generate-piece.ts
465
+ const generatePieceCmd = command({
466
+ name: "piece",
467
+ description: "Generate a piece: a connector whose actions and triggers a workflow can call",
468
+ args: {
469
+ namePositional: positional({
470
+ type: optional(string),
471
+ displayName: "name",
472
+ description: "The name of the piece to generate. Its directory is the kebab-case of this."
473
+ }),
474
+ name: option({
475
+ type: optional(string),
476
+ long: "name",
477
+ short: "n",
478
+ description: "The name of the piece to generate"
479
+ }),
480
+ id: option({
481
+ type: optional(string),
482
+ long: "id",
483
+ description: "The piece id a workflow block type names, e.g. @acme/piece-crm. Defaults to one derived from the package name."
484
+ }),
485
+ pieceVersion: option({
486
+ type: optional(string),
487
+ long: "piece-version",
488
+ description: "The version the pieces list declares. Defaults to the package version when the piece is named after the package, else 1.0.0."
489
+ }),
490
+ auth: option({
491
+ type: oneOf([
492
+ "none",
493
+ "secret",
494
+ "custom"
495
+ ]),
496
+ long: "auth",
497
+ description: "The kind of connection the piece asks for",
498
+ defaultValue: () => "custom",
499
+ defaultValueIsSerializable: true
500
+ }),
501
+ description: option({
502
+ type: optional(string),
503
+ long: "description",
504
+ description: "One line describing what the piece connects to"
505
+ }),
506
+ dir: option({
507
+ type: optional(Directory),
508
+ long: "dir",
509
+ description: "Name of the directory of an existing piece to re-register"
510
+ }),
511
+ all: flag({
512
+ long: "all",
513
+ short: "a",
514
+ description: "Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone"
515
+ }),
516
+ ...debugArgs
517
+ },
518
+ handler: async (args) => {
519
+ const { startGeneratePiece } = await import("./generate-piece-B8Kbsshu.mjs");
520
+ await startGeneratePiece(args, process.cwd());
521
+ process.exit(0);
522
+ }
523
+ });
394
524
  const generateProcessorCmd = command({
395
525
  name: "processor",
396
526
  description: "Generate a processor",
@@ -454,7 +584,7 @@ const generateProcessorCmd = command({
454
584
  ...debugArgs
455
585
  },
456
586
  handler: async (args) => {
457
- const { startGenerateProcessor } = await import("./generate-processor-_WOx-mMe.mjs");
587
+ const { startGenerateProcessor } = await import("./generate-processor-BK7moaDe.mjs");
458
588
  await startGenerateProcessor(args, process.cwd());
459
589
  process.exit(0);
460
590
  }
@@ -495,7 +625,7 @@ const generateSubgraphCmd = command({
495
625
  ...debugArgs
496
626
  },
497
627
  handler: async (args) => {
498
- const { startGenerateSubgraph } = await import("./generate-subgraph-BsHUstpl.mjs");
628
+ const { startGenerateSubgraph } = await import("./generate-subgraph-CCXHyg4b.mjs");
499
629
  await startGenerateSubgraph(args, process.cwd());
500
630
  process.exit(0);
501
631
  }
@@ -512,6 +642,9 @@ const generate = subcommands({
512
642
  app: generateAppCmd,
513
643
  processor: generateProcessorCmd,
514
644
  subgraph: generateSubgraphCmd,
645
+ piece: generatePieceCmd,
646
+ "piece-action": generatePieceActionCmd,
647
+ "piece-trigger": generatePieceTriggerCmd,
515
648
  "migration-file": generateMigrationFileCmd
516
649
  }
517
650
  });
@@ -523,7 +656,7 @@ const init = command({
523
656
  args: initArgs,
524
657
  handler: async (args) => {
525
658
  if (args.debug) console.log({ args });
526
- const { startInit } = await import("./init-BZP6gvYd.mjs");
659
+ const { startInit } = await import("./init-B3Tp7X17.mjs");
527
660
  await startInit(args);
528
661
  process.exit(0);
529
662
  }
@@ -546,7 +679,7 @@ This command:
546
679
  args: inspectArgs,
547
680
  handler: async (args) => {
548
681
  if (args.debug) console.log(args);
549
- const { startInspect } = await import("./inspect-C51aBFiq.mjs");
682
+ const { startInspect } = await import("./inspect-B8eX-XPA.mjs");
550
683
  startInspect(args);
551
684
  process.exit(0);
552
685
  }
@@ -625,7 +758,7 @@ Resolution order for the registry URL:
625
758
  throw error;
626
759
  }
627
760
  }
628
- const { updateConfigFile, updateStylesFile } = await import("./utils-BzwczAW-.mjs");
761
+ const { updateConfigFile, updateStylesFile } = await import("./utils-B6flWWiG.mjs");
629
762
  try {
630
763
  console.log("⚙️ Updating powerhouse config file...");
631
764
  updateConfigFile(dependenciesWithVersions, projectPath, "install", args.local ? "local" : "registry", registryUrl, args.registry !== void 0);
@@ -802,7 +935,7 @@ const migrate = command({
802
935
  description: "Run migrations",
803
936
  handler: async (args) => {
804
937
  if (args.debug) console.log(args);
805
- const { startMigrate } = await import("./migrate-jGKfE02L.mjs");
938
+ const { startMigrate } = await import("./migrate-CM_3Luws.mjs");
806
939
  await startMigrate(args);
807
940
  process.exit(0);
808
941
  }
@@ -850,7 +983,7 @@ This command:
850
983
  const { projectPath } = await getPowerhouseProjectInfo();
851
984
  if (!projectPath) throw new Error("Could not find project path.");
852
985
  const { checkNpmAuth, npmPublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
853
- const { mintRegistryAuthToken } = await import("./registry-auth-DxEWCJu2.mjs");
986
+ const { mintRegistryAuthToken } = await import("./registry-auth-C9en-6FX.mjs");
854
987
  const registryUrl = resolveRegistryUrl({
855
988
  registry: args.registry,
856
989
  projectPath
@@ -940,7 +1073,7 @@ Usage:
940
1073
  const projectPath = (await getPowerhouseProjectInfo().catch(() => null))?.projectPath ?? process.cwd();
941
1074
  const [{ resolveRegistryUrl, writeRegistryAuthToken }, { mintRegistryAuthToken }, { parseExpiry, formatExpiry }] = await Promise.all([
942
1075
  import("@powerhousedao/shared/registry"),
943
- import("./registry-auth-DxEWCJu2.mjs"),
1076
+ import("./registry-auth-C9en-6FX.mjs"),
944
1077
  import("@renown/sdk/node")
945
1078
  ]);
946
1079
  const registryUrl = resolveRegistryUrl({
@@ -977,7 +1110,7 @@ This command:
977
1110
  const { basePath, dbPath, migrate, migrateStatus, reset, yes } = args;
978
1111
  if (basePath) process.env.BASE_PATH = basePath;
979
1112
  if (reset) {
980
- const { resetSwitchboardDatabase } = await import("./switchboard-reset-BcQXlcVf.mjs");
1113
+ const { resetSwitchboardDatabase } = await import("./switchboard-reset-BWLfgYuv.mjs");
981
1114
  await resetSwitchboardDatabase({
982
1115
  dbPath,
983
1116
  yes
@@ -985,14 +1118,14 @@ This command:
985
1118
  process.exit(0);
986
1119
  }
987
1120
  if (migrate || migrateStatus) {
988
- const { runSwitchboardMigrations } = await import("./switchboard-migrate-NQ7LHWSi.mjs");
1121
+ const { runSwitchboardMigrations } = await import("./switchboard-migrate-RN3lGK4Q.mjs");
989
1122
  await runSwitchboardMigrations({
990
1123
  dbPath,
991
1124
  statusOnly: migrateStatus
992
1125
  });
993
1126
  process.exit(0);
994
1127
  }
995
- const { startSwitchboard } = await import("./switchboard-iRFugh8I.mjs");
1128
+ const { startSwitchboard } = await import("./switchboard-DTJkt8lG.mjs");
996
1129
  const { defaultDriveUrl, renown } = await startSwitchboard(args);
997
1130
  console.log(" ➜ Switchboard:", defaultDriveUrl);
998
1131
  if (renown) console.log(" ➜ Identity:", renown.did);
@@ -1038,7 +1171,7 @@ This command:
1038
1171
  console.error("❌ Failed to uninstall dependencies");
1039
1172
  throw error;
1040
1173
  }
1041
- const { removeStylesImports, updateConfigFile } = await import("./utils-BzwczAW-.mjs");
1174
+ const { removeStylesImports, updateConfigFile } = await import("./utils-B6flWWiG.mjs");
1042
1175
  try {
1043
1176
  console.log("⚙️ Updating powerhouse config file...");
1044
1177
  updateConfigFile(dependenciesWithVersions, projectPath, "uninstall");
@@ -1178,7 +1311,7 @@ it never replaces the Vetra drive.
1178
1311
  args: vetraArgs,
1179
1312
  handler: async (args) => {
1180
1313
  if (args.debug) console.log(args);
1181
- const { startVetra } = await import("./vetra-CMrdPGVJ.mjs");
1314
+ const { startVetra } = await import("./vetra-DCD3t7Qh.mjs");
1182
1315
  await startVetra(args);
1183
1316
  }
1184
1317
  }),
@@ -1301,4 +1434,4 @@ await main().catch(async (error) => {
1301
1434
  export {};
1302
1435
 
1303
1436
  //# sourceMappingURL=cli.mjs.map
1304
- //# debugId=52da3f87-0474-5ba1-90c7-7f6d6b7a8b1f
1437
+ //# debugId=61a4e538-407a-541a-bdb1-5323d64da65e