@hubspot/cms-dev-server 0.18.11 → 0.18.13
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/index.js +258 -75
- package/dist/run.js +283 -93
- package/package.json +3 -4
- package/types/api/designmanager.d.ts +8 -0
- package/types/components/HubLTemplatesList.d.ts +1 -0
- package/types/createAppServer.d.ts +1 -1
- package/types/lib/getDevServerUIData.d.ts +14 -3
- package/types/lib/getFieldValuesForModule.d.ts +2 -0
- package/types/lib/renderModuleFieldsJson.d.ts +4 -0
- package/types/lib/renderModulePreview.d.ts +1 -1
- package/types/routes/moduleFieldsJson.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cms-dev-server",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.13",
|
|
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": "^0.18.
|
|
32
|
+
"@hubspot/cms-components": "^0.18.13",
|
|
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",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"@storybook/addon-essentials": "7.1.1",
|
|
42
42
|
"@storybook/addon-interactions": "7.1.1",
|
|
43
43
|
"@storybook/addon-links": "7.1.1",
|
|
44
|
-
"@storybook/cli": "7.1.1",
|
|
45
44
|
"@storybook/react": "7.1.1",
|
|
46
45
|
"@storybook/react-vite": "7.1.1",
|
|
47
46
|
"@storybook/testing-library": "^0.0.13",
|
|
@@ -131,5 +130,5 @@
|
|
|
131
130
|
"publishConfig": {
|
|
132
131
|
"access": "public"
|
|
133
132
|
},
|
|
134
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "7aa0c0b1d55439d9914b03d34a44aea668f88254"
|
|
135
134
|
}
|
|
@@ -24,8 +24,16 @@ export interface HubLModuleData {
|
|
|
24
24
|
previewKey: string;
|
|
25
25
|
moduleId: string;
|
|
26
26
|
}
|
|
27
|
+
export interface ModulePageDependencyData {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
errors?: string[];
|
|
31
|
+
portalId: number;
|
|
32
|
+
subType: string;
|
|
33
|
+
}
|
|
27
34
|
export declare function fetchHubLModules(accountId: any, previewToken: any): Promise<PaginatedApiResponse<HubLModule>>;
|
|
28
35
|
export declare function fetchPreviewTemplates(accountId: any, previewToken: any): Promise<PaginatedApiResponse<HubLTemplate>>;
|
|
29
36
|
export declare function fetchModuleByPath(accountId: number, path: string): Promise<any>;
|
|
30
37
|
export declare function fetchTemplateByPath(accountId: number, path: string): Promise<HubLTemplateData>;
|
|
38
|
+
export declare function fetchModulePageDependencies(accountId: number, path: string): Promise<ModulePageDependencyData[]>;
|
|
31
39
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RequestLocals } from './lib/getDevServerUIData.js';
|
|
2
|
-
declare function createAppServer(webRoot: any, reqLocals: RequestLocals, port: any): Promise<import("express-serve-static-core").Express>;
|
|
2
|
+
declare function createAppServer(webRoot: any, reqLocals: Omit<RequestLocals, 'viteServer'>, port: any): Promise<import("express-serve-static-core").Express>;
|
|
3
3
|
export default createAppServer;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { HubLModule, HubLTemplate } from '../api/designmanager.js';
|
|
2
|
+
export interface ModuleData {
|
|
3
|
+
name: string;
|
|
4
|
+
nameWithExtension: string;
|
|
5
|
+
subPath?: string;
|
|
6
|
+
fieldsJson: any;
|
|
7
|
+
}
|
|
8
|
+
export interface PartialData {
|
|
9
|
+
name: string;
|
|
10
|
+
subPath: string;
|
|
11
|
+
}
|
|
2
12
|
export interface DevServerUIData {
|
|
3
13
|
authedPortalId: number;
|
|
4
14
|
projectName: string;
|
|
5
|
-
|
|
6
|
-
|
|
15
|
+
modulesData: ModuleData[];
|
|
16
|
+
partialsData: PartialData[];
|
|
7
17
|
hubLModules: HubLModule[];
|
|
8
18
|
hubLTemplates: HubLTemplate[];
|
|
9
|
-
|
|
19
|
+
themeWebRoot: string;
|
|
10
20
|
[key: string]: any;
|
|
11
21
|
}
|
|
12
22
|
export interface RequestLocals {
|
|
@@ -17,6 +27,7 @@ export interface RequestLocals {
|
|
|
17
27
|
projectName: string;
|
|
18
28
|
webRootProjectComponentFolder: string;
|
|
19
29
|
localPreviewToken: string;
|
|
30
|
+
viteServer: any;
|
|
20
31
|
}
|
|
21
32
|
export declare function getDevServerUIData(reqLocals: RequestLocals): Promise<DevServerUIData>;
|
|
22
33
|
export default getDevServerUIData;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ViteDevServer } from 'vite';
|
|
2
|
+
export declare const lookForModuleInFolder: (modulePath: string, viteServer: ViteDevServer) => Promise<[any, string]>;
|
|
3
|
+
declare function renderModuleFieldsJson(viteServer: ViteDevServer, requestedModulePath: string): Promise<any>;
|
|
4
|
+
export default renderModuleFieldsJson;
|
|
@@ -2,4 +2,4 @@ export declare function renderRemoteModulePreview(modulePath: string, authedPort
|
|
|
2
2
|
html: string;
|
|
3
3
|
cssNeeded: string;
|
|
4
4
|
}>;
|
|
5
|
-
export declare function renderLocalProjectModulePreview(moduleName: string, authedPortalId: any, authedEnv: any, authedHublet: any, webRoot: any, viteServer: any, jsRenderingGates: any, projectName: any, projectComponentPath: any, fullOriginalUrl: any, cookieValue: any): Promise<import("./renderComponentWithCSS.js").RenderResult>;
|
|
5
|
+
export declare function renderLocalProjectModulePreview(moduleName: string, authedPortalId: any, authedEnv: any, authedHublet: any, webRoot: any, viteServer: any, jsRenderingGates: any, projectName: any, projectComponentPath: any, fullOriginalUrl: any, cookieValue: any, fieldOverrides?: {}): Promise<import("./renderComponentWithCSS.js").RenderResult>;
|