From 469e7cc0a6802d56be7355dc62d844aac68df3f9 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 6 Apr 2019 23:19:26 -0500 Subject: [PATCH 001/122] Updated version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a7d2a5..bc64bbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "repertory-ui", - "version": "1.0.2", + "version": "1.0.3", "private": true, "author": "scott.e.graves@gmail.com", "description": "GUI for Repertory - Repertory allows you to mount Hyperspace, Sia and/or SiaPrime blockchain storage solutions via FUSE on Linux/OS X or via WinFSP on Windows.", From 3528e99bfd2423f2336be5db64b68a52762db86b Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 01:28:10 -0500 Subject: [PATCH 002/122] Version changes --- CHANGELOG.md | 7 +++++++ LICENSE.md | 2 +- README.md | 8 ++++---- releases.json | 10 ++++++++++ src/constants.js | 4 ++-- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ac382a..3a85c7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # Changelog # +## 1.0.3 ## +* Linux distribution support + * Debian 9 + * Solus + * Ubuntu 18.10 + * Ubuntu 19.04 + * ## 1.0.2 ## * Option to launch application hidden (notification icon only) * Close window to notification area diff --git a/LICENSE.md b/LICENSE.md index 7aa51d6..28f9ec1 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,5 @@ # Repertory UI MIT License # -### Copyright <2018> ### +### Copyright <2018-2019> ### Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index 579cb7f..00fb529 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ ### GUI for [Repertory](https://bitbucket.org/blockstorage/repertory) ### Repertory allows you to mount Sia, SiaPrime and/or Hyperspace blockchain storage solutions via FUSE on Linux/OS X or via WinFSP on Windows. # Downloads # -* [Repertory UI v1.0.2 OS X](https://pixeldrain.com/u/sEz57mDP) -* [Repertory UI v1.0.2 Windows 64-bit](https://pixeldrain.com/u/4oJeVntd) +* [Repertory UI v1.0.3 Linux 64-bit]() +* [Repertory UI v1.0.3 OS X 64-bit]() +* [Repertory UI v1.0.3 Windows 64-bit]() # Supported Platforms # -* OS X +* OS X 64-bit * Windows 64-bit -# Future Platforms # * Linux 64-bit \ No newline at end of file diff --git a/releases.json b/releases.json index 243631d..dbc81b9 100644 --- a/releases.json +++ b/releases.json @@ -1,12 +1,20 @@ { "Locations": { "win32": { + "1.0.3": { + "hash": "", + "urls": [] + }, "1.0.2": { "hash": "", "urls": ["https://pixeldrain.com/api/file/4oJeVntd"] } }, "darwin": { + "1.0.3": { + "hash": "", + "urls": [] + }, "1.0.2": { "hash": "", "urls": ["https://pixeldrain.com/api/file/sEz57mDP"] @@ -15,9 +23,11 @@ }, "Versions": { "win32": [ + "1.0.3", "1.0.2" ], "darwin": [ + "1.0.3", "1.0.2" ] } diff --git a/src/constants.js b/src/constants.js index bd45c0d..672b660 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,13 +1,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/master/releases.json'; +exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/1.0.0-beta_branch/releases.json'; exports.DATA_LOCATIONS = { linux: '~/.local/repertory/ui', darwin: '~/Library/Application Support/repertory/ui', win32: '%LOCALAPPDATA%\\repertory\\ui' }; -exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/master/releases.json'; +exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/1.0.0-beta_branch/releases.json'; exports.PROVIDER_LIST = [ 'Hyperspace', From 0e58e9fa65f670276bf4dcb143e82510571bc0dc Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 02:26:36 -0500 Subject: [PATCH 003/122] Prepare for releases --- releases.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/releases.json b/releases.json index dbc81b9..81d5a32 100644 --- a/releases.json +++ b/releases.json @@ -19,9 +19,21 @@ "hash": "", "urls": ["https://pixeldrain.com/api/file/sEz57mDP"] } + }, + "solus": { + "1.0.3": { + "hash": "", + "urls": [] + } } }, "Versions": { + "linux": [ + "unavailable" + ], + "solus": [ + "1.0.3" + ], "win32": [ "1.0.3", "1.0.2" From 978e5d0415a760ce3dc26c560bb041c2bd8112ca Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 02:56:37 -0500 Subject: [PATCH 004/122] Solus Linux detection --- CHANGELOG.md | 3 ++- electron.js | 28 +++++++++++++++++++++++++--- helpers.js | 31 +++++++++++++++++++++++++++++++ public/detect_linux.sh | 17 +++++++++++++++++ src/constants.js | 7 ++++++- 5 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 public/detect_linux.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a85c7e..aa34878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ * Linux distribution support * Debian 9 * Solus + * Ubuntu 18.04 * Ubuntu 18.10 * Ubuntu 19.04 - * + ## 1.0.2 ## * Option to launch application hidden (notification icon only) * Close window to notification area diff --git a/electron.js b/electron.js index ed58920..be4bd04 100644 --- a/electron.js +++ b/electron.js @@ -11,6 +11,10 @@ const helpers = require('./helpers'); const fs = require('fs'); const unzip = require('unzipper'); const AutoLaunch = require('auto-launch'); +require.extensions['.sh'] = function (module, filename) { + module.exports = fs.readFileSync(filename, 'utf8'); +}; +const detectScript = require('./public/detect_linux.sh'); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -577,9 +581,27 @@ ipcMain.on(Constants.IPC_Get_Config_Template, (event, data) => { }); ipcMain.on(Constants.IPC_Get_Platform, (event) => { - event.sender.send(Constants.IPC_Get_Platform_Reply, { - data: os.platform() - }); + let platform = os.platform(); + if (platform === 'linux') { + fs.writeFileSync('/tmp/repertory_detect_linux.sh', detectScript); + helpers + .executeScript('/tmp/repertory_detect_linux.sh') + .then(data => { + platform = data.replace(/(\r\n|\n|\r)/gm,""); + event.sender.send(Constants.IPC_Get_Platform_Reply, { + data: platform, + }); + }) + .catch(() => { + event.sender.send(Constants.IPC_Get_Platform_Reply, { + data: platform, + }); + }); + } else { + event.sender.send(Constants.IPC_Get_Platform_Reply, { + data: platform, + }); + } }); ipcMain.on(Constants.IPC_Get_State, (event, data) => { diff --git a/helpers.js b/helpers.js index e494960..945f2fa 100644 --- a/helpers.js +++ b/helpers.js @@ -156,6 +156,37 @@ module.exports.executeAsync = (command, args=[]) => { }); }; +module.exports.executeScript = script => { + return new Promise((resolve, reject) => { + const processOptions = { + detached: false, + shell: true, + windowsHide: true, + }; + + const command = '/bin/sh'; + const args = [ + script + ]; + + const process = new spawn(command, args, processOptions); + let result = ''; + + process.on('error', (err) => { + reject(err); + }); + + process.stdout.on('data', (d)=> { + result += d; + }); + + process.on('exit', () => { + resolve(result); + }); + process.unref(); + }); +}; + module.exports.executeMount = (directory, version, storageType, location, noConsoleSupported, exitCallback) => { return new Promise((resolve) => { const processOptions = { diff --git a/public/detect_linux.sh b/public/detect_linux.sh new file mode 100644 index 0000000..65009d0 --- /dev/null +++ b/public/detect_linux.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +DISTNAME=unknown +DISTVER= + +if [ -f /etc/solus-release ]; then + DISTNAME=solus +elif [ -f /etc/lsb-release ]; then + . /etc/lsb-release + DISTNAME=$(echo ${DISTRIB_ID} | awk '{print tolower($0)}') + DISTVER=${DISTRIB_RELEASE} +elif [ -f /etc/debian_version ]; then + DISTNAME=debian + DISTVER=$(head -1 /etc/debian_version) +fi + +echo ${DISTNAME}${DISTVER} diff --git a/src/constants.js b/src/constants.js index 672b660..86683ff 100644 --- a/src/constants.js +++ b/src/constants.js @@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { }); exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/1.0.0-beta_branch/releases.json'; exports.DATA_LOCATIONS = { + debian: '~/.local/repertory/ui', linux: '~/.local/repertory/ui', + solus: '~/.local/repertory/ui', + 'ubuntu18.04': '~/.local/repertory/ui', + 'ubuntu18.10': '~/.local/repertory/ui', + 'ubuntu19.04': '~/.local/repertory/ui', darwin: '~/Library/Application Support/repertory/ui', win32: '%LOCALAPPDATA%\\repertory\\ui' }; -exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/1.0.0-beta_branch/releases.json'; +exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/1.0.3_branch/releases.json'; exports.PROVIDER_LIST = [ 'Hyperspace', From b75868e883c7ee0715ebd7327ba3b7c1b5b63ce5 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 03:03:24 -0500 Subject: [PATCH 005/122] Solus Linux detection --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bc64bbf..126cb0d 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,8 @@ "./src/constants.js", "build/**/*", "node_modules/**/*", - "./helpers.js" + "./helpers.js", + "./public/detect_linux.sh" ], "linux": { "category": "Utility", From 9207d6af3feded8b93f073ab0332bdda56e5bea9 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 18:02:51 -0500 Subject: [PATCH 006/122] Debian support --- public/detect_linux.sh | 2 +- src/constants.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/detect_linux.sh b/public/detect_linux.sh index 65009d0..a9e6010 100644 --- a/public/detect_linux.sh +++ b/public/detect_linux.sh @@ -11,7 +11,7 @@ elif [ -f /etc/lsb-release ]; then DISTVER=${DISTRIB_RELEASE} elif [ -f /etc/debian_version ]; then DISTNAME=debian - DISTVER=$(head -1 /etc/debian_version) + DISTVER=$(head -1 /etc/debian_version|awk -F. '{print $1}') fi echo ${DISTNAME}${DISTVER} diff --git a/src/constants.js b/src/constants.js index 86683ff..5c9655c 100644 --- a/src/constants.js +++ b/src/constants.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/1.0.0-beta_branch/releases.json'; exports.DATA_LOCATIONS = { - debian: '~/.local/repertory/ui', + debian9: '~/.local/repertory/ui', linux: '~/.local/repertory/ui', solus: '~/.local/repertory/ui', 'ubuntu18.04': '~/.local/repertory/ui', From 8da3f86b87f64bbe05eae00d8f430f8ee77b8923 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 19:09:11 -0500 Subject: [PATCH 007/122] Linux Mint 19/19.1 support --- CHANGELOG.md | 2 ++ public/detect_linux.sh | 6 ++++++ releases.json | 3 +++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa34878..faf067a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.0.3 ## * Linux distribution support * Debian 9 + * Linux Mint 19 + * Linux Mint 19.1 * Solus * Ubuntu 18.04 * Ubuntu 18.10 diff --git a/public/detect_linux.sh b/public/detect_linux.sh index a9e6010..8d9ed60 100644 --- a/public/detect_linux.sh +++ b/public/detect_linux.sh @@ -9,6 +9,12 @@ elif [ -f /etc/lsb-release ]; then . /etc/lsb-release DISTNAME=$(echo ${DISTRIB_ID} | awk '{print tolower($0)}') DISTVER=${DISTRIB_RELEASE} + if [ "$DISTNAME" = "linuxmint" ]; then + if [ "$DISTVER" = "19" ] || [ "$DISTVER" = "19.1" ]; then + DISNAME=ubuntu + DISTVER=18.04 + fi + fi elif [ -f /etc/debian_version ]; then DISTNAME=debian DISTVER=$(head -1 /etc/debian_version|awk -F. '{print $1}') diff --git a/releases.json b/releases.json index 81d5a32..1e54fa1 100644 --- a/releases.json +++ b/releases.json @@ -41,6 +41,9 @@ "darwin": [ "1.0.3", "1.0.2" + ], + "unknown": [ + "unavailable" ] } } \ No newline at end of file From c7f9ec278ee1d0f5f0b439ff028a40dca386afe9 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 7 Apr 2019 19:15:22 -0500 Subject: [PATCH 008/122] Updated README --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 00fb529..85b86de 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,11 @@ Repertory allows you to mount Sia, SiaPrime and/or Hyperspace blockchain storage # Supported Platforms # * OS X 64-bit * Windows 64-bit -* Linux 64-bit \ No newline at end of file +* Linux 64-bit Distributions: + * Debian 9 + * Linux Mint 19 + * Linux Mint 19.1 + * Solus + * Ubuntu 18.04 + * Ubuntu 18.10 + * Ubuntu 19.04 \ No newline at end of file From 9ad2f798da443fb2047a7277cb41a1f4864665ba Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Mon, 8 Apr 2019 18:41:39 -0500 Subject: [PATCH 009/122] Set default release type to Beta --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index a169f40..a289d89 100644 --- a/src/App.js +++ b/src/App.js @@ -65,7 +65,7 @@ class App extends IPCContainer { LocationsLookup: {}, MissingDependencies: [], MountsBusy: false, - Release: 3, + Release: 2, ReleaseTypes: [ 'Release', 'RC', From 177fd97c4b7817262bed6b5f1f6ef68e2bb39d5b Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Mon, 8 Apr 2019 23:07:08 -0500 Subject: [PATCH 010/122] Try to fix screen resolution issue --- src/components/UI/Grid/Grid.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/UI/Grid/Grid.js b/src/components/UI/Grid/Grid.js index ad92a61..cf4855b 100644 --- a/src/components/UI/Grid/Grid.js +++ b/src/components/UI/Grid/Grid.js @@ -7,8 +7,13 @@ export default CSSModules(class extends Component { constructor(props) { super(props); window.addEventListener("resize", this.updateSizeAsync); + this.checkSizeInterval = setInterval(()=> { + this.updateSize() + }, 2000); } + checkSizeInterval; + state = { calculated: false, dimensions: { @@ -59,6 +64,7 @@ export default CSSModules(class extends Component { componentWillUnmount = () => { window.removeEventListener("resize", this.updateSizeAsync); + clearInterval(this.checkSizeInterval); }; render() { From 35a38977b6e5ef55a6e065ca5ce492baa7a42642 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 9 Apr 2019 12:18:57 -0500 Subject: [PATCH 011/122] Removed react-css-modules --- CHANGELOG.md | 1 + config/env.js | 93 ------ config/jest/cssTransform.js | 14 - config/jest/fileTransform.js | 12 - config/paths.js | 55 ---- config/polyfills.js | 22 -- config/webpack.config.dev.js | 251 --------------- config/webpack.config.prod.js | 291 ------------------ config/webpackDevServer.config.js | 95 ------ package.json | 118 ++----- scripts/build.js | 150 --------- scripts/start.js | 107 ------- scripts/test.js | 27 -- src/App.css | 6 +- src/App.js | 13 +- .../ConfigurationItem/ConfigurationItem.css | 6 +- .../ConfigurationItem/ConfigurationItem.js | 25 +- .../DependencyList/Dependency/Dependency.css | 2 +- .../DependencyList/Dependency/Dependency.js | 12 +- .../DependencyList/DependencyList.js | 7 +- .../DownloadProgress/DownloadProgress.js | 7 +- src/components/ErrorDetails/ErrorDetails.css | 4 +- src/components/ErrorDetails/ErrorDetails.js | 12 +- src/components/MountItem/MountItem.css | 2 +- src/components/MountItem/MountItem.js | 9 +- .../ReleaseVersionDisplay.js | 7 +- src/components/UI/Box/Box.css | 8 +- src/components/UI/Box/Box.js | 9 +- src/components/UI/Button/Button.js | 9 +- src/components/UI/DropDown/DropDown.css | 12 +- src/components/UI/DropDown/DropDown.js | 13 +- src/components/UI/Grid/Grid.js | 18 +- .../UI/Grid/GridComponent/GridComponent.js | 9 +- src/components/UI/Loading/Loading.css | 2 +- src/components/UI/Loading/Loading.js | 11 +- src/components/UI/Modal/Modal.css | 4 +- src/components/UI/Modal/Modal.js | 17 +- src/components/UI/Text/Text.css | 8 +- src/components/UI/Text/Text.js | 14 +- src/components/UpgradeIcon/UpgradeIcon.css | 2 +- src/components/UpgradeIcon/UpgradeIcon.js | 11 +- src/components/UpgradeUI/UpgradeUI.js | 7 +- src/containers/Configuration/Configuration.js | 9 +- src/containers/MountItems/MountItems.js | 7 +- src/index.js | 4 +- ...isterServiceWorker.js => serviceWorker.js} | 74 +++-- 46 files changed, 201 insertions(+), 1395 deletions(-) delete mode 100644 config/env.js delete mode 100644 config/jest/cssTransform.js delete mode 100644 config/jest/fileTransform.js delete mode 100644 config/paths.js delete mode 100644 config/polyfills.js delete mode 100644 config/webpack.config.dev.js delete mode 100644 config/webpack.config.prod.js delete mode 100644 config/webpackDevServer.config.js delete mode 100644 scripts/build.js delete mode 100644 scripts/start.js delete mode 100644 scripts/test.js rename src/{registerServiceWorker.js => serviceWorker.js} (56%) diff --git a/CHANGELOG.md b/CHANGELOG.md index faf067a..aca636a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Ubuntu 18.04 * Ubuntu 18.10 * Ubuntu 19.04 +* Removed `react-css-modules` dependency ## 1.0.2 ## * Option to launch application hidden (notification icon only) diff --git a/config/env.js b/config/env.js deleted file mode 100644 index 30a6c7f..0000000 --- a/config/env.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const paths = require('./paths'); - -// Make sure that including paths.js after env.js will read .env variables. -delete require.cache[require.resolve('./paths')]; - -const NODE_ENV = process.env.NODE_ENV; -if (!NODE_ENV) { - throw new Error( - 'The NODE_ENV environment variable is required but was not specified.' - ); -} - -// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use -var dotenvFiles = [ - `${paths.dotenv}.${NODE_ENV}.local`, - `${paths.dotenv}.${NODE_ENV}`, - // Don't include `.env.local` for `test` environment - // since normally you expect tests to produce the same - // results for everyone - NODE_ENV !== 'test' && `${paths.dotenv}.local`, - paths.dotenv, -].filter(Boolean); - -// Load environment variables from .env* files. Suppress warnings using silent -// if this file is missing. dotenv will never modify any environment variables -// that have already been set. Variable expansion is supported in .env files. -// https://github.com/motdotla/dotenv -// https://github.com/motdotla/dotenv-expand -dotenvFiles.forEach(dotenvFile => { - if (fs.existsSync(dotenvFile)) { - require('dotenv-expand')( - require('dotenv').config({ - path: dotenvFile, - }) - ); - } -}); - -// We support resolving modules according to `NODE_PATH`. -// This lets you use absolute paths in imports inside large monorepos: -// https://github.com/facebookincubator/create-react-app/issues/253. -// It works similar to `NODE_PATH` in Node itself: -// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders -// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored. -// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims. -// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421 -// We also resolve them to make sure all tools using them work consistently. -const appDirectory = fs.realpathSync(process.cwd()); -process.env.NODE_PATH = (process.env.NODE_PATH || '') - .split(path.delimiter) - .filter(folder => folder && !path.isAbsolute(folder)) - .map(folder => path.resolve(appDirectory, folder)) - .join(path.delimiter); - -// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be -// injected into the application via DefinePlugin in Webpack configuration. -const REACT_APP = /^REACT_APP_/i; - -function getClientEnvironment(publicUrl) { - const raw = Object.keys(process.env) - .filter(key => REACT_APP.test(key)) - .reduce( - (env, key) => { - env[key] = process.env[key]; - return env; - }, - { - // Useful for determining whether we’re running in production mode. - // Most importantly, it switches React into the correct mode. - NODE_ENV: process.env.NODE_ENV || 'development', - // Useful for resolving the correct path to static assets in `public`. - // For example, . - // This should only be used as an escape hatch. Normally you would put - // images into the `src` and `import` them in code to get their paths. - PUBLIC_URL: publicUrl, - } - ); - // Stringify all values so we can feed into Webpack DefinePlugin - const stringified = { - 'process.env': Object.keys(raw).reduce((env, key) => { - env[key] = JSON.stringify(raw[key]); - return env; - }, {}), - }; - - return { raw, stringified }; -} - -module.exports = getClientEnvironment; diff --git a/config/jest/cssTransform.js b/config/jest/cssTransform.js deleted file mode 100644 index 8f65114..0000000 --- a/config/jest/cssTransform.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -// This is a custom Jest transformer turning style imports into empty objects. -// http://facebook.github.io/jest/docs/en/webpack.html - -module.exports = { - process() { - return 'module.exports = {};'; - }, - getCacheKey() { - // The output is always the same. - return 'cssTransform'; - }, -}; diff --git a/config/jest/fileTransform.js b/config/jest/fileTransform.js deleted file mode 100644 index 9e4047d..0000000 --- a/config/jest/fileTransform.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const path = require('path'); - -// This is a custom Jest transformer turning file imports into filenames. -// http://facebook.github.io/jest/docs/en/webpack.html - -module.exports = { - process(src, filename) { - return `module.exports = ${JSON.stringify(path.basename(filename))};`; - }, -}; diff --git a/config/paths.js b/config/paths.js deleted file mode 100644 index 6d16efc..0000000 --- a/config/paths.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const path = require('path'); -const fs = require('fs'); -const url = require('url'); - -// Make sure any symlinks in the project folder are resolved: -// https://github.com/facebookincubator/create-react-app/issues/637 -const appDirectory = fs.realpathSync(process.cwd()); -const resolveApp = relativePath => path.resolve(appDirectory, relativePath); - -const envPublicUrl = process.env.PUBLIC_URL; - -function ensureSlash(path, needsSlash) { - const hasSlash = path.endsWith('/'); - if (hasSlash && !needsSlash) { - return path.substr(path, path.length - 1); - } else if (!hasSlash && needsSlash) { - return `${path}/`; - } else { - return path; - } -} - -const getPublicUrl = appPackageJson => - envPublicUrl || require(appPackageJson).homepage; - -// We use `PUBLIC_URL` environment variable or "homepage" field to infer -// "public path" at which the app is served. -// Webpack needs to know it to put the right