@hubspot/cms-dev-server 1.2.77 → 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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "1.2.77",
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.77",
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",
@@ -0,0 +1,8 @@
1
+ export declare function debugAuthContext(
2
+ authedPortalId: number,
3
+ cookieValue: string
4
+ ): Promise<void>;
5
+ export declare function compareUrls(
6
+ originalUrl: string,
7
+ signedUrl: string
8
+ ): void;
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ export declare function getLocalComponentsPath(): string;
2
+ export declare function shouldUseLocalComponents(): boolean;
@@ -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>;
@@ -0,0 +1,18 @@
1
+ import { ViteDevServer } from 'vite';
2
+ /**
3
+ * Processes HTML to find remote assets and replace with Vite-managed URLs
4
+ */
5
+ export declare function processRemoteAssets(
6
+ html: string,
7
+ viteServer: ViteDevServer
8
+ ): Promise<string>;
9
+ /**
10
+ * Vite plugin to handle remote assets
11
+ */
12
+ export declare function remoteAssetsPlugin(): {
13
+ name: string;
14
+ apply: 'serve';
15
+ configResolved(config: any): void;
16
+ resolveId(id: string): string;
17
+ load(id: string): Promise<string>;
18
+ };
@@ -0,0 +1,2 @@
1
+ import type { Plugin } from 'vite';
2
+ export declare function hubspotStaticAssetsPlugin(): Plugin;
@@ -0,0 +1,10 @@
1
+ import { ViteDevServer, Plugin } from 'vite';
2
+ /**
3
+ * Create a self-contained plugin with proper caching
4
+ */
5
+ export declare function remoteAssetsPlugin(): Plugin & {
6
+ processRemoteAssets: (
7
+ html: string,
8
+ viteServer: ViteDevServer
9
+ ) => Promise<string>;
10
+ };
@@ -0,0 +1,6 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Plugin that provides URL signing capabilities
4
+ * Uses internal signing mechanisms when available, with fallback for public environments
5
+ */
6
+ export default function requestSigningPlugin(): Plugin;
@@ -0,0 +1,13 @@
1
+ import { Request, Response, NextFunction } from 'express';
2
+ export declare function handleGetModulePages(
3
+ req: Request,
4
+ res: Response,
5
+ next: NextFunction
6
+ ): Promise<Response<any, Record<string, any>>>;
7
+ export declare function handleOpenFile(
8
+ req: Request,
9
+ res: Response,
10
+ next: NextFunction
11
+ ): Response<any, Record<string, any>>;
12
+ export declare function createAppServerRoutes(): import('express-serve-static-core').Router;
13
+ export default createAppServerRoutes;
@@ -0,0 +1,7 @@
1
+ import { Request, Response } from 'express';
2
+ declare const homeRouteHandler: (
3
+ request: Request,
4
+ response: Response,
5
+ next: Function
6
+ ) => Promise<void>;
7
+ export default homeRouteHandler;
@@ -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>;