diff --git a/.gitignore b/.gitignore index 3c3629e..23f1c2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +dweb_transports_bundle.js diff --git a/src/Errors.js b/Errors.js similarity index 100% rename from src/Errors.js rename to Errors.js diff --git a/src/Transport.js b/Transport.js similarity index 100% rename from src/Transport.js rename to Transport.js diff --git a/src/TransportHTTP.js b/TransportHTTP.js similarity index 100% rename from src/TransportHTTP.js rename to TransportHTTP.js diff --git a/src/TransportIPFS.js b/TransportIPFS.js similarity index 100% rename from src/TransportIPFS.js rename to TransportIPFS.js diff --git a/src/TransportWEBTORRENT.js b/TransportWEBTORRENT.js similarity index 100% rename from src/TransportWEBTORRENT.js rename to TransportWEBTORRENT.js diff --git a/src/TransportYJS.js b/TransportYJS.js similarity index 100% rename from src/TransportYJS.js rename to TransportYJS.js diff --git a/src/Transports.js b/Transports.js similarity index 100% rename from src/Transports.js rename to Transports.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..1406981 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +// Order is significant as should search earlier ones first +// put IPFS before Webtorrent for showcasing, as Webtorrent works in some cases IPFS doesnt so that way we exercise both +const DwebTransports = require("./Transports.js"); +require("./TransportHTTP.js"); // Can access via window.DwebTransports._transportclasses["HTTP"] +require("./TransportIPFS.js"); +require("./TransportYJS.js"); +require("./TransportWEBTORRENT.js"); +window.DwebTransports = DwebTransports; +exports = module.exports = DwebTransports; diff --git a/package.json b/package.json index fd391f9..4cb0255 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,12 @@ { - "name": "dweb-transports", - "version": "0.0.1", - "description": "Internet Archive Decentralized Web Transports Library", + "author": { + "name": "Mitra Ardron", + "email": "mitra@archive.org", + "url": "http://www.mitra.biz" + }, + "bugs": { + "url": "https://github.com/mitra42/dweb-transports/issues" + }, "dependencies": { "cids": "latest", "ipfs": "latest", @@ -18,21 +23,25 @@ "y-ipfs-connector": "latest", "y-indexeddb": "latest" }, - "keywords": [], - "license": "AGPL-3.0", - "author": { - "name": "Mitra Ardron", - "email": "mitra@archive.org", - "url": "http://www.mitra.biz" - }, + "description": "Internet Archive Decentralized Web Transports Library", "devDependencies": { "browserify": "^14.5.0", "watchify": "^3.11.0" }, + "homepage": "https://github.com/mitra42/dweb-transports#readme", + "keywords": [], + "license": "AGPL-3.0", + "main": "index.js", + "name": "dweb-transports", + "repository": { + "type": "git", + "url": "git://github.com/mitra42/dweb-transports.git" + }, "scripts": { - "bundle": "cd src; browserify ./dweb-transports_all.js > ../dist/dweb_transports_bundle.js", - "watch": "watchify src/dweb-transports_all.js -o dist/dweb_transports_bundle.js --verbose", + "bundle": "browserify ./index.js > ./dist/dweb_transports_bundle.js", + "watch": "watchify ./index.js -o dist/dweb_transports_bundle.js --verbose", "test": "cd src; node ./test.js", "help": "echo 'test (test it)'; echo 'bundle (packs into ../examples)'; echo 'watch: continually bundles whenever files change'" - } + }, + "version": "0.0.1" } diff --git a/src/utils.js b/utils.js similarity index 100% rename from src/utils.js rename to utils.js