@griddo/cx 10.2.16 → 10.2.18

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/README.md CHANGED
@@ -26,3 +26,38 @@ GRIDDO_REACT_APP_INSTANCE="instance-name"
26
26
  # Asset prefix (only infra)
27
27
  GRIDDO_ASSET_PREFIX="prefix"
28
28
  ```
29
+ # Griddo Exporter
30
+
31
+ El punto de entrada para CX está en `src/index.js` que ejecuta **Griddo Exporter**, publicado en `./build/index.js` del cual podemos encontrar el código TypeScript en `./scripts/griddo-exporter.ts`
32
+
33
+ **Griddo Exporter** es el script _orquestador_ que llama **una vez por cada dominio** a los distintos procesos que implican la realización del build de un dominio.
34
+
35
+ `BUILD-COMPLETO = PROCESOS * DOMINIOS`
36
+
37
+ ## Los procesos
38
+
39
+ Los distintos procesos llamados desde **Griddo Exporter** son:
40
+
41
+
42
+ ### API Fetch
43
+
44
+ **`yarn run api-fetch`**
45
+
46
+ Realiza toda la consulta de datos a la API de los sites (páginas, distribuidores, etc...) de un dominio, post-procesa y construye los `pageObjets`. Estos `pageObjects` son guardados como archivos JSON en una carpeta del sistema de archivos, creando lo que llamamos un **Store**.
47
+
48
+ Este Store no está acoplado con ningún sistema de renderización (Gatsby), son solo archivos JSON que describen los sites y páginas con el estándar que hemos diseñado desde Griddo.
49
+
50
+ ### Gatsby build
51
+
52
+ **`gatsby-build`**
53
+
54
+ Se leen los JSON del store y se crean las páginas pasándolos directamente (0 pre/post procesado) a la función `creatPages` de Gatsby.
55
+
56
+ ### Post build
57
+
58
+ - Se crean Robots
59
+ - Se crean sitemaps.xml del render
60
+ - Se crear un archivo __build_report__info.json para notificar a la API de la finalización del render
61
+ - Se mueven el bundle generado por Gatsby de /public a /dist (esto se debería deprecar)
62
+
63
+ **`post-build`**
package/build/index.js CHANGED
@@ -25,7 +25,7 @@ GFS4: `),console.error(e)});z[Z]||(ws=global[Z]||[],xs(z,ws),z.close=function(e)
25
25
  \u2502 Access credentials failure \u2502
26
26
  \u2502 Check that the login details are correct in your .env file \u2502
27
27
  \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F
28
- `)),process.exit(1)}}},Ar=new Kn;var el=K(Yn()),tl=K(gt()),rl=K(Gt());var yp=K(gt()),Vu=K(Gt()),gp=K(gn()),Yu=K(Wu());var Ju="10.2.16";Vu.default.config();var vp=!!process.env.GRIDDO_BUILD_LOGS&&!!JSON.parse(process.env.GRIDDO_BUILD_LOGS)||!!process.env.LOGS&&!!JSON.parse(process.env.LOGS);function Ku(e){let t=e.length,r=e.length+2,n=" ".repeat(Math.floor((r-t)/2)),i=`\u256D${"\u2500".repeat(r)}\u256E
28
+ `)),process.exit(1)}}},Ar=new Kn;var el=K(Yn()),tl=K(gt()),rl=K(Gt());var yp=K(gt()),Vu=K(Gt()),gp=K(gn()),Yu=K(Wu());var Ju="10.2.18";Vu.default.config();var vp=!!process.env.GRIDDO_BUILD_LOGS&&!!JSON.parse(process.env.GRIDDO_BUILD_LOGS)||!!process.env.LOGS&&!!JSON.parse(process.env.LOGS);function Ku(e){let t=e.length,r=e.length+2,n=" ".repeat(Math.floor((r-t)/2)),i=`\u256D${"\u2500".repeat(r)}\u256E
29
29
  `,s=`
30
30
  \u2570${"\u2500".repeat(r)}\u256F`,o=`\u2502${n}${e}${n}\u2502`;console.log(`${i}${o}${s}`)}function fi(e){vp&&console.info(e.replace(/(\s)\s+/g,"$1"))}function Xu(e){return new Promise(t=>setTimeout(t,e))}function Dr(e,t=3){return(e/1e3).toFixed(t)}function hi(e){return"site"in e&&e.site?e?.site:void 0}function di(...e){let t=performance.now();return e.forEach(r=>r()),Dr(performance.now()-t)}function Qu(){let e=`
31
31
  \xB7\xB7
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.2.16",
4
+ "version": "10.2.18",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -68,7 +68,7 @@
68
68
  "react-helmet": "^6.0.0"
69
69
  },
70
70
  "devDependencies": {
71
- "@griddo/eslint-config-back": "^10.2.16",
71
+ "@griddo/eslint-config-back": "^10.2.18",
72
72
  "@types/babel__core": "^7.20.0",
73
73
  "@types/babel__preset-env": "^7.9.2",
74
74
  "@types/csvtojson": "^2.0.0",
@@ -116,5 +116,5 @@
116
116
  "publishConfig": {
117
117
  "access": "public"
118
118
  },
119
- "gitHead": "52c6eac7dfab4eee2992165e335e733d18c9d8a3"
119
+ "gitHead": "00c771f54de889c527a267f636c4a8da7e422560"
120
120
  }
package/src/html.tsx CHANGED
@@ -2,7 +2,6 @@ import type { HtmlProps } from "./components/types";
2
2
 
3
3
  import * as React from "react";
4
4
 
5
- // TODO: JSDoc
6
5
  export default function HTML(props: HtmlProps) {
7
6
  return (
8
7
  <html {...props.htmlAttributes}>
@@ -17,9 +16,6 @@ export default function HTML(props: HtmlProps) {
17
16
  </head>
18
17
  <body {...props.bodyAttributes}>
19
18
  {props.preBodyComponents}
20
- <noscript key="noscript" id="gatsby-noscript">
21
- This app works best with JavaScript enabled.
22
- </noscript>
23
19
  <div
24
20
  key={"body"}
25
21
  id="___gatsby"