ariatemplates/hashspace — pull request #149 by PK1A (2014-04-24 12:43:20+00:00)
Title: refactor: use relative paths in requires

This is the first part of fixes that should allow us, in the end, to solve https://github.com/ariatemplates/hashspace/issues/121.

Problem description: in node.js the `require('foo')` will try to load a module from a "defined root folder" that defaults to `node_modules`. As of today the node's loading algorithm assumes that there is only one predefined "root folder". Contrary to the node's loading algorithm, in our code base we assume that there are multiple ones:
* `.` when we reference hsp: `require("hsp/foo/bar.js")`
* `node_modules` when we reference "real" 3rd party modules (accorn etc.).

This PR is the first one that is aiming to have only one "root folder" being `node_modules`. To achieve this we need to stop using `require("hsp/foo/bar.js")` and use relative paths for internal #space files instead.