@hubspot/cms-dev-server 1.0.38 → 1.0.44

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-BxnmA6nH.js
4
+ // ../cms-js-internal/dist/types-Bqf9htWu.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-BxnmA6nH.js
11
+ // ../cms-js-internal/dist/types-Bqf9htWu.js
12
12
  import path from "path";
13
13
  import { createHash } from "crypto";
14
14
  import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
@@ -378,8 +378,8 @@ function isStylesheetAsset(staticAsset) {
378
378
  return staticAsset.type === "stylesheet";
379
379
  }
380
380
  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;
381
- var init_types_BxnmA6nH = __esm({
382
- "../cms-js-internal/dist/types-BxnmA6nH.js"() {
381
+ var init_types_Bqf9htWu = __esm({
382
+ "../cms-js-internal/dist/types-Bqf9htWu.js"() {
383
383
  COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
384
384
  ENTRY_POINTS_PATH = "components/partials/";
385
385
  MODULE_FOLDER_PATH = "components/modules/";
@@ -501,16 +501,12 @@ ${groupEnd}</script>
501
501
  "CMS:JSRenderer:RemoveCjsPlugin",
502
502
  "CMS:JSRenderer:RemoveMockClientEntryPlugin",
503
503
  "CMS:JSRenderer:AnalyzeCmsModules",
504
- "CMS:JSRenderer:ClientOnlySupplementalFieldSerialization",
505
- "CMS:React:UnifiedThemePreview",
506
504
  "CMS:JSRenderer:CompressResponse"
507
505
  ];
508
506
  ENABLED_FEATURES_GATE_MAP = {
509
507
  "cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
510
508
  "cms:jsr:RemoveCjsPlugin": "CMS:JSRenderer:RemoveCjsPlugin",
511
- "cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules",
512
- "cms:jsr:clientOnlySupplementalFieldSerialization": "CMS:JSRenderer:ClientOnlySupplementalFieldSerialization",
513
- "cms:react:unifiedThemePreview": "CMS:React:UnifiedThemePreview"
509
+ "cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules"
514
510
  };
515
511
  findAllComponentsIn = (webRoot2, componentsFolder) => {
516
512
  const fullComponentsFolderPath = join(webRoot2, componentsFolder);
@@ -548,181 +544,6 @@ ${groupEnd}</script>
548
544
  }
549
545
  });
550
546
 
551
- // ../cms-js-internal/dist/decodeHtmlEntities-Byb4Xs5S.js
552
- function decodeHtmlEntities(text) {
553
- if (typeof text !== "string") {
554
- return text;
555
- }
556
- return text.replace(/&#(\d+);/g, (_, dec) => {
557
- const num = parseInt(dec, 10);
558
- if (num >= 0 && num <= 1114111) {
559
- return String.fromCharCode(num);
560
- }
561
- return _;
562
- }).replace(/&#x([0-9a-fA-F]+);/g, (_, hex) => {
563
- const num = parseInt(hex, 16);
564
- if (num >= 0 && num <= 1114111) {
565
- return String.fromCharCode(num);
566
- }
567
- return _;
568
- }).replace(
569
- /&[a-zA-Z][a-zA-Z0-9]*;/g,
570
- (entity) => namedEntities[entity] || entity
571
- );
572
- }
573
- function decodeHtmlEntitiesInObject(obj) {
574
- if (obj === null || obj === void 0) {
575
- return obj;
576
- }
577
- if (typeof obj === "string") {
578
- return decodeHtmlEntities(obj);
579
- }
580
- if (Array.isArray(obj)) {
581
- return obj.map(decodeHtmlEntitiesInObject);
582
- }
583
- if (typeof obj === "object") {
584
- const decoded = {};
585
- for (const [key, value] of Object.entries(obj)) {
586
- decoded[key] = decodeHtmlEntitiesInObject(value);
587
- }
588
- return decoded;
589
- }
590
- return obj;
591
- }
592
- var namedEntities;
593
- var init_decodeHtmlEntities_Byb4Xs5S = __esm({
594
- "../cms-js-internal/dist/decodeHtmlEntities-Byb4Xs5S.js"() {
595
- namedEntities = {
596
- "&amp;": "&",
597
- "&lt;": "<",
598
- "&gt;": ">",
599
- "&quot;": '"',
600
- "&#39;": "'",
601
- "&apos;": "'",
602
- "&nbsp;": "\xA0",
603
- // non-breaking space
604
- "&copy;": "\xA9",
605
- "&reg;": "\xAE",
606
- "&trade;": "\u2122",
607
- "&hellip;": "\u2026",
608
- "&mdash;": "\u2014",
609
- "&ndash;": "\u2013",
610
- "&lsquo;": "\u2018",
611
- "&rsquo;": "\u2019",
612
- "&ldquo;": "\u201C",
613
- "&rdquo;": "\u201D",
614
- "&bull;": "\u2022",
615
- "&middot;": "\xB7",
616
- "&euro;": "\u20AC",
617
- "&pound;": "\xA3",
618
- "&yen;": "\xA5",
619
- "&cent;": "\xA2",
620
- // Common accented characters
621
- "&aacute;": "\xE1",
622
- // á
623
- "&agrave;": "\xE0",
624
- // à
625
- "&acirc;": "\xE2",
626
- // â
627
- "&auml;": "\xE4",
628
- // ä
629
- "&atilde;": "\xE3",
630
- // ã
631
- "&aring;": "\xE5",
632
- // å
633
- "&eacute;": "\xE9",
634
- // é
635
- "&egrave;": "\xE8",
636
- // è
637
- "&ecirc;": "\xEA",
638
- // ê
639
- "&euml;": "\xEB",
640
- // ë
641
- "&iacute;": "\xED",
642
- // í
643
- "&igrave;": "\xEC",
644
- // ì
645
- "&icirc;": "\xEE",
646
- // î
647
- "&iuml;": "\xEF",
648
- // ï
649
- "&oacute;": "\xF3",
650
- // ó
651
- "&ograve;": "\xF2",
652
- // ò
653
- "&ocirc;": "\xF4",
654
- // ô
655
- "&ouml;": "\xF6",
656
- // ö
657
- "&otilde;": "\xF5",
658
- // õ
659
- "&uacute;": "\xFA",
660
- // ú
661
- "&ugrave;": "\xF9",
662
- // ù
663
- "&ucirc;": "\xFB",
664
- // û
665
- "&uuml;": "\xFC",
666
- // ü
667
- "&ntilde;": "\xF1",
668
- // ñ
669
- "&ccedil;": "\xE7",
670
- // ç
671
- // Uppercase versions
672
- "&Aacute;": "\xC1",
673
- // Á
674
- "&Agrave;": "\xC0",
675
- // À
676
- "&Acirc;": "\xC2",
677
- // Â
678
- "&Auml;": "\xC4",
679
- // Ä
680
- "&Atilde;": "\xC3",
681
- // Ã
682
- "&Aring;": "\xC5",
683
- // Å
684
- "&Eacute;": "\xC9",
685
- // É
686
- "&Egrave;": "\xC8",
687
- // È
688
- "&Ecirc;": "\xCA",
689
- // Ê
690
- "&Euml;": "\xCB",
691
- // Ë
692
- "&Iacute;": "\xCD",
693
- // Í
694
- "&Igrave;": "\xCC",
695
- // Ì
696
- "&Icirc;": "\xCE",
697
- // Î
698
- "&Iuml;": "\xCF",
699
- // Ï
700
- "&Oacute;": "\xD3",
701
- // Ó
702
- "&Ograve;": "\xD2",
703
- // Ò
704
- "&Ocirc;": "\xD4",
705
- // Ô
706
- "&Ouml;": "\xD6",
707
- // Ö
708
- "&Otilde;": "\xD5",
709
- // Õ
710
- "&Uacute;": "\xDA",
711
- // Ú
712
- "&Ugrave;": "\xD9",
713
- // Ù
714
- "&Ucirc;": "\xDB",
715
- // Û
716
- "&Uuml;": "\xDC",
717
- // Ü
718
- "&Ntilde;": "\xD1",
719
- // Ñ
720
- "&Ccedil;": "\xC7"
721
- // Ç
722
- };
723
- }
724
- });
725
-
726
547
  // ../cms-js-internal/dist/index.js
727
548
  var dist_exports = {};
728
549
  __export(dist_exports, {
@@ -743,8 +564,6 @@ __export(dist_exports, {
743
564
  collectCssInDev: () => collectCssInDev,
744
565
  collectCssModules: () => collectCssModules,
745
566
  createIslandsGlobalJsForClientInDev: () => createIslandsGlobalJsForClientInDev,
746
- decodeHtmlEntities: () => decodeHtmlEntities,
747
- decodeHtmlEntitiesInObject: () => decodeHtmlEntitiesInObject,
748
567
  doHealthChecksFailTheBuild: () => doHealthChecksFailTheBuild,
749
568
  escapeForInlineJS: () => escapeForInlineJS,
750
569
  findAllComponentsIn: () => findAllComponentsIn,
@@ -1352,11 +1171,10 @@ function GlobalPartialSlot(props) {
1352
1171
  var setProperty, getProperty, hasProperty, serializeIslandDataForInlineScript, writeSharedStateToJsGlobal, createIslandsGlobalJsForClientInDev, traverse, CMS_MODULE_COMPONENT_NAME, DND_AREA_COMPONENT_NAME, PLUGIN_NAME, promiseForNewWritableStream, renderStreamToPromise, createServerRenderContextV22, createServerRenderContext2, renderServerSidePropsWithAsyncLocalStoreContext, bootStrapRenderContext;
1353
1172
  var init_dist = __esm({
1354
1173
  "../cms-js-internal/dist/index.js"() {
1355
- init_types_BxnmA6nH();
1356
- init_types_BxnmA6nH();
1357
- init_decodeHtmlEntities_Byb4Xs5S();
1174
+ init_types_Bqf9htWu();
1175
+ init_types_Bqf9htWu();
1358
1176
  ({ setProperty, getProperty, hasProperty } = dotProp);
1359
- serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint, isUngatedForClientOnlySupplementalFieldSerialization = false) => {
1177
+ serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint) => {
1360
1178
  const islandsArrayToSerialize = tweakedIslandsArray.map(
1361
1179
  ({
1362
1180
  id,
@@ -1402,7 +1220,7 @@ var init_dist = __esm({
1402
1220
  if (filteredSupplementalFieldValues) {
1403
1221
  output.supplementalFieldValues = filteredSupplementalFieldValues;
1404
1222
  }
1405
- if (isUngatedForClientOnlySupplementalFieldSerialization && output.clientOnly) {
1223
+ if (output.clientOnly) {
1406
1224
  output.supplementalFieldValues = supplementalFieldValues;
1407
1225
  }
1408
1226
  return output;
@@ -1438,7 +1256,7 @@ ${indentString}`);
1438
1256
  }
1439
1257
  return "";
1440
1258
  };
1441
- createIslandsGlobalJsForClientInDev = (roots, perServerRequestData, viteDevServer, indent, prettyPrint, isUngatedForClientOnlySupplementalFieldSerialization = false) => {
1259
+ createIslandsGlobalJsForClientInDev = (roots, perServerRequestData, viteDevServer, indent, prettyPrint) => {
1442
1260
  const islands = getIslandUrls(roots, viteDevServer);
1443
1261
  const perServerRequestDataWithUrls = getPerServerRequestUrls(
1444
1262
  perServerRequestData,
@@ -1450,8 +1268,7 @@ ${indentString}`);
1450
1268
  islands,
1451
1269
  perServerRequestData,
1452
1270
  indent,
1453
- prettyPrint,
1454
- isUngatedForClientOnlySupplementalFieldSerialization
1271
+ prettyPrint
1455
1272
  )}${writeSharedStateToJsGlobal(
1456
1273
  islands,
1457
1274
  perServerRequestDataWithUrls,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "1.0.38",
3
+ "version": "1.0.44",
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.0.38",
32
+ "@hubspot/cms-components": "^1.0.44",
33
33
  "@hubspot/local-dev-lib": "3.7.1",
34
34
  "@inquirer/select": "^2.0.0",
35
35
  "@originjs/vite-plugin-commonjs": "^1.0.3",
@@ -67,7 +67,6 @@
67
67
  "node-fetch": "^3.3.0",
68
68
  "react": "18.3.1",
69
69
  "react-dom": "18.3.1",
70
- "request": "^2.88.2",
71
70
  "storybook": "^8.6.14",
72
71
  "styled-jsx": "5.1.2",
73
72
  "tailwind-merge": "^2.5.4",
@@ -134,5 +133,5 @@
134
133
  "publishConfig": {
135
134
  "access": "public"
136
135
  },
137
- "gitHead": "4778c01e902ff7f6ca6b829796b5c23e763f75a3"
136
+ "gitHead": "e309fd4880eb7f184eebcb61b8030594309e26c9"
138
137
  }
@@ -36,8 +36,8 @@ export interface ModulePageDependencyData {
36
36
  portalId: number;
37
37
  subType: string;
38
38
  }
39
- export declare function fetchHubLModules(accountId: any, previewToken: any): Promise<PaginatedApiResponse<HubLModule>>;
40
- export declare function fetchPreviewTemplates(accountId: any, previewToken: any): Promise<PaginatedApiResponse<HubLTemplate>>;
39
+ export declare function fetchHubLModules(accountId: any, previewToken: any, limit?: number): Promise<PaginatedApiResponse<HubLModule>>;
40
+ export declare function fetchPreviewTemplates(accountId: any, previewToken: any, limit?: number): Promise<PaginatedApiResponse<HubLTemplate>>;
41
41
  export declare function fetchModuleByPath(accountId: number, path: string): Promise<any>;
42
42
  export declare function fetchTemplateByPath(accountId: number, path: string): Promise<HubLTemplateData>;
43
43
  export declare function fetchModulePageDependencies(accountId: number, path: string): Promise<ModulePageDependencyData[]>;
@@ -0,0 +1,5 @@
1
+ export declare const API_ERRORS: {
2
+ readonly MISSING_PARAMS: "MISSING_PARAMS";
3
+ readonly FETCH_FAILED: "FETCH_FAILED";
4
+ };
5
+ export declare type ApiError = (typeof API_ERRORS)[keyof typeof API_ERRORS];
@@ -0,0 +1,2 @@
1
+ import { InlineConfig } from 'vite';
2
+ export declare function createAppViteConfig(webRoot: string, port: number): InlineConfig;
@@ -0,0 +1,22 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ export declare function getDevServerCommandLineOptions(argv: NodeJS.Process['argv']): {
3
+ hubspotCliConfigPathOption: string;
4
+ hubspotCliAccountNameOption: string;
5
+ sslEnabledOption: boolean;
6
+ storybook: boolean;
7
+ fieldGenEnabledOption: boolean;
8
+ webRoot: string;
9
+ resetSession: boolean;
10
+ };
11
+ export declare function buildThemePreviewOptions(webRoot: string): Promise<{
12
+ filePaths: string[];
13
+ startProgressBar: (numFiles: any) => {
14
+ onAttemptCallback: () => void;
15
+ onSuccessCallback: () => void;
16
+ onFirstErrorCallback: () => void;
17
+ onRetryCallback: () => void;
18
+ onFinalErrorCallback: () => any;
19
+ onFinishCallback: (results: any) => void;
20
+ };
21
+ dest: any;
22
+ }>;
@@ -0,0 +1,14 @@
1
+ export declare function determineSrcAndDest(): Promise<{
2
+ absoluteSrc: any;
3
+ dest: any;
4
+ }>;
5
+ export declare function getUploadableFileList(src: any, convertFields: any): Promise<any[]>;
6
+ export declare function fieldsJsPrompt(filePath: any, projectDir: any, skipFiles?: any[]): Promise<any[]>;
7
+ export declare function logError(error: any, context?: {}): void;
8
+ export declare class ApiErrorContext {
9
+ accountId: any;
10
+ request: any;
11
+ payload: any;
12
+ projectName: any;
13
+ constructor(props?: any);
14
+ }
@@ -0,0 +1 @@
1
+ export declare const templateTypeMap: Record<number, string>;
@@ -0,0 +1,2 @@
1
+ declare const router: import("express-serve-static-core").Router;
2
+ export default router;
@@ -0,0 +1,5 @@
1
+ import { Request, Response, NextFunction } from 'express';
2
+ export declare function handleGetModulePages(req: Request, res: Response, next: NextFunction): Promise<Response<any, Record<string, any>>>;
3
+ export declare function handleOpenFile(req: Request, res: Response, next: NextFunction): Response<any, Record<string, any>>;
4
+ export declare function appServerApiRouteHandler(): import("express-serve-static-core").Router;
5
+ export default appServerApiRouteHandler;
@@ -0,0 +1,5 @@
1
+ import { Request, Response, NextFunction } from 'express';
2
+ export declare function handleGetModulePages(req: Request, res: Response, next: NextFunction): Promise<Response<any, Record<string, any>>>;
3
+ export declare function handleOpenFile(req: Request, res: Response, next: NextFunction): Promise<Response<any, Record<string, any>>>;
4
+ export declare function appServerRoutes(): import("express-serve-static-core").Router;
5
+ export default appServerRoutes;
@@ -0,0 +1,9 @@
1
+ declare namespace _default {
2
+ namespace parameters {
3
+ namespace actions {
4
+ const argTypesRegex: string;
5
+ }
6
+ }
7
+ const decorators: ((Story: any) => JSX.Element)[];
8
+ }
9
+ export default _default;
@@ -1,2 +0,0 @@
1
- export declare function debugAuthContext(authedPortalId: number, cookieValue: string): Promise<void>;
2
- export declare function compareUrls(originalUrl: string, signedUrl: string): void;
@@ -1,2 +0,0 @@
1
- export declare function getLocalComponentsPath(): string;
2
- export declare function shouldUseLocalComponents(): boolean;
@@ -1,15 +0,0 @@
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(html: string, viteServer: ViteDevServer): Promise<string>;
6
- /**
7
- * Vite plugin to handle remote assets
8
- */
9
- export declare function remoteAssetsPlugin(): {
10
- name: string;
11
- apply: "serve";
12
- configResolved(config: any): void;
13
- resolveId(id: string): string;
14
- load(id: string): Promise<string>;
15
- };
@@ -1,2 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export declare function hubspotStaticAssetsPlugin(): Plugin;
@@ -1,7 +0,0 @@
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: (html: string, viteServer: ViteDevServer) => Promise<string>;
7
- };
@@ -1,6 +0,0 @@
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;