@hubspot/cms-dev-server 1.2.35 → 1.2.36
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/.DS_Store +0 -0
- package/dist/generateJsonFromJsx.js +1 -1
- package/dist/index.js +3 -2
- package/dist/internalSsr.js +5 -3
- package/dist/island-runtime.js +23 -38
- package/dist/run.js +3 -2
- package/dist/storybook/index.js +1 -1
- package/dist/storybook-main/main.js +9 -7
- package/package.json +3 -3
- package/types/lib/debugAuth.d.ts +2 -0
- package/types/lib/localComponentsLoader.d.ts +2 -0
- package/types/lib/viteAssetHandler.d.ts +15 -0
- package/types/plugins/hubspotStaticAssetPlugin.d.ts +2 -0
- package/types/plugins/remoteAssetsPlugin.d.ts +7 -0
- package/types/plugins/requestSigningPlugin.d.ts +6 -0
- package/types/routes/createAppServerRoutes.d.ts +5 -0
- package/types/routes/homeRouteHandler.d.ts +3 -0
package/dist/.DS_Store
ADDED
|
Binary file
|
|
@@ -10,7 +10,7 @@ import { createServer as createViteServer } from "vite";
|
|
|
10
10
|
import { createRequire } from "module";
|
|
11
11
|
import { default as react } from "@vitejs/plugin-react";
|
|
12
12
|
|
|
13
|
-
// ../cms-js-internal/dist/types-
|
|
13
|
+
// ../cms-js-internal/dist/types-CliAmBEj.js
|
|
14
14
|
import path from "path";
|
|
15
15
|
var viteRoot;
|
|
16
16
|
var viteCommand;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createServer as createViteServer } from "vite";
|
|
|
3
3
|
import { createRequire } from "module";
|
|
4
4
|
import { default as react } from "@vitejs/plugin-react";
|
|
5
5
|
|
|
6
|
-
// ../cms-js-internal/dist/types-
|
|
6
|
+
// ../cms-js-internal/dist/types-CliAmBEj.js
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { createHash } from "crypto";
|
|
9
9
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -249,6 +249,7 @@ function getCMSAssetConfigIfExists(webRoot) {
|
|
|
249
249
|
}
|
|
250
250
|
var ENABLED_FEATURES_GATE_MAP = {
|
|
251
251
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
|
252
|
+
"cms:jsr:RemoveCjsPlugin": "CMS:JSRenderer:RemoveCjsPlugin",
|
|
252
253
|
"cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules",
|
|
253
254
|
"PortalsAccessIdentity:DesignManager:UrlSigning": "PortalsAccessIdentity:DesignManager:UrlSigning"
|
|
254
255
|
};
|
|
@@ -1642,7 +1643,7 @@ function trackUsage(action) {
|
|
|
1642
1643
|
eventName: EVENT_NAME,
|
|
1643
1644
|
action,
|
|
1644
1645
|
nodeVersion: getNodeVersionData(),
|
|
1645
|
-
version: "1.2.
|
|
1646
|
+
version: "1.2.36",
|
|
1646
1647
|
os: getPlatform()
|
|
1647
1648
|
};
|
|
1648
1649
|
const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
package/dist/internalSsr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../cms-js-internal/dist/types-
|
|
1
|
+
// ../cms-js-internal/dist/types-CliAmBEj.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { createHash } from "crypto";
|
|
4
4
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -383,6 +383,7 @@ function getBaseAssetUrlFromBuild(buildDir) {
|
|
|
383
383
|
var GATES = [
|
|
384
384
|
"CMS:JSRenderer:GetServerSideProps",
|
|
385
385
|
"CMS:JSRenderer:ModuleHubl",
|
|
386
|
+
"CMS:JSRenderer:RemoveCjsPlugin",
|
|
386
387
|
"CMS:JSRenderer:RemoveMockClientEntryPlugin",
|
|
387
388
|
"CMS:JSRenderer:AnalyzeCmsModules",
|
|
388
389
|
"CMS:JSRenderer:StripNullBytes",
|
|
@@ -390,13 +391,14 @@ var GATES = [
|
|
|
390
391
|
];
|
|
391
392
|
var ENABLED_FEATURES_GATE_MAP = {
|
|
392
393
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
|
394
|
+
"cms:jsr:RemoveCjsPlugin": "CMS:JSRenderer:RemoveCjsPlugin",
|
|
393
395
|
"cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules",
|
|
394
396
|
"PortalsAccessIdentity:DesignManager:UrlSigning": "PortalsAccessIdentity:DesignManager:UrlSigning"
|
|
395
397
|
};
|
|
396
398
|
function isUngatedFor(gates, gate) {
|
|
397
399
|
return gates.includes(gate);
|
|
398
400
|
}
|
|
399
|
-
function
|
|
401
|
+
function ungatedIAtBuildTimeFor(buildDir, gate) {
|
|
400
402
|
try {
|
|
401
403
|
const buildInfo = getBuildInfo(buildDir);
|
|
402
404
|
return isUngatedFor(buildInfo.gates, gate);
|
|
@@ -1308,6 +1310,6 @@ export {
|
|
|
1308
1310
|
scriptTagToLogServerMessages,
|
|
1309
1311
|
serializeIslandDataForInlineScript,
|
|
1310
1312
|
setIn,
|
|
1311
|
-
|
|
1313
|
+
ungatedIAtBuildTimeFor,
|
|
1312
1314
|
virtualClientRenderIslandModuleId
|
|
1313
1315
|
};
|
package/dist/island-runtime.js
CHANGED
|
@@ -107,7 +107,9 @@ function setupIdleCallbackIfNeeded() {
|
|
|
107
107
|
}
|
|
108
108
|
function finishHydratingRootAndScheduleNext(rootAndExtraInfo) {
|
|
109
109
|
rootAndExtraInfo.root.hydrationStatus = "HYDRATED";
|
|
110
|
-
hydrationQueue = hydrationQueue.filter(
|
|
110
|
+
hydrationQueue = hydrationQueue.filter(
|
|
111
|
+
(x) => x.root.id !== rootAndExtraInfo.root.id
|
|
112
|
+
);
|
|
111
113
|
const hasOtherRootsToHydrate = hydrationQueue.length > 0;
|
|
112
114
|
if (hasOtherRootsToHydrate) {
|
|
113
115
|
setTimeout(() => hydrateRoot(hydrationQueue[0]), 0);
|
|
@@ -134,8 +136,7 @@ function hydrateRoot(rootAndExtraInfo) {
|
|
|
134
136
|
index: rootAndExtraInfo.islandScheduledIndex
|
|
135
137
|
};
|
|
136
138
|
const reactRoot = IslandModule.render(renderableIsland);
|
|
137
|
-
|
|
138
|
-
rootsById.set(root.id, [...existingRoots, reactRoot]);
|
|
139
|
+
rootsById.set(root.id, reactRoot);
|
|
139
140
|
}
|
|
140
141
|
function pushToHydrationQueue(rootAndExtraInfo) {
|
|
141
142
|
rootAndExtraInfo.root.hydrationStatus = "HYDRATION_QUEUED";
|
|
@@ -164,42 +165,28 @@ function loadThenHydrate(root, LoadableIslandModule, LoadableWrapperModule, root
|
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
167
|
function waitThenLoadAndHydrateIfNeeded(root, LoadableIslandModule, LoadableWrapperModule) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
)
|
|
173
|
-
);
|
|
174
|
-
} else {
|
|
175
|
-
rootEls = Array.from(
|
|
176
|
-
document.querySelectorAll("[data-hs-island]")
|
|
177
|
-
).filter((el) => el.id === root.id);
|
|
178
|
-
}
|
|
179
|
-
rootEls.forEach((rootEl) => {
|
|
180
|
-
const rootClone = { ...root };
|
|
181
|
-
const islandScheduledIndex = scheduledHydrationIndexCtr;
|
|
182
|
-
scheduledHydrationIndexCtr += 1;
|
|
183
|
-
if (rootClone.hydrateOn === "visible") {
|
|
184
|
-
onVisible(rootEl, () => {
|
|
185
|
-
loadThenHydrate(
|
|
186
|
-
rootClone,
|
|
187
|
-
LoadableIslandModule,
|
|
188
|
-
LoadableWrapperModule,
|
|
189
|
-
rootEl,
|
|
190
|
-
islandScheduledIndex
|
|
191
|
-
);
|
|
192
|
-
});
|
|
193
|
-
} else {
|
|
168
|
+
const rootEl = document.getElementById(root.id);
|
|
169
|
+
const islandScheduledIndex = scheduledHydrationIndexCtr;
|
|
170
|
+
scheduledHydrationIndexCtr += 1;
|
|
171
|
+
if (root.hydrateOn === "visible") {
|
|
172
|
+
onVisible(rootEl, () => {
|
|
194
173
|
loadThenHydrate(
|
|
195
|
-
|
|
174
|
+
root,
|
|
196
175
|
LoadableIslandModule,
|
|
197
176
|
LoadableWrapperModule,
|
|
198
177
|
rootEl,
|
|
199
178
|
islandScheduledIndex
|
|
200
179
|
);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
180
|
+
});
|
|
181
|
+
} else {
|
|
182
|
+
loadThenHydrate(
|
|
183
|
+
root,
|
|
184
|
+
LoadableIslandModule,
|
|
185
|
+
LoadableWrapperModule,
|
|
186
|
+
rootEl,
|
|
187
|
+
islandScheduledIndex
|
|
188
|
+
);
|
|
189
|
+
}
|
|
203
190
|
}
|
|
204
191
|
function getLoadableModuleFor(root) {
|
|
205
192
|
let url = root.url;
|
|
@@ -264,17 +251,15 @@ function unmountIsland(islandId) {
|
|
|
264
251
|
const islandToUnmount = rootsToProcess.find(
|
|
265
252
|
(island) => island.id === islandId
|
|
266
253
|
);
|
|
267
|
-
|
|
268
|
-
if (!islandToUnmount || !reactRoots || reactRoots.length === 0) {
|
|
254
|
+
if (!islandToUnmount || !rootsById.get(islandId)) {
|
|
269
255
|
throw new Error(`No known island: ${islandId}`);
|
|
270
256
|
}
|
|
271
257
|
const islandIndex = rootsToProcess.indexOf(islandToUnmount);
|
|
258
|
+
const reactRoot = rootsById.get(islandId);
|
|
272
259
|
rootsToProcess.splice(islandIndex, 1);
|
|
273
260
|
rootsById.delete(islandId);
|
|
274
261
|
console.log("Unmounting island:", islandId);
|
|
275
|
-
|
|
276
|
-
reactRoot.unmount();
|
|
277
|
-
}
|
|
262
|
+
reactRoot.unmount();
|
|
278
263
|
}
|
|
279
264
|
export {
|
|
280
265
|
setupIslandHydration,
|
package/dist/run.js
CHANGED
|
@@ -896,7 +896,7 @@ function packagePath(metaUrl, projectPath) {
|
|
|
896
896
|
);
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
// ../cms-js-internal/dist/types-
|
|
899
|
+
// ../cms-js-internal/dist/types-CliAmBEj.js
|
|
900
900
|
import path4 from "path";
|
|
901
901
|
import { createHash } from "crypto";
|
|
902
902
|
import fs3, { readFileSync, existsSync as existsSync2, readdirSync, lstatSync } from "fs";
|
|
@@ -1142,6 +1142,7 @@ function getCMSAssetConfigIfExists(webRoot2) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
var ENABLED_FEATURES_GATE_MAP = {
|
|
1144
1144
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
|
1145
|
+
"cms:jsr:RemoveCjsPlugin": "CMS:JSRenderer:RemoveCjsPlugin",
|
|
1145
1146
|
"cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules",
|
|
1146
1147
|
"PortalsAccessIdentity:DesignManager:UrlSigning": "PortalsAccessIdentity:DesignManager:UrlSigning"
|
|
1147
1148
|
};
|
|
@@ -2249,7 +2250,7 @@ function trackUsage(action) {
|
|
|
2249
2250
|
eventName: EVENT_NAME,
|
|
2250
2251
|
action,
|
|
2251
2252
|
nodeVersion: getNodeVersionData(),
|
|
2252
|
-
version: "1.2.
|
|
2253
|
+
version: "1.2.36",
|
|
2253
2254
|
os: getPlatform()
|
|
2254
2255
|
};
|
|
2255
2256
|
const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
package/dist/storybook/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
// ../cms-js-internal/dist/types-
|
|
11
|
+
// ../cms-js-internal/dist/types-CliAmBEj.js
|
|
12
12
|
import path from "path";
|
|
13
13
|
import { createHash } from "crypto";
|
|
14
14
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -276,7 +276,7 @@ function getBaseAssetUrlFromBuild(buildDir) {
|
|
|
276
276
|
function isUngatedFor(gates, gate) {
|
|
277
277
|
return gates.includes(gate);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function ungatedIAtBuildTimeFor(buildDir, gate) {
|
|
280
280
|
try {
|
|
281
281
|
const buildInfo = getBuildInfo(buildDir);
|
|
282
282
|
return isUngatedFor(buildInfo.gates, gate);
|
|
@@ -378,8 +378,8 @@ function isStylesheetAsset(staticAsset) {
|
|
|
378
378
|
return staticAsset.type === "stylesheet";
|
|
379
379
|
}
|
|
380
380
|
var COMPONENT_EXTENSIONS, ENTRY_POINTS_PATH, MODULE_FOLDER_PATH, TEMPLATE_FOLDER_PATH, VIRTUAL_ISLAND_RUNTIME, VIRTUAL_CONFIG_SETUP, CSS_LANGS_RE, collectCssModules, collectCssInDev, badInlineJsChars, inlineJsEscapeChars, viteRoot, viteCommand, clientRenderIsland, virtualClientRenderIslandModuleId, scriptTagToLogServerMessages, getComponentExtension, hasComponentExtension, isStorybookStory, removeComponentExtension, COMBINED_REACT_BASE_PATH, ISLAND_RUNTIME_CONFIG_BASE_PATH, removeIndexFromPath, removeIndexOrTrailingJsFromPath, HEALTHCHECKS_ENABLED_DEFAULT, HEALTHCHECKS_STRICT_DEFAULT, BUILD_INFO_PATH, GATES, ENABLED_FEATURES_GATE_MAP, findAllComponentsIn;
|
|
381
|
-
var
|
|
382
|
-
"../cms-js-internal/dist/types-
|
|
381
|
+
var init_types_CliAmBEj = __esm({
|
|
382
|
+
"../cms-js-internal/dist/types-CliAmBEj.js"() {
|
|
383
383
|
COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
|
|
384
384
|
ENTRY_POINTS_PATH = "components/partials/";
|
|
385
385
|
MODULE_FOLDER_PATH = "components/modules/";
|
|
@@ -498,6 +498,7 @@ ${groupEnd}</script>
|
|
|
498
498
|
GATES = [
|
|
499
499
|
"CMS:JSRenderer:GetServerSideProps",
|
|
500
500
|
"CMS:JSRenderer:ModuleHubl",
|
|
501
|
+
"CMS:JSRenderer:RemoveCjsPlugin",
|
|
501
502
|
"CMS:JSRenderer:RemoveMockClientEntryPlugin",
|
|
502
503
|
"CMS:JSRenderer:AnalyzeCmsModules",
|
|
503
504
|
"CMS:JSRenderer:StripNullBytes",
|
|
@@ -505,6 +506,7 @@ ${groupEnd}</script>
|
|
|
505
506
|
];
|
|
506
507
|
ENABLED_FEATURES_GATE_MAP = {
|
|
507
508
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
|
509
|
+
"cms:jsr:RemoveCjsPlugin": "CMS:JSRenderer:RemoveCjsPlugin",
|
|
508
510
|
"cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules",
|
|
509
511
|
"PortalsAccessIdentity:DesignManager:UrlSigning": "PortalsAccessIdentity:DesignManager:UrlSigning"
|
|
510
512
|
};
|
|
@@ -603,7 +605,7 @@ __export(dist_exports, {
|
|
|
603
605
|
scriptTagToLogServerMessages: () => scriptTagToLogServerMessages,
|
|
604
606
|
serializeIslandDataForInlineScript: () => serializeIslandDataForInlineScript,
|
|
605
607
|
setIn: () => setIn,
|
|
606
|
-
|
|
608
|
+
ungatedIAtBuildTimeFor: () => ungatedIAtBuildTimeFor,
|
|
607
609
|
virtualClientRenderIslandModuleId: () => virtualClientRenderIslandModuleId
|
|
608
610
|
});
|
|
609
611
|
import * as dotProp from "dot-prop";
|
|
@@ -1171,8 +1173,8 @@ function GlobalPartialSlot(props) {
|
|
|
1171
1173
|
var setProperty, getProperty, hasProperty, serializeIslandDataForInlineScript, writeSharedStateToJsGlobal, createIslandsGlobalJsForClientInDev, traverse, CMS_MODULE_COMPONENT_NAME, DND_AREA_COMPONENT_NAME, PLUGIN_NAME, promiseForNewWritableStream, renderStreamToPromise, createServerRenderContextV22, createServerRenderContext2, renderServerSidePropsWithAsyncLocalStoreContext, bootStrapRenderContext;
|
|
1172
1174
|
var init_dist = __esm({
|
|
1173
1175
|
"../cms-js-internal/dist/index.js"() {
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
+
init_types_CliAmBEj();
|
|
1177
|
+
init_types_CliAmBEj();
|
|
1176
1178
|
({ setProperty, getProperty, hasProperty } = dotProp);
|
|
1177
1179
|
serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint) => {
|
|
1178
1180
|
const islandsArrayToSerialize = tweakedIslandsArray.map(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cms-dev-server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.36",
|
|
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.2.
|
|
32
|
+
"@hubspot/cms-components": "^1.2.36",
|
|
33
33
|
"@hubspot/local-dev-lib": "4.0.2",
|
|
34
34
|
"@inquirer/select": "^2.0.0",
|
|
35
35
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"publishConfig": {
|
|
134
134
|
"access": "public"
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "84ee77b1dfdfd7fd5421260de5b91edaf48157ff"
|
|
137
137
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ViteDevServer } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Processes HTML to find remote assets and replace with Vite-managed URLs
|
|
4
|
+
*/
|
|
5
|
+
export declare function processRemoteAssets(html: string, viteServer: ViteDevServer): Promise<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Vite plugin to handle remote assets
|
|
8
|
+
*/
|
|
9
|
+
export declare function remoteAssetsPlugin(): {
|
|
10
|
+
name: string;
|
|
11
|
+
apply: "serve";
|
|
12
|
+
configResolved(config: any): void;
|
|
13
|
+
resolveId(id: string): string;
|
|
14
|
+
load(id: string): Promise<string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Request, Response, NextFunction } from 'express';
|
|
2
|
+
export declare function handleGetModulePages(req: Request, res: Response, next: NextFunction): Promise<Response<any, Record<string, any>>>;
|
|
3
|
+
export declare function handleOpenFile(req: Request, res: Response, next: NextFunction): Response<any, Record<string, any>>;
|
|
4
|
+
export declare function createAppServerRoutes(): import("express-serve-static-core").Router;
|
|
5
|
+
export default createAppServerRoutes;
|