Skip to content

Commit 50e1137

Browse files
authored
Merge pull request #20 from acolchado/node6-es6
Switching to non-transpiled es6/node6 code
2 parents aaa7754 + 7f3f9da commit 50e1137

File tree

11 files changed

+64
-47
lines changed

11 files changed

+64
-47
lines changed

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
{
2-
"extends": "opentable",
32
"env": {
3+
"es6": true,
44
"node": true
5+
},
6+
"plugins": ["node"],
7+
"parserOptions": {
8+
"ecmaVersion": 6
9+
},
10+
"rules": {
11+
"node/no-unsupported-features": [2, {
12+
"version": 6
13+
}
14+
],
15+
"arrow-parens": ["error", "always"],
16+
"no-shadow": 0,
17+
"radix": 0,
18+
"keyword-spacing": 0,
19+
"consistent-return": 0,
20+
"arrow-body-style": 0,
21+
"no-use-before-define": 0,
22+
"quotes": [
23+
"error",
24+
"single",
25+
{
26+
"avoidEscape": true
27+
}
28+
],
29+
"semi": ["error", "always"],
30+
"one-var": [
31+
"error",
32+
{
33+
"uninitialized": "always"
34+
}
35+
]
536
}
637
}

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: node_js
22
node_js:
3-
- '4'
43
- '6'
5-
script: npm run build-and-test
4+
- '8'
5+
script: npm run test

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@ To run the test suite, first install the dependancies, then run `npm test`
147147

148148
```bash
149149
$ npm install
150-
$ npm run build
151150
$ npm test
152151
```
153152

154-
> Requires Node 4+ for dev tools, but we recommend using Node 6.
155-
156153
# License
157154

158155
[MIT](LICENSE)

package.json

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "spur-errors",
33
"description": "Common error builder utility for Node.js. Contains common error types, and stack trace tracking to support more detailed error messages.",
44
"version": "0.2.6",
5-
"main": "lib/SpurErrors.js",
6-
"jsnext:main": "./src/SpurErrors",
5+
"main": "./src/SpurErrors",
76
"author": {
87
"name": "Agustin Colchado",
98
"email": "agustin@colchado.com"
@@ -19,15 +18,9 @@
1918
],
2019
"license": "MIT",
2120
"scripts": {
22-
"clean": "rm -rf lib/",
23-
"build": "npm run clean && babel src -d lib --source-maps",
24-
"dev": "npm run clean && babel --watch src -d lib",
25-
"lint": "eslint .",
21+
"lint": "eslint ./{src,test}/**/*.js index.js",
2622
"pretest": "npm run lint",
27-
"test-unit": "babel-node --debug node_modules/mocha/bin/_mocha ./test/unit/",
28-
"test-integration": "babel-node --debug node_modules/mocha/bin/_mocha ./test/integration/",
29-
"test": "npm run test-unit && npm run test-integration",
30-
"build-and-test": "npm run build && npm test"
23+
"test": "mocha test/"
3124
},
3225
"bugs": {
3326
"url": "https://github.com/opentable/spur-errors/issues"
@@ -39,17 +32,13 @@
3932
},
4033
"dependencies": {},
4134
"devDependencies": {
42-
"babel-cli": "^6.18.0",
43-
"babel-plugin-add-module-exports": "^0.2.1",
44-
"babel-plugin-transform-object-assign": "^6.8.0",
45-
"babel-plugin-transform-regenerator": "6.16.1",
46-
"babel-preset-es2015": "^6.18.0",
47-
"babel-preset-es2015-loose": "^8.0.0",
48-
"chai": "^3.5.0",
49-
"eslint": "^3.13.1",
50-
"eslint-config-opentable": "^6.0.0",
51-
"eslint-plugin-import": "^2.2.0",
52-
"mocha": "^3.2.0",
53-
"sinon": "^1.17.3"
35+
"chai": "^4.1.1",
36+
"eslint": "^4.5.0",
37+
"eslint-plugin-node": "^5.1.1",
38+
"mocha": "^3.5.0",
39+
"sinon": "^3.2.1"
40+
},
41+
"engines": {
42+
"node": ">=6.0.0"
5443
}
5544
}

src/BaseError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ const BaseError = {
5151
}
5252
};
5353

54-
export default BaseError;
54+
module.exports = BaseError;

src/SpurErrors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import BaseError from './BaseError';
1+
const BaseError = require('./BaseError');
22

33
const SpurErrors = {
44
BaseError,
@@ -27,4 +27,4 @@ const SpurErrors = {
2727
}
2828
};
2929

30-
export default SpurErrors;
30+
module.exports = SpurErrors;

test/fixtures/Callee.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import SpurErrors from '../../src/SpurErrors';
1+
const SpurErrors = require('../../src/SpurErrors');
22

33
module.exports = {
4+
45
run() {
56
return SpurErrors.NotFoundError.create();
67
}

test/integration/DependenciesSpec.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/unit/ModuleSpec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const SpurErrorsModule = require('../../');
2+
const SpurErrorsSource = require('../../src/SpurErrors');
3+
4+
describe('Module Integration', () => {
5+
it('the module should be referenced from the root using what\'s defined in the package', () => {
6+
expect(SpurErrorsModule).to.exist;
7+
});
8+
9+
it('the module should be the same as the expected source', () => {
10+
expect(SpurErrorsModule).to.equal(SpurErrorsSource);
11+
});
12+
});

0 commit comments

Comments
 (0)