ph-cmd 6.0.0-dev.6 → 6.0.0-dev.7
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/build/cli.js +1495 -0
- package/package.json +8 -8
- package/dist/scripts/generate-commands-md.d.ts +0 -2
- package/dist/scripts/generate-commands-md.d.ts.map +0 -1
- package/dist/scripts/generate-commands-md.js +0 -72
- package/dist/scripts/generate-commands-md.js.map +0 -1
- package/dist/scripts/generate-version.d.ts +0 -2
- package/dist/scripts/generate-version.d.ts.map +0 -1
- package/dist/scripts/generate-version.js +0 -13
- package/dist/scripts/generate-version.js.map +0 -1
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -120
- package/dist/src/cli.js.map +0 -1
- package/dist/src/commands/__tests__/update.test.d.ts +0 -2
- package/dist/src/commands/__tests__/update.test.d.ts.map +0 -1
- package/dist/src/commands/__tests__/update.test.js +0 -157
- package/dist/src/commands/__tests__/update.test.js.map +0 -1
- package/dist/src/commands/__tests__/use.test.d.ts +0 -2
- package/dist/src/commands/__tests__/use.test.d.ts.map +0 -1
- package/dist/src/commands/__tests__/use.test.js +0 -496
- package/dist/src/commands/__tests__/use.test.js.map +0 -1
- package/dist/src/commands/checkout.d.ts +0 -9
- package/dist/src/commands/checkout.d.ts.map +0 -1
- package/dist/src/commands/checkout.js +0 -37
- package/dist/src/commands/checkout.js.map +0 -1
- package/dist/src/commands/forward.d.ts +0 -7
- package/dist/src/commands/forward.d.ts.map +0 -1
- package/dist/src/commands/forward.js +0 -45
- package/dist/src/commands/forward.js.map +0 -1
- package/dist/src/commands/help.d.ts +0 -7
- package/dist/src/commands/help.d.ts.map +0 -1
- package/dist/src/commands/help.js +0 -14
- package/dist/src/commands/help.js.map +0 -1
- package/dist/src/commands/index.d.ts +0 -9
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -15
- package/dist/src/commands/index.js.map +0 -1
- package/dist/src/commands/init.d.ts +0 -2
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js +0 -165
- package/dist/src/commands/init.js.map +0 -1
- package/dist/src/commands/setup-globals.d.ts +0 -20
- package/dist/src/commands/setup-globals.d.ts.map +0 -1
- package/dist/src/commands/setup-globals.js +0 -24
- package/dist/src/commands/setup-globals.js.map +0 -1
- package/dist/src/commands/update.d.ts +0 -2
- package/dist/src/commands/update.d.ts.map +0 -1
- package/dist/src/commands/update.js +0 -95
- package/dist/src/commands/update.js.map +0 -1
- package/dist/src/commands/update.old.d.ts +0 -13
- package/dist/src/commands/update.old.d.ts.map +0 -1
- package/dist/src/commands/update.old.js +0 -105
- package/dist/src/commands/update.old.js.map +0 -1
- package/dist/src/commands/use-local.d.ts +0 -2
- package/dist/src/commands/use-local.d.ts.map +0 -1
- package/dist/src/commands/use-local.js +0 -115
- package/dist/src/commands/use-local.js.map +0 -1
- package/dist/src/commands/use.d.ts +0 -2
- package/dist/src/commands/use.d.ts.map +0 -1
- package/dist/src/commands/use.js +0 -117
- package/dist/src/commands/use.js.map +0 -1
- package/dist/src/commands/use.old.d.ts +0 -55
- package/dist/src/commands/use.old.d.ts.map +0 -1
- package/dist/src/commands/use.old.js +0 -219
- package/dist/src/commands/use.old.js.map +0 -1
- package/dist/src/commands/version.d.ts +0 -5
- package/dist/src/commands/version.d.ts.map +0 -1
- package/dist/src/commands/version.js +0 -42
- package/dist/src/commands/version.js.map +0 -1
- package/dist/src/help.d.ts +0 -25
- package/dist/src/help.d.ts.map +0 -1
- package/dist/src/help.js +0 -230
- package/dist/src/help.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/types.d.ts +0 -2
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils/constants.d.ts +0 -59
- package/dist/src/utils/constants.d.ts.map +0 -1
- package/dist/src/utils/constants.js +0 -102
- package/dist/src/utils/constants.js.map +0 -1
- package/dist/src/utils/dependencies.d.ts +0 -4
- package/dist/src/utils/dependencies.d.ts.map +0 -1
- package/dist/src/utils/dependencies.js +0 -61
- package/dist/src/utils/dependencies.js.map +0 -1
- package/dist/src/utils/file-system.d.ts +0 -2
- package/dist/src/utils/file-system.d.ts.map +0 -1
- package/dist/src/utils/file-system.js +0 -12
- package/dist/src/utils/file-system.js.map +0 -1
- package/dist/src/utils/help-formatting.d.ts +0 -35
- package/dist/src/utils/help-formatting.d.ts.map +0 -1
- package/dist/src/utils/help-formatting.js +0 -188
- package/dist/src/utils/help-formatting.js.map +0 -1
- package/dist/src/utils/help.d.ts +0 -31
- package/dist/src/utils/help.d.ts.map +0 -1
- package/dist/src/utils/help.js +0 -72
- package/dist/src/utils/help.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -8
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js +0 -7
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/package-manager.d.ts +0 -27
- package/dist/src/utils/package-manager.d.ts.map +0 -1
- package/dist/src/utils/package-manager.js +0 -177
- package/dist/src/utils/package-manager.js.map +0 -1
- package/dist/src/utils/parsing.d.ts +0 -20
- package/dist/src/utils/parsing.d.ts.map +0 -1
- package/dist/src/utils/parsing.js +0 -52
- package/dist/src/utils/parsing.js.map +0 -1
- package/dist/src/utils/run-cmd.d.ts +0 -2
- package/dist/src/utils/run-cmd.d.ts.map +0 -1
- package/dist/src/utils/run-cmd.js +0 -11
- package/dist/src/utils/run-cmd.js.map +0 -1
- package/dist/src/utils/types.d.ts +0 -21
- package/dist/src/utils/types.d.ts.map +0 -1
- package/dist/src/utils/types.js +0 -2
- package/dist/src/utils/types.js.map +0 -1
- package/dist/src/utils/validate-remote-drive-checkout.d.ts +0 -7
- package/dist/src/utils/validate-remote-drive-checkout.d.ts.map +0 -1
- package/dist/src/utils/validate-remote-drive-checkout.js +0 -45
- package/dist/src/utils/validate-remote-drive-checkout.js.map +0 -1
- package/dist/src/utils/validate-remote-drive.d.ts +0 -7
- package/dist/src/utils/validate-remote-drive.d.ts.map +0 -1
- package/dist/src/utils/validate-remote-drive.js +0 -51
- package/dist/src/utils/validate-remote-drive.js.map +0 -1
- package/dist/src/version.d.ts +0 -2
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -3
- package/dist/src/version.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -7
- package/dist/vitest.config.js.map +0 -1
package/dist/src/help.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Help text for CLI commands
|
|
3
|
-
* This file centralizes all help text to keep command files clean
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Help text for the update command
|
|
7
|
-
*/
|
|
8
|
-
export declare const updateHelp = "\nCommand Overview:\n The update command helps you manage and update Powerhouse dependencies in your project. It provides\n an efficient way to keep your project up-to-date with the latest versions of Powerhouse packages.\n \n This command:\n 1. Updates all Powerhouse dependencies based on the semver ranges specified in your package.json\n 2. Can force update all dependencies to a specific environment version (dev, prod, latest)\n 3. Automatically builds any local dependencies before updating\n 4. Works with all dependencies with @powerhousedao/ prefix and special packages like document-model\n\nOptions:\n --force <env> Force update to the latest available version for the environment specified.\n Valid environments: dev, prod, latest.\n - dev: Uses @dev tag for all dependencies\n - prod/latest: Uses @latest tag for all dependencies\n \n --package-manager Override the auto-detected package manager with the specified one.\n \n --debug Show additional logs while executing the command.\n\nSpecial Cases:\n - Local Dependencies: If you have dependencies linked from a local monorepo (using file: or link:\n protocols), the command will detect the monorepo root, build affected packages, then update.\n \n - No Dependencies: If no Powerhouse dependencies are found in your project, the command will\n display a message and exit without making changes.\n\nExamples:\n $ ph update # Update dependencies based on package.json ranges\n $ ph update --force dev # Force update to latest dev version available\n $ ph update --force prod # Force update to latest stable version available (same as latest)\n $ ph update --force latest # Force update to latest stable version available (same as prod)\n $ ph update --package-manager pnpm # Specify package manager to use\n $ ph update --debug # Show debug information during update\n";
|
|
9
|
-
/**
|
|
10
|
-
* Help text for the use command
|
|
11
|
-
*/
|
|
12
|
-
export declare const useHelp = "\nCommand Overview:\n The use command allows you to quickly switch between different environments for all Powerhouse\n dependencies in your project. It provides a convenient way to toggle between development,\n production, local versions, or a specific version of the packages.\n\n This command:\n 1. Updates all installed Powerhouse dependencies to the specified environment or version\n 2. Can link to local dependencies from a monorepo for development\n 3. Only updates dependencies that are already present in your package.json\n 4. Supports special packages without the @powerhousedao prefix\n\nArguments:\n <environment> Required. The environment or version to use. Valid options:\n - dev: Use development versions (@dev tag)\n - staging: Use staging versions (@staging tag)\n - prod/latest: Use production versions (@latest tag)\n - local: Use local filesystem versions (requires localPath)\n - <version>: Use a specific version (e.g., 5.1.0, 1.0.0-beta.1)\n\n [localPath] Path to the local monorepo. Required when environment is 'local'.\n This should be the root of your Powerhouse monorepo.\n\nOptions:\n --force Force environment to use, even if not in the predefined list\n\n --package-manager Override the auto-detected package manager with the specified one.\n\n --debug Show additional logs during execution for troubleshooting.\n\n --use-resolved Resolves tags to their actual version numbers. For example:\n - @dev tag will be resolved to the latest dev version (e.g. v1.0.1-dev.1)\n - @latest tag will be resolved to the latest stable version (e.g. v1.0.0)\n This ensures you get the exact version that matches the tag.\n\nSpecial Cases:\n - Local Development: When using the 'local' environment, dependencies are linked directly\n to local filesystem paths, allowing for real-time development and testing.\n\n - Missing Dependencies: The command only updates Powerhouse dependencies that are already\n installed in your project. It won't add new ones.\n\nExamples:\n $ ph use dev # Switch all dependencies to development versions\n $ ph use staging # Switch all dependencies to staging versions\n $ ph use prod # Switch all dependencies to production versions\n $ ph use latest # Same as 'prod', use latest production versions\n $ ph use 5.1.0 # Switch all dependencies to version 5.1.0\n $ ph use 1.0.0-beta.1 # Switch all dependencies to a pre-release version\n $ ph use local /path/to/monorepo # Link to local versions in the specified monorepo\n $ ph use dev --package-manager npm # Use npm instead of the auto-detected package manager\n $ ph use dev --debug # Show debug information during execution\n $ ph use dev --use-resolved # Resolve @dev tags to actual version numbers (e.g. v1.0.1-dev.1)\n";
|
|
13
|
-
/**
|
|
14
|
-
* Help text for the setup-globals command
|
|
15
|
-
*/
|
|
16
|
-
export declare const setupGlobalsHelp = "\nCommand Overview:\n The setup-globals command initializes a new Powerhouse project with the necessary global \n configuration. It helps you set up a project quickly with proper defaults and dependencies.\n\n This command:\n 1. Creates a new project with the specified name or in the current directory\n 2. Sets up all required Powerhouse dependencies\n 3. Configures the project with appropriate settings\n 4. Can run in interactive mode to guide you through the setup process\n\nArguments:\n [project-name] Optional. Name of the project to create. If not provided,\n the command will use the current directory.\n\nOptions:\n -p, --project Specify the name of the project to create.\n \n -i, --interactive Run the command in interactive mode, which will guide you\n through the setup process with questions and prompts.\n \n -v, --version Specify the development version to use. Defaults to \"main\".\n \n --dev Use the \"development\" version of the boilerplate.\n \n --staging Use the \"staging\" version of the boilerplate.\n \n --package-manager Override the auto-detected package manager with the specified one.\n\nProject Structure:\n The command will set up a project with the following structure:\n - Proper configuration files for TypeScript and ESLint\n - Dependencies for Powerhouse packages\n - Build and development scripts\n\nExamples:\n $ ph setup-globals my-project # Create a new project named \"my-project\"\n $ ph setup-globals # Set up a project in the current directory\n $ ph setup-globals -i # Run setup in interactive mode\n $ ph setup-globals --dev # Use development version\n $ ph setup-globals -v beta # Use specific version\n $ ph setup-globals --package-manager npm # Use npm as package manager\n";
|
|
17
|
-
/**
|
|
18
|
-
* Help text for the init command
|
|
19
|
-
*/
|
|
20
|
-
export declare const initHelp = "\nCommand Overview:\n The init command creates a new Powerhouse project with optimal defaults. It sets up a fully \n configured project structure with all necessary dependencies, configurations, and boilerplate.\n\n This command:\n 1. Creates a new project with the specified name\n 2. Installs all required dependencies for Powerhouse development\n 3. Sets up a proper project structure and configuration files\n 4. Can run in interactive mode for customized setup\n\nArguments:\n [project-name] Optional. Name of the project to create. If not provided,\n you'll be prompted to provide a name, or the current directory \n will be used if in interactive mode.\n\nOptions:\n -p, --project Specify the name of the project to create.\n \n -i, --interactive Run the command in interactive mode, which will guide you\n through the project setup with customizable options.\n \n -t, --tag Version of the Powerhouse dependencies to use. Defaults to \"main\"\n \n --dev Use the \"development\" version.\n \n --staging Use the \"staging\" version.\n\n -b, --branch Specify custom boilerplate branch to use.\n \n --package-manager Override the auto-detected package manager with the specified one.\n\nProject Structure:\n The command will create a complete project with:\n - Properly configured TypeScript and build settings\n - Powerhouse document-model integration\n - All necessary package.json dependencies\n - Development scripts and tooling\n\nExamples:\n $ ph init my-awesome-project # Create a new project named \"my-awesome-project\"\n $ ph init -i # Create a project in interactive mode\n $ ph init -p my-project # Same as ph init my-project\n $ ph init --dev # Use development version of boilerplate\n $ ph init -v beta # Use specific version\n $ ph init --package-manager yarn # Use yarn as package manager\n $ ph init my-awesome-project --dev --package-manager pnpm # Create a project with Powerhouse dev packages and pnpm as package manager\n";
|
|
21
|
-
/**
|
|
22
|
-
* Help text for the checkout command
|
|
23
|
-
*/
|
|
24
|
-
export declare const checkoutHelp = "\nCommand Overview:\n The checkout command clones an existing Powerhouse project from a remote Vetra drive.\n This allows you to work on projects that have been initialized and configured by others.\n\n This command:\n 1. Fetches the GitHub repository URL from the specified Vetra remote drive\n 2. Clones the repository to your local machine\n 3. Installs all project dependencies\n\nRequired Options:\n -r, --remote-drive <url> URL of the Vetra remote drive containing the project.\n The drive must have a Vetra package with a configured GitHub URL.\n\nOptions:\n --package-manager <pm> Specify which package manager to use for installing dependencies.\n Supported: npm, yarn, pnpm, bun\n If not specified, uses the detected package manager from your environment.\n\nExamples:\n $ ph checkout --remote-drive https://vetra.example.com/d/abc123 # Clone project using default package manager\n $ ph checkout --remote-drive https://vetra.example.com/d/abc123 --package-manager pnpm # Clone and install with pnpm\n\nNotes:\n - The remote drive must contain a Vetra package document with a GitHub URL configured\n - If no GitHub URL is found, you'll need to use 'ph init --remote-drive' instead to create a new project\n - The repository will be cloned into a directory named after the repository\n";
|
|
25
|
-
//# sourceMappingURL=help.d.ts.map
|
package/dist/src/help.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU,miEAmCtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,slGAqDnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,kgEA0C5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,w4EA+CpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,64CA2BxB,CAAC"}
|
package/dist/src/help.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Help text for CLI commands
|
|
3
|
-
* This file centralizes all help text to keep command files clean
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Help text for the update command
|
|
7
|
-
*/
|
|
8
|
-
export const updateHelp = `
|
|
9
|
-
Command Overview:
|
|
10
|
-
The update command helps you manage and update Powerhouse dependencies in your project. It provides
|
|
11
|
-
an efficient way to keep your project up-to-date with the latest versions of Powerhouse packages.
|
|
12
|
-
|
|
13
|
-
This command:
|
|
14
|
-
1. Updates all Powerhouse dependencies based on the semver ranges specified in your package.json
|
|
15
|
-
2. Can force update all dependencies to a specific environment version (dev, prod, latest)
|
|
16
|
-
3. Automatically builds any local dependencies before updating
|
|
17
|
-
4. Works with all dependencies with @powerhousedao/ prefix and special packages like document-model
|
|
18
|
-
|
|
19
|
-
Options:
|
|
20
|
-
--force <env> Force update to the latest available version for the environment specified.
|
|
21
|
-
Valid environments: dev, prod, latest.
|
|
22
|
-
- dev: Uses @dev tag for all dependencies
|
|
23
|
-
- prod/latest: Uses @latest tag for all dependencies
|
|
24
|
-
|
|
25
|
-
--package-manager Override the auto-detected package manager with the specified one.
|
|
26
|
-
|
|
27
|
-
--debug Show additional logs while executing the command.
|
|
28
|
-
|
|
29
|
-
Special Cases:
|
|
30
|
-
- Local Dependencies: If you have dependencies linked from a local monorepo (using file: or link:
|
|
31
|
-
protocols), the command will detect the monorepo root, build affected packages, then update.
|
|
32
|
-
|
|
33
|
-
- No Dependencies: If no Powerhouse dependencies are found in your project, the command will
|
|
34
|
-
display a message and exit without making changes.
|
|
35
|
-
|
|
36
|
-
Examples:
|
|
37
|
-
$ ph update # Update dependencies based on package.json ranges
|
|
38
|
-
$ ph update --force dev # Force update to latest dev version available
|
|
39
|
-
$ ph update --force prod # Force update to latest stable version available (same as latest)
|
|
40
|
-
$ ph update --force latest # Force update to latest stable version available (same as prod)
|
|
41
|
-
$ ph update --package-manager pnpm # Specify package manager to use
|
|
42
|
-
$ ph update --debug # Show debug information during update
|
|
43
|
-
`;
|
|
44
|
-
/**
|
|
45
|
-
* Help text for the use command
|
|
46
|
-
*/
|
|
47
|
-
export const useHelp = `
|
|
48
|
-
Command Overview:
|
|
49
|
-
The use command allows you to quickly switch between different environments for all Powerhouse
|
|
50
|
-
dependencies in your project. It provides a convenient way to toggle between development,
|
|
51
|
-
production, local versions, or a specific version of the packages.
|
|
52
|
-
|
|
53
|
-
This command:
|
|
54
|
-
1. Updates all installed Powerhouse dependencies to the specified environment or version
|
|
55
|
-
2. Can link to local dependencies from a monorepo for development
|
|
56
|
-
3. Only updates dependencies that are already present in your package.json
|
|
57
|
-
4. Supports special packages without the @powerhousedao prefix
|
|
58
|
-
|
|
59
|
-
Arguments:
|
|
60
|
-
<environment> Required. The environment or version to use. Valid options:
|
|
61
|
-
- dev: Use development versions (@dev tag)
|
|
62
|
-
- staging: Use staging versions (@staging tag)
|
|
63
|
-
- prod/latest: Use production versions (@latest tag)
|
|
64
|
-
- local: Use local filesystem versions (requires localPath)
|
|
65
|
-
- <version>: Use a specific version (e.g., 5.1.0, 1.0.0-beta.1)
|
|
66
|
-
|
|
67
|
-
[localPath] Path to the local monorepo. Required when environment is 'local'.
|
|
68
|
-
This should be the root of your Powerhouse monorepo.
|
|
69
|
-
|
|
70
|
-
Options:
|
|
71
|
-
--force Force environment to use, even if not in the predefined list
|
|
72
|
-
|
|
73
|
-
--package-manager Override the auto-detected package manager with the specified one.
|
|
74
|
-
|
|
75
|
-
--debug Show additional logs during execution for troubleshooting.
|
|
76
|
-
|
|
77
|
-
--use-resolved Resolves tags to their actual version numbers. For example:
|
|
78
|
-
- @dev tag will be resolved to the latest dev version (e.g. v1.0.1-dev.1)
|
|
79
|
-
- @latest tag will be resolved to the latest stable version (e.g. v1.0.0)
|
|
80
|
-
This ensures you get the exact version that matches the tag.
|
|
81
|
-
|
|
82
|
-
Special Cases:
|
|
83
|
-
- Local Development: When using the 'local' environment, dependencies are linked directly
|
|
84
|
-
to local filesystem paths, allowing for real-time development and testing.
|
|
85
|
-
|
|
86
|
-
- Missing Dependencies: The command only updates Powerhouse dependencies that are already
|
|
87
|
-
installed in your project. It won't add new ones.
|
|
88
|
-
|
|
89
|
-
Examples:
|
|
90
|
-
$ ph use dev # Switch all dependencies to development versions
|
|
91
|
-
$ ph use staging # Switch all dependencies to staging versions
|
|
92
|
-
$ ph use prod # Switch all dependencies to production versions
|
|
93
|
-
$ ph use latest # Same as 'prod', use latest production versions
|
|
94
|
-
$ ph use 5.1.0 # Switch all dependencies to version 5.1.0
|
|
95
|
-
$ ph use 1.0.0-beta.1 # Switch all dependencies to a pre-release version
|
|
96
|
-
$ ph use local /path/to/monorepo # Link to local versions in the specified monorepo
|
|
97
|
-
$ ph use dev --package-manager npm # Use npm instead of the auto-detected package manager
|
|
98
|
-
$ ph use dev --debug # Show debug information during execution
|
|
99
|
-
$ ph use dev --use-resolved # Resolve @dev tags to actual version numbers (e.g. v1.0.1-dev.1)
|
|
100
|
-
`;
|
|
101
|
-
/**
|
|
102
|
-
* Help text for the setup-globals command
|
|
103
|
-
*/
|
|
104
|
-
export const setupGlobalsHelp = `
|
|
105
|
-
Command Overview:
|
|
106
|
-
The setup-globals command initializes a new Powerhouse project with the necessary global
|
|
107
|
-
configuration. It helps you set up a project quickly with proper defaults and dependencies.
|
|
108
|
-
|
|
109
|
-
This command:
|
|
110
|
-
1. Creates a new project with the specified name or in the current directory
|
|
111
|
-
2. Sets up all required Powerhouse dependencies
|
|
112
|
-
3. Configures the project with appropriate settings
|
|
113
|
-
4. Can run in interactive mode to guide you through the setup process
|
|
114
|
-
|
|
115
|
-
Arguments:
|
|
116
|
-
[project-name] Optional. Name of the project to create. If not provided,
|
|
117
|
-
the command will use the current directory.
|
|
118
|
-
|
|
119
|
-
Options:
|
|
120
|
-
-p, --project Specify the name of the project to create.
|
|
121
|
-
|
|
122
|
-
-i, --interactive Run the command in interactive mode, which will guide you
|
|
123
|
-
through the setup process with questions and prompts.
|
|
124
|
-
|
|
125
|
-
-v, --version Specify the development version to use. Defaults to "main".
|
|
126
|
-
|
|
127
|
-
--dev Use the "development" version of the boilerplate.
|
|
128
|
-
|
|
129
|
-
--staging Use the "staging" version of the boilerplate.
|
|
130
|
-
|
|
131
|
-
--package-manager Override the auto-detected package manager with the specified one.
|
|
132
|
-
|
|
133
|
-
Project Structure:
|
|
134
|
-
The command will set up a project with the following structure:
|
|
135
|
-
- Proper configuration files for TypeScript and ESLint
|
|
136
|
-
- Dependencies for Powerhouse packages
|
|
137
|
-
- Build and development scripts
|
|
138
|
-
|
|
139
|
-
Examples:
|
|
140
|
-
$ ph setup-globals my-project # Create a new project named "my-project"
|
|
141
|
-
$ ph setup-globals # Set up a project in the current directory
|
|
142
|
-
$ ph setup-globals -i # Run setup in interactive mode
|
|
143
|
-
$ ph setup-globals --dev # Use development version
|
|
144
|
-
$ ph setup-globals -v beta # Use specific version
|
|
145
|
-
$ ph setup-globals --package-manager npm # Use npm as package manager
|
|
146
|
-
`;
|
|
147
|
-
/**
|
|
148
|
-
* Help text for the init command
|
|
149
|
-
*/
|
|
150
|
-
export const initHelp = `
|
|
151
|
-
Command Overview:
|
|
152
|
-
The init command creates a new Powerhouse project with optimal defaults. It sets up a fully
|
|
153
|
-
configured project structure with all necessary dependencies, configurations, and boilerplate.
|
|
154
|
-
|
|
155
|
-
This command:
|
|
156
|
-
1. Creates a new project with the specified name
|
|
157
|
-
2. Installs all required dependencies for Powerhouse development
|
|
158
|
-
3. Sets up a proper project structure and configuration files
|
|
159
|
-
4. Can run in interactive mode for customized setup
|
|
160
|
-
|
|
161
|
-
Arguments:
|
|
162
|
-
[project-name] Optional. Name of the project to create. If not provided,
|
|
163
|
-
you'll be prompted to provide a name, or the current directory
|
|
164
|
-
will be used if in interactive mode.
|
|
165
|
-
|
|
166
|
-
Options:
|
|
167
|
-
-p, --project Specify the name of the project to create.
|
|
168
|
-
|
|
169
|
-
-i, --interactive Run the command in interactive mode, which will guide you
|
|
170
|
-
through the project setup with customizable options.
|
|
171
|
-
|
|
172
|
-
-t, --tag Version of the Powerhouse dependencies to use. Defaults to "main"
|
|
173
|
-
|
|
174
|
-
--dev Use the "development" version.
|
|
175
|
-
|
|
176
|
-
--staging Use the "staging" version.
|
|
177
|
-
|
|
178
|
-
-b, --branch Specify custom boilerplate branch to use.
|
|
179
|
-
|
|
180
|
-
--package-manager Override the auto-detected package manager with the specified one.
|
|
181
|
-
|
|
182
|
-
Project Structure:
|
|
183
|
-
The command will create a complete project with:
|
|
184
|
-
- Properly configured TypeScript and build settings
|
|
185
|
-
- Powerhouse document-model integration
|
|
186
|
-
- All necessary package.json dependencies
|
|
187
|
-
- Development scripts and tooling
|
|
188
|
-
|
|
189
|
-
Examples:
|
|
190
|
-
$ ph init my-awesome-project # Create a new project named "my-awesome-project"
|
|
191
|
-
$ ph init -i # Create a project in interactive mode
|
|
192
|
-
$ ph init -p my-project # Same as ph init my-project
|
|
193
|
-
$ ph init --dev # Use development version of boilerplate
|
|
194
|
-
$ ph init -v beta # Use specific version
|
|
195
|
-
$ ph init --package-manager yarn # Use yarn as package manager
|
|
196
|
-
$ ph init my-awesome-project --dev --package-manager pnpm # Create a project with Powerhouse dev packages and pnpm as package manager
|
|
197
|
-
`;
|
|
198
|
-
/**
|
|
199
|
-
* Help text for the checkout command
|
|
200
|
-
*/
|
|
201
|
-
export const checkoutHelp = `
|
|
202
|
-
Command Overview:
|
|
203
|
-
The checkout command clones an existing Powerhouse project from a remote Vetra drive.
|
|
204
|
-
This allows you to work on projects that have been initialized and configured by others.
|
|
205
|
-
|
|
206
|
-
This command:
|
|
207
|
-
1. Fetches the GitHub repository URL from the specified Vetra remote drive
|
|
208
|
-
2. Clones the repository to your local machine
|
|
209
|
-
3. Installs all project dependencies
|
|
210
|
-
|
|
211
|
-
Required Options:
|
|
212
|
-
-r, --remote-drive <url> URL of the Vetra remote drive containing the project.
|
|
213
|
-
The drive must have a Vetra package with a configured GitHub URL.
|
|
214
|
-
|
|
215
|
-
Options:
|
|
216
|
-
--package-manager <pm> Specify which package manager to use for installing dependencies.
|
|
217
|
-
Supported: npm, yarn, pnpm, bun
|
|
218
|
-
If not specified, uses the detected package manager from your environment.
|
|
219
|
-
|
|
220
|
-
Examples:
|
|
221
|
-
$ ph checkout --remote-drive https://vetra.example.com/d/abc123 # Clone project using default package manager
|
|
222
|
-
$ ph checkout --remote-drive https://vetra.example.com/d/abc123 --package-manager pnpm # Clone and install with pnpm
|
|
223
|
-
|
|
224
|
-
Notes:
|
|
225
|
-
- The remote drive must contain a Vetra package document with a GitHub URL configured
|
|
226
|
-
- If no GitHub URL is found, you'll need to use 'ph init --remote-drive' instead to create a new project
|
|
227
|
-
- The repository will be cloned into a directory named after the repository
|
|
228
|
-
`;
|
|
229
|
-
// Add other command help texts here as needed
|
|
230
|
-
//# sourceMappingURL=help.js.map
|
package/dist/src/help.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C/B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B3B,CAAC;AAEF,8CAA8C"}
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
|
package/dist/src/index.js
DELETED
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
|
package/dist/src/types.d.ts
DELETED
package/dist/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG,IAAI,IAAI,CACjE,GAAG,IAAI,EAAE,IAAI,KACV,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/src/types.js
DELETED
package/dist/src/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export declare const PH_BIN_PATH: string;
|
|
2
|
-
export declare const PH_BIN = "ph-cli";
|
|
3
|
-
export declare const PH_CLI_COMMANDS: string[];
|
|
4
|
-
export declare const POWERHOUSE_CONFIG_FILE = "powerhouse.config.json";
|
|
5
|
-
export declare const HOME_DIR: string;
|
|
6
|
-
export declare const PH_GLOBAL_DIR_NAME = ".ph";
|
|
7
|
-
export declare const PH_GLOBAL_PACKAGE_NAME = "ph-global";
|
|
8
|
-
export declare const PH_GLOBAL_PROJECT_NAME = ".ph";
|
|
9
|
-
export declare const POWERHOUSE_GLOBAL_DIR: string;
|
|
10
|
-
export declare const packageManagers: {
|
|
11
|
-
readonly bun: {
|
|
12
|
-
readonly installCommand: "bun add {{dependency}}";
|
|
13
|
-
readonly execCommand: "bun ph-cli {{arguments}}";
|
|
14
|
-
readonly execScript: "bun {{arguments}}";
|
|
15
|
-
readonly lockfile: "bun.lock";
|
|
16
|
-
readonly globalPathRegexp: RegExp;
|
|
17
|
-
readonly updateCommand: "bun update {{dependency}}";
|
|
18
|
-
readonly buildAffected: "bun run build:affected";
|
|
19
|
-
readonly workspaceOption: "";
|
|
20
|
-
readonly installDepsCommand: "bun install";
|
|
21
|
-
};
|
|
22
|
-
readonly pnpm: {
|
|
23
|
-
readonly installCommand: "pnpm add {{dependency}}";
|
|
24
|
-
readonly execCommand: "pnpm exec ph-cli {{arguments}}";
|
|
25
|
-
readonly execScript: "pnpm {{arguments}}";
|
|
26
|
-
readonly lockfile: "pnpm-lock.yaml";
|
|
27
|
-
readonly globalPathRegexp: RegExp;
|
|
28
|
-
readonly updateCommand: "pnpm update {{dependency}}";
|
|
29
|
-
readonly buildAffected: "pnpm run build:affected";
|
|
30
|
-
readonly workspaceOption: "--workspace-root";
|
|
31
|
-
readonly installDepsCommand: "pnpm install";
|
|
32
|
-
};
|
|
33
|
-
readonly yarn: {
|
|
34
|
-
readonly installCommand: "yarn add {{dependency}}";
|
|
35
|
-
readonly execCommand: "yarn ph-cli {{arguments}}";
|
|
36
|
-
readonly execScript: "yarn {{arguments}}";
|
|
37
|
-
readonly lockfile: "yarn.lock";
|
|
38
|
-
readonly globalPathRegexp: RegExp;
|
|
39
|
-
readonly updateCommand: "yarn upgrade {{dependency}}";
|
|
40
|
-
readonly buildAffected: "yarn run build:affected";
|
|
41
|
-
readonly workspaceOption: "-W";
|
|
42
|
-
readonly installDepsCommand: "yarn install";
|
|
43
|
-
};
|
|
44
|
-
readonly npm: {
|
|
45
|
-
readonly installCommand: "npm install {{dependency}}";
|
|
46
|
-
readonly execCommand: "npx ph-cli {{arguments}}";
|
|
47
|
-
readonly execScript: "npm run {{arguments}}";
|
|
48
|
-
readonly lockfile: "package-lock.json";
|
|
49
|
-
readonly updateCommand: "npm update {{dependency}} --save";
|
|
50
|
-
readonly buildAffected: "npm run build:affected";
|
|
51
|
-
readonly workspaceOption: "";
|
|
52
|
-
readonly installDepsCommand: "npm install";
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export declare const PACKAGES_DEPENDENCIES: readonly ["@powerhousedao/builder-tools", "@powerhousedao/codegen", "@powerhousedao/common", "@powerhousedao/config", "@powerhousedao/design-system", "document-drive", "document-model", "@powerhousedao/reactor", "@powerhousedao/reactor-api", "@powerhousedao/reactor-browser", "@powerhousedao/reactor-local", "@powerhousedao/reactor-mcp", "@powerhousedao/switchboard-gui", "@powerhousedao/vetra"];
|
|
56
|
-
export declare const CLIS_DEPENDENCIES: string[];
|
|
57
|
-
export declare const APPS_DEPENDENCIES: string[];
|
|
58
|
-
export declare const ALL_POWERHOUSE_DEPENDENCIES: string[];
|
|
59
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,QAAkB,CAAC;AAC3C,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,eAAe,UAkB3B,CAAC;AACF,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,QAAQ,QAAY,CAAC;AAClC,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD,eAAO,MAAM,sBAAsB,QAAqB,CAAC;AACzD,eAAO,MAAM,qBAAqB,QAA0C,CAAC;AAE7E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ClB,CAAC;AAEX,eAAO,MAAM,qBAAqB,6YAexB,CAAC;AAEX,eAAO,MAAM,iBAAiB,UAAsC,CAAC;AACrE,eAAO,MAAM,iBAAiB,UAG7B,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAIvC,CAAC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { homedir } from "node:os";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
export const PH_BIN_PATH = process.argv[1];
|
|
4
|
-
export const PH_BIN = "ph-cli";
|
|
5
|
-
export const PH_CLI_COMMANDS = [
|
|
6
|
-
"init",
|
|
7
|
-
"dev",
|
|
8
|
-
"connect",
|
|
9
|
-
"generate",
|
|
10
|
-
"reactor",
|
|
11
|
-
"switchboard",
|
|
12
|
-
"help",
|
|
13
|
-
"install",
|
|
14
|
-
"add",
|
|
15
|
-
"i",
|
|
16
|
-
"remove",
|
|
17
|
-
"uninstall",
|
|
18
|
-
"service",
|
|
19
|
-
"list",
|
|
20
|
-
"inspect",
|
|
21
|
-
"version",
|
|
22
|
-
"login",
|
|
23
|
-
];
|
|
24
|
-
export const POWERHOUSE_CONFIG_FILE = "powerhouse.config.json";
|
|
25
|
-
export const HOME_DIR = homedir();
|
|
26
|
-
export const PH_GLOBAL_DIR_NAME = ".ph";
|
|
27
|
-
export const PH_GLOBAL_PACKAGE_NAME = "ph-global";
|
|
28
|
-
// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility
|
|
29
|
-
export const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;
|
|
30
|
-
export const POWERHOUSE_GLOBAL_DIR = path.join(HOME_DIR, PH_GLOBAL_DIR_NAME);
|
|
31
|
-
export const packageManagers = {
|
|
32
|
-
bun: {
|
|
33
|
-
installCommand: "bun add {{dependency}}",
|
|
34
|
-
execCommand: `bun ${PH_BIN} {{arguments}}`,
|
|
35
|
-
execScript: `bun {{arguments}}`,
|
|
36
|
-
lockfile: "bun.lock",
|
|
37
|
-
globalPathRegexp: /[\\/].bun[\\/]/,
|
|
38
|
-
updateCommand: "bun update {{dependency}}",
|
|
39
|
-
buildAffected: "bun run build:affected",
|
|
40
|
-
workspaceOption: "",
|
|
41
|
-
installDepsCommand: "bun install",
|
|
42
|
-
},
|
|
43
|
-
pnpm: {
|
|
44
|
-
installCommand: "pnpm add {{dependency}}",
|
|
45
|
-
execCommand: `pnpm exec ${PH_BIN} {{arguments}}`,
|
|
46
|
-
execScript: `pnpm {{arguments}}`,
|
|
47
|
-
lockfile: "pnpm-lock.yaml",
|
|
48
|
-
globalPathRegexp: /[\\/]pnpm[\\/]/,
|
|
49
|
-
updateCommand: "pnpm update {{dependency}}",
|
|
50
|
-
buildAffected: "pnpm run build:affected",
|
|
51
|
-
workspaceOption: "--workspace-root",
|
|
52
|
-
installDepsCommand: "pnpm install",
|
|
53
|
-
},
|
|
54
|
-
yarn: {
|
|
55
|
-
installCommand: "yarn add {{dependency}}",
|
|
56
|
-
execCommand: `yarn ${PH_BIN} {{arguments}}`,
|
|
57
|
-
execScript: `yarn {{arguments}}`,
|
|
58
|
-
lockfile: "yarn.lock",
|
|
59
|
-
globalPathRegexp: /[\\/]yarn[\\/]/,
|
|
60
|
-
updateCommand: "yarn upgrade {{dependency}}",
|
|
61
|
-
buildAffected: "yarn run build:affected",
|
|
62
|
-
workspaceOption: "-W",
|
|
63
|
-
installDepsCommand: "yarn install",
|
|
64
|
-
},
|
|
65
|
-
npm: {
|
|
66
|
-
installCommand: "npm install {{dependency}}",
|
|
67
|
-
execCommand: `npx ${PH_BIN} {{arguments}}`,
|
|
68
|
-
execScript: `npm run {{arguments}}`,
|
|
69
|
-
lockfile: "package-lock.json",
|
|
70
|
-
updateCommand: "npm update {{dependency}} --save",
|
|
71
|
-
buildAffected: "npm run build:affected",
|
|
72
|
-
workspaceOption: "",
|
|
73
|
-
installDepsCommand: "npm install",
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
export const PACKAGES_DEPENDENCIES = [
|
|
77
|
-
"@powerhousedao/builder-tools",
|
|
78
|
-
"@powerhousedao/codegen",
|
|
79
|
-
"@powerhousedao/common",
|
|
80
|
-
"@powerhousedao/config",
|
|
81
|
-
"@powerhousedao/design-system",
|
|
82
|
-
"document-drive",
|
|
83
|
-
"document-model",
|
|
84
|
-
"@powerhousedao/reactor",
|
|
85
|
-
"@powerhousedao/reactor-api",
|
|
86
|
-
"@powerhousedao/reactor-browser",
|
|
87
|
-
"@powerhousedao/reactor-local",
|
|
88
|
-
"@powerhousedao/reactor-mcp",
|
|
89
|
-
"@powerhousedao/switchboard-gui",
|
|
90
|
-
"@powerhousedao/vetra",
|
|
91
|
-
];
|
|
92
|
-
export const CLIS_DEPENDENCIES = ["ph-cmd", "@powerhousedao/ph-cli"];
|
|
93
|
-
export const APPS_DEPENDENCIES = [
|
|
94
|
-
"@powerhousedao/connect",
|
|
95
|
-
"@powerhousedao/switchboard",
|
|
96
|
-
];
|
|
97
|
-
export const ALL_POWERHOUSE_DEPENDENCIES = [
|
|
98
|
-
...PACKAGES_DEPENDENCIES,
|
|
99
|
-
...CLIS_DEPENDENCIES,
|
|
100
|
-
...APPS_DEPENDENCIES,
|
|
101
|
-
];
|
|
102
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { PackageManager } from "./types.js";
|
|
2
|
-
export declare function updateDependencyVersionString(packageManager: PackageManager, dependencies: string[], projectPath: string): void;
|
|
3
|
-
export declare function installDependency(packageManager: PackageManager, dependencies: string[], projectPath: string, workspace?: boolean): void;
|
|
4
|
-
//# sourceMappingURL=dependencies.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/utils/dependencies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,YAAY,CAAC;AAsB9D,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,MAAM,EAAE,EACtB,WAAW,EAAE,MAAM,QAmCpB;AAED,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,MAAM,EAAE,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,OAAO,QAuBpB"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
2
|
-
import { execSync } from "node:child_process";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { packageManagers } from "./constants.js";
|
|
5
|
-
function parseDependencyString(dependency) {
|
|
6
|
-
// Handle scoped packages (e.g. @org/package@version)
|
|
7
|
-
const lastAtIndex = dependency.lastIndexOf("@");
|
|
8
|
-
if (lastAtIndex === 0) {
|
|
9
|
-
// This is a scoped package without version
|
|
10
|
-
return { name: dependency, version: "latest" };
|
|
11
|
-
}
|
|
12
|
-
const name = dependency.slice(0, lastAtIndex);
|
|
13
|
-
const version = dependency.slice(lastAtIndex + 1);
|
|
14
|
-
return {
|
|
15
|
-
name,
|
|
16
|
-
version: version || "latest",
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function updateDependencyVersionString(packageManager, dependencies, projectPath) {
|
|
20
|
-
const manager = packageManagers[packageManager];
|
|
21
|
-
const packageJsonPath = path.join(projectPath, "package.json");
|
|
22
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
23
|
-
// Initialize dependencies and devDependencies if they don't exist
|
|
24
|
-
packageJson.dependencies = packageJson.dependencies || {};
|
|
25
|
-
packageJson.devDependencies = packageJson.devDependencies || {};
|
|
26
|
-
// Process each dependency string
|
|
27
|
-
for (const dependency of dependencies) {
|
|
28
|
-
const { name, version } = parseDependencyString(dependency);
|
|
29
|
-
// Check if the package exists in either dependencies or devDependencies
|
|
30
|
-
if (name in packageJson.dependencies) {
|
|
31
|
-
packageJson.dependencies[name] = version;
|
|
32
|
-
}
|
|
33
|
-
else if (name in packageJson.devDependencies) {
|
|
34
|
-
packageJson.devDependencies[name] = version;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// Write the updated package.json back to the file
|
|
38
|
-
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf8");
|
|
39
|
-
const installDepsCommand = manager.installDepsCommand;
|
|
40
|
-
const commandOptions = { cwd: projectPath };
|
|
41
|
-
execSync(installDepsCommand, {
|
|
42
|
-
stdio: "inherit",
|
|
43
|
-
...commandOptions,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
export function installDependency(packageManager, dependencies, projectPath, workspace) {
|
|
47
|
-
if (!existsSync(projectPath)) {
|
|
48
|
-
throw new Error(`Project path not found: ${projectPath}`);
|
|
49
|
-
}
|
|
50
|
-
const manager = packageManagers[packageManager];
|
|
51
|
-
let installCommand = manager.installCommand.replace("{{dependency}}", dependencies.join(" "));
|
|
52
|
-
if (workspace) {
|
|
53
|
-
installCommand += ` ${manager.workspaceOption}`;
|
|
54
|
-
}
|
|
55
|
-
const commandOptions = { cwd: projectPath };
|
|
56
|
-
execSync(installCommand, {
|
|
57
|
-
stdio: "inherit",
|
|
58
|
-
...commandOptions,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=dependencies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/utils/dependencies.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../../src/utils/file-system.ts"],"names":[],"mappings":"AAGA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO9D"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { constants } from "node:fs";
|
|
2
|
-
import { access } from "node:fs/promises";
|
|
3
|
-
export async function dirExists(path) {
|
|
4
|
-
try {
|
|
5
|
-
await access(path, constants.F_OK);
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
catch {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=file-system.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../../src/utils/file-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
export declare const HELP_FORMATTING_CONFIG: {
|
|
3
|
-
FIXED_COLUMN_WIDTH: number;
|
|
4
|
-
COMMANDS_TO_PAD: string[];
|
|
5
|
-
DESCRIPTION_PADDING: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Merges CLI help text with the forwarded PH CLI help text
|
|
9
|
-
* @param {string} cliHelp - Commander-generated help text
|
|
10
|
-
* @param {string} forwardedHelp - Help text from the PH CLI
|
|
11
|
-
* @returns {string} Merged help text
|
|
12
|
-
*/
|
|
13
|
-
export declare function mergeHelp(cliHelp: string, forwardedHelp: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* Applies padding to command descriptions for better alignment
|
|
16
|
-
* @param {Command} program - Commander program instance
|
|
17
|
-
*/
|
|
18
|
-
export declare function applyCommandPadding(program: Command): void;
|
|
19
|
-
/**
|
|
20
|
-
* Restores original command descriptions after generating help
|
|
21
|
-
* @param {Command} program - Commander program instance
|
|
22
|
-
*/
|
|
23
|
-
export declare function restoreCommandDescriptions(program: Command): void;
|
|
24
|
-
/**
|
|
25
|
-
* Captures Commander help output as a string
|
|
26
|
-
* @param {Command} program - Commander program instance
|
|
27
|
-
* @returns {string} Help text as a string
|
|
28
|
-
*/
|
|
29
|
-
export declare function captureCommanderHelp(program: Command): string;
|
|
30
|
-
/**
|
|
31
|
-
* Generates and displays the merged help output
|
|
32
|
-
* @param {Command} program - Commander program instance
|
|
33
|
-
*/
|
|
34
|
-
export declare function generateMergedHelp(program: Command): Promise<void>;
|
|
35
|
-
//# sourceMappingURL=help-formatting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help-formatting.d.ts","sourceRoot":"","sources":["../../../src/utils/help-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,eAAO,MAAM,sBAAsB;;;;CAOlC,CAAC;AAiEF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CA2DxE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAS1D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAOjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAe7D;AAeD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BxE"}
|