@axeth/create-cli 2.0.1 → 2.0.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 +27 -13
- package/package.json +1 -1
- package/src/class/AxethCLI.ts +4 -52
package/README.md
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
# @axeth/
|
|
1
|
+
# @axeth/cli
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The official CLI for the **Axeth** ecosystem — a toolkit for building, managing, and scaffolding Minecraft Bedrock Edition projects.
|
|
4
4
|
|
|
5
|
-
`@axeth/
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
`@axeth/cli` acts as the command-line interface that connects `@axeth/core` and `@axeth/api` together into a single developer experience.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- Project scaffolding and initialization
|
|
12
|
+
- Minecraft Bedrock addon & tool workflows
|
|
13
|
+
- Version-aware environment handling
|
|
14
|
+
- Extensible command system
|
|
15
|
+
- Works with `bun 🐰 `
|
|
8
16
|
|
|
9
|
-
> ⚠️ This package is primarily intended for internal use by Axeth tools.
|
|
10
|
-
> Advanced users may use it directly at their own discretion.
|
|
11
17
|
|
|
12
18
|
---
|
|
19
|
+
## 🚀 Usage
|
|
20
|
+
```
|
|
21
|
+
bun create @axeth/cli
|
|
22
|
+
```
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
---
|
|
25
|
+
## 🧩 Ecosystem
|
|
26
|
+
|
|
27
|
+
- @axeth/core — core logic & project engine
|
|
28
|
+
|
|
29
|
+
- @axeth/api — shared APIs & versioned Minecraft interfaces
|
|
30
|
+
|
|
31
|
+
---
|
|
15
32
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Minecraft Bedrock version targeting
|
|
19
|
-
- Environment & workspace management
|
|
20
|
-
- Shared utilities and internal pipelines
|
|
33
|
+
## License
|
|
34
|
+
MIT © PUKAN223
|
package/package.json
CHANGED
package/src/class/AxethCLI.ts
CHANGED
|
@@ -36,58 +36,10 @@ class AxethCLI {
|
|
|
36
36
|
const spinner = prompt.spinner({ indicator: "dots" });
|
|
37
37
|
|
|
38
38
|
await this.generateTemplate(addonInfo, config, minecraftServerVersion, minecraftServerUIVersion, spinner);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// spinner.start("Installing dependencies...");
|
|
44
|
-
// try {
|
|
45
|
-
// await new Promise<void>((resolve, reject) => {
|
|
46
|
-
// //add dependency installation @minecraft/server{minecraftServerVersion} and @minecraft/server-ui@{minecraftServerUIVersion}
|
|
47
|
-
// //edit package.json to add these dependencies
|
|
48
|
-
// const packageJsonPath = path.join(cwd, 'package.json');
|
|
49
|
-
// const packageJson = fs.readJsonSync(packageJsonPath);
|
|
50
|
-
// packageJson.dependencies = packageJson.dependencies || {};
|
|
51
|
-
// packageJson.dependencies['@minecraft/server'] = `^${minecraftServerVersion}`;
|
|
52
|
-
// packageJson.dependencies['@minecraft/server-ui'] = `^${minecraftServerUIVersion}`;
|
|
53
|
-
// fs.writeJsonSync(packageJsonPath, packageJson, { spaces: 2 });
|
|
54
|
-
|
|
55
|
-
// const child = spawn('bun', ['install'], { cwd, shell: true });
|
|
56
|
-
// let errorOutput = '';
|
|
57
|
-
// child.stderr && child.stderr.on('data', (data: Buffer) => {
|
|
58
|
-
// errorOutput += data.toString();
|
|
59
|
-
// });
|
|
60
|
-
// child.on('close', async (code: number) => {
|
|
61
|
-
// if (code === 0) {
|
|
62
|
-
// spinner.stop("Dependencies installed.");
|
|
63
|
-
// resolve();
|
|
64
|
-
// // Prompt to open VS Code
|
|
65
|
-
// const openVSCode = await prompt.confirm({
|
|
66
|
-
// message: "Open project in VS Code now?"
|
|
67
|
-
// });
|
|
68
|
-
// if (openVSCode) {
|
|
69
|
-
// const childCode = spawn('code', ['.'], { cwd, shell: true, stdio: 'ignore', detached: true });
|
|
70
|
-
// childCode.unref();
|
|
71
|
-
// }
|
|
72
|
-
// } else {
|
|
73
|
-
// spinner.stop("Dependency installation failed.");
|
|
74
|
-
// prompt.log.error(`bun install failed with code ${code}`);
|
|
75
|
-
// if (errorOutput) {
|
|
76
|
-
// prompt.log.error(errorOutput.trim());
|
|
77
|
-
// }
|
|
78
|
-
// reject(new Error(`bun install failed with code ${code}`));
|
|
79
|
-
// }
|
|
80
|
-
// });
|
|
81
|
-
// child.on('error', (err: Error) => {
|
|
82
|
-
// spinner.stop("Dependency installation failed.");
|
|
83
|
-
// prompt.log.error(`bun install process error: ${err.message}`);
|
|
84
|
-
// reject(err);
|
|
85
|
-
// });
|
|
86
|
-
// });
|
|
87
|
-
// } catch (err) {
|
|
88
|
-
// // spinner already stopped in error handler above
|
|
89
|
-
// prompt.log.error(`Failed to install dependencies: ${err}`);
|
|
90
|
-
// }
|
|
39
|
+
await prompt.confirm({
|
|
40
|
+
message: "Open on VSCode (code .)?",
|
|
41
|
+
initialValue: false
|
|
42
|
+
})
|
|
91
43
|
}
|
|
92
44
|
|
|
93
45
|
private async generateTemplate(addonInfo: { [x: string]: any }, config: { [x: string]: any }, minecraftServerVersion: string, minecraftServerUIVersion: string, spinner: any) {
|