@griddo/cx 11.2.4 → 11.2.5-rc.1
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/adapters/gatsby/index.d.ts +1 -1
- package/build/commands/prepare-domains-render.d.ts +1 -0
- package/build/commands/upload-search-content.d.ts +2 -0
- package/build/constants/envs.d.ts +2 -1
- package/build/end-render.js +25 -25
- package/build/end-render.js.map +4 -4
- package/build/index.d.ts +1 -2
- package/build/index.js +28 -51
- package/build/index.js.map +4 -4
- package/build/prepare-domains-render.js +73 -0
- package/build/prepare-domains-render.js.map +7 -0
- package/build/reset-render.js +21 -21
- package/build/reset-render.js.map +4 -4
- package/build/services/sites.d.ts +5 -1
- package/build/start-render.js +41 -38
- package/build/start-render.js.map +4 -4
- package/build/types/global.d.ts +5 -4
- package/build/types/sites.d.ts +7 -0
- package/build/upload-search-content.js +18 -18
- package/build/upload-search-content.js.map +4 -4
- package/build/utils/core-utils.d.ts +4 -8
- package/build/utils/create-build-data.d.ts +2 -2
- package/build/utils/domains.d.ts +9 -1
- package/build/utils/publish.d.ts +7 -0
- package/build/utils/render.d.ts +1 -1
- package/build/utils/sites.d.ts +2 -2
- package/build/utils/store.d.ts +28 -3
- package/exporter/adapters/gatsby/index.ts +124 -126
- package/exporter/build.sh +5 -5
- package/exporter/commands/end-render.ts +107 -0
- package/exporter/commands/prepare-domains-render.ts +89 -0
- package/exporter/commands/start-render.ts +68 -0
- package/exporter/{scripts → commands}/upload-search-content.ts +1 -1
- package/exporter/constants/envs.ts +4 -2
- package/exporter/constants/index.ts +1 -0
- package/exporter/index.ts +0 -2
- package/exporter/services/sites.ts +26 -0
- package/exporter/services/store.ts +33 -81
- package/exporter/types/global.ts +6 -2
- package/exporter/types/sites.ts +7 -0
- package/exporter/utils/core-utils.ts +5 -21
- package/exporter/utils/create-build-data.ts +2 -2
- package/exporter/utils/domains.ts +1 -1
- package/exporter/utils/folders.ts +2 -1
- package/exporter/utils/loggin.ts +7 -4
- package/exporter/utils/publish.ts +29 -0
- package/exporter/utils/render.ts +2 -1
- package/exporter/utils/sites.ts +12 -52
- package/exporter/utils/store.ts +88 -42
- package/package.json +7 -4
- package/start-render.js +1 -1
- package/build/run-start-render.js +0 -97
- package/build/run-start-render.js.map +0 -7
- package/build/scripts/end-render.d.ts +0 -20
- package/build/scripts/start-render.d.ts +0 -3
- package/exporter/scripts/end-render.ts +0 -102
- package/exporter/scripts/run-start-render.ts +0 -5
- package/exporter/scripts/start-render.ts +0 -25
- /package/build/{scripts/reset-render.d.ts → commands/end-render.d.ts} +0 -0
- /package/build/{scripts → commands}/move-assets.d.ts +0 -0
- /package/build/{scripts/run-start-render.d.ts → commands/reset-render.d.ts} +0 -0
- /package/build/{scripts/upload-search-content.d.ts → commands/start-render.d.ts} +0 -0
- /package/exporter/{scripts → commands}/move-assets.ts +0 -0
- /package/exporter/{scripts → commands}/reset-render.ts +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
type Report = {
|
|
3
|
-
authControl: {
|
|
4
|
-
Authorization: string;
|
|
5
|
-
"Cache-Control": string;
|
|
6
|
-
lang?: string | undefined;
|
|
7
|
-
} | undefined;
|
|
8
|
-
sites: Array<{
|
|
9
|
-
siteId: number;
|
|
10
|
-
publishHashes: Array<string>;
|
|
11
|
-
siteHash: string | null;
|
|
12
|
-
unpublishHashes: Array<string>;
|
|
13
|
-
publishPagesIds: Array<number>;
|
|
14
|
-
}>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Informa a la API del estado de publicación de los sites: published y unpublished.
|
|
18
|
-
*/
|
|
19
|
-
declare function buildComplete(report: Report): Promise<void>;
|
|
20
|
-
export { buildComplete };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
|
|
6
|
-
import pkgDir from "pkg-dir";
|
|
7
|
-
|
|
8
|
-
import { AuthService } from "../services/auth";
|
|
9
|
-
import { endSiteRender } from "../services/sites";
|
|
10
|
-
import { getConfig } from "../utils/core-utils";
|
|
11
|
-
|
|
12
|
-
// Where we are going to find export dirs
|
|
13
|
-
const execBasePath = pkgDir.sync(path.resolve(__dirname, "../.."))!;
|
|
14
|
-
|
|
15
|
-
// Where we are going to find archived exports
|
|
16
|
-
const exportArchiveBasePath = path.resolve(execBasePath, "exports/sites");
|
|
17
|
-
|
|
18
|
-
type Report = {
|
|
19
|
-
authControl:
|
|
20
|
-
| {
|
|
21
|
-
Authorization: string;
|
|
22
|
-
"Cache-Control": string;
|
|
23
|
-
lang?: string | undefined;
|
|
24
|
-
}
|
|
25
|
-
| undefined;
|
|
26
|
-
sites: Array<{
|
|
27
|
-
siteId: number;
|
|
28
|
-
publishHashes: Array<string>;
|
|
29
|
-
siteHash: string | null;
|
|
30
|
-
unpublishHashes: Array<string>;
|
|
31
|
-
publishPagesIds: Array<number>;
|
|
32
|
-
}>;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Informa a la API del estado de publicación de los sites: published y unpublished.
|
|
37
|
-
*/
|
|
38
|
-
async function buildComplete(report: Report) {
|
|
39
|
-
await AuthService.login();
|
|
40
|
-
|
|
41
|
-
const sites = report.sites;
|
|
42
|
-
|
|
43
|
-
for (const site of sites) {
|
|
44
|
-
const { siteId, ...body } = site;
|
|
45
|
-
|
|
46
|
-
console.info(`Deploying ending call to site ${siteId}:`);
|
|
47
|
-
|
|
48
|
-
await endSiteRender(siteId, body);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
console.info(`Build end's signal sent for ${report.sites.length} site(s)`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function getExportedDomains() {
|
|
55
|
-
const domains = fs
|
|
56
|
-
.readdirSync(exportArchiveBasePath)
|
|
57
|
-
// Avoid empty files, usually .DS_Store from local renders.
|
|
58
|
-
.filter((file) => !file.startsWith("."));
|
|
59
|
-
|
|
60
|
-
return domains;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getBuildReports(domains: Array<string>) {
|
|
64
|
-
const reports: Array<Report> = [];
|
|
65
|
-
const { buildReportFileName } = getConfig();
|
|
66
|
-
|
|
67
|
-
for (const domain of domains) {
|
|
68
|
-
const buildReportFile = path.resolve(
|
|
69
|
-
exportArchiveBasePath,
|
|
70
|
-
domain,
|
|
71
|
-
"dist",
|
|
72
|
-
buildReportFileName,
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
if (!fs.existsSync(buildReportFile)) {
|
|
76
|
-
console.info(`Build report file "${buildReportFile}" not found.`);
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const buildReport = JSON.parse(fs.readFileSync(buildReportFile, "utf-8"));
|
|
81
|
-
|
|
82
|
-
reports.push(buildReport);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return reports;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async function main() {
|
|
89
|
-
const domains = getExportedDomains();
|
|
90
|
-
const reports = getBuildReports(domains);
|
|
91
|
-
|
|
92
|
-
for (const report of reports) {
|
|
93
|
-
await buildComplete(report);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
main().catch((err) => {
|
|
98
|
-
console.error("Error", err?.stdout?.toString() || err);
|
|
99
|
-
process.exit(1);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
export { buildComplete };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { renderDomainsWithGatsbyAdapter } from "../adapters/gatsby";
|
|
4
|
-
import { RenderError } from "../errors";
|
|
5
|
-
import { errorLabelLog, showExporterVersion } from "../utils/loggin";
|
|
6
|
-
import { sendGriddoDefaultAlerts } from "../utils/render";
|
|
7
|
-
|
|
8
|
-
async function startRender() {
|
|
9
|
-
try {
|
|
10
|
-
showExporterVersion();
|
|
11
|
-
await renderDomainsWithGatsbyAdapter();
|
|
12
|
-
sendGriddoDefaultAlerts();
|
|
13
|
-
} catch (error) {
|
|
14
|
-
if (error instanceof RenderError) {
|
|
15
|
-
errorLabelLog("GRIDDO_ERROR InternalCXError");
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
errorLabelLog("GRIDDO_ERROR UnknownError");
|
|
20
|
-
console.error(error);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { startRender };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|