diff --git a/.aegir.js b/.aegir.js index bd405fb6..406b48ef 100644 --- a/.aegir.js +++ b/.aegir.js @@ -3,8 +3,8 @@ module.exports = { lint: { files: [ - 'js/src/**/*.js', - 'js/test/**/*.js' + 'src/**/*.js', + 'test/**/*.js' ] } } diff --git a/README.md b/README.md index 69c61fd5..fc1553fb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/SPEC/BLOCK.md b/SPEC/BLOCK.md index 82caa10f..67cb59ea 100644 --- a/SPEC/BLOCK.md +++ b/SPEC/BLOCK.md @@ -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 diff --git a/SPEC/CONFIG.md b/SPEC/CONFIG.md index 38490ff1..0425ae07 100644 --- a/SPEC/CONFIG.md +++ b/SPEC/CONFIG.md @@ -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 diff --git a/SPEC/DAG.md b/SPEC/DAG.md index 0160013a..07f8787e 100644 --- a/SPEC/DAG.md +++ b/SPEC/DAG.md @@ -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 diff --git a/SPEC/DHT.md b/SPEC/DHT.md index b039e88a..3cf1bff4 100644 --- a/SPEC/DHT.md +++ b/SPEC/DHT.md @@ -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 diff --git a/SPEC/FILES.md b/SPEC/FILES.md index e44d8d65..257584d8 100644 --- a/SPEC/FILES.md +++ b/SPEC/FILES.md @@ -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 diff --git a/SPEC/MISCELLANEOUS.md b/SPEC/MISCELLANEOUS.md index ec2e9a27..5cb9b5cb 100644 --- a/SPEC/MISCELLANEOUS.md +++ b/SPEC/MISCELLANEOUS.md @@ -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` @@ -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` @@ -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` @@ -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` @@ -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` @@ -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` @@ -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` @@ -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 diff --git a/SPEC/OBJECT.md b/SPEC/OBJECT.md index da4f666a..2e598be4 100644 --- a/SPEC/OBJECT.md +++ b/SPEC/OBJECT.md @@ -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 diff --git a/SPEC/PIN.md b/SPEC/PIN.md index d44b27c8..51075e70 100644 --- a/SPEC/PIN.md +++ b/SPEC/PIN.md @@ -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 diff --git a/SPEC/PUBSUB.md b/SPEC/PUBSUB.md index db830aaf..ea443fb2 100644 --- a/SPEC/PUBSUB.md +++ b/SPEC/PUBSUB.md @@ -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 diff --git a/SPEC/SWARM.md b/SPEC/SWARM.md index 57d07e9d..37578c6e 100644 --- a/SPEC/SWARM.md +++ b/SPEC/SWARM.md @@ -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 diff --git a/js/src/files-regular/utils.js b/js/src/files-regular/utils.js deleted file mode 100644 index e43a786d..00000000 --- a/js/src/files-regular/utils.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -const loadFixture = require('aegir/fixtures') - -exports.fixtures = Object.freeze({ - directory: Object.freeze({ - cid: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP', - files: Object.freeze({ - 'pp.txt': loadFixture('js/test/fixtures/test-folder/pp.txt', 'interface-ipfs-core'), - 'holmes.txt': loadFixture('js/test/fixtures/test-folder/holmes.txt', 'interface-ipfs-core'), - 'jungle.txt': loadFixture('js/test/fixtures/test-folder/jungle.txt', 'interface-ipfs-core'), - 'alice.txt': loadFixture('js/test/fixtures/test-folder/alice.txt', 'interface-ipfs-core'), - 'files/hello.txt': loadFixture('js/test/fixtures/test-folder/files/hello.txt', 'interface-ipfs-core'), - 'files/ipfs.txt': loadFixture('js/test/fixtures/test-folder/files/ipfs.txt', 'interface-ipfs-core') - }) - }), - smallFile: Object.freeze({ - cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP', - data: loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core') - }), - bigFile: Object.freeze({ - cid: 'Qme79tX2bViL26vNjPsF3DP1R9rMKMvnPYJiKTTKPrXJjq', - data: loadFixture('js/test/fixtures/15mb.random', 'interface-ipfs-core') - }), - sslOpts: Object.freeze({ - key: loadFixture('js/test/fixtures/ssl/privkey.pem', 'interface-ipfs-core'), - cert: loadFixture('js/test/fixtures/ssl/cert.pem', 'interface-ipfs-core') - }) -}) diff --git a/js/test/.gitkeep b/js/test/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index 07b2a5cb..22643cbc 100644 --- a/package.json +++ b/package.json @@ -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 ", - "main": "js/src/index.js", + "main": "src/index.js", "browser": { "fs": false }, @@ -20,8 +20,8 @@ "coverage-publish": "exit 0" }, "files": [ - "js/src/", - "js/test/" + "src/", + "test/" ], "repository": { "type": "git", diff --git a/js/src/bitswap/.tern-port b/src/bitswap/.tern-port similarity index 100% rename from js/src/bitswap/.tern-port rename to src/bitswap/.tern-port diff --git a/js/src/bitswap/index.js b/src/bitswap/index.js similarity index 100% rename from js/src/bitswap/index.js rename to src/bitswap/index.js diff --git a/js/src/bitswap/stat.js b/src/bitswap/stat.js similarity index 100% rename from js/src/bitswap/stat.js rename to src/bitswap/stat.js diff --git a/js/src/bitswap/utils.js b/src/bitswap/utils.js similarity index 100% rename from js/src/bitswap/utils.js rename to src/bitswap/utils.js diff --git a/js/src/bitswap/wantlist.js b/src/bitswap/wantlist.js similarity index 100% rename from js/src/bitswap/wantlist.js rename to src/bitswap/wantlist.js diff --git a/js/src/block/get.js b/src/block/get.js similarity index 100% rename from js/src/block/get.js rename to src/block/get.js diff --git a/js/src/block/index.js b/src/block/index.js similarity index 100% rename from js/src/block/index.js rename to src/block/index.js diff --git a/js/src/block/put.js b/src/block/put.js similarity index 100% rename from js/src/block/put.js rename to src/block/put.js diff --git a/js/src/block/stat.js b/src/block/stat.js similarity index 100% rename from js/src/block/stat.js rename to src/block/stat.js diff --git a/js/src/bootstrap/add.js b/src/bootstrap/add.js similarity index 100% rename from js/src/bootstrap/add.js rename to src/bootstrap/add.js diff --git a/js/src/bootstrap/index.js b/src/bootstrap/index.js similarity index 100% rename from js/src/bootstrap/index.js rename to src/bootstrap/index.js diff --git a/js/src/bootstrap/list.js b/src/bootstrap/list.js similarity index 100% rename from js/src/bootstrap/list.js rename to src/bootstrap/list.js diff --git a/js/src/bootstrap/rm.js b/src/bootstrap/rm.js similarity index 100% rename from js/src/bootstrap/rm.js rename to src/bootstrap/rm.js diff --git a/js/src/config/get.js b/src/config/get.js similarity index 100% rename from js/src/config/get.js rename to src/config/get.js diff --git a/js/src/config/index.js b/src/config/index.js similarity index 100% rename from js/src/config/index.js rename to src/config/index.js diff --git a/js/src/config/replace.js b/src/config/replace.js similarity index 100% rename from js/src/config/replace.js rename to src/config/replace.js diff --git a/js/src/config/set.js b/src/config/set.js similarity index 100% rename from js/src/config/set.js rename to src/config/set.js diff --git a/js/src/dag/get.js b/src/dag/get.js similarity index 100% rename from js/src/dag/get.js rename to src/dag/get.js diff --git a/js/src/dag/index.js b/src/dag/index.js similarity index 100% rename from js/src/dag/index.js rename to src/dag/index.js diff --git a/js/src/dag/put.js b/src/dag/put.js similarity index 100% rename from js/src/dag/put.js rename to src/dag/put.js diff --git a/js/src/dag/tree.js b/src/dag/tree.js similarity index 100% rename from js/src/dag/tree.js rename to src/dag/tree.js diff --git a/js/src/dht/find-peer.js b/src/dht/find-peer.js similarity index 100% rename from js/src/dht/find-peer.js rename to src/dht/find-peer.js diff --git a/js/src/dht/find-provs.js b/src/dht/find-provs.js similarity index 100% rename from js/src/dht/find-provs.js rename to src/dht/find-provs.js diff --git a/js/src/dht/get.js b/src/dht/get.js similarity index 100% rename from js/src/dht/get.js rename to src/dht/get.js diff --git a/js/src/dht/index.js b/src/dht/index.js similarity index 100% rename from js/src/dht/index.js rename to src/dht/index.js diff --git a/js/src/dht/provide.js b/src/dht/provide.js similarity index 100% rename from js/src/dht/provide.js rename to src/dht/provide.js diff --git a/js/src/dht/put.js b/src/dht/put.js similarity index 100% rename from js/src/dht/put.js rename to src/dht/put.js diff --git a/js/src/dht/query.js b/src/dht/query.js similarity index 100% rename from js/src/dht/query.js rename to src/dht/query.js diff --git a/js/src/files-mfs/cp.js b/src/files-mfs/cp.js similarity index 100% rename from js/src/files-mfs/cp.js rename to src/files-mfs/cp.js diff --git a/js/src/files-mfs/flush.js b/src/files-mfs/flush.js similarity index 100% rename from js/src/files-mfs/flush.js rename to src/files-mfs/flush.js diff --git a/js/src/files-mfs/index.js b/src/files-mfs/index.js similarity index 100% rename from js/src/files-mfs/index.js rename to src/files-mfs/index.js diff --git a/js/src/files-mfs/ls-pull-stream.js b/src/files-mfs/ls-pull-stream.js similarity index 100% rename from js/src/files-mfs/ls-pull-stream.js rename to src/files-mfs/ls-pull-stream.js diff --git a/js/src/files-mfs/ls-readable-stream.js b/src/files-mfs/ls-readable-stream.js similarity index 100% rename from js/src/files-mfs/ls-readable-stream.js rename to src/files-mfs/ls-readable-stream.js diff --git a/js/src/files-mfs/ls.js b/src/files-mfs/ls.js similarity index 100% rename from js/src/files-mfs/ls.js rename to src/files-mfs/ls.js diff --git a/js/src/files-mfs/mkdir.js b/src/files-mfs/mkdir.js similarity index 100% rename from js/src/files-mfs/mkdir.js rename to src/files-mfs/mkdir.js diff --git a/js/src/files-mfs/mv.js b/src/files-mfs/mv.js similarity index 100% rename from js/src/files-mfs/mv.js rename to src/files-mfs/mv.js diff --git a/js/src/files-mfs/read-pull-stream.js b/src/files-mfs/read-pull-stream.js similarity index 100% rename from js/src/files-mfs/read-pull-stream.js rename to src/files-mfs/read-pull-stream.js diff --git a/js/src/files-mfs/read-readable-stream.js b/src/files-mfs/read-readable-stream.js similarity index 100% rename from js/src/files-mfs/read-readable-stream.js rename to src/files-mfs/read-readable-stream.js diff --git a/js/src/files-mfs/read.js b/src/files-mfs/read.js similarity index 100% rename from js/src/files-mfs/read.js rename to src/files-mfs/read.js diff --git a/js/src/files-mfs/rm.js b/src/files-mfs/rm.js similarity index 100% rename from js/src/files-mfs/rm.js rename to src/files-mfs/rm.js diff --git a/js/src/files-mfs/stat.js b/src/files-mfs/stat.js similarity index 100% rename from js/src/files-mfs/stat.js rename to src/files-mfs/stat.js diff --git a/js/src/files-mfs/write.js b/src/files-mfs/write.js similarity index 100% rename from js/src/files-mfs/write.js rename to src/files-mfs/write.js diff --git a/js/src/files-regular/add-from-fs.js b/src/files-regular/add-from-fs.js similarity index 100% rename from js/src/files-regular/add-from-fs.js rename to src/files-regular/add-from-fs.js diff --git a/js/src/files-regular/add-from-stream.js b/src/files-regular/add-from-stream.js similarity index 92% rename from js/src/files-regular/add-from-stream.js rename to src/files-regular/add-from-stream.js index 45a33fe6..f97a5946 100644 --- a/js/src/files-regular/add-from-stream.js +++ b/src/files-regular/add-from-stream.js @@ -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() diff --git a/js/src/files-regular/add-from-url.js b/src/files-regular/add-from-url.js similarity index 100% rename from js/src/files-regular/add-from-url.js rename to src/files-regular/add-from-url.js diff --git a/js/src/files-regular/add-pull-stream.js b/src/files-regular/add-pull-stream.js similarity index 100% rename from js/src/files-regular/add-pull-stream.js rename to src/files-regular/add-pull-stream.js diff --git a/js/src/files-regular/add-readable-stream.js b/src/files-regular/add-readable-stream.js similarity index 100% rename from js/src/files-regular/add-readable-stream.js rename to src/files-regular/add-readable-stream.js diff --git a/js/src/files-regular/add.js b/src/files-regular/add.js similarity index 100% rename from js/src/files-regular/add.js rename to src/files-regular/add.js diff --git a/js/src/files-regular/cat-pull-stream.js b/src/files-regular/cat-pull-stream.js similarity index 100% rename from js/src/files-regular/cat-pull-stream.js rename to src/files-regular/cat-pull-stream.js diff --git a/js/src/files-regular/cat-readable-stream.js b/src/files-regular/cat-readable-stream.js similarity index 100% rename from js/src/files-regular/cat-readable-stream.js rename to src/files-regular/cat-readable-stream.js diff --git a/js/src/files-regular/cat.js b/src/files-regular/cat.js similarity index 100% rename from js/src/files-regular/cat.js rename to src/files-regular/cat.js diff --git a/js/src/files-regular/get-pull-stream.js b/src/files-regular/get-pull-stream.js similarity index 100% rename from js/src/files-regular/get-pull-stream.js rename to src/files-regular/get-pull-stream.js diff --git a/js/src/files-regular/get-readable-stream.js b/src/files-regular/get-readable-stream.js similarity index 100% rename from js/src/files-regular/get-readable-stream.js rename to src/files-regular/get-readable-stream.js diff --git a/js/src/files-regular/get.js b/src/files-regular/get.js similarity index 100% rename from js/src/files-regular/get.js rename to src/files-regular/get.js diff --git a/js/src/files-regular/index.js b/src/files-regular/index.js similarity index 100% rename from js/src/files-regular/index.js rename to src/files-regular/index.js diff --git a/js/src/files-regular/ls-pull-stream.js b/src/files-regular/ls-pull-stream.js similarity index 100% rename from js/src/files-regular/ls-pull-stream.js rename to src/files-regular/ls-pull-stream.js diff --git a/js/src/files-regular/ls-readable-stream.js b/src/files-regular/ls-readable-stream.js similarity index 100% rename from js/src/files-regular/ls-readable-stream.js rename to src/files-regular/ls-readable-stream.js diff --git a/js/src/files-regular/ls.js b/src/files-regular/ls.js similarity index 100% rename from js/src/files-regular/ls.js rename to src/files-regular/ls.js diff --git a/src/files-regular/utils.js b/src/files-regular/utils.js new file mode 100644 index 00000000..8f6bf04d --- /dev/null +++ b/src/files-regular/utils.js @@ -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') + }) +}) diff --git a/js/src/index.js b/src/index.js similarity index 100% rename from js/src/index.js rename to src/index.js diff --git a/js/src/key/export.js b/src/key/export.js similarity index 100% rename from js/src/key/export.js rename to src/key/export.js diff --git a/js/src/key/gen.js b/src/key/gen.js similarity index 100% rename from js/src/key/gen.js rename to src/key/gen.js diff --git a/js/src/key/import.js b/src/key/import.js similarity index 100% rename from js/src/key/import.js rename to src/key/import.js diff --git a/js/src/key/index.js b/src/key/index.js similarity index 100% rename from js/src/key/index.js rename to src/key/index.js diff --git a/js/src/key/list.js b/src/key/list.js similarity index 100% rename from js/src/key/list.js rename to src/key/list.js diff --git a/js/src/key/rename.js b/src/key/rename.js similarity index 100% rename from js/src/key/rename.js rename to src/key/rename.js diff --git a/js/src/key/rm.js b/src/key/rm.js similarity index 100% rename from js/src/key/rm.js rename to src/key/rm.js diff --git a/js/src/miscellaneous/dns.js b/src/miscellaneous/dns.js similarity index 100% rename from js/src/miscellaneous/dns.js rename to src/miscellaneous/dns.js diff --git a/js/src/miscellaneous/id.js b/src/miscellaneous/id.js similarity index 100% rename from js/src/miscellaneous/id.js rename to src/miscellaneous/id.js diff --git a/js/src/miscellaneous/index.js b/src/miscellaneous/index.js similarity index 100% rename from js/src/miscellaneous/index.js rename to src/miscellaneous/index.js diff --git a/js/src/miscellaneous/resolve.js b/src/miscellaneous/resolve.js similarity index 96% rename from js/src/miscellaneous/resolve.js rename to src/miscellaneous/resolve.js index 8122d7a6..50864bae 100644 --- a/js/src/miscellaneous/resolve.js +++ b/src/miscellaneous/resolve.js @@ -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() @@ -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() diff --git a/js/src/miscellaneous/stop.js b/src/miscellaneous/stop.js similarity index 100% rename from js/src/miscellaneous/stop.js rename to src/miscellaneous/stop.js diff --git a/js/src/miscellaneous/version.js b/src/miscellaneous/version.js similarity index 100% rename from js/src/miscellaneous/version.js rename to src/miscellaneous/version.js diff --git a/js/src/name-pubsub/cancel.js b/src/name-pubsub/cancel.js similarity index 100% rename from js/src/name-pubsub/cancel.js rename to src/name-pubsub/cancel.js diff --git a/js/src/name-pubsub/index.js b/src/name-pubsub/index.js similarity index 100% rename from js/src/name-pubsub/index.js rename to src/name-pubsub/index.js diff --git a/js/src/name-pubsub/state.js b/src/name-pubsub/state.js similarity index 100% rename from js/src/name-pubsub/state.js rename to src/name-pubsub/state.js diff --git a/js/src/name-pubsub/subs.js b/src/name-pubsub/subs.js similarity index 100% rename from js/src/name-pubsub/subs.js rename to src/name-pubsub/subs.js diff --git a/js/src/name/index.js b/src/name/index.js similarity index 100% rename from js/src/name/index.js rename to src/name/index.js diff --git a/js/src/name/publish.js b/src/name/publish.js similarity index 100% rename from js/src/name/publish.js rename to src/name/publish.js diff --git a/js/src/name/resolve.js b/src/name/resolve.js similarity index 100% rename from js/src/name/resolve.js rename to src/name/resolve.js diff --git a/js/src/name/utils.js b/src/name/utils.js similarity index 66% rename from js/src/name/utils.js rename to src/name/utils.js index 61bcdcba..e93360ca 100644 --- a/js/src/name/utils.js +++ b/src/name/utils.js @@ -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' }) diff --git a/js/src/object/data.js b/src/object/data.js similarity index 100% rename from js/src/object/data.js rename to src/object/data.js diff --git a/js/src/object/get.js b/src/object/get.js similarity index 100% rename from js/src/object/get.js rename to src/object/get.js diff --git a/js/src/object/index.js b/src/object/index.js similarity index 100% rename from js/src/object/index.js rename to src/object/index.js diff --git a/js/src/object/links.js b/src/object/links.js similarity index 100% rename from js/src/object/links.js rename to src/object/links.js diff --git a/js/src/object/new.js b/src/object/new.js similarity index 100% rename from js/src/object/new.js rename to src/object/new.js diff --git a/js/src/object/patch/add-link.js b/src/object/patch/add-link.js similarity index 100% rename from js/src/object/patch/add-link.js rename to src/object/patch/add-link.js diff --git a/js/src/object/patch/append-data.js b/src/object/patch/append-data.js similarity index 100% rename from js/src/object/patch/append-data.js rename to src/object/patch/append-data.js diff --git a/js/src/object/patch/index.js b/src/object/patch/index.js similarity index 100% rename from js/src/object/patch/index.js rename to src/object/patch/index.js diff --git a/js/src/object/patch/rm-link.js b/src/object/patch/rm-link.js similarity index 100% rename from js/src/object/patch/rm-link.js rename to src/object/patch/rm-link.js diff --git a/js/src/object/patch/set-data.js b/src/object/patch/set-data.js similarity index 100% rename from js/src/object/patch/set-data.js rename to src/object/patch/set-data.js diff --git a/js/src/object/put.js b/src/object/put.js similarity index 100% rename from js/src/object/put.js rename to src/object/put.js diff --git a/js/src/object/stat.js b/src/object/stat.js similarity index 100% rename from js/src/object/stat.js rename to src/object/stat.js diff --git a/js/src/object/utils.js b/src/object/utils.js similarity index 100% rename from js/src/object/utils.js rename to src/object/utils.js diff --git a/js/src/pin/add.js b/src/pin/add.js similarity index 100% rename from js/src/pin/add.js rename to src/pin/add.js diff --git a/js/src/pin/index.js b/src/pin/index.js similarity index 100% rename from js/src/pin/index.js rename to src/pin/index.js diff --git a/js/src/pin/ls.js b/src/pin/ls.js similarity index 100% rename from js/src/pin/ls.js rename to src/pin/ls.js diff --git a/js/src/pin/rm.js b/src/pin/rm.js similarity index 100% rename from js/src/pin/rm.js rename to src/pin/rm.js diff --git a/js/src/pin/utils.js b/src/pin/utils.js similarity index 62% rename from js/src/pin/utils.js rename to src/pin/utils.js index 5f1add5c..09debd8c 100644 --- a/js/src/pin/utils.js +++ b/src/pin/utils.js @@ -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' })]) }) diff --git a/js/src/ping/index.js b/src/ping/index.js similarity index 100% rename from js/src/ping/index.js rename to src/ping/index.js diff --git a/js/src/ping/ping-pull-stream.js b/src/ping/ping-pull-stream.js similarity index 100% rename from js/src/ping/ping-pull-stream.js rename to src/ping/ping-pull-stream.js diff --git a/js/src/ping/ping-readable-stream.js b/src/ping/ping-readable-stream.js similarity index 100% rename from js/src/ping/ping-readable-stream.js rename to src/ping/ping-readable-stream.js diff --git a/js/src/ping/ping.js b/src/ping/ping.js similarity index 100% rename from js/src/ping/ping.js rename to src/ping/ping.js diff --git a/js/src/ping/utils.js b/src/ping/utils.js similarity index 100% rename from js/src/ping/utils.js rename to src/ping/utils.js diff --git a/js/src/pubsub/index.js b/src/pubsub/index.js similarity index 100% rename from js/src/pubsub/index.js rename to src/pubsub/index.js diff --git a/js/src/pubsub/ls.js b/src/pubsub/ls.js similarity index 100% rename from js/src/pubsub/ls.js rename to src/pubsub/ls.js diff --git a/js/src/pubsub/peers.js b/src/pubsub/peers.js similarity index 100% rename from js/src/pubsub/peers.js rename to src/pubsub/peers.js diff --git a/js/src/pubsub/publish.js b/src/pubsub/publish.js similarity index 100% rename from js/src/pubsub/publish.js rename to src/pubsub/publish.js diff --git a/js/src/pubsub/subscribe.js b/src/pubsub/subscribe.js similarity index 100% rename from js/src/pubsub/subscribe.js rename to src/pubsub/subscribe.js diff --git a/js/src/pubsub/unsubscribe.js b/src/pubsub/unsubscribe.js similarity index 100% rename from js/src/pubsub/unsubscribe.js rename to src/pubsub/unsubscribe.js diff --git a/js/src/pubsub/utils.js b/src/pubsub/utils.js similarity index 100% rename from js/src/pubsub/utils.js rename to src/pubsub/utils.js diff --git a/js/src/repo/gc.js b/src/repo/gc.js similarity index 100% rename from js/src/repo/gc.js rename to src/repo/gc.js diff --git a/js/src/repo/index.js b/src/repo/index.js similarity index 100% rename from js/src/repo/index.js rename to src/repo/index.js diff --git a/js/src/repo/stat.js b/src/repo/stat.js similarity index 100% rename from js/src/repo/stat.js rename to src/repo/stat.js diff --git a/js/src/repo/version.js b/src/repo/version.js similarity index 100% rename from js/src/repo/version.js rename to src/repo/version.js diff --git a/js/src/stats/bitswap.js b/src/stats/bitswap.js similarity index 100% rename from js/src/stats/bitswap.js rename to src/stats/bitswap.js diff --git a/js/src/stats/bw-pull-stream.js b/src/stats/bw-pull-stream.js similarity index 100% rename from js/src/stats/bw-pull-stream.js rename to src/stats/bw-pull-stream.js diff --git a/js/src/stats/bw-readable-stream.js b/src/stats/bw-readable-stream.js similarity index 100% rename from js/src/stats/bw-readable-stream.js rename to src/stats/bw-readable-stream.js diff --git a/js/src/stats/bw.js b/src/stats/bw.js similarity index 100% rename from js/src/stats/bw.js rename to src/stats/bw.js diff --git a/js/src/stats/index.js b/src/stats/index.js similarity index 100% rename from js/src/stats/index.js rename to src/stats/index.js diff --git a/js/src/stats/repo.js b/src/stats/repo.js similarity index 100% rename from js/src/stats/repo.js rename to src/stats/repo.js diff --git a/js/src/stats/utils.js b/src/stats/utils.js similarity index 100% rename from js/src/stats/utils.js rename to src/stats/utils.js diff --git a/js/src/swarm/addrs.js b/src/swarm/addrs.js similarity index 100% rename from js/src/swarm/addrs.js rename to src/swarm/addrs.js diff --git a/js/src/swarm/connect.js b/src/swarm/connect.js similarity index 100% rename from js/src/swarm/connect.js rename to src/swarm/connect.js diff --git a/js/src/swarm/disconnect.js b/src/swarm/disconnect.js similarity index 100% rename from js/src/swarm/disconnect.js rename to src/swarm/disconnect.js diff --git a/js/src/swarm/index.js b/src/swarm/index.js similarity index 100% rename from js/src/swarm/index.js rename to src/swarm/index.js diff --git a/js/src/swarm/local-addrs.js b/src/swarm/local-addrs.js similarity index 100% rename from js/src/swarm/local-addrs.js rename to src/swarm/local-addrs.js diff --git a/js/src/swarm/peers.js b/src/swarm/peers.js similarity index 100% rename from js/src/swarm/peers.js rename to src/swarm/peers.js diff --git a/js/src/types.js b/src/types.js similarity index 100% rename from js/src/types.js rename to src/types.js diff --git a/js/src/util.js b/src/util.js similarity index 100% rename from js/src/util.js rename to src/util.js diff --git a/js/src/utils/expect-timeout.js b/src/utils/expect-timeout.js similarity index 100% rename from js/src/utils/expect-timeout.js rename to src/utils/expect-timeout.js diff --git a/js/src/utils/mocha.js b/src/utils/mocha.js similarity index 100% rename from js/src/utils/mocha.js rename to src/utils/mocha.js diff --git a/js/src/utils/spawn.js b/src/utils/spawn.js similarity index 100% rename from js/src/utils/spawn.js rename to src/utils/spawn.js diff --git a/js/src/utils/suite.js b/src/utils/suite.js similarity index 100% rename from js/src/utils/suite.js rename to src/utils/suite.js diff --git a/js/src/utils/swarm.js b/src/utils/swarm.js similarity index 100% rename from js/src/utils/swarm.js rename to src/utils/swarm.js diff --git a/js/test/fixtures/.gitattributes b/test/fixtures/.gitattributes similarity index 100% rename from js/test/fixtures/.gitattributes rename to test/fixtures/.gitattributes diff --git a/js/test/fixtures/15mb.random b/test/fixtures/15mb.random similarity index 100% rename from js/test/fixtures/15mb.random rename to test/fixtures/15mb.random diff --git a/js/test/fixtures/hidden-files-folder/.hiddenTest.txt b/test/fixtures/hidden-files-folder/.hiddenTest.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/.hiddenTest.txt rename to test/fixtures/hidden-files-folder/.hiddenTest.txt diff --git a/js/test/fixtures/hidden-files-folder/alice.txt b/test/fixtures/hidden-files-folder/alice.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/alice.txt rename to test/fixtures/hidden-files-folder/alice.txt diff --git a/js/test/fixtures/hidden-files-folder/files/hello.txt b/test/fixtures/hidden-files-folder/files/hello.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/files/hello.txt rename to test/fixtures/hidden-files-folder/files/hello.txt diff --git a/js/test/fixtures/hidden-files-folder/files/ipfs.txt b/test/fixtures/hidden-files-folder/files/ipfs.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/files/ipfs.txt rename to test/fixtures/hidden-files-folder/files/ipfs.txt diff --git a/js/test/fixtures/hidden-files-folder/hello-link b/test/fixtures/hidden-files-folder/hello-link similarity index 100% rename from js/test/fixtures/hidden-files-folder/hello-link rename to test/fixtures/hidden-files-folder/hello-link diff --git a/js/test/fixtures/hidden-files-folder/holmes.txt b/test/fixtures/hidden-files-folder/holmes.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/holmes.txt rename to test/fixtures/hidden-files-folder/holmes.txt diff --git a/js/test/fixtures/hidden-files-folder/ipfs-add.js b/test/fixtures/hidden-files-folder/ipfs-add.js similarity index 100% rename from js/test/fixtures/hidden-files-folder/ipfs-add.js rename to test/fixtures/hidden-files-folder/ipfs-add.js diff --git a/js/test/fixtures/hidden-files-folder/jungle.txt b/test/fixtures/hidden-files-folder/jungle.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/jungle.txt rename to test/fixtures/hidden-files-folder/jungle.txt diff --git a/js/test/fixtures/hidden-files-folder/pp.txt b/test/fixtures/hidden-files-folder/pp.txt similarity index 100% rename from js/test/fixtures/hidden-files-folder/pp.txt rename to test/fixtures/hidden-files-folder/pp.txt diff --git a/js/test/fixtures/ssl/cert.pem b/test/fixtures/ssl/cert.pem similarity index 100% rename from js/test/fixtures/ssl/cert.pem rename to test/fixtures/ssl/cert.pem diff --git a/js/test/fixtures/ssl/privkey.pem b/test/fixtures/ssl/privkey.pem similarity index 100% rename from js/test/fixtures/ssl/privkey.pem rename to test/fixtures/ssl/privkey.pem diff --git a/js/test/fixtures/test-folder/alice.txt b/test/fixtures/test-folder/alice.txt similarity index 100% rename from js/test/fixtures/test-folder/alice.txt rename to test/fixtures/test-folder/alice.txt diff --git a/js/test/fixtures/test-folder/files/hello.txt b/test/fixtures/test-folder/files/hello.txt similarity index 100% rename from js/test/fixtures/test-folder/files/hello.txt rename to test/fixtures/test-folder/files/hello.txt diff --git a/js/test/fixtures/test-folder/files/ipfs.txt b/test/fixtures/test-folder/files/ipfs.txt similarity index 100% rename from js/test/fixtures/test-folder/files/ipfs.txt rename to test/fixtures/test-folder/files/ipfs.txt diff --git a/js/test/fixtures/test-folder/hello-link b/test/fixtures/test-folder/hello-link similarity index 100% rename from js/test/fixtures/test-folder/hello-link rename to test/fixtures/test-folder/hello-link diff --git a/js/test/fixtures/test-folder/holmes.txt b/test/fixtures/test-folder/holmes.txt similarity index 100% rename from js/test/fixtures/test-folder/holmes.txt rename to test/fixtures/test-folder/holmes.txt diff --git a/js/test/fixtures/test-folder/ipfs-add.js b/test/fixtures/test-folder/ipfs-add.js similarity index 100% rename from js/test/fixtures/test-folder/ipfs-add.js rename to test/fixtures/test-folder/ipfs-add.js diff --git a/js/test/fixtures/test-folder/jungle.txt b/test/fixtures/test-folder/jungle.txt similarity index 100% rename from js/test/fixtures/test-folder/jungle.txt rename to test/fixtures/test-folder/jungle.txt diff --git a/js/test/fixtures/test-folder/pp.txt b/test/fixtures/test-folder/pp.txt similarity index 100% rename from js/test/fixtures/test-folder/pp.txt rename to test/fixtures/test-folder/pp.txt diff --git a/js/test/fixtures/testfile.txt b/test/fixtures/testfile.txt similarity index 100% rename from js/test/fixtures/testfile.txt rename to test/fixtures/testfile.txt diff --git a/js/test/fixtures/weird name folder [v0]/add b/test/fixtures/weird name folder [v0]/add similarity index 100% rename from js/test/fixtures/weird name folder [v0]/add rename to test/fixtures/weird name folder [v0]/add diff --git a/js/test/fixtures/weird name folder [v0]/cat b/test/fixtures/weird name folder [v0]/cat similarity index 100% rename from js/test/fixtures/weird name folder [v0]/cat rename to test/fixtures/weird name folder [v0]/cat diff --git a/js/test/fixtures/weird name folder [v0]/files/hello.txt b/test/fixtures/weird name folder [v0]/files/hello.txt similarity index 100% rename from js/test/fixtures/weird name folder [v0]/files/hello.txt rename to test/fixtures/weird name folder [v0]/files/hello.txt diff --git a/js/test/fixtures/weird name folder [v0]/files/ipfs.txt b/test/fixtures/weird name folder [v0]/files/ipfs.txt similarity index 100% rename from js/test/fixtures/weird name folder [v0]/files/ipfs.txt rename to test/fixtures/weird name folder [v0]/files/ipfs.txt diff --git a/js/test/fixtures/weird name folder [v0]/hello-link b/test/fixtures/weird name folder [v0]/hello-link similarity index 100% rename from js/test/fixtures/weird name folder [v0]/hello-link rename to test/fixtures/weird name folder [v0]/hello-link diff --git a/js/test/fixtures/weird name folder [v0]/ipfs-add b/test/fixtures/weird name folder [v0]/ipfs-add similarity index 100% rename from js/test/fixtures/weird name folder [v0]/ipfs-add rename to test/fixtures/weird name folder [v0]/ipfs-add diff --git a/js/test/fixtures/weird name folder [v0]/ls b/test/fixtures/weird name folder [v0]/ls similarity index 100% rename from js/test/fixtures/weird name folder [v0]/ls rename to test/fixtures/weird name folder [v0]/ls diff --git a/js/test/fixtures/weird name folder [v0]/version b/test/fixtures/weird name folder [v0]/version similarity index 100% rename from js/test/fixtures/weird name folder [v0]/version rename to test/fixtures/weird name folder [v0]/version diff --git a/js/test/interface.spec.js b/test/interface.spec.js similarity index 100% rename from js/test/interface.spec.js rename to test/interface.spec.js