Skip to content

Commit 952a521

Browse files
committed
Scaffold: Normalize repository
1 parent 2e7ffe4 commit 952a521

File tree

10 files changed

+113
-50
lines changed

10 files changed

+113
-50
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Logs
22
logs
33
*.log
4-
npm-debug.log*
54

65
# Runtime data
76
pids
@@ -14,24 +13,24 @@ lib-cov
1413
# Coverage directory used by tools like istanbul
1514
coverage
1615

17-
# nyc test coverage
18-
.nyc_output
19-
2016
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
2117
.grunt
2218

23-
# node-waf configuration
24-
.lock-wscript
25-
2619
# Compiled binary addons (http://nodejs.org/api/addons.html)
2720
build/Release
2821

29-
# Dependency directories
22+
# Dependency directory
23+
# Commenting this out is preferred by some people, see
24+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
3025
node_modules
3126
jspm_packages
3227

33-
# Optional npm cache directory
34-
.npm
28+
# Users Environment Variables
29+
.lock-wscript
30+
31+
# Garbage files
32+
.DS_Store
3533

36-
# Optional REPL history
37-
.node_repl_history
34+
# Generated by integration tests
35+
test/fixtures/tmp
36+
test/fixtures/out

.jscsrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "gulp"
3+
}

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- '6'
5+
- '5'
6+
- '4'
7+
- '0.12'
8+
- '0.10'
9+
after_script:
10+
- npm run coveralls

appveyor.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# http://www.appveyor.com/docs/appveyor-yml
2+
# http://www.appveyor.com/docs/lang/nodejs-iojs
3+
4+
environment:
5+
matrix:
6+
# node.js
7+
- nodejs_version: "0.10"
8+
- nodejs_version: "0.12"
9+
- nodejs_version: "4"
10+
- nodejs_version: "5"
11+
- nodejs_version: "6"
12+
13+
install:
14+
- ps: Install-Product node $env:nodejs_version
15+
- npm install
16+
17+
test_script:
18+
- node --version
19+
- npm --version
20+
- cmd: npm test
21+
22+
build: off
23+
24+
# build version format
25+
version: "{build}"

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ function add(file, callback) {
2424
}
2525

2626
var state = {
27-
path: '', //root path for the sources in the map
27+
path: '', // Root path for the sources in the map
2828
map: null,
2929
content: file.contents.toString(),
30-
preExistingComment: null
30+
// TODO: handle this?
31+
preExistingComment: null,
3132
};
3233

3334
helpers.addSourceMaps(file, state, callback);

lib/helpers.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,10 @@ function mapsLoaded(file, state, callback) {
135135
names: [],
136136
mappings: '',
137137
sources: [normalizePath(file.relative)],
138-
sourcesContent: [state.content]
138+
sourcesContent: [state.content],
139139
};
140140
}
141141

142-
// TODO: add this
143-
// else if (preExistingComment !== null && typeof preExistingComment !== 'undefined') {
144-
// sourceMap.preExistingComment = preExistingComment;
145-
// }
146-
147142
state.map.file = normalizePath(file.relative);
148143
file.sourceMap = state.map;
149144

@@ -196,16 +191,16 @@ function createSourceMapFile(opts) {
196191
},
197192
isSocket: function () {
198193
return false;
199-
}
200-
}
194+
},
195+
},
201196
});
202197
}
203198

204199
var needsMultiline = ['.css'];
205200

206201
function getCommentOptions(extname) {
207202
var opts = {
208-
multiline: (needsMultiline.indexOf(extname) !== -1)
203+
multiline: (needsMultiline.indexOf(extname) !== -1),
209204
};
210205

211206
return opts;

package.json

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,52 @@
11
{
22
"name": "vinyl-sourcemap",
33
"version": "0.3.0",
4-
"description": "Add sourcemaps to vinyl files, extracted from gulp-sourcemaps by Florian Reiterer (https://github.com/floridoo/gulp-sourcemaps)",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "mocha --async-only"
8-
},
9-
"keywords": [
10-
"vinyl",
11-
"sourcemap",
12-
"gulp"
4+
"description": "Add sourcemaps to Vinyl files.",
5+
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
6+
"contributors": [
7+
"Robin Venneman",
8+
"Blaine Bublitz <blaine.bublitz@gmail.com>"
139
],
14-
"author": "Robin Venneman",
10+
"repository": "gulpjs/vinyl-sourcemap",
1511
"license": "MIT",
16-
"repository": "github:gulpjs/vinyl-sourcemap",
17-
"devDependencies": {
18-
"eslint": "^3.4.0",
19-
"eslint-config-gulp": "github:robinvenneman/eslint-config-gulp",
20-
"expect": "^1.20.2",
21-
"mississippi": "^1.3.0",
22-
"mocha": "^3.2.0",
23-
"vinyl-fs": "^2.4.3"
12+
"engines": {
13+
"node": ">= 0.10"
14+
},
15+
"main": "index.js",
16+
"files": [
17+
"LICENSE",
18+
"index.js",
19+
"lib/"
20+
],
21+
"scripts": {
22+
"lint": "eslint index.js lib/ test/add.js test/write.js && jscs index.js test/add.js test/write.js",
23+
"pretest": "npm run lint",
24+
"test": "mocha --async-only",
25+
"cover": "istanbul cover _mocha --report lcovonly",
26+
"coveralls": "npm run cover && istanbul-coveralls"
2427
},
2528
"dependencies": {
2629
"async": "^2.1.4",
2730
"convert-source-map": "^1.5.0",
2831
"file-normalize": "^1.1.0",
2932
"graceful-fs": "^4.1.6",
3033
"object.defaults": "^1.0.0",
31-
"through2": "^2.0.1",
32-
"vinyl": "^1.2.0"
33-
}
34+
"vinyl": "^2.0.0"
35+
},
36+
"devDependencies": {
37+
"eslint": "^1.10.3",
38+
"eslint-config-gulp": "^2.0.0",
39+
"expect": "^1.20.2",
40+
"istanbul": "^0.4.3",
41+
"istanbul-coveralls": "^1.0.3",
42+
"jscs": "^2.4.0",
43+
"jscs-preset-gulp": "^1.0.0",
44+
"mississippi": "^1.3.0",
45+
"mocha": "^3.2.0"
46+
},
47+
"keywords": [
48+
"vinyl",
49+
"sourcemap",
50+
"gulp"
51+
]
3452
}

test/add.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function makeFile() {
1818
cwd: __dirname,
1919
base: path.join(__dirname, 'assets'),
2020
path: path.join(__dirname, 'assets', 'helloworld.js'),
21-
contents: new Buffer(sourceContent)
21+
contents: new Buffer(sourceContent),
2222
});
2323
}
2424

@@ -30,7 +30,7 @@ function makeSourcemap() {
3030
sourceRoot: path.join(__dirname, 'assets'),
3131
sources: ['test1.js', 'test2.js'],
3232
sourcesContent: ['console.log("line 1.1");\nconsole.log("line 1.2");\n', 'console.log("line 2.1");\nconsole.log("line 2.2");'],
33-
version: 3
33+
version: 3,
3434
};
3535
}
3636

@@ -40,7 +40,7 @@ function makeFileWithInlineSourceMap() {
4040
cwd: __dirname,
4141
base: path.join(__dirname, 'assets'),
4242
path: path.join(__dirname, 'assets', 'all.js'),
43-
contents: new Buffer('console.log("line 1.1"),console.log("line 1.2"),console.log("line 2.1"),console.log("line 2.2");\n' + inline)
43+
contents: new Buffer('console.log("line 1.1"),console.log("line 1.2"),console.log("line 2.1"),console.log("line 2.2");\n' + inline),
4444
});
4545
}
4646

@@ -233,7 +233,7 @@ describe('add', function() {
233233
});
234234
});
235235

236-
it('loads external sourcemap by filename if no source mapping comment', function (done) {
236+
it('loads external sourcemap by filename if no source mapping comment', function(done) {
237237
var file = makeFile();
238238
file.path = file.path.replace('helloworld.js', 'helloworld2.js');
239239
sourcemaps.add(file, function(err, data) {

test/write.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function makeSourceMap() {
1919
names: [],
2020
mappings: '',
2121
sources: ['helloworld.js'],
22-
sourcesContent: [sourceContent]
22+
sourcesContent: [sourceContent],
2323
};
2424
}
2525

@@ -39,7 +39,7 @@ function makeNestedFile() {
3939
cwd: __dirname,
4040
base: path.join(__dirname, 'assets'),
4141
path: path.join(__dirname, 'assets', 'dir1', 'dir2', 'helloworld.js'),
42-
contents: new Buffer(sourceContent)
42+
contents: new Buffer(sourceContent),
4343
});
4444
file.sourceMap = makeSourceMap();
4545
return file;

0 commit comments

Comments
 (0)