Skip to content

Commit 030318a

Browse files
author
Gareth Jones
committed
chore(setup): project setup files
0 parents  commit 030318a

File tree

6 files changed

+150
-0
lines changed

6 files changed

+150
-0
lines changed

.eslintrc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": "eslint:recommended",
8+
"rules": {
9+
"indent": [
10+
"error",
11+
2
12+
],
13+
"linebreak-style": [
14+
"error",
15+
"unix"
16+
],
17+
"quotes": [
18+
"error",
19+
"single"
20+
],
21+
"semi": [
22+
"error",
23+
"always"
24+
]
25+
}
26+
}

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Logs
2+
logs
3+
*.log*
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
build
12+
node_modules
13+
.bob/
14+
test/streams/test-*
15+
.idea
16+
.vscode
17+
.DS_Store
18+
19+
yarn.lock
20+
coverage/
21+
.nyc_output/
22+
_site
23+
Gemfile.lock

.npmignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Created by .ignore support plugin
2+
**/.*
3+
node_modules
4+
bower_components
5+
test
6+
tests
7+
support
8+
benchmarks
9+
examples
10+
sample
11+
lib-cov
12+
coverage.html
13+
Makefile
14+
coverage

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
sudo: false
3+
node_js:
4+
- "7"
5+
- "6"
6+
- "5"
7+
- "4"
8+
after_success:
9+
- npm run codecov

package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "log4js-api",
3+
"version": "1.0.0",
4+
"description": "For libraries that want to include log4js for logging, but don't want to introduce version conflicts for users that also use log4js. Delegates to whatever log4js version can be found, but does not introduce a specific log4js version.",
5+
"main": "lib/index.js",
6+
"scripts": {
7+
"lint": "eslint lib/ test/",
8+
"prepush": "npm test",
9+
"commitmsg": "validate-commit-msg",
10+
"pretest": "eslint lib/**/* test/**/*",
11+
"test": "tap 'test/**/*.js'",
12+
"coverage": "tap 'test/**/*.js' --cov",
13+
"codecov": "tap 'test/**/*.js' --cov --coverage-report=lcov && codecov"
14+
},
15+
"keywords": [
16+
"log4js",
17+
"logging",
18+
"logger",
19+
"api",
20+
"compatibility"
21+
],
22+
"author": "Gareth Jones <gareth.nomiddlename@gmail.com>",
23+
"license": "Apache-2.0",
24+
"devDependencies": {
25+
"codecov": "^2.2.0",
26+
"eslint": "^4.0.0",
27+
"husky": "^0.14.0",
28+
"nyc": "^11.0.2",
29+
"sandboxed-module": "^2.0.3",
30+
"tap": "^10.5.2",
31+
"validate-commit-msg": "^2.12.2"
32+
},
33+
"config": {
34+
"validate-commit-msg": {
35+
"types": [
36+
"feat",
37+
"fix",
38+
"docs",
39+
"style",
40+
"refactor",
41+
"example",
42+
"perf",
43+
"test",
44+
"chore",
45+
"revert"
46+
],
47+
"warnOnFail": false,
48+
"maxSubjectLength": 72,
49+
"subjectPattern": ".+",
50+
"subjectPatternErrorMsg": "subject does not match subject pattern!",
51+
"helpMessage": "\n# allowed type: feat, fix, docs, style, refactor, example, perf, test, chore, revert\n# subject no more than 50 chars\n# a body line no more than 72 chars"
52+
}
53+
},
54+
"nyc": {
55+
"all": true,
56+
"include": [
57+
"lib/**/*.js"
58+
],
59+
"require": [
60+
"./sandbox-coverage"
61+
]
62+
}
63+
}

sandbox-coverage.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
const sandbox = require('sandboxed-module');
4+
5+
sandbox.configure({
6+
sourceTransformers: {
7+
nyc: function (source) {
8+
if (this.filename.indexOf('node_modules') > -1) {
9+
return source;
10+
}
11+
const nyc = new (require('nyc'))();
12+
return nyc.instrumenter().instrumentSync(source, this.filename);
13+
}
14+
}
15+
});

0 commit comments

Comments
 (0)