@hubspot/cms-dev-server 1.2.46 → 1.2.49
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/README.md +13 -1
- package/dist/.DS_Store +0 -0
- package/dist/generateJsonFromJsx.js +2 -1
- package/dist/index.js +98 -21
- package/dist/run.js +98 -21
- package/dist/validateFieldsCli.js +1324 -0
- package/package.json +6 -4
- package/types/lib/debugAuth.d.ts +2 -0
- package/types/lib/localComponentsLoader.d.ts +2 -0
- package/types/lib/previewUtils.d.ts +9 -0
- package/types/lib/renderModule.d.ts +14 -0
- package/types/lib/viteAssetHandler.d.ts +15 -0
- package/types/lib/watchFieldsUpdates.d.ts +1 -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/meta.d.ts +0 -2
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.49",
|
|
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.49",
|
|
33
33
|
"@hubspot/local-dev-lib": "5.8.2",
|
|
34
34
|
"@inquirer/select": "^2.0.0",
|
|
35
35
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"copyfiles": "^2.4.1",
|
|
87
87
|
"esbuild": "^0.16.17",
|
|
88
88
|
"fs-extra": "^11.2.0",
|
|
89
|
+
"msw": "2.13.3",
|
|
89
90
|
"nodemon": "^2.0.15",
|
|
90
91
|
"postcss": "^8.4.47",
|
|
91
92
|
"publint": "^0.2.7",
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"types": "types/index.d.ts",
|
|
109
110
|
"bin": {
|
|
110
111
|
"hs-cms-dev-server": "./dist/run.js",
|
|
111
|
-
"jsx-module-fields-to-fields-json": "./dist/generateJsonFromJsx.js"
|
|
112
|
+
"jsx-module-fields-to-fields-json": "./dist/generateJsonFromJsx.js",
|
|
113
|
+
"validate-fields": "./dist/validateFieldsCli.js"
|
|
112
114
|
},
|
|
113
115
|
"files": [
|
|
114
116
|
"dist/**/*",
|
|
@@ -133,5 +135,5 @@
|
|
|
133
135
|
"publishConfig": {
|
|
134
136
|
"access": "public"
|
|
135
137
|
},
|
|
136
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "b7023ef3d880c4933ab3f1fc73a65442f7ab9059"
|
|
137
139
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export declare const removePreviewPrefix: (t: string) => string;
|
|
2
2
|
export declare const getPreviewUrl: (request: any, queryParams: any) => string;
|
|
3
3
|
export declare const buildHTMLResponse: (content: any) => string;
|
|
4
|
+
/**
|
|
5
|
+
* HTML-encodes characters that could allow a URL to break out of an attribute value and inject
|
|
6
|
+
* markup into the response. Applied to every URL placed in a `src` attribute so that even if
|
|
7
|
+
* `isSafeUrlParam` validation is bypassed or a URL is constructed from a future code path that
|
|
8
|
+
* skips it, the injected script tag cannot introduce XSS.
|
|
9
|
+
*/
|
|
10
|
+
export declare function escapeHtml(s: string): string;
|
|
11
|
+
export declare function buildStaticAssetUrl(pkg: string, filePath: string, isLocal: boolean, version: string | null, branch: string | null): string;
|
|
12
|
+
export declare const addScriptInjectionBootstrapper: (html: string, query: Record<string, any>) => string;
|
|
4
13
|
export declare const addRefreshScript: (html: string) => string;
|
|
5
14
|
export declare function buildDevFileHashTable(src: string, dest: string, filePaths: string[]): {};
|
|
6
15
|
export declare type ThemePreviewOptions = {
|
|
@@ -5,6 +5,20 @@ import { ModuleProps } from '@hubspot/cms-components';
|
|
|
5
5
|
import { RenderResult } from '../lib/renderComponentWithCSS.js';
|
|
6
6
|
export declare const VALIDATE_FIELDS_ENDPOINT = "/designmanager/v1/modules/validate-fields";
|
|
7
7
|
export declare const VALIDATE_META_ENDPOINT = "/designmanager/v1/modules/validate-meta";
|
|
8
|
+
export declare type FieldValidationResponseBody = {
|
|
9
|
+
errorType: string;
|
|
10
|
+
message: string;
|
|
11
|
+
severity: string;
|
|
12
|
+
succeeded: boolean;
|
|
13
|
+
status: string;
|
|
14
|
+
errorTokens: {
|
|
15
|
+
field: Array<string>;
|
|
16
|
+
path: Array<string>;
|
|
17
|
+
type: Array<string>;
|
|
18
|
+
uiattribute: Array<string>;
|
|
19
|
+
value: Array<string>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
8
22
|
export declare const getApplyValidationToRenderContext: (portalId: any, fieldsJSON: any, metaJSON: any, requestedModulePath: any) => (renderResult: RenderResult) => Promise<RenderResult>;
|
|
9
23
|
export declare const lookForModuleInFolder: (modulePath: string, viteServer: ViteDevServer) => Promise<[any, string]>;
|
|
10
24
|
declare function renderModule(viteServer: ViteDevServer, requestedModulePath: string, moduleProps: ModuleProps, pageUrl: string, basePath: string, environmentConfig: EnvironmentConfig, renderOptions?: RenderToPipeableStreamOptions): Promise<RenderResult>;
|
|
@@ -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
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Field } from '@hubspot/cms-components/fields';
|
|
2
2
|
import { ViteDevServer } from 'vite';
|
|
3
3
|
export declare const formatAsTypeName: (str: string) => string;
|
|
4
|
+
export declare const fileContainsAutoGenComment: (filePath: string) => Promise<boolean>;
|
|
4
5
|
/**
|
|
5
6
|
* If the filePath file is in the modules folder, find and return the closest index file.
|
|
6
7
|
* If the filePath that was updated in modules root, return that path instead.
|
|
@@ -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;
|
package/types/routes/meta.d.ts
DELETED