@docubook/create 1.4.9 → 1.5.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.
Files changed (2) hide show
  1. package/create.js +17 -8
  2. package/package.json +1 -1
package/create.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { program } from "commander";
4
- import degit from "degit";
4
+ // import degit from "degit";
5
5
  import path from "path";
6
6
  import fs from "fs";
7
7
  import ora from "ora";
@@ -43,7 +43,7 @@ function updatePostcssConfig(projectPath) {
43
43
  }
44
44
 
45
45
  program
46
- .version("1.4.9")
46
+ .version("1.5.0")
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,15 +58,24 @@ program
58
58
  ]);
59
59
  projectDirectory = directoryName;
60
60
  }
61
+ // for github skrip
62
+ // const repo = "github:mywildancloud/docubook#starter";
63
+ // const emitter = degit(repo);
64
+ // const projectPath = path.resolve(process.cwd(), projectDirectory);
61
65
 
62
- const repo = "github:mywildancloud/docubook#starter";
63
- const emitter = degit(repo);
64
- const projectPath = path.resolve(process.cwd(), projectDirectory);
66
+ // const spinner = ora(`Cloning ${chalk.green("starter")}...`).start();
67
+ // try {
68
+ // await emitter.clone(projectPath);
69
+ // spinner.succeed(`Docubook project successfully created in ${projectPath}!`);
65
70
 
66
- const spinner = ora(`Cloning ${chalk.green("starter")}...`).start();
71
+ const repo = "https://gitlab.com/mywildancloud/docubook.git";
72
+ const branch = "starter";
73
+ const cloneCommand = `git clone --branch ${branch} ${repo} ${projectPath}`;
74
+
75
+ const spinner = ora(`Cloning ${chalk.green(branch)} from GitLab...`).start();
67
76
  try {
68
- await emitter.clone(projectPath);
69
- spinner.succeed(`Docubook project successfully created in ${projectPath}!`);
77
+ execSync(cloneCommand, { stdio: "inherit" });
78
+ spinner.succeed(`Docubook project successfully created in ${projectPath}!`);
70
79
 
71
80
  // Jalankan rename hanya jika Bun terdeteksi
72
81
  if (checkBunInstalled()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/create",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {