Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4450 from withspectrum/2.5.0
Browse files Browse the repository at this point in the history
2.5.0
  • Loading branch information
brianlovin authored Dec 11, 2018
2 parents 0d3b296 + 6275852 commit 056de72
Show file tree
Hide file tree
Showing 402 changed files with 14,228 additions and 29,405 deletions.
49 changes: 0 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ aliases:
- &save-yarn-cache
paths:
- node_modules
- mobile/node_modules
- ~/.cache/yarn
key: v1-yarn-{{ arch }}-{{ checksum "package.json" }}

- &yarn
|
yarn
cd ./mobile && yarn && yarn setup && cd ..
cd ./desktop && yarn && cd ..

- &install-rethinkdb
Expand Down Expand Up @@ -65,11 +63,6 @@ js_defaults: &js_defaults
docker:
- image: circleci/node:8

macos_defaults: &macos_defaults
<<: *defaults
macos:
xcode: "9.2.0"

version: 2
jobs:

Expand Down Expand Up @@ -155,41 +148,6 @@ jobs:
name: Run ESLint
command: yarn run lint

# Tests js of the mobile app
test_mobile_js:
<<: *js_defaults
steps:
- attach_workspace:
at: ~/spectrum
- run: cd ./mobile && yarn test:unit

# Tests native code of the mobile app
test_mobile_native:
<<: *macos_defaults
steps:
- attach_workspace:
at: ~/spectrum
- run:
name: Install Expo CLI
command: npm install -g exp
- run:
name: Install Detox dependencies
command: |
brew tap wix/brew
brew install applesimutils --HEAD
npm install -g detox-cli
- run:
name: Rebuild Detox frameworks
command: |
cd ./mobile
detox clean-framework-cache
detox build-framework-cache
- run:
name: Start Packager in the background
command: cd ./mobile && exp start
background: true
- run: cd ./mobile && yarn test:e2e

workflows:
version: 2

Expand All @@ -198,13 +156,6 @@ workflows:
- checkout_environment

# Testing
- test_mobile_js:
requires:
- checkout_environment
# Disabled as Expo is fixing their critical issue with Detox
# - test_mobile_native:
# requires:
# - checkout_environment
- test_web:
requires:
- checkout_environment
Expand Down
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ test-extend.js
stats.json
iris/.env
api/.env
.expo
mobile/.expo
test-results.json
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'no-undef': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-unused-vars': 0,
'no-empty': 1,
'no-empty': 0,
'no-useless-escape': 1,
'no-fallthrough': 1,
'no-extra-boolean-cast': 1,
Expand Down
9 changes: 1 addition & 8 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
[ignore]
.*/build.*
.*/*.test.js
.*/.expo
.*/node_modules/expo
.*/node_modules/react-native
.*/node_modules/cypress
.*/node_modules/draft-js
.*/node_modules/graphql
.*/node_modules/protobufjs-no-cli
.*/node_modules/react-navigation
.*/node_modules/reqwest
.*/node_modules/sentry-expo
.*/node_modules/react-apollo
.*/node_modules/dataloader
<PROJECT_ROOT>/node_modules/*
<PROJECT_ROOT>/email-template-scripts/*

[options]
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowIssue
esproposal.class_instance_fields=enable
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=.
module.file_ext=.ios.js
module.file_ext=.android.js
module.file_ext=.native.js
module.file_ext=.web.js
module.file_ext=.js
module.file_ext=.jsx
Expand Down
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- mercury
- hermes
- chronos
- mobile
- analytics

**Run database migrations (delete if no migration was added)**
Expand All @@ -25,5 +24,5 @@ YES
**Related issues (delete if you don't know of any)**
Closes #

<!-- If there are UI changes please share mobile and desktop screenshots or recordings. -->
<!-- If there are UI changes please share mobile-responsive and desktop screenshots or recordings. -->

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ test-extend.js
stats.json
iris/.env
api/.env
.expo
mobile/.expo
test-results.json
desktop/release
public/uploads
Expand Down
46 changes: 46 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This is used by now when deploying hyperion, replacing .gitignore
# NOTE(@mxstbr): The important change is that `cacert` is NOT ignored!
node_modules
.sass-cache
npm-debug.log
build
.DS_Store
src/config/FirebaseConfig.js
npm-debug.log
yarn-error.log
rethinkdb_data
debug
now-secrets.json
build-iris
build-api
build-athena
build-hermes
build-chronos
build-mercury
build-vulcan
build-hyperion
build-electron
build-analytics
package-lock.json
.vscode
dump.rdb
*.swp
queries-by-response-size.js
queries-by-time.js
test-extend.js
stats.json
iris/.env
api/.env
test-results.json
public/uploads
cypress/screenshots/
cypress/videos/

# This is hyperion-now-specific, do not copy to .gitignore
desktop
docs
cypress
admin
.circleci
.github

39 changes: 9 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Want to fix a bug or implement an agreed-upon feature? Great, jump to the [local

With the ground rules out of the way, let's talk about the coarse architecture of this mono repo:

- **Full-stack JavaScript**: We use Node.js to power our servers, and React to power our frontend and mobile apps. Almost all of the code you'll touch in this codebase will be JavaScript.
- **Full-stack JavaScript**: We use Node.js to power our servers, and React to power our frontend apps. Almost all of the code you'll touch in this codebase will be JavaScript.
- **Background Jobs**: We leverage background jobs (powered by [`bull`](https://github.com/OptimalBits/bull) and Redis) a lot. These jobs are handled by a handful of small worker servers, each with its own purpose.

Here is a list of all the big technologies we use:
Expand All @@ -93,8 +93,7 @@ Here is a list of all the big technologies we use:
- **GraphQL**: API, powered by the entire Apollo toolchain
- **Flowtype**: Type-safe JavaScript
- **PassportJS**: Authentication
- **React**: Frontend and mobile apps
- **Expo**: Mobile apps
- **React**: Frontend React app
- **DraftJS**: WYSIWYG writing experience on the web

#### Folder structure
Expand All @@ -110,7 +109,6 @@ spectrum/
├── hermes # Worker server (email sending)
├── hyperion # Server rendering server
├── mercury # Worker server (reputation)
├── mobile # Mobile apps
├── public # Public files used on the frontend
├── shared # Shared JavaScript code
├── src # Frontend SPA
Expand Down Expand Up @@ -257,31 +255,12 @@ To develop the desktop app you have to have the dev web server running in the ba
yarn run dev:desktop
```

#### Develop the mobile apps
> Note: If something didn't work or you ran into troubles please submit PRs to improve this doc and keep it up to date!
To start the mobile apps run:
<br />
<div align="center">
<img height="200px" src="public/img/connect.svg" />
</div>

```
yarn run dev:mobile
```

And then open either the iOS simulator or the Android simulator with

```sh
yarn run open:ios
# or
yarn run open:android
```

Refer to [the Expo documentation on how to install the simulators](https://docs.expo.io/versions/v25.0.0/guides/debugging.html#using-a-simulator--emulator).

> Note: If something didn't work or you ran into troubles please submit PRs to improve this doc and keep it up to date!
<br />
<div align="center">
<img height="200px" src="public/img/connect.svg" />
</div>

## License

BSD 3-Clause, see the [LICENSE](./LICENSE) file.
## License
BSD 3-Clause, see the [LICENSE](./LICENSE) file.
3 changes: 2 additions & 1 deletion analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"dependencies": {
"amplitude": "^3.5.0",
"aws-sdk": "^2.354.0",
"aws-sdk": "^2.373.0",
"bull": "3.3.10",
"debug": "^4.1.0",
"faker": "^4.1.0",
Expand All @@ -16,6 +16,7 @@
"raven": "^2.6.4",
"redis-tag-cache": "^1.2.1",
"rethinkdbdash": "^2.3.29",
"rethinkhaberdashery": "^2.3.32",
"sanitize-filename": "^1.6.1",
"sha1": "^1.1.1",
"source-map-support": "^0.5.9",
Expand Down
15 changes: 11 additions & 4 deletions analytics/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=

aws-sdk@^2.354.0:
version "2.358.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.358.0.tgz#d2b0449711640f764029c35381d1a6ebdeababe9"
integrity sha512-nS47i+YecWDAy3JE55GrC2dLbWsc5lqIub8y+VgHPoVI11f/wmWpF1kY+8FD20IGbZQHWiqiMdMZjFS86L1w6g==
aws-sdk@^2.373.0:
version "2.373.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.373.0.tgz#fcc5606634b3b11d80810ad252d1b52b3733d780"
integrity sha512-NZYXwXGtFt9jxaKXc+PJsLPnpbD03t0MAZRxh93g36kbFMuRXtY8CDqHYNQ0ZcrgQpXbCQiz1fxT5/wu5Cu70g==
dependencies:
buffer "4.9.1"
events "1.1.1"
Expand Down Expand Up @@ -513,6 +513,13 @@ rethinkdbdash@^2.3.29:
dependencies:
bluebird ">= 3.0.1"

rethinkhaberdashery@^2.3.32:
version "2.3.32"
resolved "https://registry.yarnpkg.com/rethinkhaberdashery/-/rethinkhaberdashery-2.3.32.tgz#ddcc4ba1342e653a9d3bb6982b526087e93d537e"
integrity sha512-scDswDEu7R47WqomjScq46LkCdhaFhpaGQDP3P44GDF32iCFgYbsL4fnJdaieE115qLeinRhEjna08XWCtV0iQ==
dependencies:
bluebird ">= 3.0.1"

safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
Expand Down
11 changes: 10 additions & 1 deletion api/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,16 @@ const init = () => {
// 1
// if the user already has a githubProviderId, don't override it
if (req.user.githubProviderId) {
if (!req.user.githubUsername) {
/*
Update the cached content of the github profile that we store
in redis for the graphql resolver. This allows us to put a button
on the client for a user to re-connect a github profile from
the web app which will update the cache with any changed usernames
*/
if (
!req.user.githubUsername ||
req.user.githubUsername !== githubUsername
) {
return saveUserProvider(
req.user.id,
'githubProviderId',
Expand Down
Loading

0 comments on commit 056de72

Please sign in to comment.