dappbooster 0.2.2 → 0.3.2
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/index.js +27 -9
- package/package.json +11 -4
package/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { execSync } from "child_process";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
import { rmSync } from "fs";
|
|
6
|
+
import chalk from "chalk";
|
|
6
7
|
|
|
7
8
|
const repoUrl = "https://github.com/bootnodedev/dappbooster.git";
|
|
8
9
|
const projectName = process.argv[2];
|
|
@@ -27,14 +28,14 @@ function getLatestTag() {
|
|
|
27
28
|
|
|
28
29
|
function cloneRepo(projectName) {
|
|
29
30
|
const sanitizedProjectName = projectName.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
30
|
-
const projectDir =
|
|
31
|
+
const projectDir = join(process.cwd(), sanitizedProjectName);
|
|
31
32
|
const execOptions = {
|
|
32
33
|
stdio: "pipe",
|
|
33
34
|
shell: true,
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
try {
|
|
37
|
-
console.log(`Cloning
|
|
38
|
+
console.log(`Cloning dAppBooster...`);
|
|
38
39
|
|
|
39
40
|
// Clone the repository
|
|
40
41
|
execSync(
|
|
@@ -59,15 +60,32 @@ function cloneRepo(projectName) {
|
|
|
59
60
|
execSync(`git checkout "${latestTag}"`, execOptions);
|
|
60
61
|
|
|
61
62
|
// Remove the .git directory
|
|
62
|
-
|
|
63
|
+
rmSync(join(projectDir, ".git"), { recursive: true, force: true });
|
|
63
64
|
|
|
64
65
|
// Initialize a new git repository
|
|
65
66
|
execSync("git init", execOptions);
|
|
66
67
|
|
|
67
|
-
console.log(`DappBooster repository cloned in ${projectDir}`);
|
|
68
|
-
console.log(`Latest version: ${latestTag}`);
|
|
68
|
+
console.log(`DappBooster repository cloned in ${chalk.bold(projectDir)}`);
|
|
69
|
+
console.log(`Latest version: ${chalk.bold(latestTag)}`);
|
|
70
|
+
console.log(`
|
|
71
|
+
${chalk.green.bold(
|
|
72
|
+
"You can now start your project with the following commands:"
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
${chalk.blue("# Change to the project directory")}
|
|
76
|
+
$ ${chalk.cyan(`cd ${sanitizedProjectName}`)}
|
|
77
|
+
|
|
78
|
+
${chalk.blue("# Install dependencies")}
|
|
79
|
+
$ ${chalk.cyan("pnpm install")}
|
|
80
|
+
|
|
81
|
+
${chalk.blue("# Copy the example environment file")}
|
|
82
|
+
$ ${chalk.cyan("cp .env.example .env.local")}
|
|
83
|
+
|
|
84
|
+
${chalk.blue("# Start the development server")}
|
|
85
|
+
$ ${chalk.cyan("pnpm dev")}
|
|
86
|
+
`);
|
|
69
87
|
} catch (error) {
|
|
70
|
-
console.error("An error occurred:"
|
|
88
|
+
console.error(`${chalk.bold.red("An error occurred:")}`, error.message);
|
|
71
89
|
process.exit(1);
|
|
72
90
|
}
|
|
73
91
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dappbooster",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Script to easily start your project with dAppBooster",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"dappbooster": "
|
|
7
|
+
"dappbooster": "index.js"
|
|
8
8
|
},
|
|
9
|
+
"type": "module",
|
|
9
10
|
"scripts": {
|
|
10
11
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
12
|
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"chalk": "^5.3.0"
|
|
15
|
+
},
|
|
12
16
|
"keywords": [
|
|
13
17
|
"dappbooster",
|
|
14
18
|
"bootnode",
|
|
@@ -16,6 +20,9 @@
|
|
|
16
20
|
"installer",
|
|
17
21
|
"dapp"
|
|
18
22
|
],
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "MIT"
|
|
23
|
+
"author": "bootnodedev",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20.0.0"
|
|
27
|
+
}
|
|
21
28
|
}
|