In this contrived(•) example, we will stop at project/package.json when, in fact, the copy at project/client/package.json has all the fly-related plugins declared. In this situation, all tasks will fail with "this.source(...).xo" is not a function.
(•) Yes, flyfile.js could be moved to client/flyfile.js)
To fix this, User can now place a "fly" key in their root package.json (the one Fly finds):
Now, Fly will recursively read package.json files. If a file has this key block declared, Fly will resolve (path.resolve) the specified directory from the current file's directory.
This also means that one can point to a directory outside of project.
However, if the new directory does not contain a package.json file, Fly will notify User that nothing was found & exit.
Currently, Fly is assuming that a project's main
package.json
file is located somewhere between theflyfile.js
and the project's root directory.In rare situations, the
package.json
file that we found may not be the one that User wants us to use.For example:
In this contrived(•) example, we will stop at
project/package.json
when, in fact, the copy atproject/client/package.json
has all the fly-related plugins declared. In this situation, all tasks will fail with"this.source(...).xo" is not a function
.To fix this, User can now place a
"fly"
key in their rootpackage.json
(the one Fly finds):Now, Fly will recursively read
package.json
files. If a file has this key block declared, Fly will resolve (path.resolve
) the specified directory from the current file's directory.However, if the new directory does not contain a
package.json
file, Fly will notify User that nothing was found & exit.