Skip to content

Commit

Permalink
Merge 0307217 into 7ff4c8e
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Dec 16, 2014
2 parents 7ff4c8e + 0307217 commit 178bf40
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/component-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = ComponentPackage;

function normalize(pkg) {
var dest = path.dirname(pkg);
delete require.cache[pkg];
delete require.cache[require.resolve(pkg)];
pkg = require(pkg);
var scripts = pkg.scripts || [];
var styles = pkg.styles || [];
Expand Down
2 changes: 1 addition & 1 deletion lib/spm-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = SpmPackage;

function normalize(pkg) {
var dest = path.dirname(pkg);
delete require.cache[pkg];
delete require.cache[require.resolve(pkg)];
pkg = require(pkg);
pkg.spm = pkg.spm || {};

Expand Down
Empty file.
9 changes: 9 additions & 0 deletions test/fixtures/spm/symlink-deps/b/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "b",
"version": "0.1.0",
"spm": {
"dependencies": {
"c": "0.1.0"
}
}
}
Empty file.
6 changes: 6 additions & 0 deletions test/fixtures/spm/symlink-deps/c/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "c",
"version": "0.1.0",
"spm": {
}
}
Empty file.
9 changes: 9 additions & 0 deletions test/fixtures/spm/symlink-deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "a",
"version": "0.1.0",
"spm": {
"dependencies": {
"b": "0.1.0"
}
}
}
1 change: 1 addition & 0 deletions test/fixtures/spm/symlink-deps/sea-modules/b/0.1.0
1 change: 1 addition & 0 deletions test/fixtures/spm/symlink-deps/sea-modules/c/0.1.0
7 changes: 7 additions & 0 deletions test/spm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ describe('Father.SpmPackage', function() {
pkgB.main.should.eql('src/b.js');
});

it('symlink deps', function() {
var pkg;
pkg = getPackage('symlink-deps');
pkg = getPackage('symlink-deps');
pkg.name.should.be.equal('a');
});

describe('error', function() {

it('not found ./b', function() {
Expand Down

0 comments on commit 178bf40

Please sign in to comment.