@griddo/cx 11.9.11 → 11.9.12-rc.0
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 +13 -240
- package/build/commands/end-render.d.ts +0 -1
- package/build/commands/end-render.js +31 -0
- package/build/commands/end-render.js.map +7 -0
- package/build/commands/prepare-assets-directory.js +9 -0
- package/build/commands/prepare-assets-directory.js.map +7 -0
- package/build/commands/prepare-domains-render.js +38 -0
- package/build/commands/prepare-domains-render.js.map +7 -0
- package/build/commands/reset-render.d.ts +0 -1
- package/build/commands/reset-render.js +31 -0
- package/build/commands/reset-render.js.map +7 -0
- package/build/commands/single-domain-upload-search-content.d.ts +1 -0
- package/build/commands/start-render.d.ts +0 -1
- package/build/commands/start-render.js +66 -0
- package/build/commands/start-render.js.map +7 -0
- package/build/commands/upload-search-content.d.ts +0 -1
- package/build/commands/upload-search-content.js +32 -0
- package/build/commands/upload-search-content.js.map +7 -0
- package/build/core/GriddoLog.d.ts +16 -0
- package/build/{utils/health-checks.d.ts → core/check-env-health.d.ts} +4 -2
- package/build/core/db-class.d.ts +11 -0
- package/build/core/db.d.ts +4 -0
- package/build/core/dist-rollback.d.ts +11 -0
- package/build/core/errors.d.ts +26 -0
- package/build/core/fs.d.ts +69 -0
- package/build/core/life-cycle.d.ts +26 -0
- package/build/core/logger.d.ts +18 -0
- package/build/core/objects.d.ts +11 -0
- package/build/core/print-logos.d.ts +5 -0
- package/build/index.d.ts +10 -29
- package/build/index.js +406 -73
- package/build/react/DynamicScript/index.d.ts +4 -0
- package/build/react/GriddoFavicon/index.d.ts +4 -0
- package/build/react/GriddoIntegrations/index.d.ts +3 -4
- package/build/react/GriddoIntegrations/utils.d.ts +7 -6
- package/build/react/GriddoOpenGraph/index.d.ts +10 -0
- package/build/react/index.d.ts +3 -2
- package/build/react/index.js +1 -3
- package/build/{utils → services}/api.d.ts +1 -1
- package/build/services/auth.d.ts +2 -5
- package/build/services/domains.d.ts +3 -4
- package/build/services/manage-sites.d.ts +22 -0
- package/build/services/manage-store.d.ts +32 -0
- package/build/services/navigation.d.ts +16 -16
- package/build/{utils → services}/pages.d.ts +3 -3
- package/build/services/reference-fields.d.ts +3 -3
- package/build/services/render-artifacts.d.ts +6 -0
- package/build/services/render.d.ts +70 -0
- package/build/services/robots.d.ts +2 -19
- package/build/services/sitemaps.d.ts +5 -0
- package/build/services/sites.d.ts +8 -5
- package/build/services/store.d.ts +10 -1
- package/build/shared/context.d.ts +36 -0
- package/build/shared/envs.d.ts +19 -0
- package/build/{errors/errors-data.d.ts → shared/errors.d.ts} +5 -3
- package/build/shared/npm-modules/brush.d.ts +18 -0
- package/build/shared/npm-modules/find-up-simple.d.ts +34 -0
- package/build/shared/npm-modules/pkg-dir.d.ts +7 -0
- package/build/shared/npm-modules/xml-parser.d.ts +4 -0
- package/build/{types → shared/types}/api.d.ts +18 -18
- package/build/{types → shared/types}/global.d.ts +15 -16
- package/build/{types → shared/types}/navigation.d.ts +5 -5
- package/build/{types → shared/types}/pages.d.ts +9 -9
- package/build/shared/types/render.d.ts +54 -0
- package/build/{types → shared/types}/sites.d.ts +18 -19
- package/build/shared/types.d.ts +15 -0
- package/build/ssg-adapters/gatsby/actions/clean.d.ts +3 -0
- package/build/ssg-adapters/gatsby/actions/close.d.ts +3 -0
- package/build/ssg-adapters/gatsby/actions/data.d.ts +2 -0
- package/build/ssg-adapters/gatsby/actions/healthCheck.d.ts +2 -0
- package/build/ssg-adapters/gatsby/actions/init.d.ts +2 -0
- package/build/ssg-adapters/gatsby/actions/logs.d.ts +3 -0
- package/build/ssg-adapters/gatsby/actions/meta.d.ts +2 -0
- package/build/ssg-adapters/gatsby/actions/prepare.d.ts +2 -0
- package/build/ssg-adapters/gatsby/actions/relocation.d.ts +2 -0
- package/build/ssg-adapters/gatsby/actions/restore.d.ts +3 -0
- package/build/ssg-adapters/gatsby/actions/ssg.d.ts +3 -0
- package/build/ssg-adapters/gatsby/actions/sync.d.ts +3 -0
- package/build/ssg-adapters/gatsby/index.d.ts +9 -0
- package/build/ssg-adapters/gatsby/shared/artifacts.d.ts +4 -0
- package/build/ssg-adapters/gatsby/shared/diff-assets.d.ts +15 -0
- package/build/ssg-adapters/gatsby/shared/extract-assets.d.ts +7 -0
- package/build/ssg-adapters/gatsby/shared/gatsby-build.d.ts +7 -0
- package/build/ssg-adapters/gatsby/shared/render-rollback.d.ts +18 -0
- package/build/ssg-adapters/gatsby/shared/sync-render.d.ts +26 -0
- package/build/ssg-adapters/gatsby/shared/types.d.ts +34 -0
- package/cli.mjs +231 -0
- package/exporter/build-esbuild.noop +42 -0
- package/exporter/build.sh +16 -24
- package/exporter/commands/README.md +151 -0
- package/exporter/commands/end-render.ts +65 -86
- package/exporter/commands/prepare-assets-directory.ts +35 -0
- package/exporter/commands/prepare-domains-render.ts +132 -35
- package/exporter/commands/reset-render.ts +13 -8
- package/exporter/commands/single-domain-upload-search-content.ts +206 -0
- package/exporter/commands/start-render.ts +26 -64
- package/exporter/commands/upload-search-content.ts +204 -26
- package/exporter/core/GriddoLog.ts +45 -0
- package/exporter/core/check-env-health.ts +204 -0
- package/exporter/core/db-class.ts +54 -0
- package/exporter/core/db.ts +33 -0
- package/exporter/core/dist-rollback.ts +49 -0
- package/exporter/core/errors.ts +93 -0
- package/exporter/core/fs.ts +385 -0
- package/exporter/{utils → core}/images.ts +1 -6
- package/exporter/{utils → core}/instance.ts +9 -13
- package/exporter/core/life-cycle.ts +73 -0
- package/exporter/core/logger.ts +141 -0
- package/exporter/core/objects.ts +37 -0
- package/exporter/core/print-logos.ts +21 -0
- package/exporter/index.ts +14 -56
- package/exporter/react/DynamicScript/index.tsx +33 -0
- package/exporter/react/{Favicon → GriddoFavicon}/index.tsx +3 -9
- package/exporter/react/GriddoIntegrations/index.tsx +17 -23
- package/exporter/react/GriddoIntegrations/utils.ts +24 -12
- package/exporter/react/GriddoOpenGraph/index.tsx +39 -0
- package/exporter/react/index.tsx +3 -9
- package/exporter/services/api.ts +306 -0
- package/exporter/services/auth.ts +8 -10
- package/exporter/services/domains.ts +23 -8
- package/exporter/services/manage-sites.ts +116 -0
- package/exporter/services/manage-store.ts +173 -0
- package/exporter/services/navigation.ts +12 -18
- package/exporter/{utils → services}/pages.ts +27 -92
- package/exporter/services/reference-fields.ts +14 -32
- package/exporter/services/render-artifacts.ts +44 -0
- package/exporter/services/render.ts +229 -0
- package/exporter/services/robots.ts +33 -61
- package/exporter/services/sitemaps.ts +129 -0
- package/exporter/services/sites.ts +40 -28
- package/exporter/services/store.ts +354 -321
- package/exporter/shared/context.ts +49 -0
- package/exporter/{constants → shared}/endpoints.ts +12 -11
- package/exporter/shared/envs.ts +62 -0
- package/exporter/{errors/errors-data.ts → shared/errors.ts} +24 -14
- package/exporter/shared/npm-modules/README.md +36 -0
- package/exporter/shared/npm-modules/brush.ts +34 -0
- package/exporter/shared/npm-modules/find-up-simple.ts +100 -0
- package/exporter/shared/npm-modules/pkg-dir.ts +17 -0
- package/exporter/shared/npm-modules/xml-parser.ts +57 -0
- package/exporter/{types → shared/types}/api.ts +40 -41
- package/exporter/{types → shared/types}/global.ts +17 -21
- package/exporter/{types → shared/types}/navigation.ts +3 -3
- package/exporter/{types → shared/types}/pages.ts +10 -11
- package/exporter/shared/types/render.ts +63 -0
- package/exporter/{types → shared/types}/sites.ts +18 -19
- package/exporter/shared/types.ts +15 -0
- package/exporter/ssg-adapters/gatsby/actions/clean.ts +26 -0
- package/exporter/ssg-adapters/gatsby/actions/close.ts +17 -0
- package/exporter/ssg-adapters/gatsby/actions/data.ts +22 -0
- package/exporter/ssg-adapters/gatsby/actions/healthCheck.ts +10 -0
- package/exporter/ssg-adapters/gatsby/actions/init.ts +12 -0
- package/exporter/ssg-adapters/gatsby/actions/logs.ts +10 -0
- package/exporter/ssg-adapters/gatsby/actions/meta.ts +13 -0
- package/exporter/ssg-adapters/gatsby/actions/prepare.ts +9 -0
- package/exporter/ssg-adapters/gatsby/actions/relocation.ts +15 -0
- package/exporter/ssg-adapters/gatsby/actions/restore.ts +21 -0
- package/exporter/ssg-adapters/gatsby/actions/ssg.ts +12 -0
- package/exporter/ssg-adapters/gatsby/actions/sync.ts +65 -0
- package/exporter/ssg-adapters/gatsby/index.ts +114 -0
- package/exporter/ssg-adapters/gatsby/shared/artifacts.ts +17 -0
- package/exporter/ssg-adapters/gatsby/shared/diff-assets.ts +128 -0
- package/exporter/ssg-adapters/gatsby/shared/extract-assets.ts +75 -0
- package/exporter/ssg-adapters/gatsby/shared/gatsby-build.ts +58 -0
- package/exporter/ssg-adapters/gatsby/shared/render-rollback.ts +33 -0
- package/exporter/ssg-adapters/gatsby/shared/sync-render.ts +298 -0
- package/exporter/ssg-adapters/gatsby/shared/types.ts +35 -0
- package/gatsby-browser.tsx +41 -58
- package/gatsby-config.ts +10 -17
- package/gatsby-node.ts +20 -79
- package/gatsby-ssr.tsx +2 -1
- package/package.json +41 -80
- package/plugins/gatsby-plugin-svgr-loader/gatsby-node.js +55 -0
- package/plugins/gatsby-plugin-svgr-loader/package.json +8 -0
- package/src/components/Head.tsx +28 -73
- package/src/components/template.tsx +6 -29
- package/src/gatsby-node-utils.ts +76 -2
- package/src/html.tsx +2 -11
- package/src/types.ts +3 -3
- package/tsconfig.commands.json +36 -0
- package/tsconfig.exporter.json +21 -0
- package/tsconfig.json +5 -3
- package/build/adapters/gatsby/index.d.ts +0 -4
- package/build/adapters/gatsby/utils.d.ts +0 -22
- package/build/artifacts/index.d.ts +0 -6
- package/build/constants/envs.d.ts +0 -37
- package/build/constants/index.d.ts +0 -57
- package/build/end-render.js +0 -74
- package/build/end-render.js.map +0 -7
- package/build/errors/index.d.ts +0 -15
- package/build/index.js.map +0 -7
- package/build/prepare-domains-render.js +0 -73
- package/build/prepare-domains-render.js.map +0 -7
- package/build/react/Favicon/index.d.ts +0 -5
- package/build/registers/api.d.ts +0 -9
- package/build/registers/gatsby.d.ts +0 -9
- package/build/registers/index.d.ts +0 -3
- package/build/reset-render.js +0 -74
- package/build/reset-render.js.map +0 -7
- package/build/services/register.d.ts +0 -36
- package/build/services/settings.d.ts +0 -4
- package/build/start-render.js +0 -100
- package/build/start-render.js.map +0 -7
- package/build/upload-search-content.js +0 -74
- package/build/upload-search-content.js.map +0 -7
- package/build/utils/alerts.d.ts +0 -3
- package/build/utils/cache.d.ts +0 -35
- package/build/utils/core-utils.d.ts +0 -107
- package/build/utils/create-build-data.d.ts +0 -8
- package/build/utils/domains.d.ts +0 -13
- package/build/utils/folders.d.ts +0 -53
- package/build/utils/loggin.d.ts +0 -51
- package/build/utils/render.d.ts +0 -13
- package/build/utils/searches.d.ts +0 -15
- package/build/utils/sites.d.ts +0 -31
- package/build/utils/store.d.ts +0 -81
- package/cx.config.d.ts +0 -5
- package/cx.config.js +0 -36
- package/exporter/adapters/gatsby/index.ts +0 -162
- package/exporter/adapters/gatsby/utils.ts +0 -161
- package/exporter/artifacts/README.md +0 -34
- package/exporter/artifacts/index.ts +0 -33
- package/exporter/commands/move-assets.ts +0 -11
- package/exporter/constants/envs.ts +0 -94
- package/exporter/constants/index.ts +0 -129
- package/exporter/errors/index.ts +0 -40
- package/exporter/registers/api.ts +0 -14
- package/exporter/registers/gatsby.ts +0 -14
- package/exporter/registers/index.ts +0 -4
- package/exporter/services/register.ts +0 -113
- package/exporter/services/settings.ts +0 -17
- package/exporter/utils/alerts.ts +0 -29
- package/exporter/utils/api.ts +0 -243
- package/exporter/utils/cache.ts +0 -142
- package/exporter/utils/core-utils.ts +0 -458
- package/exporter/utils/create-build-data.ts +0 -17
- package/exporter/utils/domains.ts +0 -39
- package/exporter/utils/folders.ts +0 -320
- package/exporter/utils/health-checks.ts +0 -64
- package/exporter/utils/loggin.ts +0 -184
- package/exporter/utils/render.ts +0 -71
- package/exporter/utils/searches.ts +0 -156
- package/exporter/utils/sites.ts +0 -312
- package/exporter/utils/store.ts +0 -314
- package/src/README.md +0 -7
- package/start-render.js +0 -7
- /package/build/commands/{move-assets.d.ts → prepare-assets-directory.d.ts} +0 -0
- /package/build/{utils → core}/images.d.ts +0 -0
- /package/build/{utils → core}/instance.d.ts +0 -0
- /package/build/react/{Favicon → GriddoFavicon}/utils.d.ts +0 -0
- /package/build/{constants → shared}/endpoints.d.ts +0 -0
- /package/build/{types → shared/types}/templates.d.ts +0 -0
- /package/exporter/react/{Favicon → GriddoFavicon}/utils.ts +0 -0
- /package/exporter/{types → shared/types}/templates.ts +0 -0
|
@@ -1,102 +1,181 @@
|
|
|
1
|
-
import type { BuildProcessData } from "../types/global";
|
|
1
|
+
import type { BuildProcessData, Settings } from "../shared/types/global";
|
|
2
2
|
import type {
|
|
3
3
|
GriddoListPage,
|
|
4
4
|
GriddoMultiPage,
|
|
5
5
|
GriddoPageObject,
|
|
6
6
|
GriddoSinglePage,
|
|
7
7
|
PageAdditionalInfo,
|
|
8
|
-
} from "../types/pages";
|
|
8
|
+
} from "../shared/types/pages";
|
|
9
|
+
import type { HashSites, Site, SiteHash } from "../shared/types/sites";
|
|
9
10
|
|
|
10
|
-
import
|
|
11
|
+
import fsp from "node:fs/promises";
|
|
11
12
|
import path from "node:path";
|
|
12
13
|
|
|
13
14
|
import pLimit from "p-limit";
|
|
14
15
|
|
|
15
|
-
import {
|
|
16
|
+
import { GriddoLog } from "../core/GriddoLog";
|
|
17
|
+
import { SETTINGS } from "../shared/endpoints";
|
|
18
|
+
import {
|
|
19
|
+
GRIDDO_API_CONCURRENCY_COUNT,
|
|
20
|
+
GRIDDO_API_URL,
|
|
21
|
+
GRIDDO_PUBLIC_API_URL,
|
|
22
|
+
GRIDDO_REACT_APP_INSTANCE,
|
|
23
|
+
} from "../shared/envs";
|
|
24
|
+
import { brush } from "../shared/npm-modules/brush";
|
|
25
|
+
import { RENDER_MODE, type RenderMode } from "../shared/types/render";
|
|
26
|
+
import { get } from "./api";
|
|
27
|
+
import { getSiteData, getSitesToRender, unpublishSites } from "./manage-sites";
|
|
28
|
+
import { removeOrphanSites, saveRenderInfoInStore, saveSitePagesInStore } from "./manage-store";
|
|
16
29
|
import { NavigationService } from "./navigation";
|
|
17
|
-
import { getReferenceFieldData } from "./reference-fields";
|
|
18
|
-
import { getAllSettings } from "./settings";
|
|
19
|
-
import { getPage } from "./sites";
|
|
20
|
-
import { updatedSiteHash } from "../utils/cache";
|
|
21
|
-
import { getConfig, removeAllSiteDirsFromStore } from "../utils/core-utils";
|
|
22
|
-
import { buildLog, listSitesLog } from "../utils/loggin";
|
|
23
30
|
import {
|
|
24
31
|
createGriddoListPages,
|
|
25
32
|
createGriddoMultiPages,
|
|
26
33
|
createGriddoSinglePage,
|
|
27
34
|
getMultiPageElements,
|
|
28
35
|
getPaginatedPages,
|
|
29
|
-
} from "
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
getZombiePagesInStore,
|
|
34
|
-
removeOrphanSites,
|
|
35
|
-
removeSitePagesFromStore,
|
|
36
|
-
saveRenderInfoInStore,
|
|
37
|
-
saveSitePagesInStore,
|
|
38
|
-
} from "../utils/store";
|
|
39
|
-
|
|
40
|
-
const renderId = new Date().valueOf().toString();
|
|
41
|
-
const { griddoVersion, paths } = getConfig();
|
|
42
|
-
const { __cx } = paths();
|
|
43
|
-
const storeDir = path.join(__cx, "store");
|
|
36
|
+
} from "./pages";
|
|
37
|
+
import { getReferenceFieldData } from "./reference-fields";
|
|
38
|
+
import { getRenderPathsHydratedWithDomainFromDB } from "./render";
|
|
39
|
+
import { getPage } from "./sites";
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
* Fetch, process and save object pages and sites data into the file system to
|
|
47
|
-
* be consumed by other services (Griddo itself, Adapters, etc.)
|
|
48
|
-
*/
|
|
49
|
-
async function createStore(domain: string) {
|
|
50
|
-
console.info(`API calls with ${envs.GRIDDO_API_CONCURRENCY_COUNT} threads`);
|
|
51
|
-
console.info(`API URL ${envs.GRIDDO_API_URL as string}`);
|
|
41
|
+
const renderId = Date.now().toString();
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const buildProcessData: BuildProcessData = {};
|
|
43
|
+
function guessSiteNeedsToBeRenderedFromScratch() {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
57
46
|
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
function listSitesLog(title: string, sites: Site[]) {
|
|
48
|
+
const maxline = Math.max(
|
|
49
|
+
...sites.map((s) => s.name.length + (s.shouldBeUpdated ? 1 : 0) + s.id.toString().length),
|
|
50
|
+
);
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
const sitesStr = sites.map((s) => {
|
|
53
|
+
const shouldBeUpdated = s.shouldBeUpdated ? "*" : "";
|
|
54
|
+
const lineLen = s.name.length + shouldBeUpdated.length + s.id.toString().length;
|
|
55
|
+
const padding = " ".repeat(maxline - lineLen);
|
|
56
|
+
return `${brush.bold(s.name)} ${brush.dim(`(${s.id})`)} ${shouldBeUpdated} ${padding}${brush.dim("-")} ${brush.dim(s.slug)}`;
|
|
57
|
+
});
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
const sitesOutput = sitesStr.length > 0 ? `\n\n${sitesStr.join("\n")}` : brush.dim("--none--\n");
|
|
60
|
+
|
|
61
|
+
GriddoLog.log(`
|
|
62
|
+
${title} ${sitesOutput}`);
|
|
63
|
+
}
|
|
67
64
|
|
|
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
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Fetch, process and save object pages and sites data into the file system to
|
|
67
|
+
* be consumed by other services (Griddo itself, Adapters, etc.)
|
|
68
|
+
*/
|
|
69
|
+
async function createStore(options: {
|
|
70
|
+
domain: string;
|
|
71
|
+
renderMode: RenderMode;
|
|
72
|
+
griddoVersion: string;
|
|
73
|
+
basePath: string;
|
|
74
|
+
}) {
|
|
75
|
+
console.info(`API calls with ${GRIDDO_API_CONCURRENCY_COUNT} threads`);
|
|
76
|
+
console.info(`API URL ${GRIDDO_API_URL as string}`);
|
|
77
|
+
|
|
78
|
+
const { renderMode, domain, griddoVersion, basePath } = options;
|
|
79
|
+
const renderFromScratch = renderMode === RENDER_MODE.FROM_SCRATCH;
|
|
80
|
+
const storeDir = path.join(basePath, "store");
|
|
81
|
+
|
|
82
|
+
// Vars to save later in the report file
|
|
83
|
+
const createdPages: number[] = [];
|
|
84
|
+
const buildProcessData: BuildProcessData = {};
|
|
85
|
+
|
|
86
|
+
// Get sites objects to publish and unpublish from this domain
|
|
87
|
+
const { sitesToPublish, sitesToUnpublish } = await getSitesToRender(domain);
|
|
88
|
+
|
|
89
|
+
listSitesLog("Sites to publish:", sitesToPublish);
|
|
90
|
+
listSitesLog("Sites to unpublish:", sitesToUnpublish);
|
|
91
|
+
|
|
92
|
+
// Send unpublished sites to API.
|
|
93
|
+
await unpublishSites(sitesToUnpublish);
|
|
94
|
+
|
|
95
|
+
// Eliminamos posibles sites que estén en el store pero que no deberían
|
|
96
|
+
// porque han sido cambiados de dominio. Si han sido despublicados ya se
|
|
97
|
+
// despublican bien porque entran en `sitesToUnpublish`
|
|
98
|
+
await removeOrphanSites(sitesToPublish, domain);
|
|
99
|
+
|
|
100
|
+
const allPagesToRemoveFromBuild: number[] = [];
|
|
101
|
+
// let numberOfFinalActivePages: number[] = [];
|
|
102
|
+
|
|
103
|
+
for (const site of sitesToUnpublish) {
|
|
104
|
+
const { pagesStatus } = site;
|
|
105
|
+
|
|
106
|
+
// Añadimos a allPagesToRemoveFromBuild todas las páginas de un site
|
|
107
|
+
// para despublicar.
|
|
108
|
+
allPagesToRemoveFromBuild.push(
|
|
109
|
+
...pagesStatus.active,
|
|
110
|
+
...pagesStatus.offlinePending,
|
|
111
|
+
...pagesStatus.uploadPending,
|
|
112
|
+
...pagesStatus.deleted,
|
|
113
|
+
...pagesStatus.offline,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (const site of sitesToPublish) {
|
|
118
|
+
const { id: siteId, slug: siteSlug, theme, favicon, pagesStatus } = site;
|
|
119
|
+
const siteDirName = siteId.toString();
|
|
120
|
+
|
|
121
|
+
allPagesToRemoveFromBuild.push(...pagesStatus.offlinePending, ...pagesStatus.deleted);
|
|
122
|
+
|
|
123
|
+
const {
|
|
124
|
+
siteInfo,
|
|
125
|
+
siteHash,
|
|
126
|
+
unpublishHashes,
|
|
127
|
+
siteLangs,
|
|
128
|
+
defaultLang,
|
|
129
|
+
headers,
|
|
130
|
+
footers,
|
|
131
|
+
socials,
|
|
132
|
+
} = await getSiteData(siteId);
|
|
133
|
+
|
|
134
|
+
const {
|
|
135
|
+
cloudinaryName,
|
|
136
|
+
useMetaTitle,
|
|
137
|
+
useMetaKeywords,
|
|
138
|
+
showBasicMetaRobots,
|
|
139
|
+
avoidHrefLangsOnCanonicals,
|
|
140
|
+
avoidSelfReferenceCanonicals,
|
|
141
|
+
avoidHrefLangXDefault,
|
|
142
|
+
avoidDebugMetas,
|
|
143
|
+
} = await get<Settings>({ endpoint: SETTINGS });
|
|
144
|
+
|
|
145
|
+
buildProcessData[siteId] = {
|
|
146
|
+
siteHash,
|
|
147
|
+
unpublishHashes,
|
|
148
|
+
publishHashes: [],
|
|
149
|
+
publishPagesIds: [],
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const NavService = new NavigationService();
|
|
153
|
+
NavService.navigations = { headers, footers };
|
|
154
|
+
|
|
155
|
+
site.languages = siteLangs;
|
|
156
|
+
|
|
157
|
+
const shouldUpdateSite = await updatedSiteHash(siteId, siteHash);
|
|
158
|
+
|
|
159
|
+
const siteScript = siteInfo.siteScript;
|
|
160
|
+
|
|
161
|
+
const siteMetadata = {
|
|
162
|
+
siteUrl: siteInfo.slug,
|
|
163
|
+
title: siteInfo.name,
|
|
164
|
+
favicon,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const additionalInfo = {
|
|
168
|
+
baseUrl: GRIDDO_API_URL,
|
|
169
|
+
publicBaseUrl: GRIDDO_PUBLIC_API_URL,
|
|
170
|
+
instance: GRIDDO_REACT_APP_INSTANCE,
|
|
171
|
+
siteSlug,
|
|
172
|
+
theme,
|
|
173
|
+
siteMetadata,
|
|
174
|
+
socials,
|
|
175
|
+
siteLangs,
|
|
176
|
+
cloudinaryName,
|
|
177
|
+
griddoVersion,
|
|
178
|
+
siteOptions: {
|
|
100
179
|
useMetaTitle,
|
|
101
180
|
useMetaKeywords,
|
|
102
181
|
showBasicMetaRobots,
|
|
@@ -104,257 +183,211 @@ async function createStore(domain: string) {
|
|
|
104
183
|
avoidSelfReferenceCanonicals,
|
|
105
184
|
avoidHrefLangXDefault,
|
|
106
185
|
avoidDebugMetas,
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/// Creates the store directory for each site using the id
|
|
157
|
-
fs.mkdirSync(path.join(storeDir, siteDirName), {
|
|
158
|
-
recursive: true,
|
|
186
|
+
},
|
|
187
|
+
siteScript,
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
GriddoLog.info(`Getting pages from ${site.name} site`);
|
|
191
|
+
|
|
192
|
+
/// Creates the store directory for each site using the id
|
|
193
|
+
await fsp.mkdir(path.join(storeDir, siteDirName), {
|
|
194
|
+
recursive: true,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// -------------------------------------------------------------------------
|
|
198
|
+
// Pages loop promise creation
|
|
199
|
+
// -------------------------------------------------------------------------
|
|
200
|
+
// Async function that process every page for one site to use later in the
|
|
201
|
+
// `Promise.all` with pLimit.
|
|
202
|
+
const fetchSitePageAndSaveInStore = async (siteIdName: string, pageId: number) => {
|
|
203
|
+
// Here will be store every page returned by the API and processed
|
|
204
|
+
let griddoPageObjects: GriddoPageObject[] = [];
|
|
205
|
+
|
|
206
|
+
// Get page data
|
|
207
|
+
const page = await getPage(pageId, shouldUpdateSite);
|
|
208
|
+
|
|
209
|
+
// Probably a 404
|
|
210
|
+
if (!page) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Update Array of page ids
|
|
215
|
+
createdPages.push(pageId);
|
|
216
|
+
|
|
217
|
+
// TODO: Use structuredClone() when node 18 is available.
|
|
218
|
+
// SHAME: This new pageAdditionalInfo needs to be a copy because
|
|
219
|
+
// additionalInfo referenced from outside this function and
|
|
220
|
+
// its used by other pages.
|
|
221
|
+
const pageAdditionalInfo = JSON.parse(JSON.stringify(additionalInfo)) as PageAdditionalInfo;
|
|
222
|
+
|
|
223
|
+
// Updated with navigations (header & footer)
|
|
224
|
+
pageAdditionalInfo.navigations = NavService.getPageNavigations(page);
|
|
225
|
+
|
|
226
|
+
// Content Type Data Query.
|
|
227
|
+
// Where the pair `hasDistributorData:true` /
|
|
228
|
+
// `getStaticData:true` and `data` prop exists, this function
|
|
229
|
+
// will attach a `queriedItems` prop with the result of the
|
|
230
|
+
// fetch for the data.
|
|
231
|
+
const template = await getReferenceFieldData({
|
|
232
|
+
page,
|
|
233
|
+
cacheKey: renderId,
|
|
159
234
|
});
|
|
160
235
|
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
//
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
griddoPageObjects = await createGriddoMultiPages(
|
|
253
|
-
griddoMultipage,
|
|
254
|
-
pageAdditionalInfo,
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// >> Single template <<
|
|
259
|
-
if (isSinglePage) {
|
|
260
|
-
const griddoSinglePage = page as GriddoSinglePage;
|
|
261
|
-
|
|
262
|
-
// The `template` key with the (maybe) data (ReferenceField) items queried
|
|
263
|
-
griddoSinglePage.template = template;
|
|
264
|
-
griddoSinglePage.defaultLang = defaultLang;
|
|
265
|
-
|
|
266
|
-
griddoPageObjects = [
|
|
267
|
-
await createGriddoSinglePage(griddoSinglePage, pageAdditionalInfo),
|
|
268
|
-
];
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// Upload only the valid pages hashes or ids of pages that has
|
|
272
|
-
// been changed or created.
|
|
273
|
-
if (page.hash !== null) {
|
|
274
|
-
buildProcessData[siteId].publishHashes.push(page.hash);
|
|
275
|
-
buildProcessData[siteId].publishPagesIds.push(page.id);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Save build data to store
|
|
279
|
-
saveSitePagesInStore(siteIdName, griddoPageObjects);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
// Pages that needs to be fetched from the API and written to the
|
|
283
|
-
// store.
|
|
284
|
-
const pagesToFetchFromAPI = [
|
|
285
|
-
// These pages are news or has been updated.
|
|
286
|
-
...pagesStatus.uploadPending,
|
|
287
|
-
// You should take into account the pages that, even though they are
|
|
288
|
-
// already published and therefore should be avoided from requesting
|
|
289
|
-
// them to the API, are not in the store, probably due to a failed
|
|
290
|
-
// render. In that case, you have to request them again from the API
|
|
291
|
-
// to include them in the store.
|
|
292
|
-
...getMissingPublishedPagesInStore(siteDirName, pagesStatus.active),
|
|
293
|
-
];
|
|
294
|
-
|
|
295
|
-
// Create pages to the store. First requesting from API,
|
|
296
|
-
// transform, etc., and then writing them to disk.
|
|
297
|
-
const limit = pLimit(envs.GRIDDO_API_CONCURRENCY_COUNT);
|
|
298
|
-
const pagesToStore = pagesToFetchFromAPI.map((id: number) =>
|
|
299
|
-
limit(() => fetchSitePageAndSaveInStore(siteDirName, id)),
|
|
300
|
-
);
|
|
301
|
-
|
|
302
|
-
await Promise.all(pagesToStore);
|
|
303
|
-
|
|
304
|
-
// @ts-expect-error Mutate pagesStatus for reading pourposes.
|
|
305
|
-
pagesStatus.zombie = getZombiePagesInStore(siteDirName, [
|
|
306
|
-
...pagesStatus.active,
|
|
307
|
-
...pagesStatus.uploadPending,
|
|
308
|
-
]);
|
|
309
|
-
|
|
310
|
-
// Delete pages from the store removing them from disk.
|
|
311
|
-
removeSitePagesFromStore(siteDirName, [
|
|
312
|
-
pagesStatus.deleted,
|
|
313
|
-
pagesStatus.offline,
|
|
314
|
-
pagesStatus.offlinePending,
|
|
315
|
-
// @ts-expect-error Mutate pagesStatus for reading pourposes.
|
|
316
|
-
pagesStatus.zombie,
|
|
317
|
-
]);
|
|
236
|
+
// MultiPage Query
|
|
237
|
+
// Where the pair `hasGriddoMultiPage:true` prop exists, this function
|
|
238
|
+
// will process the schema and return a multiPageElemtens array to use
|
|
239
|
+
// in `createGriddoMultiPages()`
|
|
240
|
+
const multiPageElements = await getMultiPageElements(template);
|
|
241
|
+
|
|
242
|
+
// -----------------------------------------------------------------------
|
|
243
|
+
// Build Griddo page objects.
|
|
244
|
+
// -----------------------------------------------------------------------
|
|
245
|
+
// A page from the API could be one of those:
|
|
246
|
+
// - List with pagination (static list template): needs to be splitted in n pages
|
|
247
|
+
// - Multi-page module: needs to be splitted in n pages
|
|
248
|
+
// - Single: just one page
|
|
249
|
+
|
|
250
|
+
// Griddo page types
|
|
251
|
+
const isStaticListPage = page?.mode === "list" || page?.mode === "paginated-data";
|
|
252
|
+
const isMultiPage = !isStaticListPage && multiPageElements;
|
|
253
|
+
const isSinglePage = !isMultiPage && !isStaticListPage;
|
|
254
|
+
|
|
255
|
+
// >> List (static list template) <<
|
|
256
|
+
if (isStaticListPage) {
|
|
257
|
+
const griddoListPage = {
|
|
258
|
+
page: page,
|
|
259
|
+
pages: getPaginatedPages(template),
|
|
260
|
+
isRoot: false,
|
|
261
|
+
defaultLang: defaultLang,
|
|
262
|
+
template: template,
|
|
263
|
+
totalQueriedItems: template.queriedItems,
|
|
264
|
+
} as GriddoListPage;
|
|
265
|
+
|
|
266
|
+
// pageObjects = await createGriddoListPages({ adapter: "Gatsby" })
|
|
267
|
+
griddoPageObjects = await createGriddoListPages(griddoListPage, pageAdditionalInfo);
|
|
268
|
+
|
|
269
|
+
// ¿Por qué la añadimos a las páginas para borrar?
|
|
270
|
+
// Porque este tipo de páginas no está manejada por API y se crean varias páginas con el mismo ID.
|
|
271
|
+
// Esto hace que no se pueda rastrear bien el render.
|
|
272
|
+
allPagesToRemoveFromBuild.push(page.id);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// >> Multi-page <<
|
|
276
|
+
if (isMultiPage) {
|
|
277
|
+
const griddoMultipage = page as GriddoMultiPage;
|
|
278
|
+
|
|
279
|
+
// The `template` key with the (maybe) data (ReferenceField) items queried
|
|
280
|
+
griddoMultipage.template = template;
|
|
281
|
+
griddoMultipage.multiPageElements = multiPageElements;
|
|
282
|
+
griddoMultipage.defaultLang = defaultLang;
|
|
283
|
+
|
|
284
|
+
griddoPageObjects = await createGriddoMultiPages(griddoMultipage, pageAdditionalInfo);
|
|
285
|
+
|
|
286
|
+
// ¿Por qué la añadimos a las páginas para borrar?
|
|
287
|
+
// Porque este tipo de páginas no está manejada por API y se crean varias páginas con el mismo ID.
|
|
288
|
+
// Esto hace que no se pueda rastrear bien el render.
|
|
289
|
+
allPagesToRemoveFromBuild.push(page.id);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// >> Single template <<
|
|
293
|
+
if (isSinglePage) {
|
|
294
|
+
const griddoSinglePage = page as GriddoSinglePage;
|
|
295
|
+
|
|
296
|
+
// The `template` key with the (maybe) data (ReferenceField) items queried
|
|
297
|
+
griddoSinglePage.template = template;
|
|
298
|
+
griddoSinglePage.defaultLang = defaultLang;
|
|
299
|
+
|
|
300
|
+
griddoPageObjects = [await createGriddoSinglePage(griddoSinglePage, pageAdditionalInfo)];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Upload only the valid pages hashes or ids of pages that has
|
|
304
|
+
// been changed or created.
|
|
305
|
+
if (page.hash !== null) {
|
|
306
|
+
buildProcessData[siteId].publishHashes.push(page.hash);
|
|
307
|
+
buildProcessData[siteId].publishPagesIds.push(page.id);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Save build data to store
|
|
311
|
+
await saveSitePagesInStore(siteIdName, griddoPageObjects);
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// Pages that needs to be fetched from the API and written to the store.
|
|
315
|
+
const pagesToFetchFromAPI = pagesStatus.uploadPending;
|
|
316
|
+
|
|
317
|
+
// Esto es necesario porque en la BBDD las páginas pueden estar
|
|
318
|
+
// marcadas como activas (online) pero si es una máquina nueva hace
|
|
319
|
+
// falta hacerlas de nuevo...
|
|
320
|
+
// const sitePendingOfPublishing = site.isPublished && site.shouldBeUpdated;
|
|
321
|
+
const sitePendingOfPublishing = guessSiteNeedsToBeRenderedFromScratch();
|
|
322
|
+
// @todo: necesito tener un sistema par publicar todo de un site (cuando un site esté pending to publish)
|
|
323
|
+
// algo como site.status = pending | published | unpublished...
|
|
324
|
+
if (renderFromScratch || sitePendingOfPublishing) {
|
|
325
|
+
pagesToFetchFromAPI.push(...pagesStatus.active);
|
|
318
326
|
}
|
|
319
327
|
|
|
320
|
-
//
|
|
321
|
-
//
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// ( 2 ) - Render de un dominio que no tiene sites ni para publicar ni para
|
|
330
|
-
// despublicar, lo que llamamos un dominio "vacío".
|
|
331
|
-
// Entonces se eliminan las páginas "huérfanas" de la carpeta `store`
|
|
332
|
-
// así el proceso de SSG se encontrará efectivamente con un dominio "sin
|
|
333
|
-
// páginas" y "borrará" lo que exista en ese momento en el store para
|
|
334
|
-
// ese dominio y se guarda la información del render con arrays vacíos
|
|
335
|
-
// directamente en `createdPages` y `sitesToPublish`.
|
|
336
|
-
|
|
337
|
-
if (domainHasSites) {
|
|
338
|
-
// ( 1 )
|
|
339
|
-
saveRenderInfoInStore({
|
|
340
|
-
buildProcessData,
|
|
341
|
-
createdPages,
|
|
342
|
-
sitesToPublish,
|
|
343
|
-
});
|
|
344
|
-
} else {
|
|
345
|
-
// ( 2 )
|
|
346
|
-
removeAllSiteDirsFromStore();
|
|
347
|
-
saveRenderInfoInStore({
|
|
348
|
-
buildProcessData,
|
|
349
|
-
createdPages: [],
|
|
350
|
-
sitesToPublish: [],
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
} catch (e) {
|
|
354
|
-
const error = e as { message: string };
|
|
355
|
-
console.error(error.message);
|
|
356
|
-
process.exit(1);
|
|
328
|
+
// Create pages to the store. First requesting from API,
|
|
329
|
+
// transform, etc., and then writing them to disk.
|
|
330
|
+
const limit = pLimit(GRIDDO_API_CONCURRENCY_COUNT);
|
|
331
|
+
const pagesToStore = pagesToFetchFromAPI.map((id: number) =>
|
|
332
|
+
limit(() => fetchSitePageAndSaveInStore(siteDirName, id)),
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
await Promise.all(pagesToStore);
|
|
357
336
|
}
|
|
337
|
+
|
|
338
|
+
// Después de guardar en el store todos los sites y sus páginas (las que
|
|
339
|
+
// sean que hayan cambiado etc.) guardamos un archivo con la información del
|
|
340
|
+
// render para usos posteriores.
|
|
341
|
+
// Render de dominios con sites para publicar o despublicar. Se guarda la
|
|
342
|
+
// infor del render normalmente.
|
|
343
|
+
await saveRenderInfoInStore({ buildProcessData, createdPages, sitesToPublish }, domain);
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
pagesToCreate: createdPages,
|
|
347
|
+
pagesToDelete: allPagesToRemoveFromBuild,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Get site hashes from the file as an object
|
|
353
|
+
*/
|
|
354
|
+
async function getHashSites(): Promise<HashSites> {
|
|
355
|
+
const { __root } = await getRenderPathsHydratedWithDomainFromDB();
|
|
356
|
+
const apiCacheDir = path.join(__root, "apiCache");
|
|
357
|
+
const siteHasFilename = `${apiCacheDir}/siteHash.json`;
|
|
358
|
+
|
|
359
|
+
try {
|
|
360
|
+
const fileContent = await fsp.readFile(siteHasFilename, "utf8");
|
|
361
|
+
const jsonData = JSON.parse(fileContent);
|
|
362
|
+
return jsonData || {};
|
|
363
|
+
} catch {
|
|
364
|
+
return {};
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Update (write) the site hash file.
|
|
370
|
+
*
|
|
371
|
+
* @param siteId The id of the site.
|
|
372
|
+
* @param siteHash The has of the site.
|
|
373
|
+
*/
|
|
374
|
+
async function updatedSiteHash(siteId: number, siteHash: SiteHash) {
|
|
375
|
+
const allHash = await getHashSites();
|
|
376
|
+
const lastHash = allHash[siteId];
|
|
377
|
+
const currentHash = siteHash || lastHash || Date.now();
|
|
378
|
+
|
|
379
|
+
const { __root } = await getRenderPathsHydratedWithDomainFromDB();
|
|
380
|
+
const apiCacheDir = path.join(__root, "apiCache");
|
|
381
|
+
const siteHasFilename = `${apiCacheDir}/siteHash.json`;
|
|
382
|
+
|
|
383
|
+
if (currentHash !== lastHash) {
|
|
384
|
+
allHash[siteId] = currentHash;
|
|
385
|
+
await fsp.writeFile(siteHasFilename, JSON.stringify(allHash), {
|
|
386
|
+
encoding: "utf-8",
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
return currentHash.toString();
|
|
358
391
|
}
|
|
359
392
|
|
|
360
393
|
export { createStore };
|