Skip to content

Commit e1b9c89

Browse files
committed
feat: clone
1 parent 8047029 commit e1b9c89

File tree

11,565 files changed

+290
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,565 files changed

+290
-345
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
tests/t-run*
1+
test/t-run*
2+
23
# Logs
34
logs
45
*.log

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ npm on IPFS
1010
[![Dependency Status](https://david-dm.org/diasdavid/registry-mirror.svg?style=flat-square)](https://david-dm.org/diasdavid/registry-mirror)
1111
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
1212
![](https://img.shields.io/badge/coverage-76%25-yellow.svg?style=flat-square)
13-
<!-- While 0.4.0 doesn't get released [![Build Status](https://img.shields.io/travis/diasdavid/registry-mirror/master.svg?style=flat-square)](https://travis-ci.org/diasdavid/registry-mirror) -->
13+
[![Build Status](https://img.shields.io/travis/diasdavid/registry-mirror/master.svg?style=flat-square)](https://travis-ci.org/diasdavid/registry-mirror)
1414

1515
> **Install your modules through IPFS!!** This CLI utility enables you to clone the npm registry into IPFS and/or mirror the registry from IPFS.
1616

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"ipnpm": "src/cli/bin.js"
99
},
1010
"scripts": {
11-
"test": "mocha tests/test-*/index.js",
12-
"coverage": "istanbul cover --print both -- _mocha tests/test-*/index.js",
11+
"test": "mocha test/index.js",
12+
"coverage": "istanbul cover --print both -- _mocha test/index.js",
1313
"lint": "standard"
1414
},
1515
"pre-commit": [
@@ -36,7 +36,7 @@
3636
"express": "^4.12.3",
3737
"follow-registry": "^2.0.0",
3838
"http-https": "^1.0.0",
39-
"ipfs-blob-store": "^1.1.0",
39+
"ipfs-blob-store": "^1.1.1",
4040
"lru-cache": "^4.0.1",
4141
"patch-package-json": "0.0.4",
4242
"ronin": "^0.3.11",

src/ipfs-npm/config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const ipfsAPI = require('ipfs-api')
21
const debug = require('debug')
32
const path = require('path')
43
const os = require('os')
@@ -9,7 +8,6 @@ const tmp = os.tmpdir()
98

109
module.exports = {
1110
log: log,
12-
apiCtl: ipfsAPI('/ip4/127.0.0.1/tcp/5001'),
1311
nodes: {
1412
biham: '/ip4/188.40.114.11/tcp/8801/ipfs/QmToeN85brexqyXUnWnKfHFqhvucJPViw9AxQQkjLoULy4'
1513
},
@@ -18,7 +16,7 @@ module.exports = {
1816
port: '9876',
1917
host: '127.0.0.1'
2018
},
21-
limit: 10,
19+
writeLimit: 100,
2220
registry: 'http://registry.npmjs.org/',
2321
tmp: tmp,
2422
error: path.join(__dirname, '../defaults', '404.json'),

src/ipfs-npm/ipfs-client.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const ipfsAPI = require('ipfs-api')
2+
3+
module.exports = ipfs
4+
5+
function ipfs (options) {
6+
if (!options || !options.url) {
7+
options = {
8+
url: '/ip4/127.0.0.1/tcp/5001'
9+
}
10+
}
11+
12+
// TODO
13+
// 1. check if there is a node running (through IPFS_PATH)
14+
// if not, spawn one
15+
16+
return ipfsAPI(options.url)
17+
}

src/ipfs-npm/registry-clone/clone.js

-146
This file was deleted.

src/ipfs-npm/registry-clone/files.js

-84
This file was deleted.

src/ipfs-npm/registry-clone/hooks.js

-15
This file was deleted.

src/ipfs-npm/registry-clone/ibs.js

-4
This file was deleted.

0 commit comments

Comments
 (0)