Skip to content

Instantly share code, notes, and snippets.

@solomonhawk
Last active July 11, 2017 17:33
Show Gist options
  • Save solomonhawk/713ac831708c5cb572bc61710797efe8 to your computer and use it in GitHub Desktop.
Save solomonhawk/713ac831708c5cb572bc61710797efe8 to your computer and use it in GitHub Desktop.
Viget: New Project FED Setup

Babel:

Syntax:

  • ESLint
  • Prettier

Testing:

  • Unit:
    • Jest/Enzyme
  • Integration:
    • Nightmare

Continuous Integration:

  • CircleCI
{
"presets": [
["es2015", { "loose": true, "modules": false }],
"react",
"stage-2"
],
"plugins": [
["transform-runtime", { "polyfill": false }]
],
"env": {
"test": {
"plugins": [
"transform-es2015-modules-commonjs",
"dynamic-import-webpack"
]
},
"production": {
"presets": [
"react-optimize"
]
}
}
}
root = true
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
[Makefile]
indent_style = tab
[*.md]
trim_trailing_whitespace = false
{
"globals": {
"Promise": true,
"expect": true,
"jasmine": true
},
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
}
},
"settings": {
"import/ignore": ["node_modules"],
"import/extensions": [".js"],
"import/resolver": {
"node": {
"extensions": [".js", ".json", ".jsx"]
}
}
},
"extends": ["eslint:recommended"],
"plugins": [ "import", "jsx-a11y", "react", "jest" ],
"rules": {
"semi": [2, "never"],
"no-console": 0,
"no-debugger": 0,
"no-unused-vars" : [1, { "args": "none", "ignoreRestSiblings": true, "varsIgnorePattern": "^_" }],
"no-return-assign": "error",
"react/jsx-equals-spacing": ["warn", "never"],
"react/jsx-no-duplicate-props": ["warn", { "ignoreCase": true }],
"react/jsx-no-undef": "error",
"react/jsx-pascal-case": [
"warn",
{
"allowAllCaps": true,
"ignore": []
}
],
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/no-danger-with-children": "warn",
"react/no-deprecated": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-is-mounted": "warn",
"react/react-in-jsx-scope": "error",
"react/require-render-return": "warn",
"react/style-prop-object": "warn"
}
}
machine:
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
node:
version: 6.10.0
dependencies:
override:
- yarn
cache_directories:
- ~/.cache/yarn
test:
override:
- bash -e ./tasks/test.sh
- mkdir -p $CIRCLE_TEST_REPORTS/junit
- cp test-report.xml $CIRCLE_TEST_REPORTS/junit/test-results.xml
# TODO(shawk): update this file
# load the .env file
if [ ! "$CIRCLECI" == true ]; then
source .env
fi
BRANCH_NAME=$CIRCLE_BRANCH/
# make the values from .env available to the following commands
export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY
export AWS_DEFAULT_REGION
export NODE_ENV=production
export PUBLIC_PATH=/$BRANCH_NAME
# Perform a production mode webpack build
WEBPACK_OPTIONS="--output-public-path=$PUBLIC_PATH" make build
aws s3 sync build/smart-beta $SMART_BETA_S3_BUCKET_URL/$BRANCH_NAME
aws s3 sync build/asset-allocation $ASSET_ALLOCATION_S3_BUCKET_URL/$BRANCH_NAME
SBI_URL="http://ra-equities.s3-website-us-east-1.amazonaws.com/$BRANCH_NAME"
AA_URL="http://ra-asset-allocation.s3-website-us-east-1.amazonaws.com/$BRANCH_NAME"
LAST_COMMIT=$(git log -1 --pretty=%B)
curl -X POST -d "{\"text\":\"I just deployed $BRANCH_NAME. $LAST_COMMIT\", \"attachments\": [\
{\
\"title\": \"Smart Beta Interactive\",\
\"footer\":\"$SBI_URL\"
},
{\
\"title\": \"Asset Allocation\",\
\"footer\":\"$AA_URL\"
},
] }" "$SLACK_HOOK"
# Now that we've deployed, test against the production API
yarn test:lib
PUBLIC_PATH=$SBI_URL yarn test:sb
PUBLIC_PATH=$AA_URL yarn test:aa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment