@hubspot/cms-dev-server 1.0.33 → 1.0.35

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 (3) hide show
  1. package/dist/index.js +37 -25
  2. package/dist/run.js +37 -25
  3. package/package.json +12 -10
package/dist/index.js CHANGED
@@ -1209,13 +1209,13 @@ var createViteDevServer_default = createViteDevServer;
1209
1209
 
1210
1210
  // src/createDevServer.ts
1211
1211
  import path16 from "path";
1212
+ import fs7 from "fs";
1212
1213
  import url2 from "url";
1213
1214
  import express2 from "express";
1214
1215
  import http3 from "http";
1215
1216
  import bodyParser from "body-parser";
1216
1217
  import { spawn as spawn2 } from "child_process";
1217
1218
  import { normalizePath as normalizePath10 } from "vite";
1218
- import { Transform } from "stream";
1219
1219
 
1220
1220
  // src/routes/createDevServerRoutes.ts
1221
1221
  import {
@@ -1638,7 +1638,7 @@ function trackUsage(action) {
1638
1638
  eventName: EVENT_NAME,
1639
1639
  action,
1640
1640
  nodeVersion: getNodeVersionData(),
1641
- version: "1.0.33",
1641
+ version: "1.0.35",
1642
1642
  os: getPlatform()
1643
1643
  };
1644
1644
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
@@ -4098,7 +4098,7 @@ var hublModuleRouteHandler = async (request2, response) => {
4098
4098
  response.status(200).set({ "Content-Type": "text/html" }).end(buildModuleIndex());
4099
4099
  return;
4100
4100
  }
4101
- const calculatedPath = `@preview/${localPreviewToken}/${modulePath}.module`;
4101
+ const calculatedPath = `@preview/${localPreviewToken}/@projects/${modulePath}.module`;
4102
4102
  let customWidgetInfo;
4103
4103
  try {
4104
4104
  customWidgetInfo = await fetchModuleByPath(authedPortalId, calculatedPath);
@@ -5575,8 +5575,30 @@ HubSpot CMS dev server running at ${protocol}://hslocal.net:${PORT}${extraServer
5575
5575
  const packageRoot = path16.dirname(url2.fileURLToPath(import.meta.url));
5576
5576
  const configPath = path16.resolve(packageRoot, "./storybook-main");
5577
5577
  sendTrackingRequest("start-storybook");
5578
+ const cmsDevServerRoot = path16.dirname(packageRoot);
5579
+ const storybookBin = path16.resolve(
5580
+ cmsDevServerRoot,
5581
+ "node_modules",
5582
+ ".bin",
5583
+ "storybook"
5584
+ );
5585
+ if (!fs7.existsSync(storybookBin)) {
5586
+ console.error(
5587
+ wrapMessageInColor(
5588
+ "red",
5589
+ "Could not find storybook dependencies. The --storybook flag will be ignored."
5590
+ )
5591
+ );
5592
+ return;
5593
+ }
5594
+ console.log(
5595
+ wrapMessageInColor(
5596
+ "yellow",
5597
+ `Starting storybook server on port ${STORYBOOK_PORT}`
5598
+ )
5599
+ );
5578
5600
  const storybookProcess = spawn2(
5579
- "sb",
5601
+ storybookBin,
5580
5602
  [
5581
5603
  "dev",
5582
5604
  "-p",
@@ -5594,29 +5616,19 @@ HubSpot CMS dev server running at ${protocol}://hslocal.net:${PORT}${extraServer
5594
5616
  hsEnv: authedEnv,
5595
5617
  hublet: authedHublet,
5596
5618
  WEB_ROOT: path16.join(webRoot, "components")
5597
- }
5619
+ },
5620
+ stdio: "inherit"
5598
5621
  }
5599
5622
  );
5600
- console.log(
5601
- wrapMessageInColor(
5602
- "yellow",
5603
- `Starting storybook server on port ${STORYBOOK_PORT}`
5604
- )
5605
- );
5606
- storybookProcess.stdout.pipe(
5607
- new Transform({
5608
- transform(chunk, _encoding, callback) {
5609
- callback(null, wrapMessageInColor("yellow", chunk.toString()));
5610
- }
5611
- })
5612
- ).pipe(process.stdout);
5613
- storybookProcess.stderr.pipe(
5614
- new Transform({
5615
- transform(chunk, _encoding, callback) {
5616
- callback(null, wrapMessageInColor("red", chunk.toString()));
5617
- }
5618
- })
5619
- ).pipe(process.stderr);
5623
+ storybookProcess.on("error", (err) => {
5624
+ console.error(
5625
+ wrapMessageInColor(
5626
+ "red",
5627
+ "Failed to start storybook. The --storybook flag will be ignored."
5628
+ )
5629
+ );
5630
+ console.error(err);
5631
+ });
5620
5632
  }
5621
5633
  return {
5622
5634
  close: () => {
package/dist/run.js CHANGED
@@ -759,13 +759,13 @@ async function buildThemePreviewOptions(webRoot2, isUsingLocalWorkspace = false)
759
759
 
760
760
  // src/createDevServer.ts
761
761
  import path17 from "path";
762
+ import fs8 from "fs";
762
763
  import url2 from "url";
763
764
  import express2 from "express";
764
765
  import http3 from "http";
765
766
  import bodyParser from "body-parser";
766
767
  import { spawn as spawn2 } from "child_process";
767
768
  import { normalizePath as normalizePath10 } from "vite";
768
- import { Transform } from "stream";
769
769
 
770
770
  // src/routes/createDevServerRoutes.ts
771
771
  import {
@@ -2166,7 +2166,7 @@ function trackUsage(action) {
2166
2166
  eventName: EVENT_NAME,
2167
2167
  action,
2168
2168
  nodeVersion: getNodeVersionData(),
2169
- version: "1.0.33",
2169
+ version: "1.0.35",
2170
2170
  os: getPlatform()
2171
2171
  };
2172
2172
  const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
@@ -4626,7 +4626,7 @@ var hublModuleRouteHandler = async (request2, response) => {
4626
4626
  response.status(200).set({ "Content-Type": "text/html" }).end(buildModuleIndex());
4627
4627
  return;
4628
4628
  }
4629
- const calculatedPath = `@preview/${localPreviewToken}/${modulePath}.module`;
4629
+ const calculatedPath = `@preview/${localPreviewToken}/@projects/${modulePath}.module`;
4630
4630
  let customWidgetInfo;
4631
4631
  try {
4632
4632
  customWidgetInfo = await fetchModuleByPath(authedPortalId, calculatedPath);
@@ -6315,8 +6315,30 @@ HubSpot CMS dev server running at ${protocol}://hslocal.net:${PORT}${extraServer
6315
6315
  const packageRoot = path17.dirname(url2.fileURLToPath(import.meta.url));
6316
6316
  const configPath = path17.resolve(packageRoot, "./storybook-main");
6317
6317
  sendTrackingRequest("start-storybook");
6318
+ const cmsDevServerRoot = path17.dirname(packageRoot);
6319
+ const storybookBin = path17.resolve(
6320
+ cmsDevServerRoot,
6321
+ "node_modules",
6322
+ ".bin",
6323
+ "storybook"
6324
+ );
6325
+ if (!fs8.existsSync(storybookBin)) {
6326
+ console.error(
6327
+ wrapMessageInColor(
6328
+ "red",
6329
+ "Could not find storybook dependencies. The --storybook flag will be ignored."
6330
+ )
6331
+ );
6332
+ return;
6333
+ }
6334
+ console.log(
6335
+ wrapMessageInColor(
6336
+ "yellow",
6337
+ `Starting storybook server on port ${STORYBOOK_PORT}`
6338
+ )
6339
+ );
6318
6340
  const storybookProcess = spawn2(
6319
- "sb",
6341
+ storybookBin,
6320
6342
  [
6321
6343
  "dev",
6322
6344
  "-p",
@@ -6334,29 +6356,19 @@ HubSpot CMS dev server running at ${protocol}://hslocal.net:${PORT}${extraServer
6334
6356
  hsEnv: authedEnv,
6335
6357
  hublet: authedHublet,
6336
6358
  WEB_ROOT: path17.join(webRoot2, "components")
6337
- }
6359
+ },
6360
+ stdio: "inherit"
6338
6361
  }
6339
6362
  );
6340
- console.log(
6341
- wrapMessageInColor(
6342
- "yellow",
6343
- `Starting storybook server on port ${STORYBOOK_PORT}`
6344
- )
6345
- );
6346
- storybookProcess.stdout.pipe(
6347
- new Transform({
6348
- transform(chunk, _encoding, callback) {
6349
- callback(null, wrapMessageInColor("yellow", chunk.toString()));
6350
- }
6351
- })
6352
- ).pipe(process.stdout);
6353
- storybookProcess.stderr.pipe(
6354
- new Transform({
6355
- transform(chunk, _encoding, callback) {
6356
- callback(null, wrapMessageInColor("red", chunk.toString()));
6357
- }
6358
- })
6359
- ).pipe(process.stderr);
6363
+ storybookProcess.on("error", (err) => {
6364
+ console.error(
6365
+ wrapMessageInColor(
6366
+ "red",
6367
+ "Failed to start storybook. The --storybook flag will be ignored."
6368
+ )
6369
+ );
6370
+ console.error(err);
6371
+ });
6360
6372
  }
6361
6373
  return {
6362
6374
  close: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
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.33",
32
+ "@hubspot/cms-components": "^1.0.35",
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",
@@ -39,13 +39,14 @@
39
39
  "@radix-ui/react-toggle": "^1.1.3",
40
40
  "@radix-ui/react-tooltip": "^1.1.4",
41
41
  "@sentry/node": "^6.2.0",
42
- "@storybook/addon-actions": "7.1.1",
43
- "@storybook/addon-essentials": "7.1.1",
44
- "@storybook/addon-interactions": "7.1.1",
45
- "@storybook/addon-links": "7.1.1",
46
- "@storybook/react": "7.1.1",
47
- "@storybook/react-vite": "7.1.1",
48
- "@storybook/testing-library": "^0.0.13",
42
+ "@storybook/addon-actions": "^8.6.14",
43
+ "@storybook/addon-essentials": "^8.6.14",
44
+ "@storybook/addon-interactions": "^8.6.14",
45
+ "@storybook/addon-links": "^8.6.14",
46
+ "@storybook/builder-vite": "^8.6.14",
47
+ "@storybook/react": "^8.6.14",
48
+ "@storybook/react-vite": "^8.6.14",
49
+ "@storybook/test": "^8.6.14",
49
50
  "@vitejs/plugin-react": "^4.2.1",
50
51
  "ansi-to-html": "0.7.x",
51
52
  "babel-plugin-macros": "^3.1.0",
@@ -67,6 +68,7 @@
67
68
  "react": "18.3.1",
68
69
  "react-dom": "18.3.1",
69
70
  "request": "^2.88.2",
71
+ "storybook": "^8.6.14",
70
72
  "styled-jsx": "5.1.2",
71
73
  "tailwind-merge": "^2.5.4",
72
74
  "tailwindcss-animate": "^1.0.7",
@@ -132,5 +134,5 @@
132
134
  "publishConfig": {
133
135
  "access": "public"
134
136
  },
135
- "gitHead": "8d1de5f4c21428c7f8bf053007a30eddff290c7a"
137
+ "gitHead": "207388081f6e3a65ab2bdfe4469a76f0785b3853"
136
138
  }