Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
refactor: move to root
Browse files Browse the repository at this point in the history
In response to #423

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
alanshaw committed Feb 5, 2019
1 parent 45da688 commit 82e1b30
Show file tree
Hide file tree
Showing 181 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
module.exports = {
lint: {
files: [
'js/src/**/*.js',
'js/test/**/*.js'
'src/**/*.js',
'test/**/*.js'
]
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const createCommon = () => ({
tests.block(createCommon)
tests.config(createCommon)
tests.dag(createCommon)
// ...etc. (see js/src/index.js)
// ...etc. (see src/index.js)
```

#### Running tests by command
Expand Down
2 changes: 1 addition & 1 deletion SPEC/BLOCK.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ A great source of [examples][] can be found in the tests for this API.

[block]:https://github.com/ipfs/js-ipfs-block
[multihash]:https://github.com/multiformats/multihash
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/block
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/block
[cid]: https://www.npmjs.com/package/cids
2 changes: 1 addition & 1 deletion SPEC/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ ipfs.config.replace(newConfig, (err) => {
A great source of [examples][] can be found in the tests for this API.

[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/config
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/config
2 changes: 1 addition & 1 deletion SPEC/DAG.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ ipfs.dag.tree('zdpuAmtur968yprkhG9N5Zxn6MFVoqAWBbhUAkNLJs2UtkTq5', errOrLog)
A great source of [examples][] can be found in the tests for this API.


[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/dag
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/dag
2 changes: 1 addition & 1 deletion SPEC/DHT.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ ipfs.dht.query(id, function (err, peerInfos) {

A great source of [examples][] can be found in the tests for this API.

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/dht
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/dht
2 changes: 1 addition & 1 deletion SPEC/FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ pull(

A great source of [examples][] can be found in the tests for this API.

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/files-regular
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/files-regular
[b]: https://www.npmjs.com/package/buffer
[rs]: https://www.npmjs.com/package/readable-stream
[ps]: https://www.npmjs.com/package/pull-stream
Expand Down
18 changes: 9 additions & 9 deletions SPEC/MISCELLANEOUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ipfs.id(function (err, identity) {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/miscellaneous/id.js) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/src/miscellaneous/id.js) can be found in the tests for this API.

#### `version`

Expand All @@ -57,7 +57,7 @@ ipfs.version((err, version) => {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/miscellaneous/version.js) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/src/miscellaneous/version.js) can be found in the tests for this API.

#### `dns`

Expand All @@ -82,7 +82,7 @@ ipfs.dns('ipfs.io', (err, path) => {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/miscellaneous/dns.js) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/src/miscellaneous/dns.js) can be found in the tests for this API.

#### `stop`

Expand All @@ -105,7 +105,7 @@ ipfs.stop((err) => {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/miscellaneous/stop.js) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/src/miscellaneous/stop.js) can be found in the tests for this API.

#### `ping`

Expand Down Expand Up @@ -152,7 +152,7 @@ ipfs.ping('Qmhash', function (err, responses) {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/tree/master/js/src/ping) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/tree/master/src/ping) can be found in the tests for this API.

#### `pingPullStream`

Expand Down Expand Up @@ -197,7 +197,7 @@ pull(
)
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/tree/master/js/src/ping) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/tree/master/src/ping) can be found in the tests for this API.

#### `pingReadableStream`

Expand Down Expand Up @@ -239,7 +239,7 @@ stream.on('data', (res) => {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/tree/master/js/src/ping) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/tree/master/src/ping) can be found in the tests for this API.

#### `resolve`

Expand Down Expand Up @@ -310,8 +310,8 @@ ipfs.resolve(name, (err, res) => {
})
```

A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/miscellaneous/resolve.js) can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-ipfs-core/blob/master/src/miscellaneous/resolve.js) can be found in the tests for this API.

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/miscellaneous
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/miscellaneous
[rs]: https://www.npmjs.com/package/readable-stream
[ps]: https://www.npmjs.com/package/pull-stream
2 changes: 1 addition & 1 deletion SPEC/OBJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,4 @@ A great source of [examples][] can be found in the tests for this API.
[DAGNode]: https://github.com/ipld/js-ipld-dag-pb
[multihash]: http://github.com/multiformats/multihash
[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/object
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/object
2 changes: 1 addition & 1 deletion SPEC/PIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ ipfs.pin.rm(hash, function (err, pinset) {

A great source of [examples][] can be found in the tests for this API.

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/pin
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/pin
2 changes: 1 addition & 1 deletion SPEC/PUBSUB.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ ipfs.pubsub.peers(topic, (err, peerIds) => {

A great source of [examples][] can be found in the tests for this API.

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/pubsub
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/pubsub
2 changes: 1 addition & 1 deletion SPEC/SWARM.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ Example:
ipfs.swarm.filters.rm(filter, function (err) {})
```

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/js/src/swarm
[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/swarm
29 changes: 0 additions & 29 deletions js/src/files-regular/utils.js

This file was deleted.

Empty file removed js/test/.gitkeep
Empty file.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.96.1",
"description": "A test suite and interface you can use to implement a IPFS core interface.",
"leadMaintainer": "Alan Shaw <alan@tableflip.io>",
"main": "js/src/index.js",
"main": "src/index.js",
"browser": {
"fs": false
},
Expand All @@ -20,8 +20,8 @@
"coverage-publish": "exit 0"
},
"files": [
"js/src/",
"js/test/"
"src/",
"test/"
],
"repository": {
"type": "git",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = (createCommon, options) => {
after((done) => common.teardown(done))

it('should add from a stream', (done) => {
const testData = loadFixture('js/test/fixtures/15mb.random', 'interface-ipfs-core')
const testData = loadFixture('test/fixtures/15mb.random', 'interface-ipfs-core')

ipfs.addFromStream(into(testData), (err, result) => {
expect(err).to.not.exist()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions src/files-regular/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict'

const loadFixture = require('aegir/fixtures')

exports.fixtures = Object.freeze({
directory: Object.freeze({
cid: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP',
files: Object.freeze({
'pp.txt': loadFixture('test/fixtures/test-folder/pp.txt', 'interface-ipfs-core'),
'holmes.txt': loadFixture('test/fixtures/test-folder/holmes.txt', 'interface-ipfs-core'),
'jungle.txt': loadFixture('test/fixtures/test-folder/jungle.txt', 'interface-ipfs-core'),
'alice.txt': loadFixture('test/fixtures/test-folder/alice.txt', 'interface-ipfs-core'),
'files/hello.txt': loadFixture('test/fixtures/test-folder/files/hello.txt', 'interface-ipfs-core'),
'files/ipfs.txt': loadFixture('test/fixtures/test-folder/files/ipfs.txt', 'interface-ipfs-core')
})
}),
smallFile: Object.freeze({
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',
data: loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core')
}),
bigFile: Object.freeze({
cid: 'Qme79tX2bViL26vNjPsF3DP1R9rMKMvnPYJiKTTKPrXJjq',
data: loadFixture('test/fixtures/15mb.random', 'interface-ipfs-core')
}),
sslOpts: Object.freeze({
key: loadFixture('test/fixtures/ssl/privkey.pem', 'interface-ipfs-core'),
cert: loadFixture('test/fixtures/ssl/cert.pem', 'interface-ipfs-core')
})
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = (createCommon, options) => {
})

it('should resolve an IPFS hash', (done) => {
const content = loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core')
const content = loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core')

ipfs.add(content, (err, res) => {
expect(err).to.not.exist()
Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = (createCommon, options) => {
// Test resolve turns /ipfs/QmRootHash/path/to/file into /ipfs/QmFileHash
it('should resolve an IPFS path link', (done) => {
const path = '/path/to/testfile.txt'
const content = loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core')
const content = loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core')

ipfs.add([{ path, content }], { wrapWithDirectory: true }, (err, res) => {
expect(err).to.not.exist()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion js/src/name/utils.js → src/name/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
const loadFixture = require('aegir/fixtures')

exports.fixture = Object.freeze({
data: loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core'),
data: loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core'),
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions js/src/pin/utils.js → src/pin/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const loadFixture = require('aegir/fixtures')

exports.fixtures = Object.freeze({
files: Object.freeze([Object.freeze({
data: loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core'),
data: loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core'),
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
}), Object.freeze({
data: loadFixture('js/test/fixtures/test-folder/files/hello.txt', 'interface-ipfs-core'),
data: loadFixture('test/fixtures/test-folder/files/hello.txt', 'interface-ipfs-core'),
cid: 'QmY9cxiHqTFoWamkQVkpmmqzBrY3hCBEL2XNu3NtX74Fuu'
})])
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 82e1b30

Please sign in to comment.