@griddo/cx 10.3.19 → 10.3.21
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/build/download-data.js +17 -17
- package/build/index.js +17 -17
- package/exporter/adapters/gatsby/index.ts +3 -1
- package/exporter/adapters/gatsby/utils.ts +39 -20
- package/exporter/services/distributors.ts +1 -1
- package/exporter/services/store.ts +2 -2
- package/exporter/utils/download-build-data.ts +2 -2
- package/exporter/utils/sites.ts +2 -7
- package/gatsby-browser.tsx +43 -41
- package/gatsby-node.ts +3 -2
- package/package.json +3 -3
- package/static/README.md +3 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-500.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-500italic.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-600.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-600italic.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-700.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-700italic.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-800.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-800italic.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-900.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-900italic.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-italic.woff2 +0 -0
- package/static/fonts/dm-sans/dm-sans-v14-latin-regular.woff2 +0 -0
- package/static/fonts/dm-serif-display/dm-serif-display-v15-latin-italic.woff2 +0 -0
- package/static/fonts/dm-serif-display/dm-serif-display-v15-latin-regular.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Black.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-BlackItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Bold.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-BoldItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-ExtraBold.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-ExtraBoldItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Heavy.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-HeavyItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Light.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-LightItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Medium.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-MediumItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Regular.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-RegularItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-SemiBold.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-SemiBoldItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-Thin.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-ThinItalic.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-UltraLight.woff2 +0 -0
- package/static/fonts/gilroy/Gilroy-UltraLightItalic.woff2 +0 -0
- package/static/fonts/work-sans/work-sans-v17-latin-700.woff +0 -0
- package/static/fonts/work-sans/work-sans-v17-latin-700.woff2 +0 -0
- package/static/fonts/work-sans/work-sans-v17-latin-regular.woff +0 -0
- package/static/fonts/work-sans/work-sans-v17-latin-regular.woff2 +0 -0
- package/static/grisso.css +1 -0
- package/static/webfonts.css +115 -0
|
@@ -40,7 +40,9 @@ async function runGatsbyAdapter() {
|
|
|
40
40
|
* Download domain build data (sites, pages, etc) and generator a folder
|
|
41
41
|
* called `store` where all the domain render data is saved.
|
|
42
42
|
*/
|
|
43
|
-
exeTime = await measureExecutionTime(
|
|
43
|
+
exeTime = await measureExecutionTime(
|
|
44
|
+
async () => await downloadBuildData(domain)
|
|
45
|
+
).catch((err) => {
|
|
44
46
|
console.error(
|
|
45
47
|
"Error in downloadBuildData() :",
|
|
46
48
|
err?.stdout?.toString() || err
|
|
@@ -65,8 +65,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
65
65
|
*/
|
|
66
66
|
const restoreArtifacts = () => {
|
|
67
67
|
for (const artifact of artifactsArchivable) {
|
|
68
|
-
const {
|
|
69
|
-
|
|
68
|
+
const {
|
|
69
|
+
currentExportArchivePath,
|
|
70
|
+
currentExportWorkingPath,
|
|
71
|
+
} = getArtifactPaths(artifact);
|
|
70
72
|
|
|
71
73
|
if (fs.existsSync(currentExportArchivePath)) {
|
|
72
74
|
console.log(`️Restoring ${chalk.gray(currentExportArchivePath)}`);
|
|
@@ -146,8 +148,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
146
148
|
* Creates necesary folders.
|
|
147
149
|
*/
|
|
148
150
|
const createBaseExportPaths = () => {
|
|
149
|
-
const {
|
|
150
|
-
|
|
151
|
+
const {
|
|
152
|
+
domainExportArchiveBasePath,
|
|
153
|
+
domainCacheArchiveBasePath,
|
|
154
|
+
} = getArtifactPaths();
|
|
151
155
|
|
|
152
156
|
for (const _path of [
|
|
153
157
|
domainExportArchiveBasePath,
|
|
@@ -161,8 +165,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
161
165
|
};
|
|
162
166
|
|
|
163
167
|
const archiveExportArtifact = (artifact: string) => {
|
|
164
|
-
const {
|
|
165
|
-
|
|
168
|
+
const {
|
|
169
|
+
currentExportArchivePath,
|
|
170
|
+
currentExportWorkingPath,
|
|
171
|
+
} = getArtifactPaths(artifact);
|
|
166
172
|
|
|
167
173
|
console.info(
|
|
168
174
|
`Moving files from ${chalk.gray(
|
|
@@ -175,8 +181,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
175
181
|
/** Archive archivable artifacts to reuse them in the next render */
|
|
176
182
|
const archiveArtifacts = () => {
|
|
177
183
|
for (const artifact of artifactsArchivable) {
|
|
178
|
-
const {
|
|
179
|
-
|
|
184
|
+
const {
|
|
185
|
+
currentExportWorkingPath,
|
|
186
|
+
currentExportArchivePath,
|
|
187
|
+
} = getArtifactPaths(artifact);
|
|
180
188
|
|
|
181
189
|
if (!fs.existsSync(currentExportWorkingPath)) {
|
|
182
190
|
console.log(
|
|
@@ -202,8 +210,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
202
210
|
};
|
|
203
211
|
|
|
204
212
|
const createArtifactBackup = (artifact: string) => {
|
|
205
|
-
const {
|
|
206
|
-
|
|
213
|
+
const {
|
|
214
|
+
currentExportArchivePath,
|
|
215
|
+
currentExportBackupPath,
|
|
216
|
+
} = getArtifactPaths(artifact);
|
|
207
217
|
|
|
208
218
|
if (fs.existsSync(currentExportArchivePath)) {
|
|
209
219
|
console.info(
|
|
@@ -214,8 +224,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
214
224
|
};
|
|
215
225
|
|
|
216
226
|
const restoreArtifactBackup = (artifact: string) => {
|
|
217
|
-
const {
|
|
218
|
-
|
|
227
|
+
const {
|
|
228
|
+
currentExportArchivePath,
|
|
229
|
+
currentExportBackupPath,
|
|
230
|
+
} = getArtifactPaths(artifact);
|
|
219
231
|
|
|
220
232
|
if (fs.existsSync(currentExportBackupPath)) {
|
|
221
233
|
console.log(`️Restoring backup ${chalk.gray(currentExportArchivePath)}`);
|
|
@@ -224,8 +236,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
224
236
|
};
|
|
225
237
|
|
|
226
238
|
const deleteArtifactBackup = (artifact: string) => {
|
|
227
|
-
const {
|
|
228
|
-
|
|
239
|
+
const {
|
|
240
|
+
currentExportArchivePath,
|
|
241
|
+
currentExportBackupPath,
|
|
242
|
+
} = getArtifactPaths(artifact);
|
|
229
243
|
|
|
230
244
|
console.log(`️Removing backup ${chalk.gray(currentExportArchivePath)}`);
|
|
231
245
|
run(`rm -rf ${currentExportBackupPath}`);
|
|
@@ -234,8 +248,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
234
248
|
/** Archive archivable cache artifacts to reuse them in the next render */
|
|
235
249
|
const archiveCacheArtifacts = () => {
|
|
236
250
|
for (const artifact of artifactsCache) {
|
|
237
|
-
const {
|
|
238
|
-
|
|
251
|
+
const {
|
|
252
|
+
currentExportArchiveCachePath,
|
|
253
|
+
currentExportWorkingPath,
|
|
254
|
+
} = getArtifactPaths(artifact);
|
|
239
255
|
|
|
240
256
|
if (fs.existsSync(currentExportWorkingPath)) {
|
|
241
257
|
console.info(
|
|
@@ -258,8 +274,10 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
258
274
|
*/
|
|
259
275
|
const restoreCacheArtifacts = () => {
|
|
260
276
|
for (const artifact of artifactsCache) {
|
|
261
|
-
const {
|
|
262
|
-
|
|
277
|
+
const {
|
|
278
|
+
currentExportArchiveCachePath,
|
|
279
|
+
currentExportWorkingPath,
|
|
280
|
+
} = getArtifactPaths(artifact);
|
|
263
281
|
|
|
264
282
|
if (fs.existsSync(currentExportArchiveCachePath)) {
|
|
265
283
|
console.log(`️Restoring ${chalk.gray(currentExportArchiveCachePath)}`);
|
|
@@ -305,8 +323,9 @@ function getGatsbyDomainRunner(domain: string) {
|
|
|
305
323
|
*/
|
|
306
324
|
const removeDisposableArtifacts = () => {
|
|
307
325
|
for (const artifact of artifactsDisposable) {
|
|
308
|
-
const { currentExportWorkingPath: artifactPath } =
|
|
309
|
-
|
|
326
|
+
const { currentExportWorkingPath: artifactPath } = getArtifactPaths(
|
|
327
|
+
artifact
|
|
328
|
+
);
|
|
310
329
|
|
|
311
330
|
if (fs.existsSync(artifactPath)) {
|
|
312
331
|
console.log(`️Removing ${chalk.gray(artifactPath)}`);
|
|
@@ -157,7 +157,7 @@ class DistributorService {
|
|
|
157
157
|
if (key === "queriedItems") continue;
|
|
158
158
|
|
|
159
159
|
const _key = key as "hasDistributorData" | "queriedItems";
|
|
160
|
-
const component = templateChunk[_key] as unknown as {
|
|
160
|
+
const component = (templateChunk[_key] as unknown) as {
|
|
161
161
|
data: Reference<unknown>;
|
|
162
162
|
queriedItems: QueriedData<unknown>;
|
|
163
163
|
hasDistributorData: boolean;
|
|
@@ -54,7 +54,7 @@ const BUILD_PROCESS_DATA: BuildProcessData = {};
|
|
|
54
54
|
* Fetch, process and save object pages and sites data into the file system to
|
|
55
55
|
* be consumed by other services (Griddo itself, Adapters, etc.)
|
|
56
56
|
*/
|
|
57
|
-
async function createStore(storeFolder: string) {
|
|
57
|
+
async function createStore(storeFolder: string, domain: string) {
|
|
58
58
|
console.info(`API calls with ${API_CONCURRENCY_COUNT} threads`);
|
|
59
59
|
|
|
60
60
|
// Remove old store
|
|
@@ -68,7 +68,7 @@ async function createStore(storeFolder: string) {
|
|
|
68
68
|
|
|
69
69
|
try {
|
|
70
70
|
// Get sites objects to publish and unpublish.
|
|
71
|
-
const { sitesToPublish, sitesToUnpublish } = await checkSites();
|
|
71
|
+
const { sitesToPublish, sitesToUnpublish } = await checkSites(domain);
|
|
72
72
|
|
|
73
73
|
// The settings will be extracted below in this process.
|
|
74
74
|
await SettingsService.getAll();
|
|
@@ -13,9 +13,9 @@ const apiCacheFolder = path.resolve(__dirname, "../apiCache");
|
|
|
13
13
|
* `getBuildMetadata()` to get build and sites metadata as objects. Both from
|
|
14
14
|
* exporter utils sites folder.
|
|
15
15
|
*/
|
|
16
|
-
async function downloadBuildData() {
|
|
16
|
+
async function downloadBuildData(domain: string) {
|
|
17
17
|
createAPICacheFolder();
|
|
18
|
-
await createStore(storeFolder);
|
|
18
|
+
await createStore(storeFolder, domain);
|
|
19
19
|
sanitizeAPICacheFolder(apiCacheFolder);
|
|
20
20
|
}
|
|
21
21
|
|
package/exporter/utils/sites.ts
CHANGED
|
@@ -36,7 +36,7 @@ const STRIP_DOMAIN_FROM_PATH = JSON.parse(
|
|
|
36
36
|
/**
|
|
37
37
|
* Check the instance sites and returns site prepared to be published and unpublished.
|
|
38
38
|
*/
|
|
39
|
-
async function checkSites() {
|
|
39
|
+
async function checkSites(domain: string) {
|
|
40
40
|
console.info(`API URL ${API_URL as string}`);
|
|
41
41
|
|
|
42
42
|
// Login to API
|
|
@@ -61,12 +61,7 @@ async function checkSites() {
|
|
|
61
61
|
const langResponse = await SitesService.getLanguages(site.id);
|
|
62
62
|
|
|
63
63
|
return (site.domains = langResponse.items
|
|
64
|
-
.filter(
|
|
65
|
-
(item) =>
|
|
66
|
-
item.domain &&
|
|
67
|
-
(!process.env.DOMAIN ||
|
|
68
|
-
item.domain.slug.indexOf(process.env.DOMAIN) > 0)
|
|
69
|
-
)
|
|
64
|
+
.filter((item) => item.domain && item.domain.slug.indexOf(domain) > 0)
|
|
70
65
|
.map((item) => ({ [item.id]: `${item.domain.slug}${item.path}` })));
|
|
71
66
|
});
|
|
72
67
|
|
package/gatsby-browser.tsx
CHANGED
|
@@ -61,47 +61,49 @@ export const onServiceWorkerActive: GatsbyBrowser["onServiceWorkerActive"] = (
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
export const onServiceWorkerInstalled: GatsbyBrowser["onServiceWorkerInstalled"] =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
64
|
+
export const onServiceWorkerInstalled: GatsbyBrowser["onServiceWorkerInstalled"] = (
|
|
65
|
+
props
|
|
66
|
+
) => {
|
|
67
|
+
if (browser.onServiceWorkerInstalled) {
|
|
68
|
+
browser.onServiceWorkerInstalled(props);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const onServiceWorkerRedundant: GatsbyBrowser["onServiceWorkerRedundant"] = (
|
|
73
|
+
props
|
|
74
|
+
) => {
|
|
75
|
+
if (browser.onServiceWorkerRedundant) {
|
|
76
|
+
browser.onServiceWorkerRedundant(props);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const onServiceWorkerUpdateFound: GatsbyBrowser["onServiceWorkerUpdateFound"] = (
|
|
81
|
+
props
|
|
82
|
+
) => {
|
|
83
|
+
if (browser.onServiceWorkerUpdateFound) {
|
|
84
|
+
browser.onServiceWorkerUpdateFound(props);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const onServiceWorkerUpdateReady: GatsbyBrowser["onServiceWorkerUpdateReady"] = (
|
|
89
|
+
props
|
|
90
|
+
) => {
|
|
91
|
+
if (browser.onServiceWorkerUpdateReady) {
|
|
92
|
+
browser.onServiceWorkerUpdateReady(props);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const registerServiceWorker: GatsbyBrowser["registerServiceWorker"] = () => {
|
|
97
|
+
if (browser.registerServiceWorker) {
|
|
98
|
+
return browser.registerServiceWorker();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const replaceHydrateFunction: GatsbyBrowser["replaceHydrateFunction"] = () => {
|
|
103
|
+
if (browser.replaceHydrateFunction) {
|
|
104
|
+
return browser.replaceHydrateFunction();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
105
107
|
|
|
106
108
|
export const shouldUpdateScroll: GatsbyBrowser["shouldUpdateScroll"] = (
|
|
107
109
|
props
|
package/gatsby-node.ts
CHANGED
|
@@ -51,8 +51,9 @@ const createPages: GatsbyNode["createPages"] = async ({
|
|
|
51
51
|
|
|
52
52
|
// onPostBuild
|
|
53
53
|
const onPostBuild = async () => {
|
|
54
|
-
const { buildProcessData, sitesToPublish } =
|
|
55
|
-
|
|
54
|
+
const { buildProcessData, sitesToPublish } = getBuildMetadata(
|
|
55
|
+
storeFolderPath
|
|
56
|
+
);
|
|
56
57
|
|
|
57
58
|
await generateBuildReport(reportFilePath, buildProcessData);
|
|
58
59
|
await RobotsService.writeFiles(publicFolderPath);
|
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": "10.3.
|
|
4
|
+
"version": "10.3.21",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"react-helmet": "^6.0.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@griddo/eslint-config-back": "^10.3.
|
|
73
|
+
"@griddo/eslint-config-back": "^10.3.21",
|
|
74
74
|
"@types/babel__core": "^7.20.0",
|
|
75
75
|
"@types/babel__preset-env": "^7.9.2",
|
|
76
76
|
"@types/csvtojson": "^2.0.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"publishConfig": {
|
|
118
118
|
"access": "public"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "148175d5af62f27e29ad411a8947115ba92bbd66"
|
|
121
121
|
}
|
package/static/README.md
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|