@hubspot/cms-dev-server 0.8.0 → 0.8.2

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.
@@ -50,7 +50,7 @@ __export(dist_exports, {
50
50
  ungatedAtBuildTimeFor: () => ungatedAtBuildTimeFor,
51
51
  virtualClientRenderIslandModuleId: () => virtualClientRenderIslandModuleId
52
52
  });
53
- import path, { basename } from "path";
53
+ import path from "path";
54
54
  import * as jsxRuntime from "react/jsx-runtime";
55
55
  import stream from "stream";
56
56
  import { renderToPipeableStream, renderToStaticMarkup } from "react-dom/server";
@@ -125,7 +125,7 @@ function getPerServerRequestUrls(perServerRequestData, viteDevServer) {
125
125
  });
126
126
  return perServerRequestDataWithUrls;
127
127
  }
128
- function resolveIslandPlugin() {
128
+ function resolveIslandPlugin(islandsSet) {
129
129
  return {
130
130
  enforce: "pre",
131
131
  name: "resolve-islands",
@@ -144,6 +144,9 @@ function resolveIslandPlugin() {
144
144
  );
145
145
  const modulePath = idWithNoParam.replace(`${viteRoot}/`, "");
146
146
  const moduleId = (viteCommand === "serve" ? idWithNoParam : modulePath).concat("?client-entry");
147
+ if (islandsSet) {
148
+ islandsSet.add(moduleId);
149
+ }
147
150
  return `
148
151
  const moduleId = '${moduleId}';
149
152
 
@@ -252,8 +255,7 @@ function ungatedAtBuildTimeFor(buildDir, gate) {
252
255
  function findAllModulesInRoot(webRoot2) {
253
256
  const allModuleComponents = findAllComponentsIn(
254
257
  webRoot2,
255
- "./components/modules",
256
- true
258
+ "./components/modules"
257
259
  );
258
260
  const moduleNames = Object.keys(allModuleComponents).map(
259
261
  (moduleSubpath) => moduleSubpath.replace("components/modules/", "").replace("/index", "")
@@ -264,13 +266,12 @@ function findAllModulesInRoot(webRoot2) {
264
266
  function findAllPartialsInRoot(webRoot2) {
265
267
  const allPartialComponents = findAllComponentsIn(
266
268
  webRoot2,
267
- "./components/partials",
268
- false
269
+ "./components/partials"
269
270
  );
270
- const partialSubpaths = Object.keys(allPartialComponents);
271
- const partialNames = partialSubpaths.map(
272
- (partialSubpath) => basename(partialSubpath)
271
+ const partialNames = Object.keys(allPartialComponents).map(
272
+ (partialSubpath) => partialSubpath.replace("components/partials/", "").replace("/index", "")
273
273
  );
274
+ const partialSubpaths = Object.keys(allPartialComponents);
274
275
  return { partialNames, partialSubpaths };
275
276
  }
276
277
  function getServerGlobalsToInject(environmentConfig, hsServerPageUrl, hsBasePath) {
@@ -574,7 +575,7 @@ ${groupEnd}</script>
574
575
  "cms:jsr:separateIslandRenderOption": "CMS:JSRenderer:SeparateIslandRenderOption"
575
576
  };
576
577
  BUILD_INFO_PATH = "/build-info.json";
577
- findAllComponentsIn = (webRoot2, componentsFolder, includeSubdirIndexJS) => {
578
+ findAllComponentsIn = (webRoot2, componentsFolder) => {
578
579
  const fullComponentsFolderPath = join(webRoot2, componentsFolder);
579
580
  const componentsByName = {};
580
581
  if (!existsSync(fullComponentsFolderPath)) {
@@ -587,7 +588,7 @@ ${groupEnd}</script>
587
588
  if (!isDirectory && hasComponentExtension(fileOrFolderName) && !isStorybookStory(fileOrFolderName)) {
588
589
  const subdirPathNoExtension = removeComponentExtension(subdirPath);
589
590
  componentsByName[subdirPathNoExtension] = subdirPath;
590
- } else if (isDirectory && includeSubdirIndexJS) {
591
+ } else if (isDirectory) {
591
592
  for (const potentialExtension of COMPONENT_EXTENSIONS) {
592
593
  const potentialIndexModule = join(
593
594
  subdirPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "engines": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@hubspot/cli-lib": "^3.0.12",
28
- "@hubspot/cms-components": "^0.8.0",
28
+ "@hubspot/cms-components": "^0.8.2",
29
29
  "@originjs/vite-plugin-commonjs": "^1.0.3",
30
30
  "@storybook/addon-actions": "7.0.7",
31
31
  "@storybook/addon-essentials": "7.0.7",
@@ -100,5 +100,5 @@
100
100
  "publishConfig": {
101
101
  "access": "public"
102
102
  },
103
- "gitHead": "554152ecb8091d5484f085c82a2ccecf6ce467d4"
103
+ "gitHead": "dd431a9d693d7f25207746363a0395b616fc74d1"
104
104
  }
@@ -0,0 +1,2 @@
1
+ import { setupIslandHydration } from '@hubspot/cms-js-internal/island-runtime';
2
+ export { setupIslandHydration };
Binary file
@@ -1,2 +0,0 @@
1
- import { Alias } from 'vite';
2
- export default function generateBpmAliases(webRoot: string): Alias[];
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'vite';
2
- declare const noNodeBuiltinsPlugin: () => Plugin;
3
- export default noNodeBuiltinsPlugin;