@powerhousedao/codegen 4.1.0-dev.95 → 4.1.0-dev.97
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/create-lib/checkout-project.d.ts +12 -5
- package/dist/src/create-lib/checkout-project.d.ts.map +1 -1
- package/dist/src/create-lib/checkout-project.js +22 -5
- package/dist/src/create-lib/checkout-project.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Clones a git repository and returns the path to the cloned project.
|
|
3
|
+
* @param repositoryUrl - The URL of the git repository to clone
|
|
4
|
+
* @returns The absolute path to the cloned project directory
|
|
5
|
+
*/
|
|
6
|
+
export declare function cloneRepository(repositoryUrl: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Installs dependencies in a project directory using the specified package manager.
|
|
9
|
+
* @param projectPath - The absolute path to the project directory
|
|
10
|
+
* @param packageManager - The package manager to use (npm, pnpm, yarn, bun)
|
|
11
|
+
*/
|
|
12
|
+
export declare function installDependencies(projectPath: string, packageManager: string): void;
|
|
6
13
|
//# sourceMappingURL=checkout-project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-project.d.ts","sourceRoot":"","sources":["../../../src/create-lib/checkout-project.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"checkout-project.d.ts","sourceRoot":"","sources":["../../../src/create-lib/checkout-project.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CA0B7D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,IAAI,CAiBN"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { runCmd } from "./utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Clones a git repository and returns the path to the cloned project.
|
|
5
|
+
* @param repositoryUrl - The URL of the git repository to clone
|
|
6
|
+
* @returns The absolute path to the cloned project directory
|
|
7
|
+
*/
|
|
8
|
+
export function cloneRepository(repositoryUrl) {
|
|
6
9
|
try {
|
|
7
10
|
console.log("\x1b[33m", `Cloning repository from ${repositoryUrl}...`, "\x1b[0m");
|
|
8
11
|
runCmd(`git clone ${repositoryUrl}`);
|
|
@@ -16,10 +19,24 @@ export function checkoutProject(options) {
|
|
|
16
19
|
throw new Error("Could not determine project name from repository URL");
|
|
17
20
|
}
|
|
18
21
|
const projectPath = path.join(process.cwd(), repoName);
|
|
22
|
+
return projectPath;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.log(error);
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Installs dependencies in a project directory using the specified package manager.
|
|
31
|
+
* @param projectPath - The absolute path to the project directory
|
|
32
|
+
* @param packageManager - The package manager to use (npm, pnpm, yarn, bun)
|
|
33
|
+
*/
|
|
34
|
+
export function installDependencies(projectPath, packageManager) {
|
|
35
|
+
try {
|
|
19
36
|
process.chdir(projectPath);
|
|
20
37
|
console.log("\x1b[34m", `Installing dependencies with ${packageManager}...`, "\x1b[0m");
|
|
21
38
|
runCmd(`${packageManager} install --loglevel error`);
|
|
22
|
-
console.log("\x1b[32m", "
|
|
39
|
+
console.log("\x1b[32m", "Dependencies installed successfully!", "\x1b[0m");
|
|
23
40
|
console.log();
|
|
24
41
|
}
|
|
25
42
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-project.js","sourceRoot":"","sources":["../../../src/create-lib/checkout-project.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"checkout-project.js","sourceRoot":"","sources":["../../../src/create-lib/checkout-project.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,aAAqB;IACnD,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CACT,UAAU,EACV,2BAA2B,aAAa,KAAK,EAC7C,SAAS,CACV,CAAC;QACF,MAAM,CAAC,aAAa,aAAa,EAAE,CAAC,CAAC;QAErC,2CAA2C;QAC3C,gDAAgD;QAChD,MAAM,QAAQ,GAAG,aAAa;aAC3B,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,EAAE;YACN,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE1B,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;QACvD,OAAO,WAAW,CAAC;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAAmB,EACnB,cAAsB;IAEtB,IAAI,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAE3B,OAAO,CAAC,GAAG,CACT,UAAU,EACV,gCAAgC,cAAc,KAAK,EACnD,SAAS,CACV,CAAC;QACF,MAAM,CAAC,GAAG,cAAc,2BAA2B,CAAC,CAAC;QAErD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,sCAAsC,EAAE,SAAS,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|