Skip to content

Commit 86790d1

Browse files
committed
passing unit tests, integration tests still needed
1 parent c4ba4c6 commit 86790d1

16 files changed

+553
-1
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015"],
3+
"sourceMaps": "inline"
4+
}

.editorconfig

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jspm_packages
3535

3636
# Optional REPL history
3737
.node_repl_history
38+
39+
# Build artifacts
40+
lib

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src
2+
test
3+
coverage

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
PATH := node_modules/.bin:$(PATH)
2+
SHELL := /bin/bash
3+
4+
.FORCE:
5+
6+
all: .FORCE
7+
babel src -d lib
8+
9+
test: .FORCE
10+
mocha test/unit
11+
12+
integration: .FORCE
13+
docker-compose up -d
14+
mocha test/integration
15+
docker-compose down
16+
17+
lint: .FORCE
18+
eslint src
19+
eslint test
20+
21+
publish:
22+
echo -e "${NPM_USERNAME}\n${NPM_PASSWORD}\n${NPM_EMAIL}" | npm login
23+
npm publish
24+
npm logout

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# microlock
2-
Simple distributed locking with etcd
2+
Simple distributed locking with Etcd for Node.js

circle.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
machine:
2+
node:
3+
version: 4.4.2
4+
services:
5+
- docker
6+
test:
7+
override:
8+
- make lint
9+
- make test
10+
- make build
11+
- make integration
12+
deployment:
13+
npm:
14+
branch: master
15+
commands:
16+
- make publish

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
etcd:
2+
image: quay.io/coreos/etcd
3+
ports:
4+
- "2379:2379"
5+
command: -advertise-client-urls=http://0.0.0.0:2379 -listen-client-urls=http://0.0.0.0:2379

package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "microlock",
3+
"version": "1.0.0",
4+
"description": "Simple distributed locking with Etcd for Node.js",
5+
"main": "lib/microlock.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/thebigredgeek/microlock.git"
9+
},
10+
"keywords": [
11+
"distributed",
12+
"lock",
13+
"etcd",
14+
"lock"
15+
],
16+
"author": "Andrew E. Rhyne",
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/thebigredgeek/microlock/issues"
20+
},
21+
"homepage": "https://github.com/thebigredgeek/microlock#readme",
22+
"dependencies": {
23+
"bluebird": "^3.4.1"
24+
},
25+
"devDependencies": {
26+
"babel-cli": "^6.7.7",
27+
"babel-eslint": "^6.0.3",
28+
"babel-polyfill": "^6.7.4",
29+
"babel-preset-es2015": "^6.6.0",
30+
"babel-register": "^6.7.2",
31+
"babel-runtime": "^6.6.1",
32+
"chai": "^3.5.0",
33+
"core-js": "^2.2.2",
34+
"eslint": "^2.8.0",
35+
"eslint-plugin-babel": "^3.2.0",
36+
"mocha": "^2.4.5",
37+
"sinon": "^1.17.3",
38+
"source-map-support": "^0.4.2"
39+
}
40+
}

src/.eslintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"ecmaFeatures": {
3+
"modules": true
4+
},
5+
"env": {
6+
"node": true
7+
},
8+
"parser": "babel-eslint",
9+
"rules": {
10+
"quotes": [2, "single"],
11+
"strict": [2, "never"],
12+
"no-undef": 2,
13+
"babel/object-shorthand": 0,
14+
"babel/arrow-parens": 0
15+
},
16+
"plugins": [
17+
"babel"
18+
]
19+
}

0 commit comments

Comments
 (0)