initial commit

This commit is contained in:
Iuri Matias 2019-04-09 17:22:27 -04:00
commit bc449ff15d
9 changed files with 18304 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

1
dist/browser.js vendored Normal file
View File

@ -0,0 +1 @@
module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=2)}([function(e,r){e.exports=require("status-js-api")},function(e,r){e.exports=require("murmur-client")},function(e,r,t){"use strict";t.r(r);var n=t(0),o=t.n(n),u=t(1);let i=new(t.n(u).a)({protocols:["libp2p"],signalServers:["/dns4/web-bridge.status.im/tcp/443/wss/p2p-webrtc-star"],bootnodes:[]});i.start(),(new o.a).connectToProvider(i.provider,null),console.dir("hello world!")}]);

7
index.html Normal file
View File

@ -0,0 +1,7 @@
<html>
<head>
<script src="./dist/main.js"></script>
</head>
<body>
</body>
</html>

10445
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "status-chat-widget",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
"dependencies": {
"@babel/runtime-corejs2": "^7.3.1",
"ethereumjs-devp2p": "github:status-im/ethereumjs-devp2p#mailserver-experiment",
"murmur-client": "^0.2.5",
"null-loader": "^0.1.1",
"status-js-api": "^1.2.6",
"webpack": "^4.29.0",
"webpack-merge": "^4.2.1",
"webpack-node-externals": "^1.7.2"
},
"devDependencies": {
"webpack-cli": "^3.3.0"
}
}

18
src/index.js Normal file
View File

@ -0,0 +1,18 @@
import StatusJS from 'status-js-api';
import Murmur from 'murmur-client';
let server = new Murmur({
protocols: ["libp2p"],
// signalServer: { host: '104.248.64.24', port: '9090', protocol: 'ws' },
signalServers: [
//"/dns4/cryptolife.status.im/tcp/443/wss/p2p-webrtc-star"
"/dns4/web-bridge.status.im/tcp/443/wss/p2p-webrtc-star"
],
bootnodes: []
});
server.start();
const status = new StatusJS();
status.connectToProvider(server.provider, null);
console.dir("hello world!")

45
webpack.config.js Normal file
View File

@ -0,0 +1,45 @@
const path = require('path');
const nodeExternals = require('webpack-node-externals');
//const webConfig = {
module.exports = {
mode: 'production',
entry: path.join(__dirname, "src/index.js"),
//externals: {
// 'ethereumjs-devp2p': 'ethereumjs-devp2p'
//},
externals: [nodeExternals()],
target: 'web',
output: {
path: path.resolve(__dirname, "dist"),
library: 'widget',
libraryTarget: 'commonjs2',
filename: 'browser.js'
},
module: {
rules: [
{
test: /devp2p-node.js/,
loader: 'null-loader'
}
]
}
};
//const nodeConfig = {
// mode: 'production',
// entry: path.join(__dirname, "src/index.js"),
// target: 'node',
// output: {
// path: path.resolve(__dirname, "dist"),
// library: 'widget',
// libraryTarget: 'commonjs2',
// filename: 'node.js'
// },
// externals: [nodeExternals()]
//};
//
//module.exports = [
// webConfig,
// nodeConfig
//]

29
webpack.js Normal file
View File

@ -0,0 +1,29 @@
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
mode: 'production',
entry: path.join(__dirname, "src/index.js"),
externals: {
'ethereumjs-devp2p': 'ethereumjs-devp2p'
},
target: 'web',
externals: [nodeExternals()],
output: {
path: path.resolve(__dirname, "dist"),
// library: 'widget',
// libraryTarget: 'commonjs2',
filename: 'browser.js'
},
node: {
net: 'empty'
},
module: {
rules: [
{
test: /devp2p-node.js/,
loader: 'null-loader'
}
]
}
};

7734
yarn.lock Normal file

File diff suppressed because it is too large Load Diff