ph-cmd 5.2.0-staging.9 → 5.3.0-staging.1
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/src/cli.js +30 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/__tests__/update.test.js +1 -1
- package/dist/src/commands/__tests__/update.test.js.map +1 -1
- package/dist/src/commands/__tests__/use.test.js +1 -1
- package/dist/src/commands/__tests__/use.test.js.map +1 -1
- package/dist/src/commands/index.d.ts +1 -4
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +1 -7
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.d.ts +1 -21
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +153 -65
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/setup-globals.js +1 -1
- package/dist/src/commands/setup-globals.js.map +1 -1
- package/dist/src/commands/update.d.ts +1 -12
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +92 -101
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/update.old.d.ts +13 -0
- package/dist/src/commands/update.old.d.ts.map +1 -0
- package/dist/src/commands/update.old.js +105 -0
- package/dist/src/commands/update.old.js.map +1 -0
- package/dist/src/commands/use-local.d.ts +2 -0
- package/dist/src/commands/use-local.d.ts.map +1 -0
- package/dist/src/commands/use-local.js +115 -0
- package/dist/src/commands/use-local.js.map +1 -0
- package/dist/src/commands/use.d.ts +1 -49
- package/dist/src/commands/use.d.ts.map +1 -1
- package/dist/src/commands/use.js +106 -188
- package/dist/src/commands/use.js.map +1 -1
- package/dist/src/commands/use.old.d.ts +55 -0
- package/dist/src/commands/use.old.d.ts.map +1 -0
- package/dist/src/commands/use.old.js +219 -0
- package/dist/src/commands/use.old.js.map +1 -0
- package/dist/src/help.d.ts +1 -1
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +12 -7
- package/dist/src/help.js.map +1 -1
- package/dist/src/utils/constants.d.ts +4 -0
- package/dist/src/utils/constants.d.ts.map +1 -1
- package/dist/src/utils/constants.js +26 -0
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/file-system.d.ts +2 -0
- package/dist/src/utils/file-system.d.ts.map +1 -0
- package/dist/src/utils/file-system.js +12 -0
- package/dist/src/utils/file-system.js.map +1 -0
- package/dist/src/utils/help-formatting.d.ts.map +1 -1
- package/dist/src/utils/help-formatting.js +13 -1
- package/dist/src/utils/help-formatting.js.map +1 -1
- package/dist/src/utils/package-manager.d.ts +0 -7
- package/dist/src/utils/package-manager.d.ts.map +1 -1
- package/dist/src/utils/package-manager.js +3 -22
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/parsing.d.ts +20 -0
- package/dist/src/utils/parsing.d.ts.map +1 -0
- package/dist/src/utils/parsing.js +52 -0
- package/dist/src/utils/parsing.js.map +1 -0
- package/dist/src/utils/run-cmd.d.ts +2 -0
- package/dist/src/utils/run-cmd.d.ts.map +1 -0
- package/dist/src/utils/run-cmd.js +11 -0
- package/dist/src/utils/run-cmd.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -3
package/dist/src/commands/use.js
CHANGED
|
@@ -1,199 +1,117 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { getPackageVersion } from "@powerhousedao/codegen/utils";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { boolean, command, flag, oneOf, option, optional, positional, run, string, } from "cmd-ts";
|
|
4
|
+
import { detect } from "package-manager-detector/detect";
|
|
5
|
+
import { readPackage } from "read-pkg";
|
|
6
|
+
import { clean, valid } from "semver";
|
|
7
|
+
import { writePackage } from "write-package";
|
|
8
|
+
import { ALL_POWERHOUSE_DEPENDENCIES } from "../utils/constants.js";
|
|
9
|
+
import { handleMutuallyExclusiveOptions, logVersionUpdate, } from "../utils/parsing.js";
|
|
10
|
+
import { runCmd } from "../utils/run-cmd.js";
|
|
11
|
+
const commandParser = command({
|
|
12
|
+
name: "ph use",
|
|
13
|
+
description: "Specify the release version of Powerhouse dependencies to use.\nTo use a release tag, specify `staging`, `dev`, or `latest` as the first argument to this command or with the --tag option.\n You can also use a specific version with the --version option.",
|
|
14
|
+
args: {
|
|
15
|
+
tagPositional: positional({
|
|
16
|
+
type: optional(oneOf(["latest", "staging", "dev"])),
|
|
17
|
+
displayName: "tag",
|
|
18
|
+
description: `Specify the release tag to use for your project. Can be one of: "latest", "staging", or "dev".`,
|
|
19
|
+
}),
|
|
20
|
+
tagOption: option({
|
|
21
|
+
type: optional(oneOf(["latest", "staging", "dev"])),
|
|
22
|
+
long: "tag",
|
|
23
|
+
short: "t",
|
|
24
|
+
description: `Specify the release tag to use for your project. Can be one of: "latest", "staging", or "dev".`,
|
|
25
|
+
}),
|
|
26
|
+
version: option({
|
|
27
|
+
type: optional(string),
|
|
28
|
+
long: "version",
|
|
29
|
+
short: "v",
|
|
30
|
+
description: "Specify the exact semver release version to use for your project.",
|
|
31
|
+
}),
|
|
32
|
+
skipInstall: flag({
|
|
33
|
+
type: optional(boolean),
|
|
34
|
+
long: "skip-install",
|
|
35
|
+
short: "s",
|
|
36
|
+
description: "Skip running `install` with your package manager",
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
handler: async ({ tagPositional, tagOption, version, skipInstall }) => {
|
|
40
|
+
const tag = tagPositional ?? tagOption;
|
|
41
|
+
handleMutuallyExclusiveOptions({ tag, version }, "versioning strategy");
|
|
42
|
+
if (!tag && !version) {
|
|
43
|
+
throw new Error("Please specify either a release tag or a version to use.");
|
|
38
44
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
SPECIAL_PACKAGES.forEach((pkg) => {
|
|
42
|
-
if (allDependencies[pkg]) {
|
|
43
|
-
powerhousePackages.push(pkg);
|
|
45
|
+
if (version && !valid(clean(version))) {
|
|
46
|
+
throw new Error(`❌ Invalid version: ${chalk.bold(version)}`);
|
|
44
47
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
path.join(localPath, "packages"),
|
|
58
|
-
path.join(localPath, "apps"),
|
|
59
|
-
path.join(localPath, "clis"),
|
|
60
|
-
];
|
|
61
|
-
for (const searchDir of searchDirs) {
|
|
62
|
-
if (!existsSync(searchDir))
|
|
63
|
-
continue;
|
|
64
|
-
try {
|
|
65
|
-
// Read all subdirectories
|
|
66
|
-
const subdirs = readdirSync(searchDir, { withFileTypes: true })
|
|
67
|
-
.filter((dirent) => dirent.isDirectory())
|
|
68
|
-
.map((dirent) => dirent.name);
|
|
69
|
-
// Check each subdirectory's package.json
|
|
70
|
-
for (const subdir of subdirs) {
|
|
71
|
-
const packageJsonPath = path.join(searchDir, subdir, "package.json");
|
|
72
|
-
if (existsSync(packageJsonPath)) {
|
|
73
|
-
try {
|
|
74
|
-
const content = readFileSync(packageJsonPath, "utf-8");
|
|
75
|
-
const pkg = JSON.parse(content);
|
|
76
|
-
if (pkg.name === packageName) {
|
|
77
|
-
return path.join(searchDir, subdir);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
// Ignore invalid package.json files
|
|
82
|
-
}
|
|
48
|
+
console.log(`▶️ Updating project to use ${chalk.bold(version ?? tag)}...\n`);
|
|
49
|
+
const packageJson = await readPackage();
|
|
50
|
+
if (packageJson.dependencies) {
|
|
51
|
+
for (const [name, existingVersion] of Object.entries(packageJson.dependencies)) {
|
|
52
|
+
if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {
|
|
53
|
+
const newVersion = await getPackageVersion({ name, tag, version });
|
|
54
|
+
packageJson.dependencies[name] = newVersion;
|
|
55
|
+
logVersionUpdate({
|
|
56
|
+
name,
|
|
57
|
+
version: existingVersion,
|
|
58
|
+
newVersion,
|
|
59
|
+
});
|
|
83
60
|
}
|
|
84
61
|
}
|
|
85
62
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
63
|
+
if (packageJson.devDependencies) {
|
|
64
|
+
for (const [name, existingVersion] of Object.entries(packageJson.devDependencies)) {
|
|
65
|
+
if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {
|
|
66
|
+
const newVersion = await getPackageVersion({ name, tag, version });
|
|
67
|
+
packageJson.devDependencies[name] = newVersion;
|
|
68
|
+
logVersionUpdate({
|
|
69
|
+
name,
|
|
70
|
+
version: existingVersion,
|
|
71
|
+
newVersion,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
89
75
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
export const updatePackageJson = async (env, localPath, packageManager, debug, useResolved) => {
|
|
104
|
-
const projectInfo = await getProjectInfo();
|
|
105
|
-
const pkgManager = packageManager || getPackageManagerFromLockfile(projectInfo.path);
|
|
106
|
-
if (debug) {
|
|
107
|
-
console.log(">>> projectInfo", projectInfo);
|
|
108
|
-
console.log(">>> pkgManager", pkgManager);
|
|
109
|
-
}
|
|
110
|
-
// Read the project's package.json
|
|
111
|
-
const packageJsonPath = path.join(projectInfo.path, "package.json");
|
|
112
|
-
const packageJsonContent = readFileSync(packageJsonPath, "utf-8");
|
|
113
|
-
const packageJson = JSON.parse(packageJsonContent);
|
|
114
|
-
// Detect all Powerhouse packages from the current package.json
|
|
115
|
-
const powerhousePackages = detectPowerhousePackages(packageJson);
|
|
116
|
-
const dependencies = [];
|
|
117
|
-
if (localPath) {
|
|
118
|
-
// For local path, map each detected package to its monorepo path
|
|
119
|
-
powerhousePackages.forEach((packageName) => {
|
|
120
|
-
const fullPath = mapPackageToMonorepoPath(packageName, localPath);
|
|
121
|
-
dependencies.push(fullPath);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
// For remote dependencies, add version tags
|
|
126
|
-
powerhousePackages.forEach((packageName) => {
|
|
127
|
-
dependencies.push(`${packageName}@${ENV_MAP[env]}`);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
if (debug) {
|
|
131
|
-
console.log(">>> dependencies to update", dependencies);
|
|
132
|
-
}
|
|
133
|
-
if (dependencies.length === 0) {
|
|
134
|
-
console.log("ℹ️ No Powerhouse dependencies found to update");
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
try {
|
|
138
|
-
console.log("⚙️ Updating dependencies...");
|
|
139
|
-
if (localPath || useResolved) {
|
|
140
|
-
installDependency(pkgManager, dependencies, projectInfo.path);
|
|
76
|
+
if (packageJson.optionalDependencies) {
|
|
77
|
+
for (const [name, existingVersion] of Object.entries(packageJson.optionalDependencies)) {
|
|
78
|
+
if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {
|
|
79
|
+
const newVersion = await getPackageVersion({ name, tag, version });
|
|
80
|
+
packageJson.optionalDependencies[name] = newVersion;
|
|
81
|
+
logVersionUpdate({
|
|
82
|
+
name,
|
|
83
|
+
version: existingVersion,
|
|
84
|
+
newVersion,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
141
88
|
}
|
|
142
|
-
|
|
143
|
-
|
|
89
|
+
if (packageJson.peerDependencies) {
|
|
90
|
+
for (const [name, existingVersion] of Object.entries(packageJson.peerDependencies)) {
|
|
91
|
+
if (existingVersion && ALL_POWERHOUSE_DEPENDENCIES.includes(name)) {
|
|
92
|
+
const newVersion = await getPackageVersion({ name, tag, version });
|
|
93
|
+
packageJson.peerDependencies[name] = newVersion;
|
|
94
|
+
logVersionUpdate({
|
|
95
|
+
name,
|
|
96
|
+
version: existingVersion,
|
|
97
|
+
newVersion,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
144
101
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
export const use = async (environment, localPath, options) => {
|
|
153
|
-
if (!environment ||
|
|
154
|
-
(!options.force &&
|
|
155
|
-
environment !== "local" &&
|
|
156
|
-
!Object.keys(ENV_MAP).includes(environment))) {
|
|
157
|
-
throw new Error(`❌ Invalid environment, use --force or use one of the following: ${Object.keys(ENV_MAP).join(", ")}`);
|
|
158
|
-
}
|
|
159
|
-
if (environment === "local" && !localPath) {
|
|
160
|
-
throw new Error("❌ Local environment requires a local path, please specify the path to the local environment");
|
|
161
|
-
}
|
|
162
|
-
const { debug } = options;
|
|
163
|
-
const env = environment;
|
|
164
|
-
if (debug) {
|
|
165
|
-
console.log(">>> options", options);
|
|
166
|
-
}
|
|
167
|
-
const projectInfo = await getProjectInfo();
|
|
168
|
-
const packageManager = resolvePackageManagerOptions(options) ??
|
|
169
|
-
getPackageManagerFromLockfile(projectInfo.path);
|
|
170
|
-
await updatePackageJson(env, localPath, packageManager, debug, options.useResolved);
|
|
171
|
-
};
|
|
172
|
-
export function useCommand(program) {
|
|
173
|
-
const useCmd = program
|
|
174
|
-
.command("use")
|
|
175
|
-
.description("Allows you to change your environment (latest, development, production, local)")
|
|
176
|
-
.argument("[environment]", "The environment to use (latest, dev, prod, local)")
|
|
177
|
-
.argument("[localPath]", "The path to the local environment (you have to specify the path to the local environment)")
|
|
178
|
-
.option("--force", "force environment to use")
|
|
179
|
-
.option("--use-resolved", "Use resolved dependency versions")
|
|
180
|
-
.option("--package-manager <packageManager>", "package manager to be used")
|
|
181
|
-
.option("--pnpm", "Use 'pnpm' as package manager")
|
|
182
|
-
.option("--yarn", "Use 'yarn' as package manager")
|
|
183
|
-
.option("--bun", "Use 'bun' as package manager")
|
|
184
|
-
.option("--debug", "Show additional logs");
|
|
185
|
-
// Use withCustomHelp instead of withHelpAction and addHelpText
|
|
186
|
-
return withCustomHelp(useCmd, use, useHelp,
|
|
187
|
-
// Pre-check function to validate environment before running the action
|
|
188
|
-
(environment) => {
|
|
189
|
-
if (!environment &&
|
|
190
|
-
!process.argv.includes("--help") &&
|
|
191
|
-
!process.argv.includes("-h")) {
|
|
192
|
-
console.error('Error: Missing required argument "environment"');
|
|
193
|
-
process.exit(1);
|
|
194
|
-
return false;
|
|
102
|
+
await writePackage(packageJson);
|
|
103
|
+
console.log(chalk.green(`\n✅ Project updated to use ${chalk.bold(version ?? tag)}\n`));
|
|
104
|
+
if (skipInstall)
|
|
105
|
+
return;
|
|
106
|
+
const packageManager = await detect();
|
|
107
|
+
if (!packageManager) {
|
|
108
|
+
throw new Error(`❌ Failed to detect your package manager. Run install manually.`);
|
|
195
109
|
}
|
|
196
|
-
|
|
197
|
-
|
|
110
|
+
console.log(`▶️ Installing updated dependencies with \`${packageManager.agent}\`\n`);
|
|
111
|
+
runCmd(`${packageManager.agent} install`);
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
export async function use(args) {
|
|
115
|
+
await run(commandParser, args);
|
|
198
116
|
}
|
|
199
117
|
//# sourceMappingURL=use.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/commands/use.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/commands/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,GAAG,EACH,MAAM,GACP,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,8BAA8B,EAC9B,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,aAAa,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,8PAA8P;IAChQ,IAAI,EAAE;QACJ,aAAa,EAAE,UAAU,CAAC;YACxB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;YACnD,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,gGAAgG;SAC9G,CAAC;QACF,SAAS,EAAE,MAAM,CAAC;YAChB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;YACnD,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,GAAG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CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CommandActionType } from "../types.js";
|
|
3
|
+
import type { PackageManager } from "../utils/index.js";
|
|
4
|
+
export declare const ORG = "@powerhousedao";
|
|
5
|
+
export declare const SPECIAL_PACKAGES: string[];
|
|
6
|
+
export declare const EXCLUDED_PACKAGES: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Detects all Powerhouse packages from package.json dependencies
|
|
9
|
+
* @param packageJson - The parsed package.json object
|
|
10
|
+
* @returns Array of package names to process
|
|
11
|
+
*/
|
|
12
|
+
export declare function detectPowerhousePackages(packageJson: {
|
|
13
|
+
dependencies?: Record<string, string>;
|
|
14
|
+
devDependencies?: Record<string, string>;
|
|
15
|
+
}): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Maps a package name to its monorepo directory path by reading package.json files
|
|
18
|
+
* @param packageName - The package name (e.g., '@powerhousedao/common' or 'document-model')
|
|
19
|
+
* @param localPath - The base path to the monorepo
|
|
20
|
+
* @returns The full path to the package directory
|
|
21
|
+
*/
|
|
22
|
+
export declare function mapPackageToMonorepoPath(packageName: string, localPath: string): string;
|
|
23
|
+
export declare const ENV_MAP: {
|
|
24
|
+
dev: string;
|
|
25
|
+
staging: string;
|
|
26
|
+
prod: string;
|
|
27
|
+
latest: string;
|
|
28
|
+
};
|
|
29
|
+
export type Environment = keyof typeof ENV_MAP;
|
|
30
|
+
/**
|
|
31
|
+
* Checks if a string is a valid semver version
|
|
32
|
+
* Supports formats like: 1.0.0, 1.0.0-beta.1, 1.0.0-dev.123, v1.0.0
|
|
33
|
+
*/
|
|
34
|
+
export declare function isVersionString(str: string): boolean;
|
|
35
|
+
export declare const updatePackageJson: (envOrVersion: (typeof ENV_MAP)[keyof typeof ENV_MAP], localPath?: string, packageManager?: PackageManager, debug?: boolean, useResolved?: boolean) => Promise<void>;
|
|
36
|
+
export type UseOptions = {
|
|
37
|
+
dev?: boolean;
|
|
38
|
+
prod?: boolean;
|
|
39
|
+
local?: string;
|
|
40
|
+
debug?: boolean;
|
|
41
|
+
latest?: boolean;
|
|
42
|
+
force?: boolean;
|
|
43
|
+
packageManager?: string;
|
|
44
|
+
pnpm?: boolean;
|
|
45
|
+
yarn?: boolean;
|
|
46
|
+
bun?: boolean;
|
|
47
|
+
useResolved?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare const use: CommandActionType<[
|
|
50
|
+
string | undefined,
|
|
51
|
+
string | undefined,
|
|
52
|
+
UseOptions
|
|
53
|
+
]>;
|
|
54
|
+
export declare function useCommand(program: Command): Command;
|
|
55
|
+
//# sourceMappingURL=use.old.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.old.d.ts","sourceRoot":"","sources":["../../../src/commands/use.old.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUxD,eAAO,MAAM,GAAG,mBAAmB,CAAC;AAGpC,eAAO,MAAM,gBAAgB,UAI5B,CAAC;AAGF,eAAO,MAAM,iBAAiB,UAS7B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C,GAAG,MAAM,EAAE,CAuBX;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CA2CR;AAED,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,OAAO,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOpD;AAED,eAAO,MAAM,iBAAiB,GAC5B,cAAc,CAAC,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,CAAC,EACpD,YAAY,MAAM,EAClB,iBAAiB,cAAc,EAC/B,QAAQ,OAAO,EACf,cAAc,OAAO,kBAgEtB,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,iBAAiB,CACjC;IAAC,MAAM,GAAG,SAAS;IAAE,MAAM,GAAG,SAAS;IAAE,UAAU;CAAC,CA0CrD,CAAC;AAEF,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAyCpD"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { useHelp } from "../help.js";
|
|
4
|
+
import { getPackageManagerFromLockfile, getProjectInfo, installDependency, updateDependencyVersionString, withCustomHelp, } from "../utils/index.js";
|
|
5
|
+
import { parsePackageManager } from "../utils/parsing.js";
|
|
6
|
+
export const ORG = "@powerhousedao";
|
|
7
|
+
// Special packages that don't use the @powerhousedao organization
|
|
8
|
+
export const SPECIAL_PACKAGES = [
|
|
9
|
+
"document-model",
|
|
10
|
+
"document-drive",
|
|
11
|
+
"@renown/sdk",
|
|
12
|
+
];
|
|
13
|
+
// Packages to exclude from dynamic detection (external dependencies)
|
|
14
|
+
export const EXCLUDED_PACKAGES = [
|
|
15
|
+
"@powerhousedao/document-engineering",
|
|
16
|
+
"@powerhousedao/scalars",
|
|
17
|
+
"@powerhousedao/diff-analyzer",
|
|
18
|
+
"@powerhousedao/analytics-engine-core",
|
|
19
|
+
"@powerhousedao/analytics-engine-graphql",
|
|
20
|
+
"@powerhousedao/analytics-engine-pg",
|
|
21
|
+
"@powerhousedao/analytics-engine-browser",
|
|
22
|
+
"@powerhousedao/analytics-engine-knex",
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Detects all Powerhouse packages from package.json dependencies
|
|
26
|
+
* @param packageJson - The parsed package.json object
|
|
27
|
+
* @returns Array of package names to process
|
|
28
|
+
*/
|
|
29
|
+
export function detectPowerhousePackages(packageJson) {
|
|
30
|
+
const allDependencies = {
|
|
31
|
+
...(packageJson.dependencies || {}),
|
|
32
|
+
...(packageJson.devDependencies || {}),
|
|
33
|
+
};
|
|
34
|
+
const powerhousePackages = [];
|
|
35
|
+
// Find all @powerhousedao packages (excluding document-engineering)
|
|
36
|
+
Object.keys(allDependencies).forEach((dep) => {
|
|
37
|
+
if (dep.startsWith(ORG + "/") && !EXCLUDED_PACKAGES.includes(dep)) {
|
|
38
|
+
powerhousePackages.push(dep);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// Add special packages if they exist
|
|
42
|
+
SPECIAL_PACKAGES.forEach((pkg) => {
|
|
43
|
+
if (allDependencies[pkg]) {
|
|
44
|
+
powerhousePackages.push(pkg);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return powerhousePackages;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Maps a package name to its monorepo directory path by reading package.json files
|
|
51
|
+
* @param packageName - The package name (e.g., '@powerhousedao/common' or 'document-model')
|
|
52
|
+
* @param localPath - The base path to the monorepo
|
|
53
|
+
* @returns The full path to the package directory
|
|
54
|
+
*/
|
|
55
|
+
export function mapPackageToMonorepoPath(packageName, localPath) {
|
|
56
|
+
// Search in all possible locations
|
|
57
|
+
const searchDirs = [
|
|
58
|
+
path.join(localPath, "packages"),
|
|
59
|
+
path.join(localPath, "apps"),
|
|
60
|
+
path.join(localPath, "clis"),
|
|
61
|
+
];
|
|
62
|
+
for (const searchDir of searchDirs) {
|
|
63
|
+
if (!existsSync(searchDir))
|
|
64
|
+
continue;
|
|
65
|
+
try {
|
|
66
|
+
// Read all subdirectories
|
|
67
|
+
const subdirs = readdirSync(searchDir, { withFileTypes: true })
|
|
68
|
+
.filter((dirent) => dirent.isDirectory())
|
|
69
|
+
.map((dirent) => dirent.name);
|
|
70
|
+
// Check each subdirectory's package.json
|
|
71
|
+
for (const subdir of subdirs) {
|
|
72
|
+
const packageJsonPath = path.join(searchDir, subdir, "package.json");
|
|
73
|
+
if (existsSync(packageJsonPath)) {
|
|
74
|
+
try {
|
|
75
|
+
const content = readFileSync(packageJsonPath, "utf-8");
|
|
76
|
+
const pkg = JSON.parse(content);
|
|
77
|
+
if (pkg.name === packageName) {
|
|
78
|
+
return path.join(searchDir, subdir);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Ignore invalid package.json files
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// Ignore errors reading directory
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// Fallback to old behavior if not found
|
|
93
|
+
const baseName = packageName.startsWith(ORG + "/")
|
|
94
|
+
? packageName.substring(ORG.length + 1)
|
|
95
|
+
: packageName;
|
|
96
|
+
return path.join(localPath, "packages", baseName);
|
|
97
|
+
}
|
|
98
|
+
export const ENV_MAP = {
|
|
99
|
+
dev: "dev",
|
|
100
|
+
staging: "staging",
|
|
101
|
+
prod: "latest",
|
|
102
|
+
latest: "latest",
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Checks if a string is a valid semver version
|
|
106
|
+
* Supports formats like: 1.0.0, 1.0.0-beta.1, 1.0.0-dev.123, v1.0.0
|
|
107
|
+
*/
|
|
108
|
+
export function isVersionString(str) {
|
|
109
|
+
// Remove leading 'v' if present
|
|
110
|
+
const version = str.startsWith("v") ? str.slice(1) : str;
|
|
111
|
+
// Semver regex pattern
|
|
112
|
+
const semverPattern = /^\d+\.\d+\.\d+(-[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)?(\+[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)?$/;
|
|
113
|
+
return semverPattern.test(version);
|
|
114
|
+
}
|
|
115
|
+
export const updatePackageJson = async (envOrVersion, localPath, packageManager, debug, useResolved) => {
|
|
116
|
+
const projectInfo = await getProjectInfo();
|
|
117
|
+
const pkgManager = packageManager || getPackageManagerFromLockfile(projectInfo.path);
|
|
118
|
+
if (debug) {
|
|
119
|
+
console.log(">>> projectInfo", projectInfo);
|
|
120
|
+
console.log(">>> pkgManager", pkgManager);
|
|
121
|
+
}
|
|
122
|
+
// Read the project's package.json
|
|
123
|
+
const packageJsonPath = path.join(projectInfo.path, "package.json");
|
|
124
|
+
const packageJsonContent = readFileSync(packageJsonPath, "utf-8");
|
|
125
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
126
|
+
// Detect all Powerhouse packages from the current package.json
|
|
127
|
+
const powerhousePackages = detectPowerhousePackages(packageJson);
|
|
128
|
+
const dependencies = [];
|
|
129
|
+
if (localPath) {
|
|
130
|
+
// For local path, map each detected package to its monorepo path
|
|
131
|
+
powerhousePackages.forEach((packageName) => {
|
|
132
|
+
const fullPath = mapPackageToMonorepoPath(packageName, localPath);
|
|
133
|
+
dependencies.push(fullPath);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// Determine the version tag to use
|
|
138
|
+
// For specific versions, add ^ prefix to allow semver range updates
|
|
139
|
+
const versionTag = isVersionString(envOrVersion)
|
|
140
|
+
? `^${envOrVersion.replace(/^v/, "")}` // Remove leading 'v' if present and add ^
|
|
141
|
+
: ENV_MAP[envOrVersion];
|
|
142
|
+
// For remote dependencies, add version tags
|
|
143
|
+
powerhousePackages.forEach((packageName) => {
|
|
144
|
+
dependencies.push(`${packageName}@${versionTag}`);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (debug) {
|
|
148
|
+
console.log(">>> dependencies to update", dependencies);
|
|
149
|
+
}
|
|
150
|
+
if (dependencies.length === 0) {
|
|
151
|
+
console.log("ℹ️ No Powerhouse dependencies found to update");
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
console.log("⚙️ Updating dependencies...");
|
|
156
|
+
if (localPath || useResolved) {
|
|
157
|
+
installDependency(pkgManager, dependencies, projectInfo.path);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
updateDependencyVersionString(pkgManager, dependencies, projectInfo.path);
|
|
161
|
+
}
|
|
162
|
+
console.log("✅ Dependencies updated successfully");
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
console.error("❌ Failed to update dependencies");
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
export const use = async (environment, localPath, options) => {
|
|
170
|
+
const isVersion = environment ? isVersionString(environment) : false;
|
|
171
|
+
if (!environment ||
|
|
172
|
+
(!options.force &&
|
|
173
|
+
environment !== "local" &&
|
|
174
|
+
!isVersion &&
|
|
175
|
+
!Object.keys(ENV_MAP).includes(environment))) {
|
|
176
|
+
throw new Error(`❌ Invalid environment, use --force or use one of the following: ${Object.keys(ENV_MAP).join(", ")}, or a specific version (e.g., 5.1.0)`);
|
|
177
|
+
}
|
|
178
|
+
if (environment === "local" && !localPath) {
|
|
179
|
+
throw new Error("❌ Local environment requires a local path, please specify the path to the local environment");
|
|
180
|
+
}
|
|
181
|
+
const { debug } = options;
|
|
182
|
+
// environment can be an Environment key or a version string
|
|
183
|
+
const envOrVersion = environment;
|
|
184
|
+
if (debug) {
|
|
185
|
+
console.log(">>> options", options);
|
|
186
|
+
}
|
|
187
|
+
const projectInfo = await getProjectInfo();
|
|
188
|
+
const packageManager = parsePackageManager(options) ??
|
|
189
|
+
getPackageManagerFromLockfile(projectInfo.path);
|
|
190
|
+
await updatePackageJson(envOrVersion, localPath, packageManager, debug, options.useResolved);
|
|
191
|
+
};
|
|
192
|
+
export function useCommand(program) {
|
|
193
|
+
const useCmd = program
|
|
194
|
+
.command("use")
|
|
195
|
+
.description("Allows you to change your environment (latest, dev, staging, prod, local) or use a specific version (e.g., 5.1.0)")
|
|
196
|
+
.argument("[environment]", "The environment to use (latest, dev, staging, prod, local) or a specific version (e.g., 5.1.0)")
|
|
197
|
+
.argument("[localPath]", "The path to the local environment (you have to specify the path to the local environment)")
|
|
198
|
+
.option("--force", "force environment to use")
|
|
199
|
+
.option("--use-resolved", "Use resolved dependency versions")
|
|
200
|
+
.option("--package-manager <packageManager>", "package manager to be used")
|
|
201
|
+
.option("--pnpm", "Use 'pnpm' as package manager")
|
|
202
|
+
.option("--yarn", "Use 'yarn' as package manager")
|
|
203
|
+
.option("--bun", "Use 'bun' as package manager")
|
|
204
|
+
.option("--debug", "Show additional logs");
|
|
205
|
+
// Use withCustomHelp instead of withHelpAction and addHelpText
|
|
206
|
+
return withCustomHelp(useCmd, use, useHelp,
|
|
207
|
+
// Pre-check function to validate environment before running the action
|
|
208
|
+
(environment) => {
|
|
209
|
+
if (!environment &&
|
|
210
|
+
!process.argv.includes("--help") &&
|
|
211
|
+
!process.argv.includes("-h")) {
|
|
212
|
+
console.error('Error: Missing required argument "environment"');
|
|
213
|
+
process.exit(1);
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
return true;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=use.old.js.map
|