Skip to content
This repository was archived by the owner on Aug 15, 2018. It is now read-only.

Commit c0203aa

Browse files
committed
Merge pull request #967 from spmjs/parse-file-in-package
add testcase for `Parse file in package`
2 parents 0e3001e + 1904ade commit c0203aa

File tree

28 files changed

+55
-35
lines changed

28 files changed

+55
-35
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ specs := $(shell find ./tests -name '*.js' ! -path "*node_modules/*" ! -path "*s
88
reporter = spec
99
test:
1010
./node_modules/.bin/istanbul cover \
11-
./node_modules/.bin/_mocha -- -R ${reporter} -t 20000 ${specs}
11+
./node_modules/.bin/_mocha -- -R ${reporter} -t 20000 ${specs} --inline-diffs
1212

1313
debug:
1414
./node_modules/.bin/_mocha -R ${reporter} ${specs}

lib/build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ function checkDuplicate(files, pkg) {
235235
var versions = Object.keys(dup[k]);
236236
if (versions.length > 1) {
237237
log.warn('dulplicate',
238-
'version %s of package %s have been required while building %s'.to.yellow.color,
239-
versions.join(', '),
238+
'%s (%s) while building %s'.to.yellow.color,
240239
k,
241-
file.filepath
240+
versions.join(', '),
241+
file.path
242242
);
243243
}
244244
}

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
"gulp-jsbeautify": "~0.1.1",
3939
"gulp-load-plugins": "~0.5.3",
4040
"gulp-mirror": "~0.2.0",
41-
"gulp-size2": "^0.4.0",
42-
"gulp-template": "^1.0.0",
43-
"gulp-transport": "~0.6.0",
41+
"gulp-size2": "~0.4.0",
42+
"gulp-template": "~1.0.0",
43+
"gulp-transport": "~0.7.0",
4444
"gulp-uglify": "~0.2.1",
4545
"gulp-zip": "~0.3.4",
4646
"inherits": "~1.0.0",
47-
"inquirer": "^0.6.0",
47+
"inquirer": "~0.6.0",
4848
"jscoverage": "~0.3.8",
4949
"lodash": "~2.4.1",
5050
"mocha-browser2": "~0.3.0",
@@ -55,9 +55,9 @@
5555
"semver": "~2.2.1",
5656
"serve-spm": "~0.5.0",
5757
"spm-client": "~0.2.0",
58-
"spmrc": "^1.2.0",
58+
"spmrc": "~1.2.0",
5959
"tar": "~0.1.19",
60-
"umi": "~0.5.0",
60+
"umi": "~0.6.0",
6161
"whoami": "~0.0.3",
6262
"win-spawn": "~2.0.0"
6363
},
@@ -68,7 +68,7 @@
6868
"should": "*",
6969
"ls-archive": "~1.0.0",
7070
"istanbul": "*",
71-
"muk": "^0.3.1",
71+
"muk": "~0.3.1",
7272
"gulp-unzip": "~0.1.1"
7373
},
7474
"bin": {

tests/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('build', function() {
127127
var opt = {
128128
cwd: join(base, 'build-js'),
129129
dest: dest,
130-
zip: true,
130+
zip: true
131131
};
132132
build(opt, function(err) {
133133
should.not.exist(err);

tests/build/build-css/a.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import url("./b.css");
22
@import url("b");
3+
@import url("b/extra.css");
34

45
body {
56
background: none;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.extra {color:red;}

tests/build/build-js/relative.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
console.log('relative');
22
require('b');
3+
require('b/src/extra');
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('b-extra');

tests/build/expect/build-css-all/a/1.0.0/a-debug.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ li {
1010
color: red;
1111
}
1212

13+
.extra {color:red;}
14+
1315
body {
1416
background: none;
1517
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ul{margin:0}li{color:red}body{background:0 0}
1+
ul{margin:0}.extra,li{color:red}body{background:0 0}

0 commit comments

Comments
 (0)