@webiny/app 5.18.1 → 5.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.d.ts +8 -0
- package/config.js +25 -0
- package/package.json +9 -9
- package/plugins/NetworkErrorLinkPlugin.js +2 -1
package/config.d.ts
ADDED
package/config.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var deepFreeze = function deepFreeze(obj) {
|
|
2
|
+
Object.keys(obj).forEach(function (prop) {
|
|
3
|
+
if (typeof obj[prop] === "object" && !Object.isFrozen(obj[prop])) {
|
|
4
|
+
deepFreeze(obj[prop]);
|
|
5
|
+
}
|
|
6
|
+
});
|
|
7
|
+
return Object.freeze(obj);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function createConfig() {
|
|
11
|
+
var _config = {};
|
|
12
|
+
return {
|
|
13
|
+
set: function set(config) {
|
|
14
|
+
_config = deepFreeze(config);
|
|
15
|
+
},
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _config;
|
|
18
|
+
},
|
|
19
|
+
getKey: function getKey(key, defaultValue) {
|
|
20
|
+
return key in _config ? _config[key] : defaultValue;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export var config = createConfig();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"@babel/runtime": "7.16.3",
|
|
19
19
|
"@emotion/styled": "10.0.27",
|
|
20
20
|
"@types/react": "16.14.2",
|
|
21
|
-
"@webiny/i18n": "5.18.
|
|
22
|
-
"@webiny/i18n-react": "5.18.
|
|
23
|
-
"@webiny/plugins": "5.18.
|
|
24
|
-
"@webiny/react-router": "5.18.
|
|
25
|
-
"@webiny/ui": "5.18.
|
|
21
|
+
"@webiny/i18n": "5.18.3",
|
|
22
|
+
"@webiny/i18n-react": "5.18.3",
|
|
23
|
+
"@webiny/plugins": "5.18.3",
|
|
24
|
+
"@webiny/react-router": "5.18.3",
|
|
25
|
+
"@webiny/ui": "5.18.3",
|
|
26
26
|
"apollo-cache": "1.3.5",
|
|
27
27
|
"apollo-cache-inmemory": "1.6.6",
|
|
28
28
|
"apollo-client": "2.6.10",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@babel/preset-env": "^7.5.5",
|
|
46
46
|
"@babel/preset-react": "^7.0.0",
|
|
47
47
|
"@babel/preset-typescript": "^7.8.3",
|
|
48
|
-
"@webiny/cli": "^5.18.
|
|
49
|
-
"@webiny/project-utils": "^5.18.
|
|
48
|
+
"@webiny/cli": "^5.18.3",
|
|
49
|
+
"@webiny/project-utils": "^5.18.3",
|
|
50
50
|
"babel-plugin-lodash": "^3.3.4",
|
|
51
51
|
"rimraf": "^3.0.2",
|
|
52
52
|
"typescript": "^4.1.3"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "3ccdb07d10c57086a63eb42ba7484e17bc388297"
|
|
70
70
|
}
|
|
@@ -7,6 +7,7 @@ import { onError } from "apollo-link-error";
|
|
|
7
7
|
import { print } from "graphql/language";
|
|
8
8
|
import createErrorOverlay from "./NetworkErrorLinkPlugin/createErrorOverlay";
|
|
9
9
|
import { boolean } from "boolean";
|
|
10
|
+
import { config as appConfig } from "../config";
|
|
10
11
|
/**
|
|
11
12
|
* This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
|
|
12
13
|
*/
|
|
@@ -28,7 +29,7 @@ export var NetworkErrorLinkPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
|
|
|
28
29
|
return onError(function (_ref) {
|
|
29
30
|
var networkError = _ref.networkError,
|
|
30
31
|
operation = _ref.operation;
|
|
31
|
-
var debug = boolean(process.env.REACT_APP_DEBUG);
|
|
32
|
+
var debug = appConfig.getKey("DEBUG", boolean(process.env.REACT_APP_DEBUG));
|
|
32
33
|
|
|
33
34
|
if (networkError && debug) {
|
|
34
35
|
createErrorOverlay({
|