@docubook/create 1.4.1 → 1.4.3
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/README.md +17 -13
- package/create.js +14 -41
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npx
|
|
20
|
+
npx @docubook/create@latest
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
#### command output
|
|
@@ -41,26 +41,30 @@ Next steps:
|
|
|
41
41
|
### How to Update DocuBook?
|
|
42
42
|
- **Open a New Terminal**: Please open a new terminal on the desktop that has DocuBook installed.
|
|
43
43
|
- **Move Directory**: for example, if the directory name is docubook, then write `cd docubook` and press enter.
|
|
44
|
-
- **npx update_docu**: run `npx update_docu` bash script.
|
|
45
44
|
|
|
46
45
|
```bash
|
|
47
|
-
npx
|
|
46
|
+
npx @docubook/update@latest
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
#### command output
|
|
51
50
|
|
|
52
51
|
```bash
|
|
53
|
-
Updating Docubook project in /
|
|
54
|
-
|
|
55
|
-
ℹ Skipped
|
|
56
|
-
ℹ Skipped contents
|
|
57
|
-
ℹ Skipped app/page.tsx
|
|
58
|
-
ℹ Skipped
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
📂 Updating Docubook project in /Users/wildan/Public/docubook...
|
|
53
|
+
|
|
54
|
+
ℹ ⚡ Skipped public
|
|
55
|
+
ℹ ⚡ Skipped contents
|
|
56
|
+
ℹ ⚡ Skipped app/page.tsx
|
|
57
|
+
ℹ ⚡ Skipped docu.json
|
|
58
|
+
ℹ ⚡ Skipped CHANGELOG.md
|
|
59
|
+
✨ Replacing styles folder...
|
|
60
|
+
✨ Replaced all CSS files in styles folder
|
|
61
|
+
✔ ✅ Docubook v1.4.2 successfully updated in /Users/wildan/Public/docubook!
|
|
62
|
+
|
|
63
|
+
🎯 Next steps:
|
|
62
64
|
1. Verify your changes in the current directory.
|
|
63
|
-
2. Run the
|
|
65
|
+
2. Run the install script to check for package updates:
|
|
66
|
+
npm install
|
|
67
|
+
3. Run the development server:
|
|
64
68
|
npm run dev
|
|
65
69
|
```
|
|
66
70
|
|
package/create.js
CHANGED
|
@@ -42,49 +42,21 @@ function updatePostcssConfig(projectPath) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async function promptInstallNode() {
|
|
46
|
-
const { installNode } = await inquirer.prompt([
|
|
47
|
-
{
|
|
48
|
-
type: "confirm",
|
|
49
|
-
name: "installNode",
|
|
50
|
-
message: "Node.js is not installed. Do you want to install it now?",
|
|
51
|
-
default: true,
|
|
52
|
-
},
|
|
53
|
-
]);
|
|
54
|
-
if (installNode) {
|
|
55
|
-
console.log(chalk.green("Installing Node.js..."));
|
|
56
|
-
try {
|
|
57
|
-
execSync("curl -fsSL https://install-node.vercel.app | bash", { stdio: "inherit" });
|
|
58
|
-
console.log(chalk.green("Node.js installed successfully. Please rerun the command."));
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.error(chalk.red("Failed to install Node.js automatically. Please install it manually."));
|
|
61
|
-
}
|
|
62
|
-
process.exit(1);
|
|
63
|
-
} else {
|
|
64
|
-
console.log(chalk.yellow("Node.js is required to continue. Exiting."));
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
45
|
program
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!checkNodeInstalled()) {
|
|
75
|
-
await promptInstallNode();
|
|
76
|
-
}
|
|
77
|
-
|
|
46
|
+
.version("1.4.3")
|
|
47
|
+
.description("CLI to create a new Docubook project")
|
|
48
|
+
.argument("[project-directory]", "Directory to create the new Docubook project")
|
|
49
|
+
.action(async (projectDirectory) => {
|
|
78
50
|
if (!projectDirectory) {
|
|
79
|
-
|
|
51
|
+
const { directoryName } = await inquirer.prompt([
|
|
80
52
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
53
|
+
type: "input",
|
|
54
|
+
name: "directoryName",
|
|
55
|
+
message: "Enter a name for your project directory:",
|
|
56
|
+
default: "docubook",
|
|
85
57
|
},
|
|
86
|
-
|
|
87
|
-
|
|
58
|
+
]);
|
|
59
|
+
projectDirectory = directoryName;
|
|
88
60
|
}
|
|
89
61
|
|
|
90
62
|
const repo = "github:mywildancloud/docubook#starter";
|
|
@@ -98,6 +70,7 @@ program
|
|
|
98
70
|
|
|
99
71
|
updatePostcssConfig(projectPath);
|
|
100
72
|
|
|
73
|
+
process.chdir(projectPath);
|
|
101
74
|
if (checkBunInstalled()) {
|
|
102
75
|
console.log(chalk.green("\nBun detected. Installing dependencies with Bun..."));
|
|
103
76
|
execSync("bun install", { cwd: projectPath, stdio: "inherit" });
|
|
@@ -118,9 +91,9 @@ program
|
|
|
118
91
|
console.log(`2. Start the development server:`);
|
|
119
92
|
|
|
120
93
|
if (checkBunInstalled()) {
|
|
121
|
-
console.log(` bun run dev`);
|
|
94
|
+
console.log(` ${chalk.magenta("bun run dev")}`);
|
|
122
95
|
} else {
|
|
123
|
-
console.log(` npm run dev`);
|
|
96
|
+
console.log(` ${chalk.magenta("npm run dev")}`);
|
|
124
97
|
}
|
|
125
98
|
|
|
126
99
|
process.exit(0);
|