@griddo/cx 10.4.16 → 10.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +2 -2
- package/build/run-start-render.js +2 -2
- package/build/start-render.js +2 -2
- package/cx.config.d.ts +1 -1
- package/cx.config.js +2 -2
- package/{src → exporter}/adapters/gatsby/index.ts +12 -19
- package/{src → exporter}/utils/temp-utils.ts +4 -3
- package/{ssg/gatsby/gatsby-config.ts → gatsby-config.ts} +2 -1
- package/{ssg/gatsby/gatsby-node.ts → gatsby-node.ts} +15 -13
- package/package.json +20 -13
- package/{ssg/gatsby/src → src}/components/Head.tsx +1 -1
- package/{ssg/gatsby/src → src}/components/template.tsx +2 -1
- package/{ssg/gatsby/src → src}/gatsby-node-utils.ts +4 -3
- package/{ssg/gatsby/src → src}/types.ts +6 -6
- package/build/adapters/gatsby/index.d.ts +0 -2
- package/build/adapters/gatsby/utils.d.ts +0 -26
- package/build/adapters/index.d.ts +0 -3
- package/build/browser/index.d.ts +0 -5
- package/build/build-complete.d.ts +0 -18
- package/build/index.d.ts +0 -29
- package/build/move-assets.d.ts +0 -1
- package/build/react/index.d.ts +0 -2
- package/build/reset-render.d.ts +0 -1
- package/build/run-start-render.d.ts +0 -1
- package/build/services/auth.d.ts +0 -21
- package/build/services/distributors.d.ts +0 -45
- package/build/services/domains.d.ts +0 -8
- package/build/services/navigation.d.ts +0 -77
- package/build/services/robots.d.ts +0 -21
- package/build/services/settings.d.ts +0 -23
- package/build/services/sites.d.ts +0 -42
- package/build/services/store.d.ts +0 -6
- package/build/start-render.d.ts +0 -3
- package/build/types/api.d.ts +0 -130
- package/build/types/global.d.ts +0 -78
- package/build/types/navigation.d.ts +0 -28
- package/build/types/pages.d.ts +0 -128
- package/build/types/sites.d.ts +0 -43
- package/build/types/templates.d.ts +0 -8
- package/build/utils/api.d.ts +0 -23
- package/build/utils/cache.d.ts +0 -35
- package/build/utils/create-build-data.d.ts +0 -8
- package/build/utils/domains.d.ts +0 -5
- package/build/utils/folders.d.ts +0 -48
- package/build/utils/health-checks.d.ts +0 -7
- package/build/utils/instance.d.ts +0 -21
- package/build/utils/messages.d.ts +0 -2
- package/build/utils/pages.d.ts +0 -34
- package/build/utils/searches.d.ts +0 -14
- package/build/utils/shared.d.ts +0 -109
- package/build/utils/sites.d.ts +0 -36
- package/build/utils/store.d.ts +0 -63
- package/build/utils/temp-utils.d.ts +0 -10
- package/ssg/README.md +0 -1
- package/ssg/astro/.gitkeep +0 -0
- package/ssg/gatsby/.eslintrc.json +0 -51
- package/ssg/gatsby/.prettierignore +0 -6
- package/ssg/gatsby/.prettierrc.json +0 -3
- package/ssg/gatsby/package.json +0 -12
- package/ssg/gatsby/tsconfig.json +0 -15
- /package/{src → exporter}/adapters/gatsby/utils.ts +0 -0
- /package/{src → exporter}/adapters/index.ts +0 -0
- /package/{src → exporter}/browser/README.md +0 -0
- /package/{src → exporter}/browser/index.ts +0 -0
- /package/{src → exporter}/build-complete.ts +0 -0
- /package/{src → exporter}/index.ts +0 -0
- /package/{src → exporter}/move-assets.ts +0 -0
- /package/{src → exporter}/react/index.ts +0 -0
- /package/{src → exporter}/reset-render.ts +0 -0
- /package/{src → exporter}/run-start-render.ts +0 -0
- /package/{src → exporter}/services/auth.ts +0 -0
- /package/{src → exporter}/services/distributors.ts +0 -0
- /package/{src → exporter}/services/domains.ts +0 -0
- /package/{src → exporter}/services/navigation.ts +0 -0
- /package/{src → exporter}/services/robots.ts +0 -0
- /package/{src → exporter}/services/settings.ts +0 -0
- /package/{src → exporter}/services/sites.ts +0 -0
- /package/{src → exporter}/services/store.ts +0 -0
- /package/{src → exporter}/start-render.ts +0 -0
- /package/{src → exporter}/types/api.ts +0 -0
- /package/{src → exporter}/types/global.ts +0 -0
- /package/{src → exporter}/types/navigation.ts +0 -0
- /package/{src → exporter}/types/pages.ts +0 -0
- /package/{src → exporter}/types/sites.ts +0 -0
- /package/{src → exporter}/types/templates.ts +0 -0
- /package/{src → exporter}/utils/api.ts +0 -0
- /package/{src → exporter}/utils/cache.ts +0 -0
- /package/{src → exporter}/utils/create-build-data.ts +0 -0
- /package/{src → exporter}/utils/domains.ts +0 -0
- /package/{src → exporter}/utils/folders.ts +0 -0
- /package/{src → exporter}/utils/health-checks.ts +0 -0
- /package/{src → exporter}/utils/instance.ts +0 -0
- /package/{src → exporter}/utils/messages.ts +0 -0
- /package/{src → exporter}/utils/pages.ts +0 -0
- /package/{src → exporter}/utils/searches.ts +0 -0
- /package/{src → exporter}/utils/shared.ts +0 -0
- /package/{src → exporter}/utils/sites.ts +0 -0
- /package/{src → exporter}/utils/store.ts +0 -0
- /package/{ssg/gatsby/gatsby-browser.tsx → gatsby-browser.tsx} +0 -0
- /package/{ssg/gatsby/gatsby-ssr.tsx → gatsby-ssr.tsx} +0 -0
- /package/{ssg/gatsby/global.d.ts → global.d.ts} +0 -0
- /package/{ssg/gatsby/src → src}/README.md +0 -0
- /package/{ssg/gatsby/src → src}/html.tsx +0 -0
- /package/{ssg/gatsby/src → src}/utils.ts +0 -0
package/build/types/sites.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { SocialsResponse } from "./api";
|
|
2
|
-
import type { Footer, Header } from "./navigation";
|
|
3
|
-
import type { Core } from "@griddo/core";
|
|
4
|
-
/**
|
|
5
|
-
* Describes a Griddo site object from API.
|
|
6
|
-
* This takes some type props from Core.Site.
|
|
7
|
-
*/
|
|
8
|
-
export interface Site extends Required<Pick<Core.Site, "bigAvatar" | "favicon" | "home" | "id" | "isPublished" | "timezone" | "thumbnail" | "theme" | "socials" | "slug" | "smallAvatar" | "modified" | "name" | "siteMetadata">> {
|
|
9
|
-
author: string;
|
|
10
|
-
deleted: number;
|
|
11
|
-
domains: Array<Record<string, string>>;
|
|
12
|
-
footers: Array<Footer>;
|
|
13
|
-
hash: string | null;
|
|
14
|
-
headers: Array<Header>;
|
|
15
|
-
languages: Array<Core.SiteLanguage>;
|
|
16
|
-
languageSites: Array<number>;
|
|
17
|
-
navigationModules: {
|
|
18
|
-
header?: string;
|
|
19
|
-
footer?: string;
|
|
20
|
-
} | null;
|
|
21
|
-
pages: Array<number>;
|
|
22
|
-
changedPages: Array<number>;
|
|
23
|
-
published: string;
|
|
24
|
-
rendering: boolean;
|
|
25
|
-
renderingHours: number;
|
|
26
|
-
shouldBeUpdated: boolean;
|
|
27
|
-
siteScript: string;
|
|
28
|
-
smallAvatar: string;
|
|
29
|
-
updated: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface SiteData {
|
|
32
|
-
siteInfo: Site;
|
|
33
|
-
validPagesIds: Array<number>;
|
|
34
|
-
siteHash: string | null;
|
|
35
|
-
unpublishHashes: Array<string>;
|
|
36
|
-
siteLangs: Array<Core.SiteLanguage>;
|
|
37
|
-
defaultLang: Core.SiteLanguage | undefined;
|
|
38
|
-
headers: Array<Header>;
|
|
39
|
-
footers: Array<Footer>;
|
|
40
|
-
socials: SocialsResponse;
|
|
41
|
-
}
|
|
42
|
-
export type SiteHash = string | null;
|
|
43
|
-
export type HashSites = Record<string, number | string>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Core, Fields } from "@griddo/core";
|
|
2
|
-
/** Describes a template object from a Griddo Page */
|
|
3
|
-
export type Template = Core.Page["template"];
|
|
4
|
-
/** Describes a template with distributor data */
|
|
5
|
-
export type TemplateWithDistributor = Template & {
|
|
6
|
-
queriedItems?: Fields.QueriedData<unknown>;
|
|
7
|
-
itemsPerPage?: number;
|
|
8
|
-
};
|
package/build/utils/api.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { APIResponses, GetAPI, PostAPI, PutAPI } from "../types/api";
|
|
2
|
-
/**
|
|
3
|
-
* Make a GET request to the Griddo API.
|
|
4
|
-
*
|
|
5
|
-
* @template T Response Type returned.
|
|
6
|
-
* @returns A promise that is resolved with the data from the API response.
|
|
7
|
-
*/
|
|
8
|
-
declare function getApi<T extends APIResponses>(props: GetAPI): Promise<T>;
|
|
9
|
-
/**
|
|
10
|
-
* Make a PUT request to the Griddo API.
|
|
11
|
-
*
|
|
12
|
-
* @template T Response Type returned.
|
|
13
|
-
* @returns A promise that is resolved with the data from the API response.
|
|
14
|
-
*/
|
|
15
|
-
declare function putApi<T extends APIResponses>(props: PutAPI): Promise<T>;
|
|
16
|
-
/**
|
|
17
|
-
* Make a POST request to the Griddo API.
|
|
18
|
-
*
|
|
19
|
-
* @template T Response Type returned.
|
|
20
|
-
* @returns A promise that is resolved with the data from the API response.
|
|
21
|
-
*/
|
|
22
|
-
declare function postApi<T extends APIResponses>(props: PostAPI): Promise<T>;
|
|
23
|
-
export { getApi as get, putApi as put, postApi as post };
|
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 { createSha256, updatedSiteHash, searchCacheData, saveCache, createAPICacheDir, };
|
|
@@ -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 `getBuildPages()` 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 createBuildData(domain: string): Promise<void>;
|
|
8
|
-
export { createBuildData };
|
package/build/utils/domains.d.ts
DELETED
package/build/utils/folders.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { MakeDirectoryOptions } from "fs-extra";
|
|
3
|
-
/**
|
|
4
|
-
* Remove an empty directory from the basePath recursively.
|
|
5
|
-
* If the directory has only .xml files it will handle as empty too (empty site)
|
|
6
|
-
*
|
|
7
|
-
* @param baseDir - The base directory.
|
|
8
|
-
*/
|
|
9
|
-
declare const clearEmptyDirs: (baseDir?: string) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Creates multiple directories.
|
|
12
|
-
*
|
|
13
|
-
* @param dirs - An array of directory paths.
|
|
14
|
-
* @param options - Same option as `fs.mkdirSync()`
|
|
15
|
-
*/
|
|
16
|
-
declare function createDirsSync(dirs: Array<string>, options?: MakeDirectoryOptions): 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 copyDirsSync(src: string, dst: string, dirs: Array<string>, options?: {
|
|
26
|
-
withBackup: boolean;
|
|
27
|
-
}): void;
|
|
28
|
-
/**
|
|
29
|
-
* Move artifacts between CX valid directories.
|
|
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 moveDirsSync(src: string, dst: string, dirs: Array<string>, options?: {
|
|
37
|
-
withBackup?: boolean;
|
|
38
|
-
override?: boolean;
|
|
39
|
-
}): void;
|
|
40
|
-
/**
|
|
41
|
-
* Remove directories from `basePath` directory.
|
|
42
|
-
*
|
|
43
|
-
* @param basePath - Base directory.
|
|
44
|
-
* @param dirs - Directory to remove.
|
|
45
|
-
*/
|
|
46
|
-
declare function removeDirsSync(basePath: string, dirs: Array<string>): void;
|
|
47
|
-
declare function removeVirtualPagesFromStore(): Promise<void>;
|
|
48
|
-
export { clearEmptyDirs, copyDirsSync, createDirsSync, moveDirsSync, removeDirsSync, removeVirtualPagesFromStore, };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if the environment is secure to launch a render.
|
|
3
|
-
* If something fails then log an error message and exit from the process.
|
|
4
|
-
* Otherwise just return true.
|
|
5
|
-
*/
|
|
6
|
-
declare function checkRenderHealthOrExit(): boolean;
|
|
7
|
-
export { checkRenderHealthOrExit };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
declare const IS_COMPONENT_LIBRARY: boolean;
|
|
2
|
-
declare const PROJECT_ALIASES: {
|
|
3
|
-
"@griddo-instance": string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Returns the instance or monorepo paths.
|
|
7
|
-
*
|
|
8
|
-
* @param customPath The path for the instance components
|
|
9
|
-
*/
|
|
10
|
-
declare function resolveComponentsPath(customPath?: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Return the instance or monorepo components {t|j}sconfig.json file.
|
|
13
|
-
*/
|
|
14
|
-
declare function getComponentsJSConfig(): string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Get the instance webpack aliases
|
|
17
|
-
*/
|
|
18
|
-
declare function getComponentsLibAliases(): {
|
|
19
|
-
"@griddo-instance": string;
|
|
20
|
-
};
|
|
21
|
-
export { IS_COMPONENT_LIBRARY, PROJECT_ALIASES, getComponentsJSConfig, getComponentsLibAliases, resolveComponentsPath, };
|
package/build/utils/pages.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { GriddoListPage, GriddoMultiPage, GriddoPageObject, GriddoSinglePage, MultiPageElements, PageAdditionalInfo } from "../types/pages";
|
|
2
|
-
import type { TemplateWithDistributor } from "../types/templates";
|
|
3
|
-
import type { Fields } from "@griddo/core";
|
|
4
|
-
/**
|
|
5
|
-
* Create a single Griddo page object.
|
|
6
|
-
*
|
|
7
|
-
* @param page A Griddo single page object.
|
|
8
|
-
* @param additionalInfo Additional page info.
|
|
9
|
-
*/
|
|
10
|
-
declare function createGriddoSinglePage(page: GriddoSinglePage, additionalInfo: PageAdditionalInfo): Promise<GriddoPageObject>;
|
|
11
|
-
/**
|
|
12
|
-
* Create multiples pages from one page as list paginated pages
|
|
13
|
-
*/
|
|
14
|
-
declare function createGriddoListPages({ page, pages, isRoot, defaultLang, template, totalQueriedItems, }: GriddoListPage, additionalInfo: PageAdditionalInfo): Promise<GriddoPageObject[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Create multiples pages from a MultiPage module
|
|
17
|
-
*
|
|
18
|
-
* @param page A Griddo Multipage object.
|
|
19
|
-
* @param additionalInfo Additional page info.
|
|
20
|
-
*/
|
|
21
|
-
declare function createGriddoMultiPages(page: GriddoMultiPage, additionalInfo: PageAdditionalInfo): Promise<GriddoPageObject[]>;
|
|
22
|
-
/**
|
|
23
|
-
* Get the multi pages elements.
|
|
24
|
-
*
|
|
25
|
-
* @param page The page to get the multipage parts.
|
|
26
|
-
*/
|
|
27
|
-
declare function getMultiPageElements(page: TemplateWithDistributor): Promise<MultiPageElements> | null;
|
|
28
|
-
/**
|
|
29
|
-
* Takes a template object and split the whole queriedItems into separated queriedItems to use in Griddo static list templates.
|
|
30
|
-
*
|
|
31
|
-
* @param listTemplate A template schema with the distributor data included.
|
|
32
|
-
*/
|
|
33
|
-
declare function getPaginatedPages(listTemplate: TemplateWithDistributor): Fields.SimpleContentType<Omit<unknown, "__contentTypeKind">>[][];
|
|
34
|
-
export { createGriddoListPages, createGriddoMultiPages, createGriddoSinglePage, getMultiPageElements, getPaginatedPages, };
|
|
@@ -1,14 +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 uploadSearchContentToAPI(): Promise<void>;
|
|
14
|
-
export { postSearchInfo, uploadSearchContentToAPI };
|
package/build/utils/shared.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import type { Adapters } from "../adapters";
|
|
2
|
-
import type { APIResponses } from "../types/api";
|
|
3
|
-
import type { LifeCyclesNames } from "../types/global";
|
|
4
|
-
import type { Site } from "../types/sites";
|
|
5
|
-
declare const CXRootDir: string;
|
|
6
|
-
declare const instanceRootDir: string;
|
|
7
|
-
/**
|
|
8
|
-
* Walk a directory and returns the file pathts.
|
|
9
|
-
*
|
|
10
|
-
* @param dir A directory path.
|
|
11
|
-
*/
|
|
12
|
-
declare function walk(dir: string): string[];
|
|
13
|
-
/**
|
|
14
|
-
* Custom log inside a line-box.
|
|
15
|
-
*
|
|
16
|
-
* @param stringValue The string to be logged.
|
|
17
|
-
* @param paddingInline The number of white spaces inside the box at left and right.
|
|
18
|
-
* @param paddingBlock The number of white spaces inside the box at top and bottom.
|
|
19
|
-
*/
|
|
20
|
-
declare function logBox(stringValue: string, title?: string, paddingInline?: number, paddingBlock?: number): void;
|
|
21
|
-
/**
|
|
22
|
-
* Custom basic logging function controlled by a environment variable.
|
|
23
|
-
* Strip double spaces.
|
|
24
|
-
*
|
|
25
|
-
* @param str The string to be logged.
|
|
26
|
-
*/
|
|
27
|
-
declare function logInfo(str: string): void;
|
|
28
|
-
/**
|
|
29
|
-
* Internal log
|
|
30
|
-
* @param values The values to be logged.
|
|
31
|
-
*/
|
|
32
|
-
declare function debug(...values: Array<unknown>): void;
|
|
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
|
-
* Return a scale size colors with a number and a measure string (KB by default).
|
|
41
|
-
*
|
|
42
|
-
* @param size The page size in KB.
|
|
43
|
-
* @param measure The measure string to be added in the log.
|
|
44
|
-
*/
|
|
45
|
-
declare function logPageSize(size: number, measure?: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Converts milliseconds to seconds with a fixed number of decimals.
|
|
48
|
-
*
|
|
49
|
-
* @param ms The number in milliseconds.
|
|
50
|
-
* @param fixed The amount of fixed decimals.
|
|
51
|
-
* @returns The converted number in seconds with the fixed number of decimals.
|
|
52
|
-
*/
|
|
53
|
-
export declare function msToSec(ms: number, decimals?: number): string;
|
|
54
|
-
/**
|
|
55
|
-
* Return a siteID from a response object if exist
|
|
56
|
-
* @param response A response object
|
|
57
|
-
*/
|
|
58
|
-
export declare function getSafeSiteId(response: APIResponses): number | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Remove props from an object
|
|
61
|
-
*
|
|
62
|
-
* @param obj The object
|
|
63
|
-
* @param props An array of props to be removed
|
|
64
|
-
*/
|
|
65
|
-
declare function removeProperties(obj: Record<string, unknown>, props: Array<string>): void;
|
|
66
|
-
/**
|
|
67
|
-
* Return a list of sites with their names and ids.
|
|
68
|
-
*
|
|
69
|
-
* @param sites An array of sites objects
|
|
70
|
-
*/
|
|
71
|
-
declare function siteList(sites: Array<Site>): string;
|
|
72
|
-
/**
|
|
73
|
-
* Print the great Griddo Exporter logo in ASCII.
|
|
74
|
-
*/
|
|
75
|
-
declare function printExporterLogo(adapter: Adapters): void;
|
|
76
|
-
/**
|
|
77
|
-
* Remove unused files (old) inside the `apiCache` dir
|
|
78
|
-
*
|
|
79
|
-
* @param dirPath The path for the `apiCache` dir
|
|
80
|
-
* @todo remove other file types: sites, socials, etc..
|
|
81
|
-
*/
|
|
82
|
-
declare function sanitizeAPICacheDir(dirPath: string): void;
|
|
83
|
-
/**
|
|
84
|
-
* Measures the execution time of a series of sync or async functions.
|
|
85
|
-
* @param functions - Functions to be executed to measure their execution time.
|
|
86
|
-
* @returns A promise that resolves with the total execution time in seconds.
|
|
87
|
-
*/
|
|
88
|
-
declare function measureExecutionTime(...functions: Array<(...args: Array<unknown>) => unknown | Promise<any>>): Promise<number>;
|
|
89
|
-
declare function pause(title: string): Promise<void> | undefined;
|
|
90
|
-
declare function startLifeCycle(lifeCyleName: string): void;
|
|
91
|
-
declare function successLifeCyle(value: string): void;
|
|
92
|
-
/**
|
|
93
|
-
* Executes a life cycle process, which involves executing an array of
|
|
94
|
-
* functions, printing to the console, and handling errors with optional
|
|
95
|
-
* retries.
|
|
96
|
-
*
|
|
97
|
-
* @async
|
|
98
|
-
* @param args - The arguments object.
|
|
99
|
-
* @param args.steps - An array of functions to execute.
|
|
100
|
-
* @param args.name - The name of the life cycle.
|
|
101
|
-
* @param [args.attempts=1] - The number of retry attempts allowed in case of errors.
|
|
102
|
-
* @returns - A promise that resolves when the life cycle process is completed.
|
|
103
|
-
*/
|
|
104
|
-
declare function doLifeCycle(args: {
|
|
105
|
-
steps: Array<(...args: Array<unknown>) => unknown | Promise<any>>;
|
|
106
|
-
name: LifeCyclesNames;
|
|
107
|
-
attempts?: number;
|
|
108
|
-
}): Promise<void>;
|
|
109
|
-
export { CXRootDir, debug, delay, doLifeCycle, instanceRootDir, logBox, logInfo, logPageSize, measureExecutionTime, pause, printExporterLogo, removeProperties, sanitizeAPICacheDir, siteList, startLifeCycle, successLifeCyle, walk, };
|
package/build/utils/sites.d.ts
DELETED
|
@@ -1,36 +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 checkSites(domain: string): Promise<{
|
|
6
|
-
sitesToPublish: Site[];
|
|
7
|
-
sitesToUnpublish: Site[];
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Unpublish an array of sites in two steps:
|
|
11
|
-
* - Sending the information to the API
|
|
12
|
-
*
|
|
13
|
-
* @param sites An array of sites
|
|
14
|
-
* @see https://griddoio.notion.site/Sites-d7bb0b7cb8d24894a5337e1139fc3d09#2019d3255bda4d219c7e19cf28d0c4fe
|
|
15
|
-
*/
|
|
16
|
-
declare function unpublishSites(sites: Array<Site>): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Return a single site generic data.
|
|
19
|
-
*
|
|
20
|
-
* @param siteID The site id.
|
|
21
|
-
* @param cacheKey Boolean that indicates if we want to get cache version.
|
|
22
|
-
*
|
|
23
|
-
* @see SiteData
|
|
24
|
-
*/
|
|
25
|
-
declare function getSiteData(siteID: number): Promise<SiteData>;
|
|
26
|
-
/**
|
|
27
|
-
* Save a file with the end of build process
|
|
28
|
-
*/
|
|
29
|
-
declare function generateBuildReport(): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Generate sitemaps and save them into file system.
|
|
32
|
-
*
|
|
33
|
-
* @param sites An array of sites
|
|
34
|
-
*/
|
|
35
|
-
declare function generateSitemaps(): Promise<void>;
|
|
36
|
-
export { checkSites, generateBuildReport, generateSitemaps, getSiteData, unpublishSites, };
|
package/build/utils/store.d.ts
DELETED
|
@@ -1,63 +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 { Site } from "../types/sites";
|
|
5
|
-
/**
|
|
6
|
-
* Read all pages stored in `store` Griddo directory and return one by one with
|
|
7
|
-
* a generator.
|
|
8
|
-
*/
|
|
9
|
-
declare function getBuildPages<PageType extends GriddoPageObject>(basePath: string): AsyncGenerator<PageType, void, unknown>;
|
|
10
|
-
/**
|
|
11
|
-
* Get the build metadata from the Store.
|
|
12
|
-
* TODO: Refactorizar para leer un solo archivo: __metadata__.json
|
|
13
|
-
*/
|
|
14
|
-
declare function getBuildMetadata(): Promise<BuildMetaData>;
|
|
15
|
-
/**
|
|
16
|
-
* Creates an `store` dir to store pages transformed by createStore
|
|
17
|
-
*/
|
|
18
|
-
declare function createStoreDir(storeDir: string): void;
|
|
19
|
-
/**
|
|
20
|
-
* Write render info into a file.
|
|
21
|
-
* @param basePath - Absolute path of the dir from which files will be saved.
|
|
22
|
-
* @param renderInfo - Data that will be saved related to the render process.
|
|
23
|
-
*/
|
|
24
|
-
declare function saveRenderInfoInStore(basePath: string, renderInfo: RenderInfo): void;
|
|
25
|
-
/**
|
|
26
|
-
* Return an array of ids only from `.json` files (no dirs) in the `basePath` dir based in the file name.
|
|
27
|
-
* @param basePath - Absolute path of the dir from which files will be read.
|
|
28
|
-
* @returns A Array<number> of pages ids in `basePath` dir.
|
|
29
|
-
*/
|
|
30
|
-
declare function getPageInStoreDir(basePath: string): Array<number>;
|
|
31
|
-
/**
|
|
32
|
-
* Save the pages into the file system.
|
|
33
|
-
* @param basePath - Absolute path of the dir from which files will be saved.
|
|
34
|
-
* @param pages - An array of Griddo page objects to be saved.
|
|
35
|
-
*/
|
|
36
|
-
declare function savePagesInStore(basePath: string, pages: Array<GriddoPageObject>): void;
|
|
37
|
-
/**
|
|
38
|
-
* Remove files from dir.
|
|
39
|
-
* @param basePath - Absolute path of the dir from which files will be removed.
|
|
40
|
-
* @param filenames - An array of ids representing file page names.
|
|
41
|
-
*/
|
|
42
|
-
declare function removePagesFromStore(basePath: string, filenames: Array<number>): void;
|
|
43
|
-
/**
|
|
44
|
-
* Returns pages that need to be created or deleted for a site in the store based on the provided arguments.
|
|
45
|
-
* @param sitePages - Properties for page retrieval.
|
|
46
|
-
* @param props.storeDir - Absolute path of the Griddo store.
|
|
47
|
-
* @param props.pages - Exhaustive array of all pages in the site.
|
|
48
|
-
* @param props.validPagesIds - Array of valid pages in the site.
|
|
49
|
-
* @param props.changedPages - Array of pages that have been modified in the site.
|
|
50
|
-
* @returns - An object containing the pages to be created and deleted in the site.
|
|
51
|
-
*/
|
|
52
|
-
declare function getPagesToCreateOrDelete(storeDir: string, sitePages: {
|
|
53
|
-
sitesToPublish: Array<Site>;
|
|
54
|
-
pages: Array<number>;
|
|
55
|
-
validPagesIds: Array<number>;
|
|
56
|
-
changedPages: Array<number>;
|
|
57
|
-
}): Promise<{
|
|
58
|
-
pagesInStore: number[];
|
|
59
|
-
pagesMissingInStore: number[];
|
|
60
|
-
pagesToDeleteFromStore: number[];
|
|
61
|
-
pagesToWriteToStore: number[];
|
|
62
|
-
}>;
|
|
63
|
-
export { createStoreDir, getBuildMetadata, getBuildPages, getPageInStoreDir, getPagesToCreateOrDelete, removePagesFromStore, savePagesInStore, saveRenderInfoInStore, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CXConfig } from "../types/global";
|
|
2
|
-
declare function getConfig(): CXConfig;
|
|
3
|
-
/**
|
|
4
|
-
* Update the Griddo's `/dist` dir with the contents from `public` dir only
|
|
5
|
-
* with files of type: js, json and css.
|
|
6
|
-
*/
|
|
7
|
-
declare function legacy__createDistFromGatsbyPublic(domain: string, needsAssetPrefix: boolean): Promise<void>;
|
|
8
|
-
declare function griddoCreateInitialDirectories(domain: string): Promise<void>;
|
|
9
|
-
declare function griddoCleanDisposableDirectories(domain: string): Promise<void>;
|
|
10
|
-
export { getConfig, griddoCleanDisposableDirectories, griddoCreateInitialDirectories, legacy__createDistFromGatsbyPublic, };
|
package/ssg/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# SGG Directory
|
package/ssg/astro/.gitkeep
DELETED
|
File without changes
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"node": true,
|
|
5
|
-
"es6": true
|
|
6
|
-
},
|
|
7
|
-
"extends": [
|
|
8
|
-
"plugin:node/recommended",
|
|
9
|
-
"eslint:recommended",
|
|
10
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
11
|
-
"plugin:@typescript-eslint/recommended"
|
|
12
|
-
],
|
|
13
|
-
"plugins": ["node", "react", "prettier", "import"],
|
|
14
|
-
"parserOptions": {
|
|
15
|
-
"ecmaVersion": 2020,
|
|
16
|
-
"ecmaFeatures": { "jsx": true },
|
|
17
|
-
"sourceType": "module",
|
|
18
|
-
"allowImportExportEverywhere": true
|
|
19
|
-
},
|
|
20
|
-
"parser": "@typescript-eslint/parser",
|
|
21
|
-
"rules": {
|
|
22
|
-
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
23
|
-
"@typescript-eslint/no-explicit-any": 0,
|
|
24
|
-
"@typescript-eslint/no-non-null-assertion": 0,
|
|
25
|
-
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
|
|
26
|
-
"no-process-exit": 0,
|
|
27
|
-
"node/no-missing-import": 0,
|
|
28
|
-
"node/no-unsupported-features/es-syntax": 0,
|
|
29
|
-
"node/no-extraneous-import": 0,
|
|
30
|
-
"react/jsx-uses-react": "error",
|
|
31
|
-
"react/jsx-uses-vars": "error",
|
|
32
|
-
"linebreak-style": ["error", "unix"],
|
|
33
|
-
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
|
34
|
-
"import/order": [
|
|
35
|
-
"error",
|
|
36
|
-
{
|
|
37
|
-
"newlines-between": "always",
|
|
38
|
-
"groups": [
|
|
39
|
-
["type"],
|
|
40
|
-
["builtin"],
|
|
41
|
-
["external"],
|
|
42
|
-
["parent", "internal", "sibling", "index", "unknown"]
|
|
43
|
-
],
|
|
44
|
-
"alphabetize": {
|
|
45
|
-
"order": "asc",
|
|
46
|
-
"caseInsensitive": true
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
}
|
package/ssg/gatsby/package.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@griddo/gatsby",
|
|
3
|
-
"description": "gatsbyjs",
|
|
4
|
-
"license": "UNLICENSED",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"clean": "gatsby clean; rm -rf .cache public assets",
|
|
7
|
-
"gatsby-build": "gatsby telemetry --disable && gatsby build --prefix-paths"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"gatsby": "^4.8.0"
|
|
11
|
-
}
|
|
12
|
-
}
|
package/ssg/gatsby/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"lib": ["dom", "esnext"],
|
|
5
|
-
"jsx": "react",
|
|
6
|
-
"module": "esnext",
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"resolveJsonModule": true
|
|
13
|
-
},
|
|
14
|
-
"include": ["./src/**/*", "./*.ts", "./*.tsx"]
|
|
15
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|