@hubspot/cms-dev-server 1.0.43 → 1.0.45
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 +2 -2
- package/dist/index.js +7 -7
- package/dist/internalSsr.js +2 -3
- package/dist/run.js +7 -7
- package/dist/storybook/index.js +1 -1
- package/dist/storybook-main/main.js +6 -7
- package/package.json +3 -3
- package/types/api/designmanager.d.ts +2 -2
- 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-ohevhxjF.js
|
|
14
14
|
import path from "path";
|
|
15
15
|
var viteRoot;
|
|
16
16
|
var viteCommand;
|
|
@@ -586,7 +586,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
|
|
|
586
586
|
}
|
|
587
587
|
const origin = process.env.VITE_ORIGIN ?? (sslEnabled ? `https://hslocal.net:${port}` : `http://hslocal.net:${port}`);
|
|
588
588
|
const consumerDeps = getDepsForPackageIfExists(webRoot);
|
|
589
|
-
const isProjectWithReact = consumerDeps.includes("@hubspot/cms-components");
|
|
589
|
+
const isProjectWithReact = consumerDeps.includes("@hubspot/cms-components") || process.env.TRANSLATE_ASSET;
|
|
590
590
|
const componentsShimPlugin = isProjectWithReact ? null : cmsComponentsShimPlugin();
|
|
591
591
|
const ssrAndOptimizeDep = isProjectWithReact ? {
|
|
592
592
|
ssr: {
|
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-ohevhxjF.js
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { createHash } from "crypto";
|
|
9
9
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -1139,7 +1139,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
|
|
|
1139
1139
|
}
|
|
1140
1140
|
const origin = process.env.VITE_ORIGIN ?? (sslEnabled ? `https://hslocal.net:${port}` : `http://hslocal.net:${port}`);
|
|
1141
1141
|
const consumerDeps = getDepsForPackageIfExists(webRoot);
|
|
1142
|
-
const isProjectWithReact = consumerDeps.includes("@hubspot/cms-components");
|
|
1142
|
+
const isProjectWithReact = consumerDeps.includes("@hubspot/cms-components") || process.env.TRANSLATE_ASSET;
|
|
1143
1143
|
const componentsShimPlugin = isProjectWithReact ? null : cmsComponentsShimPlugin();
|
|
1144
1144
|
const ssrAndOptimizeDep = isProjectWithReact ? {
|
|
1145
1145
|
ssr: {
|
|
@@ -1631,7 +1631,7 @@ function trackUsage(action) {
|
|
|
1631
1631
|
eventName: EVENT_NAME,
|
|
1632
1632
|
action,
|
|
1633
1633
|
nodeVersion: getNodeVersionData(),
|
|
1634
|
-
version: "1.0.
|
|
1634
|
+
version: "1.0.45",
|
|
1635
1635
|
os: getPlatform()
|
|
1636
1636
|
};
|
|
1637
1637
|
const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
|
@@ -3713,14 +3713,14 @@ function HubLModulesList({ modules }) {
|
|
|
3713
3713
|
// src/api/designmanager.ts
|
|
3714
3714
|
import { http as hsCliHttp8 } from "@hubspot/local-dev-lib/http";
|
|
3715
3715
|
var DESIGN_MANAGER_API_PATH = "designmanager/v1";
|
|
3716
|
-
async function fetchHubLModules(accountId, previewToken) {
|
|
3716
|
+
async function fetchHubLModules(accountId, previewToken, limit = 250) {
|
|
3717
3717
|
return (await hsCliHttp8.get(accountId, {
|
|
3718
|
-
url: `${DESIGN_MANAGER_API_PATH}/modules/local-preview?previewToken=${previewToken}`
|
|
3718
|
+
url: `${DESIGN_MANAGER_API_PATH}/modules/local-preview?previewToken=${previewToken}&limit=${limit}`
|
|
3719
3719
|
})).data;
|
|
3720
3720
|
}
|
|
3721
|
-
async function fetchPreviewTemplates(accountId, previewToken) {
|
|
3721
|
+
async function fetchPreviewTemplates(accountId, previewToken, limit = 250) {
|
|
3722
3722
|
return (await hsCliHttp8.get(accountId, {
|
|
3723
|
-
url: `${DESIGN_MANAGER_API_PATH}/templates/local-preview?previewToken=${previewToken}`
|
|
3723
|
+
url: `${DESIGN_MANAGER_API_PATH}/templates/local-preview?previewToken=${previewToken}&limit=${limit}`
|
|
3724
3724
|
})).data;
|
|
3725
3725
|
}
|
|
3726
3726
|
async function fetchModuleByPath(accountId, path17) {
|
package/dist/internalSsr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../cms-js-internal/dist/types-
|
|
1
|
+
// ../cms-js-internal/dist/types-ohevhxjF.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { createHash } from "crypto";
|
|
4
4
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -385,8 +385,7 @@ var GATES = [
|
|
|
385
385
|
"CMS:JSRenderer:ModuleHubl",
|
|
386
386
|
"CMS:JSRenderer:RemoveCjsPlugin",
|
|
387
387
|
"CMS:JSRenderer:RemoveMockClientEntryPlugin",
|
|
388
|
-
"CMS:JSRenderer:AnalyzeCmsModules"
|
|
389
|
-
"CMS:JSRenderer:CompressResponse"
|
|
388
|
+
"CMS:JSRenderer:AnalyzeCmsModules"
|
|
390
389
|
];
|
|
391
390
|
var ENABLED_FEATURES_GATE_MAP = {
|
|
392
391
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
package/dist/run.js
CHANGED
|
@@ -811,7 +811,7 @@ function packagePath(metaUrl, projectPath) {
|
|
|
811
811
|
);
|
|
812
812
|
}
|
|
813
813
|
|
|
814
|
-
// ../cms-js-internal/dist/types-
|
|
814
|
+
// ../cms-js-internal/dist/types-ohevhxjF.js
|
|
815
815
|
import path3 from "path";
|
|
816
816
|
import { createHash } from "crypto";
|
|
817
817
|
import fs2, { readFileSync, existsSync as existsSync2, readdirSync, lstatSync } from "fs";
|
|
@@ -2154,7 +2154,7 @@ function trackUsage(action) {
|
|
|
2154
2154
|
eventName: EVENT_NAME,
|
|
2155
2155
|
action,
|
|
2156
2156
|
nodeVersion: getNodeVersionData(),
|
|
2157
|
-
version: "1.0.
|
|
2157
|
+
version: "1.0.45",
|
|
2158
2158
|
os: getPlatform()
|
|
2159
2159
|
};
|
|
2160
2160
|
const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
|
@@ -4236,14 +4236,14 @@ function HubLModulesList({ modules }) {
|
|
|
4236
4236
|
// src/api/designmanager.ts
|
|
4237
4237
|
import { http as hsCliHttp8 } from "@hubspot/local-dev-lib/http";
|
|
4238
4238
|
var DESIGN_MANAGER_API_PATH = "designmanager/v1";
|
|
4239
|
-
async function fetchHubLModules(accountId, previewToken) {
|
|
4239
|
+
async function fetchHubLModules(accountId, previewToken, limit = 250) {
|
|
4240
4240
|
return (await hsCliHttp8.get(accountId, {
|
|
4241
|
-
url: `${DESIGN_MANAGER_API_PATH}/modules/local-preview?previewToken=${previewToken}`
|
|
4241
|
+
url: `${DESIGN_MANAGER_API_PATH}/modules/local-preview?previewToken=${previewToken}&limit=${limit}`
|
|
4242
4242
|
})).data;
|
|
4243
4243
|
}
|
|
4244
|
-
async function fetchPreviewTemplates(accountId, previewToken) {
|
|
4244
|
+
async function fetchPreviewTemplates(accountId, previewToken, limit = 250) {
|
|
4245
4245
|
return (await hsCliHttp8.get(accountId, {
|
|
4246
|
-
url: `${DESIGN_MANAGER_API_PATH}/templates/local-preview?previewToken=${previewToken}`
|
|
4246
|
+
url: `${DESIGN_MANAGER_API_PATH}/templates/local-preview?previewToken=${previewToken}&limit=${limit}`
|
|
4247
4247
|
})).data;
|
|
4248
4248
|
}
|
|
4249
4249
|
async function fetchModuleByPath(accountId, path18) {
|
|
@@ -4962,7 +4962,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
|
|
|
4962
4962
|
}
|
|
4963
4963
|
const origin = process.env.VITE_ORIGIN ?? (sslEnabled ? `https://hslocal.net:${port}` : `http://hslocal.net:${port}`);
|
|
4964
4964
|
const consumerDeps = getDepsForPackageIfExists(webRoot2);
|
|
4965
|
-
const isProjectWithReact = consumerDeps.includes("@hubspot/cms-components");
|
|
4965
|
+
const isProjectWithReact = consumerDeps.includes("@hubspot/cms-components") || process.env.TRANSLATE_ASSET;
|
|
4966
4966
|
const componentsShimPlugin = isProjectWithReact ? null : cmsComponentsShimPlugin();
|
|
4967
4967
|
const ssrAndOptimizeDep = isProjectWithReact ? {
|
|
4968
4968
|
ssr: {
|
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-ohevhxjF.js
|
|
12
12
|
import path from "path";
|
|
13
13
|
import { createHash } from "crypto";
|
|
14
14
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -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_ohevhxjF = __esm({
|
|
382
|
+
"../cms-js-internal/dist/types-ohevhxjF.js"() {
|
|
383
383
|
COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
|
|
384
384
|
ENTRY_POINTS_PATH = "components/partials/";
|
|
385
385
|
MODULE_FOLDER_PATH = "components/modules/";
|
|
@@ -500,8 +500,7 @@ ${groupEnd}</script>
|
|
|
500
500
|
"CMS:JSRenderer:ModuleHubl",
|
|
501
501
|
"CMS:JSRenderer:RemoveCjsPlugin",
|
|
502
502
|
"CMS:JSRenderer:RemoveMockClientEntryPlugin",
|
|
503
|
-
"CMS:JSRenderer:AnalyzeCmsModules"
|
|
504
|
-
"CMS:JSRenderer:CompressResponse"
|
|
503
|
+
"CMS:JSRenderer:AnalyzeCmsModules"
|
|
505
504
|
];
|
|
506
505
|
ENABLED_FEATURES_GATE_MAP = {
|
|
507
506
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
|
@@ -1171,8 +1170,8 @@ function GlobalPartialSlot(props) {
|
|
|
1171
1170
|
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
1171
|
var init_dist = __esm({
|
|
1173
1172
|
"../cms-js-internal/dist/index.js"() {
|
|
1174
|
-
|
|
1175
|
-
|
|
1173
|
+
init_types_ohevhxjF();
|
|
1174
|
+
init_types_ohevhxjF();
|
|
1176
1175
|
({ setProperty, getProperty, hasProperty } = dotProp);
|
|
1177
1176
|
serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint) => {
|
|
1178
1177
|
const islandsArrayToSerialize = tweakedIslandsArray.map(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cms-dev-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
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.
|
|
32
|
+
"@hubspot/cms-components": "^1.0.45",
|
|
33
33
|
"@hubspot/local-dev-lib": "3.7.1",
|
|
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": "93cd6bdd2ac0ba46472567f1a5b44f7db7b0f3c7"
|
|
137
137
|
}
|
|
@@ -36,8 +36,8 @@ export interface ModulePageDependencyData {
|
|
|
36
36
|
portalId: number;
|
|
37
37
|
subType: string;
|
|
38
38
|
}
|
|
39
|
-
export declare function fetchHubLModules(accountId: any, previewToken: any): Promise<PaginatedApiResponse<HubLModule>>;
|
|
40
|
-
export declare function fetchPreviewTemplates(accountId: any, previewToken: any): Promise<PaginatedApiResponse<HubLTemplate>>;
|
|
39
|
+
export declare function fetchHubLModules(accountId: any, previewToken: any, limit?: number): Promise<PaginatedApiResponse<HubLModule>>;
|
|
40
|
+
export declare function fetchPreviewTemplates(accountId: any, previewToken: any, limit?: number): Promise<PaginatedApiResponse<HubLTemplate>>;
|
|
41
41
|
export declare function fetchModuleByPath(accountId: number, path: string): Promise<any>;
|
|
42
42
|
export declare function fetchTemplateByPath(accountId: number, path: string): Promise<HubLTemplateData>;
|
|
43
43
|
export declare function fetchModulePageDependencies(accountId: number, path: string): Promise<ModulePageDependencyData[]>;
|
|
@@ -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;
|