diff --git a/.gitignore b/.gitignore index 0a54eec..e64be03 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ dist bundle .cache -.storybook/explorer.js \ No newline at end of file +.storybook/explorer.js + +public/*.wasm +public/runnerScript.* diff --git a/package-lock.json b/package-lock.json index 58c8c03..696404a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,9 +7,10 @@ "": { "name": "fluence-admin", "version": "0.1.0", + "hasInstallScript": true, "license": "ISC", "dependencies": { - "@fluencelabs/fluence": "^0.14.2", + "@fluencelabs/fluence": "0.17.0", "@fluencelabs/fluence-network-environment": "1.0.10", "css-spinners": "^1.0.1", "tachyons": "^4.12.0", @@ -1330,22 +1331,41 @@ } }, "node_modules/@fluencelabs/avm": { - "version": "0.15.4", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.15.4.tgz", - "integrity": "sha512-NLZDq83ocJ1Helm0D8kPMSSkjxH0y+Tujg0px773zjIShbh3jgiJOjAW1xCYgTt9K0LqepjP0bWX4/8nUZfr7g==", - "dependencies": { - "base64-js": "1.5.1" + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", + "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==", + "bin": { + "copy-avm": "dist/copyAvm.js" } }, + "node_modules/@fluencelabs/avm-runner-background": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-background/-/avm-runner-background-0.1.1.tgz", + "integrity": "sha512-XUnw3eUakBDngLZMIhTUXIT3Oz6N+6aclo7p2YIvjRHqhUUnL5/VEZcbuxLdkdzMdSdbQE7C/btKNVTO2kWJBw==", + "dependencies": { + "@fluencelabs/avm-runner-interface": "^0.2.0", + "browser-or-node": "^2.0.0", + "threads": "^1.7.0" + }, + "bin": { + "copy-avm-runner": "dist/copyRunnerScript.js" + } + }, + "node_modules/@fluencelabs/avm-runner-interface": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-interface/-/avm-runner-interface-0.2.0.tgz", + "integrity": "sha512-Y41pL+UwZZVdormxju8cJQsNRp6tdER0VqJ9Kg9gH2wd1KJAaYTJkyVbn8NB7fEFRUbqfbb1BXHi9wWBYOgGYQ==" + }, "node_modules/@fluencelabs/fluence": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.14.2.tgz", - "integrity": "sha512-Cf5Ii6dpVSSi839jB7H0Y9k07xncYdHiTNKp4LlPg6inXuy2OPb2E7qF5DXlMM9O1dBb/UJTa4jZlQDsgWriiQ==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.17.0.tgz", + "integrity": "sha512-7GgDh+fonc0bWIMdM4iOH2/XVJdbPTyoLWedT1lQkrei3iBaTGZI6BzFcG0cYpBvy1i6w4XPxFDf08o3t/GR8g==", "dependencies": { "@chainsafe/libp2p-noise": "4.0.0", - "@fluencelabs/avm": "0.15.4", + "@fluencelabs/avm": "0.19.6", + "@fluencelabs/avm-runner-background": "0.1.1", + "@fluencelabs/avm-runner-interface": "^0.2.0", "async": "3.2.0", - "base64-js": "1.5.1", "bs58": "4.0.1", "cids": "0.8.1", "it-length-prefixed": "3.0.1", @@ -1360,6 +1380,9 @@ "rxjs": "^7.3.0", "ts-pattern": "^3.3.3", "uuid": "8.3.0" + }, + "bin": { + "copy-avm-public": "dist/tools/copyAvmPublic.js" } }, "node_modules/@fluencelabs/fluence-network-environment": { @@ -3065,6 +3088,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "node_modules/browser-or-node": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.0.0.tgz", + "integrity": "sha512-3Lrks/Okgof+/cRguUNG+qRXSeq79SO3hY4QrXJayJofwJwHiGC0qi99uDjsfTwULUFSr1OGVsBkdIkygKjTUA==" + }, "node_modules/browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -6885,6 +6913,15 @@ "node": ">=4.0.0" } }, + "node_modules/esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -9379,6 +9416,17 @@ "node": ">=8" } }, + "node_modules/is-observable": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-2.1.0.tgz", + "integrity": "sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", @@ -11950,6 +11998,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/observable-fns": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.6.1.tgz", + "integrity": "sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg==" + }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -16291,6 +16344,31 @@ "node": ">=0.10.0" } }, + "node_modules/threads": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/threads/-/threads-1.7.0.tgz", + "integrity": "sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==", + "dependencies": { + "callsites": "^3.1.0", + "debug": "^4.2.0", + "is-observable": "^2.1.0", + "observable-fns": "^0.6.1" + }, + "funding": { + "url": "https://github.com/andywer/threads.js?sponsor=1" + }, + "optionalDependencies": { + "tiny-worker": ">= 2" + } + }, + "node_modules/threads/node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -16381,6 +16459,15 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, + "node_modules/tiny-worker": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tiny-worker/-/tiny-worker-2.3.0.tgz", + "integrity": "sha512-pJ70wq5EAqTAEl9IkGzA+fN0836rycEuz2Cn6yeZ6FRzlVS5IDOkFHpIoEsksPRQV34GDqXm65+OlnZqUSyK2g==", + "optional": true, + "dependencies": { + "esm": "^3.2.25" + } + }, "node_modules/to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -19500,22 +19587,35 @@ "dev": true }, "@fluencelabs/avm": { - "version": "0.15.4", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.15.4.tgz", - "integrity": "sha512-NLZDq83ocJ1Helm0D8kPMSSkjxH0y+Tujg0px773zjIShbh3jgiJOjAW1xCYgTt9K0LqepjP0bWX4/8nUZfr7g==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", + "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==" + }, + "@fluencelabs/avm-runner-background": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-background/-/avm-runner-background-0.1.1.tgz", + "integrity": "sha512-XUnw3eUakBDngLZMIhTUXIT3Oz6N+6aclo7p2YIvjRHqhUUnL5/VEZcbuxLdkdzMdSdbQE7C/btKNVTO2kWJBw==", "requires": { - "base64-js": "1.5.1" + "@fluencelabs/avm-runner-interface": "^0.2.0", + "browser-or-node": "^2.0.0", + "threads": "^1.7.0" } }, + "@fluencelabs/avm-runner-interface": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-interface/-/avm-runner-interface-0.2.0.tgz", + "integrity": "sha512-Y41pL+UwZZVdormxju8cJQsNRp6tdER0VqJ9Kg9gH2wd1KJAaYTJkyVbn8NB7fEFRUbqfbb1BXHi9wWBYOgGYQ==" + }, "@fluencelabs/fluence": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.14.2.tgz", - "integrity": "sha512-Cf5Ii6dpVSSi839jB7H0Y9k07xncYdHiTNKp4LlPg6inXuy2OPb2E7qF5DXlMM9O1dBb/UJTa4jZlQDsgWriiQ==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.17.0.tgz", + "integrity": "sha512-7GgDh+fonc0bWIMdM4iOH2/XVJdbPTyoLWedT1lQkrei3iBaTGZI6BzFcG0cYpBvy1i6w4XPxFDf08o3t/GR8g==", "requires": { "@chainsafe/libp2p-noise": "4.0.0", - "@fluencelabs/avm": "0.15.4", + "@fluencelabs/avm": "0.19.6", + "@fluencelabs/avm-runner-background": "0.1.1", + "@fluencelabs/avm-runner-interface": "^0.2.0", "async": "3.2.0", - "base64-js": "1.5.1", "bs58": "4.0.1", "cids": "0.8.1", "it-length-prefixed": "3.0.1", @@ -21012,6 +21112,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "browser-or-node": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.0.0.tgz", + "integrity": "sha512-3Lrks/Okgof+/cRguUNG+qRXSeq79SO3hY4QrXJayJofwJwHiGC0qi99uDjsfTwULUFSr1OGVsBkdIkygKjTUA==" + }, "browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -24127,6 +24232,12 @@ "estraverse": "^4.1.1" } }, + "esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "optional": true + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -26142,6 +26253,11 @@ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, + "is-observable": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-2.1.0.tgz", + "integrity": "sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw==" + }, "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", @@ -28258,6 +28374,11 @@ } } }, + "observable-fns": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.6.1.tgz", + "integrity": "sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg==" + }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -31869,6 +31990,25 @@ } } }, + "threads": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/threads/-/threads-1.7.0.tgz", + "integrity": "sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==", + "requires": { + "callsites": "^3.1.0", + "debug": "^4.2.0", + "is-observable": "^2.1.0", + "observable-fns": "^0.6.1", + "tiny-worker": ">= 2" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -31960,6 +32100,15 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, + "tiny-worker": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tiny-worker/-/tiny-worker-2.3.0.tgz", + "integrity": "sha512-pJ70wq5EAqTAEl9IkGzA+fN0836rycEuz2Cn6yeZ6FRzlVS5IDOkFHpIoEsksPRQV34GDqXm65+OlnZqUSyK2g==", + "optional": true, + "requires": { + "esm": "^3.2.25" + } + }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", diff --git a/package.json b/package.json index 3a62149..33e07dd 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "", "main": "index.js", "scripts": { + "postinstall": "copy-avm-public public", "test": "elm-test", "start": "npm run dev", "dev": "webpack-dev-server --hot --colors --port 3000", @@ -31,7 +32,7 @@ }, "homepage": "https://github.com/fluencelabs/fluence-admin#readme", "dependencies": { - "@fluencelabs/fluence": "^0.14.2", + "@fluencelabs/fluence": "0.17.0", "@fluencelabs/fluence-network-environment": "1.0.10", "css-spinners": "^1.0.1", "tachyons": "^4.12.0", diff --git a/webpack.config.js b/webpack.config.js index b6ab174..0540d1b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -129,7 +129,7 @@ if (MODE === 'development') { devServer: { inline: true, stats: 'errors-only', - contentBase: path.join(__dirname, 'src/assets'), + contentBase: path.join(__dirname, 'public'), historyApiFallback: true, // feel free to delete this section if you don't need anything like this before(app) { @@ -169,6 +169,16 @@ if (MODE === 'production') { // both options are optional filename: '[name]-[hash].css', }), + new CopyWebpackPlugin({ + patterns: [ + { + from: './public/avm.wasm', + }, + { + from: './public/runnerScript.web.js', + }, + ], + }), ], module: { rules: [