@rip-lang/swarm 1.2.10 → 1.2.12

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/swarm.rip +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/swarm",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "Parallel job runner with worker threads — setup once, swarm many",
5
5
  "type": "module",
6
6
  "main": "swarm.rip",
@@ -35,7 +35,7 @@
35
35
  "author": "Steve Shreeve <steve.shreeve@gmail.com>",
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "rip-lang": "^3.13.4"
38
+ "rip-lang": "^3.13.7"
39
39
  },
40
40
  "files": [
41
41
  "swarm.rip",
package/swarm.rip CHANGED
@@ -202,8 +202,11 @@ export swarm = (opts = {}) ->
202
202
  workerPath = join(dirname(new URL(import.meta.url).pathname), 'lib', 'worker.mjs')
203
203
  scriptPath = resolve(process.argv[1] or '')
204
204
 
205
- # find rip-loader for workers (NODE_PATH ensures require.resolve works)
206
- loaderPath = try join(dirname(require.resolve('rip-lang')), '..', 'rip-loader.js')
205
+ # find rip-loader for workers derive from swarm's own location
206
+ # (swarm is at node_modules/@rip-lang/swarm/, loader is at node_modules/rip-lang/)
207
+ swarmDir = dirname(new URL(import.meta.url).pathname)
208
+ loaderPath = join(swarmDir, '..', '..', 'rip-lang', 'rip-loader.js')
209
+ loaderPath = null unless existsSync(loaderPath)
207
210
 
208
211
  # state
209
212
  live = 0