Skip to content

Commit 36587b7

Browse files
refactor: use aegir
1 parent 857d31d commit 36587b7

File tree

11 files changed

+126
-38
lines changed

11 files changed

+126
-38
lines changed

.gitignore

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
node_modules
1+
**/node_modules/
2+
**/*.log
3+
test/repo-tests*
4+
5+
# Logs
6+
logs
27
*.log
8+
9+
coverage
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23+
.grunt
24+
25+
# node-waf configuration
26+
.lock-wscript
27+
28+
build
29+
30+
# Dependency directory
31+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
32+
node_modules
33+
34+
lib
35+
dist

.npmignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
**/node_modules/
2+
**/*.log
3+
test/repo-tests*
4+
5+
# Logs
6+
logs
7+
*.log
8+
9+
coverage
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23+
.grunt
24+
25+
# node-waf configuration
26+
.lock-wscript
27+
28+
build
29+
30+
# Dependency directory
31+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
32+
node_modules

.travis.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1+
sudo: false
12
language: node_js
23
node_js:
3-
- "4"
4-
- "5"
4+
- 4
5+
- 5
6+
- stable
7+
8+
# Make sure we have new NPM.
9+
before_install:
10+
- npm install -g npm
11+
12+
script:
13+
- npm run lint
14+
- npm test
15+
- npm run coverage
16+
17+
before_script:
18+
- export DISPLAY=:99.0
19+
- sh -e /etc/init.d/xvfb start
20+
21+
after_success:
22+
- npm run coverage-publish
23+
24+
addons:
25+
firefox: 'latest'

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
ipfsd-ctl
22
=========
33

4-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
5-
[![Dependency Status](https://david-dm.org/ipfs/js-ipfsd-ctl.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfsd-ctl)
4+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
5+
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
6+
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
7+
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfsd-ctl/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfsd-ctl?branch=master)
68
[![Travis CI](https://travis-ci.org/ipfs/js-ipfsd-ctl.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfsd-ctl)
79
[![Circle CI](https://circleci.com/gh/ipfs/js-ipfsd-ctl.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfsd-ctl)
8-
10+
[![Dependency Status](https://david-dm.org/ipfs/js-ipfsd-ctl.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfsd-ctl) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
911

1012
> Control an ipfs node daemon using Node.js
1113

examples/id.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
var ipfsd = require('../index.js')
24

35
ipfsd.disposableApi(function (err, ipfs) {

examples/local.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
var ipfsd = require('../index.js')
24

35
// opens an api connection to local running ipfs node

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
"name": "ipfsd-ctl",
33
"version": "0.13.0",
44
"description": "simple controls for an ipfs node",
5-
"main": "index.js",
5+
"main": "lib/index.js",
6+
"jsxnext:main": "src/index.js",
67
"scripts": {
7-
"test": "node_modules/.bin/mocha test",
8-
"lint": "standard"
8+
"lint": "aegir-lint",
9+
"coverage": "aegir-coverage",
10+
"test": "aegir-test --env node",
11+
"build": "aegir-build --env node",
12+
"release": "aegir-release --env node",
13+
"release:minor": "aegir-release --type minor --env node",
14+
"release:major": "aegir-release --type major --env node",
15+
"coverage-publish": "aegir-coverage publish"
916
},
1017
"engines": {
1118
"node": ">=4.2.2"
@@ -35,11 +42,9 @@
3542
"async": "^1.5.0"
3643
},
3744
"devDependencies": {
38-
"estraverse": "^4.1.1",
45+
"aegir": "^3.0.4",
3946
"mkdirp": "^0.5.1",
40-
"mocha": "^2.3.4",
41-
"pre-commit": "^1.1.2",
42-
"standard": "^6.0.8"
47+
"pre-commit": "^1.1.2"
4348
},
4449
"repository": {
4550
"type": "git",

index.js renamed to src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
const os = require('os')
44
const join = require('path').join
55

6-
const Node = require('./lib/node')
6+
const Node = require('./node')
77

88
function tempDir () {
9-
return join(os.tmpdir(), `ipfs_${(Math.random() + '').substr(2)}`)
9+
return join(os.tmpdir(), `ipfs_${String(Math.random()).substr(2)}`)
1010
}
1111

1212
module.exports = {

lib/node.js renamed to src/node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@ module.exports = class Node {
126126

127127
this.subprocess = run(this.exec, ['daemon'], {env: this.env})
128128
.on('error', (err) => {
129-
if ((err + '').match('daemon is running')) {
129+
if (String(err).match('daemon is running')) {
130130
// we're good
131131
done(null, ipfs(conf.Addresses.API))
132-
} else if ((err + '').match('non-zero exit code')) {
132+
} else if (String(err).match('non-zero exit code')) {
133133
// ignore when kill -9'd
134134
} else {
135135
done(err)
136136
}
137137
})
138138
.on('data', (data) => {
139-
const match = (data + '').trim().match(/API server listening on (.*)/)
139+
const match = String(data).trim().match(/API server listening on (.*)/)
140140
if (match) {
141141
this.apiAddr = match[1]
142142
const addr = multiaddr(this.apiAddr).nodeAddress()

test/.eslintrc

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

0 commit comments

Comments
 (0)