Skip to content

Conversation

muffinresearch
Copy link
Contributor

@muffinresearch muffinresearch commented Apr 28, 2016

Fixes mozilla/addons#9569
Fixes mozilla/addons#9565
Fixes mozilla/addons#9559

  • Clearly separates the client and server config - since on the client the client module is pointing at client-config which is just exposes only the conf keys set as clientConfigKeys in the main config.
  • Sets up differences for dev/stage/production and developement
  • fixes imports for test helpers
  • Moves webpack config out of /src
  • Fixed up all imports using ../ etc
  • Added a catch clause to the server so when the promise blows up we see a stack trace and get a 500 error. Making the 500 nicer will come later.

@jasonthomas this will need some modifcations to the deployment since you'll need to specify NODE_ENV in the deploy scripts after this lands.

e.g:

NODE_ENV=dev npm run build:disco 
NODE_ENV=dev npm run start:disco

Replacing dev with stage or production for the other cases and disco with search for the search app deployment.

const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const webpackDevConfig = require('config/webpack.dev.config.babel').default;
const webpackDevConfig = require('../webpack.dev.config.babel').default;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably work without ../ following recent changes.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling bd61c07 on muffinresearch:refactor-config into 228e1d1 on mozilla:master.

import SriStatsPlugin from 'sri-stats-webpack-plugin';

import config from './index';
const config = require('config');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be an import, I'll clean that up in due course.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 558ffd9 on muffinresearch:refactor-config into 228e1d1 on mozilla:master.

@@ -0,0 +1,79 @@
// CONFIG defaults (aka PRODUCTION)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On other projects we've made development the default. I guess since this is still no-configuration-needed for development having production default is cool?

Copy link
Contributor Author

@muffinresearch muffinresearch Apr 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I feel it's a better way around to have production config happen if you don't override something than to have development config if you don't override something.

@mstriemer mstriemer closed this in 5552ca9 Apr 29, 2016
module.exports = {
serverPort: 3000,

apiHost: 'https://addons-dev.allizom.org',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this to:

apiHost: process.env.API_HOST || 'https://addons-dev.allizom.org',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that needs to be done differently to use the proper node-config way. I'll update #298.

@muffinresearch muffinresearch deleted the refactor-config branch April 3, 2019 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to configure stage and -dev Consider moving the webpack config Improve the import for the test utils
3 participants