@series-inc/stowkit-cli 0.6.16 → 0.6.17
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/dist/cli.js +22 -0
- package/dist/init.js +20 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -128,6 +128,18 @@ function openBrowser(url) {
|
|
|
128
128
|
exec(`${cmd} ${url}`);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
+
async function isStowKitRunning(port) {
|
|
132
|
+
try {
|
|
133
|
+
const controller = new AbortController();
|
|
134
|
+
const timeout = setTimeout(() => controller.abort(), 1000);
|
|
135
|
+
const res = await fetch(`http://localhost:${port}/api/project`, { signal: controller.signal });
|
|
136
|
+
clearTimeout(timeout);
|
|
137
|
+
return res.ok;
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
131
143
|
async function main() {
|
|
132
144
|
if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
|
|
133
145
|
printUsage();
|
|
@@ -269,6 +281,11 @@ async function main() {
|
|
|
269
281
|
break;
|
|
270
282
|
}
|
|
271
283
|
case 'packer': {
|
|
284
|
+
if (await isStowKitRunning(port)) {
|
|
285
|
+
console.log(`\n Packer already running: http://localhost:${port}\n`);
|
|
286
|
+
openBrowser(`http://localhost:${port}`);
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
272
289
|
const packerDir = resolveAppDir('@series-inc/stowkit-packer-gui', 'stowkit-packer-gui');
|
|
273
290
|
if (!packerDir) {
|
|
274
291
|
console.error('Packer GUI not found. Install it: npm install @series-inc/stowkit-packer-gui');
|
|
@@ -281,6 +298,11 @@ async function main() {
|
|
|
281
298
|
break;
|
|
282
299
|
}
|
|
283
300
|
case 'editor': {
|
|
301
|
+
if (await isStowKitRunning(port)) {
|
|
302
|
+
console.log(`\n Editor already running: http://localhost:${port}\n`);
|
|
303
|
+
openBrowser(`http://localhost:${port}`);
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
284
306
|
const editorDir = resolveAppDir('@series-inc/stowkit-editor', 'stowkit-editor');
|
|
285
307
|
if (!editorDir) {
|
|
286
308
|
console.error('Editor not found. Install it: npm install @series-inc/stowkit-editor');
|
package/dist/init.js
CHANGED
|
@@ -96,6 +96,8 @@ export async function initProject(projectDir, opts) {
|
|
|
96
96
|
'# StowKit',
|
|
97
97
|
'*.stowcache',
|
|
98
98
|
'public/cdn-assets/',
|
|
99
|
+
'Open Packer.bat',
|
|
100
|
+
'open-packer.sh',
|
|
99
101
|
].join('\n');
|
|
100
102
|
try {
|
|
101
103
|
const existing = await fs.readFile(gitignorePath, 'utf-8');
|
|
@@ -108,11 +110,14 @@ export async function initProject(projectDir, opts) {
|
|
|
108
110
|
}
|
|
109
111
|
// Copy AI skill/rule files
|
|
110
112
|
await copySkillFiles(absDir);
|
|
113
|
+
// Create double-clickable launcher scripts
|
|
114
|
+
await createLauncherScripts(absDir);
|
|
111
115
|
console.log(`Initialized StowKit project at ${absDir}`);
|
|
112
116
|
console.log(` Source art dir: ${srcArtDir}/`);
|
|
113
117
|
console.log(` Output dir: public/cdn-assets/`);
|
|
114
118
|
console.log(` Config: .felicityproject`);
|
|
115
119
|
console.log(` AI skills: .claude/skills/stowkit/SKILL.md, .cursor/rules/stowkit.mdc`);
|
|
120
|
+
console.log(` Launcher: Open Packer.bat (Windows) / open-packer.sh (macOS/Linux)`);
|
|
116
121
|
// Install engine if selected
|
|
117
122
|
if (withEngine) {
|
|
118
123
|
await installEngine(absDir);
|
|
@@ -120,6 +125,7 @@ export async function initProject(projectDir, opts) {
|
|
|
120
125
|
console.log('');
|
|
121
126
|
console.log('Drop your assets (PNG, JPG, FBX, WAV, etc.) into assets/');
|
|
122
127
|
console.log('Then run: stowkit build');
|
|
128
|
+
console.log('Or double-click "Open Packer.bat" to launch the packer GUI.');
|
|
123
129
|
}
|
|
124
130
|
async function installEngine(absDir) {
|
|
125
131
|
console.log('');
|
|
@@ -159,6 +165,20 @@ async function copySkillFiles(absDir) {
|
|
|
159
165
|
// Skill file not found in package — skip silently
|
|
160
166
|
}
|
|
161
167
|
}
|
|
168
|
+
async function createLauncherScripts(absDir) {
|
|
169
|
+
const batContent = [
|
|
170
|
+
'@echo off',
|
|
171
|
+
'npx @series-inc/stowkit-cli packer .',
|
|
172
|
+
'if %errorlevel% neq 0 pause',
|
|
173
|
+
].join('\r\n');
|
|
174
|
+
const shContent = [
|
|
175
|
+
'#!/bin/sh',
|
|
176
|
+
'cd "$(dirname "$0")"',
|
|
177
|
+
'npx @series-inc/stowkit-cli packer .',
|
|
178
|
+
].join('\n');
|
|
179
|
+
await fs.writeFile(path.join(absDir, 'Open Packer.bat'), batContent);
|
|
180
|
+
await fs.writeFile(path.join(absDir, 'open-packer.sh'), shContent, { mode: 0o755 });
|
|
181
|
+
}
|
|
162
182
|
async function copyEngineSkillFiles(absDir) {
|
|
163
183
|
const thisDir = path.dirname(fileURLToPath(import.meta.url));
|
|
164
184
|
const candidates = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@series-inc/stowkit-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"stowkit": "./dist/cli.js"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@series-inc/stowkit-packer-gui": "^0.1.17",
|
|
21
|
-
"@series-inc/stowkit-editor": "^0.1.
|
|
21
|
+
"@series-inc/stowkit-editor": "^0.1.7",
|
|
22
22
|
"draco3d": "^1.5.7",
|
|
23
23
|
"fbx-parser": "^2.1.3",
|
|
24
24
|
"@strangeape/ffmpeg-audio-wasm": "^0.1.0",
|