From f938a9068e6ecd5ec3eaa843377d8628d7cbeb2a Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Mon, 13 May 2019 10:06:57 +0200 Subject: [PATCH 1/5] add config to gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 2decfd291..319db37b5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ yarn-error.log* test/unit/coverage test/e2e/reports selenium-debug.log +config/*.js +!config/index.js +!config/default.env.js +!config/example.*.env.js # Editor directories and files .idea From 9bfe74507025cd9e0f52276d6c3c064b53fafada Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Mon, 13 May 2019 10:10:35 +0200 Subject: [PATCH 2/5] Create default.env.js --- config/default.env.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config/default.env.js diff --git a/config/default.env.js b/config/default.env.js new file mode 100644 index 000000000..d15f0a87d --- /dev/null +++ b/config/default.env.js @@ -0,0 +1,11 @@ +'use strict' +module.exports = { + NODE_ENV: '"development"', + TYPEKIT_ID: '"your-TYPEKIT_ID"', + MIDDLELAYER_API: '"http://localhost:3030"', + MIDDLELAYER_MEDIA_PATH: '"/media"', + MIDDLELAYER_API_PATH: '"/"', + MIDDLELAYER_API_SOCKET_PATH: '"/socket.io/"', + TAWK_TO_SITE_ID: false, + GITHUB_WIKI_HOME: '"https://path/to/home.md"', +}; From 4ba1071ae012b8badddc9e8674e9834c9f2144d3 Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Mon, 13 May 2019 10:11:15 +0200 Subject: [PATCH 3/5] add example config files for prod and dev environments --- config/example.dev.env.js | 9 +++++++++ config/example.prod.env.js | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 config/example.dev.env.js create mode 100644 config/example.prod.env.js diff --git a/config/example.dev.env.js b/config/example.dev.env.js new file mode 100644 index 000000000..06b5adc1a --- /dev/null +++ b/config/example.dev.env.js @@ -0,0 +1,9 @@ +'use strict' +const merge = require('webpack-merge') +const defaultEnv = require('./default.env') + +module.exports = merge(defaultEnv, { + TYPEKIT_ID: '""', // should be specified + TAWK_TO_SITE_ID: false, // if false then wont show + GITHUB_WIKI_HOME: '"https://raw.githubusercontent.com/wiki/path/to/wiki.md"', +}); diff --git a/config/example.prod.env.js b/config/example.prod.env.js new file mode 100644 index 000000000..79ed8e4b3 --- /dev/null +++ b/config/example.prod.env.js @@ -0,0 +1,15 @@ +'use strict' +const merge = require('webpack-merge') +const defaultEnv = require('./default.env') + +'use strict' +module.exports = { + NODE_ENV: '"production"', + TYPEKIT_ID: '"..."', + MIDDLELAYER_API: "https://"', + MIDDLELAYER_MEDIA_PATH: '"/media"', + MIDDLELAYER_API_PATH: '"/api"', + MIDDLELAYER_API_SOCKET_PATH: '"/api/socket.io/"', + TAWK_TO_SITE_ID: '"..."', + GITHUB_WIKI_HOME: '"https://raw.githubusercontent.com/wiki/path/to/wiki.md"', +}; From 38475f5ab433bbec683544ecbcb6d3e19b392103 Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Mon, 13 May 2019 10:12:13 +0200 Subject: [PATCH 4/5] remove prod and dev files --- config/dev.env.js | 11 ++--------- config/prod.env.js | 8 ++++---- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/config/dev.env.js b/config/dev.env.js index 75be8926b..32ccdee42 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -1,16 +1,9 @@ 'use strict' const merge = require('webpack-merge') -const prodEnv = require('./prod.env') +const defaultEnv = require('./default.env') -module.exports = merge(prodEnv, { - NODE_ENV: '"development"', +module.exports = merge(defaultEnv, { TYPEKIT_ID: '"egx1cmg"', - // MIDDLELAYER_API: '"https://impresso-project.ch"', - MIDDLELAYER_MEDIA_PATH: '"/alpha/media"', - MIDDLELAYER_API_PATH: '"/"', - MIDDLELAYER_API_SOCKET_PATH: '"/socket.io/"', - MIDDLELAYER_API: '"http://localhost:3030"', - // MIDDLELAYER_API_SOCKET_PATH: '"/socket.io/"', TAWK_TO_SITE_ID: false, // if false then wont show GITHUB_WIKI_HOME: '"https://raw.githubusercontent.com/wiki/impresso/impresso-frontend/Home.md"', }); diff --git a/config/prod.env.js b/config/prod.env.js index 0b47ed307..a77562d1e 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -2,10 +2,10 @@ module.exports = { NODE_ENV: '"production"', TYPEKIT_ID: '"egx1cmg"', - MIDDLELAYER_API: process.env.API_BASE_URL || '"https://impresso-project.ch"', - MIDDLELAYER_MEDIA_PATH: '"/alpha/media"', - MIDDLELAYER_API_PATH: '"/alpha/api"', - MIDDLELAYER_API_SOCKET_PATH: '"/alpha/api/socket.io/"', + MIDDLELAYER_API: '"https://impresso-project.ch"', + MIDDLELAYER_MEDIA_PATH: '"/app/media"', + MIDDLELAYER_API_PATH: '"/"', + MIDDLELAYER_API_SOCKET_PATH: '"/socket.io/"', TAWK_TO_SITE_ID: '"5c49872f51410568a1081bed"', GITHUB_WIKI_HOME: '"https://raw.githubusercontent.com/wiki/impresso/impresso-frontend/Home.md"', }; From 9c69fcf1757c736fa4d1f9d4943e1ea4d65d2688 Mon Sep 17 00:00:00 2001 From: Thijs van Beek Date: Mon, 13 May 2019 10:27:58 +0200 Subject: [PATCH 5/5] removed config/dev.env.js --- config/dev.env.js | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 config/dev.env.js diff --git a/config/dev.env.js b/config/dev.env.js deleted file mode 100644 index 32ccdee42..000000000 --- a/config/dev.env.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' -const merge = require('webpack-merge') -const defaultEnv = require('./default.env') - -module.exports = merge(defaultEnv, { - TYPEKIT_ID: '"egx1cmg"', - TAWK_TO_SITE_ID: false, // if false then wont show - GITHUB_WIKI_HOME: '"https://raw.githubusercontent.com/wiki/impresso/impresso-frontend/Home.md"', -});