@griddo/cx 1.62.2 → 1.62.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/gatsby-browser.js +37 -55
- package/gatsby-config.js +4 -3
- package/gatsby-ssr.js +11 -28
- package/package.json +3 -3
package/gatsby-browser.js
CHANGED
|
@@ -1,131 +1,113 @@
|
|
|
1
|
-
/* eslint-disable node/no-unpublished-require */
|
|
2
1
|
/* eslint-disable node/no-missing-require */
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// Intance Gatsby Browser configuration file
|
|
7
|
-
// Se intenta hacer require del archivo builder.config que solo está en la
|
|
8
|
-
// instancia. De no existir, se avisa por consola.
|
|
9
|
-
// TODO: Añadir un método infalible para saber si es monorepo o instancia.
|
|
10
|
-
try {
|
|
11
|
-
builderBrowserConfig = require('../../../builder.browser');
|
|
12
|
-
console.log('Instance build.config loaded');
|
|
13
|
-
} catch (e) {
|
|
14
|
-
builderBrowserConfig = require('../griddo-components/builder.browser');
|
|
15
|
-
console.warn('Loading builder.config from Griddo monorepo');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Gatsby API Browser
|
|
19
|
-
// Si builderBrowserConfig.* es "truthy" es que `builderBrowserConfig` no es `undefined`, es decir se
|
|
20
|
-
// está ejecutando en la instancia y * está definido en el archivo de la
|
|
21
|
-
// instancia para ejecutar código.
|
|
3
|
+
const { browser } = require('components');
|
|
22
4
|
|
|
23
5
|
exports.disableCorePrefetching = () => {
|
|
24
|
-
if (
|
|
25
|
-
|
|
6
|
+
if (browser.disableCorePrefetching) {
|
|
7
|
+
browser.disableCorePrefetching();
|
|
26
8
|
}
|
|
27
9
|
};
|
|
28
10
|
|
|
29
11
|
exports.onClientEntry = () => {
|
|
30
|
-
if (
|
|
31
|
-
|
|
12
|
+
if (browser.onClientEntry) {
|
|
13
|
+
browser.onClientEntry();
|
|
32
14
|
}
|
|
33
15
|
};
|
|
34
16
|
|
|
35
17
|
exports.onInitialClientRender = () => {
|
|
36
|
-
if (
|
|
37
|
-
|
|
18
|
+
if (browser.onInitialClientRender) {
|
|
19
|
+
browser.onInitialClientRender();
|
|
38
20
|
}
|
|
39
21
|
};
|
|
40
22
|
|
|
41
23
|
exports.onPostPrefetchPathname = props => {
|
|
42
|
-
if (
|
|
43
|
-
|
|
24
|
+
if (browser.onPostPrefetchPathname) {
|
|
25
|
+
browser.onPostPrefetchPathname(props);
|
|
44
26
|
}
|
|
45
27
|
};
|
|
46
28
|
|
|
47
29
|
exports.onPreRouteUpdate = props => {
|
|
48
|
-
if (
|
|
49
|
-
|
|
30
|
+
if (browser.onPreRouteUpdate) {
|
|
31
|
+
browser.onPreRouteUpdate(props);
|
|
50
32
|
}
|
|
51
33
|
};
|
|
52
34
|
|
|
53
35
|
exports.onPrefetchPathname = props => {
|
|
54
|
-
if (
|
|
55
|
-
|
|
36
|
+
if (browser.onPrefetchPathname) {
|
|
37
|
+
browser.onPrefetchPathname(props);
|
|
56
38
|
}
|
|
57
39
|
};
|
|
58
40
|
|
|
59
41
|
exports.onRouteUpdateDelayed = props => {
|
|
60
|
-
if (
|
|
61
|
-
|
|
42
|
+
if (browser.onServiceWorkerActive) {
|
|
43
|
+
browser.onRouteUpdateDelayed(props);
|
|
62
44
|
}
|
|
63
45
|
};
|
|
64
46
|
|
|
65
47
|
exports.onServiceWorkerActive = props => {
|
|
66
|
-
if (
|
|
67
|
-
|
|
48
|
+
if (browser.onServiceWorkerActive) {
|
|
49
|
+
browser.onServiceWorkerActive(props);
|
|
68
50
|
}
|
|
69
51
|
};
|
|
70
52
|
|
|
71
53
|
exports.onServiceWorkerInstalled = props => {
|
|
72
|
-
if (
|
|
73
|
-
|
|
54
|
+
if (browser.onServiceWorkerInstalled) {
|
|
55
|
+
browser.onServiceWorkerInstalled(props);
|
|
74
56
|
}
|
|
75
57
|
};
|
|
76
58
|
|
|
77
59
|
exports.onServiceWorkerRedundant = props => {
|
|
78
|
-
if (
|
|
79
|
-
|
|
60
|
+
if (browser.onServiceWorkerRedundant) {
|
|
61
|
+
browser.onServiceWorkerRedundant(props);
|
|
80
62
|
}
|
|
81
63
|
};
|
|
82
64
|
|
|
83
65
|
exports.onServiceWorkerUpdateFound = props => {
|
|
84
|
-
if (
|
|
85
|
-
|
|
66
|
+
if (browser.onServiceWorkerUpdateFound) {
|
|
67
|
+
browser.onServiceWorkerUpdateFound(props);
|
|
86
68
|
}
|
|
87
69
|
};
|
|
88
70
|
|
|
89
71
|
exports.onServiceWorkerUpdateReady = props => {
|
|
90
|
-
if (
|
|
91
|
-
|
|
72
|
+
if (browser.onServiceWorkerUpdateReady) {
|
|
73
|
+
browser.onServiceWorkerUpdateReady(props);
|
|
92
74
|
}
|
|
93
75
|
};
|
|
94
76
|
|
|
95
77
|
exports.registerServiceWorker = () => {
|
|
96
|
-
if (
|
|
97
|
-
|
|
78
|
+
if (browser.registerServiceWorker) {
|
|
79
|
+
browser.registerServiceWorker();
|
|
98
80
|
}
|
|
99
81
|
};
|
|
100
82
|
|
|
101
83
|
exports.replaceHydrateFunction = () => {
|
|
102
|
-
if (
|
|
103
|
-
|
|
84
|
+
if (browser.replaceHydrateFunction) {
|
|
85
|
+
browser.replaceHydrateFunction();
|
|
104
86
|
}
|
|
105
87
|
};
|
|
106
88
|
|
|
107
89
|
exports.shouldUpdateScroll = props => {
|
|
108
|
-
if (
|
|
109
|
-
|
|
90
|
+
if (browser.shouldUpdateScroll) {
|
|
91
|
+
browser.shouldUpdateScroll(props);
|
|
110
92
|
}
|
|
111
93
|
};
|
|
112
94
|
|
|
113
95
|
exports.wrapRootElement = props => {
|
|
114
|
-
if (
|
|
115
|
-
return
|
|
96
|
+
if (browser.wrapPageElement) {
|
|
97
|
+
return browser.wrapRootElement(props);
|
|
116
98
|
}
|
|
117
99
|
};
|
|
118
100
|
|
|
119
101
|
exports.wrapRootElement = props => {
|
|
120
|
-
if (
|
|
121
|
-
return
|
|
102
|
+
if (browser.wrapRootElement) {
|
|
103
|
+
return browser.wrapRootElement(props);
|
|
122
104
|
}
|
|
123
105
|
};
|
|
124
106
|
|
|
125
107
|
exports.onRouteUpdate = props => {
|
|
126
108
|
// Instance onRouteUpdate
|
|
127
|
-
if (
|
|
128
|
-
|
|
109
|
+
if (browser.onRouteUpdate) {
|
|
110
|
+
browser.onRouteUpdate(props);
|
|
129
111
|
}
|
|
130
112
|
|
|
131
113
|
// Griddo onRouteUpdate
|
package/gatsby-config.js
CHANGED
|
@@ -4,13 +4,14 @@ require('dotenv').config();
|
|
|
4
4
|
|
|
5
5
|
const assetPrefix = process.env.ASSET_PREFIX || undefined;
|
|
6
6
|
|
|
7
|
-
// Gatsby
|
|
8
|
-
|
|
9
|
-
const { plugins } = require(computils.resolveComponentsPath(
|
|
7
|
+
// Gatsby configuration file from client
|
|
8
|
+
const { plugins, ...gatsbyConfig } = require(computils.resolveComponentsPath(
|
|
10
9
|
'builder.config.js'
|
|
11
10
|
));
|
|
12
11
|
|
|
13
12
|
const CONFIG = {
|
|
13
|
+
// cliente config
|
|
14
|
+
...gatsbyConfig,
|
|
14
15
|
plugins: [
|
|
15
16
|
// client plugins
|
|
16
17
|
...plugins,
|
package/gatsby-ssr.js
CHANGED
|
@@ -1,50 +1,33 @@
|
|
|
1
|
-
/* eslint-disable node/no-unpublished-require */
|
|
2
1
|
/* eslint-disable node/no-missing-require */
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
const { ssr } = require('components');
|
|
5
4
|
|
|
6
|
-
// Intance Gatsby Browser configuration file
|
|
7
|
-
// Se intenta hacer require del archivo builder.config que solo está en la
|
|
8
|
-
// instancia. De no existir, se avisa por consola.
|
|
9
|
-
// TODO: Añadir un método infalible para saber si es monorepo o instancia.
|
|
10
|
-
try {
|
|
11
|
-
builderSSRConfig = require('../../../builder.ssr');
|
|
12
|
-
console.log('Instance build.ssr loaded');
|
|
13
|
-
} catch (e) {
|
|
14
|
-
builderSSRConfig = require('../griddo-components/builder.ssr');
|
|
15
|
-
console.warn('Loading builder.ssr from Griddo monorepo');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Gatsby SSR Browser
|
|
19
|
-
// Si builderSSRConfig.* es "truthy" es que `builderSSRConfig` no es `undefined`, es decir se
|
|
20
|
-
// está ejecutando en la instancia y * está definido en el archivo de la
|
|
21
|
-
// instancia para ejecutar código.
|
|
22
5
|
exports.onRenderBody = props => {
|
|
23
|
-
if (
|
|
24
|
-
|
|
6
|
+
if (ssr.onRenderBody) {
|
|
7
|
+
ssr.onRenderBody(props);
|
|
25
8
|
}
|
|
26
9
|
};
|
|
27
10
|
|
|
28
11
|
exports.onPreRenderHTML = props => {
|
|
29
|
-
if (
|
|
30
|
-
|
|
12
|
+
if (ssr.onPreRenderHTML) {
|
|
13
|
+
ssr.onPreRenderHTML(props);
|
|
31
14
|
}
|
|
32
15
|
};
|
|
33
16
|
|
|
34
17
|
exports.replaceRenderer = props => {
|
|
35
|
-
if (
|
|
36
|
-
|
|
18
|
+
if (ssr.replaceRenderer) {
|
|
19
|
+
ssr.replaceRenderer(props);
|
|
37
20
|
}
|
|
38
21
|
};
|
|
39
22
|
|
|
40
23
|
exports.wrapPageElement = props => {
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
24
|
+
if (ssr.wrapPageElement) {
|
|
25
|
+
return ssr.wrapPageElement(props);
|
|
43
26
|
}
|
|
44
27
|
};
|
|
45
28
|
|
|
46
29
|
exports.wrapRootElement = props => {
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
30
|
+
if (ssr.wrapRootElement) {
|
|
31
|
+
return ssr.wrapRootElement(props);
|
|
49
32
|
}
|
|
50
33
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/cx",
|
|
3
3
|
"description": "Griddo SSG based on Gatsby",
|
|
4
|
-
"version": "1.62.
|
|
4
|
+
"version": "1.62.3",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"react-helmet": "^6.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@griddo/eslint-config-back": "^1.62.
|
|
69
|
+
"@griddo/eslint-config-back": "^1.62.3",
|
|
70
70
|
"eslint": "^7.5.0",
|
|
71
71
|
"eslint-plugin-node": "^11.1.0",
|
|
72
72
|
"eslint-plugin-react": "7.14.3",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "a06d325550a9963c24c2072634bfa751a063f2ac"
|
|
102
102
|
}
|