@hubspot/cms-dev-server 0.13.5 → 0.13.7
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/dist/internalSsr.js +13 -1
- package/dist/run.js +108 -9
- package/dist/storybook/index.js +1 -1
- package/dist/storybook-main/main.js +13 -1
- package/package.json +3 -3
- package/dist/fsevents-72LCIACT.node +0 -0
- package/types/components/ModulesList.d.ts +0 -5
- package/types/components/PartialsList.d.ts +0 -4
- package/types/generateBpmAliases.d.ts +0 -2
- package/types/lib/debug.d.ts +0 -1
- package/types/lib/fetchModuleGraphQLData.d.ts +0 -24
- package/types/lib/fullOriginalUrlFromRequest.d.ts +0 -5
- package/types/lib/moduleGraph.d.ts +0 -1
- package/types/lib/packagePath.d.ts +0 -1
- package/types/lib/pathHelpers.d.ts +0 -3
- package/types/lib/proxyHelpers.d.ts +0 -8
- package/types/lib/renderComponentWithCSS.d.ts +0 -14
- package/types/lib/renderHelpers.d.ts +0 -1
- package/types/lib/renderModule.d.ts +0 -8
- package/types/lib/renderPartial.d.ts +0 -5
- package/types/lib/templates.d.ts +0 -4
- package/types/noNodeBuiltinsPlugin.d.ts +0 -3
- package/types/plugins/componentRoutesPlugin.d.ts +0 -2
- package/types/plugins/jsRenderingPlugin.d.ts +0 -2
- package/types/plugins/localProxyPlugin.d.ts +0 -2
- package/types/plugins/storybookPlugin.d.ts +0 -2
- package/types/proxyPage/constants.d.ts +0 -1
- package/types/proxyPage/fetchContentMetadata.d.ts +0 -7
- package/types/proxyPage/fetchPreviewInfo.d.ts +0 -6
- package/types/proxyPage/proxyPage.d.ts +0 -6
- package/types/proxyPage/renderLocalError.d.ts +0 -2
- package/types/proxyPage/utils.d.ts +0 -4
- package/types/resolveSharedDeps.d.ts +0 -2
- package/types/routes/createDevServerRoutes.d.ts +0 -3
- package/types/routes/homeRouteHandler.d.ts +0 -3
- package/types/routes/linksToAllModulesRouteHandler.d.ts +0 -2
- package/types/routes/linksToAllPartialsRouteHandler.d.ts +0 -2
- package/types/routes/module.d.ts +0 -3
- package/types/routes/partial.d.ts +0 -2
- package/types/routes/proxyPageResourceRedirect.d.ts +0 -2
- package/types/routes/proxyPageRouteHandler.d.ts +0 -2
- package/types/routes/proxyPathPageResourceRedirect.d.ts +0 -2
- package/types/routes/proxyPathPageRouteHandler.d.ts +0 -2
package/dist/internalSsr.js
CHANGED
|
@@ -516,7 +516,7 @@ function findAllPartialsInRoot(webRoot) {
|
|
|
516
516
|
const partialSubpaths = Object.keys(allPartialComponents);
|
|
517
517
|
return { partialNames, partialSubpaths };
|
|
518
518
|
}
|
|
519
|
-
function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath, prettyPrint) {
|
|
519
|
+
function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath, prettyPrint, criticalDevErrors) {
|
|
520
520
|
if (prettyPrint === void 0 && hsServerPageUrl && cmsComponents.isDebugUrlString) {
|
|
521
521
|
prettyPrint = cmsComponents.isDebugUrlString(hsServerPageUrl);
|
|
522
522
|
}
|
|
@@ -531,6 +531,18 @@ function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath
|
|
|
531
531
|
if (hsBasePath) {
|
|
532
532
|
globals.push(`window.__hsBasePath = '${hsBasePath}';`);
|
|
533
533
|
}
|
|
534
|
+
if (!environmentConfig.getIsDeployed() && (criticalDevErrors == null ? void 0 : criticalDevErrors.length)) {
|
|
535
|
+
const firstCriticalDevError = criticalDevErrors[0];
|
|
536
|
+
globals.push(`
|
|
537
|
+
customElements.whenDefined('vite-error-overlay').then(() => {
|
|
538
|
+
const ErrorOverlay = customElements.get('vite-error-overlay');
|
|
539
|
+
const error = new Error("${firstCriticalDevError.message}");
|
|
540
|
+
const overlay = new ErrorOverlay(error);
|
|
541
|
+
|
|
542
|
+
document.body.appendChild(overlay);
|
|
543
|
+
})
|
|
544
|
+
`);
|
|
545
|
+
}
|
|
534
546
|
return `
|
|
535
547
|
<script type="text/javascript">
|
|
536
548
|
${globals.join("\n ")}
|
package/dist/run.js
CHANGED
|
@@ -537,7 +537,7 @@ function findAllPartialsInRoot(webRoot2) {
|
|
|
537
537
|
const partialSubpaths = Object.keys(allPartialComponents);
|
|
538
538
|
return { partialNames, partialSubpaths };
|
|
539
539
|
}
|
|
540
|
-
function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath, prettyPrint) {
|
|
540
|
+
function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath, prettyPrint, criticalDevErrors) {
|
|
541
541
|
if (prettyPrint === void 0 && hsServerPageUrl && cmsComponents.isDebugUrlString) {
|
|
542
542
|
prettyPrint = cmsComponents.isDebugUrlString(hsServerPageUrl);
|
|
543
543
|
}
|
|
@@ -552,6 +552,18 @@ function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath
|
|
|
552
552
|
if (hsBasePath) {
|
|
553
553
|
globals.push(`window.__hsBasePath = '${hsBasePath}';`);
|
|
554
554
|
}
|
|
555
|
+
if (!environmentConfig.getIsDeployed() && (criticalDevErrors == null ? void 0 : criticalDevErrors.length)) {
|
|
556
|
+
const firstCriticalDevError = criticalDevErrors[0];
|
|
557
|
+
globals.push(`
|
|
558
|
+
customElements.whenDefined('vite-error-overlay').then(() => {
|
|
559
|
+
const ErrorOverlay = customElements.get('vite-error-overlay');
|
|
560
|
+
const error = new Error("${firstCriticalDevError.message}");
|
|
561
|
+
const overlay = new ErrorOverlay(error);
|
|
562
|
+
|
|
563
|
+
document.body.appendChild(overlay);
|
|
564
|
+
})
|
|
565
|
+
`);
|
|
566
|
+
}
|
|
555
567
|
return `
|
|
556
568
|
<script type="text/javascript">
|
|
557
569
|
${globals.join("\n ")}
|
|
@@ -778,6 +790,22 @@ import { promises as fsPromises } from "fs";
|
|
|
778
790
|
import {
|
|
779
791
|
isDebugUrlString as isDebugUrlString2
|
|
780
792
|
} from "@hubspot/cms-components";
|
|
793
|
+
|
|
794
|
+
// src/lib/criticalDevErrorsToServerMessages.ts
|
|
795
|
+
var criticalDevErrorsToServerMessages = (criticalDevErrors) => {
|
|
796
|
+
const logMessages = criticalDevErrors.map(
|
|
797
|
+
(criticalDevError) => {
|
|
798
|
+
return {
|
|
799
|
+
level: criticalDevError.level,
|
|
800
|
+
parameters: [criticalDevError.message]
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
return logMessages;
|
|
805
|
+
};
|
|
806
|
+
var criticalDevErrorsToServerMessages_default = criticalDevErrorsToServerMessages;
|
|
807
|
+
|
|
808
|
+
// src/lib/templates.ts
|
|
781
809
|
var { readFile } = fsPromises;
|
|
782
810
|
var generateIslandSetupScriptBlock = () => {
|
|
783
811
|
return `
|
|
@@ -822,21 +850,30 @@ var createIslandHtmlTemplate = async (baseTemplatePath, title, globalScriptBlock
|
|
|
822
850
|
var createHtmlShellDependingOnRenderContext = async (baseTemplatePath, url3, title, renderContext, viteServer, __jsRenderingGates) => {
|
|
823
851
|
let htmlTemplate;
|
|
824
852
|
const prettyPrint = isDebugUrlString2(url3);
|
|
853
|
+
const serverMessages = criticalDevErrorsToServerMessages_default(
|
|
854
|
+
renderContext.criticalDevErrors
|
|
855
|
+
);
|
|
856
|
+
const serverLogScript = serverMessages.length ? scriptTagToLogServerMessages(
|
|
857
|
+
serverMessages,
|
|
858
|
+
"@hubspot/cms-dev-server messages"
|
|
859
|
+
) : "";
|
|
825
860
|
if (renderContext.islands.length) {
|
|
826
861
|
const globalScriptBlock = getServerGlobalsToInject(
|
|
827
862
|
renderContext.environmentConfig,
|
|
828
863
|
renderContext.pageUrl,
|
|
829
|
-
renderContext.entryPointBasePath
|
|
864
|
+
renderContext.entryPointBasePath,
|
|
865
|
+
void 0,
|
|
866
|
+
renderContext.criticalDevErrors
|
|
830
867
|
);
|
|
831
868
|
htmlTemplate = await createIslandHtmlTemplate(
|
|
832
869
|
baseTemplatePath,
|
|
833
870
|
title,
|
|
834
|
-
globalScriptBlock
|
|
871
|
+
`${globalScriptBlock}${serverLogScript}`
|
|
835
872
|
);
|
|
836
873
|
htmlTemplate = htmlTemplate.replace(
|
|
837
874
|
"<!--islandsglobal-->",
|
|
838
875
|
`<script>
|
|
839
|
-
${createIslandsGlobalJsForClientInDev(
|
|
876
|
+
${createIslandsGlobalJsForClientInDev(
|
|
840
877
|
renderContext.islands,
|
|
841
878
|
renderContext.perServerRequestData,
|
|
842
879
|
viteServer,
|
|
@@ -848,12 +885,16 @@ ${createIslandsGlobalJsForClientInDev(
|
|
|
848
885
|
);
|
|
849
886
|
} else {
|
|
850
887
|
const globalScriptBlock = getServerGlobalsToInject(
|
|
851
|
-
renderContext.environmentConfig
|
|
888
|
+
renderContext.environmentConfig,
|
|
889
|
+
void 0,
|
|
890
|
+
void 0,
|
|
891
|
+
void 0,
|
|
892
|
+
renderContext.criticalDevErrors
|
|
852
893
|
);
|
|
853
894
|
htmlTemplate = await createdPlainHtmlTemplate(
|
|
854
895
|
baseTemplatePath,
|
|
855
896
|
title,
|
|
856
|
-
globalScriptBlock
|
|
897
|
+
`${globalScriptBlock}${serverLogScript}`
|
|
857
898
|
);
|
|
858
899
|
}
|
|
859
900
|
return viteServer.transformIndexHtml(url3, htmlTemplate);
|
|
@@ -913,7 +954,7 @@ function trackUsage(action) {
|
|
|
913
954
|
eventName: EVENT_NAME,
|
|
914
955
|
action,
|
|
915
956
|
nodeVersion: getNodeVersionData(),
|
|
916
|
-
version: "0.13.
|
|
957
|
+
version: "0.13.7",
|
|
917
958
|
os: getPlatform()
|
|
918
959
|
};
|
|
919
960
|
const uri = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
|
@@ -1112,6 +1153,7 @@ import { normalizePath as normalizePath3 } from "vite";
|
|
|
1112
1153
|
// src/lib/renderModule.ts
|
|
1113
1154
|
import { join as joinPosix2 } from "path/posix";
|
|
1114
1155
|
import { traverseFieldsJSON } from "@hubspot/cms-components/fields";
|
|
1156
|
+
import cliHttp3 from "@hubspot/cli-lib/http.js";
|
|
1115
1157
|
|
|
1116
1158
|
// src/lib/fetchModuleGraphQLData.ts
|
|
1117
1159
|
import cliHttp2 from "@hubspot/cli-lib/http.js";
|
|
@@ -1140,6 +1182,39 @@ async function fetchModuleGraphQLData(accountId, query, requestedModulePath, pag
|
|
|
1140
1182
|
}
|
|
1141
1183
|
|
|
1142
1184
|
// src/lib/renderModule.ts
|
|
1185
|
+
var getApplyFieldsValidationToRenderContext = (portalId, fieldsJSON, requestedModulePath) => {
|
|
1186
|
+
return async (renderResult) => {
|
|
1187
|
+
const { renderContext } = renderResult;
|
|
1188
|
+
const validationSeverityToLogLevel = {
|
|
1189
|
+
FATAL: "error",
|
|
1190
|
+
WARNING: "warn"
|
|
1191
|
+
};
|
|
1192
|
+
let validationRequest;
|
|
1193
|
+
let fieldValidationErrors = [];
|
|
1194
|
+
try {
|
|
1195
|
+
validationRequest = await cliHttp3.post(portalId, {
|
|
1196
|
+
uri: "/designmanager/v1/modules/validate-fields",
|
|
1197
|
+
body: fieldsJSON,
|
|
1198
|
+
resolveWithFullResponse: true
|
|
1199
|
+
});
|
|
1200
|
+
} catch {
|
|
1201
|
+
console.log("Failed to validate module fields for", requestedModulePath);
|
|
1202
|
+
}
|
|
1203
|
+
if (validationRequest) {
|
|
1204
|
+
fieldValidationErrors = validationRequest.body;
|
|
1205
|
+
}
|
|
1206
|
+
if (fieldValidationErrors.length) {
|
|
1207
|
+
fieldValidationErrors.forEach((fieldValidationError) => {
|
|
1208
|
+
renderContext.criticalDevErrors.push({
|
|
1209
|
+
message: `Field Validation Error in ${requestedModulePath}: ${fieldValidationError.message}`,
|
|
1210
|
+
error: new Error(fieldValidationError.message),
|
|
1211
|
+
level: validationSeverityToLogLevel[fieldValidationError.severity] || "info"
|
|
1212
|
+
});
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
return renderResult;
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1143
1218
|
var lookForModuleInFolder2 = async (modulePath, viteServer) => {
|
|
1144
1219
|
let componentModule;
|
|
1145
1220
|
const insideFolderPath = joinPosix2(modulePath, "index");
|
|
@@ -1199,6 +1274,11 @@ async function renderModule(viteServer, requestedModulePath, moduleProps, pageUr
|
|
|
1199
1274
|
);
|
|
1200
1275
|
const fieldsJSON = renderFieldsToJson(fields, requestedModulePath);
|
|
1201
1276
|
const fieldValues = getFieldValuesForModule(fieldsJSON, fieldOverrides);
|
|
1277
|
+
const applyFieldsValidationToRenderContext = getApplyFieldsValidationToRenderContext(
|
|
1278
|
+
environmentConfig.getPortalID(),
|
|
1279
|
+
fieldsJSON,
|
|
1280
|
+
requestedModulePath
|
|
1281
|
+
);
|
|
1202
1282
|
if (componentModule.query && typeof componentModule.query === "string") {
|
|
1203
1283
|
try {
|
|
1204
1284
|
dataQueryResult = await fetchModuleGraphQLData(
|
|
@@ -1249,7 +1329,7 @@ async function renderModule(viteServer, requestedModulePath, moduleProps, pageUr
|
|
|
1249
1329
|
basePath,
|
|
1250
1330
|
environmentConfig,
|
|
1251
1331
|
renderOptions
|
|
1252
|
-
);
|
|
1332
|
+
).then(applyFieldsValidationToRenderContext);
|
|
1253
1333
|
}
|
|
1254
1334
|
function getFieldValuesForModule(fieldsJSON, fieldOverrides = {}) {
|
|
1255
1335
|
const props = {};
|
|
@@ -1891,6 +1971,7 @@ async function proxySpecificPage(response, portalId, hublet, contentId, webRoot2
|
|
|
1891
1971
|
let islands = [];
|
|
1892
1972
|
let mergedPerRequestState = /* @__PURE__ */ new Map();
|
|
1893
1973
|
let basePath;
|
|
1974
|
+
const criticalDevErrors = [];
|
|
1894
1975
|
const renderPromisesByChunkIndex = new Array(
|
|
1895
1976
|
numPlaceholders
|
|
1896
1977
|
);
|
|
@@ -1920,10 +2001,14 @@ async function proxySpecificPage(response, portalId, hublet, contentId, webRoot2
|
|
|
1920
2001
|
projectComponentPath
|
|
1921
2002
|
);
|
|
1922
2003
|
renderPromisesByChunkIndex[indexForThisRender] = renderPromise.then((promiseResult) => {
|
|
2004
|
+
var _a;
|
|
1923
2005
|
let { html, cssNeeded, inlineAssets, renderContext } = promiseResult;
|
|
1924
2006
|
console.log(
|
|
1925
2007
|
`Finished render of ${localRenderPlaceholder.path} (i = ${indexForThisRender})`
|
|
1926
2008
|
);
|
|
2009
|
+
if ((_a = renderContext.criticalDevErrors) == null ? void 0 : _a.length) {
|
|
2010
|
+
criticalDevErrors.push(...renderContext.criticalDevErrors);
|
|
2011
|
+
}
|
|
1927
2012
|
if (renderContext.islands.length > 0) {
|
|
1928
2013
|
islands = islands.concat(renderContext.islands);
|
|
1929
2014
|
}
|
|
@@ -1963,8 +2048,22 @@ ${result}`;
|
|
|
1963
2048
|
response.write(foobar);
|
|
1964
2049
|
}
|
|
1965
2050
|
response.write(
|
|
1966
|
-
getServerGlobalsToInject(
|
|
2051
|
+
getServerGlobalsToInject(
|
|
2052
|
+
environmentConfig,
|
|
2053
|
+
fullOriginalUrl,
|
|
2054
|
+
basePath,
|
|
2055
|
+
void 0,
|
|
2056
|
+
criticalDevErrors
|
|
2057
|
+
)
|
|
1967
2058
|
);
|
|
2059
|
+
if (criticalDevErrors.length) {
|
|
2060
|
+
response.write(
|
|
2061
|
+
scriptTagToLogServerMessages(
|
|
2062
|
+
criticalDevErrorsToServerMessages_default(criticalDevErrors),
|
|
2063
|
+
"@hubspot/cms-dev-server messages"
|
|
2064
|
+
)
|
|
2065
|
+
);
|
|
2066
|
+
}
|
|
1968
2067
|
if (islands.length > 0) {
|
|
1969
2068
|
const sortedIslandRoots = sortIslandRootsByPriority(islands);
|
|
1970
2069
|
const islandRuntimeAndGlobalScriptHtml = await getIslandRuntimeAndGlobalToInject(
|
package/dist/storybook/index.js
CHANGED
|
@@ -165,7 +165,7 @@ function moduleStory(ModuleComponent, fields, storyArgs) {
|
|
|
165
165
|
return {
|
|
166
166
|
render: (_args) => {
|
|
167
167
|
const fieldValues = getNestedFieldObjectForArgs(_args);
|
|
168
|
-
const props = namespaceModulePropsShape(
|
|
168
|
+
const props = namespaceModulePropsShape(fieldValues);
|
|
169
169
|
return /* @__PURE__ */ jsx(ModuleComponent, { ...props });
|
|
170
170
|
},
|
|
171
171
|
argTypes,
|
|
@@ -296,7 +296,7 @@ function findAllPartialsInRoot(webRoot2) {
|
|
|
296
296
|
const partialSubpaths = Object.keys(allPartialComponents);
|
|
297
297
|
return { partialNames, partialSubpaths };
|
|
298
298
|
}
|
|
299
|
-
function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath, prettyPrint) {
|
|
299
|
+
function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath, prettyPrint, criticalDevErrors) {
|
|
300
300
|
if (prettyPrint === void 0 && hsServerPageUrl && cmsComponents.isDebugUrlString) {
|
|
301
301
|
prettyPrint = cmsComponents.isDebugUrlString(hsServerPageUrl);
|
|
302
302
|
}
|
|
@@ -311,6 +311,18 @@ function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath
|
|
|
311
311
|
if (hsBasePath) {
|
|
312
312
|
globals.push(`window.__hsBasePath = '${hsBasePath}';`);
|
|
313
313
|
}
|
|
314
|
+
if (!environmentConfig.getIsDeployed() && (criticalDevErrors == null ? void 0 : criticalDevErrors.length)) {
|
|
315
|
+
const firstCriticalDevError = criticalDevErrors[0];
|
|
316
|
+
globals.push(`
|
|
317
|
+
customElements.whenDefined('vite-error-overlay').then(() => {
|
|
318
|
+
const ErrorOverlay = customElements.get('vite-error-overlay');
|
|
319
|
+
const error = new Error("${firstCriticalDevError.message}");
|
|
320
|
+
const overlay = new ErrorOverlay(error);
|
|
321
|
+
|
|
322
|
+
document.body.appendChild(overlay);
|
|
323
|
+
})
|
|
324
|
+
`);
|
|
325
|
+
}
|
|
314
326
|
return `
|
|
315
327
|
<script type="text/javascript">
|
|
316
328
|
${globals.join("\n ")}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cms-dev-server",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@hubspot/cli-lib": "^3.0.12",
|
|
28
|
-
"@hubspot/cms-components": "^0.13.
|
|
28
|
+
"@hubspot/cms-components": "^0.13.7",
|
|
29
29
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
30
30
|
"@storybook/addon-actions": "7.0.7",
|
|
31
31
|
"@storybook/addon-essentials": "7.0.7",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"publishConfig": {
|
|
102
102
|
"access": "public"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "a763f4937fd0e13aa14be03d5093eaa537639ece"
|
|
105
105
|
}
|
|
Binary file
|
package/types/lib/debug.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const debug: any;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare type DataQueryPoints = {
|
|
2
|
-
count: number;
|
|
3
|
-
weight: number;
|
|
4
|
-
used_points: number;
|
|
5
|
-
};
|
|
6
|
-
declare type DataQueryResult = {
|
|
7
|
-
extensions: {
|
|
8
|
-
query_complexity: {
|
|
9
|
-
max_points: number;
|
|
10
|
-
used_points: number;
|
|
11
|
-
points_for_internal_api_requests: DataQueryPoints;
|
|
12
|
-
points_for_objects_retrieved: DataQueryPoints;
|
|
13
|
-
points_for_properties_with_value: DataQueryPoints;
|
|
14
|
-
points_for_properties_without_value: DataQueryPoints;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
data?: {
|
|
18
|
-
CRM?: any;
|
|
19
|
-
HUBDB?: any;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare function clearGraphQLDataCache(): void;
|
|
23
|
-
export default function fetchModuleGraphQLData(accountId: number, query: string, requestedModulePath: string, pageUrl: string): Promise<DataQueryResult>;
|
|
24
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const findFullPathInModuleGraph: (modulePathNoExtension: string, moduleGraph: any) => string | void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function packagePath(metaUrl: string, projectPath: string): string;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
export declare const getComponentPaths: (viteServer: ViteDevServer, componentPath: string) => [componentPathNoExtension: string, componentPathWithExtension: string];
|
|
3
|
-
export declare const getEntryPointBasePath: (componentPath: string) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface LocalRenderBlockInfo {
|
|
2
|
-
startOffset: number;
|
|
3
|
-
endOffset: number;
|
|
4
|
-
path: string;
|
|
5
|
-
json: any;
|
|
6
|
-
}
|
|
7
|
-
export declare const findLocalRenderPlaceholders: (body: string) => Array<LocalRenderBlockInfo>;
|
|
8
|
-
export declare const getProjectNameFromHSConfig: (hsProjectConfigPath: any) => any;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
|
-
import { RenderToPipeableStreamOptions } from 'react-dom/server';
|
|
4
|
-
import { ServerRenderContextValue } from '@hubspot/cms-components';
|
|
5
|
-
import { EnvironmentConfig } from '@hubspot/cms-components/config';
|
|
6
|
-
import { InlineAsset } from '@hubspot/cms-js-internal';
|
|
7
|
-
export declare type RenderResult = {
|
|
8
|
-
html: string;
|
|
9
|
-
inlineAssets?: InlineAsset[];
|
|
10
|
-
cssNeeded: string;
|
|
11
|
-
renderContext: ServerRenderContextValue;
|
|
12
|
-
};
|
|
13
|
-
declare function renderComponentWithCSS(viteServer: ViteDevServer, componentPath: string, Component: ComponentType, props: any, pageUrl: string, entryPointBasePath: string, environmentConfig: EnvironmentConfig, renderOptions: RenderToPipeableStreamOptions): Promise<RenderResult>;
|
|
14
|
-
export default renderComponentWithCSS;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const logPartialInfo: (partialPath: any, props: any) => void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { RenderToPipeableStreamOptions } from 'react-dom/server';
|
|
3
|
-
import { EnvironmentConfig } from '@hubspot/cms-components/config';
|
|
4
|
-
declare function renderModule(viteServer: ViteDevServer, requestedModulePath: string, moduleProps: {
|
|
5
|
-
fieldValues: any;
|
|
6
|
-
hublParameters?: any;
|
|
7
|
-
}, pageUrl: string, basePath: string, environmentConfig: EnvironmentConfig, renderOptions?: RenderToPipeableStreamOptions): Promise<import("./renderComponentWithCSS.js").RenderResult>;
|
|
8
|
-
export default renderModule;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { EnvironmentConfig } from '@hubspot/cms-components/config';
|
|
2
|
-
import { ViteDevServer } from 'vite';
|
|
3
|
-
import { RenderToPipeableStreamOptions } from 'react-dom/server';
|
|
4
|
-
declare function renderPartial(viteServer: ViteDevServer, partialPath: string, props: any, pageUrl: string, basePath: string, environmentConfig: EnvironmentConfig, renderOptions?: RenderToPipeableStreamOptions): Promise<import("./renderComponentWithCSS.js").RenderResult>;
|
|
5
|
-
export default renderPartial;
|
package/types/lib/templates.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { ServerRenderContextValue } from '@hubspot/cms-components';
|
|
3
|
-
export declare const createHtmlShellDependingOnRenderContext: (baseTemplatePath: string, url: string, title: string, renderContext: ServerRenderContextValue, viteServer: ViteDevServer, __jsRenderingGates: string[]) => Promise<string>;
|
|
4
|
-
export declare const getIslandRuntimeAndGlobalToInject: (sortedIslandRoots: any, perServerRequestData: any, viteServer: ViteDevServer, __gates: string[]) => Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const VALID_PROXY_DOMAIN_SUFFIXES: string[];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Hublet } from '@hubspot/cms-components';
|
|
2
|
-
export declare type PortalContentIdAndHublet = {
|
|
3
|
-
portalId: number;
|
|
4
|
-
contentId: string;
|
|
5
|
-
hublet: Hublet;
|
|
6
|
-
};
|
|
7
|
-
export default function fetchContentMetadata(url: string, portalId: number): Promise<PortalContentIdAndHublet>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Response } from 'express';
|
|
2
|
-
import { ViteDevServer } from 'vite';
|
|
3
|
-
import { Gate } from '@hubspot/cms-js-internal';
|
|
4
|
-
import { Hublet } from '@hubspot/cms-components';
|
|
5
|
-
export declare const makeProxyPreviewRequest: (accountId: string, urlToProxy: string, previewKey: string, contentId: string, projectName: string, __jsRenderingGates: Gate[]) => any;
|
|
6
|
-
export default function proxySpecificPage(response: Response, portalId: number, hublet: Hublet, contentId: string, webRoot: string, viteServer: ViteDevServer, projectName: string, projectComponentPath: string, jsRenderingGates: Gate[], urlToProxy?: string, fullOriginalUrl?: string): Promise<void>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RenderResult } from '../lib/renderComponentWithCSS.js';
|
|
2
|
-
export declare const getSubDomainFromValidLocalDomain: (hostname: any) => any;
|
|
3
|
-
export declare const fakeRenderJsComponent: (indexForThisRender: any) => Promise<RenderResult>;
|
|
4
|
-
export declare const consoleWarn: (message: any) => void;
|
package/types/routes/module.d.ts
DELETED