From 538606dd17f1ddccd5b779f6e262dadec678ef5b Mon Sep 17 00:00:00 2001
From: Sabeur Thabti
Date: Thu, 20 Apr 2017 08:36:08 +0100
Subject: [PATCH 1/2] Add prettier (#754)
* add prettier
* ensure prettier works
---
.eslintrc | 5 +
package.json | 24 +++--
src/server.js | 67 ++++++-------
yarn.lock | 270 ++++++++++++++++++++++++++++++++++++++++++++++----
4 files changed, 304 insertions(+), 62 deletions(-)
diff --git a/.eslintrc b/.eslintrc
index 58b1abbaf..e9c306bef 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -5,8 +5,11 @@
"comma-dangle": 0,
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-extraneous-dependencies": 0,
+ "import/prefer-default-export": 1,
"import/extensions": 0,
"import/no-unresolved": 0,
+ "property": 0,
+ "no-mixed-operators": 0,
"strict": 0
},
"ecmaFeatures": {
@@ -38,7 +41,9 @@
mixpanel: true,
"expect": true,
"browser": true,
+ "import": true,
"FB": true,
+ "window": true,
sinon: true
},
"env": {
diff --git a/package.json b/package.json
index 044377b8e..283478744 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,21 @@
"build:client": "webpack --config ./webpack/prod.config.js",
"validate": "npm ls",
"analyze:build": "env NODE_ENV=production webpack --json --config ./webpack/prod.config.js > bundle-stats.json",
- "analyze:json": "webpack-bundle-size-analyzer bundle-stats.json"
+ "analyze:json": "webpack-bundle-size-analyzer bundle-stats.json",
+ "lint:fix": "npm run test:dev:lint -- --fix",
+ "prettier": "prettier --single-quote --write",
+ "precommit": "lint-staged"
+ },
+ "pre-commit": [
+ "test:stylelint",
+ "precommit"
+ ],
+ "lint-staged": {
+ "*.js": [
+ "npm run prettier",
+ "npm run lint:fix",
+ "git add"
+ ]
},
"engines": {
"node": ">= 6.3.0"
@@ -158,6 +172,7 @@
"karma-sinon": "1.0.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "1.8.0",
+ "lint-staged": "^3.4.0",
"mocha": "2.2.5",
"nodemon": "1.7.1",
"path": "0.11.14",
@@ -165,6 +180,7 @@
"phantomjs-polyfill": "0.0.1",
"piping": "0.3.0",
"pre-commit": "1.1.3",
+ "prettier": "^1.2.2",
"react-addons-test-utils": "15.4.1",
"react-transform-catch-errors": "1.0.0",
"react-transform-hmr": "1.0.1",
@@ -179,9 +195,5 @@
"webpack-bundle-analyzer": "2.2.1",
"webpack-dev-server": "2.1.0-beta.0",
"webpack-hot-middleware": "2.12.2"
- },
- "pre-commit": [
- "test:dev:lint",
- "test:stylelint"
- ]
+ }
}
diff --git a/src/server.js b/src/server.js
index feedcc90b..25d8dac78 100644
--- a/src/server.js
+++ b/src/server.js
@@ -31,10 +31,8 @@ Raven.config(config.sentryServer, {
autoBreadcrumbs: true
}).install();
-
expressConfig(server);
-
server.use(Raven.requestHandler());
server.use((req, res, next) => {
@@ -49,14 +47,11 @@ server.use((req, res, next) => {
}
if (req.query.DISABLE_SSR) {
- return res.status(200).send(`\n${ReactDOM.renderToString(
-
-
-
- )}`);
+ return res.status(200).send(
+ `\n${ReactDOM.renderToString(
+
+ )}`
+ );
}
store.dispatch(setUserAgent(req.useragent));
@@ -74,29 +69,29 @@ server.use((req, res, next) => {
console.error('ROUTER ERROR:', pretty.render(error));
res.status(500).send(error);
} else if (renderProps) {
- const status = renderProps.location.pathname.indexOf('/error') > -1 ? 404 : 200;
-
- loadOnServer({ ...renderProps, store, helpers: { client } }).then(() => {
- const component = (
-
-
-
-
-
- );
-
- res.type('html');
- res.setHeader('Cache-Control', 'public, max-age=31557600');
- res.status(status);
- debug('Server', 'Sending markup');
- res.send(`\n${ReactDOM.renderToString(
-
- )}`);
- }).catch(next);
+ const status = renderProps.location.pathname.indexOf('/error') > -1
+ ? 404
+ : 200;
+
+ loadOnServer({ ...renderProps, store, helpers: { client } })
+ .then(() => {
+ const component = (
+
+
+
+
+
+ );
+
+ res.type('html');
+ res.setHeader('Cache-Control', 'public, max-age=31557600');
+ res.status(status);
+ debug('Server', 'Sending markup');
+ res.send(
+ `\n${ReactDOM.renderToString(
)}`
+ );
+ })
+ .catch(next);
}
}
);
@@ -123,7 +118,11 @@ export default function serve(cb) {
console.info(`==> 🌎 ENV=${process.env.NODE_ENV}`);
console.info(`==> ✅ Server is listening at http://localhost:${port}`);
console.info(`==> 🎯 API at ${process.env.API_URL}`);
- Object.keys(config).forEach(key => config[key].constructor.name !== 'Object' && console.info(`==> ${key}`, config[key]));
+ Object.keys(config).forEach(
+ key =>
+ config[key].constructor.name !== 'Object' &&
+ console.info(`==> ${key}`, config[key])
+ );
return cb && cb(this);
});
diff --git a/yarn.lock b/yarn.lock
index 0090a1e5a..0b019d677 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -106,7 +106,7 @@ amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
-ansi-escapes@^1.1.0:
+ansi-escapes@^1.0.0, ansi-escapes@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
@@ -122,6 +122,12 @@ ansi-styles@^2.1.0, ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
+ansi-styles@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1"
+ dependencies:
+ color-convert "^1.0.0"
+
any-promise@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-0.1.0.tgz#830b680aa7e56f33451d4b049f3bd8044498ee27"
@@ -137,6 +143,10 @@ app-module-path@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-1.0.2.tgz#ddaf02e39155aa2f831a2306ee5a2d7a2d0d9a1f"
+app-root-path@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46"
+
aproba@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0"
@@ -261,6 +271,10 @@ ast-types@0.9.2:
version "0.9.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.2.tgz#2cc19979d15c655108bf565323b8e7ee38751f6b"
+ast-types@0.9.8:
+ version "0.9.8"
+ resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078"
+
async-each-series@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/async-each-series/-/async-each-series-1.1.0.tgz#f42fd8155d38f21a5b8ea07c28e063ed1700b138"
@@ -361,7 +375,7 @@ babel-cli@6.11.4:
optionalDependencies:
chokidar "^1.0.0"
-babel-code-frame@^6.11.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
+babel-code-frame@6.22.0, babel-code-frame@^6.11.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
dependencies:
@@ -1272,6 +1286,10 @@ babel-types@^6.13.0, babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19
lodash "^4.2.0"
to-fast-properties "^1.0.1"
+babylon@7.0.0-beta.8:
+ version "7.0.0-beta.8"
+ resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949"
+
babylon@^5.8.38:
version "5.8.38"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-5.8.38.tgz#ec9b120b11bf6ccd4173a18bf217e60b79859ffd"
@@ -1696,7 +1714,7 @@ chalk@1.1.1:
strip-ansi "^3.0.0"
supports-color "^2.0.0"
-chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3, chalk@~1.1.0:
+chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3, chalk@~1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
@@ -1812,18 +1830,29 @@ clean-webpack-plugin@0.1.10:
dependencies:
rimraf "~2.5.1"
-cli-cursor@^1.0.1:
+cli-cursor@^1.0.1, cli-cursor@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"
dependencies:
restore-cursor "^1.0.1"
+cli-spinners@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c"
+
cli-table@~0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23"
dependencies:
colors "1.0.3"
+cli-truncate@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574"
+ dependencies:
+ slice-ansi "0.0.4"
+ string-width "^1.0.1"
+
cli-width@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a"
@@ -1881,7 +1910,7 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
-color-convert@^1.3.0:
+color-convert@^1.0.0, color-convert@^1.3.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.8.2.tgz#be868184d7c8631766d54e7078e2672d7c7e3339"
dependencies:
@@ -2255,6 +2284,14 @@ cross-spawn@^4.0.0:
lru-cache "^4.0.1"
which "^1.2.9"
+cross-spawn@^5.0.1:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
+ dependencies:
+ lru-cache "^4.0.1"
+ shebang-command "^1.2.0"
+ which "^1.2.9"
+
cryptiles@2.x.x:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
@@ -2460,6 +2497,10 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
+date-fns@^1.27.2:
+ version "1.28.3"
+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.3.tgz#145d87adc3f5a82c6bda668de97eee1132c97ea1"
+
date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
@@ -2847,6 +2888,10 @@ ejs@^2.5.5:
version "2.5.6"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.6.tgz#479636bfa3fe3b1debd52087f0acb204b4f19c88"
+elegant-spinner@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e"
+
elliptic@^6.0.0:
version "6.3.2"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48"
@@ -3240,7 +3285,7 @@ estraverse@~4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2"
-esutils@^2.0.0, esutils@^2.0.2:
+esutils@2.0.2, esutils@^2.0.0, esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
@@ -3310,6 +3355,18 @@ execa@^0.5.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"
+execa@^0.6.0:
+ version "0.6.3"
+ resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe"
+ dependencies:
+ cross-spawn "^5.0.1"
+ get-stream "^3.0.0"
+ is-stream "^1.1.0"
+ npm-run-path "^2.0.0"
+ p-finally "^1.0.0"
+ signal-exit "^3.0.0"
+ strip-eof "^1.0.0"
+
execall@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/execall/-/execall-1.0.0.tgz#73d0904e395b3cab0658b08d09ec25307f29bb73"
@@ -3517,7 +3574,7 @@ fd-slicer@~1.0.1:
dependencies:
pend "~1.2.0"
-figures@^1.3.5:
+figures@^1.3.5, figures@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
dependencies:
@@ -3628,6 +3685,10 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"
+flow-parser@0.43.0:
+ version "0.43.0"
+ resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7"
+
fontfaceobserver@1.7.3:
version "1.7.3"
resolved "https://registry.yarnpkg.com/fontfaceobserver/-/fontfaceobserver-1.7.3.tgz#b06c653171a06ef8d195539cf7c3802208752ecd"
@@ -3827,6 +3888,10 @@ get-proxy@^1.0.1:
dependencies:
rc "^1.1.2"
+get-stdin@5.0.1, get-stdin@^5.0.0:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
+
get-stdin@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-3.0.2.tgz#c1ced24b9039b38ded85bdf161e57713b6dd4abe"
@@ -3835,10 +3900,6 @@ get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
-get-stdin@^5.0.0:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
-
get-stream@^2.2.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
@@ -3846,6 +3907,10 @@ get-stream@^2.2.0:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"
+get-stream@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
+
getpass@^0.1.1:
version "0.1.6"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6"
@@ -3901,24 +3966,24 @@ glob@3.2.3:
inherits "2"
minimatch "~0.2.11"
-glob@^5.0.1, glob@^5.0.15, glob@^5.0.3, glob@^5.0.5:
- version "5.0.15"
- resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
+glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.1.1:
+ version "7.1.1"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
dependencies:
+ fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
- minimatch "2 || 3"
+ minimatch "^3.0.2"
once "^1.3.0"
path-is-absolute "^1.0.0"
-glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.1.1:
- version "7.1.1"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
+glob@^5.0.1, glob@^5.0.15, glob@^5.0.3, glob@^5.0.5:
+ version "5.0.15"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
dependencies:
- fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
- minimatch "^3.0.2"
+ minimatch "2 || 3"
once "^1.3.0"
path-is-absolute "^1.0.0"
@@ -4460,6 +4525,10 @@ indent-string@^2.1.0:
dependencies:
repeating "^2.0.0"
+indent-string@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d"
+
indexes-of@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607"
@@ -4742,6 +4811,10 @@ is-primitive@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
+is-promise@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
+
is-property@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
@@ -4864,6 +4937,22 @@ jade@0.26.3:
commander "0.6.1"
mkdirp "0.3.0"
+jest-matcher-utils@^19.0.0:
+ version "19.0.0"
+ resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d"
+ dependencies:
+ chalk "^1.1.3"
+ pretty-format "^19.0.0"
+
+jest-validate@19.0.0:
+ version "19.0.0"
+ resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173"
+ dependencies:
+ chalk "^1.1.1"
+ jest-matcher-utils "^19.0.0"
+ leven "^2.0.0"
+ pretty-format "^19.0.0"
+
jodid25519@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967"
@@ -5213,6 +5302,10 @@ leven@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/leven/-/leven-1.0.2.tgz#9144b6eebca5f1d0680169f1a6770dcea60b75c3"
+leven@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
+
levn@^0.3.0, levn@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
@@ -5220,6 +5313,64 @@ levn@^0.3.0, levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"
+lint-staged@^3.4.0:
+ version "3.4.0"
+ resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.4.0.tgz#52fa85dfc92bb1c6fe8ad0d0d98ca13924e03e4b"
+ dependencies:
+ app-root-path "^2.0.0"
+ cosmiconfig "^1.1.0"
+ execa "^0.6.0"
+ listr "^0.11.0"
+ minimatch "^3.0.0"
+ npm-which "^3.0.1"
+ staged-git-files "0.0.4"
+
+listr-silent-renderer@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e"
+
+listr-update-renderer@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz#ca80e1779b4e70266807e8eed1ad6abe398550f9"
+ dependencies:
+ chalk "^1.1.3"
+ cli-truncate "^0.2.1"
+ elegant-spinner "^1.0.1"
+ figures "^1.7.0"
+ indent-string "^3.0.0"
+ log-symbols "^1.0.2"
+ log-update "^1.0.2"
+ strip-ansi "^3.0.1"
+
+listr-verbose-renderer@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.0.tgz#44dc01bb0c34a03c572154d4d08cde9b1dc5620f"
+ dependencies:
+ chalk "^1.1.3"
+ cli-cursor "^1.0.2"
+ date-fns "^1.27.2"
+ figures "^1.7.0"
+
+listr@^0.11.0:
+ version "0.11.0"
+ resolved "https://registry.yarnpkg.com/listr/-/listr-0.11.0.tgz#5e778bc23806ac3ab984ed75564458151f39b03e"
+ dependencies:
+ chalk "^1.1.3"
+ cli-truncate "^0.2.1"
+ figures "^1.7.0"
+ indent-string "^2.1.0"
+ is-promise "^2.1.0"
+ is-stream "^1.1.0"
+ listr-silent-renderer "^1.1.1"
+ listr-update-renderer "^0.2.0"
+ listr-verbose-renderer "^0.4.0"
+ log-symbols "^1.0.2"
+ log-update "^1.0.2"
+ ora "^0.2.3"
+ rxjs "^5.0.0-beta.11"
+ stream-to-observable "^0.1.0"
+ strip-ansi "^3.0.1"
+
load-json-file@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
@@ -5428,6 +5579,13 @@ log-symbols@^1.0.2:
dependencies:
chalk "^1.0.0"
+log-update@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1"
+ dependencies:
+ ansi-escapes "^1.0.0"
+ cli-cursor "^1.0.2"
+
log4js@^0.6.31:
version "0.6.38"
resolved "https://registry.yarnpkg.com/log4js/-/log4js-0.6.38.tgz#2c494116695d6fb25480943d3fc872e662a522fd"
@@ -5670,7 +5828,7 @@ minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
-minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
+minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
@@ -5985,12 +6143,26 @@ normalizr@3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/normalizr/-/normalizr-3.0.2.tgz#ac51ab65af807e9022b9f16a767fb1449c0dae6a"
+npm-path@^2.0.2:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.3.tgz#15cff4e1c89a38da77f56f6055b24f975dfb2bbe"
+ dependencies:
+ which "^1.2.10"
+
npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
dependencies:
path-key "^2.0.0"
+npm-which@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa"
+ dependencies:
+ commander "^2.9.0"
+ npm-path "^2.0.2"
+ which "^1.2.10"
+
npmconf@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/npmconf/-/npmconf-2.1.2.tgz#66606a4a736f1e77a059aa071a79c94ab781853a"
@@ -6171,6 +6343,15 @@ optipng-bin@^3.0.0:
bin-wrapper "^3.0.0"
logalot "^2.0.0"
+ora@^0.2.3:
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4"
+ dependencies:
+ chalk "^1.1.1"
+ cli-cursor "^1.0.2"
+ cli-spinners "^0.1.2"
+ object-assign "^4.0.1"
+
ordered-read-streams@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b"
@@ -6924,6 +7105,21 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
+prettier@^1.2.2:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.2.tgz#22d17c1132faaaea1f1d4faea31f19f7a1959f3e"
+ dependencies:
+ ast-types "0.9.8"
+ babel-code-frame "6.22.0"
+ babylon "7.0.0-beta.8"
+ chalk "1.1.3"
+ esutils "2.0.2"
+ flow-parser "0.43.0"
+ get-stdin "5.0.1"
+ glob "7.1.1"
+ jest-validate "19.0.0"
+ minimist "1.2.0"
+
pretty-error@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.0.0.tgz#e5f4dd401a652cf46226707c10ffa124e433e83f"
@@ -6931,6 +7127,12 @@ pretty-error@2.0.0:
renderkid "~2.0.0"
utila "~0.4"
+pretty-format@^19.0.0:
+ version "19.0.0"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84"
+ dependencies:
+ ansi-styles "^3.0.0"
+
private@^0.1.6, private@~0.1.5:
version "0.1.6"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1"
@@ -7915,6 +8117,12 @@ rx-lite@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102"
+rxjs@^5.0.0-beta.11:
+ version "5.3.0"
+ resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.3.0.tgz#d88ccbdd46af290cbdb97d5d8055e52453fabe2d"
+ dependencies:
+ symbol-observable "^1.0.1"
+
samsam@1.1.2, samsam@~1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.2.tgz#bec11fdc83a9fda063401210e40176c3024d1567"
@@ -8065,6 +8273,12 @@ shallowequal@0.2.2:
dependencies:
lodash.keys "^3.1.2"
+shebang-command@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
+ dependencies:
+ shebang-regex "^1.0.0"
+
shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
@@ -8354,6 +8568,10 @@ stackframe@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4"
+staged-git-files@0.0.4:
+ version "0.0.4"
+ resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35"
+
stat-mode@^0.2.0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/stat-mode/-/stat-mode-0.2.2.tgz#e6c80b623123d7d80cf132ce538f346289072502"
@@ -8414,6 +8632,10 @@ stream-shift@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952"
+stream-to-observable@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe"
+
strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
@@ -8709,6 +8931,10 @@ symbol-observable@^0.2.3:
version "0.2.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40"
+symbol-observable@^1.0.1:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
+
"symbol-tree@>= 3.1.0 < 4.0.0":
version "3.1.4"
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.1.4.tgz#02b279348d337debc39694c5c95f882d448a312a"
@@ -9532,7 +9758,7 @@ which-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"
-which@1, which@1.2.x, which@^1.0.9, which@^1.2.8, which@^1.2.9, which@~1.2.10, which@~1.2.2:
+which@1, which@1.2.x, which@^1.0.9, which@^1.2.10, which@^1.2.8, which@^1.2.9, which@~1.2.10, which@~1.2.2:
version "1.2.12"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192"
dependencies:
From e83e447b20bd2b94bb975060cdbfdf48e5a027af Mon Sep 17 00:00:00 2001
From: Mohamed El Mahallawy
Date: Thu, 20 Apr 2017 01:20:38 -0700
Subject: [PATCH 2/2] Quick deploy changes (#755)
* Center reading mode
* Fixes #742 loading component
* Fixes #704 contact us to zendesk
* Fix sitemap
* Fix overflow and default reciter
---
src/components/ComponentLoader/index.js | 2 +-
src/components/Footer/index.js | 4 ++--
src/components/Verse/style.scss | 4 ++--
src/redux/actions/audioplayer.js | 2 +-
src/redux/modules/options.js | 4 ++--
src/server/config/sitemap.js | 9 ++++-----
6 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/components/ComponentLoader/index.js b/src/components/ComponentLoader/index.js
index f41fe4f9b..8adb23c1b 100644
--- a/src/components/ComponentLoader/index.js
+++ b/src/components/ComponentLoader/index.js
@@ -2,7 +2,7 @@ import React, { PropTypes } from 'react';
const ComponentLoader = ({ isLoading, error, pastDelay }) => {
if (isLoading) {
- return pastDelay ? Loading...
: null;
+ return pastDelay ? : null;
} else if (error) {
return Error! Component failed to load
;
}
diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js
index 93e59b5c8..b99e2f7e7 100644
--- a/src/components/Footer/index.js
+++ b/src/components/Footer/index.js
@@ -28,12 +28,12 @@ const Footer = () => (
-
+
-
+
client.get(`/api/v3/chapters/${chapterId}/verses/${verseId}/audio_files`, {
params: {
- recitation: audio || 8 // NOTE: default, but should never be used
+ recitation: audio || 7 // NOTE: default, but should never be used
}
}),
verseKey,
diff --git a/src/redux/modules/options.js b/src/redux/modules/options.js
index aa1593909..e9ee5ce0f 100644
--- a/src/redux/modules/options.js
+++ b/src/redux/modules/options.js
@@ -13,8 +13,8 @@ const initialState = {
isShowingSurahInfo: false,
loadingRecitations: false,
loadingTranslations: false,
- audio: 8,
- translations: [20],
+ audio: 7, // Mishari Rashid al-`Afasy
+ translations: [20], // Sahih International
tooltip: 'translation',
userAgent: null,
footNote: null,
diff --git a/src/server/config/sitemap.js b/src/server/config/sitemap.js
index 9bb0ac1d1..da2478623 100644
--- a/src/server/config/sitemap.js
+++ b/src/server/config/sitemap.js
@@ -9,17 +9,17 @@ export default (server) => {
client.get('/api/v3/chapters').then((response) => {
response.chapters.forEach((chapter) => {
- Array(chapter.versesCount).fill().forEach((_, index) => {
- const ayahId = index + 1;
+ Array(chapter.verses_count).fill().forEach((_, index) => {
+ const verseId = index + 1;
urls.push({
- url: `/${chapter.id}/${ayahId}`,
+ url: `/${chapter.id}/${verseId}`,
changefreq: 'weekly',
priority: 1
});
urls.push({
- url: `/${chapter.id}/${ayahId}-${ayahId + 9}`,
+ url: `/${chapter.id}/${verseId}-${verseId + 9}`,
changefreq: 'weekly',
priority: 1
});
@@ -62,7 +62,6 @@ export default (server) => {
});
});
-
const xml = sitemap.createSitemap({
hostname: 'https://quran.com',
cacheTime: 600000, // 600 sec cache period