@griddo/cx 11.10.4-rc.1 → 11.10.4-rc.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/build/index.js CHANGED
@@ -345,6 +345,112 @@ var SEARCH = `${GRIDDO_API_URL2}/search`;
345
345
  var SETTINGS = `${GRIDDO_API_URL2}/settings`;
346
346
  var SITE_URI = `${GRIDDO_API_URL2}/site/`;
347
347
 
348
+ // package.json
349
+ var package_default = {
350
+ name: "@griddo/cx",
351
+ description: "Griddo SSG based on Gatsby",
352
+ version: "11.10.4-rc.3",
353
+ authors: [
354
+ "Hisco <francis.vega@griddo.io>"
355
+ ],
356
+ license: "UNLICENSED",
357
+ homepage: "https://griddo.io",
358
+ repository: {
359
+ type: "git",
360
+ url: "https://github.com/griddo/griddo"
361
+ },
362
+ bin: {
363
+ "griddo-render": "cli.mjs"
364
+ },
365
+ exports: {
366
+ ".": {
367
+ import: "./build/index.js",
368
+ require: "./build/index.js",
369
+ types: "./build/index.d.ts"
370
+ },
371
+ "./react": {
372
+ import: "./build/react/index.js",
373
+ require: "./build/react/index.js",
374
+ types: "./build/react/index.d.ts"
375
+ }
376
+ },
377
+ scripts: {
378
+ "// NPM": "",
379
+ prepare: "yarn run build",
380
+ "// BUILD": "",
381
+ build: "rm -rf build && sh ./exporter/build.sh",
382
+ "build:debug": "rm -rf build && sh ./exporter/build.sh --debug",
383
+ "// TESTS": "",
384
+ test: "npm run test:compile && npm run test:create-render-fixtures && node --env-file=.env --test ./build/__tests__/* && npm run test:remove-render-fixtures",
385
+ "test-exporter": "npm run test:compile && node --env-file=.env --test ./build/__tests__exporter__/",
386
+ "test:create-render-fixtures": "node --env-file=.env ./build/__tests__/utils/create-fixtures",
387
+ "test:remove-render-fixtures": "node --env-file=.env ./build/__tests__/utils/remove-fixtures",
388
+ "test:compile": "tsgo --project tsconfig.tests.json",
389
+ "// INFRA SCRIPTS": "",
390
+ "prepare-domains-render": "node ./build/commands/prepare-domains-render",
391
+ "start-render": "node ./build/commands/start-render",
392
+ "end-render": "node ./build/commands/end-render",
393
+ "upload-search-content": "node ./build/commands/upload-search-content",
394
+ "reset-render": "node ./build/commands/reset-render",
395
+ "// ONLY LOCAL SCRIPTS": "",
396
+ "prepare-assets-directory": "node ./build/commands/prepare-assets-directory",
397
+ "create-rollback-copy": "rm -rf ../../exports-backup && cp -r ../../exports ../../exports-backup",
398
+ render: "npm run build && node --env-file=.env cli.mjs render --root=../..",
399
+ "// LINTER & FORMATTER": "",
400
+ lint: "biome check --write",
401
+ format: "biome format --write",
402
+ flint: "npm run lint && npm run format",
403
+ "ts-lint": "tsgo --noEmit",
404
+ "watch:ts-lint": "tsc --noEmit --watch"
405
+ },
406
+ dependencies: {
407
+ gatsby: "5.15.0"
408
+ },
409
+ devDependencies: {
410
+ "@biomejs/biome": "2.3.4",
411
+ "@types/node": "20.19.4",
412
+ "@typescript/native-preview": "latest",
413
+ cheerio: "1.1.2",
414
+ esbuild: "0.25.12",
415
+ "p-limit": "7.2.0",
416
+ typescript: "5.9.3"
417
+ },
418
+ peerDependencies: {
419
+ "@griddo/core": "11.9.16",
420
+ react: ">=18 <19",
421
+ "react-dom": ">=18 <19"
422
+ },
423
+ engines: {
424
+ node: ">=20.19"
425
+ },
426
+ files: [
427
+ "build",
428
+ "exporter",
429
+ "src",
430
+ "gatsby-browser.tsx",
431
+ "gatsby-config.ts",
432
+ "gatsby-node.ts",
433
+ "gatsby-ssr.tsx",
434
+ "global.d.ts",
435
+ "tsconfig.commands.json",
436
+ "tsconfig.exporter.json",
437
+ "tsconfig.json",
438
+ "plugins",
439
+ "cli.mjs"
440
+ ],
441
+ publishConfig: {
442
+ access: "public"
443
+ },
444
+ gitHead: "bcd57d7f4aeeb8a1d939c464fd44ac26a5393103"
445
+ };
446
+
447
+ // exporter/shared/headers.ts
448
+ var DEFAULT_HEADERS = {
449
+ "x-application-id": "griddo-cx",
450
+ "x-client-version": package_default.version,
451
+ "x-client-name": "CX"
452
+ };
453
+
348
454
  // exporter/services/auth.ts
349
455
  var AuthService = class {
350
456
  headers;
@@ -352,7 +458,10 @@ var AuthService = class {
352
458
  try {
353
459
  const response = await fetch(LOGIN, {
354
460
  method: "POST",
355
- headers: { "Content-Type": "application/json", Connection: "close" },
461
+ headers: Object.assign({}, DEFAULT_HEADERS, {
462
+ "Content-Type": "application/json",
463
+ Connection: "close"
464
+ }),
356
465
  body: JSON.stringify({
357
466
  username: GRIDDO_BOT_USER,
358
467
  password: GRIDDO_BOT_PASSWORD
@@ -10,10 +10,9 @@ declare const SEARCH: string;
10
10
  declare const SETTINGS: string;
11
11
  declare const BUILD_END: string[];
12
12
  declare const BUILD_START: string[];
13
- declare const GET_PAGES: string[];
14
13
  declare const GET_REFERENCE_FIELD_DATA: string[];
15
14
  declare const GET_SITEMAP: string[];
16
15
  declare const INFO: string[];
17
16
  declare const LANGUAGES: string[];
18
17
  declare const SOCIALS: string[];
19
- export { AI_EMBEDDINGS, ALERT, BUILD_END, BUILD_START, DOMAINS, GET_ALL, GET_PAGE, GET_PAGES, GET_REFERENCE_FIELD_DATA, GET_SITEMAP, INFO, LANGUAGES, LOGIN, RESET_RENDER, ROBOTS, SEARCH, SETTINGS, SOCIALS, };
18
+ export { AI_EMBEDDINGS, ALERT, BUILD_END, BUILD_START, DOMAINS, GET_ALL, GET_PAGE, GET_REFERENCE_FIELD_DATA, GET_SITEMAP, INFO, LANGUAGES, LOGIN, RESET_RENDER, ROBOTS, SEARCH, SETTINGS, SOCIALS, };
@@ -0,0 +1,5 @@
1
+ export declare const DEFAULT_HEADERS: {
2
+ readonly "x-application-id": "griddo-cx";
3
+ readonly "x-client-version": string;
4
+ readonly "x-client-name": "CX";
5
+ };
@@ -16,6 +16,7 @@ import { RenderError } from "../core/errors";
16
16
  import { pathExists } from "../core/fs";
17
17
  import { GriddoLog } from "../core/GriddoLog";
18
18
  import { addLogToBuffer } from "../core/logger";
19
+ import { DEFAULT_HEADERS } from "../shared/headers";
19
20
  import { brush } from "../shared/npm-modules/brush";
20
21
  import { AuthService } from "./auth";
21
22
  import { getRenderPathsHydratedWithDomainFromDB } from "./render";
@@ -76,7 +77,10 @@ async function requestAPI<T extends APIResponses>(
76
77
  // Prepare fetch options
77
78
  const fetchOptions: RequestInit = {
78
79
  method: method.toUpperCase(),
79
- headers: Object.assign({}, headers, AuthService.headers) as Record<string, string>,
80
+ headers: Object.assign({}, DEFAULT_HEADERS, headers, AuthService.headers) as Record<
81
+ string,
82
+ string
83
+ >,
80
84
  };
81
85
 
82
86
  // Add body for non-GET requests
@@ -4,6 +4,7 @@ import { throwError } from "../core/errors";
4
4
  import { LOGIN } from "../shared/endpoints";
5
5
  import { GRIDDO_BOT_PASSWORD, GRIDDO_BOT_USER } from "../shared/envs";
6
6
  import { LoginError } from "../shared/errors";
7
+ import { DEFAULT_HEADERS } from "../shared/headers";
7
8
 
8
9
  class AuthService {
9
10
  headers: AuthHeaders | undefined;
@@ -12,7 +13,10 @@ class AuthService {
12
13
  try {
13
14
  const response = await fetch(LOGIN, {
14
15
  method: "POST",
15
- headers: { "Content-Type": "application/json", Connection: "close" },
16
+ headers: Object.assign({}, DEFAULT_HEADERS, {
17
+ "Content-Type": "application/json",
18
+ Connection: "close",
19
+ }),
16
20
  body: JSON.stringify({
17
21
  username: GRIDDO_BOT_USER,
18
22
  password: GRIDDO_BOT_PASSWORD,
@@ -16,7 +16,6 @@ const SETTINGS = `${GRIDDO_API_URL}/settings`;
16
16
  const SITE_URI = `${GRIDDO_API_URL}/site/`;
17
17
  const BUILD_END = [SITE_URI, "/build/end"];
18
18
  const BUILD_START = [SITE_URI, "/build/start"];
19
- const GET_PAGES = [SITE_URI, "/pages?pagination=false"];
20
19
  const GET_REFERENCE_FIELD_DATA = [SITE_URI, "/distributor"];
21
20
  const GET_SITEMAP = [SITE_URI, "/sitemap"];
22
21
  const INFO = [SITE_URI, "/all"];
@@ -31,7 +30,6 @@ export {
31
30
  DOMAINS,
32
31
  GET_ALL,
33
32
  GET_PAGE,
34
- GET_PAGES,
35
33
  GET_REFERENCE_FIELD_DATA,
36
34
  GET_SITEMAP,
37
35
  INFO,
@@ -0,0 +1,7 @@
1
+ import packageJson from "../../package.json";
2
+
3
+ export const DEFAULT_HEADERS = {
4
+ "x-application-id": "griddo-cx",
5
+ "x-client-version": packageJson.version,
6
+ "x-client-name": "CX",
7
+ } as const;
@@ -5,7 +5,6 @@ import pLimit from "p-limit";
5
5
 
6
6
  import { findFilesBySuffix } from "../../../core/fs";
7
7
  import { GriddoLog } from "../../../core/GriddoLog";
8
- import { addLogToBuffer } from "../../../core/logger";
9
8
  import { GRIDDO_SSG_BUNDLE_ANALYZER } from "../../../shared/envs";
10
9
  import { getAssetsDiffBetweenRenders, patchHtmlFile } from "./diff-assets";
11
10
 
@@ -185,7 +184,7 @@ class SyncRender {
185
184
  const changedHtmlFilePaths = this.state.htmlToAdd.map(({ from }) => from);
186
185
 
187
186
  for (const htmlFilePath of changedHtmlFilePaths) {
188
- addLogToBuffer(`Patching HTML file ${htmlFilePath} with the new webpackCompilationHash`);
187
+ GriddoLog.build(`Patching HTML file ${htmlFilePath} with the new webpackCompilationHash`);
189
188
  await patchHtmlFile(htmlFilePath, webpackCompilationHash);
190
189
  }
191
190
  }
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": "11.10.4-rc.1",
4
+ "version": "11.10.4-rc.3",
5
5
  "authors": [
6
6
  "Hisco <francis.vega@griddo.io>"
7
7
  ],
@@ -93,5 +93,5 @@
93
93
  "publishConfig": {
94
94
  "access": "public"
95
95
  },
96
- "gitHead": "0e7021e704a8f36957596114cfa4cfbb0449c20f"
96
+ "gitHead": "bcd57d7f4aeeb8a1d939c464fd44ac26a5393103"
97
97
  }