@lunnos/hyt 1.0.0
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 +131 -0
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +74 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +179 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +269 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/setup.d.ts +3 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +164 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/config.d.ts +11 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +39 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/download.d.ts +9 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/download.js +89 -0
- package/dist/utils/download.js.map +1 -0
- package/dist/utils/errors.d.ts +13 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +25 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/gradle.d.ts +7 -0
- package/dist/utils/gradle.d.ts.map +1 -0
- package/dist/utils/gradle.js +50 -0
- package/dist/utils/gradle.js.map +1 -0
- package/dist/utils/hytale.d.ts +5 -0
- package/dist/utils/hytale.d.ts.map +1 -0
- package/dist/utils/hytale.js +84 -0
- package/dist/utils/hytale.js.map +1 -0
- package/dist/utils/java.d.ts +7 -0
- package/dist/utils/java.d.ts.map +1 -0
- package/dist/utils/java.js +53 -0
- package/dist/utils/java.js.map +1 -0
- package/dist/utils/javaDownload.d.ts +9 -0
- package/dist/utils/javaDownload.d.ts.map +1 -0
- package/dist/utils/javaDownload.js +185 -0
- package/dist/utils/javaDownload.js.map +1 -0
- package/dist/utils/paths.d.ts +9 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +19 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/server.d.ts +16 -0
- package/dist/utils/server.d.ts.map +1 -0
- package/dist/utils/server.js +70 -0
- package/dist/utils/server.js.map +1 -0
- package/dist/utils/ui.d.ts +12 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +22 -0
- package/dist/utils/ui.js.map +1 -0
- package/dist/utils/watcher.d.ts +10 -0
- package/dist/utils/watcher.d.ts.map +1 -0
- package/dist/utils/watcher.js +45 -0
- package/dist/utils/watcher.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { execa } from 'execa';
|
|
5
|
+
import { loadConfig } from '../utils/config.js';
|
|
6
|
+
import { downloadFile, getTemplateUrl, getCfrUrl } from '../utils/download.js';
|
|
7
|
+
import { startSpinner, success, error, info, warn } from '../utils/ui.js';
|
|
8
|
+
import { ConfigError, HytaleError } from '../utils/errors.js';
|
|
9
|
+
const TEMPLATE_VERSION = '0.0.1';
|
|
10
|
+
export function initCommand() {
|
|
11
|
+
return new Command('init')
|
|
12
|
+
.description('Create a new Hytale plugin project')
|
|
13
|
+
.argument('<project-name>', 'Name for your plugin project')
|
|
14
|
+
.option('--skip-cfr', 'Skip CFR decompiler download')
|
|
15
|
+
.option('--skip-git', 'Skip git initialization')
|
|
16
|
+
.action(async (projectName, options) => {
|
|
17
|
+
try {
|
|
18
|
+
console.log(`\n🚀 Creating new Hytale plugin project: ${projectName}\n`);
|
|
19
|
+
// Verify setup has been run
|
|
20
|
+
const config = await loadConfig();
|
|
21
|
+
if (!config) {
|
|
22
|
+
throw new ConfigError('HYT is not configured. Please run "hyt setup" first.');
|
|
23
|
+
}
|
|
24
|
+
// Define paths
|
|
25
|
+
const workspaceDir = process.cwd();
|
|
26
|
+
const projectDir = path.join(workspaceDir, projectName);
|
|
27
|
+
const serverDir = path.join(projectDir, 'Server');
|
|
28
|
+
const pluginsDir = path.join(serverDir, 'Plugins');
|
|
29
|
+
const pluginSourceDir = path.join(pluginsDir, projectName);
|
|
30
|
+
const modsDir = path.join(projectDir, 'mods');
|
|
31
|
+
// Check if directory already exists
|
|
32
|
+
try {
|
|
33
|
+
await fs.access(projectDir);
|
|
34
|
+
throw new HytaleError(`Directory "${projectName}" already exists.`);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
if (err.code !== 'ENOENT') {
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Create workspace structure
|
|
42
|
+
const structureSpinner = startSpinner('Creating workspace structure...');
|
|
43
|
+
await fs.mkdir(projectDir, { recursive: true });
|
|
44
|
+
await fs.mkdir(serverDir, { recursive: true });
|
|
45
|
+
await fs.mkdir(pluginsDir, { recursive: true });
|
|
46
|
+
await fs.mkdir(modsDir, { recursive: true });
|
|
47
|
+
structureSpinner.succeed('Workspace structure created');
|
|
48
|
+
// Copy server files from Hytale installation
|
|
49
|
+
const copySpinner = startSpinner('Copying server files from Hytale installation...');
|
|
50
|
+
const hytaleServerPath = path.join(config.hytaleInstallPath, 'Server');
|
|
51
|
+
const hytaleAssetsPath = path.join(config.hytaleInstallPath, 'Assets.zip');
|
|
52
|
+
try {
|
|
53
|
+
// Copy Server folder
|
|
54
|
+
await copyDirectory(hytaleServerPath, serverDir);
|
|
55
|
+
// Copy Assets.zip
|
|
56
|
+
await fs.copyFile(hytaleAssetsPath, path.join(projectDir, 'Assets.zip'));
|
|
57
|
+
copySpinner.succeed('Server files copied');
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
copySpinner.fail('Failed to copy server files');
|
|
61
|
+
throw new HytaleError(`Could not copy server files from Hytale installation. ` +
|
|
62
|
+
`Make sure "${config.hytaleInstallPath}" contains Server/ and Assets.zip`);
|
|
63
|
+
}
|
|
64
|
+
// Download template
|
|
65
|
+
const templateSpinner = startSpinner('Downloading plugin template...');
|
|
66
|
+
const templateZipPath = path.join(pluginsDir, 'template.zip');
|
|
67
|
+
try {
|
|
68
|
+
await downloadFile(getTemplateUrl(), templateZipPath);
|
|
69
|
+
templateSpinner.succeed('Template downloaded');
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
templateSpinner.fail('Failed to download template');
|
|
73
|
+
throw new HytaleError(`Could not download plugin template. Check your internet connection.`);
|
|
74
|
+
}
|
|
75
|
+
// Extract template
|
|
76
|
+
const extractSpinner = startSpinner('Extracting template...');
|
|
77
|
+
try {
|
|
78
|
+
await extractZip(templateZipPath, pluginsDir);
|
|
79
|
+
// Rename extracted folder to project name
|
|
80
|
+
const extractedDir = path.join(pluginsDir, `example-mod-${TEMPLATE_VERSION}`);
|
|
81
|
+
await fs.rename(extractedDir, pluginSourceDir);
|
|
82
|
+
// Clean up zip
|
|
83
|
+
await fs.unlink(templateZipPath);
|
|
84
|
+
extractSpinner.succeed('Template extracted');
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
extractSpinner.fail('Failed to extract template');
|
|
88
|
+
throw err;
|
|
89
|
+
}
|
|
90
|
+
// Update project name in template files
|
|
91
|
+
const renameSpinner = startSpinner('Configuring project name...');
|
|
92
|
+
await replaceInFiles(pluginSourceDir, 'ExamplePlugin', toPascalCase(projectName));
|
|
93
|
+
await replaceInFiles(pluginSourceDir, 'example-mod', projectName);
|
|
94
|
+
await replaceInFiles(pluginSourceDir, 'org.example', `com.${projectName.toLowerCase()}`);
|
|
95
|
+
// Rename the main Java file to match the new class name
|
|
96
|
+
const pascalName = toPascalCase(projectName);
|
|
97
|
+
const oldJavaFile = path.join(pluginSourceDir, 'app', 'src', 'main', 'java', 'org', 'example', 'ExamplePlugin.java');
|
|
98
|
+
const newJavaFile = path.join(pluginSourceDir, 'app', 'src', 'main', 'java', 'org', 'example', `${pascalName}.java`);
|
|
99
|
+
try {
|
|
100
|
+
await fs.rename(oldJavaFile, newJavaFile);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
// File might already be renamed or in different location
|
|
104
|
+
}
|
|
105
|
+
renameSpinner.succeed('Project name configured');
|
|
106
|
+
// Download CFR (optional)
|
|
107
|
+
if (!options.skipCfr) {
|
|
108
|
+
const cfrSpinner = startSpinner('Downloading CFR decompiler...');
|
|
109
|
+
const cfrPath = path.join(serverDir, 'cfr.jar');
|
|
110
|
+
try {
|
|
111
|
+
await downloadFile(getCfrUrl(), cfrPath);
|
|
112
|
+
cfrSpinner.succeed('CFR decompiler downloaded');
|
|
113
|
+
// Generate reference sources with live timer
|
|
114
|
+
const srcRefDir = path.join(pluginsDir, 'src-ref');
|
|
115
|
+
await fs.mkdir(srcRefDir, { recursive: true });
|
|
116
|
+
try {
|
|
117
|
+
const startTime = Date.now();
|
|
118
|
+
// Create a spinner with live updates
|
|
119
|
+
const refSpinner = startSpinner('Generating reference sources...');
|
|
120
|
+
// Update spinner text every second
|
|
121
|
+
const timerInterval = setInterval(() => {
|
|
122
|
+
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
123
|
+
refSpinner.text = `Generating reference sources... (${elapsed}s elapsed)`;
|
|
124
|
+
}, 1000);
|
|
125
|
+
try {
|
|
126
|
+
await execa(config.javaPath, [
|
|
127
|
+
'-jar', cfrPath,
|
|
128
|
+
path.join(serverDir, 'HytaleServer.jar'),
|
|
129
|
+
'--outputdir', srcRefDir
|
|
130
|
+
], {
|
|
131
|
+
cwd: serverDir,
|
|
132
|
+
stdio: 'pipe',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
clearInterval(timerInterval);
|
|
137
|
+
}
|
|
138
|
+
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
139
|
+
refSpinner.succeed(`Reference sources generated in ${elapsed}s`);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
warn('Reference source generation failed (non-critical)');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
cfrSpinner.warn('CFR download failed (non-critical, you can download manually)');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
info('Skipping CFR decompiler download');
|
|
151
|
+
}
|
|
152
|
+
// Initialize git (optional)
|
|
153
|
+
if (!options.skipGit) {
|
|
154
|
+
const gitSpinner = startSpinner('Initializing git repository...');
|
|
155
|
+
try {
|
|
156
|
+
await execa('git', ['init'], { cwd: pluginSourceDir });
|
|
157
|
+
// Create .gitignore
|
|
158
|
+
const gitignore = `# Build outputs
|
|
159
|
+
build/
|
|
160
|
+
.gradle/
|
|
161
|
+
|
|
162
|
+
# IDE
|
|
163
|
+
.idea/
|
|
164
|
+
*.iml
|
|
165
|
+
.vscode/
|
|
166
|
+
|
|
167
|
+
# OS
|
|
168
|
+
.DS_Store
|
|
169
|
+
Thumbs.db
|
|
170
|
+
`;
|
|
171
|
+
await fs.writeFile(path.join(pluginSourceDir, '.gitignore'), gitignore);
|
|
172
|
+
gitSpinner.succeed('Git repository initialized');
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
gitSpinner.warn('Git initialization failed (git may not be installed)');
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
info('Skipping git initialization');
|
|
180
|
+
}
|
|
181
|
+
// Success!
|
|
182
|
+
success('\n✨ Project created successfully!');
|
|
183
|
+
console.log(`
|
|
184
|
+
📁 Project structure:
|
|
185
|
+
${projectName}/
|
|
186
|
+
├── Assets.zip
|
|
187
|
+
├── mods/ # Compiled plugins go here
|
|
188
|
+
└── Server/
|
|
189
|
+
├── HytaleServer.jar
|
|
190
|
+
└── Plugins/
|
|
191
|
+
└── ${projectName}/ # Your plugin source code
|
|
192
|
+
|
|
193
|
+
🚀 Next steps:
|
|
194
|
+
cd ${projectName}/Server/Plugins/${projectName}
|
|
195
|
+
hyt build # Build your plugin
|
|
196
|
+
hyt dev # Start development mode
|
|
197
|
+
|
|
198
|
+
📖 Plugin source is in: Server/Plugins/${projectName}/app/src/
|
|
199
|
+
`);
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
if (err instanceof ConfigError || err instanceof HytaleError) {
|
|
203
|
+
error(err.message);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
error(`Init failed: ${err.message}`);
|
|
207
|
+
}
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
async function copyDirectory(src, dest) {
|
|
213
|
+
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
214
|
+
await fs.mkdir(dest, { recursive: true });
|
|
215
|
+
for (const entry of entries) {
|
|
216
|
+
const srcPath = path.join(src, entry.name);
|
|
217
|
+
const destPath = path.join(dest, entry.name);
|
|
218
|
+
if (entry.isDirectory()) {
|
|
219
|
+
await copyDirectory(srcPath, destPath);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
await fs.copyFile(srcPath, destPath);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
async function extractZip(zipPath, destDir) {
|
|
227
|
+
if (process.platform === 'win32') {
|
|
228
|
+
await execa('powershell', [
|
|
229
|
+
'-Command',
|
|
230
|
+
`Expand-Archive -Path "${zipPath}" -DestinationPath "${destDir}" -Force`
|
|
231
|
+
]);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
await execa('unzip', ['-o', zipPath, '-d', destDir]);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
async function replaceInFiles(dir, search, replace) {
|
|
238
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
239
|
+
for (const entry of entries) {
|
|
240
|
+
const entryPath = path.join(dir, entry.name);
|
|
241
|
+
if (entry.isDirectory()) {
|
|
242
|
+
await replaceInFiles(entryPath, search, replace);
|
|
243
|
+
}
|
|
244
|
+
else if (entry.isFile()) {
|
|
245
|
+
// Only process text files
|
|
246
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
247
|
+
const textExtensions = ['.java', '.kt', '.kts', '.gradle', '.json', '.xml', '.properties', '.md', '.txt'];
|
|
248
|
+
if (textExtensions.includes(ext) || entry.name === 'gradlew') {
|
|
249
|
+
try {
|
|
250
|
+
let content = await fs.readFile(entryPath, 'utf-8');
|
|
251
|
+
if (content.includes(search)) {
|
|
252
|
+
content = content.replace(new RegExp(search, 'g'), replace);
|
|
253
|
+
await fs.writeFile(entryPath, content, 'utf-8');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
// Skip binary files or files we can't read
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function toPascalCase(str) {
|
|
264
|
+
return str
|
|
265
|
+
.split(/[-_\s]+/)
|
|
266
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
267
|
+
.join('');
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/E,O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C7C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG;SACP,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SACvE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,YAAY,IAAI,OAAO,CA+JtC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { loadConfig, saveConfig } from '../utils/config.js';
|
|
3
|
+
import { detectJava, validateJavaVersion, verifyJavaPath } from '../utils/java.js';
|
|
4
|
+
import { findHytaleInstall, verifyHytaleInstall } from '../utils/hytale.js';
|
|
5
|
+
import { downloadAndInstallJava, hasInstalledJava, getJavaExecutablePathAsync } from '../utils/javaDownload.js';
|
|
6
|
+
import { startSpinner, success, error, info } from '../utils/ui.js';
|
|
7
|
+
import { JavaError, HytaleError, ConfigError } from '../utils/errors.js';
|
|
8
|
+
import readline from 'readline';
|
|
9
|
+
export function setupCommand() {
|
|
10
|
+
return new Command('setup')
|
|
11
|
+
.description('Configure HYT with Java and Hytale installation paths')
|
|
12
|
+
.option('--java-path <path>', 'Manually specify Java executable path')
|
|
13
|
+
.option('--hytale-path <path>', 'Manually specify Hytale installation path')
|
|
14
|
+
.action(async (options) => {
|
|
15
|
+
try {
|
|
16
|
+
console.log('🔧 Setting up HYT...\n');
|
|
17
|
+
const existingConfig = await loadConfig();
|
|
18
|
+
const config = existingConfig || {};
|
|
19
|
+
let javaPath;
|
|
20
|
+
if (options.javaPath) {
|
|
21
|
+
info(`Using manually specified Java path: ${options.javaPath}`);
|
|
22
|
+
javaPath = options.javaPath;
|
|
23
|
+
if (!(await verifyJavaPath(javaPath))) {
|
|
24
|
+
throw new JavaError(`Java executable not found at: ${javaPath}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (await hasInstalledJava()) {
|
|
29
|
+
javaPath = await getJavaExecutablePathAsync();
|
|
30
|
+
info(`Using HYT-installed Java at: ${javaPath}`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const spinner = startSpinner('Detecting Java installation...');
|
|
34
|
+
const detectedJava = await detectJava();
|
|
35
|
+
if (!detectedJava) {
|
|
36
|
+
spinner.fail('Java not found in PATH');
|
|
37
|
+
console.log('\n💡 Java 25 is required but not found on your system.');
|
|
38
|
+
console.log('Would you like HYT to download and install Java 25 automatically?');
|
|
39
|
+
console.log('(It will be installed to ~/.hyt/java25/ and will not affect your system Java)\n');
|
|
40
|
+
const answer = await askYesNo('Download Java 25 now?');
|
|
41
|
+
if (answer) {
|
|
42
|
+
const downloadSpinner = startSpinner('Downloading Java 25 (this may take a few minutes, ~200MB)...');
|
|
43
|
+
try {
|
|
44
|
+
javaPath = await downloadAndInstallJava();
|
|
45
|
+
downloadSpinner.succeed(`Java 25 installed successfully to: ${javaPath}`);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
downloadSpinner.fail('Failed to download Java');
|
|
49
|
+
throw new JavaError(`Could not download Java 25: ${err.message}\n` +
|
|
50
|
+
'Please install Java manually or use --java-path to specify the location.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
throw new JavaError('Java 25 or higher is required. Please install Java manually or use --java-path to specify the location.');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
javaPath = detectedJava;
|
|
59
|
+
spinner.succeed(`Found Java at: ${javaPath}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Validate Java version
|
|
64
|
+
const versionSpinner = startSpinner('Validating Java version...');
|
|
65
|
+
let versionValid = false;
|
|
66
|
+
try {
|
|
67
|
+
await validateJavaVersion(javaPath);
|
|
68
|
+
versionSpinner.succeed('Java version is compatible');
|
|
69
|
+
versionValid = true;
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
versionSpinner.fail('Java version check failed');
|
|
73
|
+
// If version is incompatible and not manually specified, offer to download
|
|
74
|
+
if (err instanceof JavaError && !options.javaPath) {
|
|
75
|
+
console.log(`\n${err.message}`);
|
|
76
|
+
console.log('\n💡 Would you like HYT to download and install Java 25 automatically?');
|
|
77
|
+
console.log('(It will be installed to ~/.hyt/java25/ and will not affect your system Java)\n');
|
|
78
|
+
const answer = await askYesNo('Download Java 25 now?');
|
|
79
|
+
if (answer) {
|
|
80
|
+
const downloadSpinner = startSpinner('Downloading Java 25 (this may take a few minutes, ~200MB)...');
|
|
81
|
+
try {
|
|
82
|
+
javaPath = await downloadAndInstallJava();
|
|
83
|
+
downloadSpinner.succeed(`Java 25 installed successfully to: ${javaPath}`);
|
|
84
|
+
// Validate the downloaded version
|
|
85
|
+
await validateJavaVersion(javaPath);
|
|
86
|
+
versionValid = true;
|
|
87
|
+
}
|
|
88
|
+
catch (downloadErr) {
|
|
89
|
+
downloadSpinner.fail('Failed to download Java');
|
|
90
|
+
throw new JavaError(`Could not download Java 25: ${downloadErr.message}\n` +
|
|
91
|
+
'Please install Java 25 manually or use --java-path to specify the location.');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throw err;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// Manual path specified with wrong version, or other error
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!versionValid) {
|
|
104
|
+
throw new JavaError('Java version validation failed');
|
|
105
|
+
}
|
|
106
|
+
config.javaPath = javaPath;
|
|
107
|
+
// Hytale installation detection/validation
|
|
108
|
+
let hytaleInstallPath;
|
|
109
|
+
if (options.hytalePath) {
|
|
110
|
+
// Manual override
|
|
111
|
+
info(`Using manually specified Hytale path: ${options.hytalePath}`);
|
|
112
|
+
hytaleInstallPath = options.hytalePath;
|
|
113
|
+
// Verify path exists
|
|
114
|
+
if (!(await verifyHytaleInstall(hytaleInstallPath))) {
|
|
115
|
+
throw new HytaleError(`Hytale installation not found at: ${hytaleInstallPath}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// Auto-detect
|
|
120
|
+
const spinner = startSpinner('Detecting Hytale installation...');
|
|
121
|
+
const detectedHytale = await findHytaleInstall();
|
|
122
|
+
if (!detectedHytale) {
|
|
123
|
+
spinner.fail('Hytale installation not found');
|
|
124
|
+
throw new HytaleError('Hytale installation not found. Please install Hytale or use --hytale-path to specify the location.');
|
|
125
|
+
}
|
|
126
|
+
hytaleInstallPath = detectedHytale;
|
|
127
|
+
spinner.succeed(`Found Hytale at: ${hytaleInstallPath}`);
|
|
128
|
+
}
|
|
129
|
+
config.hytaleInstallPath = hytaleInstallPath;
|
|
130
|
+
// Save configuration
|
|
131
|
+
const saveSpinner = startSpinner('Saving configuration...');
|
|
132
|
+
await saveConfig(config);
|
|
133
|
+
saveSpinner.succeed('Configuration saved');
|
|
134
|
+
success('\\n✨ HYT setup complete!');
|
|
135
|
+
console.log('\\nYou can now use the following commands:');
|
|
136
|
+
console.log(' hyt init <project-name> - Create a new Hytale plugin project');
|
|
137
|
+
console.log(' hyt build - Build your plugin');
|
|
138
|
+
console.log(' hyt dev - Start development mode with hot reload');
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
if (err instanceof JavaError || err instanceof HytaleError || err instanceof ConfigError) {
|
|
142
|
+
error(err.message);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
error(`Setup failed: ${err.message}`);
|
|
146
|
+
}
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
async function askYesNo(question) {
|
|
152
|
+
const rl = readline.createInterface({
|
|
153
|
+
input: process.stdin,
|
|
154
|
+
output: process.stdout,
|
|
155
|
+
});
|
|
156
|
+
return new Promise((resolve) => {
|
|
157
|
+
rl.question(`${question} (Y/n): `, (answer) => {
|
|
158
|
+
rl.close();
|
|
159
|
+
const normalized = answer.trim().toLowerCase();
|
|
160
|
+
resolve(normalized === '' || normalized === 'y' || normalized === 'yes');
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAgB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAQ,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;SACxB,WAAW,CAAC,uDAAuD,CAAC;SACpE,MAAM,CA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AAC,CAAC;YACnD,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,QAAgB;IACtC,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,GAAG,QAAQ,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE;YAC5C,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC/C,OAAO,CAAC,UAAU,KAAK,EAAE,IAAI,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,KAAK,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
import { setupCommand } from './commands/setup.js';
|
|
5
|
+
import { initCommand } from './commands/init.js';
|
|
6
|
+
import { buildCommand } from './commands/build.js';
|
|
7
|
+
import { devCommand } from './commands/dev.js';
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const { version } = require('../package.json');
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('hyt')
|
|
13
|
+
.description('CLI tool for Hytale plugin development automation')
|
|
14
|
+
.version(version);
|
|
15
|
+
program.addCommand(setupCommand());
|
|
16
|
+
program.addCommand(initCommand());
|
|
17
|
+
program.addCommand(buildCommand());
|
|
18
|
+
program.addCommand(devCommand());
|
|
19
|
+
program.parse(process.argv);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,mDAAmD,CAAC;KAChE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;AAEjC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ConfigSchema {
|
|
2
|
+
javaPath: string;
|
|
3
|
+
hytaleInstallPath: string;
|
|
4
|
+
}
|
|
5
|
+
/** Load configuration from ~/.hyt/config.json */
|
|
6
|
+
export declare function loadConfig(): Promise<ConfigSchema | null>;
|
|
7
|
+
/** Save configuration to ~/.hyt/config.json */
|
|
8
|
+
export declare function saveConfig(config: ConfigSchema): Promise<void>;
|
|
9
|
+
/** Validate configuration schema */
|
|
10
|
+
export declare function validateConfig(config: Partial<ConfigSchema>): config is ConfigSchema;
|
|
11
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,iDAAiD;AACjD,wBAAsB,UAAU,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAW/D;AAED,+CAA+C;AAC/C,wBAAsB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAapE;AAED,oCAAoC;AACpC,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,MAAM,IAAI,YAAY,CAOpF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import { ConfigError } from './errors.js';
|
|
3
|
+
import { getConfigDir, getConfigPath } from './paths.js';
|
|
4
|
+
/** Load configuration from ~/.hyt/config.json */
|
|
5
|
+
export async function loadConfig() {
|
|
6
|
+
try {
|
|
7
|
+
const configPath = getConfigPath();
|
|
8
|
+
const data = await fs.readFile(configPath, 'utf-8');
|
|
9
|
+
return JSON.parse(data);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
if (error.code === 'ENOENT') {
|
|
13
|
+
return null; // Config file doesn't exist yet
|
|
14
|
+
}
|
|
15
|
+
throw new ConfigError(`Failed to load configuration: ${error.message}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Save configuration to ~/.hyt/config.json */
|
|
19
|
+
export async function saveConfig(config) {
|
|
20
|
+
try {
|
|
21
|
+
const configDir = getConfigDir();
|
|
22
|
+
const configPath = getConfigPath();
|
|
23
|
+
// Ensure config directory exists
|
|
24
|
+
await fs.mkdir(configDir, { recursive: true });
|
|
25
|
+
// Write config file
|
|
26
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw new ConfigError(`Failed to save configuration: ${error.message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Validate configuration schema */
|
|
33
|
+
export function validateConfig(config) {
|
|
34
|
+
return (typeof config.javaPath === 'string' &&
|
|
35
|
+
config.javaPath.length > 0 &&
|
|
36
|
+
typeof config.hytaleInstallPath === 'string' &&
|
|
37
|
+
config.hytaleInstallPath.length > 0);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOzD,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAiB,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC,CAAC,gCAAgC;QAC/C,CAAC;QACD,MAAM,IAAI,WAAW,CAAC,iCAAkC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;AACH,CAAC;AAED,+CAA+C;AAC/C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAoB;IACnD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QAEnC,iCAAiC;QACjC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE/C,oBAAoB;QACpB,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CAAC,iCAAkC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;AACH,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,cAAc,CAAC,MAA6B;IAC1D,OAAO,CACL,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ;QACnC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QAC1B,OAAO,MAAM,CAAC,iBAAiB,KAAK,QAAQ;QAC5C,MAAM,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Download a file from URL to destination with progress bar */
|
|
2
|
+
export declare function downloadFile(url: string, destPath: string, maxRedirects?: number): Promise<void>;
|
|
3
|
+
/** Download the example plugin template */
|
|
4
|
+
export declare function downloadTemplate(destPath: string): Promise<void>;
|
|
5
|
+
/** Download CFR decompiler */
|
|
6
|
+
export declare function downloadCfr(destPath: string): Promise<void>;
|
|
7
|
+
export declare function getTemplateUrl(): string;
|
|
8
|
+
export declare function getCfrUrl(): string;
|
|
9
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAUA,gEAAgE;AAChE,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ElG;AAED,2CAA2C;AAC3C,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED,8BAA8B;AAC9B,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
|