@griddo/cx 11.9.17 → 11.10.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 +40 -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 +404 -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 +17 -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 +56 -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 +142 -0
- package/exporter/commands/end-render.ts +53 -87
- package/exporter/commands/prepare-assets-directory.ts +35 -0
- package/exporter/commands/prepare-domains-render.ts +150 -33
- 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 +14 -65
- package/exporter/commands/upload-search-content.ts +204 -26
- package/exporter/core/GriddoLog.ts +45 -0
- package/exporter/core/check-env-health.ts +203 -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 +137 -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 +58 -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 +65 -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 +117 -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 -78
- 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 +81 -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 -26
- 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 -182
- package/exporter/adapters/gatsby/utils.ts +0 -186
- 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
package/build/utils/alerts.d.ts
DELETED
package/build/utils/cache.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Petition } from "../types/global";
|
|
2
|
-
import type { SiteHash } from "../types/sites";
|
|
3
|
-
/**
|
|
4
|
-
* Creates an `apiCache` dir to store pages fetched from them API.
|
|
5
|
-
*/
|
|
6
|
-
declare function createAPICacheDir(): void;
|
|
7
|
-
/**
|
|
8
|
-
* Generate a filename with a hash using a string.
|
|
9
|
-
*
|
|
10
|
-
* @todo Merge with generateFilenameWithHash
|
|
11
|
-
* @param data A string to create a sha256 based on.
|
|
12
|
-
*/
|
|
13
|
-
declare function createSha256(data: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* Save a file using a hash name.
|
|
16
|
-
*
|
|
17
|
-
* @param petition An object.
|
|
18
|
-
* @param content Content to be saved.
|
|
19
|
-
*/
|
|
20
|
-
declare function saveCache<T>(petition: Petition, content: T): void;
|
|
21
|
-
/**
|
|
22
|
-
* Search in the `apiCache` dir for a file using the petition as hash generator.
|
|
23
|
-
* Return the file content if found or null if not.
|
|
24
|
-
*
|
|
25
|
-
* @param petition An object
|
|
26
|
-
*/
|
|
27
|
-
declare function searchCacheData<T>(petition: Petition): T | null;
|
|
28
|
-
/**
|
|
29
|
-
* Update (write) the site hash file.
|
|
30
|
-
*
|
|
31
|
-
* @param siteId The id of the site.
|
|
32
|
-
* @param siteHash The has of the site.
|
|
33
|
-
*/
|
|
34
|
-
declare function updatedSiteHash(siteId: number, siteHash: SiteHash): string;
|
|
35
|
-
export { createAPICacheDir, createSha256, saveCache, searchCacheData, updatedSiteHash, };
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { APIResponses } from "../types/api";
|
|
2
|
-
import type { CXConfig, LifeCyclesNames, LifeCycleSteps } from "../types/global";
|
|
3
|
-
declare const instanceRootDir: string;
|
|
4
|
-
/**
|
|
5
|
-
* Returns the configuration file content.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const config = getConfig()
|
|
9
|
-
* const { __cx } = config.paths()
|
|
10
|
-
* const { griddoVersion, proDomain } = config
|
|
11
|
-
*/
|
|
12
|
-
declare function getConfig(): CXConfig;
|
|
13
|
-
/**
|
|
14
|
-
* Returns true for "true", "on", true and positive numbers.
|
|
15
|
-
* Returns false for "false", "off", false, 0, negative integers and anything else.
|
|
16
|
-
*/
|
|
17
|
-
declare function isTruthy(value: any): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Walk a directory and returns the file pathts.
|
|
20
|
-
*
|
|
21
|
-
* @param dir A directory path.
|
|
22
|
-
*/
|
|
23
|
-
declare function walk(dir: string): string[];
|
|
24
|
-
/**
|
|
25
|
-
* Walk a directory and returns the JSON file absolute paths with one level of depth.
|
|
26
|
-
* Bypass the `metadata` folder.
|
|
27
|
-
* /abs/.../sotre/<siteId>/jsonfile.json
|
|
28
|
-
* /abs/.../sotre/<siteId>/jsonfile.json
|
|
29
|
-
* /abs/.../sotre/<siteId>/jsonfile.json
|
|
30
|
-
* /abs/.../sotre/<siteId>/jsonfile.json
|
|
31
|
-
*/
|
|
32
|
-
declare function walkStore(dir: string): Array<string>;
|
|
33
|
-
/**
|
|
34
|
-
* Custom delay using the "promise hack",
|
|
35
|
-
*
|
|
36
|
-
* @param ms Amount of miliseconds to be delayed
|
|
37
|
-
*/
|
|
38
|
-
declare function delay(ms: number): Promise<unknown>;
|
|
39
|
-
/**
|
|
40
|
-
* Converts milliseconds to seconds with a fixed number of decimals.
|
|
41
|
-
*
|
|
42
|
-
* @param ms The number in milliseconds.
|
|
43
|
-
* @param fixed The amount of fixed decimals.
|
|
44
|
-
* @returns The converted number in seconds with the fixed number of decimals.
|
|
45
|
-
*/
|
|
46
|
-
declare function msToSec(ms: number, decimals?: number): string;
|
|
47
|
-
/**
|
|
48
|
-
* Return a siteID from a response object if exist
|
|
49
|
-
* @param response A response object
|
|
50
|
-
*/
|
|
51
|
-
declare function getSafeSiteId(response: APIResponses): number | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Remove props from an object
|
|
54
|
-
*
|
|
55
|
-
* @param obj The object
|
|
56
|
-
* @param props An array of props to be removed
|
|
57
|
-
*/
|
|
58
|
-
declare function removeProperties(obj: Record<string, unknown>, props: Array<string>): void;
|
|
59
|
-
/**
|
|
60
|
-
* Remove unused files (old) inside the `apiCache` dir
|
|
61
|
-
*
|
|
62
|
-
* @todo remove other file types: sites, socials, etc..
|
|
63
|
-
*/
|
|
64
|
-
declare function sanitizeAPICacheDir(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Measures the execution time of a series of sync or async functions.
|
|
67
|
-
*
|
|
68
|
-
* @async
|
|
69
|
-
* @param functions - Functions to be executed to measure their execution time.
|
|
70
|
-
* @returns A promise that resolves with the total execution time in seconds.
|
|
71
|
-
*/
|
|
72
|
-
declare function measureExecutionTime(functions: Array<(...args: Array<unknown>) => unknown | Promise<unknown>>): Promise<number>;
|
|
73
|
-
/**
|
|
74
|
-
* Pause the process until a key is pressed.
|
|
75
|
-
*
|
|
76
|
-
* @param title
|
|
77
|
-
* @returns
|
|
78
|
-
*/
|
|
79
|
-
declare function pause(title: string): Promise<void> | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Executes a life cycle process, which involves executing an array of
|
|
82
|
-
* functions, printing to the console, and handling errors with optional
|
|
83
|
-
* retries.
|
|
84
|
-
*
|
|
85
|
-
* @async
|
|
86
|
-
* @param name - The name of the life cycle.
|
|
87
|
-
* @param options - The arguments object.
|
|
88
|
-
* @param options.steps - An array of functions to execute.
|
|
89
|
-
* @returns - A promise that resolves when the life cycle process is completed.
|
|
90
|
-
*/
|
|
91
|
-
declare function doLifeCycle(name: LifeCyclesNames, steps: LifeCycleSteps): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* Creates additional files after the render: sitemaps, robots and a report of
|
|
94
|
-
* the finished render.
|
|
95
|
-
*
|
|
96
|
-
* @async
|
|
97
|
-
* @param domain
|
|
98
|
-
*/
|
|
99
|
-
declare function createDomainMetadata(domain: string): Promise<void>;
|
|
100
|
-
declare function removeAllSiteDirsFromStore(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Save render information to a file to use as debug log.
|
|
103
|
-
*
|
|
104
|
-
* This information will **not** be sent to any API.
|
|
105
|
-
*/
|
|
106
|
-
declare function saveBuildEndLogs(): void;
|
|
107
|
-
export { createDomainMetadata, delay, doLifeCycle, getConfig, getSafeSiteId, instanceRootDir, isTruthy, measureExecutionTime, msToSec, pause, removeAllSiteDirsFromStore, removeProperties, sanitizeAPICacheDir, saveBuildEndLogs, walk, walkStore, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Download all data: sites, pages etc.. from the instance private Griddo API.
|
|
3
|
-
* Then you can use the generator funcion `getBuildPagesFromStore()` to get the pages and
|
|
4
|
-
* `getBuildMetadata()` to get build and sites metadata as objects. Both from
|
|
5
|
-
* exporter utils sites dir.
|
|
6
|
-
*/
|
|
7
|
-
declare function createDomainRenderData(domain: string): Promise<void>;
|
|
8
|
-
export { createDomainRenderData };
|
package/build/utils/domains.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Domains } from "../types/global";
|
|
2
|
-
/**
|
|
3
|
-
* Return an array of domains name (string) of the current instance.
|
|
4
|
-
*/
|
|
5
|
-
declare function getInstanceDomains(): Promise<string[]>;
|
|
6
|
-
/**
|
|
7
|
-
* Return an unique array of domains, filtered without "/".
|
|
8
|
-
*
|
|
9
|
-
* @param domains An array of domains
|
|
10
|
-
* @see Domains
|
|
11
|
-
*/
|
|
12
|
-
declare function getDomainSlugs(domains: Domains): string[];
|
|
13
|
-
export { getInstanceDomains, getDomainSlugs };
|
package/build/utils/folders.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { type MakeDirectoryOptions } from "fs-extra";
|
|
2
|
-
/**
|
|
3
|
-
* Remove an empty directory from the basePath recursively.
|
|
4
|
-
* If the directory has only .xml files it will handle as empty too (empty site)
|
|
5
|
-
*
|
|
6
|
-
* @param baseDir - The base directory.
|
|
7
|
-
*/
|
|
8
|
-
declare function deleteDisposableSiteDirs(): void;
|
|
9
|
-
/**
|
|
10
|
-
* Creates multiple directories.
|
|
11
|
-
*
|
|
12
|
-
* @param dirs - An array of directory paths.
|
|
13
|
-
* @param options - Same option as `fs.mkdirSync()`
|
|
14
|
-
*/
|
|
15
|
-
declare function createArtifacts(dirs: Array<string>, options?: MakeDirectoryOptions): void;
|
|
16
|
-
declare function renameArtifact(src: string, dst: string): void;
|
|
17
|
-
/**
|
|
18
|
-
* Copy multiple directories with backup option.
|
|
19
|
-
*
|
|
20
|
-
* @param src - Source directory.
|
|
21
|
-
* @param dst - Destination directory.
|
|
22
|
-
* @param dirs - Directories to copy.
|
|
23
|
-
* @param options.withBackup - Create a previous backup before copy.
|
|
24
|
-
*/
|
|
25
|
-
declare function copyArtifacts(src: string, dst: string, dirs: Array<string>, options?: {
|
|
26
|
-
withBackup: boolean;
|
|
27
|
-
}): void;
|
|
28
|
-
/**
|
|
29
|
-
* Move artifacts between cx-paths
|
|
30
|
-
*
|
|
31
|
-
* @param src - Source directory.
|
|
32
|
-
* @param dst - Destination directory.
|
|
33
|
-
* @param dirs - Directories to move.
|
|
34
|
-
* @param options - Options.
|
|
35
|
-
*/
|
|
36
|
-
declare function moveArtifacts(src: string, dst: string, dirs: Array<string>, options?: {
|
|
37
|
-
withBackup?: boolean;
|
|
38
|
-
override?: boolean;
|
|
39
|
-
}): void;
|
|
40
|
-
/**
|
|
41
|
-
* Removes multiple artifact directories.
|
|
42
|
-
*
|
|
43
|
-
* @param artifacts - An array of artifact directory paths.
|
|
44
|
-
*/
|
|
45
|
-
declare function removeArtifacts(artifacts: Array<string>): void;
|
|
46
|
-
/**
|
|
47
|
-
* Elimina todas las páginas del store (de todos los sites) cuyo nombre empiece con un guión "-".
|
|
48
|
-
* Estas páginas son "virtuales" y no tienen ids desde API por lo que mantenerlas en el store es un problema cuando se hacen modificaciones en la página "madre".
|
|
49
|
-
* La solución por ahora es borrarlas del store y rehacerlas en todos los renders.
|
|
50
|
-
*/
|
|
51
|
-
declare function removeVirtualPagesFromStore(): Promise<void>;
|
|
52
|
-
declare function prependFileSync(filePath: string, content: string): void;
|
|
53
|
-
export { copyArtifacts, createArtifacts, deleteDisposableSiteDirs, moveArtifacts, prependFileSync, removeArtifacts, removeVirtualPagesFromStore, renameArtifact, };
|
package/build/utils/loggin.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Site } from "../types/sites";
|
|
2
|
-
/**
|
|
3
|
-
* Custom basic logging function controlled by a environment variable.
|
|
4
|
-
*
|
|
5
|
-
* @param str The string to be logged.
|
|
6
|
-
*/
|
|
7
|
-
declare function verboseLog(str: string): void;
|
|
8
|
-
/**
|
|
9
|
-
* Custom log inside a line-box.
|
|
10
|
-
*
|
|
11
|
-
* @param stringValue The string to be logged.
|
|
12
|
-
* @param paddingInline The number of white spaces inside the box at left and right.
|
|
13
|
-
* @param paddingBlock The number of white spaces inside the box at top and bottom.
|
|
14
|
-
*/
|
|
15
|
-
declare function boxLog(stringValue: string, title?: string, paddingInline?: number, paddingBlock?: number): void;
|
|
16
|
-
/**
|
|
17
|
-
* Custom basic logging function controlled by a environment variable.
|
|
18
|
-
* Strip double spaces.
|
|
19
|
-
*
|
|
20
|
-
* @param str The string to be logged.
|
|
21
|
-
*/
|
|
22
|
-
declare function buildLog(str: string): void;
|
|
23
|
-
/**
|
|
24
|
-
* Console log with a blue color in the info prefix.
|
|
25
|
-
* @param str The string to be logged.
|
|
26
|
-
*/
|
|
27
|
-
declare function infoLog(str: string): void;
|
|
28
|
-
/**
|
|
29
|
-
* Console log with a green color in the success prefix.
|
|
30
|
-
* @param str The string to be logged.
|
|
31
|
-
*/
|
|
32
|
-
declare function successLog(str: string): void;
|
|
33
|
-
/**
|
|
34
|
-
* Internal log
|
|
35
|
-
* @param values The values to be logged.
|
|
36
|
-
*/
|
|
37
|
-
declare function debugLog(...values: Array<unknown>): void;
|
|
38
|
-
/**
|
|
39
|
-
* Return a scale size colors with a number and a measure string (KB by default).
|
|
40
|
-
*
|
|
41
|
-
* @param size The page size in KB.
|
|
42
|
-
* @param measure The measure string to be added in the log.
|
|
43
|
-
*/
|
|
44
|
-
declare function pageSizeLog(size: number, measure?: string): string;
|
|
45
|
-
/**
|
|
46
|
-
* Console log the Griddo exporter version.
|
|
47
|
-
*/
|
|
48
|
-
declare function showExporterVersion(): void;
|
|
49
|
-
declare function listSitesLog(title: string, sites: Array<Site>): void;
|
|
50
|
-
declare function errorLabelLog(msg: string): void;
|
|
51
|
-
export { boxLog, buildLog, debugLog, errorLabelLog, infoLog, listSitesLog, pageSizeLog, showExporterVersion, successLog, verboseLog, };
|
package/build/utils/render.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a sentinel file with the current date and time.
|
|
3
|
-
* This file is used to track later if node_modules/@griddo/cx was cleaned by a
|
|
4
|
-
* npm install from a deploy.
|
|
5
|
-
*/
|
|
6
|
-
declare function createSentinelRenderFile(): void;
|
|
7
|
-
declare function deleteSentinelRenderFile(): void;
|
|
8
|
-
declare function isValidRender(): void;
|
|
9
|
-
/**
|
|
10
|
-
* Send the default registers through Griddo alerts.
|
|
11
|
-
*/
|
|
12
|
-
declare function sendGriddoDefaultAlerts(): Promise<void>;
|
|
13
|
-
export { createSentinelRenderFile, deleteSentinelRenderFile, isValidRender, sendGriddoDefaultAlerts, };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PostSearchInfoResponse } from "../types/api";
|
|
2
|
-
import type { PostSearchInfoProps } from "../types/global";
|
|
3
|
-
/**
|
|
4
|
-
* Save in the BBDD the content of a page parsed without HTML tags.
|
|
5
|
-
*
|
|
6
|
-
* @param props Object with parts of the final page object to be saved in the BBDD.
|
|
7
|
-
*/
|
|
8
|
-
declare function postSearchInfo(props: PostSearchInfoProps): Promise<PostSearchInfoResponse>;
|
|
9
|
-
/**
|
|
10
|
-
* Function that search in the `/public` dir the content info of the pages and
|
|
11
|
-
* send it to the search table in the ddbb using the API.
|
|
12
|
-
*/
|
|
13
|
-
declare function uploadRenderedSearchContentToAPI(distDomainPath: string, domain: string): Promise<void>;
|
|
14
|
-
declare function startAIEmbeddings(): Promise<void>;
|
|
15
|
-
export { postSearchInfo, startAIEmbeddings, uploadRenderedSearchContentToAPI };
|
package/build/utils/sites.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Site, SiteData } from "../types/sites";
|
|
2
|
-
/**
|
|
3
|
-
* Check the instance sites and returns site prepared to be published and unpublished.
|
|
4
|
-
*/
|
|
5
|
-
declare function getSitesToRender(domain: string): Promise<{
|
|
6
|
-
sitesToPublish: Site[];
|
|
7
|
-
sitesToUnpublish: Site[];
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Unpublish an array of sites sending the information to the API.
|
|
11
|
-
*
|
|
12
|
-
* @param sites An array of sites
|
|
13
|
-
* @see https://griddoio.notion.site/Sites-d7bb0b7cb8d24894a5337e1139fc3d09#2019d3255bda4d219c7e19cf28d0c4fe
|
|
14
|
-
*/
|
|
15
|
-
declare function unpublishSites(sites: Array<Site>): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Return a single site generic data.
|
|
18
|
-
*
|
|
19
|
-
* @param siteID The site id.
|
|
20
|
-
* @see SiteData
|
|
21
|
-
*/
|
|
22
|
-
declare function getSiteData(siteID: number): Promise<SiteData>;
|
|
23
|
-
/**
|
|
24
|
-
* Save a file with the end of build process to use as `build-end` signal.
|
|
25
|
-
*/
|
|
26
|
-
declare function generateBuildReport(): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Generate sitemaps and save them into file system.
|
|
29
|
-
*/
|
|
30
|
-
declare function generateSitemaps(): Promise<void>;
|
|
31
|
-
export { generateBuildReport, generateSitemaps, getSiteData, getSitesToRender, unpublishSites, };
|
package/build/utils/store.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { BuildMetaData } from "../types/api";
|
|
2
|
-
import type { RenderInfo } from "../types/global";
|
|
3
|
-
import type { GriddoPageObject } from "../types/pages";
|
|
4
|
-
import type { Site } from "../types/sites";
|
|
5
|
-
/**
|
|
6
|
-
* Read all path pages stored in the `store` Griddo directory and returns the
|
|
7
|
-
* absolute file path.
|
|
8
|
-
*
|
|
9
|
-
* @param domain - The domain to get the pages from.
|
|
10
|
-
*/
|
|
11
|
-
declare function getBuildPagesFromCachedStore<PageType extends GriddoPageObject>(domain: string): Generator<PageType, void, unknown>;
|
|
12
|
-
/**
|
|
13
|
-
* Read all pages stored in the `store` Griddo directory and returns one by one
|
|
14
|
-
* with a generator.
|
|
15
|
-
*
|
|
16
|
-
* @param basePath - Base directory to get pages from.
|
|
17
|
-
* @param options.withSizeProp - Add size prop to the page object.
|
|
18
|
-
* @todo throw error if the basePath is not an store folder
|
|
19
|
-
*/
|
|
20
|
-
declare function getBuildPagesFromStore<PageType extends GriddoPageObject>(args?: {
|
|
21
|
-
basePath?: string;
|
|
22
|
-
withSizeProp?: boolean;
|
|
23
|
-
}): Generator<PageType, void, unknown>;
|
|
24
|
-
/**
|
|
25
|
-
* Read all pages stored in `store` Griddo directory and return the absolute
|
|
26
|
-
* path.
|
|
27
|
-
*/
|
|
28
|
-
declare function getBuildPagesPath(): string[];
|
|
29
|
-
/**
|
|
30
|
-
* Get the build metadata from the Store.
|
|
31
|
-
*/
|
|
32
|
-
declare function getBuildMetadata(): Promise<BuildMetaData>;
|
|
33
|
-
/**
|
|
34
|
-
* Write render info into a file.
|
|
35
|
-
* @param renderInfo - Data that will be saved related to the render process.
|
|
36
|
-
*/
|
|
37
|
-
declare function saveRenderInfoInStore(renderInfo: RenderInfo): void;
|
|
38
|
-
/**
|
|
39
|
-
* Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name and filtered by the pages ids in a concrete site.
|
|
40
|
-
* @param basePath - Absolute path of the dir from which files will be read.
|
|
41
|
-
* @returns A Array<number> of pages ids in `basePath` dir filtered by pages ids in a concrete site.
|
|
42
|
-
*/
|
|
43
|
-
/**
|
|
44
|
-
* Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name.
|
|
45
|
-
* @param basePath - Absolute path of the dir from which files will be read.
|
|
46
|
-
* @returns A Array<number> of pages ids in `basePath` dir.
|
|
47
|
-
*/
|
|
48
|
-
declare function getPageInStoreDir(basePath: string): Array<number>;
|
|
49
|
-
/**
|
|
50
|
-
* Save the pages into the file system.
|
|
51
|
-
* @param pages - An array of Griddo page objects to be saved.
|
|
52
|
-
*/
|
|
53
|
-
declare function saveSitePagesInStore(siteDirName: string, pages: Array<GriddoPageObject>): void;
|
|
54
|
-
/**
|
|
55
|
-
* Removes JSON files from the specified site directory based on the provided arrays of page numbers.
|
|
56
|
-
* For each number in the arrays, a corresponding file with the format `<number>.json` is removed if it exists.
|
|
57
|
-
*
|
|
58
|
-
* WARNING: This function may end up handling large arrays, so don't be tempted
|
|
59
|
-
* to refactor it to use something cool like the spread operator and make a
|
|
60
|
-
* single array, etc..
|
|
61
|
-
*
|
|
62
|
-
* @param siteDirName - The name of the site directory containing the pages.
|
|
63
|
-
* @param pageIdsArray - A two-dimensional array where each inner array contains numbers representing page files to be removed.
|
|
64
|
-
*/
|
|
65
|
-
declare function removeSitePagesFromStore(siteDirName: string, pageIdsArray: Array<Array<number>>): void;
|
|
66
|
-
/**
|
|
67
|
-
* Removes sites that exist in the store that should no longer be there because
|
|
68
|
-
* the domain has been changed. This is necessary because those sites will not
|
|
69
|
-
* be marked as `sitesToUnpublish` so they must be removed manually.
|
|
70
|
-
*/
|
|
71
|
-
declare function removeOrphanSites(sitesToPublish: Array<Site>, domain: string): void;
|
|
72
|
-
/**
|
|
73
|
-
* Returns the list of `activePages` pages that do not currently exist in a
|
|
74
|
-
* site's store (probably due to a failed render).
|
|
75
|
-
*/
|
|
76
|
-
declare function getMissingPublishedPagesInStore(siteName: string, activePages: Array<number>): number[];
|
|
77
|
-
/**
|
|
78
|
-
* Get pages that are not active anymore but are in the store.
|
|
79
|
-
*/
|
|
80
|
-
declare function getZombiePagesInStore(siteDir: string, activePages: Array<number>): number[];
|
|
81
|
-
export { getBuildMetadata, getBuildPagesFromCachedStore, getBuildPagesFromStore, getBuildPagesPath, getMissingPublishedPagesInStore, getPageInStoreDir, getZombiePagesInStore, removeOrphanSites, removeSitePagesFromStore, saveSitePagesInStore, saveRenderInfoInStore, };
|
package/cx.config.d.ts
DELETED
package/cx.config.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
|
|
3
|
-
import pkgDir from "pkg-dir";
|
|
4
|
-
|
|
5
|
-
import { resolveComponentsPath } from "./exporter/utils/instance";
|
|
6
|
-
|
|
7
|
-
// Paths
|
|
8
|
-
const REPO_ROOT_DIR = pkgDir.sync(path.resolve(__dirname, "../.."));
|
|
9
|
-
const CX_ROOT_DIR = pkgDir.sync(__dirname);
|
|
10
|
-
const SSG_DIR = path.resolve(pkgDir.sync(__dirname));
|
|
11
|
-
const CX_CACHE_DIR = path.resolve(CX_ROOT_DIR, ".cx-cache");
|
|
12
|
-
const COMPONENTS_DIR = resolveComponentsPath();
|
|
13
|
-
const EXPORTS_DIR = path.join(REPO_ROOT_DIR, "exports/sites");
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
16
|
-
const { version: griddoVersion } = require(
|
|
17
|
-
path.join(CX_ROOT_DIR, "package.json"),
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const config = {
|
|
21
|
-
proDomain: "pro-",
|
|
22
|
-
griddoVersion,
|
|
23
|
-
buildReportFileName: "build-report.json",
|
|
24
|
-
paths: (domain) => ({
|
|
25
|
-
__cache: path.join(CX_CACHE_DIR, domain || ""),
|
|
26
|
-
__components: COMPONENTS_DIR,
|
|
27
|
-
__cx: CX_ROOT_DIR,
|
|
28
|
-
__exports: path.join(EXPORTS_DIR, domain || ""),
|
|
29
|
-
__root: REPO_ROOT_DIR,
|
|
30
|
-
__ssg: SSG_DIR,
|
|
31
|
-
__exports_dist: domain ? path.join(EXPORTS_DIR, domain, "dist") : "",
|
|
32
|
-
__cx_dist: path.join(CX_ROOT_DIR, "dist"),
|
|
33
|
-
}),
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default config;
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Artifacts,
|
|
3
|
-
LifeCyclesNames,
|
|
4
|
-
LifeCycleSteps,
|
|
5
|
-
} from "../../types/global";
|
|
6
|
-
|
|
7
|
-
import fs from "node:fs";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
createDistFromGatsbyPublic,
|
|
12
|
-
getGatsbyAssetPrefixWithDomain,
|
|
13
|
-
hasNewCommit,
|
|
14
|
-
runGatsbyBuildCommand,
|
|
15
|
-
updateCommitFile,
|
|
16
|
-
} from "./utils";
|
|
17
|
-
import getCxArtifacts from "../../artifacts";
|
|
18
|
-
import { AuthService } from "../../services/auth";
|
|
19
|
-
import {
|
|
20
|
-
createDomainMetadata,
|
|
21
|
-
doLifeCycle,
|
|
22
|
-
getConfig,
|
|
23
|
-
saveBuildEndLogs,
|
|
24
|
-
} from "../../utils/core-utils";
|
|
25
|
-
import { createDomainRenderData } from "../../utils/create-build-data";
|
|
26
|
-
import {
|
|
27
|
-
copyArtifacts,
|
|
28
|
-
createArtifacts,
|
|
29
|
-
deleteDisposableSiteDirs,
|
|
30
|
-
moveArtifacts,
|
|
31
|
-
removeArtifacts,
|
|
32
|
-
removeVirtualPagesFromStore,
|
|
33
|
-
renameArtifact,
|
|
34
|
-
} from "../../utils/folders";
|
|
35
|
-
import { infoLog } from "../../utils/loggin";
|
|
36
|
-
import {
|
|
37
|
-
createSentinelRenderFile,
|
|
38
|
-
deleteSentinelRenderFile,
|
|
39
|
-
isValidRender,
|
|
40
|
-
} from "../../utils/render";
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Render every instance domain with the Gatsby adapter.
|
|
44
|
-
*/
|
|
45
|
-
export async function renderDomainsWithGatsbyAdapter(domain: string) {
|
|
46
|
-
await AuthService.login();
|
|
47
|
-
const config = getConfig();
|
|
48
|
-
|
|
49
|
-
infoLog(`Initializing render for the domain ${domain}\n`);
|
|
50
|
-
|
|
51
|
-
const {
|
|
52
|
-
//
|
|
53
|
-
__ssg,
|
|
54
|
-
__exports,
|
|
55
|
-
__cache,
|
|
56
|
-
__cx,
|
|
57
|
-
__components,
|
|
58
|
-
} = config.paths(domain);
|
|
59
|
-
|
|
60
|
-
// Griddo artifacts
|
|
61
|
-
const cxArtifacts = getCxArtifacts(domain);
|
|
62
|
-
|
|
63
|
-
// Gatsby artifacts
|
|
64
|
-
const gatsbyArtifacts: Pick<Artifacts, "disposables" | "cacheables"> = {
|
|
65
|
-
disposables: [
|
|
66
|
-
path.join(__ssg, "public"),
|
|
67
|
-
path.join(__ssg, "static"),
|
|
68
|
-
path.join(__ssg, ".cache"),
|
|
69
|
-
],
|
|
70
|
-
cacheables: [".cache"],
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// These variables are involved in the build for create the dist directory
|
|
74
|
-
// from public and pass to the gatsby-build command via spawnSync.
|
|
75
|
-
const assetPrefix = getGatsbyAssetPrefixWithDomain(domain);
|
|
76
|
-
const needsAssetPrefix = !!assetPrefix && assetPrefix !== "";
|
|
77
|
-
|
|
78
|
-
// Compose artifacts
|
|
79
|
-
const disposableArtifacts = [
|
|
80
|
-
...cxArtifacts.disposables,
|
|
81
|
-
...gatsbyArtifacts.disposables,
|
|
82
|
-
];
|
|
83
|
-
|
|
84
|
-
// LifeCycles
|
|
85
|
-
|
|
86
|
-
const allLifeCycles: Array<{
|
|
87
|
-
name: LifeCyclesNames;
|
|
88
|
-
steps: LifeCycleSteps;
|
|
89
|
-
}> = [
|
|
90
|
-
{
|
|
91
|
-
name: "Init",
|
|
92
|
-
steps: [() => createSentinelRenderFile()],
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
name: "Clean",
|
|
97
|
-
steps: [() => removeArtifacts(disposableArtifacts)],
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
name: "Prepare",
|
|
102
|
-
steps: [() => createArtifacts(cxArtifacts.initials)],
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
name: "Restore",
|
|
107
|
-
steps: [
|
|
108
|
-
() => copyArtifacts(__components, __ssg, ["static"]),
|
|
109
|
-
() => copyArtifacts(__exports, __cx, cxArtifacts.archivables),
|
|
110
|
-
() =>
|
|
111
|
-
renameArtifact(path.join(__cx, "dist"), path.join(__ssg, "public")),
|
|
112
|
-
() => moveArtifacts(__cache, __cx, cxArtifacts.cacheables),
|
|
113
|
-
() => moveArtifacts(__cache, __ssg, gatsbyArtifacts.cacheables),
|
|
114
|
-
// Remove .cache if new deploy detected
|
|
115
|
-
() => {
|
|
116
|
-
if (hasNewCommit(__cache)) {
|
|
117
|
-
if (fs.existsSync(path.join(__ssg, ".cache"))) {
|
|
118
|
-
infoLog(
|
|
119
|
-
"New deploy detected, removing Gatsby `.cache` directory to prevent data corruption",
|
|
120
|
-
);
|
|
121
|
-
fs.rmSync(path.join(__ssg, ".cache"), {
|
|
122
|
-
recursive: true,
|
|
123
|
-
force: true,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
{
|
|
132
|
-
name: "Data",
|
|
133
|
-
steps: [() => createDomainRenderData(domain)],
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
{
|
|
137
|
-
name: "SSG",
|
|
138
|
-
steps: [() => runGatsbyBuildCommand(assetPrefix)],
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
name: "Relocation",
|
|
143
|
-
steps: [() => createDistFromGatsbyPublic(domain, needsAssetPrefix)],
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
name: "Meta",
|
|
148
|
-
steps: [() => createDomainMetadata(domain), () => saveBuildEndLogs()],
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
{
|
|
152
|
-
name: "Archive",
|
|
153
|
-
steps: [
|
|
154
|
-
() => removeVirtualPagesFromStore(),
|
|
155
|
-
() => deleteDisposableSiteDirs(),
|
|
156
|
-
() =>
|
|
157
|
-
moveArtifacts(__cx, __exports, cxArtifacts.archivables, {
|
|
158
|
-
withBackup: true,
|
|
159
|
-
}),
|
|
160
|
-
() => moveArtifacts(__cx, __cache, cxArtifacts.cacheables),
|
|
161
|
-
() => moveArtifacts(__ssg, __cache, gatsbyArtifacts.cacheables),
|
|
162
|
-
],
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
{
|
|
166
|
-
name: "Close",
|
|
167
|
-
steps: [
|
|
168
|
-
() => removeArtifacts(disposableArtifacts),
|
|
169
|
-
() => updateCommitFile({ basePath: __cache }),
|
|
170
|
-
],
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
{
|
|
174
|
-
name: "HealthCheck",
|
|
175
|
-
steps: [() => isValidRender(), () => deleteSentinelRenderFile()],
|
|
176
|
-
},
|
|
177
|
-
];
|
|
178
|
-
|
|
179
|
-
for (const { name, steps } of allLifeCycles) {
|
|
180
|
-
await doLifeCycle(name, steps);
|
|
181
|
-
}
|
|
182
|
-
}
|