openuispec 0.2.0 → 0.2.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.
@@ -246,17 +246,23 @@ export async function takeScreenshot(
246
246
 
247
247
  // ── cleanup ─────────────────────────────────────────────────────────
248
248
 
249
- export function shutdownAll() {
249
+ export async function shutdownAll() {
250
250
  for (const [, instance] of servers) {
251
251
  try { instance.process.kill(); } catch { /* already dead */ }
252
252
  }
253
253
  servers.clear();
254
254
  if (browserInstance) {
255
- try { browserInstance.close(); } catch { /* ignore */ }
255
+ try { await browserInstance.close(); } catch { /* ignore */ }
256
256
  browserInstance = null;
257
257
  }
258
258
  }
259
259
 
260
- process.on("exit", shutdownAll);
261
- process.on("SIGINT", () => { shutdownAll(); process.exit(0); });
262
- process.on("SIGTERM", () => { shutdownAll(); process.exit(0); });
260
+ process.on("exit", () => {
261
+ // Sync-only fallback for process exit
262
+ for (const [, instance] of servers) {
263
+ try { instance.process.kill(); } catch { /* already dead */ }
264
+ }
265
+ servers.clear();
266
+ });
267
+ process.on("SIGINT", () => { shutdownAll().then(() => process.exit(0)); });
268
+ process.on("SIGTERM", () => { shutdownAll().then(() => process.exit(0)); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openuispec",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A semantic UI specification format for AI-native, platform-native app development",
@@ -28,7 +28,9 @@
28
28
  "openuispec-mcp": "./mcp-server/index.ts"
29
29
  },
30
30
  "scripts": {
31
- "test": "node --import tsx --test tests/*.test.ts",
31
+ "test": "node --import tsx --test tests/check.test.ts tests/configure-target.test.ts tests/drift-prepare.test.ts tests/init.test.ts tests/mcp-tools.test.ts tests/semantic-lint.test.ts tests/status.test.ts",
32
+ "test:screenshot": "node --import tsx --test tests/mcp-screenshot.test.ts",
33
+ "test:all": "node --import tsx --test tests/*.test.ts",
32
34
  "validate": "tsx schema/validate.ts",
33
35
  "validate:manifest": "tsx schema/validate.ts manifest",
34
36
  "validate:tokens": "tsx schema/validate.ts tokens",