Skip to content

Commit 042789c

Browse files
committed
allow for scoped fly-plugins
1 parent 18617df commit 042789c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/plugins.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const flatten = require("./fn").flatten
66
const co = require("bluebird").coroutine
77
const $ = require("./utils")
88

9-
const rgx = /^fly-/i
9+
const rgx = /^(@.*?\/fly-|fly-)/i
1010
const dirname = p.dirname
1111
const resolve = p.resolve
1212
const join = p.join

test/fixtures/alt/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"dependencies": {
33
"fly-plugin1": "*",
44
"fly-plugin-2": "*",
5-
"fly-no-exist": "*"
5+
"fly-no-exist": "*",
6+
"@demo/fly-thing": "*",
7+
"@foo-bar/fly-fake": "*",
8+
"@foo/ignore": "*"
69
},
710
"devDependencies": {
811
"fake": "*"

test/plugins.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test("plugins.getDependencies", co(function* (t) {
4747
const pkg = yield plugs.getPackage(altDir)
4848
const out2 = plugs.getDependencies(pkg.data)
4949
t.true(Array.isArray(out2), "via dir; returns an array")
50-
t.equal(out2.length, 5, "via dir; find all the available dependencies")
50+
t.equal(out2.length, 8, "via dir; find all the available dependencies")
5151

5252
const out3 = plugs.getDependencies({})
5353
t.true(Array.isArray(out3) && out3.length === 0, "via `{}`; returns an empty array")
@@ -62,7 +62,7 @@ test("plugins.load", co(function* (t) {
6262

6363
const out = yield plugs.load(flyfile)
6464
t.ok(Array.isArray(out), "returns an array")
65-
t.equal(out.length, 4, "filters down to fly-* plugins only")
65+
t.equal(out.length, 6, "filters down to fly-* plugins only")
6666
t.equal(typeof out[0], "function", "is an array of functions")
6767
t.equal(out[2], undefined, "returns `undefined` for faulty plugins")
6868

0 commit comments

Comments
 (0)