@rip-lang/swarm 1.2.7 → 1.2.9

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/lib/worker.mjs CHANGED
@@ -22,7 +22,6 @@ try {
22
22
  }
23
23
  } catch (err) {
24
24
  parentPort.postMessage({ type: 'error', error: err.message });
25
- process.exit(1);
26
25
  }
27
26
 
28
27
  // Signal ready
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/swarm",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "Parallel job runner with worker threads — setup once, swarm many",
5
5
  "type": "module",
6
6
  "main": "swarm.rip",
package/swarm.rip CHANGED
@@ -214,21 +214,6 @@ export swarm = (opts = {}) ->
214
214
  catch
215
215
  null
216
216
 
217
- # pre-flight: check workers can resolve modules from script directory
218
- dir = dirname(scriptPath)
219
- found = false
220
- loop
221
- if existsSync(join(dir, 'node_modules', '@rip-lang', 'swarm'))
222
- found = true
223
- break
224
- parent = dirname(dir)
225
- break if parent is dir
226
- dir = parent
227
- unless found
228
- console.error "swarm: no node_modules found — workers won't be able to load modules"
229
- console.error "hint: run 'bun add @rip-lang/all' in your project directory"
230
- exit 1
231
-
232
217
  # state
233
218
  live = 0
234
219
  done = 0
@@ -293,12 +278,14 @@ export swarm = (opts = {}) ->
293
278
  w.on 'message', (msg) ->
294
279
  switch msg.type
295
280
  when 'error'
281
+ writeFileSync('.swarm/errors.log', "worker #{slot} startup: #{msg.error}\n", { flag: 'a' }) if existsSync(_dir)
296
282
  unless fatal
297
283
  fatal = true
298
284
  cursor(true) unless quiet
285
+ write go(workers + 5, 1) unless quiet
299
286
  console.error "\nswarm: #{msg.error}"
300
287
  console.error "hint: run 'bun add @rip-lang/all' in your project directory" if msg.error.includes('Cannot find module')
301
- writeFileSync('.swarm/errors.log', "worker #{slot} startup: #{msg.error}\n", { flag: 'a' }) if existsSync(_dir)
288
+ exit 1
302
289
  when 'ready'
303
290
  dispatchNext(w, slot)
304
291
  when 'done'