@docubook/create 1.5.1 → 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.
Files changed (2) hide show
  1. package/create.js +32 -21
  2. 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.5.0")
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
- // for github skrip
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,15 +67,19 @@ 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";
75
+ const projectPath = path.resolve(process.cwd(), projectDirectory);
73
76
  const cloneCommand = `git clone --branch ${branch} ${repo} ${projectPath}`;
74
77
 
75
78
  const spinner = ora(`Cloning ${chalk.green(branch)} from GitLab...`).start();
76
79
  try {
77
80
  execSync(cloneCommand, { stdio: "inherit" });
78
81
  spinner.succeed(`Docubook project successfully created in ${projectPath}!`);
82
+ // --- clone from gitlab ---
79
83
 
80
84
  // Jalankan rename hanya jika Bun terdeteksi
81
85
  if (checkBunInstalled()) {
@@ -84,24 +88,24 @@ program
84
88
  console.log(chalk.yellow("Skipping postcss.config.js rename because Bun is not installed."));
85
89
  }
86
90
 
87
- const { enter } = await inquirer.prompt([
88
- {
89
- type: "confirm",
90
- name: "enter",
91
- message: "Install dependencies in the current project directory?",
92
- default: true,
93
- },
94
- ]);
95
-
96
- if (enter) {
97
- if (checkBunInstalled()) {
98
- console.log(chalk.green("\nBun detected. Installing dependencies with Bun..."));
99
- execSync("bun install", { stdio: "inherit", cwd: projectPath });
100
- } else {
101
- console.log(chalk.green("\nInstalling dependencies with npm..."));
102
- execSync("npm install", { stdio: "inherit", cwd: projectPath });
103
- }
104
- }
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
+ // }
105
109
 
106
110
  const packageJsonPath = path.join(projectPath, "package.json");
107
111
  if (fs.existsSync(packageJsonPath)) {
@@ -112,7 +116,14 @@ program
112
116
  console.log(chalk.green("\nNext steps:"));
113
117
  console.log(`1. Navigate to your project directory:`);
114
118
  console.log(` ${chalk.green(`cd ${projectDirectory}`)}`);
115
- console.log(`2. Start the development server:`);
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:`);
116
127
 
117
128
  if (checkBunInstalled()) {
118
129
  console.log(` ${chalk.green("bun run dev")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/create",
3
- "version": "1.5.1",
3
+ "version": "1.6.9",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {