Skip to content

Commit

Permalink
Merge branch 'master' into swap-cli-lib-deps-4
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Nov 30, 2023
2 parents 6dea74b + 16cc4bd commit 46e0acd
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 9 deletions.
8 changes: 7 additions & 1 deletion packages/cli/commands/cms/convertFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
} = require('@hubspot/cli-lib/lib/handleFieldsJs');

const { trackConvertFieldsUsage } = require('../../lib/usageTracking');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const i18nKey = 'cli.commands.convertFields';

exports.command = 'convert-fields';
Expand Down Expand Up @@ -54,7 +55,12 @@ exports.handler = async options => {
if (fieldsJs.rejected) return;
fieldsJs.saveOutput();
} else if (stats.isDirectory()) {
const filePaths = await walk(src);
let filePaths = [];
try {
filePaths = await walk(src);
} catch (e) {
logErrorInstance(e);
}
const allowedFilePaths = filePaths
.filter(file => {
if (!isAllowedExtension(file)) {
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/lib/projectStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fs = require('fs');
const path = require('path');
const { walk } = require('@hubspot/local-dev-lib/fs');
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('./errorHandlers/standardErrors');

const COMPONENT_TYPES = Object.freeze({
app: 'app',
Expand Down Expand Up @@ -73,8 +74,13 @@ function getIsLegacyApp(appConfig, appPath) {

async function findProjectComponents(projectSourceDir) {
const components = [];
let projectFiles = [];

const projectFiles = await walk(projectSourceDir);
try {
projectFiles = await walk(projectSourceDir);
} catch (e) {
logErrorInstance(e);
}

projectFiles.forEach(projectFile => {
// Find app components
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ const { createIgnoreFilter } = require('@hubspot/local-dev-lib/ignoreRules');
const { fieldsJsPrompt } = require('../lib/prompts/cmsFieldPrompt');
const { isAllowedExtension } = require('@hubspot/cli-lib/path');
const { isConvertableFieldJs } = require('@hubspot/cli-lib/lib/handleFieldsJs');
const { logErrorInstance } = require('./errorHandlers/standardErrors');

/*
* Walks the src folder for files, filters them based on ignore filter.
* If convertFields is true then will check for any JS fields conflicts (i.e., JS fields file and fields.json file) and prompt to resolve
*/
const getUploadableFileList = async (src, convertFields) => {
const filePaths = await walk(src);
let filePaths = [];
try {
filePaths = await walk(src);
} catch (e) {
logErrorInstance(e);
}
const allowedFiles = filePaths
.filter(file => {
if (!isAllowedExtension(file)) {
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/lib/usageTracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,14 @@ const trackAuthAction = async (command, authType, step, accountId) => {
step,
};
try {
const response = await trackUsage(
await trackUsage(
'cli-interaction',
EventClass.INTERACTION,
usageTrackingEvent,
accountId
);

logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);

return response;
} catch (e) {
logger.debug('Auth action tracking failed: %s', e.message);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@hubspot/cli-lib": "^7.0.0",
"@hubspot/local-dev-lib": "^0.0.10",
"@hubspot/local-dev-lib": "^0.0.11",
"@hubspot/serverless-dev-runtime": "5.0.3-beta.1",
"@hubspot/ui-extensions-dev-server": "^0.8.0",
"archiver": "^5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-dev-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "Apache-2.0",
"dependencies": {
"@hubspot/cli-lib": "^7.0.0",
"@hubspot/local-dev-lib": "^0.0.10",
"@hubspot/local-dev-lib": "^0.0.11",
"body-parser": "^1.19.0",
"chalk": "^4.1.0",
"chokidar": "^3.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cms-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@hubspot/cli-lib": "^7.0.0",
"@hubspot/local-dev-lib": "^0.0.10"
"@hubspot/local-dev-lib": "^0.0.11"
},
"gitHead": "0659fd19cabc3645af431b177c11d0c1b089e0f8"
}

0 comments on commit 46e0acd

Please sign in to comment.