juxscript 1.1.75 → 1.1.77

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "totalComponents": 63,
3
- "generatedAt": "2026-02-11T22:28:43.938Z",
3
+ "generatedAt": "2026-02-11T22:32:45.675Z",
4
4
  "components": [
5
5
  {
6
6
  "file": "alert.js",
@@ -208,6 +208,7 @@ app.get('*', (req, res) => {
208
208
  const server = http.createServer(app);
209
209
  let wss = null;
210
210
  let watcher = null;
211
+ let publicWatcher = null; // āœ… Declare at top level
211
212
 
212
213
  if (HOT_RELOAD) {
213
214
  wss = new WebSocketServer({ port: WS_PORT });
@@ -263,7 +264,7 @@ if (HOT_RELOAD) {
263
264
  if (fs.existsSync(paths.public)) {
264
265
  console.log(`šŸ‘€ Watching public assets: ${paths.public}`);
265
266
 
266
- const publicWatcher = createWatcher(paths.public, {
267
+ publicWatcher = createWatcher(paths.public, {
267
268
  onChange: async (changedFiles) => {
268
269
  console.log('šŸ“¦ Public asset changed, copying...');
269
270
 
@@ -280,13 +281,6 @@ if (HOT_RELOAD) {
280
281
  // Silent, already logged main watcher
281
282
  }
282
283
  });
283
-
284
- // āœ… Store reference for cleanup
285
- const originalShutdown = shutdown;
286
- shutdown = () => {
287
- if (publicWatcher) publicWatcher.close();
288
- originalShutdown();
289
- };
290
284
  }
291
285
  }
292
286
 
@@ -300,9 +294,11 @@ server.listen(PORT, () => {
300
294
  }
301
295
  });
302
296
 
297
+ // āœ… Define shutdown AFTER all variables are initialized
303
298
  const shutdown = () => {
304
299
  console.log('\nšŸ‘‹ Shutting down...');
305
300
  if (watcher) watcher.close();
301
+ if (publicWatcher) publicWatcher.close(); // āœ… Close public watcher
306
302
  if (wss) {
307
303
  wss.clients.forEach(client => client.terminate());
308
304
  wss.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.75",
3
+ "version": "1.1.77",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",