Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Update dependencies #26

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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