Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit e9c7e0c

Browse files
committed
Merge branch 'master' into production
2 parents ff5489b + 7094284 commit e9c7e0c

Some content is hidden

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

55 files changed

+989
-807
lines changed

.babelrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@
44
"transform-runtime",
55
"add-module-exports",
66
"transform-decorators-legacy",
7-
"transform-react-display-name"
7+
"transform-react-display-name",
8+
["system-import-transformer", {"modules": "common"}]
89
],
910
"env": {
1011
"development": {
1112
"plugins": [
1213
"typecheck"
1314
]
15+
},
16+
"production": {
17+
"plugins": [
18+
"transform-react-inline-elements",
19+
"transform-react-constant-elements"
20+
]
1421
}
1522
}
1623
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ build
33
node_modules
44
/node_modules
55
static/dist
6+
dist
67
test-results.xml
78
npm-debug.log
9+
npm-debug.log.*
810
webpack-stats.json
911
webpack-assets.json
1012
bundle-stats.json
1113
selenium-debug.log
1214
tests/functional/output/*
1315
test/functional/screenshots/*
1416
.ssh
15-
webpack-stats.debug.json
17+
webpack-stats.debug.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-exact = true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.3.0

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
sudo: false
22
language: node_js
33
env: TEST_SUITE=unit
4-
node_js:
5-
- "5.6.0"
4+
# Node version is handled inside `.nvmrc` file & travis picks it up automatically because it uses `nvm`
5+
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Using-.nvmrc
66
cache:
77
directories:
88
- node_modules

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Found a problem? Want a new feature?
1414
Pull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits.
1515

1616
1. To begin, [fork this project], clone your fork, and add our [upstream].
17+
1718
```bash
1819
# Clone your fork of the repository into the current directory
1920
git clone https://github.com/<your-username>/quran.com-frontend
@@ -36,6 +37,7 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
3637
git push origin master
3738
```
3839
3. Create a branch for your feature or fix:
40+
3941
```bash
4042
# Move into a new branch for a feature
4143
git checkout -b feature/thing
@@ -46,6 +48,7 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
4648
```
4749

4850
4. Be sure your code follows our practices.
51+
4952
```bash
5053
# Test current code
5154
npm run test
@@ -58,6 +61,7 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
5861
```
5962

6063
5. To create a PR you need to push your branch to the origin(forked) remote and then press some buttons on GitHub:
64+
6165
```bash
6266
# Push a feature branch
6367
git push -u origin feature/thing

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ENV API_URL http://api.quran.com:3000
55
ENV SENTRY_KEY_CLIENT https://44c105328ae544ae9928f9eb74b40061@app.getsentry.com/80639
66
ENV SENTRY_KEY_SERVER https://44c105328ae544ae9928f9eb74b40061:41ca814d33124e04ab450104c3938cb1@app.getsentry.com/80639
77
ENV PORT 8000
8+
ENV NODE_PATH "./src"
89

910
RUN apt-get -y update && apt-get -y install supervisor ssh rsync
1011

@@ -17,15 +18,16 @@ RUN cp /etc/cron.daily/logrotate /etc/cron.hourly
1718
# cache npm install when package.json hasn't changed
1819
WORKDIR /tmp
1920
ADD package.json package.json
20-
RUN npm install
21+
RUN npm install --silent --no-progress
2122
RUN npm install -g pm2
2223

2324
RUN mkdir /quran
2425
RUN cp -a /tmp/node_modules /quran
2526

2627
WORKDIR /quran
2728
ADD . /quran/
28-
RUN npm run build
29+
RUN npm run build:client
30+
RUN npm run build:server
2931

3032
# ssh keys
3133
WORKDIR /root
@@ -38,5 +40,7 @@ RUN rsync --update --progress -raz . ahmedre@rsync.keycdn.com:zones/assets/
3840
# go back to /quran
3941
WORKDIR /quran
4042

43+
ENV NODE_PATH "./dist"
44+
4145
EXPOSE 8000
4246
CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisor/supervisord.conf"]

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To start the app, run `npm run dev` which will run both the server and the clien
2626

2727
## Backend
2828
Current at: https://github.com/quran/quran-api-rails
29-
DB is private, message me for acceess.
29+
DB is private, message me for access.
3030

3131

3232
## Design
@@ -40,8 +40,6 @@ subl bundle-stats.json #so that you can the output
4040
analyze-bundle-size bundle-stats.json
4141
```
4242

43-
## [View project issues on waffle.io...](https://waffle.io/quran/quran.com-frontend)
44-
4543
[Reactjs]: https://facebook.github.io/react/docs/getting-started.html
4644
[Redux]: http://redux.js.org/
4745
[Expressjs]: http://expressjs.com/en/starter/hello-world.html
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
require('dotenv').load();
22
require('app-module-path').addPath(__dirname);
3-
require('app-module-path').addPath('./src');
3+
require('app-module-path').addPath('../src');
44

55
var fs = require('fs');
6+
var path = require('path');
7+
var webpackIsomorphicTools = require('webpack-isomorphic-tools');
68
var babelrc = fs.readFileSync('./.babelrc');
9+
var rootDir = path.resolve(__dirname, '..');
710
var config;
811

912
try {
@@ -13,8 +16,6 @@ try {
1316
console.error(err);
1417
}
1518

16-
config.plugins.push(['system-import-transformer', {modules: 'common'}]);
17-
1819
require('babel-register')(config);
1920

2021
global.__CLIENT__ = false;
@@ -30,12 +31,8 @@ if (__DEVELOPMENT__) {
3031
}
3132
}
3233

33-
var webpackIsomorphicTools = require('webpack-isomorphic-tools');
34-
// this must be equal to your Webpack configuration "context" parameter
35-
var rootPath = require('path').resolve(__dirname, './')
36-
37-
global.webpack_isomorphic_tools = new webpackIsomorphicTools(require('./webpack/isomorphic-tools-configuration'))
34+
global.webpack_isomorphic_tools = new webpackIsomorphicTools(require('../webpack/isomorphic-tools-configuration'))
3835
.development(process.env.NODE_ENV === 'development')
39-
.server(rootPath, function() {
40-
require('./server.js')();
36+
.server(rootDir, function() {
37+
require('../src/server.js')();
4138
});

bin/server.prod.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require('dotenv').load();
2+
require('app-module-path').addPath(__dirname);
3+
require('app-module-path').addPath('../dist');
4+
5+
var webpackIsomorphicTools = require('webpack-isomorphic-tools');
6+
var path = require('path');
7+
var rootDir = path.resolve(__dirname, '../dist');
8+
9+
global.__CLIENT__ = false;
10+
global.__SERVER__ = true;
11+
global.__DEVELOPMENT__ = process.env.NODE_ENV !== 'production';
12+
13+
global.webpack_isomorphic_tools = new webpackIsomorphicTools(require('../webpack/isomorphic-tools-configuration'))
14+
.development(__DEVELOPMENT__)
15+
.server(rootDir, function() {
16+
require('../dist/server.js')();
17+
});

0 commit comments

Comments
 (0)