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

Commit bfaed76

Browse files
authored
Merge branch 'master' into divehi_font
2 parents 05501c1 + 6ad81be commit bfaed76

File tree

146 files changed

+5749
-4026
lines changed

Some content is hidden

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

146 files changed

+5749
-4026
lines changed
File renamed without changes.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Title of change
2+
_why the change and what has changed_
3+
4+
### Checklist
5+
6+
- [ ] Unit tests written
7+
- [ ] Manually tested
8+
- [ ] New dependencies were added with `yarn`
9+
- [ ] Prettier & ESLint were run
10+
11+
### Screenshot
12+
_insert screenshot if needed_

.storybook/config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from 'react';
2+
import { configure, addDecorator } from '@storybook/react';
3+
import { withInfo } from '@storybook/addon-info';
4+
5+
import { ThemeProvider } from 'styled-components';
6+
import { IntlProvider } from 'react-intl';
7+
8+
import getLocalMessages from '../src/helpers/setLocal';
9+
import theme from '../src/theme';
10+
11+
global.__CLIENT__ = true;
12+
13+
addDecorator((story, context) => withInfo('common info')(story)(context));
14+
15+
addDecorator(story =>
16+
<ThemeProvider theme={theme}>
17+
<IntlProvider locale="en" messages={getLocalMessages()}>
18+
{story()}
19+
</IntlProvider>
20+
</ThemeProvider>
21+
);
22+
23+
const req = require.context('../src/components', true, /\.stories\.js$/);
24+
25+
function loadStories() {
26+
req.keys().forEach(filename => req(filename));
27+
}
28+
29+
configure(loadStories, module);

.storybook/preview-head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<link rel="stylesheet" href="https://assets-1f14.kxcdn.com/main-415d4fa2919ce5d6e18b.css">

.storybook/webpack.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// you can use this file to add your custom webpack plugins, loaders and anything you like.
2+
// This is just the basic way to add additional webpack configurations.
3+
// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config
4+
5+
// IMPORTANT
6+
// When you add this file, we won't add the default configurations which is similar
7+
// to "React Create App". This only has babel loader to load JavaScript.
8+
9+
module.exports = {
10+
resolve: {
11+
extensions: ['.js'],
12+
modules: ['src', 'node_modules']
13+
},
14+
plugins: [
15+
// your custom plugins
16+
],
17+
module: {
18+
rules: [
19+
// add your custom rules.
20+
]
21+
}
22+
};

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ FROM node:6.3
22

33
ENV NODE_ENV production
44
ENV API_URL http://api.quran.com:3000
5-
ENV SENTRY_KEY_CLIENT https://44c105328ae544ae9928f9eb74b40061@app.getsentry.com/80639
6-
ENV SENTRY_KEY_SERVER https://44c105328ae544ae9928f9eb74b40061:41ca814d33124e04ab450104c3938cb1@app.getsentry.com/80639
7-
# It's okay because it's only the APP ID
8-
ENV FACEBOOK_APP_ID 1557596491207315
5+
ENV SENTRY_KEY_CLIENT https://app.getsentry.com
6+
ENV SENTRY_KEY_SERVER https://app.getsentry.com
7+
8+
ENV FACEBOOK_APP_ID appid
99
ENV ONE_QURAN_URL https://one.quran.com
1010
ENV PORT 8000
1111
ENV NODE_PATH "./src"

karma.conf.js

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

package.json

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,31 @@
55
"repository": "https://github.com/quran/quran.com-frontend",
66
"scripts": {
77
"test": "npm run test:dev:unit",
8-
"test:ci:unit": "karma start --browsers PhantomJS --single-run",
8+
"test:ci:unit": "jest src",
99
"pretest:ci:unit": "npm run test:ci:lint",
10-
"test:dev:unit": "karma start",
10+
"test:dev:unit": "jest src",
11+
"jest": "jest",
1112
"test:ci:lint": "./node_modules/eslint/bin/eslint.js ./src",
1213
"test:dev:lint": "./node_modules/eslint/bin/eslint.js ./src",
1314
"test:stylelint": "stylelint './src/**/*.scss' --config ./webpack/.stylelintrc",
14-
"dev-old": "env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js",
15-
"dev": "env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node --expose-gc ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config ./webpack/dev.config.js --progress & env NODE_PATH='./src' PORT=8000 node --expose-gc ./bin/server.js",
15+
"dev": "cross-env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node --expose-gc ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config ./webpack/dev.config.js --progress & env NODE_PATH='./src' PORT=8000 node --expose-gc ./bin/server.js",
1616
"build": "npm run build:client & npm run build:server",
1717
"build:server": "babel ./src -d ./dist -D",
1818
"build:client": "webpack --config ./webpack/prod.config.js",
1919
"validate": "npm ls",
20-
"analyze:build": "env NODE_ENV=production webpack --json --config ./webpack/prod.config.js > bundle-stats.json",
20+
"analyze:build": "cross-env NODE_ENV=production webpack --json --config ./webpack/prod.config.js > bundle-stats.json",
2121
"analyze:json": "webpack-bundle-size-analyzer bundle-stats.json",
2222
"lint:fix": "npm run test:dev:lint -- --fix",
2323
"prettier": "prettier --single-quote --write",
24-
"precommit": "lint-staged"
24+
"precommit": "lint-staged",
25+
"storybook": "start-storybook -p 6006",
26+
"build-storybook": "build-storybook"
27+
},
28+
"jest": {
29+
"moduleDirectories": [
30+
"node_modules",
31+
"src"
32+
]
2533
},
2634
"pre-commit": [
2735
"test:stylelint",
@@ -79,6 +87,7 @@
7987
"cookie-parser": "1.4.3",
8088
"copy-to-clipboard": "3.0.5",
8189
"cors": "2.7.1",
90+
"cross-env": "^5.1.1",
8291
"css-loader": "0.26.1",
8392
"cssnano": "3.10.0",
8493
"debug": "2.2.0",
@@ -95,16 +104,20 @@
95104
"html-webpack-plugin": "1.7.0",
96105
"http-proxy": "1.14.0",
97106
"humps": "2.0.0",
107+
"i": "0.3.6",
98108
"image-webpack-loader": "3.1.0",
99109
"imports-loader": "0.6.5",
100110
"json-loader": "0.5.4",
111+
"loadable-components": "^0.3.0",
101112
"morgan": "1.7.0",
102113
"node-sass": "4.1.1",
103114
"normalizr": "3.0.2",
115+
"polished": "^1.8.0",
104116
"postcss-loader": "0.9.1",
105117
"precss": "1.4.0",
106118
"pretty-error": "2.0.0",
107119
"promise": "7.1.1",
120+
"prop-types": "^15.6.0",
108121
"proxy-middleware": "0.14.0",
109122
"qs": "6.2.1",
110123
"quran-components": "^0.0.80",
@@ -124,8 +137,9 @@
124137
"react-metrics": "1.2.1",
125138
"react-paginate": "4.1.0",
126139
"react-redux": "5.0.1",
127-
"react-router": "3.0.0",
128-
"react-router-bootstrap": "0.20.1",
140+
"react-router": "^4",
141+
"react-router-bootstrap": "^0.24.4",
142+
"react-router-dom": "^4.2.2",
129143
"react-router-redux": "4.0.7",
130144
"react-router-scroll": "0.2.1",
131145
"react-scroll": "1.2.0",
@@ -153,7 +167,12 @@
153167
"winston": "1.1.2"
154168
},
155169
"devDependencies": {
170+
"@storybook/addon-actions": "^3.2.13",
171+
"@storybook/addon-info": "^3.2.13",
172+
"@storybook/addon-links": "^3.2.13",
173+
"@storybook/react": "^3.2.13",
156174
"babel-eslint": "7.1.1",
175+
"babel-jest": "^21.2.0",
157176
"babel-plugin-react-transform": "2.0.2",
158177
"babel-preset-react-hmre": "1.1.1",
159178
"chai": "3.0.0",
@@ -167,19 +186,8 @@
167186
"eslint-plugin-jsx-a11y": "2.2.3",
168187
"eslint-plugin-mocha": "4.8.0",
169188
"eslint-plugin-react": "6.8.0",
189+
"jest": "^21.2.1",
170190
"jscs": "2.1.1",
171-
"karma": "1.3.0",
172-
"karma-chai": "0.1.0",
173-
"karma-chai-sinon": "0.1.5",
174-
"karma-chrome-launcher": "0.2.0",
175-
"karma-intl-shim": "1.0.3",
176-
"karma-junit-reporter": "0.3.4",
177-
"karma-mocha": "0.2.0",
178-
"karma-phantomjs-launcher": "~1.0.2",
179-
"karma-script-launcher": "~0.1.0",
180-
"karma-sinon": "1.0.4",
181-
"karma-sourcemap-loader": "0.3.7",
182-
"karma-webpack": "1.8.0",
183191
"lint-staged": "^3.4.0",
184192
"mocha": "2.2.5",
185193
"nodemon": "1.7.1",

0 commit comments

Comments
 (0)