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

Dev environment setup #2

Merged
merged 19 commits into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from 18 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
8 changes: 4 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"presets": [
"es2015",
"react"
"env",
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you typically have to pass some configuration options to env?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. Works out of the box

"react",
"stage-2"
],
"plugins": [
"transform-object-rest-spread",
plugins: [
"react-hot-loader/babel"
]
}
14 changes: 14 additions & 0 deletions .env.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To use these environment variables run `yarn run config`

# Used for absolute paths
NODE_PATH=src

# All environment variables need `REACT_APP_` as a prefix

# Firebase: Not all of these will be used, it just depends on what we enable
apiKey="apiKeyFromFirebase",
authDomain="authDomainFromFirebase",
databaseURL="databaseURLFromFirebase",
projectId="projectIdFromFirebase",
storageBucket="storageBucketFromFirebase",
messagingSenderId="messagingSenderIdFromFirebase"
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
**/*{.,-}min.js
/public
/config/**
registerServiceWorker.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there something about service workers that eslint disagrees with?

Copy link
Contributor Author

@ynigoreyes ynigoreyes Aug 10, 2018

Choose a reason for hiding this comment

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

Yeah, lines 2 and 3 are not needed anymore. The service worker is all over the place. It'm mainly so serve content offline. That is all is seems to do but that boilerplate from CRA. However, it is not styled in any way really, but i don't want to touch it since it is boilerplate from CRA

19 changes: 17 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@ module.exports = {
"env": {
"mocha": true,
"node": true,
"browser": true,
"browser": true
Copy link
Contributor

Choose a reason for hiding this comment

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

lol, you don't like commas on final lines? My linter typically does

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No i do like commas on the final lines, im just not sure as to why some did not have it to begin with. Usually it formats on save and fixes stuff like this but oops

},
"parser": "babel-eslint",
"plugins": ["chai-friendly"],
"rules": {
"no-unused-expressions": 0,
"no-control-regex": 0,
"keyword-spacing": 0,
"chai-friendly/no-unused-expressions": 2,

"import/no-extraneous-dependencies": 0,
"import/extensions": 0,
"import/no-unresolved": 0,
"import/prefer-default-export": 0,

"jsx-quotes": [2, "prefer-single"],

// For some reason, these lint errors came up and they were extreme style linting errors
"react/jsx-filename-extension": 0,
"react/destructuring-assignment": 0,
"react/no-access-state-in-setstate": 0,
"react/prefer-stateless-function": 0,
"react/jsx-one-expression-per-line": 0,
"react/jsx-wrap-multilines": 0,
"react/require-default-props": 0,
}
};
}
86 changes: 23 additions & 63 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,71 +1,31 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Docs
./docs/
# Jetbrains
.idea/

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# See https://help.github.com/ignore-files/ for more about ignoring files.

# Bower dependency directory (https://bower.io/)
bower_components
# dependencies
/node_modules

# node-waf configuration
.lock-wscript
# testing
/coverage

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/*.map
build/*.json
build/*.js
# production
/build
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be public now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well actually you want to version the public folder because that contains you index.html and the service worker. CRA builds from the public folder into the build folder. Yeah it through me off the first time too


# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
# Docs
/docs

# dotenv environment variables file
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# dbdatagen
devutils/dbdatagen/cpceed-firebase-admin-key.json
devutils/dbdatagen/gen-uids.json
devutils/dbdatagen/gen-script.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor
*.swp
.tern-project
.tern-config
.tern-port
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

18 changes: 0 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
language: node_js
node_js:
- "8"
- "node"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -17,13 +9,3 @@ cache:
- $HOME/.npm
script:
- npm test
- npm run docs
env:
- TRAVIS=travis CXX=g++-4.8
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
local_dir: docs/
on:
branch: master
13 changes: 0 additions & 13 deletions build/index.html

This file was deleted.

35 changes: 0 additions & 35 deletions common/logger.js

This file was deleted.

7 changes: 7 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const rewireReactHotLoader = require('react-app-rewire-hot-loader')
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need react-app-rewired at the moment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, for stateful hot reloading in the development env


/* config-overrides.js */
module.exports = function override (config, env) {
config = rewireReactHotLoader(config, env)
return config
};
59 changes: 0 additions & 59 deletions karma.conf.js

This file was deleted.

Loading