Skip to content

Commit

Permalink
build: Update dependencies
Browse files Browse the repository at this point in the history
Related to #24
and #23
  • Loading branch information
germanattanasio committed Jul 6, 2021
1 parent 517929e commit 11337fa
Show file tree
Hide file tree
Showing 34 changed files with 17,926 additions and 12,635 deletions.
10 changes: 8 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"plugins": ["@babel/syntax-dynamic-import"],
"presets": [
"react",
"es2015"
[
"@babel/preset-env",
{
"modules": false
}
],
["@babel/preset-react"]
]
}
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ASSISTANT_ID=
ASSISTANT_IAM_APIKEY=
ASSISTANT_URL=
ASSISTANT_IAM_APIKEY=
ASSISTANT_AUTH_TYPE=
16 changes: 7 additions & 9 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
env:
es6: true
es2021: true
node: true
extends: airbnb
globals:
Atomics: readonly
SharedArrayBuffer: readonly
extends:
- 'plugin:react/recommended'
- airbnb
- prettier
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 2018
sourceType: script
plugins:
- react
ecmaVersion: 12
sourceType: module
rules: {}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"trailingComma": "none"
}
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
dist: xenial
node_js: '12'
dist: trusty
node_js: '14'
cache:
directories:
- node_modules
Expand All @@ -13,7 +13,6 @@ env:
- B_DOMAIN=ng.bluemix.net
script:
- npm run build
- npm test

before_deploy:
- npm install -g bx-blue-green
Expand Down
55 changes: 18 additions & 37 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,37 @@ const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');

module.exports = (app) => {
module.exports = app => {
// parse cookies
app.use(cookieParser());

app.set('view engine', 'html');

// handle URLencoded and json params
app.use(bodyParser.urlencoded({
extended: true,
limit: '40mb',
}));
app.use(bodyParser.json({
limit: '40mb',
}));

if (process.env.NODE_ENV === 'production') {
// in production, serve gzipped js bundle
app.get('*.js', (req, res, next) => {
req.url = `${req.url}.gz`;
res.set('Content-Encoding', 'gzip');
res.set('Content-Type', 'application/javascript');
next();
});

// in production, serve gzipped css bundle
app.get('*.css', (req, res, next) => {
req.url = `${req.url}.gz`;
res.set('Content-Encoding', 'gzip');
res.set('Content-Type', 'text/css');
next();
});
}
app.use(
bodyParser.urlencoded({
extended: true,
limit: '40mb'
})
);
app.use(
bodyParser.json({
limit: '40mb'
})
);

// if we aren't in production we will use
// webpack dev middleware for dev server
if (process.env.NODE_ENV !== 'production') {
const webpackConfig = require('./webpack.config.dev.js'); // eslint-disable-line
const webpackConfig = require('../webpack.config.js')(); // eslint-disable-line
const webpackCompiler = webpack(webpackConfig);

app.use(webpackDevMiddleware(webpackCompiler, {
publicPath: webpackConfig.output.publicPath,
}));

// hot loading makes everything better
app.use(webpackHotMiddleware(webpackCompiler, {
reload: false,
}));
// if we are in production, serve dist as static
app.use(
webpackDevMiddleware(webpackCompiler, {
publicPath: webpackConfig.output.publicPath
})
);
} else {
app.use(express.static(path.resolve(__dirname, '..', 'dist')));
}
Expand Down
79 changes: 0 additions & 79 deletions config/webpack.config.common.js

This file was deleted.

28 changes: 0 additions & 28 deletions config/webpack.config.dev.js

This file was deleted.

62 changes: 0 additions & 62 deletions config/webpack.config.prod.js

This file was deleted.

Loading

0 comments on commit 11337fa

Please sign in to comment.