ph-cmd 6.2.3-dev.5 → 6.2.3-dev.6
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/cli.mjs +3 -3
- package/dist/{get-version-BYUrzKup.mjs → get-version-BbpyAL6I.mjs} +4 -4
- package/dist/{get-version-BYUrzKup.mjs.map → get-version-BbpyAL6I.mjs.map} +1 -1
- package/dist/{ph-cli-DFANEHdr.mjs → ph-cli-AF3uv55o.mjs} +4 -4
- package/dist/{ph-cli-DFANEHdr.mjs.map → ph-cli-AF3uv55o.mjs.map} +1 -1
- package/dist/{run-Bk73bmS1.mjs → run-KGPgcrtL.mjs} +4 -4
- package/dist/{run-Bk73bmS1.mjs.map → run-KGPgcrtL.mjs.map} +1 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
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]="3c343493-d1c1-53be-8105-8600810b1670")}catch(e){}}();
|
|
4
|
-
import { t as getVersion } from "./get-version-
|
|
4
|
+
import { t as getVersion } from "./get-version-BbpyAL6I.mjs";
|
|
5
5
|
import { r as maybeNotifyOutdated } from "./version-check-BxMITre2.mjs";
|
|
6
6
|
import { phCliCommandNames } from "@powerhousedao/shared/clis/command-names";
|
|
7
7
|
import { initCliTelemetry } from "@powerhousedao/shared/clis/telemetry";
|
|
@@ -18,11 +18,11 @@ function detectPackageManager() {
|
|
|
18
18
|
* any code is parsed to avoid errors on startup due to unsupported dependencies.
|
|
19
19
|
*/
|
|
20
20
|
async function runPhCliCommand(phCliCommand) {
|
|
21
|
-
const { executePhCliCommand } = await import("./ph-cli-
|
|
21
|
+
const { executePhCliCommand } = await import("./ph-cli-AF3uv55o.mjs");
|
|
22
22
|
return await executePhCliCommand(phCliCommand);
|
|
23
23
|
}
|
|
24
24
|
async function runPhCmdCommand(args) {
|
|
25
|
-
const { run } = await import("./run-
|
|
25
|
+
const { run } = await import("./run-KGPgcrtL.mjs");
|
|
26
26
|
return await run(args);
|
|
27
27
|
}
|
|
28
28
|
let sentryClient = void 0;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* `bun run scripts/generate-commands-docs.ts` or `bun run src/cli.ts`).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="99108f03-be41-519e-b5ef-1fb3e2f6e3f4")}catch(e){}}();
|
|
9
9
|
function getVersion() {
|
|
10
|
-
return "6.2.3-dev.
|
|
10
|
+
return "6.2.3-dev.6";
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
export { getVersion as t };
|
|
14
14
|
|
|
15
|
-
//# sourceMappingURL=get-version-
|
|
16
|
-
//# debugId=
|
|
15
|
+
//# sourceMappingURL=get-version-BbpyAL6I.mjs.map
|
|
16
|
+
//# debugId=99108f03-be41-519e-b5ef-1fb3e2f6e3f4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-version-
|
|
1
|
+
{"version":3,"file":"get-version-BbpyAL6I.mjs","sources":["../src/get-version.ts"],"sourcesContent":["declare const CLI_VERSION: string | undefined;\ndeclare const CLI_GIT_SHA: string | undefined;\n\n/**\n * Returns the CLI version string. Replaced inline by tsdown's `define` at\n * build time; falls back to env vars when running un-bundled (e.g. via\n * `bun run scripts/generate-commands-docs.ts` or `bun run src/cli.ts`).\n */\nexport function getVersion() {\n if (typeof CLI_VERSION !== \"undefined\") return CLI_VERSION;\n return (\n process.env.WORKSPACE_VERSION ||\n process.env.npm_package_version ||\n \"unknown\"\n );\n}\n\nexport function getGitHash() {\n if (typeof CLI_GIT_SHA !== \"undefined\") return CLI_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA || \"unknown\";\n}\n"],"names":[],"mappings":";;;;;;;;AAQA,SAAgB,aAAa;AACa,QAAA","debug_id":"99108f03-be41-519e-b5ef-1fb3e2f6e3f4"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
3
|
-
import { t as getVersion } from "./get-version-
|
|
2
|
+
!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]="c7e8ea96-c0a3-5d2b-85d4-0e5560b29832")}catch(e){}}();
|
|
3
|
+
import { t as getVersion } from "./get-version-BbpyAL6I.mjs";
|
|
4
4
|
import { getPowerhouseProjectInfo } from "@powerhousedao/shared/clis";
|
|
5
5
|
import spawn$1 from "cross-spawn";
|
|
6
6
|
import { resolveCommand } from "package-manager-detector";
|
|
@@ -40,5 +40,5 @@ async function executePhCliCommand(phCliCommand) {
|
|
|
40
40
|
//#endregion
|
|
41
41
|
export { executePhCliCommand };
|
|
42
42
|
|
|
43
|
-
//# sourceMappingURL=ph-cli-
|
|
44
|
-
//# debugId=
|
|
43
|
+
//# sourceMappingURL=ph-cli-AF3uv55o.mjs.map
|
|
44
|
+
//# debugId=c7e8ea96-c0a3-5d2b-85d4-0e5560b29832
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ph-cli-
|
|
1
|
+
{"version":3,"file":"ph-cli-AF3uv55o.mjs","sources":["../src/ph-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { getPowerhouseProjectInfo } from \"@powerhousedao/shared/clis\";\nimport spawn from \"cross-spawn\";\nimport { resolveCommand } from \"package-manager-detector\";\nimport { getVersion } from \"./get-version.js\";\n\nconst PH_CLI_PACKAGE = \"@powerhousedao/ph-cli\";\n\n// Auth/identity commands write global state (~/.renown.json, ~/.npmrc), not a\n// project, so they run outside a project via dlx when no ph-cli is installed.\nconst PROJECT_OPTIONAL_COMMANDS = new Set([\n \"login\",\n \"logout\",\n \"registry-login\",\n]);\n\nexport async function executePhCliCommand(phCliCommand: string) {\n const forwardedArgs = process.argv.slice(3);\n const { projectPath, packageManager } = await getPowerhouseProjectInfo(\n undefined,\n { silent: true },\n );\n\n if (!projectPath && !PROJECT_OPTIONAL_COMMANDS.has(phCliCommand)) {\n throw new Error(\n `No Powerhouse project directory found, cannot run \\`ph ${phCliCommand}\\`.\\nTo create a local project, run \\`ph init\\`.\\nTo create a global project, run \\`ph setup-globals\\`.`,\n );\n }\n\n // In a project run the installed binary; otherwise dlx ph-cli pinned to this\n // ph-cmd version, falling back to `latest` when the version is unknown.\n const version = getVersion();\n const phCliTarget = projectPath\n ? \"ph-cli\"\n : `${PH_CLI_PACKAGE}@${version === \"unknown\" ? \"latest\" : version}`;\n const action = projectPath ? \"execute-local\" : \"execute\";\n\n const resolved = resolveCommand(packageManager, action, [\n phCliTarget,\n phCliCommand,\n ...forwardedArgs,\n ]);\n if (!resolved) {\n throw new Error(\n `Could not resolve a \"${action}\" command for package manager \"${packageManager}\" to run ph-cli. Supported package managers: npm, pnpm, yarn, bun.`,\n );\n }\n\n if (!projectPath) {\n const { injectPnpmAllowBuilds } =\n await import(\"@powerhousedao/shared/clis\");\n injectPnpmAllowBuilds(packageManager, resolved);\n }\n\n const { command, args } = resolved;\n // spawn (not a shell-joined string) so args with shell metacharacters — e.g.\n // `connect build --json '{\"a\":\"b\"}'` — survive intact. cross-spawn keeps that\n // guarantee on Windows too: `command` here is an npx/pnpm/yarn `.cmd` shim,\n // which node:child_process refuses to run without `shell: true` (spawn\n // EINVAL), and `shell: true` is exactly what would break those arguments.\n const result = spawn.sync(command, args, {\n stdio: \"inherit\",\n cwd: projectPath ?? process.cwd(),\n });\n if (result.error) throw result.error;\n if (result.signal) {\n throw new Error(`${command} terminated by signal ${result.signal}`);\n }\n if (typeof result.status === \"number\" && result.status !== 0) {\n process.exit(result.status);\n }\n}\n"],"names":["spawn"],"mappings":";;;;;;;AAMA,MAAM,iBAAiB;AAIvB,MAAM,4BAA4B,IAAI,IAAI;CACxC;CACA;CACA;CACD,CAAC;AAEF,eAAsB,oBAAoB,cAAsB;CAC9D,MAAM,gBAAgB,QAAQ,KAAK,MAAM,EAAE;CAC3C,MAAM,EAAE,aAAa,mBAAmB,MAAM,yBAC5C,KAAA,GACA,EAAE,QAAQ,MAAM,CACjB;AAED,KAAI,CAAC,eAAe,CAAC,0BAA0B,IAAI,aAAa,CAC9D,OAAM,IAAI,MACR,0DAA0D,aAAa,yGACxE;CAKH,MAAM,UAAU,YAAY;CAC5B,MAAM,cAAc,cAChB,WACA,GAAG,eAAe,GAAG,YAAY,YAAY,WAAW;CAC5D,MAAM,SAAS,cAAc,kBAAkB;CAE/C,MAAM,WAAW,eAAe,gBAAgB,QAAQ;EACtD;EACA;EACA,GAAG;EACJ,CAAC;AACF,KAAI,CAAC,SACH,OAAM,IAAI,MACR,wBAAwB,OAAO,iCAAiC,eAAe,oEAChF;AAGH,KAAI,CAAC,aAAa;EAChB,MAAM,EAAE,0BACN,MAAM,OAAO;AACf,wBAAsB,gBAAgB,SAAS;;CAGjD,MAAM,EAAE,SAAS,SAAS;CAM1B,MAAM,SAASA,QAAM,KAAK,SAAS,MAAM;EACvC,OAAO;EACP,KAAK,eAAe,QAAQ,KAAK;EAClC,CAAC;AACF,KAAI,OAAO,MAAO,OAAM,OAAO;AAC/B,KAAI,OAAO,OACT,OAAM,IAAI,MAAM,GAAG,QAAQ,wBAAwB,OAAO,SAAS;AAErE,KAAI,OAAO,OAAO,WAAW,YAAY,OAAO,WAAW,EACzD,SAAQ,KAAK,OAAO,OAAO","debug_id":"c7e8ea96-c0a3-5d2b-85d4-0e5560b29832"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
3
|
-
import { t as getVersion } from "./get-version-
|
|
2
|
+
!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]="f0d82393-d14b-5f12-be22-577a3f12dea0")}catch(e){}}();
|
|
3
|
+
import { t as getVersion } from "./get-version-BbpyAL6I.mjs";
|
|
4
4
|
import { i as setCacheCurrent, n as getStream, t as PH_CMD_STREAMS } from "./version-check-BxMITre2.mjs";
|
|
5
5
|
import { t as delegateInit } from "./delegate-init-BiHdTmaF.mjs";
|
|
6
6
|
import { readFile, realpath } from "node:fs/promises";
|
|
@@ -552,5 +552,5 @@ async function run(args) {
|
|
|
552
552
|
//#endregion
|
|
553
553
|
export { run };
|
|
554
554
|
|
|
555
|
-
//# sourceMappingURL=run-
|
|
556
|
-
//# debugId=
|
|
555
|
+
//# sourceMappingURL=run-KGPgcrtL.mjs.map
|
|
556
|
+
//# debugId=f0d82393-d14b-5f12-be22-577a3f12dea0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-Bk73bmS1.mjs","sources":["../src/commands/init.ts","../src/utils/self-update.ts","../src/commands/self-update.ts","../src/commands/setup-globals.ts","../src/commands/update.ts","../src/commands/use-local.ts","../src/commands/use.ts","../src/commands/ph.ts","../src/run.ts"],"sourcesContent":["import { initArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\nimport { delegateInit } from \"../utils/delegate-init.js\";\n\n/**\n * Delegates `ph init` to the appropriate version of `@powerhousedao/ph-cli`.\n * This ensures the init logic (boilerplate, codegen) always matches the\n * ph-cli version being installed in the new project.\n */\nexport const init = command({\n name: \"init\",\n description: \"Initialize a new project\",\n args: initArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n await delegateInit(args);\n process.exit(0);\n },\n});\n","import { spawn as spawnChild } from \"cross-spawn\";\nimport { readFile as readFileAsync } from \"node:fs/promises\";\n\nimport { getStream } from \"./version-check.js\";\n\nexport type GlobalPackageManager = \"npm\" | \"pnpm\" | \"bun\" | \"yarn\";\n\nexport type InstallDetection =\n | { pm: GlobalPackageManager; pkgRoot: string }\n | { pm: null; reason: \"source-checkout\" | \"unknown\" };\n\nconst PACKAGE_NAME = \"ph-cmd\";\n\nfunction normalizePath(p: string): string {\n return p.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\");\n}\n\n/**\n * Which package manager owns the running global install, resolved from the\n * real path of the running bundle (the bin entry is a symlink; the ESM\n * loader resolves it). Path signatures:\n * pnpm: <global>/node_modules/.pnpm/ph-cmd@<v>/node_modules/ph-cmd/...\n * bun: <home>/.bun/install/global/node_modules/ph-cmd/...\n * yarn: <global>/yarn/global/node_modules/ph-cmd/... (yarn classic)\n * npm: <prefix>/lib/node_modules/ph-cmd/... (any plain node_modules)\n * A source checkout (<repo>/clis/ph-cmd/dist/cli.mjs) and any unrecognized\n * layout are refused with a reason instead of guessing.\n */\nexport function detectGlobalInstall(rawPath: string): InstallDetection {\n const real = normalizePath(rawPath);\n if (real.includes(\"/clis/ph-cmd/\")) {\n return { pm: null, reason: \"source-checkout\" };\n }\n const pkgDir = real.endsWith(`/dist/cli.mjs`)\n ? real.slice(0, -\"/dist/cli.mjs\".length)\n : null;\n if (!pkgDir || !pkgDir.endsWith(`/${PACKAGE_NAME}`)) {\n return { pm: null, reason: \"unknown\" };\n }\n if (real.includes(`/node_modules/.pnpm/${PACKAGE_NAME}@`)) {\n return { pm: \"pnpm\", pkgRoot: pkgDir };\n }\n if (real.includes(\"/.bun/install/global/node_modules/\")) {\n return { pm: \"bun\", pkgRoot: pkgDir };\n }\n if (real.includes(\"/yarn/global/node_modules/\")) {\n return { pm: \"yarn\", pkgRoot: pkgDir };\n }\n if (real.includes(\"/node_modules/\")) {\n return { pm: \"npm\", pkgRoot: pkgDir };\n }\n return { pm: null, reason: \"unknown\" };\n}\n\nconst UPDATE_COMMANDS: Record<\n GlobalPackageManager,\n { command: (spec: string) => string; argv: (spec: string) => string[] }\n> = {\n npm: {\n command: (spec) => `npm install -g ${spec}`,\n argv: (spec) => [\"npm\", \"install\", \"-g\", spec],\n },\n pnpm: {\n command: (spec) => `pnpm add -g ${spec}`,\n argv: (spec) => [\"pnpm\", \"add\", \"-g\", spec],\n },\n bun: {\n command: (spec) => `bun add -g ${spec}`,\n argv: (spec) => [\"bun\", \"add\", \"-g\", spec],\n },\n yarn: {\n command: (spec) => `yarn global add ${spec}`,\n argv: (spec) => [\"yarn\", \"global\", \"add\", spec],\n },\n};\n\n/** Human-readable update command (for error hints). */\nexport function updateCommand(pm: GlobalPackageManager, tag: string): string {\n return UPDATE_COMMANDS[pm].command(`${PACKAGE_NAME}@${tag}`);\n}\n\n/** Exact argv used to spawn the package manager. */\nexport function updateArgv(pm: GlobalPackageManager, tag: string): string[] {\n return UPDATE_COMMANDS[pm].argv(`${PACKAGE_NAME}@${tag}`);\n}\n\nexport type SelfUpdateDeps = {\n /** Runs a full argv (program first); rejects on non-zero exit. */\n spawner?: (argv: string[], opts: { stdio: \"inherit\" }) => Promise<void>;\n readFile?: (path: string) => Promise<string>;\n stdout?: (line: string) => void;\n stderr?: (line: string) => void;\n /** called with the new version after a successful update (clears the notice). */\n refreshCache?: (newVersion: string) => Promise<void>;\n};\n\nexport type SelfUpdateResult =\n | { ok: true; from: string; to: string }\n | { ok: false; message: string };\n\nfunction defaultSpawner(\n argv: string[],\n opts: { stdio: \"inherit\" },\n): Promise<void> {\n const { promise, resolve, reject } = Promise.withResolvers<void>();\n const child = spawnChild(argv[0], argv.slice(1), opts);\n child.on(\"close\", (code) =>\n code === 0\n ? resolve()\n : reject(new Error(`${argv[0]} exited with code ${code}`)),\n );\n child.on(\"error\", reject);\n return promise;\n}\n\n/**\n * Upgrade the global ph-cmd install to `tag` (default: the running build's\n * stream) using the owning package manager, then report the new version.\n * Never throws: refusals and failures come back as `{ ok: false }` so the\n * command layer owns the exit code.\n */\nexport async function runSelfUpdate(opts: {\n currentVersion: string;\n tag?: string;\n realPath: string;\n deps?: SelfUpdateDeps;\n}): Promise<SelfUpdateResult> {\n const {\n spawner = defaultSpawner,\n readFile = (p: string) => readFileAsync(p, \"utf-8\"),\n stdout = (line: string) => console.log(line),\n stderr = (line: string) => console.error(line),\n refreshCache,\n } = opts.deps ?? {};\n\n const detection = detectGlobalInstall(opts.realPath);\n if (detection.pm === null) {\n if (detection.reason === \"source-checkout\") {\n const message =\n \"ph is running from a source checkout; self-update only applies to global installs.\";\n stderr(message);\n return { ok: false, message };\n }\n const manual = (Object.keys(UPDATE_COMMANDS) as GlobalPackageManager[])\n .map((pm) => ` ${updateCommand(pm, \"latest\")}`)\n .join(\"\\n\");\n const message = `Couldn't determine how ph was installed (${opts.realPath}). Update manually:\\n${manual}`;\n stderr(message);\n return { ok: false, message };\n }\n\n const tag = opts.tag ?? getStream(opts.currentVersion);\n stdout(\n `Updating ph-cmd via ${detection.pm} (${updateCommand(detection.pm, tag)})...`,\n );\n try {\n await spawner(updateArgv(detection.pm, tag), { stdio: \"inherit\" });\n } catch (error: unknown) {\n const message = `ph-cmd update failed via ${detection.pm}. Try manually: ${updateCommand(detection.pm, tag)}`;\n stderr(message);\n if (error instanceof Error) stderr(error.message);\n return { ok: false, message };\n }\n\n let to = \"unknown\";\n try {\n const pkg = JSON.parse(\n await readFile(`${detection.pkgRoot}/package.json`),\n ) as { version?: unknown };\n if (typeof pkg.version === \"string\") to = pkg.version;\n } catch {\n // leave \"unknown\" — the PM already printed its own result\n }\n stdout(\n `Updated ph-cmd from ${opts.currentVersion} to ${to}. The new version takes effect on your next 'ph' run.`,\n );\n await refreshCache?.(to).catch(() => {});\n return { ok: true, from: opts.currentVersion, to };\n}\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, optional, option, string } from \"cmd-ts\";\nimport { realpath } from \"node:fs/promises\";\nimport { PH_CMD_STREAMS, setCacheCurrent } from \"../utils/version-check.js\";\nimport { runSelfUpdate } from \"../utils/self-update.js\";\nimport { getVersion } from \"../get-version.js\";\n\nexport const selfUpdate = command({\n name: \"self-update\",\n description:\n \"Update the globally installed ph to the newest version of its release stream\",\n args: {\n tag: option({\n type: optional(string),\n long: \"tag\",\n short: \"t\",\n description: `dist-tag to install (defaults to the running build's stream; e.g. ${PH_CMD_STREAMS.join(\n \", \",\n )})`,\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n // The real path of the running bundle identifies the global install\n // (and its package manager). argv[1] is the entry script; the ESM\n // loader already resolved symlinks, realpath is belt-and-braces.\n const entry = process.argv[1];\n const realPath = entry\n ? await realpath(entry)\n : import.meta.url.replace(/^file:\\/\\//, \"\");\n const result = await runSelfUpdate({\n currentVersion: getVersion(),\n tag: args.tag,\n realPath,\n });\n if (!result.ok) {\n process.exit(1);\n }\n // Quiet the notice on the next run: the new version is now current.\n await setCacheCurrent(result.to);\n process.exit(0);\n },\n});\n","import { initArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nconst PH_GLOBAL_PACKAGE_NAME = \"ph-global\";\n\n/**\n * `ph setup-globals` bootstraps the `~/.ph` project. It's the same flow as\n * `ph init` with `--name .ph` from the user's home directory, plus a\n * post-step that renames the package.json to `ph-global` (since `.ph` is\n * an invalid npm name).\n */\nexport const setupGlobals = command({\n name: \"setup-globals\",\n description: \"Initialize a new global project\",\n args: initArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n\n const { HOME_DIR, PH_GLOBAL_DIR_NAME, POWERHOUSE_GLOBAL_DIR } =\n await import(\"@powerhousedao/shared/clis\");\n\n /**\n * Fix the package.json `name` field for the global project — `.ph` is a\n * valid directory name but not a valid npm package name (vite + npm\n * reject names starting with a dot). We let `ph init` create the project\n * as `.ph` and then rename it here to `ph-global`.\n */\n const fixGlobalPackageName = (): void => {\n const packageJsonPath = path.join(POWERHOUSE_GLOBAL_DIR, \"package.json\");\n if (!existsSync(packageJsonPath)) return;\n try {\n const packageJson = JSON.parse(\n readFileSync(packageJsonPath, \"utf-8\"),\n ) as { name?: string };\n if (packageJson.name?.startsWith(\".\")) {\n packageJson.name = PH_GLOBAL_PACKAGE_NAME;\n writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));\n }\n } catch {\n // Ignore parse/write failures — leaves the file untouched.\n }\n };\n\n // The directory itself can exist without the project being bootstrapped —\n // telemetry writes `~/.ph/telemetry.json` early on. Use the presence of\n // `package.json` as the real \"is initialized\" signal.\n const globalPackageJson = path.join(POWERHOUSE_GLOBAL_DIR, \"package.json\");\n if (existsSync(globalPackageJson)) {\n // Repair-in-place: an older bootstrap may have left `name: \".ph\"` in\n // package.json, which breaks vite/npm. Fix it on every invocation.\n fixGlobalPackageName();\n console.log(`📦 Using global project: ${POWERHOUSE_GLOBAL_DIR}`);\n process.exit(0);\n }\n\n console.log(\"📦 Initializing global project...\");\n process.chdir(HOME_DIR);\n const { delegateInit } = await import(\"../utils/delegate-init.js\");\n await delegateInit(args, [\"--name\", PH_GLOBAL_DIR_NAME]);\n fixGlobalPackageName();\n console.log(\n `🚀 Global project initialized successfully: ${POWERHOUSE_GLOBAL_DIR}`,\n );\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { ALL_POWERHOUSE_DEPENDENCIES } from \"@powerhousedao/shared/constants\";\nimport { boolean, command, flag, optional } from \"cmd-ts\";\n\nexport const update = command({\n name: \"update\",\n description:\n \"Update your Powerhouse dependencies and installed packages to their latest versions\",\n args: {\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n short: \"s\",\n description: \"Skip running `install` with your package manager\",\n }),\n updatePackages: flag({\n type: optional(boolean),\n long: \"update-packages\",\n description:\n \"Auto-update installed packages (powerhouse.config.json) to their newest same-major version\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { skipInstall, updatePackages, debug } = args;\n if (debug) {\n console.log({ args });\n }\n console.log(`\\n▶️ Updating Powerhouse dependencies...\\n`);\n const [\n { default: chalk },\n { readPackage },\n { writePackage },\n { getTagFromVersion, logVersionUpdate, parsePackageVersion, runCmd },\n { resolveRegistryUrl },\n { updateInstalledPackages },\n ] = await Promise.all([\n import(\"chalk\"),\n import(\"read-pkg\"),\n import(\"write-package\"),\n import(\"@powerhousedao/shared/clis\"),\n import(\"@powerhousedao/shared/registry\"),\n import(\"./update-packages.js\"),\n ]);\n const registryUrl = resolveRegistryUrl({ projectPath: process.cwd() });\n const packageJson = await readPackage();\n\n if (packageJson.dependencies) {\n for (const [name, version] of Object.entries(packageJson.dependencies)) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.dependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.devDependencies) {\n for (const [name, version] of Object.entries(\n packageJson.devDependencies,\n )) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.devDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.optionalDependencies) {\n for (const [name, version] of Object.entries(\n packageJson.optionalDependencies,\n )) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.optionalDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.peerDependencies) {\n for (const [name, version] of Object.entries(\n packageJson.peerDependencies,\n )) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.peerDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n await writePackage(packageJson);\n\n console.log(chalk.green(`\\n✅ Project updated successfully\\n`));\n\n // Detect the package manager once; it backs the install below and the\n // update of `local` (node_modules) installed packages.\n const { detect } = await import(\"package-manager-detector/detect\");\n const packageManager = await detect();\n\n await updateInstalledPackages({\n registryUrl,\n auto: updatePackages ?? false,\n skipInstall: skipInstall ?? false,\n packageManager,\n });\n\n if (skipInstall) return;\n\n if (!packageManager) {\n throw new Error(\n `❌ Failed to detect your package manager. Run install manually.`,\n );\n }\n console.log(\n `▶️ Installing updated dependencies with \\`${packageManager.agent}\\`\\n`,\n );\n runCmd(`${packageManager.agent} install`);\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport {\n boolean,\n command,\n flag,\n option,\n optional,\n positional,\n string,\n} from \"cmd-ts\";\n\nexport const useLocal = command({\n name: \"use-local\",\n description:\n \"Use your local `powerhouse` monorepo dependencies the current project.\",\n args: {\n monorepoPathPositional: positional({\n type: optional(string),\n displayName: \"monorepo path\",\n description:\n \"Path to your local powerhouse monorepo relative to this project\",\n }),\n monorepoPathOption: option({\n type: optional(string),\n long: \"path\",\n short: \"p\",\n description:\n \"Path to your local powerhouse monorepo relative to this project\",\n }),\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n short: \"s\",\n description: \"Skip running `install` with `pnpm`\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { monorepoPathPositional, monorepoPathOption, skipInstall, debug } =\n args;\n if (debug) {\n console.log({ args });\n }\n const monorepoPath = monorepoPathPositional ?? monorepoPathOption;\n\n if (!monorepoPath) {\n throw new Error(\n \"❌ Please provide the path to your local powerhouse monorepo.\",\n );\n }\n\n const { runUseLocal } = await import(\"@powerhousedao/shared/clis\");\n await runUseLocal(monorepoPath, skipInstall);\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { ALL_POWERHOUSE_DEPENDENCIES } from \"@powerhousedao/shared/constants\";\nimport {\n boolean,\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n run,\n string,\n} from \"cmd-ts\";\n\nexport const use = command({\n name: \"use\",\n description: \"Specify the release version of Powerhouse dependencies to use.\",\n args: {\n tagPositional: positional({\n type: optional(oneOf([\"latest\", \"staging\", \"dev\", \"rc\"])),\n displayName: \"tag\",\n description: `Specify the release tag to use for your project. Can be one of: \"latest\", \"staging\", \"dev\", or \"rc\".`,\n }),\n tagOption: option({\n type: optional(oneOf([\"latest\", \"staging\", \"dev\", \"rc\"])),\n long: \"tag\",\n short: \"t\",\n description: `Specify the release tag to use for your project. Can be one of: \"latest\", \"staging\", \"dev\", or \"rc\".`,\n }),\n version: option({\n type: optional(string),\n long: \"version\",\n short: \"v\",\n description:\n \"Specify the exact semver release version to use for your project.\",\n }),\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n short: \"s\",\n description: \"Skip running `install` with your package manager\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { tagPositional, tagOption, version, skipInstall, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const tag = tagPositional ?? tagOption;\n const {\n handleMutuallyExclusiveOptions,\n logVersionUpdate,\n parsePackageVersion,\n runCmd,\n } = await import(\"@powerhousedao/shared/clis\");\n handleMutuallyExclusiveOptions({ tag, version }, \"versioning strategy\");\n\n if (!tag && !version) {\n throw new Error(\n \"Please specify either a release tag or a version to use.\",\n );\n }\n\n const [\n { default: chalk },\n { readPackage },\n { writePackage },\n { clean, valid },\n ] = await Promise.all([\n import(\"chalk\"),\n import(\"read-pkg\"),\n import(\"write-package\"),\n import(\"semver\"),\n ]);\n\n if (version && !valid(clean(version))) {\n throw new Error(`❌ Invalid version: ${chalk.bold(version)}`);\n }\n\n console.log(\n `▶️ Updating project to use ${chalk.bold(version ?? tag)}...\\n`,\n );\n\n const packageJson = await readPackage();\n\n if (packageJson.dependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.dependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.dependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.devDependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.devDependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.devDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.optionalDependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.optionalDependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.optionalDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.peerDependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.peerDependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.peerDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n await writePackage(packageJson);\n\n console.log(\n chalk.green(\n `\\n✅ Project updated to use ${chalk.bold(version ?? tag)}\\n`,\n ),\n );\n\n if (!skipInstall) {\n const { detect } = await import(\"package-manager-detector/detect\");\n const packageManager = await detect();\n if (!packageManager) {\n throw new Error(\n `❌ Failed to detect your package manager. Run install manually.`,\n );\n }\n console.log(\n `▶️ Installing updated dependencies with \\`${packageManager.agent}\\`\\n`,\n );\n runCmd(`${packageManager.agent} install`);\n }\n\n process.exit(0);\n },\n});\n\nexport async function runUse(args: string[]) {\n await run(use, args);\n}\n","import { phCliHelpCommands } from \"@powerhousedao/shared/clis/args\";\nimport { subcommands } from \"cmd-ts\";\nimport { getVersion } from \"../get-version.js\";\nimport { init } from \"./init.js\";\nimport { selfUpdate } from \"./self-update.js\";\nimport { setupGlobals } from \"./setup-globals.js\";\nimport { update } from \"./update.js\";\nimport { useLocal } from \"./use-local.js\";\nimport { use } from \"./use.js\";\n\n// `--version` is intercepted in cli.ts before the subcommand tree is\n// constructed, so cmd-ts only needs the bare version string here. The\n// rich version output (with project info, package manager, etc.) is\n// produced by `getPhCmdVersionInfo` along that short-circuit path.\nexport const ph = subcommands({\n name: \"ph\",\n version: getVersion(),\n description:\n \"The Powerhouse CLI (ph-cmd) is a command-line interface tool that provides essential commands for managing Powerhouse projects.\\nThe tool and it's commands are fundamental for creating, building, and running Document Models as a builder in studio mode.\",\n cmds: {\n init,\n use,\n update,\n \"self-update\": selfUpdate,\n \"setup-globals\": setupGlobals,\n \"use-local\": useLocal,\n ...phCliHelpCommands,\n },\n});\n","import { run as runCmdTs } from \"cmd-ts\";\nimport { ph } from \"./commands/ph.js\";\n\nexport async function run(args: string[]) {\n return await runC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CAAC,aAAa;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,iBAAiB,MAAM,QAAQ;AACrC,OAAI,CAAC,eACH,OAAM,IAAI,MACR,iEACD;AAEH,WAAQ,IACN,6CAA6C,eAAe,MAAM,MACnE;AACD,UAAO,GAAG,eAAe,MAAM,UAAU;;AAG3C,UAAQ,KAAK,EAAE;;CAElB,CAAC;;;AChKF,MAAa,KAAK,YAAY;CAC5B,MAAM;CACN,SAAS,YAAY;CACrB,aACE;CACF,MAAM;EACJ;EACA;EACA;EACA,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,GAAG;EACJ;CACF,CAAC;;;ACzBF,eAAsB,IAAI,MAAgB;AACxC,QAAO,MAAMC,MAAS,IAAI,KAAK","debug_id":"96b80135-b624-5548-a1fd-2f9cc3dcd82e"}
|
|
1
|
+
{"version":3,"file":"run-KGPgcrtL.mjs","sources":["../src/commands/init.ts","../src/utils/self-update.ts","../src/commands/self-update.ts","../src/commands/setup-globals.ts","../src/commands/update.ts","../src/commands/use-local.ts","../src/commands/use.ts","../src/commands/ph.ts","../src/run.ts"],"sourcesContent":["import { initArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\nimport { delegateInit } from \"../utils/delegate-init.js\";\n\n/**\n * Delegates `ph init` to the appropriate version of `@powerhousedao/ph-cli`.\n * This ensures the init logic (boilerplate, codegen) always matches the\n * ph-cli version being installed in the new project.\n */\nexport const init = command({\n name: \"init\",\n description: \"Initialize a new project\",\n args: initArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n await delegateInit(args);\n process.exit(0);\n },\n});\n","import { spawn as spawnChild } from \"cross-spawn\";\nimport { readFile as readFileAsync } from \"node:fs/promises\";\n\nimport { getStream } from \"./version-check.js\";\n\nexport type GlobalPackageManager = \"npm\" | \"pnpm\" | \"bun\" | \"yarn\";\n\nexport type InstallDetection =\n | { pm: GlobalPackageManager; pkgRoot: string }\n | { pm: null; reason: \"source-checkout\" | \"unknown\" };\n\nconst PACKAGE_NAME = \"ph-cmd\";\n\nfunction normalizePath(p: string): string {\n return p.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\");\n}\n\n/**\n * Which package manager owns the running global install, resolved from the\n * real path of the running bundle (the bin entry is a symlink; the ESM\n * loader resolves it). Path signatures:\n * pnpm: <global>/node_modules/.pnpm/ph-cmd@<v>/node_modules/ph-cmd/...\n * bun: <home>/.bun/install/global/node_modules/ph-cmd/...\n * yarn: <global>/yarn/global/node_modules/ph-cmd/... (yarn classic)\n * npm: <prefix>/lib/node_modules/ph-cmd/... (any plain node_modules)\n * A source checkout (<repo>/clis/ph-cmd/dist/cli.mjs) and any unrecognized\n * layout are refused with a reason instead of guessing.\n */\nexport function detectGlobalInstall(rawPath: string): InstallDetection {\n const real = normalizePath(rawPath);\n if (real.includes(\"/clis/ph-cmd/\")) {\n return { pm: null, reason: \"source-checkout\" };\n }\n const pkgDir = real.endsWith(`/dist/cli.mjs`)\n ? real.slice(0, -\"/dist/cli.mjs\".length)\n : null;\n if (!pkgDir || !pkgDir.endsWith(`/${PACKAGE_NAME}`)) {\n return { pm: null, reason: \"unknown\" };\n }\n if (real.includes(`/node_modules/.pnpm/${PACKAGE_NAME}@`)) {\n return { pm: \"pnpm\", pkgRoot: pkgDir };\n }\n if (real.includes(\"/.bun/install/global/node_modules/\")) {\n return { pm: \"bun\", pkgRoot: pkgDir };\n }\n if (real.includes(\"/yarn/global/node_modules/\")) {\n return { pm: \"yarn\", pkgRoot: pkgDir };\n }\n if (real.includes(\"/node_modules/\")) {\n return { pm: \"npm\", pkgRoot: pkgDir };\n }\n return { pm: null, reason: \"unknown\" };\n}\n\nconst UPDATE_COMMANDS: Record<\n GlobalPackageManager,\n { command: (spec: string) => string; argv: (spec: string) => string[] }\n> = {\n npm: {\n command: (spec) => `npm install -g ${spec}`,\n argv: (spec) => [\"npm\", \"install\", \"-g\", spec],\n },\n pnpm: {\n command: (spec) => `pnpm add -g ${spec}`,\n argv: (spec) => [\"pnpm\", \"add\", \"-g\", spec],\n },\n bun: {\n command: (spec) => `bun add -g ${spec}`,\n argv: (spec) => [\"bun\", \"add\", \"-g\", spec],\n },\n yarn: {\n command: (spec) => `yarn global add ${spec}`,\n argv: (spec) => [\"yarn\", \"global\", \"add\", spec],\n },\n};\n\n/** Human-readable update command (for error hints). */\nexport function updateCommand(pm: GlobalPackageManager, tag: string): string {\n return UPDATE_COMMANDS[pm].command(`${PACKAGE_NAME}@${tag}`);\n}\n\n/** Exact argv used to spawn the package manager. */\nexport function updateArgv(pm: GlobalPackageManager, tag: string): string[] {\n return UPDATE_COMMANDS[pm].argv(`${PACKAGE_NAME}@${tag}`);\n}\n\nexport type SelfUpdateDeps = {\n /** Runs a full argv (program first); rejects on non-zero exit. */\n spawner?: (argv: string[], opts: { stdio: \"inherit\" }) => Promise<void>;\n readFile?: (path: string) => Promise<string>;\n stdout?: (line: string) => void;\n stderr?: (line: string) => void;\n /** called with the new version after a successful update (clears the notice). */\n refreshCache?: (newVersion: string) => Promise<void>;\n};\n\nexport type SelfUpdateResult =\n | { ok: true; from: string; to: string }\n | { ok: false; message: string };\n\nfunction defaultSpawner(\n argv: string[],\n opts: { stdio: \"inherit\" },\n): Promise<void> {\n const { promise, resolve, reject } = Promise.withResolvers<void>();\n const child = spawnChild(argv[0], argv.slice(1), opts);\n child.on(\"close\", (code) =>\n code === 0\n ? resolve()\n : reject(new Error(`${argv[0]} exited with code ${code}`)),\n );\n child.on(\"error\", reject);\n return promise;\n}\n\n/**\n * Upgrade the global ph-cmd install to `tag` (default: the running build's\n * stream) using the owning package manager, then report the new version.\n * Never throws: refusals and failures come back as `{ ok: false }` so the\n * command layer owns the exit code.\n */\nexport async function runSelfUpdate(opts: {\n currentVersion: string;\n tag?: string;\n realPath: string;\n deps?: SelfUpdateDeps;\n}): Promise<SelfUpdateResult> {\n const {\n spawner = defaultSpawner,\n readFile = (p: string) => readFileAsync(p, \"utf-8\"),\n stdout = (line: string) => console.log(line),\n stderr = (line: string) => console.error(line),\n refreshCache,\n } = opts.deps ?? {};\n\n const detection = detectGlobalInstall(opts.realPath);\n if (detection.pm === null) {\n if (detection.reason === \"source-checkout\") {\n const message =\n \"ph is running from a source checkout; self-update only applies to global installs.\";\n stderr(message);\n return { ok: false, message };\n }\n const manual = (Object.keys(UPDATE_COMMANDS) as GlobalPackageManager[])\n .map((pm) => ` ${updateCommand(pm, \"latest\")}`)\n .join(\"\\n\");\n const message = `Couldn't determine how ph was installed (${opts.realPath}). Update manually:\\n${manual}`;\n stderr(message);\n return { ok: false, message };\n }\n\n const tag = opts.tag ?? getStream(opts.currentVersion);\n stdout(\n `Updating ph-cmd via ${detection.pm} (${updateCommand(detection.pm, tag)})...`,\n );\n try {\n await spawner(updateArgv(detection.pm, tag), { stdio: \"inherit\" });\n } catch (error: unknown) {\n const message = `ph-cmd update failed via ${detection.pm}. Try manually: ${updateCommand(detection.pm, tag)}`;\n stderr(message);\n if (error instanceof Error) stderr(error.message);\n return { ok: false, message };\n }\n\n let to = \"unknown\";\n try {\n const pkg = JSON.parse(\n await readFile(`${detection.pkgRoot}/package.json`),\n ) as { version?: unknown };\n if (typeof pkg.version === \"string\") to = pkg.version;\n } catch {\n // leave \"unknown\" — the PM already printed its own result\n }\n stdout(\n `Updated ph-cmd from ${opts.currentVersion} to ${to}. The new version takes effect on your next 'ph' run.`,\n );\n await refreshCache?.(to).catch(() => {});\n return { ok: true, from: opts.currentVersion, to };\n}\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, optional, option, string } from \"cmd-ts\";\nimport { realpath } from \"node:fs/promises\";\nimport { PH_CMD_STREAMS, setCacheCurrent } from \"../utils/version-check.js\";\nimport { runSelfUpdate } from \"../utils/self-update.js\";\nimport { getVersion } from \"../get-version.js\";\n\nexport const selfUpdate = command({\n name: \"self-update\",\n description:\n \"Update the globally installed ph to the newest version of its release stream\",\n args: {\n tag: option({\n type: optional(string),\n long: \"tag\",\n short: \"t\",\n description: `dist-tag to install (defaults to the running build's stream; e.g. ${PH_CMD_STREAMS.join(\n \", \",\n )})`,\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n // The real path of the running bundle identifies the global install\n // (and its package manager). argv[1] is the entry script; the ESM\n // loader already resolved symlinks, realpath is belt-and-braces.\n const entry = process.argv[1];\n const realPath = entry\n ? await realpath(entry)\n : import.meta.url.replace(/^file:\\/\\//, \"\");\n const result = await runSelfUpdate({\n currentVersion: getVersion(),\n tag: args.tag,\n realPath,\n });\n if (!result.ok) {\n process.exit(1);\n }\n // Quiet the notice on the next run: the new version is now current.\n await setCacheCurrent(result.to);\n process.exit(0);\n },\n});\n","import { initArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nconst PH_GLOBAL_PACKAGE_NAME = \"ph-global\";\n\n/**\n * `ph setup-globals` bootstraps the `~/.ph` project. It's the same flow as\n * `ph init` with `--name .ph` from the user's home directory, plus a\n * post-step that renames the package.json to `ph-global` (since `.ph` is\n * an invalid npm name).\n */\nexport const setupGlobals = command({\n name: \"setup-globals\",\n description: \"Initialize a new global project\",\n args: initArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n\n const { HOME_DIR, PH_GLOBAL_DIR_NAME, POWERHOUSE_GLOBAL_DIR } =\n await import(\"@powerhousedao/shared/clis\");\n\n /**\n * Fix the package.json `name` field for the global project — `.ph` is a\n * valid directory name but not a valid npm package name (vite + npm\n * reject names starting with a dot). We let `ph init` create the project\n * as `.ph` and then rename it here to `ph-global`.\n */\n const fixGlobalPackageName = (): void => {\n const packageJsonPath = path.join(POWERHOUSE_GLOBAL_DIR, \"package.json\");\n if (!existsSync(packageJsonPath)) return;\n try {\n const packageJson = JSON.parse(\n readFileSync(packageJsonPath, \"utf-8\"),\n ) as { name?: string };\n if (packageJson.name?.startsWith(\".\")) {\n packageJson.name = PH_GLOBAL_PACKAGE_NAME;\n writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));\n }\n } catch {\n // Ignore parse/write failures — leaves the file untouched.\n }\n };\n\n // The directory itself can exist without the project being bootstrapped —\n // telemetry writes `~/.ph/telemetry.json` early on. Use the presence of\n // `package.json` as the real \"is initialized\" signal.\n const globalPackageJson = path.join(POWERHOUSE_GLOBAL_DIR, \"package.json\");\n if (existsSync(globalPackageJson)) {\n // Repair-in-place: an older bootstrap may have left `name: \".ph\"` in\n // package.json, which breaks vite/npm. Fix it on every invocation.\n fixGlobalPackageName();\n console.log(`📦 Using global project: ${POWERHOUSE_GLOBAL_DIR}`);\n process.exit(0);\n }\n\n console.log(\"📦 Initializing global project...\");\n process.chdir(HOME_DIR);\n const { delegateInit } = await import(\"../utils/delegate-init.js\");\n await delegateInit(args, [\"--name\", PH_GLOBAL_DIR_NAME]);\n fixGlobalPackageName();\n console.log(\n `🚀 Global project initialized successfully: ${POWERHOUSE_GLOBAL_DIR}`,\n );\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { ALL_POWERHOUSE_DEPENDENCIES } from \"@powerhousedao/shared/constants\";\nimport { boolean, command, flag, optional } from \"cmd-ts\";\n\nexport const update = command({\n name: \"update\",\n description:\n \"Update your Powerhouse dependencies and installed packages to their latest versions\",\n args: {\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n short: \"s\",\n description: \"Skip running `install` with your package manager\",\n }),\n updatePackages: flag({\n type: optional(boolean),\n long: \"update-packages\",\n description:\n \"Auto-update installed packages (powerhouse.config.json) to their newest same-major version\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { skipInstall, updatePackages, debug } = args;\n if (debug) {\n console.log({ args });\n }\n console.log(`\\n▶️ Updating Powerhouse dependencies...\\n`);\n const [\n { default: chalk },\n { readPackage },\n { writePackage },\n { getTagFromVersion, logVersionUpdate, parsePackageVersion, runCmd },\n { resolveRegistryUrl },\n { updateInstalledPackages },\n ] = await Promise.all([\n import(\"chalk\"),\n import(\"read-pkg\"),\n import(\"write-package\"),\n import(\"@powerhousedao/shared/clis\"),\n import(\"@powerhousedao/shared/registry\"),\n import(\"./update-packages.js\"),\n ]);\n const registryUrl = resolveRegistryUrl({ projectPath: process.cwd() });\n const packageJson = await readPackage();\n\n if (packageJson.dependencies) {\n for (const [name, version] of Object.entries(packageJson.dependencies)) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.dependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.devDependencies) {\n for (const [name, version] of Object.entries(\n packageJson.devDependencies,\n )) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.devDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.optionalDependencies) {\n for (const [name, version] of Object.entries(\n packageJson.optionalDependencies,\n )) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.optionalDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.peerDependencies) {\n for (const [name, version] of Object.entries(\n packageJson.peerDependencies,\n )) {\n if (version && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const tag = getTagFromVersion(version);\n const newVersion = await parsePackageVersion({ name, tag });\n packageJson.peerDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version,\n newVersion,\n });\n }\n }\n }\n\n await writePackage(packageJson);\n\n console.log(chalk.green(`\\n✅ Project updated successfully\\n`));\n\n // Detect the package manager once; it backs the install below and the\n // update of `local` (node_modules) installed packages.\n const { detect } = await import(\"package-manager-detector/detect\");\n const packageManager = await detect();\n\n await updateInstalledPackages({\n registryUrl,\n auto: updatePackages ?? false,\n skipInstall: skipInstall ?? false,\n packageManager,\n });\n\n if (skipInstall) return;\n\n if (!packageManager) {\n throw new Error(\n `❌ Failed to detect your package manager. Run install manually.`,\n );\n }\n console.log(\n `▶️ Installing updated dependencies with \\`${packageManager.agent}\\`\\n`,\n );\n runCmd(`${packageManager.agent} install`);\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport {\n boolean,\n command,\n flag,\n option,\n optional,\n positional,\n string,\n} from \"cmd-ts\";\n\nexport const useLocal = command({\n name: \"use-local\",\n description:\n \"Use your local `powerhouse` monorepo dependencies the current project.\",\n args: {\n monorepoPathPositional: positional({\n type: optional(string),\n displayName: \"monorepo path\",\n description:\n \"Path to your local powerhouse monorepo relative to this project\",\n }),\n monorepoPathOption: option({\n type: optional(string),\n long: \"path\",\n short: \"p\",\n description:\n \"Path to your local powerhouse monorepo relative to this project\",\n }),\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n short: \"s\",\n description: \"Skip running `install` with `pnpm`\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { monorepoPathPositional, monorepoPathOption, skipInstall, debug } =\n args;\n if (debug) {\n console.log({ args });\n }\n const monorepoPath = monorepoPathPositional ?? monorepoPathOption;\n\n if (!monorepoPath) {\n throw new Error(\n \"❌ Please provide the path to your local powerhouse monorepo.\",\n );\n }\n\n const { runUseLocal } = await import(\"@powerhousedao/shared/clis\");\n await runUseLocal(monorepoPath, skipInstall);\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { ALL_POWERHOUSE_DEPENDENCIES } from \"@powerhousedao/shared/constants\";\nimport {\n boolean,\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n run,\n string,\n} from \"cmd-ts\";\n\nexport const use = command({\n name: \"use\",\n description: \"Specify the release version of Powerhouse dependencies to use.\",\n args: {\n tagPositional: positional({\n type: optional(oneOf([\"latest\", \"staging\", \"dev\", \"rc\"])),\n displayName: \"tag\",\n description: `Specify the release tag to use for your project. Can be one of: \"latest\", \"staging\", \"dev\", or \"rc\".`,\n }),\n tagOption: option({\n type: optional(oneOf([\"latest\", \"staging\", \"dev\", \"rc\"])),\n long: \"tag\",\n short: \"t\",\n description: `Specify the release tag to use for your project. Can be one of: \"latest\", \"staging\", \"dev\", or \"rc\".`,\n }),\n version: option({\n type: optional(string),\n long: \"version\",\n short: \"v\",\n description:\n \"Specify the exact semver release version to use for your project.\",\n }),\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n short: \"s\",\n description: \"Skip running `install` with your package manager\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { tagPositional, tagOption, version, skipInstall, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const tag = tagPositional ?? tagOption;\n const {\n handleMutuallyExclusiveOptions,\n logVersionUpdate,\n parsePackageVersion,\n runCmd,\n } = await import(\"@powerhousedao/shared/clis\");\n handleMutuallyExclusiveOptions({ tag, version }, \"versioning strategy\");\n\n if (!tag && !version) {\n throw new Error(\n \"Please specify either a release tag or a version to use.\",\n );\n }\n\n const [\n { default: chalk },\n { readPackage },\n { writePackage },\n { clean, valid },\n ] = await Promise.all([\n import(\"chalk\"),\n import(\"read-pkg\"),\n import(\"write-package\"),\n import(\"semver\"),\n ]);\n\n if (version && !valid(clean(version))) {\n throw new Error(`❌ Invalid version: ${chalk.bold(version)}`);\n }\n\n console.log(\n `▶️ Updating project to use ${chalk.bold(version ?? tag)}...\\n`,\n );\n\n const packageJson = await readPackage();\n\n if (packageJson.dependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.dependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.dependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.devDependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.devDependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.devDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.optionalDependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.optionalDependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.optionalDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n if (packageJson.peerDependencies) {\n for (const [name, existingVersion] of Object.entries(\n packageJson.peerDependencies,\n )) {\n if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {\n const newVersion = await parsePackageVersion({ name, tag, version });\n packageJson.peerDependencies[name] = newVersion;\n logVersionUpdate({\n name,\n version: existingVersion,\n newVersion,\n });\n }\n }\n }\n\n await writePackage(packageJson);\n\n console.log(\n chalk.green(\n `\\n✅ Project updated to use ${chalk.bold(version ?? tag)}\\n`,\n ),\n );\n\n if (!skipInstall) {\n const { detect } = await import(\"package-manager-detector/detect\");\n const packageManager = await detect();\n if (!packageManager) {\n throw new Error(\n `❌ Failed to detect your package manager. Run install manually.`,\n );\n }\n console.log(\n `▶️ Installing updated dependencies with \\`${packageManager.agent}\\`\\n`,\n );\n runCmd(`${packageManager.agent} install`);\n }\n\n process.exit(0);\n },\n});\n\nexport async function runUse(args: string[]) {\n await run(use, args);\n}\n","import { phCliHelpCommands } from \"@powerhousedao/shared/clis/args\";\nimport { subcommands } from \"cmd-ts\";\nimport { getVersion } from \"../get-version.js\";\nimport { init } from \"./init.js\";\nimport { selfUpdate } from \"./self-update.js\";\nimport { setupGlobals } from \"./setup-globals.js\";\nimport { update } from \"./update.js\";\nimport { useLocal } from \"./use-local.js\";\nimport { use } from \"./use.js\";\n\n// `--version` is intercepted in cli.ts before the subcommand tree is\n// constructed, so cmd-ts only needs the bare version string here. The\n// rich version output (with project info, package manager, etc.) is\n// produced by `getPhCmdVersionInfo` along that short-circuit path.\nexport const ph = subcommands({\n name: \"ph\",\n version: getVersion(),\n description:\n \"The Powerhouse CLI (ph-cmd) is a command-line interface tool that provides essential commands for managing Powerhouse projects.\\nThe tool and it's commands are fundamental for creating, building, and running Document Models as a builder in studio mode.\",\n cmds: {\n init,\n use,\n update,\n \"self-update\": selfUpdate,\n \"setup-globals\": setupGlobals,\n \"use-local\": useLocal,\n ...phCliHelpCommands,\n },\n});\n","import { run as runCmdTs } from \"cmd-ts\";\nimport { ph } from \"./commands/ph.js\";\n\nexport async function run(args: string[]) {\n return await runCmdTs(ph, args);\n}\n"],"names":["spawnChild","readFileAsync","readFile","runCmdTs"],"mappings":";;;;;;;;;;;;;;;;;;AASA,MAAa,OAAO,QAAQ;CAC1B,MAAM;CACN,aAAa;CACb,MAAM;CACN,SAAS,OAAO,SAAS;AACvB,MAAI,KAAK,MACP,SAAQ,IAAI,EAAE,MAAM,CAAC;AAEvB,QAAM,aAAa,KAAK;AACxB,UAAQ,KAAK,EAAE;;CAElB,CAAC;;;ACTF,MAAM,eAAe;AAErB,SAAS,cAAc,GAAmB;AACxC,QAAO,EAAE,QAAQ,OAAO,IAAI,CAAC,QAAQ,QAAQ,GAAG;;;;;;;;;;;;;AAclD,SAAgB,oBAAoB,SAAmC;CACrE,MAAM,OAAO,cAAc,QAAQ;AACnC,KAAI,KAAK,SAAS,gBAAgB,CAChC,QAAO;EAAE,IAAI;EAAM,QAAQ;EAAmB;CAEhD,MAAM,SAAS,KAAK,SAAS,gBAAgB,GACzC,KAAK,MAAM,GAAG,IAAwB,GACtC;AACJ,KAAI,CAAC,UAAU,CAAC,OAAO,SAAS,IAAI,eAAe,CACjD,QAAO;EAAE,IA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B,SAAS,KAAK,EAAE;IACjE,MAAM,aAAa,MAAM,oBAAoB;KAAE;KAAM;KAAK;KAAS,CAAC;AACpE,gBAAY,qBAAqB,QAAQ;AACzC,qBAAiB;KACf;KACA,SAAS;KACT;KACD,CAAC;;;AAKR,MAAI,YAAY;QACT,MAAM,CAAC,MAAM,oBAAoB,OAAO,QAC3C,YAAY,iBACb,CACC,KAAI,mBAAmB,4BAA4B,SAAS,KAAK,EAAE;IACjE,MAAM,aAAa,MAAM,oBAAoB;KAAE;KAAM;KAAK;KAAS,CAAC;AACpE,gBAAY,iBAAiB,QAAQ;AACrC,qBAAiB;KACf;KACA,SAAS;KACT;KACD,CAAC;;;AAKR,QAAM,aAAa,YAAY;AAE/B,UAAQ,IACN,MAAM,MACJ,8BAA8B,MAAM,KAAK,WAAW,IAAI,CAAC,IAC1D,CACF;AAED,MAAI,CAAC,aAAa;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,iBAAiB,MAAM,QAAQ;AACrC,OAAI,CAAC,eACH,OAAM,IAAI,MACR,iEACD;AAEH,WAAQ,IACN,6CAA6C,eAAe,MAAM,MACnE;AACD,UAAO,GAAG,eAAe,MAAM,UAAU;;AAG3C,UAAQ,KAAK,EAAE;;CAElB,CAAC;;;AChKF,MAAa,KAAK,YAAY;CAC5B,MAAM;CACN,SAAS,YAAY;CACrB,aACE;CACF,MAAM;EACJ;EACA;EACA;EACA,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,GAAG;EACJ;CACF,CAAC;;;ACzBF,eAAsB,IAAI,MAAgB;AACxC,QAAO,MAAMC,MAAS,IAAI,KAAK","debug_id":"f0d82393-d14b-5f12-be22-577a3f12dea0"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ph-cmd",
|
|
3
|
-
"version": "6.2.3-dev.
|
|
3
|
+
"version": "6.2.3-dev.6",
|
|
4
4
|
"description": "Powerhouse CLI — create Vetra projects, generate document models and editors, run local dev environments, and publish packages.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"author": "",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"cross-spawn": "7.0.6",
|
|
38
|
-
"@powerhousedao/shared": "6.2.3-dev.
|
|
38
|
+
"@powerhousedao/shared": "6.2.3-dev.6",
|
|
39
39
|
"@sentry/node-core": "^10.52.0",
|
|
40
40
|
"chalk": "5.6.2",
|
|
41
41
|
"cmd-ts": "0.15.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/cross-spawn": "6.0.6",
|
|
49
|
-
"@powerhousedao/codegen": "6.2.3-dev.
|
|
49
|
+
"@powerhousedao/codegen": "6.2.3-dev.6",
|
|
50
50
|
"tsdown": "0.21.1",
|
|
51
51
|
"vitest": "4.1.1"
|
|
52
52
|
},
|