@docubook/create 1.5.2 → 1.6.9
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/create.js +31 -21
- package/package.json +1 -1
package/create.js
CHANGED
|
@@ -43,7 +43,7 @@ function updatePostcssConfig(projectPath) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
program
|
|
46
|
-
.version("1.
|
|
46
|
+
.version("1.6.9")
|
|
47
47
|
.description("CLI to create a new Docubook project")
|
|
48
48
|
.argument("[project-directory]", "Directory to create the new Docubook project")
|
|
49
49
|
.action(async (projectDirectory) => {
|
|
@@ -58,7 +58,7 @@ program
|
|
|
58
58
|
]);
|
|
59
59
|
projectDirectory = directoryName;
|
|
60
60
|
}
|
|
61
|
-
//
|
|
61
|
+
// --- clone from github ---
|
|
62
62
|
// const repo = "github:mywildancloud/docubook#starter";
|
|
63
63
|
// const emitter = degit(repo);
|
|
64
64
|
// const projectPath = path.resolve(process.cwd(), projectDirectory);
|
|
@@ -67,7 +67,9 @@ program
|
|
|
67
67
|
// try {
|
|
68
68
|
// await emitter.clone(projectPath);
|
|
69
69
|
// spinner.succeed(`Docubook project successfully created in ${projectPath}!`);
|
|
70
|
+
// --- clone from github ---
|
|
70
71
|
|
|
72
|
+
// --- clone from gitlab ---
|
|
71
73
|
const repo = "https://gitlab.com/mywildancloud/docubook.git";
|
|
72
74
|
const branch = "starter";
|
|
73
75
|
const projectPath = path.resolve(process.cwd(), projectDirectory);
|
|
@@ -77,6 +79,7 @@ program
|
|
|
77
79
|
try {
|
|
78
80
|
execSync(cloneCommand, { stdio: "inherit" });
|
|
79
81
|
spinner.succeed(`Docubook project successfully created in ${projectPath}!`);
|
|
82
|
+
// --- clone from gitlab ---
|
|
80
83
|
|
|
81
84
|
// Jalankan rename hanya jika Bun terdeteksi
|
|
82
85
|
if (checkBunInstalled()) {
|
|
@@ -85,24 +88,24 @@ program
|
|
|
85
88
|
console.log(chalk.yellow("Skipping postcss.config.js rename because Bun is not installed."));
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
// const { enter } = await inquirer.prompt([
|
|
92
|
+
// {
|
|
93
|
+
// type: "confirm",
|
|
94
|
+
// name: "enter",
|
|
95
|
+
// message: "Install dependencies in the current project directory?",
|
|
96
|
+
// default: true,
|
|
97
|
+
// },
|
|
98
|
+
// ]);
|
|
99
|
+
|
|
100
|
+
// if (enter) {
|
|
101
|
+
// if (checkBunInstalled()) {
|
|
102
|
+
// console.log(chalk.green("\nBun detected. Installing dependencies with Bun..."));
|
|
103
|
+
// execSync("bun install", { stdio: "inherit", cwd: projectPath });
|
|
104
|
+
// } else {
|
|
105
|
+
// console.log(chalk.green("\nInstalling dependencies with npm..."));
|
|
106
|
+
// execSync("npm install", { stdio: "inherit", cwd: projectPath });
|
|
107
|
+
// }
|
|
108
|
+
// }
|
|
106
109
|
|
|
107
110
|
const packageJsonPath = path.join(projectPath, "package.json");
|
|
108
111
|
if (fs.existsSync(packageJsonPath)) {
|
|
@@ -113,7 +116,14 @@ program
|
|
|
113
116
|
console.log(chalk.green("\nNext steps:"));
|
|
114
117
|
console.log(`1. Navigate to your project directory:`);
|
|
115
118
|
console.log(` ${chalk.green(`cd ${projectDirectory}`)}`);
|
|
116
|
-
console.log(`2.
|
|
119
|
+
console.log(`2. Install dependencies:`);
|
|
120
|
+
|
|
121
|
+
if (checkBunInstalled()) {
|
|
122
|
+
console.log(` ${chalk.green("bun install")}`);
|
|
123
|
+
} else {
|
|
124
|
+
console.log(` ${chalk.green("npm install")}`);
|
|
125
|
+
}
|
|
126
|
+
console.log(`3. Start the development server:`);
|
|
117
127
|
|
|
118
128
|
if (checkBunInstalled()) {
|
|
119
129
|
console.log(` ${chalk.green("bun run dev")}`);
|