@hubspot/cms-dev-server 1.2.76 → 1.2.78

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.
@@ -1,7 +1,7 @@
1
1
  // src/storybook/moduleStory.tsx
2
2
  import { useEffect } from "react";
3
3
 
4
- // ../cms-js-internal/dist/types-B-d4FeeE.js
4
+ // ../cms-js-internal/dist/types-Dvw_fW6p.js
5
5
  function namespaceModulePropsShape(props) {
6
6
  const {
7
7
  dataQueryResult,
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
 
11
- // ../cms-js-internal/dist/types-B-d4FeeE.js
11
+ // ../cms-js-internal/dist/types-Dvw_fW6p.js
12
12
  import path from "path";
13
13
  import { createHash } from "crypto";
14
14
  import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
@@ -267,6 +267,13 @@ function isFullHeightPreviewEnabled(config) {
267
267
  }
268
268
  return false;
269
269
  }
270
+ function isLocalUiDisabled(config) {
271
+ var _a;
272
+ if ("devServer" in config) {
273
+ return ((_a = config.devServer) == null ? void 0 : _a.disableLocalUi) ?? false;
274
+ }
275
+ return false;
276
+ }
270
277
  function getBuildInfo(buildDir) {
271
278
  try {
272
279
  const buildInfo = JSON.parse(
@@ -385,8 +392,8 @@ function isStylesheetAsset(staticAsset) {
385
392
  return staticAsset.type === "stylesheet";
386
393
  }
387
394
  var COMPONENT_EXTENSIONS, ENTRY_POINTS_PATH, MODULE_FOLDER_PATH, TEMPLATE_FOLDER_PATH, VIRTUAL_ISLAND_RUNTIME, VIRTUAL_CONFIG_SETUP, CSS_LANGS_RE, collectCssModules, collectCssInDev, badInlineJsChars, inlineJsEscapeChars, viteRoot, viteCommand, clientRenderIsland, virtualClientRenderIslandModuleId, scriptTagToLogServerMessages, getComponentExtension, hasComponentExtension, isStorybookStory, removeComponentExtension, COMBINED_REACT_BASE_PATH, ISLAND_RUNTIME_CONFIG_BASE_PATH, removeIndexFromPath, removeIndexOrTrailingJsFromPath, HEALTHCHECKS_ENABLED_DEFAULT, HEALTHCHECKS_STRICT_DEFAULT, BUILD_INFO_PATH, GATES, ENABLED_FEATURES_GATE_MAP, findAllComponentsIn;
388
- var init_types_B_d4FeeE = __esm({
389
- "../cms-js-internal/dist/types-B-d4FeeE.js"() {
395
+ var init_types_Dvw_fW6p = __esm({
396
+ "../cms-js-internal/dist/types-Dvw_fW6p.js"() {
390
397
  COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
391
398
  ENTRY_POINTS_PATH = "components/partials/";
392
399
  MODULE_FOLDER_PATH = "components/modules/";
@@ -589,6 +596,7 @@ __export(dist_exports, {
589
596
  hasComponentExtension: () => hasComponentExtension,
590
597
  includesHublDataReference: () => includesHublDataReference,
591
598
  isFullHeightPreviewEnabled: () => isFullHeightPreviewEnabled,
599
+ isLocalUiDisabled: () => isLocalUiDisabled,
592
600
  isStorybookStory: () => isStorybookStory,
593
601
  isStylesheetAsset: () => isStylesheetAsset,
594
602
  isUngatedFor: () => isUngatedFor,
@@ -1176,8 +1184,8 @@ function GlobalPartialSlot(props) {
1176
1184
  var setProperty, getProperty, hasProperty, serializeIslandDataForInlineScript, writeSharedStateToJsGlobal, createIslandsGlobalJsForClientInDev, traverse, CMS_MODULE_COMPONENT_NAME, DND_AREA_COMPONENT_NAME, PLUGIN_NAME, promiseForNewWritableStream, renderStreamToPromise, createServerRenderContextV22, createServerRenderContext2, renderServerSidePropsWithAsyncLocalStoreContext, bootStrapRenderContext;
1177
1185
  var init_dist = __esm({
1178
1186
  "../cms-js-internal/dist/index.js"() {
1179
- init_types_B_d4FeeE();
1180
- init_types_B_d4FeeE();
1187
+ init_types_Dvw_fW6p();
1188
+ init_types_Dvw_fW6p();
1181
1189
  ({ setProperty, getProperty, hasProperty } = dotProp);
1182
1190
  serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint) => {
1183
1191
  const islandsArrayToSerialize = tweakedIslandsArray.map(
@@ -7,7 +7,7 @@ import { createServer as createViteServer, normalizePath as normalizePath2 } fro
7
7
  import { createRequire } from "module";
8
8
  import { default as react } from "@vitejs/plugin-react";
9
9
 
10
- // ../cms-js-internal/dist/types-B-d4FeeE.js
10
+ // ../cms-js-internal/dist/types-Dvw_fW6p.js
11
11
  import path from "path";
12
12
  import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
13
13
  import { join } from "path/posix";
@@ -318,6 +318,7 @@ var fieldTypeNameByType = {
318
318
  textalignment: "TextAlignmentFieldType",
319
319
  text: "TextFieldType",
320
320
  url: "UrlFieldType",
321
+ variantselection: "VariantSelectionFieldType",
321
322
  videoplayer: "VideoFieldType",
322
323
  workflow: "WorkflowFieldType"
323
324
  };
@@ -433,7 +434,7 @@ function getFieldTypes(fields) {
433
434
  if (field.children) {
434
435
  const childrenResult = getFieldTypes(field.children);
435
436
  imports.push(...childrenResult.imports);
436
- if (childrenResult.types.length) {
437
+ if (childrenResult.types.length || field.type === "GroupFieldType") {
437
438
  const subType = ts.factory.createTypeLiteralNode(childrenResult.types);
438
439
  const { type: type2, imports: newImports2 } = buildTypeFromField(
439
440
  field,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "1.2.76",
3
+ "version": "1.2.78",
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": "^1.2.76",
32
+ "@hubspot/cms-components": "^1.2.78",
33
33
  "@hubspot/local-dev-lib": "5.10.1",
34
34
  "@inquirer/select": "^2.0.0",
35
35
  "@originjs/vite-plugin-commonjs": "^1.0.3",
@@ -65,6 +65,7 @@
65
65
  "jsdom": "^25.0.1",
66
66
  "lucide-react": "^0.454.0",
67
67
  "node-fetch": "^3.3.0",
68
+ "parse5": "^7.1.2",
68
69
  "react": "18.3.1",
69
70
  "react-dom": "18.3.1",
70
71
  "storybook": "^8.6.15",
@@ -51,7 +51,7 @@ export interface AppLocals {
51
51
  sslEnabled: boolean;
52
52
  fieldBuilderEnabled: boolean;
53
53
  appWebRoot: string;
54
- appViteServer: ViteDevServer;
54
+ appViteServer: ViteDevServer | null;
55
55
  }
56
56
  export declare const templateTypeMap: Record<number, string>;
57
57
  export declare function normalizeHubLModules(modules: HubLModule[], projectName: string): ModuleData[];
@@ -0,0 +1,27 @@
1
+ declare type P5Node = {
2
+ nodeName: string;
3
+ tagName?: string;
4
+ value?: string;
5
+ attrs?: Array<{
6
+ name: string;
7
+ value: string;
8
+ }>;
9
+ childNodes?: P5Node[];
10
+ parentNode?: P5Node | null;
11
+ };
12
+ export declare type ParsedHtml = P5Node;
13
+ export declare function parseHtml(html: string): ParsedHtml;
14
+ /**
15
+ * Serialized outer HTML of the first `<div data-hs-cos-type="module">`.
16
+ * Mirrors the old `querySelector('div[data-hs-cos-type="module"]').outerHTML`.
17
+ */
18
+ export declare function extractModuleOuterHtml(root: ParsedHtml): string;
19
+ /**
20
+ * Concatenated text of `<style>` tags. With `headOnly`, only those under
21
+ * `<head>` (mirrors `querySelectorAll('head style')`); otherwise all of them
22
+ * (mirrors `querySelectorAll('style')`).
23
+ */
24
+ export declare function extractStyleText(root: ParsedHtml, opts?: {
25
+ headOnly?: boolean;
26
+ }): string;
27
+ export {};
@@ -1,3 +1,3 @@
1
1
  export declare function checkFileExists(filePath: string): boolean;
2
2
  export declare function findHSProjectJson(startPath: any): string | null;
3
- export default function validateHSPlatform(projectConfigPath: string, portalId: number): Promise<Boolean>;
3
+ export default function validateHSPlatform(projectConfigPath: string, portalId: number, deferSelection?: (promptAndWrite: () => Promise<boolean>) => void): Promise<Boolean>;
@@ -1 +1 @@
1
- export default function startShadowDevServer(devServerPort: number, shadowPort: number, themePath: string): Promise<void>;
1
+ export default function startShadowDevServer(devServerPort: number, shadowPort: number, themePath: string, host: string): Promise<void>;