@powerhousedao/ph-cli 6.0.0-dev.6 → 6.0.0-dev.60
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/scripts/generate-commands-docs.d.ts +2 -0
- package/dist/scripts/generate-commands-docs.d.ts.map +1 -0
- package/dist/scripts/generate-commands-docs.js +41 -0
- package/dist/scripts/generate-commands-docs.js.map +1 -0
- package/dist/scripts/generate-commands-docs.ts +45 -0
- package/dist/src/cli.js +21 -37
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/access-token.d.ts +13 -8
- package/dist/src/commands/access-token.d.ts.map +1 -1
- package/dist/src/commands/access-token.js +100 -79
- package/dist/src/commands/access-token.js.map +1 -1
- package/dist/src/commands/connect.d.ts +248 -18
- package/dist/src/commands/connect.d.ts.map +1 -1
- package/dist/src/commands/connect.js +61 -84
- package/dist/src/commands/connect.js.map +1 -1
- package/dist/src/commands/generate.d.ts +59 -8
- package/dist/src/commands/generate.d.ts.map +1 -1
- package/dist/src/commands/generate.js +24 -40
- package/dist/src/commands/generate.js.map +1 -1
- package/dist/src/commands/index.d.ts +1 -2
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +13 -2
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/inspect.d.ts +11 -5
- package/dist/src/commands/inspect.d.ts.map +1 -1
- package/dist/src/commands/inspect.js +25 -20
- package/dist/src/commands/inspect.js.map +1 -1
- package/dist/src/commands/install.d.ts +21 -14
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +74 -123
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/list.d.ts +9 -8
- package/dist/src/commands/list.d.ts.map +1 -1
- package/dist/src/commands/list.js +37 -32
- package/dist/src/commands/list.js.map +1 -1
- package/dist/src/commands/login.d.ts +23 -11
- package/dist/src/commands/login.d.ts.map +1 -1
- package/dist/src/commands/login.js +105 -118
- package/dist/src/commands/login.js.map +1 -1
- package/dist/src/commands/logout.d.ts +6 -0
- package/dist/src/commands/logout.d.ts.map +1 -0
- package/dist/src/commands/logout.js +13 -0
- package/dist/src/commands/logout.js.map +1 -0
- package/dist/src/commands/migrate.d.ts +11 -9
- package/dist/src/commands/migrate.d.ts.map +1 -1
- package/dist/src/commands/migrate.js +15 -11
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/ph-cli-commands.d.ts +417 -0
- package/dist/src/commands/ph-cli-commands.d.ts.map +1 -0
- package/dist/src/commands/ph-cli-commands.js +27 -0
- package/dist/src/commands/ph-cli-commands.js.map +1 -0
- package/dist/src/commands/ph-cli-help.d.ts +398 -0
- package/dist/src/commands/ph-cli-help.d.ts.map +1 -0
- package/dist/src/commands/ph-cli-help.js +12 -0
- package/dist/src/commands/ph-cli-help.js.map +1 -0
- package/dist/src/commands/ph-cli.d.ts +504 -0
- package/dist/src/commands/ph-cli.d.ts.map +1 -0
- package/dist/src/commands/ph-cli.js +12 -0
- package/dist/src/commands/ph-cli.js.map +1 -0
- package/dist/src/commands/service.d.ts +11 -4
- package/dist/src/commands/service.d.ts.map +1 -1
- package/dist/src/commands/service.js +27 -16
- package/dist/src/commands/service.js.map +1 -1
- package/dist/src/commands/switchboard.d.ts +45 -8
- package/dist/src/commands/switchboard.d.ts.map +1 -1
- package/dist/src/commands/switchboard.js +35 -71
- package/dist/src/commands/switchboard.js.map +1 -1
- package/dist/src/commands/uninstall.d.ts +21 -14
- package/dist/src/commands/uninstall.d.ts.map +1 -1
- package/dist/src/commands/uninstall.js +71 -117
- package/dist/src/commands/uninstall.js.map +1 -1
- package/dist/src/commands/vetra.d.ts +63 -10
- package/dist/src/commands/vetra.d.ts.map +1 -1
- package/dist/src/commands/vetra.js +23 -34
- package/dist/src/commands/vetra.js.map +1 -1
- package/dist/src/get-version.d.ts +2 -0
- package/dist/src/get-version.d.ts.map +1 -0
- package/dist/src/get-version.js +6 -0
- package/dist/src/get-version.js.map +1 -0
- package/dist/src/help.d.ts +3 -3
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +7 -7
- package/dist/src/services/auth.d.ts +5 -53
- package/dist/src/services/auth.d.ts.map +1 -1
- package/dist/src/services/auth.js +11 -159
- package/dist/src/services/auth.js.map +1 -1
- package/dist/src/services/connect-build.d.ts +3 -0
- package/dist/src/services/connect-build.d.ts.map +1 -0
- package/dist/src/services/connect-build.js +24 -0
- package/dist/src/services/connect-build.js.map +1 -0
- package/dist/src/services/connect-preview.d.ts +3 -0
- package/dist/src/services/connect-preview.d.ts.map +1 -0
- package/dist/src/services/connect-preview.js +35 -0
- package/dist/src/services/connect-preview.js.map +1 -0
- package/dist/src/services/connect-studio.d.ts +4 -0
- package/dist/src/services/connect-studio.d.ts.map +1 -0
- package/dist/src/services/connect-studio.js +30 -0
- package/dist/src/services/connect-studio.js.map +1 -0
- package/dist/src/services/generate.d.ts +2 -29
- package/dist/src/services/generate.d.ts.map +1 -1
- package/dist/src/services/generate.js +55 -75
- package/dist/src/services/generate.js.map +1 -1
- package/dist/src/services/inspect.d.ts +2 -4
- package/dist/src/services/inspect.d.ts.map +1 -1
- package/dist/src/services/inspect.js +7 -6
- package/dist/src/services/inspect.js.map +1 -1
- package/dist/src/services/migrate.d.ts +2 -6
- package/dist/src/services/migrate.d.ts.map +1 -1
- package/dist/src/services/migrate.js +52 -14
- package/dist/src/services/migrate.js.map +1 -1
- package/dist/src/services/switchboard.d.ts +3 -34
- package/dist/src/services/switchboard.d.ts.map +1 -1
- package/dist/src/services/switchboard.js +7 -7
- package/dist/src/services/switchboard.js.map +1 -1
- package/dist/src/services/vetra.d.ts +2 -14
- package/dist/src/services/vetra.d.ts.map +1 -1
- package/dist/src/services/vetra.js +109 -88
- package/dist/src/services/vetra.js.map +1 -1
- package/dist/src/types.d.ts +26 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/assign-env-vars.d.ts +3 -0
- package/dist/src/utils/assign-env-vars.d.ts.map +1 -0
- package/dist/src/utils/assign-env-vars.js +11 -0
- package/dist/src/utils/assign-env-vars.js.map +1 -0
- package/dist/src/utils/constants.d.ts +2 -0
- package/dist/src/utils/constants.d.ts.map +1 -0
- package/dist/src/utils/constants.js +2 -0
- package/dist/src/utils/constants.js.map +1 -0
- package/dist/src/utils/resolve-connect-dirs.d.ts +7 -0
- package/dist/src/utils/resolve-connect-dirs.d.ts.map +1 -0
- package/dist/src/utils/resolve-connect-dirs.js +16 -0
- package/dist/src/utils/resolve-connect-dirs.js.map +1 -0
- package/dist/src/utils.d.ts +0 -4
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -29
- 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-commands-md.ts +0 -84
- package/dist/src/commands/help.d.ts +0 -3
- package/dist/src/commands/help.d.ts.map +0 -1
- package/dist/src/commands/help.js +0 -9
- package/dist/src/commands/help.js.map +0 -1
- package/dist/src/commands/register-commands.d.ts +0 -5
- package/dist/src/commands/register-commands.d.ts.map +0 -1
- package/dist/src/commands/register-commands.js +0 -32
- package/dist/src/commands/register-commands.js.map +0 -1
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -5
- package/dist/src/index.js.map +0 -1
- package/dist/src/services/connect.d.ts +0 -2
- package/dist/src/services/connect.d.ts.map +0 -1
- package/dist/src/services/connect.js +0 -2
- package/dist/src/services/connect.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/test/utils.test.d.ts +0 -2
- package/dist/test/utils.test.d.ts.map +0 -1
- package/dist/test/utils.test.js +0 -132
- package/dist/test/utils.test.js.map +0 -1
|
@@ -1,14 +1,25 @@
|
|
|
1
|
+
// export * from "./access-token.old.js";
|
|
1
2
|
export * from "./access-token.js";
|
|
3
|
+
// export * from "./connect.old.js";
|
|
2
4
|
export * from "./connect.js";
|
|
5
|
+
// export * from "./generate.old.js";
|
|
3
6
|
export * from "./generate.js";
|
|
4
|
-
export * from "./
|
|
7
|
+
// export * from "./inspect.old.js";
|
|
5
8
|
export * from "./inspect.js";
|
|
9
|
+
// export * from "./install.old.js";
|
|
6
10
|
export * from "./install.js";
|
|
11
|
+
// export * from "./list.old.js";
|
|
7
12
|
export * from "./list.js";
|
|
13
|
+
// export * from "./login.old.js";
|
|
8
14
|
export * from "./login.js";
|
|
9
|
-
export * from "./
|
|
15
|
+
// export * from "./migrate.old.js";
|
|
16
|
+
export * from "./migrate.js";
|
|
17
|
+
// export * from "./service.old.js";
|
|
10
18
|
export * from "./service.js";
|
|
19
|
+
// export * from "./switchboard.old.js";
|
|
11
20
|
export * from "./switchboard.js";
|
|
21
|
+
// export * from "./uninstall.old.js";
|
|
12
22
|
export * from "./uninstall.js";
|
|
23
|
+
// export * from "./vetra.old.js";
|
|
13
24
|
export * from "./vetra.js";
|
|
14
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,mBAAmB,CAAC;AAClC,oCAAoC;AACpC,cAAc,cAAc,CAAC;AAC7B,qCAAqC;AACrC,cAAc,eAAe,CAAC;AAC9B,oCAAoC;AACpC,cAAc,cAAc,CAAC;AAC7B,oCAAoC;AACpC,cAAc,cAAc,CAAC;AAC7B,iCAAiC;AACjC,cAAc,WAAW,CAAC;AAC1B,kCAAkC;AAClC,cAAc,YAAY,CAAC;AAC3B,oCAAoC;AACpC,cAAc,cAAc,CAAC;AAC7B,oCAAoC;AACpC,cAAc,cAAc,CAAC;AAC7B,wCAAwC;AACxC,cAAc,kBAAkB,CAAC;AACjC,sCAAsC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,kCAAkC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export declare const inspect: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
3
|
+
debug: boolean | undefined;
|
|
4
|
+
packageName: string;
|
|
5
|
+
}>>;
|
|
6
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
7
|
+
debug: boolean | undefined;
|
|
8
|
+
packageName: string;
|
|
9
|
+
}, Promise<never>> & {
|
|
10
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<never>>>;
|
|
11
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
6
12
|
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/commands/inspect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/commands/inspect.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;;;;;;;6JAsBlB,CAAC"}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
}
|
|
1
|
+
import { inspectArgs } from "@powerhousedao/common/clis";
|
|
2
|
+
import { command } from "cmd-ts";
|
|
3
|
+
export const inspect = command({
|
|
4
|
+
name: "inspect",
|
|
5
|
+
description: `
|
|
6
|
+
The inspect command examines and provides detailed information about a Powerhouse package.
|
|
7
|
+
It helps you understand the structure, dependencies, and configuration of packages in
|
|
8
|
+
your project.
|
|
9
|
+
|
|
10
|
+
This command:
|
|
11
|
+
1. Analyzes the specified package
|
|
12
|
+
2. Retrieves detailed information about its structure and configuration
|
|
13
|
+
3. Displays package metadata, dependencies, and other relevant information
|
|
14
|
+
4. Helps troubleshoot package-related issues`,
|
|
15
|
+
aliases: ["is"],
|
|
16
|
+
args: inspectArgs,
|
|
17
|
+
handler: async (args) => {
|
|
18
|
+
if (args.debug) {
|
|
19
|
+
console.log(args);
|
|
20
|
+
}
|
|
21
|
+
const { startInspect } = await import("../services/inspect.js");
|
|
22
|
+
startInspect(args);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
21
26
|
//# sourceMappingURL=inspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../src/commands/inspect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../src/commands/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;IAC7B,IAAI,EAAE,SAAS;IACf,WAAW,EAAE;;;;;;;;;6CAS8B;IAC3C,OAAO,EAAE,CAAC,IAAI,CAAC;IACf,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QACD,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;QAChE,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
export declare const install: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
3
|
+
debug: boolean | undefined;
|
|
4
|
+
packageManager: import("package-manager-detector").Agent | undefined;
|
|
5
|
+
npm: boolean | undefined;
|
|
6
|
+
pnpm: boolean | undefined;
|
|
7
|
+
yarn: boolean | undefined;
|
|
8
|
+
bun: boolean | undefined;
|
|
9
|
+
dependencies: string[];
|
|
10
|
+
}>>;
|
|
11
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
12
|
+
debug: boolean | undefined;
|
|
13
|
+
packageManager: import("package-manager-detector").Agent | undefined;
|
|
14
|
+
npm: boolean | undefined;
|
|
15
|
+
pnpm: boolean | undefined;
|
|
16
|
+
yarn: boolean | undefined;
|
|
17
|
+
bun: boolean | undefined;
|
|
18
|
+
dependencies: string[];
|
|
19
|
+
}, Promise<never>> & {
|
|
20
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<never>>>;
|
|
21
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
15
22
|
//# sourceMappingURL=install.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;6JAuFlB,CAAC"}
|
|
@@ -1,127 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
// Parse package names to extract version/tag
|
|
24
|
-
const parsedDependencies = dependencies.map((dep) => {
|
|
25
|
-
// Handle scoped packages (@org/package[@version])
|
|
26
|
-
if (dep.startsWith("@")) {
|
|
27
|
-
const matches = /^(@[^/]+\/[^@]+)(?:@(.+))?$/.exec(dep);
|
|
28
|
-
if (!matches) {
|
|
29
|
-
throw new Error(`Invalid scoped package name format: ${dep}`);
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
name: matches[1],
|
|
33
|
-
version: matches[2] || "latest",
|
|
34
|
-
full: dep,
|
|
35
|
-
};
|
|
1
|
+
import { getPowerhouseProjectInfo, getPowerhouseProjectInstallCommand, installArgs, makeDependenciesWithVersions, } from "@powerhousedao/common/clis";
|
|
2
|
+
import { execSync } from "child_process";
|
|
3
|
+
import { command } from "cmd-ts";
|
|
4
|
+
import { updateConfigFile, updateStylesFile } from "../utils.js";
|
|
5
|
+
export const install = command({
|
|
6
|
+
name: "install",
|
|
7
|
+
aliases: ["add", "i"],
|
|
8
|
+
description: `
|
|
9
|
+
The install command adds Powerhouse dependencies to your project. It handles installation
|
|
10
|
+
of packages, updates configuration files, and ensures proper setup of dependencies.
|
|
11
|
+
|
|
12
|
+
This command:
|
|
13
|
+
1. Installs specified Powerhouse dependencies using your package manager
|
|
14
|
+
2. Updates powerhouse.config.json to include the new dependencies
|
|
15
|
+
3. Supports various installation options and configurations
|
|
16
|
+
4. Works with npm, yarn, pnpm, and bun package managers
|
|
17
|
+
`,
|
|
18
|
+
args: installArgs,
|
|
19
|
+
handler: async (args) => {
|
|
20
|
+
if (args.debug) {
|
|
21
|
+
console.log(args);
|
|
36
22
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
throw new Error(`Invalid package name format: ${dep}`);
|
|
23
|
+
const { projectPath, localProjectPath, globalProjectPath, packageManager, isGlobal, } = await getPowerhouseProjectInfo(args);
|
|
24
|
+
if (!projectPath) {
|
|
25
|
+
throw new Error(`Could not find project path to install from.`);
|
|
41
26
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
full: dep,
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
if (options.debug) {
|
|
49
|
-
console.log(">>> parsedDependencies", parsedDependencies);
|
|
50
|
-
}
|
|
51
|
-
if (!dependencies || dependencies.length === 0) {
|
|
52
|
-
throw new Error("❌ Dependency name is required");
|
|
53
|
-
}
|
|
54
|
-
if (options.packageManager &&
|
|
55
|
-
!SUPPORTED_PACKAGE_MANAGERS.includes(options.packageManager)) {
|
|
56
|
-
throw new Error("❌ Unsupported package manager. Supported package managers: npm, yarn, pnpm, bun");
|
|
57
|
-
}
|
|
58
|
-
const projectInfo = getProjectInfo(options.debug);
|
|
59
|
-
if (options.debug) {
|
|
60
|
-
console.log("\n>>> projectInfo", projectInfo);
|
|
61
|
-
}
|
|
62
|
-
const isGlobal = options.global || projectInfo.isGlobal;
|
|
63
|
-
const packageManager = options.packageManager || getPackageManagerFromLockfile(projectInfo.path);
|
|
64
|
-
if (options.debug) {
|
|
65
|
-
console.log("\n>>> installDependency arguments:");
|
|
66
|
-
console.log(">>> packageManager", packageManager);
|
|
67
|
-
console.log(">>> dependencies", dependencies);
|
|
68
|
-
console.log(">>> isGlobal", isGlobal);
|
|
69
|
-
console.log(">>> projectPath", projectInfo.path);
|
|
70
|
-
console.log(">>> workspace", options.workspace);
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
console.log("installing dependencies 📦 ...");
|
|
74
|
-
if (!fs.existsSync(projectInfo.path)) {
|
|
75
|
-
throw new Error(`Project path not found: ${projectInfo.path}`);
|
|
27
|
+
const dependenciesWithVersions = await makeDependenciesWithVersions(args.dependencies);
|
|
28
|
+
if (args.debug) {
|
|
29
|
+
console.log(">>> parsedDependencies", dependenciesWithVersions);
|
|
76
30
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.action(install);
|
|
125
|
-
setCustomHelp(command, installHelp);
|
|
126
|
-
}
|
|
31
|
+
if (args.debug) {
|
|
32
|
+
console.log("\n>>> projectInfo", {
|
|
33
|
+
localProjectPath,
|
|
34
|
+
globalProjectPath,
|
|
35
|
+
packageManager,
|
|
36
|
+
isGlobal,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
console.log("installing dependencies 📦 ...");
|
|
41
|
+
const installCommand = getPowerhouseProjectInstallCommand(packageManager);
|
|
42
|
+
execSync(installCommand, {
|
|
43
|
+
stdio: "inherit",
|
|
44
|
+
cwd: projectPath,
|
|
45
|
+
});
|
|
46
|
+
console.log("Dependency installed successfully 🎉");
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error("❌ Failed to install dependencies");
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
if (args.debug) {
|
|
53
|
+
console.log("\n>>> updateConfigFile arguments:");
|
|
54
|
+
console.log(">>> dependencies", args.dependencies);
|
|
55
|
+
console.log(">>> projectPath", projectPath);
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
console.log("⚙️ Updating powerhouse config file...");
|
|
59
|
+
updateConfigFile(dependenciesWithVersions, projectPath, "install");
|
|
60
|
+
console.log("Config file updated successfully 🎉");
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error("❌ Failed to update config file");
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
console.log("⚙️ Updating styles.css file...");
|
|
68
|
+
updateStylesFile(dependenciesWithVersions, projectPath);
|
|
69
|
+
console.log("Styles file updated successfully 🎉");
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error("❌ Failed to update styles file");
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
process.exit(0);
|
|
76
|
+
},
|
|
77
|
+
});
|
|
127
78
|
//# sourceMappingURL=install.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,kCAAkC,EAClC,WAAW,EACX,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;IAC7B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;IACrB,WAAW,EAAE;;;;;;;;;GASZ;IACD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;Y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AG,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAC9C,CAAC;QAED,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;YACrD,gBAAgB,CAAC,wBAAwB,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAChD,MAAM,KAAK,CAAC;QACd,CAAC;QAED,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;YAC9C,gBAAgB,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAChD,MAAM,KAAK,CAAC;QACd,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare const list: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
3
|
+
debug: boolean | undefined;
|
|
4
|
+
}>>;
|
|
5
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
6
|
+
debug: boolean | undefined;
|
|
7
|
+
}, Promise<void>> & {
|
|
8
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<void>>>;
|
|
9
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
9
10
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;;6JAyCf,CAAC"}
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
+
import { getPowerhouseProjectInfo, listArgs } from "@powerhousedao/common/clis";
|
|
1
2
|
import { getConfig } from "@powerhousedao/config/node";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { command } from "cmd-ts";
|
|
4
|
+
export const list = command({
|
|
5
|
+
name: "list",
|
|
6
|
+
description: `
|
|
7
|
+
The list command displays information about installed Powerhouse packages in your project.
|
|
8
|
+
It reads the powerhouse.config.json file and shows the packages that are currently installed.
|
|
9
|
+
|
|
10
|
+
This command:
|
|
11
|
+
1. Examines your project configuration
|
|
12
|
+
2. Lists all installed Powerhouse packages
|
|
13
|
+
3. Provides a clear overview of your project's dependencies
|
|
14
|
+
4. Helps you manage and track your Powerhouse components
|
|
15
|
+
`,
|
|
16
|
+
aliases: ["l"],
|
|
17
|
+
args: listArgs,
|
|
18
|
+
handler: async (args) => {
|
|
19
|
+
if (args.debug) {
|
|
20
|
+
console.log(args);
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const projectInfo = await getPowerhouseProjectInfo();
|
|
24
|
+
console.log("\n>>> projectInfo", projectInfo);
|
|
25
|
+
const phConfig = getConfig(projectInfo.projectPath + "/powerhouse.config.json");
|
|
26
|
+
if (!phConfig.packages || phConfig.packages.length === 0) {
|
|
27
|
+
console.log("No packages found in the project");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
console.log("Installed Packages:\n");
|
|
31
|
+
phConfig.packages.forEach((pkg) => {
|
|
32
|
+
console.log(pkg.packageName);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
15
36
|
console.log("No packages found in the project");
|
|
16
|
-
return;
|
|
17
37
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
console.log("No packages found in the project");
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
export function listCommand(program) {
|
|
28
|
-
const command = program
|
|
29
|
-
.command("list")
|
|
30
|
-
.alias("l")
|
|
31
|
-
.description("List installed packages")
|
|
32
|
-
.option("--debug", "Show additional logs")
|
|
33
|
-
.action(list);
|
|
34
|
-
setCustomHelp(command, listHelp);
|
|
35
|
-
}
|
|
38
|
+
process.exit(0);
|
|
39
|
+
},
|
|
40
|
+
});
|
|
36
41
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAA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@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export declare const login: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
3
|
+
debug: boolean | undefined;
|
|
4
|
+
renownUrl: string;
|
|
5
|
+
timeout: number;
|
|
6
|
+
logout: boolean | undefined;
|
|
7
|
+
status: boolean | undefined;
|
|
8
|
+
showDid: boolean | undefined;
|
|
9
|
+
}>>;
|
|
10
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
11
|
+
debug: boolean | undefined;
|
|
12
|
+
renownUrl: string;
|
|
13
|
+
timeout: number;
|
|
14
|
+
logout: boolean | undefined;
|
|
15
|
+
status: boolean | undefined;
|
|
16
|
+
showDid: boolean | undefined;
|
|
17
|
+
}, Promise<never>> & {
|
|
18
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<never>>>;
|
|
19
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
20
|
+
/**
|
|
21
|
+
* Logout and clear credentials
|
|
22
|
+
*/
|
|
23
|
+
export declare function handleLogout(): Promise<void>;
|
|
12
24
|
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/login.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/login.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;6JAsGhB,CAAC;AAkIH;;GAEG;AACH,wBAAsB,YAAY,kBAejC"}
|