diff --git a/README.md b/README.md index 8d54d14..9bbc13f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -### Starting blockpaste -`yarn start:blockpaste` +### Starting Swarm Bin +`yarn start:swarmbin` ### Start playground `yarn start:playground` diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index c5f1f38..14813e4 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -5,7 +5,7 @@ const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); +const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); const eslintFormatter = require('react-dev-utils/eslintFormatter'); @@ -249,10 +249,7 @@ module.exports = { // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), - new CopyWebpackPlugin([{ - from: 'node_modules/monaco-editor/min/vs', - to: 'vs', - }]), + new MonacoWebpackPlugin(), ], // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 01fe1ed..4d838d3 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -3,7 +3,7 @@ const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); +const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ManifestPlugin = require('webpack-manifest-plugin'); @@ -13,10 +13,10 @@ const eslintFormatter = require('react-dev-utils/eslintFormatter'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); const paths = require('./paths'); const getClientEnvironment = require('./env'); - // Webpack uses `publicPath` to determine where the app is being served from. // It requires a trailing slash, or the file assets will get an incorrect path. -const publicPath = paths.servedPath; +const publicPath = "https://swarm-gateways.net/bzz:/swarmbin.eth/"; + // Some apps do not use client-side routing with pushState. // For these, "homepage" can be set to "." to enable relative asset paths. const shouldUseRelativeAssetPaths = publicPath === './'; @@ -321,10 +321,7 @@ module.exports = { // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), - new CopyWebpackPlugin([{ - from: 'node_modules/monaco-editor/min/vs', - to: 'vs', - }]), + new MonacoWebpackPlugin(), ], // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. diff --git a/package.json b/package.json index 2db00fd..8c4ebfd 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { - "name": "eth-sandbox", + "name": "swarmbin", "version": "0.1.0", "private": true, "dependencies": { + "@erebos/swarm": "^0.8.1", "autoprefixer": "7.1.1", "babel-core": "6.25.0", "babel-eslint": "7.2.3", @@ -31,20 +32,22 @@ "html-webpack-plugin": "2.29.0", "husky": "^0.14.3", "jest": "20.0.4", - "lint-staged": "^6.0.0", + "lint-staged": "^9.0.0", "lodash": "^4.17.4", "moment": "^2.20.1", + "monaco-editor-webpack-plugin": "^1.7.0", "object-assign": "4.1.1", "office-ui-fabric-react": "^5.37.0", "postcss-flexbugs-fixes": "3.0.0", "postcss-loader": "2.0.6", "prettier": "^1.10.2", "promise": "7.1.1", + "qs": "^6.7.0", "react": "^15.6.1", "react-dev-utils": "^3.0.2", "react-dom": "^15.6.1", "react-error-overlay": "^1.0.9", - "react-monaco-editor": "^0.13.0", + "react-monaco-editor": "0.26.2", "react-panelgroup": "^1.0.5", "react-router": "^3.0.2", "style-loader": "0.18.2", @@ -58,18 +61,19 @@ "whatwg-fetch": "2.0.3" }, "scripts": { - "deploy:blockpaste": "node scripts/deploy-blockpaste", + "analyze": "source-map-explorer './build/static/js/*.js'", + "deploy:swarmbin": "node scripts/deploy-swarmbin", "deploy:playground": "node scripts/deploy-playground", - "deploy:all": "yarn deploy:blockpaste && yarn deploy:playground && yarn invalidate-cache", + "deploy:all": "yarn deploy:swarmbin && yarn deploy:playground && yarn invalidate-cache", "invalidate-cache": "node scripts/invalidate-cache", "lint": "eslint src", "lint:fix": "eslint src --fix", "start": "node scripts/start.js", - "start:blockpaste": "REACT_APP_ID=blockpaste REACT_APP_ROOT=src/index.blockpaste.js REACT_APP_INDEX_FILE=public/index.blockpaste.html yarn start", + "start:swarmbin": "REACT_APP_ID=swarmbin REACT_APP_ROOT=src/index.swarmbin.js REACT_APP_INDEX_FILE=public/index.swarmbin.html yarn start", "start:playground": "REACT_APP_ID=playground REACT_APP_ROOT=src/index.playground.js REACT_APP_INDEX_FILE=public/index.playground.html yarn start", "precommit": "lint-staged", "prettier": "prettier --write src", - "build:blockpaste": "REACT_APP_ID=blockpaste REACT_APP_ROOT=src/index.blockpaste.js REACT_APP_INDEX_FILE=public/index.blockpaste.html node scripts/build.js", + "build:swarmbin": "REACT_APP_ID=swarmbin REACT_APP_ROOT=src/index.swarmbin.js REACT_APP_INDEX_FILE=public/index.swarmbin.html node scripts/build.js", "build:playground": "REACT_APP_ID=playground REACT_APP_ROOT=src/index.playground.js REACT_APP_INDEX_FILE=public/index.playground.html node scripts/build.js", "test": "node scripts/test.js --env=jsdom" }, diff --git a/public/index.blockpaste.html b/public/index.swarmbin.html similarity index 91% rename from public/index.blockpaste.html rename to public/index.swarmbin.html index 74fbf68..253f7c9 100644 --- a/public/index.blockpaste.html +++ b/public/index.swarmbin.html @@ -14,8 +14,8 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> -