@hubspot/local-dev-lib 3.5.5 → 3.5.6
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.
|
@@ -3,10 +3,10 @@ export declare class FieldsJs {
|
|
|
3
3
|
filePath: string;
|
|
4
4
|
rootWriteDir: string;
|
|
5
5
|
rejected: boolean;
|
|
6
|
-
fieldOptions: string;
|
|
6
|
+
fieldOptions: string | string[];
|
|
7
7
|
outputPath?: string;
|
|
8
8
|
toJSON?: () => JSON;
|
|
9
|
-
constructor(projectDir: string, filePath: string, rootWriteDir?: string | null, fieldOptions?: string);
|
|
9
|
+
constructor(projectDir: string, filePath: string, rootWriteDir?: string | null, fieldOptions?: string | string[]);
|
|
10
10
|
init(): Promise<this>;
|
|
11
11
|
convertFieldsJs(writeDir: string): Promise<string | void>;
|
|
12
12
|
/**
|
|
@@ -42,11 +42,14 @@ class FieldsJs {
|
|
|
42
42
|
const filePath = this.filePath;
|
|
43
43
|
const dirName = path_1.default.dirname(filePath);
|
|
44
44
|
return new Promise((resolve, reject) => {
|
|
45
|
+
const fieldOptionsAsString = Array.isArray(this.fieldOptions)
|
|
46
|
+
? this.fieldOptions.join(',')
|
|
47
|
+
: this.fieldOptions;
|
|
45
48
|
const convertFieldsProcess = (0, child_process_1.fork)(path_1.default.join(__dirname, './processFieldsJs.js'), [], {
|
|
46
49
|
cwd: dirName,
|
|
47
50
|
env: {
|
|
48
51
|
dirName,
|
|
49
|
-
fieldOptions:
|
|
52
|
+
fieldOptions: fieldOptionsAsString,
|
|
50
53
|
filePath,
|
|
51
54
|
writeDir,
|
|
52
55
|
},
|
package/lib/cms/modules.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PathInput, ValidationResult, ModuleDefinition } from '../../types/Modules';
|
|
2
|
+
import { GithubRepoFile } from '../../types/Github';
|
|
2
3
|
export declare const ValidationIds: {
|
|
3
4
|
SRC_REQUIRED: string;
|
|
4
5
|
DEST_REQUIRED: string;
|
|
@@ -10,5 +11,6 @@ export declare function validateSrcAndDestPaths(src?: PathInput, dest?: PathInpu
|
|
|
10
11
|
export declare function createModule(moduleDefinition: ModuleDefinition, name: string, dest: string, getInternalVersion: boolean, options?: {
|
|
11
12
|
allowExistingDir: boolean;
|
|
12
13
|
}): Promise<void>;
|
|
13
|
-
export declare function retrieveDefaultModule(
|
|
14
|
+
export declare function retrieveDefaultModule(): Promise<GithubRepoFile[]>;
|
|
15
|
+
export declare function retrieveDefaultModule(name: string, dest: string): Promise<void>;
|
|
14
16
|
export declare const isModuleHTMLFile: (filePath: string) => boolean;
|
package/lib/cms/modules.js
CHANGED
|
@@ -189,9 +189,11 @@ async function retrieveDefaultModule(name, dest) {
|
|
|
189
189
|
const defaultReactModules = await (0, github_1.listGithubRepoContents)('HubSpot/cms-react', 'default-react-modules/src/components/modules/', 'dir');
|
|
190
190
|
return defaultReactModules;
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
if (dest) {
|
|
193
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-react', dest, {
|
|
194
|
+
sourceDir: `default-react-modules/src/components/modules/${name}`,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
195
197
|
}
|
|
196
198
|
exports.retrieveDefaultModule = retrieveDefaultModule;
|
|
197
199
|
const MODULE_HTML_EXTENSION_REGEX = new RegExp(/\.module(?:\/|\\)module\.html$/);
|
|
@@ -118,7 +118,7 @@ class HubSpotHttpError extends Error {
|
|
|
118
118
|
if (message) {
|
|
119
119
|
errorMessages.push(message);
|
|
120
120
|
}
|
|
121
|
-
if (errors) {
|
|
121
|
+
if (Array.isArray(errors)) {
|
|
122
122
|
const specificErrors = errors.map(error => {
|
|
123
123
|
let errorMessage = error.message;
|
|
124
124
|
if (error.context?.requiredScopes) {
|
package/package.json
CHANGED