Skip to content

Commit abd1a5e

Browse files
author
vikasrohit
authored
Merge pull request #1704 from appirio-tech/dev
Promoting to Production
2 parents b53c0bd + 910a0b2 commit abd1a5e

File tree

248 files changed

+15739
-11279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+15739
-11279
lines changed

.build-info

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"rndkey":"\\þû\u001c±7åI–\u0007ïˆRªÞǤ¦\u0015Ц\u0007¥ç\u001e:ÄX)™P§","timestamp":"2018-02-17T13:13:13.277Z"}

.circleci/config.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 2
2+
jobs:
3+
test:
4+
docker:
5+
- image: circleci/node:8.9.4
6+
steps:
7+
- checkout
8+
- restore_cache:
9+
key: test-node-modules-{{ checksum "package-lock.json" }}
10+
- run: npm install
11+
- save_cache:
12+
key: test-node-modules-{{ checksum "package-lock.json" }}
13+
paths:
14+
- node_modules
15+
- run: npm run lint
16+
- run: npm run test
17+
- run: npm run build
18+
- persist_to_workspace:
19+
root: .
20+
paths:
21+
- dist
22+
23+
# Just tests commited code.
24+
deployDev:
25+
docker:
26+
- image: cibuilds/aws
27+
steps:
28+
- checkout
29+
- attach_workspace:
30+
at: ./workspace
31+
- run: ./deploy.sh DEV no-cache
32+
33+
deployProd:
34+
docker:
35+
- image: cibuilds/aws
36+
steps:
37+
- checkout
38+
- attach_workspace:
39+
at: ./workspace
40+
- run: ./deploy.sh PROD
41+
42+
workflows:
43+
version: 2
44+
build:
45+
jobs:
46+
- test
47+
- deployDev:
48+
requires:
49+
- test
50+
filters:
51+
branches:
52+
only: dev
53+
- deployProd:
54+
requires:
55+
- test
56+
filters:
57+
branches:
58+
only: master
59+

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"react/jsx-closing-bracket-location": 2,
2929
"jsx-quotes": [2, "prefer-double"],
3030
"react/jsx-boolean-value": 2,
31-
"react/wrap-multilines": 2,
31+
"react/jsx-wrap-multilines": 2,
3232
"react/self-closing-comp": 2,
3333
"react/no-is-mounted": 2
3434
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#### For folks working on this code base, we're ogaznizing coding style and general guidelines [here](https://github.com/appirio-tech/connect-app/wiki/Community-Work-Read-Me-First!).
1+
#### For folks working on this code base, we're organizing coding style and general guidelines [here](https://github.com/appirio-tech/connect-app/wiki/Community-Work-Read-Me-First!).
22

33
# TC Deployment Notes
44
_[TC Deployment Notes should always be kept up to date **on the default branch**. Update these notes when changes to this information occur]_

circle.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

config/babel/webpack-coffee.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Babel config for CoffeeScript only.
3+
*
4+
* We disable modules for `env` preset of `babel` for CoffeeScript to avoid error
5+
* 'Uncaught ReferenceError exports is not defined'
6+
*/
7+
const topCoderBabelConfig = require('topcoder-react-utils/config/babel/webpack')
8+
9+
const envPresetIndex = topCoderBabelConfig.presets.find((preset) => preset === 'env')
10+
topCoderBabelConfig.presets.splice(envPresetIndex, 1, ['env', { modules: false }])
11+
12+
module.exports = topCoderBabelConfig
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Function which is applied to webpack config from topcoder-react-utils
3+
* and perform some common modification specific to connect app which cannot be applied using
4+
* webpack merge.
5+
*/
6+
7+
module.exports = function (config) {
8+
/*
9+
Exclude some folders from babel-loader
10+
*/
11+
const jsxRule = config.module.rules.find(rule => /jsx/.test(rule.test.toString()))
12+
jsxRule.exclude = [
13+
/node_modules[\\/](?!appirio-tech.*|topcoder|tc-)/,
14+
/src[\\/]assets[\\/]fonts/
15+
]
16+
17+
/*
18+
Add babel-plugin-lodash to exclude full lodash lib and include only necessary methods
19+
*/
20+
jsxRule.options.plugins = (jsxRule.options.plugins || []).concat(['lodash'])
21+
22+
/*
23+
Include packages `appirio-tech-react-components` and `tc-ui`
24+
to `.scss` rule
25+
*/
26+
const scssRule = config.module.rules.find(rule => /scss/.test(rule.test.toString()))
27+
scssRule.exclude = /node_modules[\\/](?!appirio-tech-react-components|tc-ui)/
28+
29+
/*
30+
Remove outputPath as otherwise in development mode files cannot be found
31+
in the webpack in-memory filesystem
32+
TODO understand why it happens, fix it another way, remove this
33+
*/
34+
const imagesRule = config.module.rules.find(rule => /gif/.test(rule.test.toString()))
35+
delete imagesRule.options.outputPath
36+
37+
/*
38+
Remove outputPath as otherwise in development mode files cannot be found
39+
in the webpack in-memory filesystem
40+
TODO understand why it happens, fix it another way, remove this
41+
*/
42+
const fontsRule = config.module.rules.find(rule => /woff2/.test(rule.test.toString()))
43+
delete fontsRule.options.outputPath
44+
}

config/webpack/common.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/**
2+
* Common part of webpack config specific to connect app
3+
*
4+
* This config is merged to development and production configs
5+
* and is not supposed to be used directly by itself.
6+
*/
7+
'use strict'
8+
9+
const _ = require('lodash')
10+
const path = require('path')
11+
const webpack = require('webpack')
12+
const HtmlWebpackPlugin = require('html-webpack-plugin')
13+
const constants = require('../constants')
14+
15+
const dirname = path.resolve(__dirname, '../..')
16+
17+
module.exports = {
18+
/*
19+
Connect app has different output folder rather than topcoder-react-utils
20+
So update it
21+
*/
22+
output: {
23+
path: path.join(dirname, '/dist'),
24+
filename: '[name].[hash].js',
25+
chunkFilename: '[name].[hash].js',
26+
publicPath: '/'
27+
},
28+
29+
resolve: {
30+
/*
31+
Connect app depends on `appirio-tech-react-components` which uses
32+
CoffeeScript so we have to add support for these formats
33+
*/
34+
extensions: [
35+
'.coffee',
36+
'.litcoffee',
37+
'.cjsx'
38+
],
39+
alias: {
40+
/*
41+
Connect app uses handlebars which has some issue with webpack
42+
We have to create an alias to concrete file in order to import it
43+
*/
44+
handlebars: 'handlebars/dist/handlebars.min.js'
45+
}
46+
},
47+
48+
module: {
49+
rules: [{
50+
/*
51+
Connect app depends on `appirio-tech-react-components` which uses
52+
CoffeeScript so we have to add support for it
53+
54+
Note, that we use custom babel config for coffee script which disables modules
55+
*/
56+
test: /\.(coffee|litcoffee|cjsx)$/,
57+
use: [
58+
{
59+
loader: 'babel-loader',
60+
options: {
61+
babelrc: false,
62+
forceEnv: 'development', // by default set env to 'development'
63+
presets: [path.resolve(dirname, './config/babel/webpack-coffee.js')],
64+
plugins: ['lodash']
65+
}
66+
},
67+
'coffee-loader',
68+
'cjsx-loader'
69+
]
70+
}, {
71+
/*
72+
Load SVG files not handled by inline-react-svg babel plugin
73+
*/
74+
test: /\.svg$/,
75+
loader: 'file-loader'
76+
}],
77+
},
78+
79+
plugins: [
80+
/*
81+
Connect app has a custom html template file, so we use it
82+
*/
83+
new HtmlWebpackPlugin({
84+
template: path.join(dirname, '/src/index.html'),
85+
inject: 'body'
86+
}),
87+
88+
/*
89+
Connect app requires a lot of env vars which are defined in constants.
90+
*/
91+
new webpack.DefinePlugin({
92+
'process.env': _.mapValues(constants, (value) => JSON.stringify(value))
93+
}),
94+
95+
/*
96+
Remove some unused files to reduce bundle size
97+
*/
98+
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
99+
]
100+
}

0 commit comments

Comments
 (0)