@hubspot/cli 7.11.8-experimental.0 → 8.0.0-beta.1
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/api/__tests__/migrate.test.js +19 -1
- package/api/migrate.d.ts +1 -1
- package/api/migrate.js +2 -1
- package/bin/cli.js +12 -27
- package/commands/__tests__/customObject.test.js +0 -2
- package/commands/__tests__/doctor.test.js +0 -2
- package/commands/__tests__/getStarted.test.js +0 -4
- package/commands/__tests__/project.test.js +0 -4
- package/commands/__tests__/upgrade.test.js +309 -0
- package/commands/account/__tests__/auth.test.js +180 -0
- package/commands/account/__tests__/list.test.js +128 -3
- package/commands/account/__tests__/rename.test.js +0 -2
- package/commands/account/__tests__/use.test.js +138 -0
- package/commands/account/auth.js +1 -1
- package/commands/account/clean.js +4 -3
- package/commands/account/createOverride.js +3 -2
- package/commands/account/info.js +2 -2
- package/commands/account/list.js +4 -4
- package/commands/account/remove.js +3 -2
- package/commands/account/removeOverride.js +3 -2
- package/commands/account/use.js +4 -3
- package/commands/app/__tests__/migrate.test.js +8 -25
- package/commands/app/migrate.js +10 -16
- package/commands/app/secret/__tests__/add.test.js +112 -0
- package/commands/app/secret/add.js +13 -13
- package/commands/auth.js +8 -2
- package/commands/cms/__tests__/fetch.test.js +114 -15
- package/commands/cms/__tests__/upload.test.js +308 -0
- package/commands/cms/__tests__/watch.test.js +212 -0
- package/commands/cms/app/create.js +2 -3
- package/commands/cms/convertFields.js +1 -1
- package/commands/cms/fetch.js +3 -2
- package/commands/cms/function/deploy.js +2 -2
- package/commands/cms/function/list.js +2 -3
- package/commands/cms/lighthouseScore.js +19 -27
- package/commands/cms/module/marketplace-validate.js +0 -1
- package/commands/cms/theme/__tests__/preview.test.js +2 -8
- package/commands/cms/theme/create.js +1 -1
- package/commands/cms/theme/marketplace-validate.js +0 -1
- package/commands/cms/theme/preview.d.ts +0 -1
- package/commands/cms/theme/preview.js +12 -52
- package/commands/cms/upload.js +3 -3
- package/commands/cms/watch.js +3 -3
- package/commands/customObject.js +0 -2
- package/commands/doctor.js +10 -2
- package/commands/filemanager/__tests__/upload.test.js +161 -0
- package/commands/getStarted.js +13 -3
- package/commands/hubdb/__tests__/list.test.js +0 -9
- package/commands/hubdb/list.js +6 -8
- package/commands/init.js +8 -2
- package/commands/mcp/__tests__/start.test.js +113 -3
- package/commands/mcp/setup.js +0 -7
- package/commands/mcp/start.d.ts +1 -1
- package/commands/mcp/start.js +0 -7
- package/commands/project/__tests__/add.test.js +0 -2
- package/commands/project/__tests__/create.test.js +2 -2
- package/commands/project/__tests__/deploy.test.js +0 -4
- package/commands/project/__tests__/dev.test.js +273 -0
- package/commands/project/__tests__/devUnifiedFlow.test.js +2 -5
- package/commands/project/__tests__/installDeps.test.js +0 -2
- package/commands/project/__tests__/lint.test.js +0 -5
- package/commands/project/__tests__/logs.test.js +24 -31
- package/commands/project/__tests__/migrate.test.js +7 -12
- package/commands/project/__tests__/updateDeps.test.js +0 -2
- package/commands/project/__tests__/upload.test.js +191 -0
- package/commands/project/__tests__/validate.test.js +314 -31
- package/commands/project/cloneApp.d.ts +1 -7
- package/commands/project/cloneApp.js +1 -149
- package/commands/project/create.js +3 -4
- package/commands/project/deploy.js +18 -7
- package/commands/project/dev/deprecatedFlow.js +0 -2
- package/commands/project/dev/index.js +23 -11
- package/commands/project/dev/unifiedFlow.d.ts +1 -1
- package/commands/project/dev/unifiedFlow.js +1 -4
- package/commands/project/list.js +4 -4
- package/commands/project/listBuilds.js +2 -7
- package/commands/project/logs.js +19 -12
- package/commands/project/migrate.js +3 -3
- package/commands/project/profile/add.js +1 -1
- package/commands/project/profile/delete.js +1 -1
- package/commands/project/upload.d.ts +1 -1
- package/commands/project/upload.js +13 -4
- package/commands/project/validate.js +85 -13
- package/commands/project/watch.js +7 -7
- package/commands/project.js +0 -4
- package/commands/sandbox/__tests__/create.test.js +0 -2
- package/commands/secret/__tests__/addSecret.test.js +140 -7
- package/commands/secret/addSecret.js +3 -1
- package/commands/testAccount/__tests__/create.test.js +6 -1
- package/commands/testAccount/__tests__/importData.test.js +0 -1
- package/commands/testAccount/create.d.ts +1 -0
- package/commands/testAccount/create.js +13 -5
- package/commands/upgrade.d.ts +8 -0
- package/commands/upgrade.js +119 -0
- package/lang/en.d.ts +88 -10
- package/lang/en.js +105 -26
- package/lib/__tests__/buildAccount.test.js +0 -13
- package/lib/__tests__/cliUpgradeUtils.test.js +131 -0
- package/lib/__tests__/commonOpts.test.js +0 -1
- package/lib/__tests__/dependencyManagement.test.js +633 -13
- package/lib/__tests__/developerTestAccounts.test.js +0 -1
- package/lib/__tests__/hasFeature.test.js +0 -6
- package/lib/__tests__/importData.test.js +0 -1
- package/lib/__tests__/npmCli.test.js +84 -0
- package/lib/__tests__/oauth.test.js +1 -11
- package/lib/__tests__/process.test.js +0 -1
- package/lib/__tests__/sandboxSync.test.js +0 -1
- package/lib/__tests__/sandboxes.test.js +0 -1
- package/lib/__tests__/serverlessLogs.test.js +0 -1
- package/lib/__tests__/usageTracking.test.js +39 -6
- package/lib/__tests__/validation.test.js +0 -1
- package/lib/app/__tests__/migrate.test.js +137 -12
- package/lib/app/migrate.d.ts +5 -2
- package/lib/app/migrate.js +30 -11
- package/lib/app/urls.d.ts +1 -1
- package/lib/buildAccount.d.ts +1 -1
- package/lib/cliUpgradeUtils.d.ts +22 -0
- package/lib/cliUpgradeUtils.js +62 -0
- package/lib/cmsAssets/api-sample.js +2 -5
- package/lib/cmsAssets/function.js +1 -9
- package/lib/cmsAssets/module.js +1 -9
- package/lib/cmsAssets/template.js +1 -9
- package/lib/configOptions.d.ts +0 -1
- package/lib/configOptions.js +1 -5
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +10 -4
- package/lib/dependencyManagement.d.ts +9 -0
- package/lib/dependencyManagement.js +127 -26
- package/lib/developerTestAccounts.d.ts +1 -1
- package/lib/doctor/Diagnosis.d.ts +1 -0
- package/lib/doctor/Diagnosis.js +7 -0
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +2 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +8 -4
- package/lib/doctor/Doctor.d.ts +12 -0
- package/lib/doctor/Doctor.js +283 -33
- package/lib/doctor/__tests__/Diagnosis.test.js +1 -0
- package/lib/doctor/__tests__/Doctor.test.js +201 -51
- package/lib/errorHandlers/__tests__/index.test.d.ts +1 -0
- package/lib/errorHandlers/__tests__/index.test.js +278 -0
- package/lib/errorHandlers/index.d.ts +1 -0
- package/lib/errorHandlers/index.js +14 -2
- package/lib/http.js +3 -1
- package/lib/links.js +2 -3
- package/lib/mcp/__tests__/setup.test.js +69 -2
- package/lib/mcp/setup.d.ts +1 -0
- package/lib/mcp/setup.js +37 -4
- package/lib/middleware/__tests__/configMiddleware.test.js +1 -43
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.js +44 -0
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.js +0 -5
- package/lib/middleware/autoUpdateMiddleware.js +58 -57
- package/lib/middleware/configMiddleware.d.ts +0 -3
- package/lib/middleware/configMiddleware.js +0 -11
- package/lib/middleware/fireAlarmMiddleware.js +1 -1
- package/lib/middleware/spinniesMiddleware.d.ts +1 -0
- package/lib/middleware/spinniesMiddleware.js +4 -0
- package/lib/middleware/usageTrackingMiddleware.d.ts +13 -0
- package/lib/middleware/usageTrackingMiddleware.js +16 -0
- package/lib/{npm.d.ts → npm/npmCli.d.ts} +8 -3
- package/lib/npm/npmCli.js +59 -0
- package/lib/npm/packageJson.d.ts +24 -0
- package/lib/npm/packageJson.js +102 -0
- package/lib/npm/workspaces.d.ts +12 -0
- package/lib/npm/workspaces.js +48 -0
- package/lib/oauth.js +1 -3
- package/lib/projects/__tests__/AppDevModeInterface.test.js +40 -18
- package/lib/projects/__tests__/DevServerManager.test.js +1 -0
- package/lib/projects/__tests__/DevSessionManager.test.d.ts +1 -0
- package/lib/projects/__tests__/DevSessionManager.test.js +250 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +19 -6
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +0 -2
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +0 -1
- package/lib/projects/__tests__/components.test.js +6 -22
- package/lib/projects/__tests__/deploy.test.js +0 -1
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +3 -5
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.d.ts +1 -0
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.js +328 -0
- package/lib/projects/__tests__/projectProfiles.test.d.ts +1 -0
- package/lib/projects/__tests__/projectProfiles.test.js +441 -0
- package/lib/projects/__tests__/projects.test.js +0 -1
- package/lib/projects/__tests__/structure.test.js +0 -1
- package/lib/projects/__tests__/uieLinting.test.js +2 -11
- package/lib/projects/__tests__/upload.test.js +104 -3
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +0 -2
- package/lib/projects/add/__tests__/v2AddComponent.test.js +2 -4
- package/lib/projects/add/v2AddComponent.js +2 -3
- package/lib/projects/components.d.ts +1 -1
- package/lib/projects/components.js +4 -4
- package/lib/projects/create/__tests__/legacy.test.js +0 -1
- package/lib/projects/create/__tests__/v2.test.js +0 -1
- package/lib/projects/create/v2.d.ts +1 -1
- package/lib/projects/create/v2.js +1 -1
- package/lib/projects/ensureProjectExists.js +0 -1
- package/lib/projects/localDev/AppDevModeInterface.js +9 -2
- package/lib/projects/localDev/DevSessionManager.d.ts +18 -0
- package/lib/projects/localDev/DevSessionManager.js +95 -0
- package/lib/projects/localDev/LocalDevLogger.d.ts +4 -0
- package/lib/projects/localDev/LocalDevLogger.js +18 -7
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.d.ts +4 -3
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +23 -12
- package/lib/projects/localDev/LocalDevProcess.d.ts +2 -1
- package/lib/projects/localDev/LocalDevProcess.js +18 -7
- package/lib/projects/localDev/LocalDevState.d.ts +3 -2
- package/lib/projects/localDev/helpers/account.d.ts +1 -1
- package/lib/projects/localDev/helpers/devSessionsApi.d.ts +9 -0
- package/lib/projects/localDev/helpers/devSessionsApi.js +19 -0
- package/lib/projects/localDev/helpers/project.d.ts +1 -1
- package/lib/projects/localDev/helpers/project.js +1 -2
- package/lib/projects/pollProjectBuildAndDeploy.js +4 -5
- package/lib/projects/projectProfiles.d.ts +17 -0
- package/lib/projects/projectProfiles.js +140 -0
- package/lib/projects/structure.d.ts +1 -1
- package/lib/projects/uieLinting.js +6 -8
- package/lib/projects/upload.d.ts +9 -1
- package/lib/projects/upload.js +11 -5
- package/lib/projects/urls.d.ts +1 -0
- package/lib/projects/urls.js +3 -3
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.js +8 -4
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +2 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +19 -13
- package/lib/sandboxSync.d.ts +1 -1
- package/lib/sandboxes.d.ts +1 -1
- package/lib/serverlessLogs.js +0 -1
- package/lib/theme/__tests__/migrate.test.js +12 -4
- package/lib/theme/migrate.js +2 -3
- package/lib/ui/__tests__/SpinniesManager.test.js +0 -1
- package/lib/usageTracking.js +18 -0
- package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateFunctionTool.js +2 -1
- package/mcp-server/tools/cms/HsCreateModuleTool.js +2 -1
- package/mcp-server/tools/cms/HsCreateTemplateTool.js +2 -1
- package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -2
- package/mcp-server/tools/cms/HsListFunctionsTool.js +2 -2
- package/mcp-server/tools/cms/HsListTool.js +2 -2
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsListTool.test.js +4 -4
- package/mcp-server/tools/project/AddFeatureToProjectTool.js +4 -3
- package/mcp-server/tools/project/CreateProjectTool.js +4 -3
- package/mcp-server/tools/project/CreateTestAccountTool.d.ts +7 -2
- package/mcp-server/tools/project/CreateTestAccountTool.js +19 -9
- package/mcp-server/tools/project/DocFetchTool.js +2 -1
- package/mcp-server/tools/project/DocsSearchTool.js +2 -1
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +4 -4
- package/mcp-server/tools/project/GetApplicationInfoTool.js +5 -5
- package/mcp-server/tools/project/GetConfigValuesTool.js +2 -1
- package/mcp-server/tools/project/UploadProjectTools.js +6 -3
- package/mcp-server/tools/project/ValidateProjectTool.js +2 -1
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.js +4 -2
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +4 -2
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +23 -4
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +0 -1
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +4 -2
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +8 -5
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +7 -3
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +17 -3
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +3 -1
- package/mcp-server/utils/__tests__/content.test.js +0 -3
- package/mcp-server/utils/__tests__/feedbackTracking.test.js +0 -3
- package/mcp-server/utils/__tests__/project.test.js +65 -4
- package/mcp-server/utils/project.js +6 -2
- package/package.json +15 -17
- package/types/Cms.d.ts +1 -1
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +3 -2
- package/types/PackageJson.d.ts +10 -0
- package/types/PackageJson.js +1 -0
- package/types/ProjectComponents.d.ts +1 -1
- package/ui/components/BoxWithTitle.js +1 -1
- package/ui/components/Table.d.ts +89 -0
- package/ui/components/Table.js +246 -0
- package/ui/lib/table.d.ts +2 -0
- package/ui/lib/table.js +11 -0
- package/ui/playground/Playground.d.ts +5 -0
- package/ui/{views/UiSandbox.js → playground/Playground.js} +4 -4
- package/ui/{lib/ui-testing-utils.d.ts → playground/fixtures.d.ts} +1 -1
- package/ui/{lib/ui-testing-utils.js → playground/fixtures.js} +33 -1
- package/ui/render.d.ts +19 -0
- package/ui/render.js +44 -0
- package/commands/__tests__/create.test.js +0 -53
- package/commands/create.d.ts +0 -4
- package/commands/create.js +0 -137
- package/commands/customObject/__tests__/schema.test.js +0 -53
- package/commands/customObject/schema/create.d.ts +0 -4
- package/commands/customObject/schema/create.js +0 -34
- package/commands/customObject/schema/delete.d.ts +0 -4
- package/commands/customObject/schema/delete.js +0 -37
- package/commands/customObject/schema/fetch-all.d.ts +0 -4
- package/commands/customObject/schema/fetch-all.js +0 -32
- package/commands/customObject/schema/fetch.d.ts +0 -4
- package/commands/customObject/schema/fetch.js +0 -36
- package/commands/customObject/schema/list.d.ts +0 -4
- package/commands/customObject/schema/list.js +0 -26
- package/commands/customObject/schema/update.d.ts +0 -4
- package/commands/customObject/schema/update.js +0 -39
- package/commands/customObject/schema.d.ts +0 -3
- package/commands/customObject/schema.js +0 -31
- package/commands/fetch.d.ts +0 -4
- package/commands/fetch.js +0 -52
- package/commands/function/deploy.d.ts +0 -4
- package/commands/function/deploy.js +0 -31
- package/commands/function/list.d.ts +0 -4
- package/commands/function/list.js +0 -33
- package/commands/function/server.d.ts +0 -4
- package/commands/function/server.js +0 -57
- package/commands/function.d.ts +0 -3
- package/commands/function.js +0 -32
- package/commands/lint.d.ts +0 -4
- package/commands/lint.js +0 -31
- package/commands/list.d.ts +0 -4
- package/commands/list.js +0 -31
- package/commands/logs.d.ts +0 -4
- package/commands/logs.js +0 -58
- package/commands/module/marketplace-validate.d.ts +0 -4
- package/commands/module/marketplace-validate.js +0 -31
- package/commands/module.d.ts +0 -3
- package/commands/module.js +0 -23
- package/commands/mv.d.ts +0 -4
- package/commands/mv.js +0 -35
- package/commands/project/__tests__/migrateApp.test.js +0 -78
- package/commands/project/migrateApp.d.ts +0 -4
- package/commands/project/migrateApp.js +0 -55
- package/commands/remove.d.ts +0 -4
- package/commands/remove.js +0 -31
- package/commands/theme/generate-selectors.d.ts +0 -4
- package/commands/theme/generate-selectors.js +0 -30
- package/commands/theme/marketplace-validate.d.ts +0 -4
- package/commands/theme/marketplace-validate.js +0 -33
- package/commands/theme/preview.d.ts +0 -4
- package/commands/theme/preview.js +0 -59
- package/commands/theme.d.ts +0 -3
- package/commands/theme.js +0 -29
- package/commands/upload.d.ts +0 -4
- package/commands/upload.js +0 -62
- package/commands/watch.d.ts +0 -4
- package/commands/watch.js +0 -73
- package/lib/__tests__/npm.test.js +0 -57
- package/lib/__tests__/projectProfiles.test.js +0 -129
- package/lib/app/__tests__/migrate_legacy.test.js +0 -143
- package/lib/app/migrate_legacy.d.ts +0 -4
- package/lib/app/migrate_legacy.js +0 -121
- package/lib/npm.js +0 -33
- package/lib/projectProfiles.d.ts +0 -7
- package/lib/projectProfiles.js +0 -73
- package/lib/ui/table.d.ts +0 -3
- package/lib/ui/table.js +0 -63
- package/ui/index.d.ts +0 -1
- package/ui/index.js +0 -6
- package/ui/views/UiSandbox.d.ts +0 -5
- /package/commands/__tests__/{create.test.d.ts → upgrade.test.d.ts} +0 -0
- /package/commands/{customObject/__tests__/schema.test.d.ts → cms/__tests__/upload.test.d.ts} +0 -0
- /package/commands/{project/__tests__/migrateApp.test.d.ts → cms/__tests__/watch.test.d.ts} +0 -0
- /package/{lib/__tests__/npm.test.d.ts → commands/project/__tests__/dev.test.d.ts} +0 -0
- /package/lib/__tests__/{projectProfiles.test.d.ts → cliUpgradeUtils.test.d.ts} +0 -0
- /package/lib/{app/__tests__/migrate_legacy.test.d.ts → __tests__/npmCli.test.d.ts} +0 -0
package/lang/en.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { mapToUserFriendlyName } from '@hubspot/project-parsing-lib';
|
|
2
|
+
import { mapToUserFriendlyName } from '@hubspot/project-parsing-lib/transform';
|
|
3
3
|
import { PLATFORM_VERSIONS } from '@hubspot/local-dev-lib/constants/projects';
|
|
4
4
|
import { PERSONAL_ACCESS_KEY_AUTH_METHOD } from '@hubspot/local-dev-lib/constants/auth';
|
|
5
5
|
import { ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME, GLOBAL_CONFIG_PATH, DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, } from '@hubspot/local-dev-lib/constants/config';
|
|
@@ -10,9 +10,6 @@ import { APP_DISTRIBUTION_TYPES, APP_AUTH_TYPES, PROJECT_CONFIG_FILE, PROJECT_WI
|
|
|
10
10
|
export const commands = {
|
|
11
11
|
generalErrors: {
|
|
12
12
|
srcIsProject: (src, command) => `"${src}" is in a project folder. Did you mean "hs project ${command}"?`,
|
|
13
|
-
handleDeprecatedEnvVariables: {
|
|
14
|
-
portalEnvVarDeprecated: 'The HUBSPOT_PORTAL_ID environment variable is deprecated. Please use HUBSPOT_ACCOUNT_ID instead.',
|
|
15
|
-
},
|
|
16
13
|
validateConfigMiddleware: {
|
|
17
14
|
missingConfigFile: `A HubSpot config file is required to run this command, but none was found. To create a new config file and authenticate a HubSpot account, run ${uiCommandReference('hs account auth')}`,
|
|
18
15
|
configValidationFailed: (errors) => `Your HubSpot config file is invalid. Please fix the following errors:\n - ${errors.join('\n- ')}`,
|
|
@@ -419,7 +416,6 @@ export const commands = {
|
|
|
419
416
|
dest: 'Path in HubSpot Design Tools. Can be a net new path. If you wish to preview a site page using your theme changes it must match the path of the theme used by the site.',
|
|
420
417
|
},
|
|
421
418
|
options: {
|
|
422
|
-
notify: 'Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file',
|
|
423
419
|
noSsl: 'Disable HTTPS',
|
|
424
420
|
port: 'The port on which to start the local server',
|
|
425
421
|
},
|
|
@@ -1026,6 +1022,27 @@ export const commands = {
|
|
|
1026
1022
|
},
|
|
1027
1023
|
outputWritten: (filename) => `Output written to ${chalk.bold(filename)}`,
|
|
1028
1024
|
},
|
|
1025
|
+
upgrade: {
|
|
1026
|
+
describe: 'Install the latest version of the HubSpot CLI, or a specific version.',
|
|
1027
|
+
options: {
|
|
1028
|
+
version: 'Specific version to install (defaults to latest)',
|
|
1029
|
+
force: 'Skip confirmation prompt and install immediately',
|
|
1030
|
+
beta: 'Install the next version of the HubSpot CLI (beta)',
|
|
1031
|
+
},
|
|
1032
|
+
alreadyLatest: (version, beta) => `You are already running the latest ${beta ? 'beta ' : ''}version (${chalk.bold(version)}).`,
|
|
1033
|
+
alreadyOnVersion: (current) => `You are already running version ${chalk.bold(current)}`,
|
|
1034
|
+
autoUpgradeNotAvailable: (version) => `Unable to auto-upgrade the HubSpot CLI. You can manually install ${chalk.bold(`@hubspot/cli@${version}`)}`,
|
|
1035
|
+
confirmPrompt: (current, version) => `Upgrade from ${current} to version ${version}?`,
|
|
1036
|
+
cancelled: 'Upgrade cancelled.',
|
|
1037
|
+
installing: (version) => `Installing @hubspot/cli@${version}...`,
|
|
1038
|
+
success: (version) => `Successfully installed @hubspot/cli@${version}`,
|
|
1039
|
+
autoUpgradeMessage: `The HubSpot CLI supports automatic updates as an optional feature.\n\nWhen enabled, the CLI will automatically install non-breaking updates within the current major version. Major releases will always require manual upgrades.\n\nRun ${uiCommandReference('hs config set --allow-auto-updates=true')}\n\nYou can change this later at any time with ${uiCommandReference('hs config set')}`,
|
|
1040
|
+
errors: {
|
|
1041
|
+
unableToDetermineLatestVersion: 'Unable to determine the latest version of the HubSpot CLI. Please try again later.',
|
|
1042
|
+
installFailed: 'Failed to install the CLI. Verify that the target version is available and try again.',
|
|
1043
|
+
generic: 'An error occurred while upgrading the CLI.',
|
|
1044
|
+
},
|
|
1045
|
+
},
|
|
1029
1046
|
filemanager: {
|
|
1030
1047
|
describe: 'Commands for managing files in the File Manager.',
|
|
1031
1048
|
subcommands: {
|
|
@@ -1198,16 +1215,16 @@ export const commands = {
|
|
|
1198
1215
|
codex: 'Codex CLI',
|
|
1199
1216
|
claudeCode: 'Claude Code',
|
|
1200
1217
|
cursor: 'Cursor',
|
|
1218
|
+
gemini: 'Gemini CLI',
|
|
1201
1219
|
windsurf: 'Windsurf',
|
|
1202
1220
|
vsCode: 'VSCode',
|
|
1203
1221
|
args: {
|
|
1204
|
-
client: 'Target
|
|
1222
|
+
client: 'Target apps to configure',
|
|
1205
1223
|
docsSearch: 'Should the docs search mcp server be installed',
|
|
1206
1224
|
},
|
|
1207
1225
|
success: (derivedTargets) => `You can now use the HubSpot CLI MCP Server in ${derivedTargets.join(', ')}. ${chalk.bold('You may need to restart these tools to apply the changes')}.`,
|
|
1208
1226
|
errors: {
|
|
1209
1227
|
needsMcpAccess: (accountId) => `You must opt in to the developer MCP beta to use this feature on ${uiAccountDescription(accountId)}. Try again with a different account or ${uiLink('join the beta now', getProductUpdatesUrl('239890', accountId))}`,
|
|
1210
|
-
needsNode20: `This feature requires node >=20`,
|
|
1211
1228
|
errorParsingJsonFIle: (filename, errorMessage) => `Unable to update ${chalk.bold(filename)} due to invalid JSON: ${errorMessage}`,
|
|
1212
1229
|
},
|
|
1213
1230
|
spinners: {
|
|
@@ -1226,6 +1243,11 @@ export const commands = {
|
|
|
1226
1243
|
configuringCursor: 'Configuring Cursor...',
|
|
1227
1244
|
failedToConfigureCursor: 'Failed to configure Cursor',
|
|
1228
1245
|
configuredCursor: 'Configured Cursor',
|
|
1246
|
+
// Gemini
|
|
1247
|
+
configuringGemini: 'Configuring Gemini CLI...',
|
|
1248
|
+
configuredGemini: 'Configured Gemini CLI',
|
|
1249
|
+
geminiNotFound: 'Gemini CLI not found - skipping configuration',
|
|
1250
|
+
geminiInstallFailed: 'Failed to configure Gemini CLI',
|
|
1229
1251
|
alreadyInstalled: 'HubSpot CLI mcp server already installed, reinstalling',
|
|
1230
1252
|
// Windsurf
|
|
1231
1253
|
configuringWindsurf: 'Configuring Windsurf...',
|
|
@@ -1239,12 +1261,11 @@ export const commands = {
|
|
|
1239
1261
|
},
|
|
1240
1262
|
prompts: {
|
|
1241
1263
|
targets: '[--client] Which tools would you like to add the HubSpot CLI MCP server to?',
|
|
1242
|
-
targetsRequired: 'Must choose at least one
|
|
1264
|
+
targetsRequired: 'Must choose at least one app to configure.',
|
|
1243
1265
|
},
|
|
1244
1266
|
},
|
|
1245
1267
|
start: {
|
|
1246
1268
|
errors: {
|
|
1247
|
-
needsNode20: `This feature requires node >=20`,
|
|
1248
1269
|
serverFileNotFound: (serverPath) => `MCP server file not found at ${serverPath}`,
|
|
1249
1270
|
failedToStart: 'Failed to start MCP server',
|
|
1250
1271
|
},
|
|
@@ -1364,6 +1385,9 @@ export const commands = {
|
|
|
1364
1385
|
examples: {
|
|
1365
1386
|
default: 'Start local dev for the current project',
|
|
1366
1387
|
},
|
|
1388
|
+
prompts: {
|
|
1389
|
+
selectProfile: '[--profile] Select a profile to use for local development',
|
|
1390
|
+
},
|
|
1367
1391
|
options: {
|
|
1368
1392
|
profile: 'The profile to target during local dev',
|
|
1369
1393
|
projectAccount: 'The id of the account to upload your project to. Must be used with --testing-account. Supported on platform versions 2025.2 and newer.',
|
|
@@ -1417,7 +1441,7 @@ export const commands = {
|
|
|
1417
1441
|
describe: 'How the app will be distributed.',
|
|
1418
1442
|
},
|
|
1419
1443
|
auth: {
|
|
1420
|
-
describe: 'Authentication model for the
|
|
1444
|
+
describe: 'Authentication model for the app.',
|
|
1421
1445
|
},
|
|
1422
1446
|
features: {
|
|
1423
1447
|
describe: `Features to include in the project. Only valid if project-base is ${PROJECT_WITH_APP}`,
|
|
@@ -1515,13 +1539,13 @@ export const commands = {
|
|
|
1515
1539
|
describe: "The path to the component type's location within the hubspot-project-components Github repo: https://github.com/HubSpot/hubspot-project-components",
|
|
1516
1540
|
},
|
|
1517
1541
|
distribution: {
|
|
1518
|
-
describe: 'The distribution method for the
|
|
1542
|
+
describe: 'The distribution method for the app.',
|
|
1519
1543
|
},
|
|
1520
1544
|
auth: {
|
|
1521
|
-
describe: 'The authentication type for the
|
|
1545
|
+
describe: 'The authentication type for the app.',
|
|
1522
1546
|
},
|
|
1523
1547
|
features: {
|
|
1524
|
-
describe: 'Which features to include with the
|
|
1548
|
+
describe: 'Which features to include with the app.',
|
|
1525
1549
|
},
|
|
1526
1550
|
},
|
|
1527
1551
|
creatingComponent: (projectName) => `Adding feature(s) to app [${chalk.bold(projectName)}]\n`,
|
|
@@ -1565,6 +1589,7 @@ export const commands = {
|
|
|
1565
1589
|
examples: {
|
|
1566
1590
|
default: 'Deploy the latest build of the current project',
|
|
1567
1591
|
withOptions: 'Deploy build 5 of the project my-project',
|
|
1592
|
+
withProfile: 'Deploy using the provided profile',
|
|
1568
1593
|
},
|
|
1569
1594
|
options: {
|
|
1570
1595
|
build: 'Project build ID to be deployed',
|
|
@@ -1647,6 +1672,7 @@ export const commands = {
|
|
|
1647
1672
|
describe: 'Upload your project files and create a new build.',
|
|
1648
1673
|
examples: {
|
|
1649
1674
|
default: 'Upload a project into your HubSpot account',
|
|
1675
|
+
withProfile: 'Upload a project into your HubSpot account when using profiles',
|
|
1650
1676
|
},
|
|
1651
1677
|
logs: {
|
|
1652
1678
|
buildSucceeded: (buildId) => `Build #${buildId} succeeded\n`,
|
|
@@ -1825,12 +1851,23 @@ export const commands = {
|
|
|
1825
1851
|
badVersion: 'This command is only available for projects 2025.2 and later.',
|
|
1826
1852
|
examples: {
|
|
1827
1853
|
default: 'Validate the project before uploading',
|
|
1854
|
+
withProfile: 'Validate the project with a profile before uploading.',
|
|
1828
1855
|
},
|
|
1829
1856
|
success: (projectName) => `Project ${projectName} is valid and ready to upload`,
|
|
1830
|
-
failure: (projectName) => `Project ${projectName} is invalid`,
|
|
1857
|
+
failure: (projectName, profileName) => `Project ${projectName} is invalid${profileName ? ` with profile "${profileName}" applied` : ''}`,
|
|
1858
|
+
failureWithProfile: (profileName) => chalk.bold(`With profile "${profileName}":`),
|
|
1859
|
+
spinners: {
|
|
1860
|
+
validatingProfile: (profileName) => `Validating project with profile "${profileName}"`,
|
|
1861
|
+
profileValidationFailed: (profileName) => `Profile "${profileName}" failed validation`,
|
|
1862
|
+
profileValidationSucceeded: (profileName) => `Project valid with profile "${profileName}" applied`,
|
|
1863
|
+
invalidWithProfile: (profileName) => `Project is invalid with profile "${profileName}" applied`,
|
|
1864
|
+
validatingAllProfiles: 'Validating the project with all profiles',
|
|
1865
|
+
allProfilesValidationSucceeded: 'Project profile validation succeeded',
|
|
1866
|
+
allProfilesValidationFailed: 'Project profile validation failed',
|
|
1867
|
+
},
|
|
1831
1868
|
options: {
|
|
1832
1869
|
profile: {
|
|
1833
|
-
describe: 'The profile to target for this validation',
|
|
1870
|
+
describe: 'The profile to target for this validation. If no profile is provided, all profiles will be validated.',
|
|
1834
1871
|
},
|
|
1835
1872
|
},
|
|
1836
1873
|
},
|
|
@@ -2149,7 +2186,7 @@ export const commands = {
|
|
|
2149
2186
|
polling: {
|
|
2150
2187
|
start: (testAccountName) => `Creating test account "${chalk.bold(testAccountName)}"...`,
|
|
2151
2188
|
syncing: 'Test account created! Syncing account data... (may take a few minutes - you can exit and the sync will continue)',
|
|
2152
|
-
success: (testAccountName, testAccountId) => `Test account "${chalk.bold(testAccountName)}" successfully created with id
|
|
2189
|
+
success: (testAccountName, testAccountId, parentAccountId) => `Test account "${chalk.bold(testAccountName)}" successfully created with id ${chalk.bold(testAccountId)} under parent account ${uiAccountDescription(parentAccountId)}`,
|
|
2153
2190
|
createFailure: 'Failed to create test account.',
|
|
2154
2191
|
},
|
|
2155
2192
|
options: {
|
|
@@ -2161,6 +2198,7 @@ export const commands = {
|
|
|
2161
2198
|
serviceLevel: 'Service Hub tier. Options: FREE, STARTER, PROFESSIONAL, ENTERPRISE',
|
|
2162
2199
|
salesLevel: 'Sales Hub tier. Options: FREE, STARTER, PROFESSIONAL, ENTERPRISE',
|
|
2163
2200
|
contentLevel: 'CMS Hub tier. Options: FREE, STARTER, PROFESSIONAL, ENTERPRISE',
|
|
2201
|
+
commerceLevel: 'Commerce Hub tier. Options: FREE, PROFESSIONAL, ENTERPRISE',
|
|
2164
2202
|
},
|
|
2165
2203
|
example: (configPath) => `Create a test account from the config file at ${configPath}`,
|
|
2166
2204
|
examples: {
|
|
@@ -2171,7 +2209,7 @@ export const commands = {
|
|
|
2171
2209
|
},
|
|
2172
2210
|
createConfig: {
|
|
2173
2211
|
describe: 'Create a test account config file.',
|
|
2174
|
-
pathPrompt: '[--path] Enter the name of the
|
|
2212
|
+
pathPrompt: '[--path] Enter the name of the test account config file: ',
|
|
2175
2213
|
errors: {
|
|
2176
2214
|
pathError: 'Path is required',
|
|
2177
2215
|
pathFormatError: 'Path must end with .json',
|
|
@@ -2869,6 +2907,12 @@ export const lib = {
|
|
|
2869
2907
|
startError: (message) => `Failed to start local dev server: ${message}`,
|
|
2870
2908
|
fileChangeError: (message) => `Failed to notify local dev server of file change: ${message}`,
|
|
2871
2909
|
},
|
|
2910
|
+
devSession: {
|
|
2911
|
+
registrationError: (message) => `Failed to register dev session: ${message}`,
|
|
2912
|
+
missingSessionIdError: 'Failed to connect to dev session: Missing session ID. Please try creating a new dev session.',
|
|
2913
|
+
heartbeatError: (message) => `Failed to send dev session heartbeat: ${message}`,
|
|
2914
|
+
deletionError: (message) => `Failed to delete dev session: ${message}`,
|
|
2915
|
+
},
|
|
2872
2916
|
},
|
|
2873
2917
|
AppDevModeInterface: {
|
|
2874
2918
|
autoInstallStaticAuthApp: {
|
|
@@ -2956,7 +3000,7 @@ export const lib = {
|
|
|
2956
3000
|
privateApp: `This project contains a private app. Local development of private apps is not supported in developer accounts. Change your default account using ${uiCommandReference('hs account use')}, or link a new account with ${uiAuthCommandReference()}.`,
|
|
2957
3001
|
},
|
|
2958
3002
|
validateAccountOption: {
|
|
2959
|
-
invalidPublicAppAccount: `This project contains a public app. The "--account" flag must point to a developer test account to develop this project locally. Alternatively, change your default account to an
|
|
3003
|
+
invalidPublicAppAccount: `This project contains a public app. The "--account" flag must point to a developer test account to develop this project locally. Alternatively, change your default account to an app developer account using ${uiCommandReference('hs account use')} and run ${uiCommandReference('hs project dev')} to set up a new developer test account.`,
|
|
2960
3004
|
invalidPrivateAppAccount: `This project contains a private app. The account specified with the "--account" flag points to a developer account, which do not support the local development of private apps. Update the "--account" flag to point to a standard, sandbox, or developer test account, or change your default account by running ${uiCommandReference('hs account use')}.`,
|
|
2961
3005
|
nonSandboxWarning: `Testing in a sandbox is strongly recommended. To switch the target account, select an option below or run ${uiCommandReference('hs account use')} before running the command again.`,
|
|
2962
3006
|
publicAppNonDeveloperTestAccountWarning: `Local development of public apps is only supported in ${chalk.bold('developer test accounts')}.`,
|
|
@@ -2979,7 +3023,7 @@ export const lib = {
|
|
|
2979
3023
|
},
|
|
2980
3024
|
middleware: {
|
|
2981
3025
|
updateNotification: {
|
|
2982
|
-
notifyTitle: chalk.bold('
|
|
3026
|
+
notifyTitle: chalk.bold('Update available'),
|
|
2983
3027
|
cmsUpdateNotification: (packageName) => `${chalk.bold('The CMS CLI is now the HubSpot CLI')}\n\nTo upgrade, uninstall ${chalk.bold(packageName)}\nand then run ${uiCommandReference('{updateCommand}')}`,
|
|
2984
3028
|
cliUpdateNotification: (currentVersion, updateCommand, latestVersion) => `HubSpot CLI version ${chalk.cyan(chalk.bold(`${currentVersion}`))} is outdated.\nRun ${uiCommandReference(`${updateCommand}`)} to upgrade to version ${chalk.cyan(chalk.bold(`${latestVersion}`))}`,
|
|
2985
3029
|
},
|
|
@@ -2988,6 +3032,7 @@ export const lib = {
|
|
|
2988
3032
|
updateSucceeded: (latestVersion) => `Successfully updated HubSpot CLI to version ${chalk.bold(latestVersion)}`,
|
|
2989
3033
|
notInstalledGlobally: 'Cannot auto-update the HubSpot CLI because NPM is not installed globally',
|
|
2990
3034
|
updateFailed: (latestVersion) => `Failed to update HubSpot CLI to version ${chalk.bold(latestVersion)}`,
|
|
3035
|
+
enableAutoUpdatesMessage: `The HubSpot CLI can automatically keep itself up to date.\n\nThis helps ensure compatibility with the HubSpot platform. You can change this later at any time.\n\nRun${uiCommandReference('hs config set --allow-auto-updates=true')}`,
|
|
2991
3036
|
},
|
|
2992
3037
|
},
|
|
2993
3038
|
projectProfiles: {
|
|
@@ -3006,7 +3051,9 @@ export const lib = {
|
|
|
3006
3051
|
noProjectConfig: 'No project config found. Please run this command from a project directory.',
|
|
3007
3052
|
profileNotFound: (profileName) => `Profile ${chalk.bold(profileName)} not found.`,
|
|
3008
3053
|
missingAccountId: (profileName) => `Profile ${chalk.bold(profileName)} is missing an account id.`,
|
|
3054
|
+
listedAccountNotFound: (accountId, profileName) => `The account ${uiAccountDescription(accountId)} is defined in your profile ${chalk.bold(profileName)}, but is missing in your config file`,
|
|
3009
3055
|
failedToLoadProfile: (profileName) => `Failed to load profile ${chalk.bold(profileName)}.`,
|
|
3056
|
+
profileNotValid: (profileName, errors) => `${chalk.bold(`With profile "${profileName}"`)}:\n\t- ${errors.join('\n\t- ')}`,
|
|
3010
3057
|
},
|
|
3011
3058
|
},
|
|
3012
3059
|
},
|
|
@@ -3015,7 +3062,7 @@ export const lib = {
|
|
|
3015
3062
|
prompt: {
|
|
3016
3063
|
marketPlaceDistribution: 'On the HubSpot marketplace',
|
|
3017
3064
|
privateDistribution: 'Privately',
|
|
3018
|
-
distribution: '[--distribution] Choose how to distribute your
|
|
3065
|
+
distribution: '[--distribution] Choose how to distribute your app:',
|
|
3019
3066
|
auth: '[--auth] Choose your authentication type:',
|
|
3020
3067
|
staticAuth: 'Static Auth',
|
|
3021
3068
|
oauth: 'OAuth',
|
|
@@ -3342,10 +3389,10 @@ export const lib = {
|
|
|
3342
3389
|
keepingCurrentDefault: (accountName) => `Account "${accountName}" will continue to be the default account`,
|
|
3343
3390
|
},
|
|
3344
3391
|
createDeveloperTestAccountConfigPrompt: {
|
|
3345
|
-
namePrompt: (withFlag = true) => `${withFlag ? '[--name] ' : ''}Enter the name of the
|
|
3346
|
-
descriptionPrompt: (withFlag = true) => `${withFlag ? '[--description] ' : ''}Enter the description of the
|
|
3392
|
+
namePrompt: (withFlag = true) => `${withFlag ? '[--name] ' : ''}Enter the name of the test account:`,
|
|
3393
|
+
descriptionPrompt: (withFlag = true) => `${withFlag ? '[--description] ' : ''}Enter the description of the test account:`,
|
|
3347
3394
|
useDefaultAccountLevelsPrompt: {
|
|
3348
|
-
message: 'Would you like to create a default
|
|
3395
|
+
message: 'Would you like to create a default test account, or customize your own?',
|
|
3349
3396
|
default: 'Default (All Hubs, ENTERPRISE)',
|
|
3350
3397
|
manual: 'Customize my own',
|
|
3351
3398
|
},
|
|
@@ -3356,11 +3403,12 @@ export const lib = {
|
|
|
3356
3403
|
service: 'Service',
|
|
3357
3404
|
sales: 'Sales',
|
|
3358
3405
|
content: 'Content',
|
|
3406
|
+
commerce: 'Commerce',
|
|
3359
3407
|
},
|
|
3360
3408
|
errors: {
|
|
3361
3409
|
allHubsRequired: 'Select a tier for each hub',
|
|
3362
3410
|
tiersError: 'Cannot have more than one tier per hub',
|
|
3363
|
-
nameRequired: 'The name may not be blank. Please add a name for the
|
|
3411
|
+
nameRequired: 'The name may not be blank. Please add a name for the test account.',
|
|
3364
3412
|
},
|
|
3365
3413
|
},
|
|
3366
3414
|
accountNamePrompt: {
|
|
@@ -3739,7 +3787,7 @@ export const lib = {
|
|
|
3739
3787
|
notLatestSecondary: (command, hsVersion) => `Run ${uiCommandReference(command)} to upgrade to the latest version ${hsVersion}`,
|
|
3740
3788
|
latest: (hsVersion) => `HubSpot CLI v${hsVersion} up to date`,
|
|
3741
3789
|
unableToDetermine: 'Unable to determine if HubSpot CLI is up to date.',
|
|
3742
|
-
unableToDetermineSecondary: (
|
|
3790
|
+
unableToDetermineSecondary: (link) => `Run ${uiCommandReference('hs --version')} to check your installed version; then visit the ${uiLink('npm HubSpot CLI version history', link)} to validate whether you have the latest version`,
|
|
3743
3791
|
},
|
|
3744
3792
|
projectDependenciesChecks: {
|
|
3745
3793
|
missingDependencies: (dir) => `missing dependencies in ${chalk.bold(dir)}`,
|
|
@@ -3753,9 +3801,18 @@ export const lib = {
|
|
|
3753
3801
|
},
|
|
3754
3802
|
port: {
|
|
3755
3803
|
inUse: (port) => `Port ${port} is in use`,
|
|
3756
|
-
inUseSecondary:
|
|
3804
|
+
inUseSecondary: `Make sure it is available before running ${uiCommandReference('hs project dev')}`,
|
|
3757
3805
|
available: (port) => `Port ${port} available for local development`,
|
|
3758
3806
|
},
|
|
3807
|
+
projectValidation: {
|
|
3808
|
+
valid: 'Project configuration and structure is valid',
|
|
3809
|
+
configInvalid: 'Project configuration is invalid',
|
|
3810
|
+
configMissing: 'Project configuration file not found',
|
|
3811
|
+
sourceDirectoryInvalid: 'Project source directory validation failed',
|
|
3812
|
+
translationFailed: 'Project validation failed',
|
|
3813
|
+
profileValidationFailed: (profileName) => `Project validation failed with profile '${profileName}' applied`,
|
|
3814
|
+
validationDetails: `Run ${uiCommandReference('hs project validate')} for more details.`,
|
|
3815
|
+
},
|
|
3759
3816
|
diagnosis: {
|
|
3760
3817
|
cli: {
|
|
3761
3818
|
header: 'HubSpot CLI install',
|
|
@@ -3784,6 +3841,28 @@ export const lib = {
|
|
|
3784
3841
|
warnings: (count) => `${chalk.bold('Warning:')} ${count}`,
|
|
3785
3842
|
},
|
|
3786
3843
|
},
|
|
3844
|
+
networkChecks: {
|
|
3845
|
+
header: 'Network & API connectivity',
|
|
3846
|
+
hubspotApiReachable: 'HubSpot API is reachable',
|
|
3847
|
+
hubspotApiUnreachable: 'Unable to connect to HubSpot API',
|
|
3848
|
+
hubspotApiUnreachableSecondary: 'Check your internet connection and firewall settings',
|
|
3849
|
+
npmRegistryReachable: 'npm registry is reachable',
|
|
3850
|
+
npmRegistryUnreachable: 'Unable to connect to npm registry',
|
|
3851
|
+
npmRegistryUnreachableSecondary: 'Check your internet connection and npm configuration',
|
|
3852
|
+
},
|
|
3853
|
+
webhookChecks: {
|
|
3854
|
+
header: 'Webhook endpoints',
|
|
3855
|
+
endpointReachable: (url) => `Webhook endpoint reachable: ${url}`,
|
|
3856
|
+
endpointUnreachable: (url) => `Webhook endpoint unreachable: ${url}`,
|
|
3857
|
+
endpointUnreachableSecondary: 'Verify the URL is correct and the server is running',
|
|
3858
|
+
checkType: 'Webhook',
|
|
3859
|
+
},
|
|
3860
|
+
appRedirectChecks: {
|
|
3861
|
+
redirectUrlReachable: (url) => `App redirect URL reachable: ${url}`,
|
|
3862
|
+
redirectUrlUnreachable: (url) => `App redirect URL unreachable: ${url}`,
|
|
3863
|
+
redirectUrlUnreachableSecondary: 'Verify the URL is correct and the server is running',
|
|
3864
|
+
checkType: 'App redirect URL',
|
|
3865
|
+
},
|
|
3787
3866
|
defaultAccountOverrideFileChecks: {
|
|
3788
3867
|
overrideActive: (defaultAccountOverrideFile) => `Default account override file is active: ${defaultAccountOverrideFile}`,
|
|
3789
3868
|
overrideAccountId: (overrideAccountId) => `Active account ID: ${overrideAccountId}`,
|
|
@@ -11,7 +11,6 @@ vi.mock('@hubspot/local-dev-lib/personalAccessKey');
|
|
|
11
11
|
vi.mock('@hubspot/local-dev-lib/config');
|
|
12
12
|
vi.mock('@hubspot/local-dev-lib/api/developerTestAccounts');
|
|
13
13
|
vi.mock('@hubspot/local-dev-lib/api/sandboxHubs');
|
|
14
|
-
vi.mock('../ui/logger.js');
|
|
15
14
|
vi.mock('../errorHandlers/index.js');
|
|
16
15
|
vi.mock('../prompts/personalAccessKeyPrompt');
|
|
17
16
|
vi.mock('../prompts/accountNamePrompt');
|
|
@@ -65,9 +64,6 @@ describe('lib/buildAccount', () => {
|
|
|
65
64
|
mockedGetConfigAccountIfExists.mockResolvedValue(undefined);
|
|
66
65
|
mockedUpdateConfigAccount.mockReturnValue(undefined);
|
|
67
66
|
});
|
|
68
|
-
afterEach(() => {
|
|
69
|
-
vi.clearAllMocks();
|
|
70
|
-
});
|
|
71
67
|
it('should save account with provided personal access key', async () => {
|
|
72
68
|
const result = await buildAccount.saveAccountToConfig(mockAccountConfig.accountId, mockAccountConfig.name, mockAccountConfig.env, 'test-key');
|
|
73
69
|
expect(mockedPersonalAccessKeyPrompt).not.toHaveBeenCalled();
|
|
@@ -157,9 +153,6 @@ describe('lib/buildAccount', () => {
|
|
|
157
153
|
data: mockDeveloperTestAccount,
|
|
158
154
|
});
|
|
159
155
|
});
|
|
160
|
-
afterEach(() => {
|
|
161
|
-
vi.clearAllMocks();
|
|
162
|
-
});
|
|
163
156
|
it('should create a developer test account successfully', async () => {
|
|
164
157
|
const result = await buildAccount.buildDeveloperTestAccount(mockDeveloperTestAccount.accountName, mockParentAccountConfig, mockParentAccountConfig.env, 10);
|
|
165
158
|
expect(result).toEqual(mockDeveloperTestAccount.id);
|
|
@@ -198,9 +191,6 @@ describe('lib/buildAccount', () => {
|
|
|
198
191
|
data: { sandbox: mockSandbox, personalAccessKey: 'test-key' },
|
|
199
192
|
});
|
|
200
193
|
});
|
|
201
|
-
afterEach(() => {
|
|
202
|
-
vi.clearAllMocks();
|
|
203
|
-
});
|
|
204
194
|
it('should create a standard sandbox successfully', async () => {
|
|
205
195
|
const result = await buildAccount.buildSandbox(mockSandbox.name, mockParentAccountConfig, HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX, mockParentAccountConfig.env, false);
|
|
206
196
|
expect(result).toEqual({
|
|
@@ -254,9 +244,6 @@ describe('lib/buildAccount', () => {
|
|
|
254
244
|
data: { personalAccessKey: { encodedOAuthRefreshToken: 'test-key' } },
|
|
255
245
|
});
|
|
256
246
|
});
|
|
257
|
-
afterEach(() => {
|
|
258
|
-
vi.clearAllMocks();
|
|
259
|
-
});
|
|
260
247
|
it('should create a v2 standard sandbox successfully and fetch a personal access key', async () => {
|
|
261
248
|
const result = await buildAccount.buildV2Sandbox(mockSandbox.name, mockParentAccountConfig, HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX, false, mockParentAccountConfig.env, false);
|
|
262
249
|
expect(result).toEqual({ sandbox: mockSandbox });
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import updateNotifier from 'update-notifier';
|
|
2
|
+
import { isCliGloballyInstalled, canCliBeAutoUpgraded, getLatestCliVersion, getCliUpgradeInfo, installCliVersion, } from '../cliUpgradeUtils.js';
|
|
3
|
+
import { isGloballyInstalled, getLatestPackageVersion, executeInstall, isInstalledGloballyWithNPM, } from '../npm/npmCli.js';
|
|
4
|
+
import { pkg } from '../jsonLoader.js';
|
|
5
|
+
vi.mock('../npm/npmCli');
|
|
6
|
+
vi.mock('update-notifier');
|
|
7
|
+
vi.mock('../jsonLoader.js', () => ({
|
|
8
|
+
pkg: {
|
|
9
|
+
name: '@hubspot/cli',
|
|
10
|
+
version: '7.11.2',
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
const mockedIsGloballyInstalled = vi.mocked(isGloballyInstalled);
|
|
14
|
+
const mockedGetLatestPackageVersion = vi.mocked(getLatestPackageVersion);
|
|
15
|
+
const mockedExecuteInstall = vi.mocked(executeInstall);
|
|
16
|
+
const mockedUpdateNotifier = vi.mocked(updateNotifier);
|
|
17
|
+
const mockedIsInstalledGloballyWithNPM = vi.mocked(isInstalledGloballyWithNPM);
|
|
18
|
+
describe('lib/cliUpgradeUtils', () => {
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
vi.clearAllMocks();
|
|
21
|
+
});
|
|
22
|
+
describe('isCliGloballyInstalled()', () => {
|
|
23
|
+
it('should return true when hs is globally installed', async () => {
|
|
24
|
+
mockedIsGloballyInstalled.mockResolvedValueOnce(true);
|
|
25
|
+
const result = await isCliGloballyInstalled();
|
|
26
|
+
expect(result).toBe(true);
|
|
27
|
+
expect(mockedIsGloballyInstalled).toHaveBeenCalledTimes(1);
|
|
28
|
+
expect(mockedIsGloballyInstalled).toHaveBeenCalledWith('hs');
|
|
29
|
+
});
|
|
30
|
+
it('should return false when hs is not globally installed', async () => {
|
|
31
|
+
mockedIsGloballyInstalled.mockResolvedValueOnce(false);
|
|
32
|
+
const result = await isCliGloballyInstalled();
|
|
33
|
+
expect(result).toBe(false);
|
|
34
|
+
expect(mockedIsGloballyInstalled).toHaveBeenCalledTimes(1);
|
|
35
|
+
expect(mockedIsGloballyInstalled).toHaveBeenCalledWith('hs');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('canCliBeAutoUpgraded()', () => {
|
|
39
|
+
it('should return true when package is installed globally via npm', async () => {
|
|
40
|
+
mockedIsInstalledGloballyWithNPM.mockResolvedValueOnce(true);
|
|
41
|
+
const result = await canCliBeAutoUpgraded();
|
|
42
|
+
expect(result).toBe(true);
|
|
43
|
+
expect(mockedIsInstalledGloballyWithNPM).toHaveBeenCalledTimes(1);
|
|
44
|
+
expect(mockedIsInstalledGloballyWithNPM).toHaveBeenCalledWith(pkg.name);
|
|
45
|
+
});
|
|
46
|
+
it('should return false when package is not installed globally via npm', async () => {
|
|
47
|
+
mockedIsInstalledGloballyWithNPM.mockResolvedValueOnce(false);
|
|
48
|
+
const result = await canCliBeAutoUpgraded();
|
|
49
|
+
expect(result).toBe(false);
|
|
50
|
+
expect(mockedIsInstalledGloballyWithNPM).toHaveBeenCalledTimes(1);
|
|
51
|
+
expect(mockedIsInstalledGloballyWithNPM).toHaveBeenCalledWith(pkg.name);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe('getLatestCliVersion()', () => {
|
|
55
|
+
it('should return the latest CLI version', async () => {
|
|
56
|
+
const latest = '7.12.0';
|
|
57
|
+
const next = '7.12.0-beta.1';
|
|
58
|
+
mockedGetLatestPackageVersion.mockResolvedValueOnce({ latest, next });
|
|
59
|
+
const result = await getLatestCliVersion();
|
|
60
|
+
expect(result).toEqual({ latest, next });
|
|
61
|
+
expect(mockedGetLatestPackageVersion).toHaveBeenCalledTimes(1);
|
|
62
|
+
expect(mockedGetLatestPackageVersion).toHaveBeenCalledWith(pkg.name);
|
|
63
|
+
});
|
|
64
|
+
it('should throw errors from getLatestPackageVersion', async () => {
|
|
65
|
+
const errorMessage = 'Failed to get version';
|
|
66
|
+
mockedGetLatestPackageVersion.mockRejectedValueOnce(new Error(errorMessage));
|
|
67
|
+
await expect(getLatestCliVersion()).rejects.toThrow(errorMessage);
|
|
68
|
+
expect(mockedGetLatestPackageVersion).toHaveBeenCalledWith(pkg.name);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe('getCliUpgradeInfo()', () => {
|
|
72
|
+
it('should return upgrade info when update is available', () => {
|
|
73
|
+
const mockNotifier = {
|
|
74
|
+
update: {
|
|
75
|
+
current: '7.11.2',
|
|
76
|
+
latest: '7.12.0',
|
|
77
|
+
type: 'minor',
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
mockedUpdateNotifier.mockReturnValue(mockNotifier);
|
|
81
|
+
const result = getCliUpgradeInfo();
|
|
82
|
+
expect(result).toMatchObject({
|
|
83
|
+
current: '7.11.2',
|
|
84
|
+
latest: '7.12.0',
|
|
85
|
+
type: 'minor',
|
|
86
|
+
});
|
|
87
|
+
expect(mockedUpdateNotifier).toHaveBeenCalledWith({
|
|
88
|
+
pkg,
|
|
89
|
+
distTag: 'latest',
|
|
90
|
+
shouldNotifyInNpmScript: true,
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
it('should return cached info on subsequent calls', () => {
|
|
94
|
+
const mockNotifier = {
|
|
95
|
+
update: {
|
|
96
|
+
current: '7.11.2',
|
|
97
|
+
latest: '7.12.0',
|
|
98
|
+
type: 'minor',
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
mockedUpdateNotifier.mockReturnValue(mockNotifier);
|
|
102
|
+
const firstCall = getCliUpgradeInfo();
|
|
103
|
+
const secondCall = getCliUpgradeInfo();
|
|
104
|
+
expect(firstCall).toEqual(secondCall);
|
|
105
|
+
expect(firstCall.current).toBe('7.11.2');
|
|
106
|
+
expect(firstCall.latest).toBe('7.12.0');
|
|
107
|
+
expect(firstCall.type).toBe('minor');
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe('installCliVersion()', () => {
|
|
111
|
+
it('should install latest version by default', async () => {
|
|
112
|
+
mockedExecuteInstall.mockResolvedValueOnce(undefined);
|
|
113
|
+
await installCliVersion();
|
|
114
|
+
expect(mockedExecuteInstall).toHaveBeenCalledTimes(1);
|
|
115
|
+
expect(mockedExecuteInstall).toHaveBeenCalledWith([`${pkg.name}@latest`], '-g');
|
|
116
|
+
});
|
|
117
|
+
it('should install a specific version when provided', async () => {
|
|
118
|
+
const version = '7.12.0';
|
|
119
|
+
mockedExecuteInstall.mockResolvedValueOnce(undefined);
|
|
120
|
+
await installCliVersion(version);
|
|
121
|
+
expect(mockedExecuteInstall).toHaveBeenCalledTimes(1);
|
|
122
|
+
expect(mockedExecuteInstall).toHaveBeenCalledWith([`${pkg.name}@${version}`], '-g');
|
|
123
|
+
});
|
|
124
|
+
it('should throw errors from executeInstall', async () => {
|
|
125
|
+
const errorMessage = 'Installation failed';
|
|
126
|
+
mockedExecuteInstall.mockRejectedValueOnce(new Error(errorMessage));
|
|
127
|
+
await expect(installCliVersion()).rejects.toThrow(errorMessage);
|
|
128
|
+
expect(mockedExecuteInstall).toHaveBeenCalledWith([`${pkg.name}@latest`], '-g');
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|