@griddo/cx 11.7.6-rc.1 → 11.7.6
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 +228 -25
- package/build/adapters/gatsby/index.d.ts +4 -0
- package/build/adapters/gatsby/utils.d.ts +22 -0
- package/build/artifacts/index.d.ts +6 -0
- package/build/commands/move-assets.d.ts +1 -0
- package/build/commands/prepare-domains-render.d.ts +1 -0
- package/build/{exporter/constants → constants}/envs.d.ts +7 -1
- package/build/constants/index.d.ts +57 -0
- package/build/end-render.js +74 -0
- package/build/end-render.js.map +7 -0
- package/build/{exporter/constants/errors.d.ts → errors/errors-data.d.ts} +3 -5
- package/build/{exporter/utils/errors.d.ts → errors/index.d.ts} +3 -3
- package/build/index.d.ts +29 -0
- package/build/index.js +73 -0
- package/build/index.js.map +7 -0
- package/build/prepare-domains-render.js +73 -0
- package/build/prepare-domains-render.js.map +7 -0
- package/build/react/Favicon/index.d.ts +5 -0
- package/build/react/Favicon/utils.d.ts +9 -0
- package/build/react/GriddoIntegrations/index.d.ts +20 -0
- package/build/react/GriddoIntegrations/utils.d.ts +26 -0
- package/{react/index.tsx → build/react/index.d.ts} +0 -1
- package/build/react/index.js +3 -0
- package/build/registers/api.d.ts +9 -0
- package/build/registers/gatsby.d.ts +9 -0
- package/build/registers/index.d.ts +3 -0
- package/build/reset-render.js +74 -0
- package/build/reset-render.js.map +7 -0
- package/build/{exporter/services → services}/auth.d.ts +1 -1
- package/build/services/domains.d.ts +6 -0
- package/build/services/register.d.ts +36 -0
- package/build/{exporter/services → services}/robots.d.ts +6 -0
- package/build/services/settings.d.ts +4 -0
- package/build/{exporter/services → services}/sites.d.ts +2 -5
- package/build/services/store.d.ts +6 -0
- package/build/start-render.js +100 -0
- package/build/start-render.js.map +7 -0
- package/build/{exporter/types → types}/api.d.ts +4 -3
- package/build/{exporter/types → types}/global.d.ts +6 -6
- package/build/{exporter/types → types}/navigation.d.ts +1 -1
- package/build/{exporter/types → types}/sites.d.ts +2 -1
- package/build/upload-search-content.js +74 -0
- package/build/upload-search-content.js.map +7 -0
- package/build/utils/alerts.d.ts +3 -0
- package/build/{exporter/utils → utils}/cache.d.ts +12 -7
- package/build/utils/core-utils.d.ts +107 -0
- package/build/utils/create-build-data.d.ts +8 -0
- package/build/{exporter/utils → utils}/domains.d.ts +1 -1
- package/build/utils/folders.d.ts +53 -0
- package/build/{exporter/utils/check-health.d.ts → utils/health-checks.d.ts} +2 -2
- package/build/{exporter/utils → utils}/loggin.d.ts +16 -2
- package/build/{exporter/utils → utils}/pages.d.ts +2 -2
- package/build/utils/render.d.ts +13 -0
- package/build/utils/searches.d.ts +15 -0
- package/build/{exporter/utils → utils}/sites.d.ts +3 -3
- package/build/{exporter/utils → utils}/store.d.ts +38 -10
- package/cx.config.d.ts +5 -0
- package/cx.config.js +36 -0
- package/exporter/adapters/gatsby/index.ts +146 -60
- package/exporter/adapters/gatsby/utils.ts +161 -0
- package/exporter/artifacts/README.md +34 -0
- package/exporter/{utils/artifacts.ts → artifacts/index.ts} +8 -9
- package/exporter/build.sh +38 -5
- package/exporter/commands/end-render.ts +81 -56
- package/exporter/commands/move-assets.ts +11 -0
- package/exporter/commands/prepare-domains-render.ts +31 -149
- package/exporter/commands/reset-render.ts +3 -12
- package/exporter/commands/start-render.ts +47 -18
- package/exporter/commands/upload-search-content.ts +21 -206
- package/exporter/constants/envs.ts +51 -59
- package/exporter/constants/index.ts +129 -0
- package/exporter/{constants/errors.ts → errors/errors-data.ts} +15 -24
- package/exporter/{utils/errors.ts → errors/index.ts} +9 -10
- package/exporter/index.ts +82 -0
- package/{react → exporter/react}/Favicon/index.tsx +7 -1
- package/{react → exporter/react}/GriddoIntegrations/index.tsx +14 -6
- package/{react → exporter/react}/GriddoIntegrations/utils.ts +9 -4
- package/exporter/react/index.tsx +11 -0
- package/exporter/registers/api.ts +14 -0
- package/exporter/registers/gatsby.ts +14 -0
- package/exporter/registers/index.ts +4 -0
- package/exporter/services/auth.ts +6 -7
- package/exporter/services/domains.ts +16 -0
- package/exporter/services/navigation.ts +10 -4
- package/exporter/services/reference-fields.ts +23 -8
- package/exporter/services/register.ts +113 -0
- package/exporter/services/robots.ts +15 -8
- package/exporter/services/settings.ts +17 -0
- package/exporter/services/sites.ts +24 -35
- package/exporter/services/store.ts +76 -118
- package/exporter/types/api.ts +27 -24
- package/exporter/types/global.ts +10 -8
- package/exporter/types/navigation.ts +1 -1
- package/exporter/types/pages.ts +3 -2
- package/exporter/types/sites.ts +2 -1
- package/exporter/utils/alerts.ts +29 -0
- package/exporter/utils/api.ts +82 -46
- package/exporter/utils/cache.ts +59 -34
- package/exporter/utils/core-utils.ts +247 -86
- package/exporter/utils/create-build-data.ts +17 -0
- package/exporter/utils/domains.ts +7 -10
- package/exporter/utils/folders.ts +92 -161
- package/exporter/utils/health-checks.ts +64 -0
- package/exporter/utils/images.ts +6 -1
- package/exporter/utils/instance.ts +12 -9
- package/exporter/utils/loggin.ts +89 -24
- package/exporter/utils/pages.ts +88 -23
- package/exporter/utils/render.ts +48 -147
- package/exporter/utils/searches.ts +156 -0
- package/exporter/utils/sites.ts +77 -67
- package/exporter/utils/store.ts +178 -85
- package/gatsby-browser.tsx +58 -41
- package/gatsby-config.ts +12 -6
- package/gatsby-node.ts +77 -15
- package/gatsby-ssr.tsx +1 -2
- package/package.json +74 -33
- package/src/README.md +7 -0
- package/src/components/Head.tsx +46 -13
- package/src/components/template.tsx +30 -8
- package/src/gatsby-node-utils.ts +2 -91
- package/src/html.tsx +11 -2
- package/src/types.ts +5 -5
- package/start-render.js +3 -1
- package/tsconfig.json +2 -3
- package/build/adapters/gatsby/actions/clean.js +0 -10
- package/build/adapters/gatsby/actions/clean.js.map +0 -1
- package/build/adapters/gatsby/actions/close.js +0 -12
- package/build/adapters/gatsby/actions/close.js.map +0 -1
- package/build/adapters/gatsby/actions/data.js +0 -18
- package/build/adapters/gatsby/actions/data.js.map +0 -1
- package/build/adapters/gatsby/actions/healthCheck.js +0 -10
- package/build/adapters/gatsby/actions/healthCheck.js.map +0 -1
- package/build/adapters/gatsby/actions/init.js +0 -9
- package/build/adapters/gatsby/actions/init.js.map +0 -1
- package/build/adapters/gatsby/actions/meta.js +0 -14
- package/build/adapters/gatsby/actions/meta.js.map +0 -1
- package/build/adapters/gatsby/actions/prepare.js +0 -9
- package/build/adapters/gatsby/actions/prepare.js.map +0 -1
- package/build/adapters/gatsby/actions/relocation.js +0 -15
- package/build/adapters/gatsby/actions/relocation.js.map +0 -1
- package/build/adapters/gatsby/actions/restore.js +0 -26
- package/build/adapters/gatsby/actions/restore.js.map +0 -1
- package/build/adapters/gatsby/actions/ssg.js +0 -9
- package/build/adapters/gatsby/actions/ssg.js.map +0 -1
- package/build/adapters/gatsby/actions/sync.js +0 -50
- package/build/adapters/gatsby/actions/sync.js.map +0 -1
- package/build/adapters/gatsby/index.js +0 -74
- package/build/adapters/gatsby/index.js.map +0 -1
- package/build/adapters/gatsby/shared/context.js +0 -25
- package/build/adapters/gatsby/shared/context.js.map +0 -1
- package/build/adapters/gatsby/shared/extract-assets.js +0 -58
- package/build/adapters/gatsby/shared/extract-assets.js.map +0 -1
- package/build/adapters/gatsby/shared/gatsby-build.js +0 -49
- package/build/adapters/gatsby/shared/gatsby-build.js.map +0 -1
- package/build/adapters/gatsby/shared/sync-render.js +0 -208
- package/build/adapters/gatsby/shared/sync-render.js.map +0 -1
- package/build/adapters/gatsby/shared/types.js +0 -3
- package/build/adapters/gatsby/shared/types.js.map +0 -1
- package/build/commands/end-render.js +0 -63
- package/build/commands/end-render.js.map +0 -1
- package/build/commands/prepare-assets-directory.js +0 -32
- package/build/commands/prepare-assets-directory.js.map +0 -1
- package/build/commands/prepare-domains-render.js +0 -138
- package/build/commands/prepare-domains-render.js.map +0 -1
- package/build/commands/reset-render.js +0 -22
- package/build/commands/reset-render.js.map +0 -1
- package/build/commands/start-render.js +0 -35
- package/build/commands/start-render.js.map +0 -1
- package/build/commands/upload-search-content.js +0 -189
- package/build/commands/upload-search-content.js.map +0 -1
- package/build/constants/endpoints.js +0 -42
- package/build/constants/endpoints.js.map +0 -1
- package/build/constants/envs.js +0 -73
- package/build/constants/envs.js.map +0 -1
- package/build/constants/errors.js +0 -89
- package/build/constants/errors.js.map +0 -1
- package/build/exporter/adapters/gatsby/actions/clean.d.ts +0 -3
- package/build/exporter/adapters/gatsby/actions/close.d.ts +0 -3
- package/build/exporter/adapters/gatsby/actions/data.d.ts +0 -2
- package/build/exporter/adapters/gatsby/actions/healthCheck.d.ts +0 -2
- package/build/exporter/adapters/gatsby/actions/init.d.ts +0 -2
- package/build/exporter/adapters/gatsby/actions/meta.d.ts +0 -2
- package/build/exporter/adapters/gatsby/actions/prepare.d.ts +0 -2
- package/build/exporter/adapters/gatsby/actions/relocation.d.ts +0 -2
- package/build/exporter/adapters/gatsby/actions/restore.d.ts +0 -3
- package/build/exporter/adapters/gatsby/actions/ssg.d.ts +0 -3
- package/build/exporter/adapters/gatsby/actions/sync.d.ts +0 -3
- package/build/exporter/adapters/gatsby/index.d.ts +0 -9
- package/build/exporter/adapters/gatsby/shared/context.d.ts +0 -38
- package/build/exporter/adapters/gatsby/shared/extract-assets.d.ts +0 -7
- package/build/exporter/adapters/gatsby/shared/gatsby-build.d.ts +0 -7
- package/build/exporter/adapters/gatsby/shared/sync-render.d.ts +0 -36
- package/build/exporter/adapters/gatsby/shared/types.d.ts +0 -34
- package/build/exporter/commands/prepare-assets-directory.d.ts +0 -2
- package/build/exporter/commands/prepare-domains-render.d.ts +0 -2
- package/build/exporter/services/db.d.ts +0 -4
- package/build/exporter/services/store.d.ts +0 -15
- package/build/exporter/types/render.d.ts +0 -50
- package/build/exporter/utils/artifacts.d.ts +0 -6
- package/build/exporter/utils/brush.d.ts +0 -18
- package/build/exporter/utils/core-utils.d.ts +0 -77
- package/build/exporter/utils/folders.d.ts +0 -66
- package/build/exporter/utils/render.d.ts +0 -49
- package/build/services/auth.js +0 -39
- package/build/services/auth.js.map +0 -1
- package/build/services/db.js +0 -34
- package/build/services/db.js.map +0 -1
- package/build/services/navigation.js +0 -93
- package/build/services/navigation.js.map +0 -1
- package/build/services/reference-fields.js +0 -131
- package/build/services/reference-fields.js.map +0 -1
- package/build/services/robots.js +0 -58
- package/build/services/robots.js.map +0 -1
- package/build/services/sites.js +0 -109
- package/build/services/sites.js.map +0 -1
- package/build/services/store.js +0 -282
- package/build/services/store.js.map +0 -1
- package/build/types/api.js +0 -3
- package/build/types/api.js.map +0 -1
- package/build/types/global.js +0 -3
- package/build/types/global.js.map +0 -1
- package/build/types/navigation.js +0 -3
- package/build/types/navigation.js.map +0 -1
- package/build/types/pages.js +0 -3
- package/build/types/pages.js.map +0 -1
- package/build/types/render.js +0 -10
- package/build/types/render.js.map +0 -1
- package/build/types/sites.js +0 -3
- package/build/types/sites.js.map +0 -1
- package/build/types/templates.js +0 -3
- package/build/types/templates.js.map +0 -1
- package/build/utils/api.js +0 -161
- package/build/utils/api.js.map +0 -1
- package/build/utils/artifacts.js +0 -34
- package/build/utils/artifacts.js.map +0 -1
- package/build/utils/brush.js +0 -30
- package/build/utils/brush.js.map +0 -1
- package/build/utils/cache.js +0 -106
- package/build/utils/cache.js.map +0 -1
- package/build/utils/check-health.js +0 -68
- package/build/utils/check-health.js.map +0 -1
- package/build/utils/core-utils.js +0 -251
- package/build/utils/core-utils.js.map +0 -1
- package/build/utils/domains.js +0 -37
- package/build/utils/domains.js.map +0 -1
- package/build/utils/errors.js +0 -30
- package/build/utils/errors.js.map +0 -1
- package/build/utils/folders.js +0 -339
- package/build/utils/folders.js.map +0 -1
- package/build/utils/images.js +0 -45
- package/build/utils/images.js.map +0 -1
- package/build/utils/instance.js +0 -66
- package/build/utils/instance.js.map +0 -1
- package/build/utils/loggin.js +0 -102
- package/build/utils/loggin.js.map +0 -1
- package/build/utils/pages.js +0 -359
- package/build/utils/pages.js.map +0 -1
- package/build/utils/render.js +0 -144
- package/build/utils/render.js.map +0 -1
- package/build/utils/sites.js +0 -239
- package/build/utils/sites.js.map +0 -1
- package/build/utils/store.js +0 -193
- package/build/utils/store.js.map +0 -1
- package/exporter/adapters/gatsby/actions/clean.ts +0 -14
- package/exporter/adapters/gatsby/actions/close.ts +0 -17
- package/exporter/adapters/gatsby/actions/data.ts +0 -25
- package/exporter/adapters/gatsby/actions/healthCheck.ts +0 -10
- package/exporter/adapters/gatsby/actions/init.ts +0 -12
- package/exporter/adapters/gatsby/actions/meta.ts +0 -18
- package/exporter/adapters/gatsby/actions/prepare.ts +0 -9
- package/exporter/adapters/gatsby/actions/relocation.ts +0 -15
- package/exporter/adapters/gatsby/actions/restore.ts +0 -36
- package/exporter/adapters/gatsby/actions/ssg.ts +0 -12
- package/exporter/adapters/gatsby/actions/sync.ts +0 -70
- package/exporter/adapters/gatsby/shared/context.ts +0 -50
- package/exporter/adapters/gatsby/shared/extract-assets.ts +0 -61
- package/exporter/adapters/gatsby/shared/gatsby-build.ts +0 -54
- package/exporter/adapters/gatsby/shared/sync-render.ts +0 -294
- package/exporter/adapters/gatsby/shared/types.ts +0 -35
- package/exporter/build-esbuild.noop +0 -42
- package/exporter/commands/prepare-assets-directory.ts +0 -33
- package/exporter/services/db.ts +0 -32
- package/exporter/types/render.ts +0 -59
- package/exporter/utils/brush.ts +0 -34
- package/exporter/utils/check-health.ts +0 -79
- package/plugins/gatsby-plugin-svgr-loader/gatsby-node.js +0 -55
- package/plugins/gatsby-plugin-svgr-loader/package.json +0 -8
- package/build/{exporter/commands → commands}/end-render.d.ts +0 -0
- package/build/{exporter/commands → commands}/reset-render.d.ts +0 -0
- package/build/{exporter/commands → commands}/start-render.d.ts +0 -0
- package/build/{exporter/commands → commands}/upload-search-content.d.ts +0 -0
- package/build/{exporter/constants → constants}/endpoints.d.ts +0 -0
- package/build/{exporter/services → services}/navigation.d.ts +0 -0
- package/build/{exporter/services → services}/reference-fields.d.ts +0 -0
- package/build/{exporter/types → types}/pages.d.ts +1 -1
- /package/build/{exporter/types → types}/templates.d.ts +0 -0
- /package/build/{exporter/utils → utils}/api.d.ts +0 -0
- /package/build/{exporter/utils → utils}/images.d.ts +0 -0
- /package/build/{exporter/utils → utils}/instance.d.ts +0 -0
- /package/{react → exporter/react}/Favicon/utils.ts +0 -0
package/exporter/types/render.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { RenderInfo } from "./global";
|
|
2
|
-
|
|
3
|
-
const RENDER_MODE = {
|
|
4
|
-
FROM_SCRATCH: "FROM_SCRATCH",
|
|
5
|
-
INCREMENTAL: "INCREMENTAL",
|
|
6
|
-
IDLE: "IDLE",
|
|
7
|
-
} as const;
|
|
8
|
-
|
|
9
|
-
type RenderMode = (typeof RENDER_MODE)[keyof typeof RENDER_MODE];
|
|
10
|
-
|
|
11
|
-
export interface RenderModeTuple {
|
|
12
|
-
renderMode: RenderMode;
|
|
13
|
-
reason?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type DomainLike = string;
|
|
17
|
-
|
|
18
|
-
type RenderDB = {
|
|
19
|
-
proDomain: string;
|
|
20
|
-
griddoVersion: string;
|
|
21
|
-
buildReportFileName: string;
|
|
22
|
-
sortedDomains: Array<DomainLike>;
|
|
23
|
-
paths: {
|
|
24
|
-
root: string;
|
|
25
|
-
cx: string;
|
|
26
|
-
ssg: string;
|
|
27
|
-
cxCache: string;
|
|
28
|
-
components: string;
|
|
29
|
-
exportsDir: string;
|
|
30
|
-
};
|
|
31
|
-
domains: {
|
|
32
|
-
[key: DomainLike]: {
|
|
33
|
-
renderMode?: RenderMode;
|
|
34
|
-
shouldBeRendered?: boolean;
|
|
35
|
-
isRendering?: boolean;
|
|
36
|
-
renderInfo?: RenderInfo;
|
|
37
|
-
renderModeReason?: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
interface Report {
|
|
43
|
-
authControl:
|
|
44
|
-
| {
|
|
45
|
-
Authorization: string;
|
|
46
|
-
"Cache-Control": string;
|
|
47
|
-
lang?: string | undefined;
|
|
48
|
-
}
|
|
49
|
-
| undefined;
|
|
50
|
-
sites: Array<{
|
|
51
|
-
siteId: number;
|
|
52
|
-
publishHashes: Array<string>;
|
|
53
|
-
siteHash: string | null;
|
|
54
|
-
unpublishHashes: Array<string>;
|
|
55
|
-
publishPagesIds: Array<number>;
|
|
56
|
-
}>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { RENDER_MODE, type RenderDB, type RenderMode, type Report };
|
package/exporter/utils/brush.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Brush adds color to a string|number, it does not print it!
|
|
3
|
-
// Its simple, no log, no chains, just color in a string|number
|
|
4
|
-
// usage:
|
|
5
|
-
// console.log(brush.green("sucess!"))
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
const RESET = "\x1b[0m";
|
|
9
|
-
const CODES = {
|
|
10
|
-
black: "\x1b[30m",
|
|
11
|
-
red: "\x1b[31m",
|
|
12
|
-
green: "\x1b[32m",
|
|
13
|
-
yellow: "\x1b[33m",
|
|
14
|
-
blue: "\x1b[34m",
|
|
15
|
-
magenta: "\x1b[35m",
|
|
16
|
-
cyan: "\x1b[36m",
|
|
17
|
-
white: "\x1b[37m",
|
|
18
|
-
gray: "\x1b[90m",
|
|
19
|
-
bold: "\x1b[1m",
|
|
20
|
-
dim: "\x1b[2m",
|
|
21
|
-
} as const;
|
|
22
|
-
|
|
23
|
-
type ColorFunction = (text: string | number) => string;
|
|
24
|
-
type ColorName = keyof typeof CODES;
|
|
25
|
-
type Brush = Record<ColorName, ColorFunction>;
|
|
26
|
-
|
|
27
|
-
const brush = {} as Brush;
|
|
28
|
-
|
|
29
|
-
for (const color in CODES) {
|
|
30
|
-
const key = color as ColorName;
|
|
31
|
-
brush[key] = (text: string | number) => `${CODES[key]}${text}${RESET}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { brush };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { CheckHealthError } from "../constants/errors";
|
|
4
|
-
import { isTruthy } from "./core-utils";
|
|
5
|
-
import { throwError } from "./errors";
|
|
6
|
-
|
|
7
|
-
const GRIDDO_ENVS_VARS: ReadonlyArray<string> = [];
|
|
8
|
-
const GRIDDO_SKIP_BUILD_CHECKS = isTruthy(process.env.GRIDDO_SKIP_BUILD_CHECKS);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Check if a list of environments variables exist with any value.
|
|
12
|
-
*
|
|
13
|
-
* @todo Also check the value.
|
|
14
|
-
* @param envs An array of environments variables
|
|
15
|
-
* @returns exists with (1) if there are missing envs vars
|
|
16
|
-
*/
|
|
17
|
-
function checkEnvsVars(envs: ReadonlyArray<string>) {
|
|
18
|
-
const missingEnvs = envs.filter((envName) => {
|
|
19
|
-
return !process.env[envName];
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
if (missingEnvs.length) {
|
|
23
|
-
const missingEnvsMsg = missingEnvs.join("\n");
|
|
24
|
-
console.error(`Env check failed. These envs vars are missing: \n\n${missingEnvsMsg}`);
|
|
25
|
-
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function checkEnvsVarsAndValues(envs: Array<Record<string, string>>): boolean {
|
|
33
|
-
for (const env of envs) {
|
|
34
|
-
const [key, expected] = Object.entries(env)[0];
|
|
35
|
-
const actual = process.env[key];
|
|
36
|
-
|
|
37
|
-
if (actual !== expected) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Check if the environment is secure to launch a render.
|
|
46
|
-
* If something fails then log an error message and exit from the process.
|
|
47
|
-
* Otherwise just return true.
|
|
48
|
-
*/
|
|
49
|
-
export function checkHealth() {
|
|
50
|
-
// Bypass the check using this env var, handy for local renders.
|
|
51
|
-
if (GRIDDO_SKIP_BUILD_CHECKS) {
|
|
52
|
-
console.info("Build health check skipped");
|
|
53
|
-
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Checklist
|
|
58
|
-
// check if it's setted
|
|
59
|
-
const areRequiredEnvsSet = checkEnvsVars(GRIDDO_ENVS_VARS);
|
|
60
|
-
// check if it's setted and the value
|
|
61
|
-
const areEnvsMatchingExpected = checkEnvsVarsAndValues([
|
|
62
|
-
{
|
|
63
|
-
GRIDDO_RENDER_BY_DOMAINS: "true",
|
|
64
|
-
},
|
|
65
|
-
]);
|
|
66
|
-
|
|
67
|
-
// Render is safe if...
|
|
68
|
-
const isSafeToRender = areRequiredEnvsSet && areEnvsMatchingExpected;
|
|
69
|
-
|
|
70
|
-
// The environment is suitable for a build-render
|
|
71
|
-
if (isSafeToRender) {
|
|
72
|
-
console.info("\nBuild health check passed\n");
|
|
73
|
-
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Error
|
|
78
|
-
throwError(CheckHealthError);
|
|
79
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
exports.onCreateWebpackConfig = (
|
|
2
|
-
{ stage, actions, getConfig, rules },
|
|
3
|
-
{ rule: ruleProps = {} },
|
|
4
|
-
) => {
|
|
5
|
-
const { include, exclude, options, ...otherProps } = ruleProps;
|
|
6
|
-
|
|
7
|
-
if (["develop", "develop-html", "build-html", "build-javascript"].includes(stage)) {
|
|
8
|
-
// Add the react-svg-loader rule
|
|
9
|
-
actions.setWebpackConfig({
|
|
10
|
-
module: {
|
|
11
|
-
rules: [
|
|
12
|
-
{
|
|
13
|
-
test: /\.svg$/,
|
|
14
|
-
include,
|
|
15
|
-
exclude,
|
|
16
|
-
...otherProps,
|
|
17
|
-
use: [
|
|
18
|
-
{
|
|
19
|
-
loader: "@svgr/webpack",
|
|
20
|
-
options,
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
const cfg = getConfig();
|
|
28
|
-
const imgsRule = rules.images();
|
|
29
|
-
|
|
30
|
-
const newUrlLoaderRule =
|
|
31
|
-
include || exclude
|
|
32
|
-
? {
|
|
33
|
-
...imgsRule,
|
|
34
|
-
include: exclude,
|
|
35
|
-
exclude: include,
|
|
36
|
-
}
|
|
37
|
-
: {
|
|
38
|
-
...imgsRule,
|
|
39
|
-
test: new RegExp(imgsRule.test.toString().replace("svg|", "").slice(1, -1)),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
cfg.module.rules = [
|
|
43
|
-
// Remove the base url-loader images rule entirely
|
|
44
|
-
...cfg.module.rules.filter((rule) => {
|
|
45
|
-
if (rule.test) {
|
|
46
|
-
return rule.test.toString() !== imgsRule.test.toString();
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}),
|
|
50
|
-
// Put it back without SVG loading
|
|
51
|
-
newUrlLoaderRule,
|
|
52
|
-
];
|
|
53
|
-
actions.replaceWebpackConfig(cfg);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Core, Fields } from "@griddo/core";
|
|
2
1
|
import type { SocialsResponse } from "./api";
|
|
3
2
|
import type { Settings } from "./global";
|
|
4
3
|
import type { Site } from "./sites";
|
|
4
|
+
import type { Core, Fields } from "@griddo/core";
|
|
5
5
|
export type APIPageObject = Core.Page & {
|
|
6
6
|
id: number;
|
|
7
7
|
} & {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|