@hubspot/cms-dev-server 0.18.22 → 0.18.24

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.
Files changed (39) hide show
  1. package/dist/app/assets/index-BAtasOic.css +1 -0
  2. package/dist/app/assets/index-BC6R47Vo.js +154 -0
  3. package/dist/{index.html → app/index.html} +2 -1
  4. package/dist/app/server/assets/RenderTreeSeparately-T6CL43QJ-D50VfKo0.js +111 -0
  5. package/dist/app/server/serverEntry.js +3393 -0
  6. package/dist/index.js +83 -62
  7. package/dist/run.js +83 -64
  8. package/package.json +4 -5
  9. package/dist/.DS_Store +0 -0
  10. package/dist/App.js +0 -168
  11. package/dist/App.js.map +0 -7
  12. package/dist/_.._/.DS_Store +0 -0
  13. package/dist/_.._/app/serverEntry.js +0 -8
  14. package/dist/_.._/app/serverEntry.js.map +0 -7
  15. package/dist/clientEntry.css +0 -2
  16. package/dist/clientEntry.css.map +0 -7
  17. package/dist/clientEntry.js +0 -168
  18. package/dist/clientEntry.js.map +0 -7
  19. package/dist/components.json +0 -20
  20. package/dist/fonts/LexendDeca-Bold.woff2 +0 -0
  21. package/dist/fonts/LexendDeca-Light.woff2 +0 -0
  22. package/dist/fonts/LexendDeca-Medium.woff2 +0 -0
  23. package/dist/fonts/LexendDeca-SemiBold.woff2 +0 -0
  24. package/dist/generateJsonFromJsx.js.map +0 -7
  25. package/dist/index.css +0 -2
  26. package/dist/index.css.map +0 -7
  27. package/dist/index.js.map +0 -7
  28. package/dist/internalSsr.js.map +0 -7
  29. package/dist/island-runtime.js.map +0 -7
  30. package/dist/postcss.config.js +0 -6
  31. package/dist/run.js.map +0 -7
  32. package/dist/storybook/index.js.map +0 -7
  33. package/dist/storybook-main/main.js.map +0 -7
  34. package/dist/storybook-main/preview.js.map +0 -7
  35. package/dist/tailwind.config.js +0 -67
  36. /package/dist/{fonts/LexendDeca-Bold-PSGSBIWW.woff2 → app/assets/LexendDeca-Bold-B8uERmr8.woff2} +0 -0
  37. /package/dist/{fonts/LexendDeca-Light-IDG5XLZG.woff2 → app/assets/LexendDeca-Light-BtcvwT5C.woff2} +0 -0
  38. /package/dist/{fonts/LexendDeca-Medium-ZCTJP7FU.woff2 → app/assets/LexendDeca-Medium-CxVPR2j6.woff2} +0 -0
  39. /package/dist/{fonts/LexendDeca-SemiBold-LCAJGQDV.woff2 → app/assets/LexendDeca-SemiBold-BhzS3XUP.woff2} +0 -0
package/dist/run.js CHANGED
@@ -2,14 +2,12 @@
2
2
 
3
3
  // src/lib/instrument.ts
4
4
  import * as Sentry from "@sentry/node";
5
- import { nodeProfilingIntegration } from "@sentry/profiling-node";
6
5
  var isDev = process.env.NODE_ENV === "development";
7
6
  var DSN_KEY = "f50d34a51498b37c8da9e9cba13be20a";
8
7
  var domain = isDev ? "exceptions-na1.hubspotqa.com" : "exceptions-na1.hubspot.com";
9
8
  var SENTRY_DSN = `https://${DSN_KEY}@${domain}/v2/1`;
10
9
  Sentry.init({
11
10
  dsn: SENTRY_DSN,
12
- integrations: [nodeProfilingIntegration()],
13
11
  tracesSampleRate: 1
14
12
  // profilesSampleRate: 1.0,
15
13
  });
@@ -760,7 +758,7 @@ async function buildThemePreviewOptions(webRoot2, isUsingLocalWorkspace = false)
760
758
  }
761
759
 
762
760
  // src/createDevServer.ts
763
- import path15 from "path";
761
+ import path16 from "path";
764
762
  import url2 from "url";
765
763
  import express2 from "express";
766
764
  import http3 from "http";
@@ -770,7 +768,11 @@ import { normalizePath as normalizePath9 } from "vite";
770
768
  import { Transform } from "stream";
771
769
 
772
770
  // src/routes/createDevServerRoutes.ts
773
- import { Router as Router2, urlencoded } from "express";
771
+ import {
772
+ Router as Router2,
773
+ urlencoded,
774
+ static as expressStatic
775
+ } from "express";
774
776
  import { createProxyMiddleware } from "http-proxy-middleware";
775
777
 
776
778
  // src/routes/partial.ts
@@ -1403,8 +1405,8 @@ function convertEntryPointIslandPathsToRelative(config, entryPointsCmsModuleMap)
1403
1405
  );
1404
1406
  return Object.fromEntries(relativeEntries);
1405
1407
  }
1406
- function toRelativePath(config, path16) {
1407
- return path16.replace(`${config.root}/`, "");
1408
+ function toRelativePath(config, path17) {
1409
+ return path17.replace(`${config.root}/`, "");
1408
1410
  }
1409
1411
  function shouldAnalyzeModule(config, moduleInfo, code) {
1410
1412
  const [fileId, __] = moduleInfo.id.split("?");
@@ -1447,11 +1449,11 @@ function analyzeSourceCodeUsages(ctx, moduleInfo, config, code) {
1447
1449
  let moduleComponentLocalImportName = CMS_MODULE_COMPONENT_NAME;
1448
1450
  let dndAreaComponentLocalImportName = DND_AREA_COMPONENT_NAME;
1449
1451
  traverse(sourceAst, {
1450
- ImportDeclaration(path16) {
1451
- if (t.isStringLiteral(path16.node.source, {
1452
+ ImportDeclaration(path17) {
1453
+ if (t.isStringLiteral(path17.node.source, {
1452
1454
  value: "@hubspot/cms-components"
1453
1455
  })) {
1454
- for (const specifier of path16.node.specifiers) {
1456
+ for (const specifier of path17.node.specifiers) {
1455
1457
  if (t.isImportSpecifier(specifier) && t.isIdentifier(specifier.imported, {
1456
1458
  name: CMS_MODULE_COMPONENT_NAME
1457
1459
  })) {
@@ -1465,14 +1467,14 @@ function analyzeSourceCodeUsages(ctx, moduleInfo, config, code) {
1465
1467
  }
1466
1468
  }
1467
1469
  },
1468
- JSXOpeningElement(path16) {
1469
- if (t.isJSXIdentifier(path16.node.name, {
1470
+ JSXOpeningElement(path17) {
1471
+ if (t.isJSXIdentifier(path17.node.name, {
1470
1472
  name: moduleComponentLocalImportName
1471
1473
  })) {
1472
1474
  let cmsModuleName;
1473
1475
  let cmsModulePath;
1474
1476
  let cmsModuleLabel;
1475
- for (const prop of path16.node.attributes) {
1477
+ for (const prop of path17.node.attributes) {
1476
1478
  if (t.isJSXAttribute(prop) && t.isJSXIdentifier(prop.name, { name: "name" }) && t.isStringLiteral(prop.value)) {
1477
1479
  cmsModuleName = prop.value.value;
1478
1480
  continue;
@@ -1507,11 +1509,11 @@ function analyzeSourceCodeUsages(ctx, moduleInfo, config, code) {
1507
1509
  }
1508
1510
  contentDescriptors.modules[cmsModuleProps.name] = cmsModuleProps;
1509
1511
  }
1510
- if (t.isJSXIdentifier(path16.node.name, {
1512
+ if (t.isJSXIdentifier(path17.node.name, {
1511
1513
  name: dndAreaComponentLocalImportName
1512
1514
  })) {
1513
1515
  let dndAreaName;
1514
- for (const prop of path16.node.attributes) {
1516
+ for (const prop of path17.node.attributes) {
1515
1517
  if (t.isJSXAttribute(prop) && t.isJSXIdentifier(prop.name, { name: "name" }) && t.isStringLiteral(prop.value)) {
1516
1518
  dndAreaName = prop.value.value;
1517
1519
  continue;
@@ -2095,7 +2097,7 @@ function trackUsage(action) {
2095
2097
  eventName: EVENT_NAME,
2096
2098
  action,
2097
2099
  nodeVersion: getNodeVersionData(),
2098
- version: "0.18.22",
2100
+ version: "0.18.24",
2099
2101
  os: getPlatform()
2100
2102
  };
2101
2103
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
@@ -2168,12 +2170,12 @@ var findLocalRenderPlaceholders = (body) => {
2168
2170
  );
2169
2171
  offsetSoFar = nearestNewlineOrQuoteAfterBlockOpen;
2170
2172
  if (pathEndOffset >= 0 && pathEndOffset < nextNewlineOffset) {
2171
- const path16 = body.substring(
2173
+ const path17 = body.substring(
2172
2174
  startOffset + localJsRenderStartString.length,
2173
2175
  pathEndOffset
2174
2176
  );
2175
2177
  offsetSoFar = pathEndOffset + 1;
2176
- if (startOffset >= 0 && path16) {
2178
+ if (startOffset >= 0 && path17) {
2177
2179
  const nextCommentEndOffset = body.indexOf("-->", pathEndOffset);
2178
2180
  const endOffset = body.indexOf(localJsRenderEndString, pathEndOffset);
2179
2181
  offsetSoFar = Math.min(nextCommentEndOffset, endOffset);
@@ -2198,7 +2200,7 @@ var findLocalRenderPlaceholders = (body) => {
2198
2200
  result.push({
2199
2201
  startOffset,
2200
2202
  endOffset: endOffset + localJsRenderEndString.length,
2201
- path: path16,
2203
+ path: path17,
2202
2204
  json
2203
2205
  });
2204
2206
  }
@@ -2577,9 +2579,9 @@ var customColors = [
2577
2579
  ];
2578
2580
  var Converter = new AnsiToHtmlConverter({ colors: customColors });
2579
2581
  var darkErrorStyles = `background-color: #222; color: #ccc; padding: 0.5em; font-family: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;`;
2580
- var renderLocalError_default = (path16, error) => {
2582
+ var renderLocalError_default = (path17, error) => {
2581
2583
  const stackWithColorClasses = Converter.toHtml(error.stack);
2582
- return `<div data-js-rendered="error" style="${darkErrorStyles}">Error rendering ${path16}<br/><br/><code><pre>${stackWithColorClasses}</pre></code></div>`;
2584
+ return `<div data-js-rendered="error" style="${darkErrorStyles}">Error rendering ${path17}<br/><br/><code><pre>${stackWithColorClasses}</pre></code></div>`;
2583
2585
  };
2584
2586
 
2585
2587
  // src/proxyPage/fetchPreviewInfo.ts
@@ -4139,18 +4141,18 @@ async function fetchPreviewTemplates(accountId, previewToken) {
4139
4141
  url: `${DESIGN_MANAGER_API_PATH}/templates/local-preview?previewToken=${previewToken}`
4140
4142
  })).data;
4141
4143
  }
4142
- async function fetchModuleByPath(accountId, path16) {
4144
+ async function fetchModuleByPath(accountId, path17) {
4143
4145
  return (await hsCliHttp8.get(accountId, {
4144
- url: `${DESIGN_MANAGER_API_PATH}/modules/by-path/${path16}?portalId=${accountId}`
4146
+ url: `${DESIGN_MANAGER_API_PATH}/modules/by-path/${path17}?portalId=${accountId}`
4145
4147
  })).data;
4146
4148
  }
4147
- async function fetchTemplateByPath(accountId, path16) {
4149
+ async function fetchTemplateByPath(accountId, path17) {
4148
4150
  return (await hsCliHttp8.get(accountId, {
4149
- url: `${DESIGN_MANAGER_API_PATH}/templates/by-path/${path16}?portalId=${accountId}`
4151
+ url: `${DESIGN_MANAGER_API_PATH}/templates/by-path/${path17}?portalId=${accountId}`
4150
4152
  })).data;
4151
4153
  }
4152
- async function fetchModulePageDependencies(accountId, path16) {
4153
- const url3 = `${DESIGN_MANAGER_API_PATH}/modules/list-pages?modulePath=${path16}`;
4154
+ async function fetchModulePageDependencies(accountId, path17) {
4155
+ const url3 = `${DESIGN_MANAGER_API_PATH}/modules/list-pages?modulePath=${path17}`;
4154
4156
  return (await hsCliHttp8.get(accountId, { url: url3 })).data;
4155
4157
  }
4156
4158
 
@@ -4595,6 +4597,7 @@ var templateRouteHandler = async (request2, response) => {
4595
4597
  hsLocalProxyProject: localProxyProject,
4596
4598
  localProxySchemaVersion: "2",
4597
4599
  hsLoginVerifyDisabled: `${true}`,
4600
+ hsCacheBuster: Date.now().toString(),
4598
4601
  ...request2.query
4599
4602
  };
4600
4603
  const previewUrl = new URL(getPreviewUrl(request2, params));
@@ -4703,11 +4706,10 @@ async function getDevServerUIData(reqLocals, viteServer) {
4703
4706
  let hubLModuleData = { objects: [] };
4704
4707
  let hubLTemplateData = { objects: [] };
4705
4708
  if (authedPortalId) {
4706
- hubLModuleData = await fetchHubLModules(authedPortalId, localPreviewToken);
4707
- hubLTemplateData = await fetchPreviewTemplates(
4708
- authedPortalId,
4709
- localPreviewToken
4710
- );
4709
+ [hubLModuleData, hubLTemplateData] = await Promise.all([
4710
+ fetchHubLModules(authedPortalId, localPreviewToken),
4711
+ fetchPreviewTemplates(authedPortalId, localPreviewToken)
4712
+ ]);
4711
4713
  }
4712
4714
  const hubLTemplates = (hubLTemplateData == null ? void 0 : hubLTemplateData.objects.filter(
4713
4715
  (template) => isCodedFile(template.filename)
@@ -4741,14 +4743,14 @@ function getOpenCommand() {
4741
4743
  }
4742
4744
  }
4743
4745
  async function handleGetModulePages(req, res, next) {
4744
- const { path: path16, portalId } = req.query;
4745
- if (!path16 || !portalId) {
4746
+ const { path: path17, portalId } = req.query;
4747
+ if (!path17 || !portalId) {
4746
4748
  return res.status(400).json({ error: "Missing required parameters" });
4747
4749
  }
4748
4750
  try {
4749
4751
  const data = await fetchModulePageDependencies(
4750
4752
  Number(portalId),
4751
- path16
4753
+ path17
4752
4754
  );
4753
4755
  res.json(data);
4754
4756
  } catch (err) {
@@ -4756,13 +4758,13 @@ async function handleGetModulePages(req, res, next) {
4756
4758
  }
4757
4759
  }
4758
4760
  function handleOpenFile(req, res, next) {
4759
- const { path: path16 } = req.query;
4760
- if (!path16) {
4761
+ const { path: path17 } = req.query;
4762
+ if (!path17) {
4761
4763
  return res.status(400).json({ error: "Missing required parameters" });
4762
4764
  }
4763
4765
  try {
4764
4766
  const command = getOpenCommand();
4765
- spawn(command, [path16], { detached: true }).unref();
4767
+ spawn(command, [path17], { detached: true }).unref();
4766
4768
  res.sendStatus(200);
4767
4769
  } catch (err) {
4768
4770
  next(err);
@@ -4777,12 +4779,17 @@ function createAppServerRoutes() {
4777
4779
  var createAppServerRoutes_default = createAppServerRoutes;
4778
4780
 
4779
4781
  // src/routes/createDevServerRoutes.ts
4782
+ import path13 from "path";
4783
+ import { fileURLToPath } from "url";
4784
+ var __filename = fileURLToPath(import.meta.url);
4785
+ var __dirname = path13.dirname(__filename);
4786
+ var isProd = true;
4780
4787
  var STORYBOOK_DOMAINS = VALID_PROXY_DOMAIN_SUFFIXES.map(
4781
4788
  (domain2) => `storybook.${domain2}`
4782
4789
  );
4783
4790
  var createDevServerRoutes = async (viteServer, storybookPort, appServerConfig) => {
4784
4791
  const devServerApp = Router2();
4785
- const { appServer, reqLocals, appWebRoot } = appServerConfig || {};
4792
+ const { appServer, reqLocals } = appServerConfig || {};
4786
4793
  devServerApp.use((request2, response, next) => {
4787
4794
  const { method, url: url3, hostname } = request2;
4788
4795
  debug(`${method}:${hostname}${url3}`);
@@ -4801,24 +4808,36 @@ var createDevServerRoutes = async (viteServer, storybookPort, appServerConfig) =
4801
4808
  }
4802
4809
  devServerApp.use(urlencoded());
4803
4810
  if (appServer) {
4804
- devServerApp.use(appServer.middlewares);
4811
+ const appWebRoot = isProd ? path13.join(__dirname, "app") : appServerConfig == null ? void 0 : appServerConfig.appWebRoot;
4812
+ if (isProd) {
4813
+ const distAssetsPath = path13.join(appWebRoot, "assets");
4814
+ devServerApp.use("/assets", expressStatic(distAssetsPath));
4815
+ } else {
4816
+ devServerApp.use(appServer.middlewares);
4817
+ }
4805
4818
  devServerApp.use(viteServer.middlewares);
4806
4819
  devServerApp.use("/api", createAppServerRoutes_default());
4807
4820
  devServerApp.get("/", async (req, res) => {
4808
4821
  try {
4809
4822
  const initialProps = await getDevServerUIData_default(reqLocals, viteServer);
4810
4823
  const url3 = req.originalUrl.replace("/", "");
4811
- let template = await fs4.readFile(`${appWebRoot}/index.html`, "utf-8");
4812
- template = await appServer.transformIndexHtml(url3, template);
4813
- const { render } = await appServer.ssrLoadModule(
4814
- `${appWebRoot}/serverEntry.tsx`
4815
- );
4824
+ const templatePath = path13.join(appWebRoot, "index.html");
4825
+ const serverEntryPath = isProd ? path13.join(appWebRoot, "server/serverEntry.js") : path13.join(appWebRoot, "serverEntry.tsx");
4826
+ let render;
4827
+ let template = await fs4.readFile(path13.join(templatePath), "utf-8");
4828
+ if (isProd) {
4829
+ const { render: ssrRender } = await import(serverEntryPath);
4830
+ render = ssrRender;
4831
+ } else {
4832
+ template = await appServer.transformIndexHtml(url3, template);
4833
+ render = (await appServer.ssrLoadModule(serverEntryPath)).render;
4834
+ }
4816
4835
  const rendered = await render(initialProps);
4817
4836
  const html = template.replace(`<!--app-head-->`, rendered.head ?? "").replace(`<!--app-html-->`, rendered.html ?? "").replace(
4818
4837
  `<!--app-script-->`,
4819
4838
  `<script>window.__hsInitialProps = ${JSON.stringify(
4820
4839
  initialProps
4821
- )}</script>` ?? ""
4840
+ )};</script>` ?? ""
4822
4841
  );
4823
4842
  res.status(200).set({ "Content-Type": "text/html" }).send(html);
4824
4843
  } catch (e) {
@@ -5289,7 +5308,7 @@ async function fetchWebsiteDomainNames(portalId) {
5289
5308
  }
5290
5309
 
5291
5310
  // src/lib/validateHSPlatform.ts
5292
- import path13 from "path";
5311
+ import path14 from "path";
5293
5312
  import fs5 from "fs";
5294
5313
  import select from "@inquirer/select";
5295
5314
  import { http as hsCliHttp12 } from "@hubspot/local-dev-lib/http";
@@ -5301,12 +5320,12 @@ function findHSProjectJson(startPath) {
5301
5320
  let currentDir = startPath;
5302
5321
  let dirLevel = 0;
5303
5322
  const maxDirLevel = 4;
5304
- while (path13.dirname(currentDir) !== currentDir && dirLevel < maxDirLevel) {
5305
- const filePath = path13.join(currentDir, HSPROJECT_JSON);
5323
+ while (path14.dirname(currentDir) !== currentDir && dirLevel < maxDirLevel) {
5324
+ const filePath = path14.join(currentDir, HSPROJECT_JSON);
5306
5325
  if (checkFileExists(filePath)) {
5307
5326
  return filePath;
5308
5327
  }
5309
- currentDir = path13.dirname(currentDir);
5328
+ currentDir = path14.dirname(currentDir);
5310
5329
  dirLevel++;
5311
5330
  }
5312
5331
  console.log(
@@ -5612,7 +5631,7 @@ function writeFieldsType(fields, fileName, typeName) {
5612
5631
 
5613
5632
  // src/lib/watchFieldsUpdates.ts
5614
5633
  import fs6 from "fs";
5615
- import path14 from "path";
5634
+ import path15 from "path";
5616
5635
  import readline from "readline";
5617
5636
  var lastSerializedFieldsCache = {};
5618
5637
  var formatAsTypeName = (str) => {
@@ -5624,9 +5643,9 @@ var isInModulesFolder = (filePath, projectRoot) => {
5624
5643
  const getEntryPathFromId = (id) => {
5625
5644
  return id.startsWith(projectRoot) ? id.replace(`${projectRoot}/`, "") : "";
5626
5645
  };
5627
- const currentModuleId = path14.normalize(filePath);
5646
+ const currentModuleId = path15.normalize(filePath);
5628
5647
  const moduleEntryPath = getEntryPathFromId(currentModuleId);
5629
- const subFolderTokens = moduleEntryPath.split(path14.sep);
5648
+ const subFolderTokens = moduleEntryPath.split(path15.sep);
5630
5649
  return {
5631
5650
  inModuleFolder: subFolderTokens[0] === "components" && subFolderTokens[1] === "modules",
5632
5651
  isRootModuleFile: subFolderTokens.length === 3
@@ -5653,10 +5672,10 @@ var getIndexFile = (filePath, projectRoot) => {
5653
5672
  return void 0;
5654
5673
  if (isRootModuleFile)
5655
5674
  return { indexFilePath: filePath, isRootModuleFile };
5656
- const dir = path14.dirname(filePath);
5675
+ const dir = path15.dirname(filePath);
5657
5676
  const files = fs6.readdirSync(dir);
5658
5677
  const indexFileName = files.find((file) => file.startsWith("index."));
5659
- return indexFileName ? { indexFilePath: path14.join(dir, indexFileName), isRootModuleFile } : void 0;
5678
+ return indexFileName ? { indexFilePath: path15.join(dir, indexFileName), isRootModuleFile } : void 0;
5660
5679
  };
5661
5680
  var getIndexFileFields = async (indexFilePath, indexFileName, viteServer) => {
5662
5681
  let indexFile;
@@ -5680,7 +5699,7 @@ var maybeUpdateFields = async (filePath, viteServer, projectRoot) => {
5680
5699
  if (!indexInfo)
5681
5700
  return;
5682
5701
  const { indexFilePath, isRootModuleFile } = indexInfo;
5683
- const indexFileName = path14.parse(indexFilePath).name;
5702
+ const indexFileName = path15.parse(indexFilePath).name;
5684
5703
  const isTypeFile = filePath.endsWith(".types.ts");
5685
5704
  if (isTypeFile)
5686
5705
  return;
@@ -5691,7 +5710,7 @@ var maybeUpdateFields = async (filePath, viteServer, projectRoot) => {
5691
5710
  );
5692
5711
  if (fields) {
5693
5712
  const typeFileName = isRootModuleFile ? `${indexFileName}.fields.types.ts` : "fields.type.ts";
5694
- const typeFilePath = path14.join(path14.dirname(filePath), typeFileName);
5713
+ const typeFilePath = path15.join(path15.dirname(filePath), typeFileName);
5695
5714
  const lastSerializedFields = lastSerializedFieldsCache[typeFilePath];
5696
5715
  const serializedFields = JSON.stringify(fields);
5697
5716
  if (lastSerializedFields === serializedFields)
@@ -5699,7 +5718,7 @@ var maybeUpdateFields = async (filePath, viteServer, projectRoot) => {
5699
5718
  const hasAutoGenComment = await fileContainsAutoGenComment(typeFilePath);
5700
5719
  if (!hasAutoGenComment)
5701
5720
  return;
5702
- const moduleFolderName = path14.basename(path14.dirname(filePath));
5721
+ const moduleFolderName = path15.basename(path15.dirname(filePath));
5703
5722
  const outputTypeName = formatAsTypeName(moduleFolderName);
5704
5723
  const didSucceed = writeFieldsType(fields, typeFilePath, outputTypeName);
5705
5724
  if (didSucceed) {
@@ -5715,7 +5734,7 @@ var maybeUpdateFields = async (filePath, viteServer, projectRoot) => {
5715
5734
  var startFieldsTypeGenWatcher = (viteServer, projectRoot) => {
5716
5735
  const { moduleSubpaths } = findAllModulesInRoot(projectRoot);
5717
5736
  moduleSubpaths.forEach((modulePath) => {
5718
- const resolvedPath = path14.resolve(projectRoot, modulePath);
5737
+ const resolvedPath = path15.resolve(projectRoot, modulePath);
5719
5738
  maybeUpdateFields(resolvedPath, viteServer, projectRoot);
5720
5739
  });
5721
5740
  const watchCallback = (filePath) => maybeUpdateFields(filePath, viteServer, projectRoot);
@@ -5853,7 +5872,7 @@ Local proxy functionality and module preview routes will not work without settin
5853
5872
  } catch (e) {
5854
5873
  authedHublet = "na1";
5855
5874
  }
5856
- const absoluteWebRoot = normalizePath9(path15.resolve(process.cwd(), webRoot2));
5875
+ const absoluteWebRoot = normalizePath9(path16.resolve(process.cwd(), webRoot2));
5857
5876
  const [__webRootProjectFolder, webRootProjectComponentFolder] = absoluteWebRoot.replace(/\/$/, "").split("/").slice(-2);
5858
5877
  const projectConfigPath = findHSProjectJson(absoluteWebRoot);
5859
5878
  if (authedPortalId) {
@@ -5907,8 +5926,8 @@ Local proxy functionality and module preview routes will not work without settin
5907
5926
  expressServer.use(bodyParser.json());
5908
5927
  let appServerConfig = null;
5909
5928
  if (showUI2) {
5910
- const appWebRoot = path15.join(
5911
- path15.dirname(url2.fileURLToPath(import.meta.url)),
5929
+ const appWebRoot = path16.join(
5930
+ path16.dirname(url2.fileURLToPath(import.meta.url)),
5912
5931
  "../app"
5913
5932
  );
5914
5933
  const reqLocals = {
@@ -5979,8 +5998,8 @@ HubSpot CMS dev server hosting: ${projectName}/${expressServer.locals.projectCom
5979
5998
  `
5980
5999
  );
5981
6000
  if (storybook2) {
5982
- const packageRoot = path15.dirname(url2.fileURLToPath(import.meta.url));
5983
- const configPath = path15.resolve(packageRoot, "./storybook-main");
6001
+ const packageRoot = path16.dirname(url2.fileURLToPath(import.meta.url));
6002
+ const configPath = path16.resolve(packageRoot, "./storybook-main");
5984
6003
  sendTrackingRequest("start-storybook");
5985
6004
  const storybookProcess = spawn2(
5986
6005
  "sb",
@@ -6000,7 +6019,7 @@ HubSpot CMS dev server hosting: ${projectName}/${expressServer.locals.projectCom
6000
6019
  portalId: authedPortalId.toString(),
6001
6020
  hsEnv: authedEnv,
6002
6021
  hublet: authedHublet,
6003
- WEB_ROOT: path15.join(webRoot2, "components")
6022
+ WEB_ROOT: path16.join(webRoot2, "components")
6004
6023
  }
6005
6024
  }
6006
6025
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "0.18.22",
3
+ "version": "0.18.24",
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.22",
32
+ "@hubspot/cms-components": "^0.18.24",
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",
@@ -37,8 +37,7 @@
37
37
  "@radix-ui/react-separator": "^1.1.0",
38
38
  "@radix-ui/react-slot": "^1.1.0",
39
39
  "@radix-ui/react-tooltip": "^1.1.4",
40
- "@sentry/node": "^8.37.1",
41
- "@sentry/profiling-node": "^8.37.1",
40
+ "@sentry/node": "^6.2.0",
42
41
  "@storybook/addon-actions": "7.1.1",
43
42
  "@storybook/addon-essentials": "7.1.1",
44
43
  "@storybook/addon-interactions": "7.1.1",
@@ -132,5 +131,5 @@
132
131
  "publishConfig": {
133
132
  "access": "public"
134
133
  },
135
- "gitHead": "d1de08f5a01c6a5560b04cec14048bee99692ba1"
134
+ "gitHead": "29aa57588f20ed6bde2b24615e18dea79178d7ad"
136
135
  }
package/dist/.DS_Store DELETED
Binary file