@hubspot/cms-dev-server 1.2.47 → 1.2.50

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/README.md CHANGED
@@ -1,3 +1,15 @@
1
1
  # cms-dev-server
2
2
 
3
- Local dev server for JS rendering
3
+ Local development server for JS rendering, published as `@hubspot/cms-dev-server` and invoked via the HubSpot CLI. Handles proxying pages, serving/hot-reloading a customer's JS project, module/HubL routing, and a Storybook mode.
4
+
5
+ See [Set up local development](../docs/local-dev-setup.md) for how this is normally run from the monorepo root (`bend yarn start`/`bend yarn watch`), and [Utility Scripts](../docs/utility-scripts.md) for the full command reference.
6
+
7
+ ## Scripts
8
+
9
+ - `dev` / `dev-inspect` — run the dev server directly (with `--inspect` for the latter)
10
+ - `start` / `start-inspect` — same, via the built output
11
+ - `build` / `build:watch` / `build-types` — build the package and its type declarations
12
+ - `es-watch` — watch mode for the ES build
13
+ - `runBuild` — used by `bend yarn run-at-resources`/`run-at-resources-unified` to point the dev server at a fixture project
14
+ - `test` / `test:watch` — vitest
15
+ - `publint` — validates the published package shape before release
@@ -570,11 +570,11 @@ function getDepsForPackageIfExists(packagePath2) {
570
570
  try {
571
571
  return getDepsForPackage(packagePath2);
572
572
  } catch (e) {
573
- console.log("No package.json at ", packagePath2);
573
+ console.warn("No package.json at ", packagePath2);
574
574
  return [];
575
575
  }
576
576
  }
577
- async function createViteDevServer(webRoot, port, sslEnabled, domainsToProxy = [], jsRenderingGates, secretNames) {
577
+ async function createViteDevServer(webRoot, port, sslEnabled, domainsToProxy = [], jsRenderingGates, secretNames, logLevel) {
578
578
  const additionalMkcertHosts = domainsToProxy.map((proxyDomain) => [
579
579
  `${proxyDomain}.localhost`,
580
580
  `${proxyDomain}.hslocal.net`
@@ -625,6 +625,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
625
625
  noncePlaceholderPlugin()
626
626
  ] : [];
627
627
  const viteConfig = {
628
+ logLevel,
628
629
  appType: "custom",
629
630
  server: {
630
631
  middlewareMode: true,
@@ -632,7 +633,8 @@ Custom origin: ${process.env.VITE_ORIGIN}
632
633
  origin,
633
634
  hmr: {
634
635
  protocol: sslEnabled ? "wss" : void 0
635
- }
636
+ },
637
+ allowedHosts: ["localhost", "hslocal.net", ...additionalMkcertHosts]
636
638
  },
637
639
  root: webRoot,
638
640
  ...ssrAndOptimizeDep,
package/dist/index.js CHANGED
@@ -1140,11 +1140,11 @@ function getDepsForPackageIfExists(packagePath2) {
1140
1140
  try {
1141
1141
  return getDepsForPackage(packagePath2);
1142
1142
  } catch (e) {
1143
- console.log("No package.json at ", packagePath2);
1143
+ console.warn("No package.json at ", packagePath2);
1144
1144
  return [];
1145
1145
  }
1146
1146
  }
1147
- async function createViteDevServer(webRoot, port, sslEnabled, domainsToProxy = [], jsRenderingGates, secretNames) {
1147
+ async function createViteDevServer(webRoot, port, sslEnabled, domainsToProxy = [], jsRenderingGates, secretNames, logLevel) {
1148
1148
  const additionalMkcertHosts = domainsToProxy.map((proxyDomain) => [
1149
1149
  `${proxyDomain}.localhost`,
1150
1150
  `${proxyDomain}.hslocal.net`
@@ -1195,6 +1195,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
1195
1195
  noncePlaceholderPlugin()
1196
1196
  ] : [];
1197
1197
  const viteConfig = {
1198
+ logLevel,
1198
1199
  appType: "custom",
1199
1200
  server: {
1200
1201
  middlewareMode: true,
@@ -1202,7 +1203,8 @@ Custom origin: ${process.env.VITE_ORIGIN}
1202
1203
  origin,
1203
1204
  hmr: {
1204
1205
  protocol: sslEnabled ? "wss" : void 0
1205
- }
1206
+ },
1207
+ allowedHosts: ["localhost", "hslocal.net", ...additionalMkcertHosts]
1206
1208
  },
1207
1209
  root: webRoot,
1208
1210
  ...ssrAndOptimizeDep,
@@ -1649,7 +1651,7 @@ function trackUsage(action) {
1649
1651
  eventName: EVENT_NAME,
1650
1652
  action,
1651
1653
  nodeVersion: getNodeVersionData(),
1652
- version: "1.2.47",
1654
+ version: "1.2.50",
1653
1655
  os: getPlatform()
1654
1656
  };
1655
1657
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
package/dist/run.js CHANGED
@@ -2256,7 +2256,7 @@ function trackUsage(action) {
2256
2256
  eventName: EVENT_NAME,
2257
2257
  action,
2258
2258
  nodeVersion: getNodeVersionData(),
2259
- version: "1.2.47",
2259
+ version: "1.2.50",
2260
2260
  os: getPlatform()
2261
2261
  };
2262
2262
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
@@ -5205,11 +5205,11 @@ function getDepsForPackageIfExists(packagePath2) {
5205
5205
  try {
5206
5206
  return getDepsForPackage(packagePath2);
5207
5207
  } catch (e) {
5208
- console.log("No package.json at ", packagePath2);
5208
+ console.warn("No package.json at ", packagePath2);
5209
5209
  return [];
5210
5210
  }
5211
5211
  }
5212
- async function createViteDevServer(webRoot2, port, sslEnabled, domainsToProxy = [], jsRenderingGates, secretNames) {
5212
+ async function createViteDevServer(webRoot2, port, sslEnabled, domainsToProxy = [], jsRenderingGates, secretNames, logLevel) {
5213
5213
  const additionalMkcertHosts = domainsToProxy.map((proxyDomain) => [
5214
5214
  `${proxyDomain}.localhost`,
5215
5215
  `${proxyDomain}.hslocal.net`
@@ -5260,6 +5260,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
5260
5260
  noncePlaceholderPlugin()
5261
5261
  ] : [];
5262
5262
  const viteConfig = {
5263
+ logLevel,
5263
5264
  appType: "custom",
5264
5265
  server: {
5265
5266
  middlewareMode: true,
@@ -5267,7 +5268,8 @@ Custom origin: ${process.env.VITE_ORIGIN}
5267
5268
  origin,
5268
5269
  hmr: {
5269
5270
  protocol: sslEnabled ? "wss" : void 0
5270
- }
5271
+ },
5272
+ allowedHosts: ["localhost", "hslocal.net", ...additionalMkcertHosts]
5271
5273
  },
5272
5274
  root: webRoot2,
5273
5275
  ...ssrAndOptimizeDep,