From 21ee117e23bd2c999b2f1b1db1e0343826637852 Mon Sep 17 00:00:00 2001 From: Branden Rodgers Date: Tue, 23 Dec 2025 12:41:38 -0500 Subject: [PATCH] Sync from internal - version 7.11.2 This commit syncs changes from the internal repository to keep the public repo up to date. Version: 7.11.2 Generated by: hubspot-cli internal --- bin/{hs => hs.js} | 0 bin/{hscms => hscms.js} | 0 lib/middleware/configMiddleware.ts | 8 ++++++-- lib/middleware/gitMiddleware.ts | 9 +++++++-- package.json | 8 ++++---- 5 files changed, 17 insertions(+), 8 deletions(-) rename bin/{hs => hs.js} (100%) rename bin/{hscms => hscms.js} (100%) diff --git a/bin/hs b/bin/hs.js similarity index 100% rename from bin/hs rename to bin/hs.js diff --git a/bin/hscms b/bin/hscms.js similarity index 100% rename from bin/hscms rename to bin/hscms.js diff --git a/lib/middleware/configMiddleware.ts b/lib/middleware/configMiddleware.ts index edcc654cc..e80cf2223 100644 --- a/lib/middleware/configMiddleware.ts +++ b/lib/middleware/configMiddleware.ts @@ -7,6 +7,7 @@ import { getConfigDefaultAccountIfExists, configFileExists, } from '@hubspot/local-dev-lib/config'; +import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config'; import { getCwd } from '@hubspot/local-dev-lib/path'; import { validateAccount } from '../validation.js'; import { EXIT_CODES } from '../enums/exitCodes.js'; @@ -43,7 +44,7 @@ export function handleCustomConfigLocationMiddleware( ): void { const { useEnv, config } = argv; if (useEnv) { - process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG = 'true'; + process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] = 'true'; } else if (config && typeof config === 'string') { const absoluteConfigPath = path.isAbsolute(config) ? config @@ -105,7 +106,10 @@ export async function validateConfigMiddleware( // We don't run validation for auth because users should be able to run it when // no accounts are configured, but we still want to exit if the config file is not found - if (!process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG && !configFileExists()) { + if ( + !process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] && + !configFileExists() + ) { console.error( 'Config file not found, run hs account auth to configure your account' ); diff --git a/lib/middleware/gitMiddleware.ts b/lib/middleware/gitMiddleware.ts index f66338518..88378804c 100644 --- a/lib/middleware/gitMiddleware.ts +++ b/lib/middleware/gitMiddleware.ts @@ -3,11 +3,16 @@ import { getConfigFilePath, globalConfigFileExists, } from '@hubspot/local-dev-lib/config'; +import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config'; import { checkAndWarnGitInclusion } from '../ui/git.js'; import { debugError } from '../errorHandlers/index.js'; + export function checkAndWarnGitInclusionMiddleware(argv: Arguments): void { - // Skip this when no command is provided - if (argv._.length) { + // Skip this when no command is provided or if using environment config + if ( + argv._.length && + !process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] + ) { // Skip if using global config if (globalConfigFileExists()) { return; diff --git a/package.json b/package.json index 828dac9ea..64eb497ed 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "@hubspot/cli", - "version": "7.11.1", + "version": "7.11.2", "description": "The official CLI for developing on HubSpot", "license": "Apache-2.0", "repository": "https://github.com/HubSpot/hubspot-cli", "type": "module", "dependencies": { - "@hubspot/local-dev-lib": "4.0.3", + "@hubspot/local-dev-lib": "4.0.4", "@hubspot/project-parsing-lib": "0.10.2", "@hubspot/serverless-dev-runtime": "7.0.7", "@hubspot/theme-preview-dev-server": "0.0.12", @@ -111,8 +111,8 @@ "node": ">=18" }, "bin": { - "hs": "./bin/hs", - "hscms": "./bin/hscms" + "hs": "./bin/hs.js", + "hscms": "./bin/hscms.js" }, "publishConfig": { "access": "public",