Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions lib/projects/buildAndDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
import { EXIT_CODES } from '../enums/exitCodes';
import { lib } from '../../lang/en';
import { uiLogger } from '../ui/logger';
import { AppFunctionsPackageKey } from '@hubspot/project-parsing-lib/src/lib/constants';
import { mapToInternalType } from '@hubspot/project-parsing-lib';

const SPINNER_STATUS = {
SPINNING: 'spinning',
Expand Down Expand Up @@ -169,25 +171,37 @@ function makePollTaskStatusFunc<T extends ProjectTask>({

const subtasks = getSubtasks(initialTaskStatus);

const tasksById = subtasks.reduce(
(acc: { [key: string]: ProjectSubtask }, subtask) => {
const hiddenComponentBuildIds: string[] = [];

const tasksById = subtasks
.filter(subtask => {
// TODO: Remove this filtering logic when visible=false for SERVERLESS_PACKAGE
const shouldBeVisible =
getSubtaskType(subtask) !== mapToInternalType(AppFunctionsPackageKey);
if (!shouldBeVisible) {
hiddenComponentBuildIds.push(subtask.id);
}
return shouldBeVisible;
})
Comment on lines +177 to +185
Copy link
Contributor Author

@joe-yeager joe-yeager May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hopefully temporary solution to prevent the serverless-package component from showing up in the loading spinners, because it is auto generated and will be confusing for users to see it in the output.

.reduce((acc: { [key: string]: ProjectSubtask }, subtask) => {
const { id, visible } = subtask;
if (visible) {
acc[id] = subtask;
}
return acc;
},
{}
);

const structuredTasks = Object.keys(taskStructure).map(key => {
return {
...tasksById[key],
subtasks: taskStructure[key]
.filter(taskId => Boolean(tasksById[taskId]))
.map(taskId => tasksById[taskId]),
};
});
}, {});

const structuredTasks = Object.keys(taskStructure)
// TODO: Remove this filtering logic when visible=false for SERVERLESS_PACKAGE
.filter(buildId => !hiddenComponentBuildIds.includes(buildId))
.map(key => {
return {
...tasksById[key],
subtasks: taskStructure[key]
.filter(taskId => Boolean(tasksById[taskId]))
.map(taskId => tasksById[taskId]),
};
});

const numComponents = structuredTasks.length;
const componentCountText = silenceLogs
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repository": "https://github.com/HubSpot/hubspot-cli",
"dependencies": {
"@hubspot/local-dev-lib": "3.5.6",
"@hubspot/project-parsing-lib": "0.1.7",
"@hubspot/project-parsing-lib": "0.1.11",
"@hubspot/serverless-dev-runtime": "7.0.2",
"@hubspot/theme-preview-dev-server": "0.0.10",
"@hubspot/ui-extensions-dev-server": "0.8.52",
Expand Down