@hubspot/cms-dev-server 0.16.14 → 0.16.15

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/run.js CHANGED
@@ -643,12 +643,13 @@ function findCmsModules(cmsModules = {}) {
643
643
  JSXOpeningElement(path11) {
644
644
  if (!t.isJSXIdentifier(path11.node.name, {
645
645
  name: moduleLocalImportName
646
- }) || path11.node.attributes.length !== 2) {
646
+ })) {
647
647
  return null;
648
648
  }
649
649
  moduleUsed = true;
650
650
  let cmsModuleName;
651
651
  let cmsModulePath;
652
+ let cmsModuleLabel;
652
653
  for (const prop of path11.node.attributes) {
653
654
  if (t.isJSXAttribute(prop) && t.isJSXIdentifier(prop.name, { name: "name" }) && t.isStringLiteral(prop.value)) {
654
655
  cmsModuleName = prop.value.value;
@@ -658,6 +659,10 @@ function findCmsModules(cmsModules = {}) {
658
659
  cmsModulePath = prop.value.value;
659
660
  continue;
660
661
  }
662
+ if (t.isJSXAttribute(prop) && t.isJSXIdentifier(prop.name, { name: "label" }) && t.isStringLiteral(prop.value)) {
663
+ cmsModuleLabel = prop.value.value;
664
+ continue;
665
+ }
661
666
  pluginError(
662
667
  new Error(
663
668
  `Error: ${id.replace(config.root, "")}:${prop.loc.start.line} "name" and "path" must be primitive strings`
@@ -669,6 +674,9 @@ function findCmsModules(cmsModules = {}) {
669
674
  name: cmsModuleName,
670
675
  path: cmsModulePath
671
676
  };
677
+ if (cmsModuleLabel) {
678
+ cmsModuleProps.label = cmsModuleLabel;
679
+ }
672
680
  if (Object.hasOwn(localCmsModules, cmsModuleProps.name)) {
673
681
  pluginError(
674
682
  new Error(
@@ -955,7 +963,7 @@ async function renderComponentWithCSS(viteServer, componentPath, Component, prop
955
963
  html,
956
964
  renderContext,
957
965
  []
958
- // Build-time generated static asset arracy is only available when deployed
966
+ // Build-time generated static asset array is only available when deployed
959
967
  );
960
968
  }
961
969
  const cssNeeded = collectCssInDev2(componentPathWithExtension, viteServer);
@@ -1239,7 +1247,7 @@ function trackUsage(action) {
1239
1247
  eventName: EVENT_NAME,
1240
1248
  action,
1241
1249
  nodeVersion: getNodeVersionData(),
1242
- version: "0.16.14",
1250
+ version: "0.16.15",
1243
1251
  os: getPlatform()
1244
1252
  };
1245
1253
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;