Comparing version 0.5.5 to 0.5.6
@@ -37,4 +37,7 @@ var assert = require("assert"); | ||
arg.value = relativize(this.moduleId, arg.value); | ||
return; | ||
} | ||
} | ||
this.genericVisit(exp); | ||
} | ||
@@ -41,0 +44,0 @@ }); |
@@ -17,3 +17,3 @@ { | ||
], | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"homepage": "http://github.com/benjamn/commoner", | ||
@@ -20,0 +20,0 @@ "repository": { |
@@ -23,7 +23,8 @@ Commoner | ||
Commoner also takes care to rewrite all `require` calls to use relative | ||
module identifiers, so that the output files can be installed into any | ||
subdirectory of a larger project, and external tools do not have to give | ||
special treatment to top-level modules (or even know which modules are | ||
top-level and which are nested). | ||
Commoner also takes care to rewrite all `require` calls to use [relative module | ||
identifiers](http://wiki.commonjs.org/wiki/Modules/1.1#Module_Identifiers), | ||
so that the output files can be installed into any subdirectory of a | ||
larger project, and external tools do not have to give special treatment | ||
to top-level modules (or even know which modules are top-level and which | ||
are nested). | ||
@@ -30,0 +31,0 @@ Commoner was derived from an earlier, more opinionated tool called |
@@ -152,11 +152,14 @@ var Watcher = require("../lib/watcher").Watcher; | ||
function makeSource(id) { | ||
var str = JSON.stringify(id); | ||
return "require(" + str + ");\n" + | ||
"require(function(){require(" + str + ")}())"; | ||
} | ||
function helperP(requiredId, expected) { | ||
return relativizeP( | ||
"some/deeply/nested/module", | ||
"require(" + JSON.stringify(requiredId) + ")" | ||
makeSource(requiredId) | ||
).then(function(source) { | ||
assert.strictEqual( | ||
source, | ||
"require(" + JSON.stringify(expected) + ")" | ||
); | ||
assert.strictEqual(source, makeSource(expected)); | ||
}); | ||
@@ -163,0 +166,0 @@ } |
48174
1065
290