@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 +0 -1
- package/package.json +1 -1
- package/swarm.rip +3 -16
package/lib/worker.mjs
CHANGED
package/package.json
CHANGED
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
|
-
|
|
288
|
+
exit 1
|
|
302
289
|
when 'ready'
|
|
303
290
|
dispatchNext(w, slot)
|
|
304
291
|
when 'done'
|