@littlecarlito/blorktools 0.51.0 → 0.52.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.
- package/bin/cli.js +37 -14
- package/package.json +2 -2
package/bin/cli.js
CHANGED
|
@@ -5,9 +5,34 @@ import path from 'path';
|
|
|
5
5
|
|
|
6
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const packageRoot = path.resolve(__dirname, '..');
|
|
8
|
+
const SUBCOMMANDS = {
|
|
9
|
+
debugger: {
|
|
10
|
+
root: 'src/asset_debugger',
|
|
11
|
+
description: '3D asset debugger with drag-and-drop interface'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function printHelp() {
|
|
16
|
+
console.log(`
|
|
17
|
+
blorktools - 3D Asset Development Tools
|
|
18
|
+
|
|
19
|
+
Usage: blorktools [command] [options]
|
|
20
|
+
|
|
21
|
+
Commands:
|
|
22
|
+
(none) Open the tools index page
|
|
23
|
+
debugger Open the asset debugger directly
|
|
24
|
+
|
|
25
|
+
Options:
|
|
26
|
+
--port, -p <number> Port to run on (default: 3001)
|
|
27
|
+
--host, -h <string> Host to bind to (default: localhost)
|
|
28
|
+
--no-open Don't open browser automatically
|
|
29
|
+
--help Show this help message
|
|
30
|
+
`);
|
|
31
|
+
}
|
|
8
32
|
|
|
9
33
|
function parseArgs(args) {
|
|
10
34
|
const result = {
|
|
35
|
+
command: null,
|
|
11
36
|
port: 3001,
|
|
12
37
|
host: 'localhost',
|
|
13
38
|
open: true
|
|
@@ -30,18 +55,16 @@ function parseArgs(args) {
|
|
|
30
55
|
} else if (arg === '--no-open') {
|
|
31
56
|
result.open = false;
|
|
32
57
|
} else if (arg === '--help') {
|
|
33
|
-
|
|
34
|
-
blorktools - 3D Asset Development Tools
|
|
35
|
-
|
|
36
|
-
Usage: blorktools [options]
|
|
37
|
-
|
|
38
|
-
Options:
|
|
39
|
-
--port, -p <number> Port to run on (default: 3001)
|
|
40
|
-
--host, -h <string> Host to bind to (default: localhost)
|
|
41
|
-
--no-open Don't open browser automatically
|
|
42
|
-
--help Show this help message
|
|
43
|
-
`);
|
|
58
|
+
printHelp();
|
|
44
59
|
process.exit(0);
|
|
60
|
+
} else if (!arg.startsWith('-')) {
|
|
61
|
+
if (SUBCOMMANDS[arg]) {
|
|
62
|
+
result.command = arg;
|
|
63
|
+
} else {
|
|
64
|
+
console.error(`Error: Unknown command "${arg}"`);
|
|
65
|
+
console.error('Run "blorktools --help" for available commands');
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
45
68
|
}
|
|
46
69
|
}
|
|
47
70
|
return result;
|
|
@@ -49,17 +72,17 @@ Options:
|
|
|
49
72
|
|
|
50
73
|
async function main() {
|
|
51
74
|
const args = parseArgs(process.argv.slice(2));
|
|
75
|
+
const subcommand = args.command ? SUBCOMMANDS[args.command] : null;
|
|
76
|
+
const rootDir = subcommand ? path.join(packageRoot, subcommand.root) : path.join(packageRoot, 'src');
|
|
52
77
|
const viteConfig = await import(path.join(packageRoot, 'vite.config.js'));
|
|
53
78
|
const config = viteConfig.default;
|
|
54
|
-
// Override with CLI args
|
|
55
79
|
config.server = {
|
|
56
80
|
...config.server,
|
|
57
81
|
port: args.port,
|
|
58
82
|
host: args.host,
|
|
59
83
|
open: args.open ? '/index.html' : false
|
|
60
84
|
};
|
|
61
|
-
|
|
62
|
-
config.root = path.join(packageRoot, 'src');
|
|
85
|
+
config.root = rootDir;
|
|
63
86
|
const server = await createServer(config);
|
|
64
87
|
await server.listen();
|
|
65
88
|
server.printUrls();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@littlecarlito/blorktools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.1",
|
|
4
4
|
"description": "Development tools for 3D assets and debugging",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"license": "SEE LICENSE IN LICENSE",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "f8f270c622b30258c9196566e81cba2497558ae5"
|
|
49
49
|
}
|