blackberry-webworks/BBX-Framework — Issue #3: Find a good way of handling relative paths
Author: gtanner
Created: 2011-11-01 14:08:09+00:00
State: open

Spawned from Pull Request #2

The direction of node and npm in relation to requiring in modules forces us to use relative paths.

My main concern is that using a module in production code will look like:

var x = require("./lib/foo/bar");

and using it tests will look like:

var x = require("../../lib/foo/bar");

We used require.paths in Ripple to make it so all require statements would look like:

var x = require("foo/bar");

Since we would add the lib directory to the paths to search.

This is going to quickly get out of hand as we add more code so we need a solution to how to do this without polluting the users NODE_PATH env var or doing other hacky stuff