@hubspot/cms-dev-server 0.18.18 → 0.18.20

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/index.js CHANGED
@@ -361,14 +361,6 @@ var serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestD
361
361
  if (isUngatedForClientOnlySupplementalFieldSerialization && output.clientOnly) {
362
362
  output.supplementalFieldValues = supplementalFieldValues;
363
363
  }
364
- if (output.supplementalFieldValues) {
365
- output.supplementalFieldValues = Object.keys(
366
- output.supplementalFieldValues
367
- ).sort().reduce((acc, key) => {
368
- acc[key] = output.supplementalFieldValues[key];
369
- return acc;
370
- }, {});
371
- }
372
364
  return output;
373
365
  }
374
366
  );
@@ -1469,7 +1461,7 @@ function trackUsage(action) {
1469
1461
  eventName: EVENT_NAME,
1470
1462
  action,
1471
1463
  nodeVersion: getNodeVersionData(),
1472
- version: "0.18.18",
1464
+ version: "0.18.20",
1473
1465
  os: getPlatform()
1474
1466
  };
1475
1467
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
@@ -3923,9 +3915,7 @@ var buildModuleIndex = () => buildHTMLResponse(`
3923
3915
 
3924
3916
  // src/routes/hublTemplateRouteHandler.ts
3925
3917
  import { http as hsCliHttp10 } from "@hubspot/local-dev-lib/http";
3926
- import {
3927
- buildStaticEnvConfig as buildStaticEnvConfig5
3928
- } from "@hubspot/cms-components";
3918
+ import { buildStaticEnvConfig as buildStaticEnvConfig5 } from "@hubspot/cms-components";
3929
3919
  import { getEnv as getEnv2 } from "@hubspot/local-dev-lib/config";
3930
3920
  var templateRouteHandler = async (request2, response) => {
3931
3921
  sendTrackingRequest("view-template-route");
@@ -3955,7 +3945,9 @@ var templateRouteHandler = async (request2, response) => {
3955
3945
  try {
3956
3946
  templateInfo = await fetchTemplateByPath(authedPortalId, calculatedPath);
3957
3947
  } catch (err) {
3958
- console.error(`Failed to fetch template data for ${calculatedPath}: ${err}`);
3948
+ console.error(
3949
+ `Failed to fetch template data for ${calculatedPath}: ${err}`
3950
+ );
3959
3951
  }
3960
3952
  if (!templateInfo || !("previewKey" in templateInfo)) {
3961
3953
  response.status(500).set({ "Content-Type": "text/html" }).end(buildErrorIndex2());
@@ -3972,6 +3964,7 @@ var templateRouteHandler = async (request2, response) => {
3972
3964
  ...request2.query
3973
3965
  };
3974
3966
  const previewUrl = new URL(getPreviewUrl(request2, params));
3967
+ const fullOriginalUrl = `${request2.protocol}://${request2.get("host")}${request2.originalUrl}`;
3975
3968
  try {
3976
3969
  const result = (await hsCliHttp10.get(authedPortalId, {
3977
3970
  baseURL: previewUrl.origin,
@@ -3983,7 +3976,7 @@ var templateRouteHandler = async (request2, response) => {
3983
3976
  response,
3984
3977
  pageHtml,
3985
3978
  webRoot,
3986
- "fullOriginalUrl",
3979
+ fullOriginalUrl,
3987
3980
  environmentConfig,
3988
3981
  viteServer,
3989
3982
  projectName,
@@ -525,14 +525,6 @@ var serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestD
525
525
  if (isUngatedForClientOnlySupplementalFieldSerialization && output.clientOnly) {
526
526
  output.supplementalFieldValues = supplementalFieldValues;
527
527
  }
528
- if (output.supplementalFieldValues) {
529
- output.supplementalFieldValues = Object.keys(
530
- output.supplementalFieldValues
531
- ).sort().reduce((acc, key) => {
532
- acc[key] = output.supplementalFieldValues[key];
533
- return acc;
534
- }, {});
535
- }
536
528
  return output;
537
529
  }
538
530
  );
@@ -1160,13 +1152,37 @@ function renderFieldsToJson(fields, moduleName) {
1160
1152
  throw e2;
1161
1153
  }
1162
1154
  }
1155
+ function DndAreaSlot(props) {
1156
+ return /* @__PURE__ */ jsx(
1157
+ "div",
1158
+ {
1159
+ suppressHydrationWarning: true,
1160
+ dangerouslySetInnerHTML: {
1161
+ __html: `<!-- hs-dnd-area-placeholder-${props.name} -->`
1162
+ }
1163
+ }
1164
+ );
1165
+ }
1166
+ function ModuleSlot(props) {
1167
+ return /* @__PURE__ */ jsx(
1168
+ "div",
1169
+ {
1170
+ suppressHydrationWarning: true,
1171
+ dangerouslySetInnerHTML: {
1172
+ __html: `<!-- hs-module-placeholder-${props.name} -->`
1173
+ }
1174
+ }
1175
+ );
1176
+ }
1163
1177
  export {
1164
1178
  COMPONENT_EXTENSIONS,
1165
1179
  CSS_LANGS_RE,
1180
+ DndAreaSlot,
1166
1181
  ENABLED_FEATURES_GATE_MAP,
1167
1182
  ENTRY_POINTS_PATH,
1168
1183
  GATES,
1169
1184
  MODULE_FOLDER_PATH,
1185
+ ModuleSlot,
1170
1186
  VIRTUAL_CONFIG_SETUP,
1171
1187
  VIRTUAL_ISLAND_RUNTIME,
1172
1188
  areBuildHealthChecksEnabled,
package/dist/run.js CHANGED
@@ -1154,14 +1154,6 @@ var serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestD
1154
1154
  if (isUngatedForClientOnlySupplementalFieldSerialization && output.clientOnly) {
1155
1155
  output.supplementalFieldValues = supplementalFieldValues;
1156
1156
  }
1157
- if (output.supplementalFieldValues) {
1158
- output.supplementalFieldValues = Object.keys(
1159
- output.supplementalFieldValues
1160
- ).sort().reduce((acc, key) => {
1161
- acc[key] = output.supplementalFieldValues[key];
1162
- return acc;
1163
- }, {});
1164
- }
1165
1157
  return output;
1166
1158
  }
1167
1159
  );
@@ -2089,7 +2081,7 @@ function trackUsage(action) {
2089
2081
  eventName: EVENT_NAME,
2090
2082
  action,
2091
2083
  nodeVersion: getNodeVersionData(),
2092
- version: "0.18.18",
2084
+ version: "0.18.20",
2093
2085
  os: getPlatform()
2094
2086
  };
2095
2087
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
@@ -4543,9 +4535,7 @@ var buildModuleIndex = () => buildHTMLResponse(`
4543
4535
 
4544
4536
  // src/routes/hublTemplateRouteHandler.ts
4545
4537
  import { http as hsCliHttp10 } from "@hubspot/local-dev-lib/http";
4546
- import {
4547
- buildStaticEnvConfig as buildStaticEnvConfig5
4548
- } from "@hubspot/cms-components";
4538
+ import { buildStaticEnvConfig as buildStaticEnvConfig5 } from "@hubspot/cms-components";
4549
4539
  import { getEnv as getEnv2 } from "@hubspot/local-dev-lib/config";
4550
4540
  var templateRouteHandler = async (request2, response) => {
4551
4541
  sendTrackingRequest("view-template-route");
@@ -4575,7 +4565,9 @@ var templateRouteHandler = async (request2, response) => {
4575
4565
  try {
4576
4566
  templateInfo = await fetchTemplateByPath(authedPortalId, calculatedPath);
4577
4567
  } catch (err) {
4578
- console.error(`Failed to fetch template data for ${calculatedPath}: ${err}`);
4568
+ console.error(
4569
+ `Failed to fetch template data for ${calculatedPath}: ${err}`
4570
+ );
4579
4571
  }
4580
4572
  if (!templateInfo || !("previewKey" in templateInfo)) {
4581
4573
  response.status(500).set({ "Content-Type": "text/html" }).end(buildErrorIndex2());
@@ -4592,6 +4584,7 @@ var templateRouteHandler = async (request2, response) => {
4592
4584
  ...request2.query
4593
4585
  };
4594
4586
  const previewUrl = new URL(getPreviewUrl(request2, params));
4587
+ const fullOriginalUrl = `${request2.protocol}://${request2.get("host")}${request2.originalUrl}`;
4595
4588
  try {
4596
4589
  const result = (await hsCliHttp10.get(authedPortalId, {
4597
4590
  baseURL: previewUrl.origin,
@@ -4603,7 +4596,7 @@ var templateRouteHandler = async (request2, response) => {
4603
4596
  response,
4604
4597
  pageHtml,
4605
4598
  webRoot2,
4606
- "fullOriginalUrl",
4599
+ fullOriginalUrl,
4607
4600
  environmentConfig,
4608
4601
  viteServer,
4609
4602
  projectName,
@@ -486,10 +486,12 @@ var dist_exports = {};
486
486
  __export(dist_exports, {
487
487
  COMPONENT_EXTENSIONS: () => COMPONENT_EXTENSIONS,
488
488
  CSS_LANGS_RE: () => CSS_LANGS_RE,
489
+ DndAreaSlot: () => DndAreaSlot,
489
490
  ENABLED_FEATURES_GATE_MAP: () => ENABLED_FEATURES_GATE_MAP,
490
491
  ENTRY_POINTS_PATH: () => ENTRY_POINTS_PATH,
491
492
  GATES: () => GATES,
492
493
  MODULE_FOLDER_PATH: () => MODULE_FOLDER_PATH,
494
+ ModuleSlot: () => ModuleSlot,
493
495
  VIRTUAL_CONFIG_SETUP: () => VIRTUAL_CONFIG_SETUP,
494
496
  VIRTUAL_ISLAND_RUNTIME: () => VIRTUAL_ISLAND_RUNTIME,
495
497
  areBuildHealthChecksEnabled: () => areBuildHealthChecksEnabled,
@@ -1068,6 +1070,28 @@ function renderFieldsToJson(fields, moduleName) {
1068
1070
  throw e2;
1069
1071
  }
1070
1072
  }
1073
+ function DndAreaSlot(props) {
1074
+ return /* @__PURE__ */ jsx(
1075
+ "div",
1076
+ {
1077
+ suppressHydrationWarning: true,
1078
+ dangerouslySetInnerHTML: {
1079
+ __html: `<!-- hs-dnd-area-placeholder-${props.name} -->`
1080
+ }
1081
+ }
1082
+ );
1083
+ }
1084
+ function ModuleSlot(props) {
1085
+ return /* @__PURE__ */ jsx(
1086
+ "div",
1087
+ {
1088
+ suppressHydrationWarning: true,
1089
+ dangerouslySetInnerHTML: {
1090
+ __html: `<!-- hs-module-placeholder-${props.name} -->`
1091
+ }
1092
+ }
1093
+ );
1094
+ }
1071
1095
  var setProperty, getProperty, hasProperty, serializeIslandDataForInlineScript, writeSharedStateToJsGlobal, createIslandsGlobalJsForClientInDev, traverse, CMS_MODULE_COMPONENT_NAME, DND_AREA_COMPONENT_NAME, PLUGIN_NAME, promiseForNewWritableStream, renderStreamToPromise, createServerRenderContextV22, createServerRenderContext2, renderServerSidePropsWithAsyncLocalStoreContext, bootStrapRenderContext;
1072
1096
  var init_dist = __esm({
1073
1097
  "../cms-js-internal/dist/index.js"() {
@@ -1119,14 +1143,6 @@ var init_dist = __esm({
1119
1143
  if (isUngatedForClientOnlySupplementalFieldSerialization && output.clientOnly) {
1120
1144
  output.supplementalFieldValues = supplementalFieldValues;
1121
1145
  }
1122
- if (output.supplementalFieldValues) {
1123
- output.supplementalFieldValues = Object.keys(
1124
- output.supplementalFieldValues
1125
- ).sort().reduce((acc, key) => {
1126
- acc[key] = output.supplementalFieldValues[key];
1127
- return acc;
1128
- }, {});
1129
- }
1130
1146
  return output;
1131
1147
  }
1132
1148
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "0.18.18",
3
+ "version": "0.18.20",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "engines": {
@@ -29,7 +29,7 @@
29
29
  "@babel/parser": "^7.25.3",
30
30
  "@babel/traverse": "^7.25.3",
31
31
  "@babel/types": "^7.25.2",
32
- "@hubspot/cms-components": "^0.18.18",
32
+ "@hubspot/cms-components": "^0.18.20",
33
33
  "@hubspot/local-dev-lib": "2.0.1",
34
34
  "@inquirer/select": "^2.0.0",
35
35
  "@originjs/vite-plugin-commonjs": "^1.0.3",
@@ -130,5 +130,5 @@
130
130
  "publishConfig": {
131
131
  "access": "public"
132
132
  },
133
- "gitHead": "49628d53d7bcdfbd68471aac97d8c1b97e7603af"
133
+ "gitHead": "60fcf93ab9a2f42d65948f33662709878d9a2188"
134
134
  }
@@ -0,0 +1,4 @@
1
+ import { ViteDevServer } from 'vite';
2
+ export declare const lookForModuleInFolder: (modulePath: string, viteServer: ViteDevServer) => Promise<[any, string]>;
3
+ declare function renderModuleJson(viteServer: ViteDevServer, requestedModulePath: string): Promise<any>;
4
+ export default renderModuleJson;
@@ -1,2 +0,0 @@
1
- export declare const metaRouteHandler: (req: any, res: any) => void;
2
- export declare const markRemoteFsDirty: () => void;