Skip to content

Commit

Permalink
Remove unnecessary dotenv dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jigsawye committed Mar 20, 2018
1 parent 21826f2 commit 75d0a29
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 68 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Expand Up @@ -18,5 +18,6 @@ jobs:
paths:
- node_modules
key: dependencies-{{ checksum "package.json" }}
- run: echo "SENTRY_DSN=${SENTRY_DSN}" >> .env
- run: echo "REACT_APP_SENTRY_DSN=${SENTRY_DSN}" >> .env
- run: echo "REACT_APP_VERSION=$npm_package_version" >> .env
- run: yarn deploy
3 changes: 2 additions & 1 deletion .env.example
@@ -1 +1,2 @@
SENTRY_DSN=YOUR_SENTRY_DSN
REACT_APP_SENTRY_DSN=YOUR_SENTRY_DSN
REACT_APP_VERSION=$npm_package_version
7 changes: 0 additions & 7 deletions config-overrides.js
@@ -1,6 +1,4 @@
require('dotenv').config();
const { injectBabelPlugin } = require('react-app-rewired');
const rewireDefinePlugin = require('react-app-rewire-define-plugin');
const rewireEslint = require('react-app-rewire-eslint');

module.exports = function override(config, env) {
Expand All @@ -12,11 +10,6 @@ module.exports = function override(config, env) {

config = injectBabelPlugin(['lodash', { id: ['lodash', 'recompose'] }], config);

config = rewireDefinePlugin(config, env, {
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN),
'process.env.version': JSON.stringify(require('./package.json').version),
});

config = rewireEslint(config, env);

return config;
Expand Down
5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -15,7 +15,6 @@
"dependencies": {
"antd": "^3.3.0",
"copy-to-clipboard": "^3.0.8",
"eslint-config-airbnb": "^16.1.0",
"gh-pages": "^1.1.0",
"immer": "^1.2.0",
"lodash": "^4.17.5",
Expand All @@ -24,7 +23,6 @@
"raven-for-redux": "^1.3.0",
"raven-js": "^3.23.3",
"react": "^16.2.0",
"react-app-rewire-eslint": "^0.2.3",
"react-dom": "^16.2.0",
"react-markdown": "^3.3.0",
"react-redux": "^5.0.7",
Expand All @@ -47,8 +45,7 @@
"devDependencies": {
"babel-plugin-import": "^1.6.7",
"babel-plugin-lodash": "^3.3.2",
"dotenv": "^5.0.1",
"react-app-rewire-define-plugin": "^1.0.0",
"eslint-config-airbnb": "^16.1.0",
"react-app-rewired": "^1.5.0"
}
}
2 changes: 1 addition & 1 deletion src/components/About.jsx
Expand Up @@ -26,7 +26,7 @@ const aboutWebsite = `
若有能力也歡迎發 Pull Request 或是 Issue 討論。
### 改版訊息
當前版本: **${process.env.version}**
當前版本: **${process.env.REACT_APP_VERSION}**
完整改版訊息請參閱 [Github Releases](https://github.com/jigsawye/rosim/releases)。
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -12,7 +12,7 @@ import App from './components/App';
import { unregister } from './registerServiceWorker';
import loadDataFromUrl from './utils/loadDataFromUrl';

Raven.config(process.env.SENTRY_DSN).install();
Raven.config(process.env.REACT_APP_SENTRY_DSN).install();

const store = createStore(
reducer,
Expand Down
53 changes: 0 additions & 53 deletions yarn.lock
Expand Up @@ -76,10 +76,6 @@ ajv-keywords@^2.0.0, ajv-keywords@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"

ajv-keywords@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be"

ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
Expand All @@ -96,14 +92,6 @@ ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.0, ajv@^5.2.3:
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.3.0"

ajv@^6.1.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.0.tgz#afac295bbaa0152449e522742e4547c1ae9328d2"
dependencies:
fast-deep-equal "^1.0.0"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.3.0"

align-text@^0.1.1, align-text@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
Expand Down Expand Up @@ -2210,10 +2198,6 @@ dotenv@4.0.0, dotenv@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d"

dotenv@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"

draft-js@^0.10.0, draft-js@~0.10.0:
version "0.10.5"
resolved "https://registry.yarnpkg.com/draft-js/-/draft-js-0.10.5.tgz#bfa9beb018fe0533dbb08d6675c371a6b08fa742"
Expand Down Expand Up @@ -5971,16 +5955,6 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-app-rewire-define-plugin@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/react-app-rewire-define-plugin/-/react-app-rewire-define-plugin-1.0.0.tgz#e55f94ea3b23f9aac05dfc13ea4b19cf0033bb9d"
dependencies:
webpack "^3.6.0"

react-app-rewire-eslint@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/react-app-rewire-eslint/-/react-app-rewire-eslint-0.2.3.tgz#88e93d74569c33fe22185d46f6a2b521c4dd7fb6"

react-app-rewired@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/react-app-rewired/-/react-app-rewired-1.5.0.tgz#8889d2f9ae8d8af16b340ca5424ffd5a07d23af2"
Expand Down Expand Up @@ -7591,33 +7565,6 @@ webpack@3.8.1:
webpack-sources "^1.0.1"
yargs "^8.0.2"

webpack@^3.6.0:
version "3.11.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894"
dependencies:
acorn "^5.0.0"
acorn-dynamic-import "^2.0.0"
ajv "^6.1.0"
ajv-keywords "^3.1.0"
async "^2.1.2"
enhanced-resolve "^3.4.0"
escope "^3.6.0"
interpret "^1.0.0"
json-loader "^0.5.4"
json5 "^0.5.1"
loader-runner "^2.3.0"
loader-utils "^1.1.0"
memory-fs "~0.4.1"
mkdirp "~0.5.0"
node-libs-browser "^2.0.0"
source-map "^0.5.3"
supports-color "^4.2.1"
tapable "^0.2.7"
uglifyjs-webpack-plugin "^0.4.6"
watchpack "^1.4.0"
webpack-sources "^1.0.1"
yargs "^8.0.2"

websocket-driver@>=0.5.1:
version "0.7.0"
resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.0.tgz#0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb"
Expand Down

0 comments on commit 75d0a29

Please sign in to comment.