Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #155 from ipfs/aegir
Browse files Browse the repository at this point in the history
refactor: use aegir
  • Loading branch information
daviddias committed Apr 22, 2016
2 parents 0276d78 + 892e247 commit 5aacf1c
Show file tree
Hide file tree
Showing 97 changed files with 2,041 additions and 1,858 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ build
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

lib
dist
34 changes: 34 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
**/node_modules/
**/*.log
test/repo-tests*

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

test
20 changes: 13 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
sudo: false
language: node_js
node_js:
- "4"
- "5"
- 4
- 5

# Make sure we have new NPM.
before_install:
- npm i -g npm
# Workaround for a permissions issue with Travis virtual machine images

addons:
firefox: 'latest'
- npm install -g npm

script:
- npm run lint
- npm test
- npm run coverage

addons:
firefox: 'latest'

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

after_success:
- npm run coverage-publish
60 changes: 31 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
IPFS JavaScript Implementation
==============================

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![Build Status](https://travis-ci.org/ipfs/js-ipfs.svg?style=flat-square&branch=master)](https://travis-ci.org/ipfs/js-ipfs)
![](https://img.shields.io/badge/coverage-75%25-yellow.svg?style=flat-square)
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![](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)
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs?branch=master)
[![Travis CI](https://travis-ci.org/ipfs/js-ipfs.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs)
[![Circle CI](https://circleci.com/gh/ipfs/js-ipfs.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfs)
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)

> IPFS JavaScript implementation.
> IPFS JavaScript implementation.
# Description

Expand Down Expand Up @@ -37,7 +39,7 @@ $ npm i ipfs --save

## Use in Node.js

```JavaScript
```js
var IPFS = require('ipfs')

var node = new IPFS()
Expand All @@ -57,7 +59,7 @@ The cli is availble through `jsipfs` in your terminal

The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.

```JavaScript
```js
```

## Use in a browser using a script tag
Expand Down Expand Up @@ -100,40 +102,40 @@ IPFS Core is divided into separate subsystems, each of them exist in their own r
▶ ┌───────────────────────────────────────────────────────────────────────────────┐
│ IPFS Core │
│ └───────────────────────────────────────────────────────────────────────────────┘
│ │
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
│ │ │ │ │
│ │ │ │ │ │
▼ │ ▼ │ ▼
│ │
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
│ │ │ │ │
│ │ │ │ │ │
▼ │ ▼ │ ▼
│ ┌──────────────────┐ │ ┌──────────────────┐ │ ┌──────────────────┐
│ │ │ │ │ │ │ │
│ │ Block Service │ │ │ DAG Service │ │ │ IPFS Repo │
│ │ │ │ │ │ │ │
│ └──────────────────┘ │ └──────────────────┘ │ └──────────────────┘
│ │ │ │
IPFS Core │ ▼ │ ┌────┴────┐ │
┌────────┐ │ ▼ ▼ │
│ │ Block │ │ ┌────────┐┌────────┐ │
└────────┘ │ │DAG Node││DAG Link│ │
│ │ └────────┘└────────┘ │
│ │ │ │
IPFS Core │ ▼ │ ┌────┴────┐ │
┌────────┐ │ ▼ ▼ │
│ │ Block │ │ ┌────────┐┌────────┐ │
└────────┘ │ │DAG Node││DAG Link│ │
│ │ └────────┘└────────┘ │
┌──────────────────┐ │ │ ┌──────────────────┐
│ │ │ │ │ │ │
│ Bitswap │◀────┤ ├──────▶│ Importer │
│ │ │ │ │ │ │
└──────────────────┘ │ │ └──────────────────┘
│ │ │ │
│ │ ┌────┴────┐
│ │ │ ▼ ▼
│ │ │ │
│ │ ┌────┴────┐
│ │ │ ▼ ▼
│ │ ┌────────┐┌────────┐
│ ┌──────────────────┐ │ │ │ layout ││chunker │
│ │ │ ┌────────────┘ └────────┘└────────┘
│ │ Files │◀────┘ │
│ │ │
│ └──────────────────┘ │
▶ │
│ │ Files │◀────┘ │
│ │ │
│ └──────────────────┘ │
▶ │
┌───────────────────────────────────────────────────────────────────────────────┐
│ │
│ │
Expand Down
58 changes: 0 additions & 58 deletions karma.conf.js

This file was deleted.

64 changes: 31 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@
"bin": {
"jsipfs": "src/cli/bin.js"
},
"main": "src/core/index.js",
"main": "lib/core/index.js",
"jsnext:main": "src/core/index.js",
"scripts": {
"lint": "standard --verbose | snazzy",
"coverage": "istanbul cover --print both -- _mocha test/core-tests/index.js",
"coverage:http-api": "istanbul cover --print both -- _mocha test/http-api-tests/index.js",
"test": "npm run test:node && npm run test:browser",
"test:node": "npm run test:node:core && npm run test:node:http-api && npm run test:node:cli",
"test:node:teamcity": "npm run test:node:core:teamcity && npm run test:node:http-api:teamcity && npm run test:node:cli:teamcity",
"test:node:cli:teamcity": "mocha --reporter mocha-teamcity-reporter test/cli-tests/index.js",
"test:node:core:teamcity": "mocha --reporter mocha-teamcity-reporter test/core-tests/index.js",
"test:node:http-api:teamcity": "mocha --reporter mocha-teamcity-reporter test/http-api-tests/index.js",
"test:node:cli": "mocha test/cli-tests/index.js",
"test:node:core": "mocha test/core-tests/index.js",
"test:node:http-api": "mocha test/http-api-tests/index.js",
"test:browser": "karma start karma.conf.js",
"test:browser:teamcity": "karma start --reporters teamcity --colors false karma.conf.js",
"test:core": "mocha test/core-tests/index.js",
"test:cli": "mocha test/cli-tests/index.js"
"lint": "aegir-lint",
"coverage": "aegir-coverage",
"test": "aegir-test",
"test:node": "aegir-test node",
"test:browser": "aegir-test browser",
"build": "aegir-build",
"release": "aegir-release",
"release:minor": "aegir-release minor",
"release:major": "aegir-release major",
"coverage-publish": "aegir-coverage publish"
},
"pre-commit": [
"lint",
Expand All @@ -42,38 +37,26 @@
},
"homepage": "https://github.com/ipfs/js-ipfs#readme",
"devDependencies": {
"aegir": "^2.1.1",
"async": "^1.5.2",
"brfs": "^1.4.3",
"buffer-loader": "0.0.1",
"chai": "^3.4.1",
"chai": "^3.5.0",
"expose-loader": "^0.7.1",
"form-data": "^1.0.0-rc3",
"idb-plus-blob-store": "^1.0.0",
"istanbul": "^0.4.1",
"json-loader": "^0.5.4",
"karma": "^0.13.19",
"karma-chrome-launcher": "^0.2.2",
"karma-cli": "^0.1.2",
"karma-firefox-launcher": "^0.1.7",
"karma-mocha": "^0.2.1",
"karma-spec-reporter": "0.0.26",
"karma-teamcity-reporter": "^0.2.2",
"karma-webpack": "^1.7.0",
"local-storage-blob-store": "0.0.3",
"lodash": "^4.11.1",
"mocha": "^2.3.4",
"mocha-teamcity-reporter": "^1.0.0",
"ncp": "^2.0.0",
"nexpect": "^0.5.0",
"pre-commit": "^1.1.2",
"rimraf": "^2.4.4",
"snazzy": "^3.0.1",
"standard": "^6.0.7",
"stream-to-promise": "^1.1.0",
"transform-loader": "^0.2.3",
"webpack": "^2.0.7-beta"
"transform-loader": "^0.2.3"
},
"dependencies": {
"babel-runtime": "^6.6.1",
"bl": "^1.1.2",
"boom": "^3.1.1",
"bs58": "^3.0.0",
Expand All @@ -95,5 +78,20 @@
"peer-info": "^0.6.2",
"ronin": "^0.3.11",
"temp": "^0.8.3"
},
"aegir": {
"webpack": {
"resolve": {
"alias": {
"node-forge": "../../../node_modules/peer-id/vendor/forge.bundle.js"
}
},
"externals": {
"fs": "{}",
"ipfs-data-importing": "{ import: {} }",
"libp2p-ipfs": "{}",
"mkdirp": "{}"
}
}
}
}
2 changes: 2 additions & 0 deletions src/cli/commands/block/get.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command
const utils = require('../../utils')
const bs58 = require('bs58')
Expand Down
2 changes: 2 additions & 0 deletions src/cli/commands/block/put.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command
const utils = require('../../utils')
const bs58 = require('bs58')
Expand Down
2 changes: 2 additions & 0 deletions src/cli/commands/cat.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command

module.exports = Command.extend({
Expand Down
2 changes: 2 additions & 0 deletions src/cli/commands/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command
const debug = require('debug')
const get = require('lodash.get')
Expand Down
2 changes: 2 additions & 0 deletions src/cli/commands/config/replace.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command
const debug = require('debug')
const path = require('path')
Expand Down
2 changes: 2 additions & 0 deletions src/cli/commands/config/show.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command
const debug = require('debug')
const log = debug('cli:config')
Expand Down
5 changes: 4 additions & 1 deletion src/cli/commands/daemon.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
'use strict'

const Command = require('ronin').Command
const httpAPI = require('../../http-api')
const HttpAPI = require('../../http-api')
const debug = require('debug')
const log = debug('cli:daemon')
log.error = debug('cli:daemon:error')

let httpAPI

module.exports = Command.extend({
desc: 'Start a long-running daemon process',

run: (name) => {
console.log('Initializing daemon...')
httpAPI = new HttpAPI()
httpAPI.start((err) => {
if (err) {
return log.error(err)
Expand Down
2 changes: 2 additions & 0 deletions src/cli/commands/dns.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const Command = require('ronin').Command

module.exports = Command.extend({
Expand Down
Loading

0 comments on commit 5aacf1c

Please sign in to comment.