@hubspot/cli 7.7.0-experimental.2 → 7.7.1-experimental.0
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/bin/cli.js +96 -94
- package/commands/account.js +0 -2
- package/commands/app.js +0 -2
- package/commands/auth.js +0 -2
- package/commands/cms.js +0 -2
- package/commands/completion.js +0 -2
- package/commands/config.js +0 -2
- package/commands/create.js +0 -2
- package/commands/customObject.js +0 -2
- package/commands/doctor.js +0 -2
- package/commands/feedback.js +0 -2
- package/commands/filemanager.js +0 -2
- package/commands/function.js +0 -2
- package/commands/hubdb.js +0 -2
- package/commands/init.js +0 -2
- package/commands/lint.js +0 -2
- package/commands/list.js +0 -2
- package/commands/mv.js +0 -2
- package/commands/open.js +0 -2
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.js +59 -34
- package/commands/project/dev/unifiedFlow.d.ts +10 -2
- package/commands/project/dev/unifiedFlow.js +27 -41
- package/commands/project.js +0 -4
- package/commands/remove.js +0 -2
- package/commands/sandbox.js +0 -2
- package/commands/secret.js +0 -2
- package/commands/theme.js +0 -2
- package/commands/upload.js +0 -2
- package/lang/en.d.ts +14 -54
- package/lang/en.js +14 -54
- package/lib/accountTypes.js +1 -3
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +5 -3
- package/lib/projects/localDev/AppDevModeInterface.js +0 -6
- package/lib/projects/upload.js +6 -0
- package/package.json +4 -7
- package/types/Yargs.d.ts +2 -0
- package/bin/hsmcp.d.ts +0 -2
- package/bin/hsmcp.js +0 -13
- package/commands/project/validate.d.ts +0 -4
- package/commands/project/validate.js +0 -53
- package/commands/setupMcp.d.ts +0 -8
- package/commands/setupMcp.js +0 -229
- package/mcp-server/index.d.ts +0 -1
- package/mcp-server/index.js +0 -17
- package/mcp-server/mcpLoader.d.ts +0 -5
- package/mcp-server/mcpLoader.js +0 -24
- package/mcp-server/tools/ExplainProjectStructureTool.d.ts +0 -33
- package/mcp-server/tools/ExplainProjectStructureTool.js +0 -266
- package/mcp-server/tools/GenerateAppComponentTool.d.ts +0 -99
- package/mcp-server/tools/GenerateAppComponentTool.js +0 -193
- package/mcp-server/tools/GenerateCardComponentTool.d.ts +0 -74
- package/mcp-server/tools/GenerateCardComponentTool.js +0 -146
- package/mcp-server/tools/GenerateProjectConfigTool.d.ts +0 -32
- package/mcp-server/tools/GenerateProjectConfigTool.js +0 -40
- package/mcp-server/tools/HubSpotCLIHelper.d.ts +0 -24
- package/mcp-server/tools/HubSpotCLIHelper.js +0 -110
- package/mcp-server/tools/UploadProjectTool.d.ts +0 -44
- package/mcp-server/tools/UploadProjectTool.js +0 -166
- package/mcp-server/tools/ValidateProjectTool.d.ts +0 -62
- package/mcp-server/tools/ValidateProjectTool.js +0 -336
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.unifiedProjectDevFlow = unifiedProjectDevFlow;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const util_1 = __importDefault(require("util"));
|
|
9
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
-
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
11
9
|
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
12
10
|
const errors_1 = require("@hubspot/project-parsing-lib/src/lib/errors");
|
|
13
11
|
const project_parsing_lib_1 = require("@hubspot/project-parsing-lib");
|
|
@@ -24,14 +22,10 @@ const LocalDevWatcher_1 = __importDefault(require("../../../lib/projects/localDe
|
|
|
24
22
|
const process_1 = require("../../../lib/process");
|
|
25
23
|
const accountTypes_1 = require("../../../lib/accountTypes");
|
|
26
24
|
const ui_1 = require("../../../lib/ui");
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
async function unifiedProjectDevFlow(args,
|
|
30
|
-
const targetProjectAccountId = (0, getAccountIdentifier_1.getAccountIdentifier)(accountConfig);
|
|
25
|
+
const logger_1 = require("../../../lib/ui/logger");
|
|
26
|
+
const en_1 = require("../../../lang/en");
|
|
27
|
+
async function unifiedProjectDevFlow({ args, targetProjectAccountId, providedTargetTestingAccountId, projectConfig, projectDir, profileConfig, }) {
|
|
31
28
|
const env = (0, environment_1.getValidEnv)((0, config_2.getEnv)(targetProjectAccountId));
|
|
32
|
-
if (!targetProjectAccountId) {
|
|
33
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
34
|
-
}
|
|
35
29
|
let projectNodes;
|
|
36
30
|
// Get IR
|
|
37
31
|
try {
|
|
@@ -41,58 +35,49 @@ async function unifiedProjectDevFlow(args, accountConfig, projectConfig, project
|
|
|
41
35
|
accountId: targetProjectAccountId,
|
|
42
36
|
}, { profile: args.profile });
|
|
43
37
|
projectNodes = intermediateRepresentation.intermediateNodesIndexedByUid;
|
|
44
|
-
logger_1.
|
|
38
|
+
logger_1.uiLogger.debug(util_1.default.inspect(projectNodes, false, null, true));
|
|
45
39
|
}
|
|
46
40
|
catch (e) {
|
|
47
41
|
if ((0, errors_1.isTranslationError)(e)) {
|
|
48
|
-
logger_1.
|
|
42
|
+
logger_1.uiLogger.error(e.toString());
|
|
49
43
|
}
|
|
50
44
|
else {
|
|
51
45
|
(0, errorHandlers_1.logError)(e);
|
|
52
46
|
}
|
|
53
47
|
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
54
48
|
}
|
|
55
|
-
// @TODO Do we need to do more than this or leave it to the dev servers?
|
|
56
49
|
if (!Object.keys(projectNodes).length) {
|
|
57
|
-
logger_1.
|
|
58
|
-
projectDir,
|
|
59
|
-
command: (0, ui_1.uiCommandReference)('hs project add'),
|
|
60
|
-
}));
|
|
50
|
+
logger_1.uiLogger.error(en_1.commands.project.dev.errors.noRunnableComponents);
|
|
61
51
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
62
52
|
}
|
|
63
|
-
|
|
53
|
+
const targetProjectAccountConfig = (0, config_2.getAccountConfig)(targetProjectAccountId);
|
|
54
|
+
if (!targetProjectAccountConfig) {
|
|
55
|
+
logger_1.uiLogger.error(en_1.commands.project.dev.errors.noAccount(targetProjectAccountId));
|
|
56
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
57
|
+
}
|
|
64
58
|
const accounts = (0, config_2.getConfigAccounts)();
|
|
65
|
-
const accountIsCombined = await (0, accountTypes_1.isUnifiedAccount)(
|
|
59
|
+
const accountIsCombined = await (0, accountTypes_1.isUnifiedAccount)(targetProjectAccountConfig);
|
|
66
60
|
if (!accountIsCombined && !profileConfig) {
|
|
67
|
-
logger_1.
|
|
68
|
-
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.dev.errors.accountNotCombined`, {
|
|
69
|
-
accountUseCommand: (0, ui_1.uiCommandReference)('hs account use'),
|
|
70
|
-
}));
|
|
61
|
+
logger_1.uiLogger.error(en_1.commands.project.dev.errors.accountNotCombined);
|
|
71
62
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
72
63
|
}
|
|
73
|
-
let targetTestingAccountId =
|
|
64
|
+
let targetTestingAccountId = providedTargetTestingAccountId;
|
|
74
65
|
if (profileConfig) {
|
|
75
66
|
// Bypass the prompt for the testing account if the user has a profile configured
|
|
76
67
|
targetTestingAccountId = profileConfig.accountId;
|
|
77
68
|
}
|
|
78
|
-
else if (
|
|
79
|
-
|
|
80
|
-
targetTestingAccountId = targetProjectAccountId;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
logger_1.logger.log('');
|
|
69
|
+
else if (!targetTestingAccountId) {
|
|
70
|
+
logger_1.uiLogger.log('');
|
|
84
71
|
(0, ui_1.uiLine)();
|
|
85
|
-
logger_1.
|
|
86
|
-
logger_1.
|
|
87
|
-
logger_1.logger.log((0, lang_1.i18n)(`commands.project.subcommands.dev.logs.learnMoreMessage`, {
|
|
88
|
-
learnMoreLink: (0, ui_1.uiLink)((0, lang_1.i18n)(`commands.project.subcommands.dev.logs.learnMoreLink`), 'https://developers.hubspot.com/docs/getting-started/account-types'),
|
|
89
|
-
}));
|
|
72
|
+
logger_1.uiLogger.log(en_1.commands.project.dev.logs.accountTypeInformation);
|
|
73
|
+
logger_1.uiLogger.log(en_1.commands.project.dev.logs.learnMoreMessage);
|
|
90
74
|
(0, ui_1.uiLine)();
|
|
91
|
-
logger_1.
|
|
92
|
-
const accountType = await (0, helpers_1.selectAccountTypePrompt)(
|
|
75
|
+
logger_1.uiLogger.log('');
|
|
76
|
+
const accountType = await (0, helpers_1.selectAccountTypePrompt)(targetProjectAccountConfig);
|
|
93
77
|
if (accountType === config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST) {
|
|
94
|
-
const devAccountPromptResponse = await (0, projectDevTargetAccountPrompt_1.selectDeveloperTestTargetAccountPrompt)(accounts,
|
|
95
|
-
targetTestingAccountId =
|
|
78
|
+
const devAccountPromptResponse = await (0, projectDevTargetAccountPrompt_1.selectDeveloperTestTargetAccountPrompt)(accounts, targetProjectAccountConfig);
|
|
79
|
+
targetTestingAccountId =
|
|
80
|
+
devAccountPromptResponse.targetAccountId || undefined;
|
|
96
81
|
if (!!devAccountPromptResponse.notInConfigAccount) {
|
|
97
82
|
// When the developer test account isn't configured in the CLI config yet
|
|
98
83
|
// Walk the user through adding the account's PAK to the config
|
|
@@ -100,12 +85,13 @@ async function unifiedProjectDevFlow(args, accountConfig, projectConfig, project
|
|
|
100
85
|
}
|
|
101
86
|
else if (devAccountPromptResponse.createNestedAccount) {
|
|
102
87
|
// Create a new developer test account and automatically add it to the CLI config
|
|
103
|
-
targetTestingAccountId = await (0, helpers_1.createDeveloperTestAccountForLocalDev)(targetProjectAccountId,
|
|
88
|
+
targetTestingAccountId = await (0, helpers_1.createDeveloperTestAccountForLocalDev)(targetProjectAccountId, targetProjectAccountConfig, env);
|
|
104
89
|
}
|
|
105
90
|
}
|
|
106
91
|
else if (accountType === config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX) {
|
|
107
|
-
const sandboxAccountPromptResponse = await (0, projectDevTargetAccountPrompt_1.selectSandboxTargetAccountPrompt)(accounts,
|
|
108
|
-
targetTestingAccountId =
|
|
92
|
+
const sandboxAccountPromptResponse = await (0, projectDevTargetAccountPrompt_1.selectSandboxTargetAccountPrompt)(accounts, targetProjectAccountConfig);
|
|
93
|
+
targetTestingAccountId =
|
|
94
|
+
sandboxAccountPromptResponse.targetAccountId || undefined;
|
|
109
95
|
}
|
|
110
96
|
else {
|
|
111
97
|
targetTestingAccountId = targetProjectAccountId;
|
package/commands/project.js
CHANGED
|
@@ -20,7 +20,6 @@ const migrateApp_1 = __importDefault(require("./project/migrateApp"));
|
|
|
20
20
|
const cloneApp_1 = __importDefault(require("./project/cloneApp"));
|
|
21
21
|
const installDeps_1 = __importDefault(require("./project/installDeps"));
|
|
22
22
|
const profile_1 = __importDefault(require("./project/profile"));
|
|
23
|
-
const validate_1 = __importDefault(require("./project/validate"));
|
|
24
23
|
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
25
24
|
const command = ['project', 'projects'];
|
|
26
25
|
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.project.describe`), false);
|
|
@@ -41,7 +40,6 @@ function projectBuilder(yargs) {
|
|
|
41
40
|
.command(cloneApp_1.default)
|
|
42
41
|
.command(installDeps_1.default)
|
|
43
42
|
.command(profile_1.default)
|
|
44
|
-
.command(validate_1.default)
|
|
45
43
|
.demandCommand(1, '');
|
|
46
44
|
return yargs;
|
|
47
45
|
}
|
|
@@ -53,5 +51,3 @@ const projectCommand = {
|
|
|
53
51
|
handler: () => { },
|
|
54
52
|
};
|
|
55
53
|
exports.default = projectCommand;
|
|
56
|
-
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
57
|
-
module.exports = projectCommand;
|
package/commands/remove.js
CHANGED
package/commands/sandbox.js
CHANGED
package/commands/secret.js
CHANGED
package/commands/theme.js
CHANGED
package/commands/upload.js
CHANGED
package/lang/en.d.ts
CHANGED
|
@@ -810,18 +810,28 @@ Profiles enable you to reference variables in your component configuration files
|
|
|
810
810
|
readonly placeholderAccountSelection: "Using default account as target account (for now)";
|
|
811
811
|
readonly learnMoreLocalDevServer: "Learn more about the projects local dev server";
|
|
812
812
|
readonly accountTypeInformation: "Testing in a developer test account is strongly recommended, but you can use a sandbox account if your plan allows you to create one.";
|
|
813
|
-
readonly learnMoreMessage: `
|
|
813
|
+
readonly learnMoreMessage: `
|
|
814
|
+
Visit our ${string} to learn more.`;
|
|
814
815
|
};
|
|
815
816
|
readonly errors: {
|
|
816
817
|
readonly noProjectConfig: "No project detected. Please run this command again from a project directory.";
|
|
817
|
-
readonly noAccount: (accountId:
|
|
818
|
+
readonly noAccount: (accountId: number) => string;
|
|
818
819
|
readonly noAccountsInConfig: (authCommand: string) => string;
|
|
819
820
|
readonly invalidProjectComponents: "Projects cannot contain both private and public apps. Move your apps to separate projects before attempting local development.";
|
|
820
|
-
readonly noRunnableComponents:
|
|
821
|
+
readonly noRunnableComponents: `No supported components were found in this project. Run ${string} to see a list of available components and add one to your project.`;
|
|
822
|
+
readonly accountNotCombined: `
|
|
823
|
+
Local development of unified apps is currently only compatible with accounts that are opted into the unified apps beta. Make sure that this account is opted in or switch accounts using ${string}.`;
|
|
824
|
+
readonly unsupportedAccountFlagLegacy: "The --projectAccount and --testingAccount flags are not supported for projects with platform versions earlier than 2025.2.";
|
|
825
|
+
readonly unsupportedAccountFlagV3: "The --account flag is is not supported supported for projects with platform versions 2025.2 and newer. Use --testingAccount and --projectAccount flags to specify accounts to use for local dev";
|
|
821
826
|
};
|
|
822
827
|
readonly examples: {
|
|
823
828
|
readonly default: "Start local dev for the current project";
|
|
824
829
|
};
|
|
830
|
+
readonly options: {
|
|
831
|
+
readonly profile: "The profile to target during local dev";
|
|
832
|
+
readonly projectAccount: "The id of the account to upload your project to. Only compatible with platform versions 2025.2 and above.";
|
|
833
|
+
readonly testingAccount: "The id of the account to install apps and test on. Only compatible with platform versions 2025.2 and above.";
|
|
834
|
+
};
|
|
825
835
|
};
|
|
826
836
|
readonly create: {
|
|
827
837
|
readonly describe: "Create a new project.";
|
|
@@ -2211,57 +2221,6 @@ Profiles enable you to reference variables in your component configuration files
|
|
|
2211
2221
|
};
|
|
2212
2222
|
};
|
|
2213
2223
|
};
|
|
2214
|
-
readonly setupMcp: {
|
|
2215
|
-
readonly describe: "Configure the HubSpot CLI MCP (Model Context Protocol) server for use with Cursor.";
|
|
2216
|
-
readonly errors: {
|
|
2217
|
-
readonly serverNotFound: "hsmcp command not found. Please ensure the HubSpot CLI is properly installed and available in your PATH.";
|
|
2218
|
-
readonly installHint: "If you installed the CLI locally, make sure to install it globally with: npm install -g @hubspot/cli";
|
|
2219
|
-
readonly configurationFailed: "Failed to configure MCP server";
|
|
2220
|
-
};
|
|
2221
|
-
readonly warnings: {
|
|
2222
|
-
readonly alreadyConfigured: "MCP server is already configured.";
|
|
2223
|
-
};
|
|
2224
|
-
readonly success: {
|
|
2225
|
-
readonly configured: "MCP server successfully configured for Cursor.";
|
|
2226
|
-
readonly restartCursor: "Please restart Cursor to apply the changes.";
|
|
2227
|
-
};
|
|
2228
|
-
readonly instructions: {
|
|
2229
|
-
readonly title: "Manual MCP Server Configuration Instructions:";
|
|
2230
|
-
readonly step1: "1. Open or create the Cursor configuration file at:";
|
|
2231
|
-
readonly step2: "2. Add the following configuration to the file:";
|
|
2232
|
-
readonly step3: "3. Restart Cursor to apply the changes.";
|
|
2233
|
-
readonly documentation: "For more information, visit: https://docs.cursor.com/context/model-context-protocol";
|
|
2234
|
-
};
|
|
2235
|
-
readonly options: {
|
|
2236
|
-
readonly autoSetup: {
|
|
2237
|
-
readonly describe: "Automatically configure the MCP server in Cursor configuration";
|
|
2238
|
-
};
|
|
2239
|
-
readonly showInstructions: {
|
|
2240
|
-
readonly describe: "Display manual configuration instructions instead of auto-setup";
|
|
2241
|
-
};
|
|
2242
|
-
readonly global: {
|
|
2243
|
-
readonly describe: "Configure globally for all Cursor workspaces (default: true)";
|
|
2244
|
-
};
|
|
2245
|
-
};
|
|
2246
|
-
readonly prompts: {
|
|
2247
|
-
readonly selectAction: "How would you like to configure the MCP server?";
|
|
2248
|
-
readonly selectScope: "Configure MCP server for:";
|
|
2249
|
-
readonly overwrite: "MCP server is already configured. Overwrite existing configuration?";
|
|
2250
|
-
};
|
|
2251
|
-
readonly choices: {
|
|
2252
|
-
readonly autoSetup: "Automatically configure (recommended)";
|
|
2253
|
-
readonly showInstructions: "Show manual configuration instructions";
|
|
2254
|
-
readonly global: "Global (all Cursor workspaces)";
|
|
2255
|
-
readonly project: "Current project only";
|
|
2256
|
-
};
|
|
2257
|
-
readonly examples: {
|
|
2258
|
-
readonly default: "Configure the MCP server interactively";
|
|
2259
|
-
readonly autoSetup: "Automatically configure the MCP server";
|
|
2260
|
-
readonly autoSetupGlobal: "Automatically configure the MCP server globally";
|
|
2261
|
-
readonly autoSetupProject: "Automatically configure for current project only";
|
|
2262
|
-
readonly showInstructions: "Display manual configuration instructions";
|
|
2263
|
-
};
|
|
2264
|
-
};
|
|
2265
2224
|
};
|
|
2266
2225
|
export declare const lib: {
|
|
2267
2226
|
readonly process: {
|
|
@@ -2461,6 +2420,7 @@ Run ${string} to upgrade to version ${string}`;
|
|
|
2461
2420
|
};
|
|
2462
2421
|
};
|
|
2463
2422
|
readonly projectUpload: {
|
|
2423
|
+
readonly wrongPlatformVersionMetaFiles: `Detected components that require a minimum platform version of ${string}. You need to update your platform version in your hsproject.json and run ${string}`;
|
|
2464
2424
|
readonly uploadProjectFiles: {
|
|
2465
2425
|
readonly add: (projectName: string, accountIdentifier: string) => string;
|
|
2466
2426
|
readonly fail: (projectName: string, accountIdentifier: string) => string;
|
package/lang/en.js
CHANGED
|
@@ -8,6 +8,8 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const ui_1 = require("../lib/ui");
|
|
9
9
|
const urls_1 = require("../lib/projects/urls");
|
|
10
10
|
const ui_2 = require("../lib/ui");
|
|
11
|
+
const projects_1 = require("@hubspot/local-dev-lib/constants/projects");
|
|
12
|
+
const constants_1 = require("../lib/constants");
|
|
11
13
|
exports.commands = {
|
|
12
14
|
generalErrors: {
|
|
13
15
|
srcIsProject: (src, command) => `"${src}" is in a project folder. Did you mean "hs project ${command}"?`,
|
|
@@ -814,18 +816,26 @@ exports.commands = {
|
|
|
814
816
|
placeholderAccountSelection: 'Using default account as target account (for now)',
|
|
815
817
|
learnMoreLocalDevServer: 'Learn more about the projects local dev server',
|
|
816
818
|
accountTypeInformation: 'Testing in a developer test account is strongly recommended, but you can use a sandbox account if your plan allows you to create one.',
|
|
817
|
-
learnMoreMessage:
|
|
819
|
+
learnMoreMessage: `\nVisit our ${(0, ui_1.uiLink)('docs on Developer Test and Sandbox accounts', 'https://developers.hubspot.com/docs/getting-started/account-types')} to learn more.`,
|
|
818
820
|
},
|
|
819
821
|
errors: {
|
|
820
822
|
noProjectConfig: 'No project detected. Please run this command again from a project directory.',
|
|
821
|
-
noAccount: (accountId
|
|
823
|
+
noAccount: (accountId) => `An error occurred while reading account ${(0, ui_1.uiAccountDescription)(accountId)} from your config. Run ${(0, ui_1.uiCommandReference)('hs auth')} to re-auth this account.`,
|
|
822
824
|
noAccountsInConfig: (authCommand) => `No accounts found in your config. Run ${chalk_1.default.bold(authCommand)} to configure a HubSpot account with the CLI.`,
|
|
823
825
|
invalidProjectComponents: 'Projects cannot contain both private and public apps. Move your apps to separate projects before attempting local development.',
|
|
824
|
-
noRunnableComponents:
|
|
826
|
+
noRunnableComponents: `No supported components were found in this project. Run ${(0, ui_1.uiCommandReference)('hs project add')} to see a list of available components and add one to your project.`,
|
|
827
|
+
accountNotCombined: `\nLocal development of unified apps is currently only compatible with accounts that are opted into the unified apps beta. Make sure that this account is opted in or switch accounts using ${(0, ui_1.uiCommandReference)('hs account use')}.`,
|
|
828
|
+
unsupportedAccountFlagLegacy: 'The --projectAccount and --testingAccount flags are not supported for projects with platform versions earlier than 2025.2.',
|
|
829
|
+
unsupportedAccountFlagV3: 'The --account flag is is not supported supported for projects with platform versions 2025.2 and newer. Use --testingAccount and --projectAccount flags to specify accounts to use for local dev',
|
|
825
830
|
},
|
|
826
831
|
examples: {
|
|
827
832
|
default: 'Start local dev for the current project',
|
|
828
833
|
},
|
|
834
|
+
options: {
|
|
835
|
+
profile: 'The profile to target during local dev',
|
|
836
|
+
projectAccount: 'The id of the account to upload your project to. Only compatible with platform versions 2025.2 and above.',
|
|
837
|
+
testingAccount: 'The id of the account to install apps and test on. Only compatible with platform versions 2025.2 and above.',
|
|
838
|
+
},
|
|
829
839
|
},
|
|
830
840
|
create: {
|
|
831
841
|
describe: 'Create a new project.',
|
|
@@ -2213,57 +2223,6 @@ exports.commands = {
|
|
|
2213
2223
|
},
|
|
2214
2224
|
},
|
|
2215
2225
|
},
|
|
2216
|
-
setupMcp: {
|
|
2217
|
-
describe: 'Configure the HubSpot CLI MCP (Model Context Protocol) server for use with Cursor.',
|
|
2218
|
-
errors: {
|
|
2219
|
-
serverNotFound: 'hsmcp command not found. Please ensure the HubSpot CLI is properly installed and available in your PATH.',
|
|
2220
|
-
installHint: 'If you installed the CLI locally, make sure to install it globally with: npm install -g @hubspot/cli',
|
|
2221
|
-
configurationFailed: 'Failed to configure MCP server',
|
|
2222
|
-
},
|
|
2223
|
-
warnings: {
|
|
2224
|
-
alreadyConfigured: 'MCP server is already configured.',
|
|
2225
|
-
},
|
|
2226
|
-
success: {
|
|
2227
|
-
configured: 'MCP server successfully configured for Cursor.',
|
|
2228
|
-
restartCursor: 'Please restart Cursor to apply the changes.',
|
|
2229
|
-
},
|
|
2230
|
-
instructions: {
|
|
2231
|
-
title: 'Manual MCP Server Configuration Instructions:',
|
|
2232
|
-
step1: '1. Open or create the Cursor configuration file at:',
|
|
2233
|
-
step2: '2. Add the following configuration to the file:',
|
|
2234
|
-
step3: '3. Restart Cursor to apply the changes.',
|
|
2235
|
-
documentation: 'For more information, visit: https://docs.cursor.com/context/model-context-protocol',
|
|
2236
|
-
},
|
|
2237
|
-
options: {
|
|
2238
|
-
autoSetup: {
|
|
2239
|
-
describe: 'Automatically configure the MCP server in Cursor configuration',
|
|
2240
|
-
},
|
|
2241
|
-
showInstructions: {
|
|
2242
|
-
describe: 'Display manual configuration instructions instead of auto-setup',
|
|
2243
|
-
},
|
|
2244
|
-
global: {
|
|
2245
|
-
describe: 'Configure globally for all Cursor workspaces (default: true)',
|
|
2246
|
-
},
|
|
2247
|
-
},
|
|
2248
|
-
prompts: {
|
|
2249
|
-
selectAction: 'How would you like to configure the MCP server?',
|
|
2250
|
-
selectScope: 'Configure MCP server for:',
|
|
2251
|
-
overwrite: 'MCP server is already configured. Overwrite existing configuration?',
|
|
2252
|
-
},
|
|
2253
|
-
choices: {
|
|
2254
|
-
autoSetup: 'Automatically configure (recommended)',
|
|
2255
|
-
showInstructions: 'Show manual configuration instructions',
|
|
2256
|
-
global: 'Global (all Cursor workspaces)',
|
|
2257
|
-
project: 'Current project only',
|
|
2258
|
-
},
|
|
2259
|
-
examples: {
|
|
2260
|
-
default: 'Configure the MCP server interactively',
|
|
2261
|
-
autoSetup: 'Automatically configure the MCP server',
|
|
2262
|
-
autoSetupGlobal: 'Automatically configure the MCP server globally',
|
|
2263
|
-
autoSetupProject: 'Automatically configure for current project only',
|
|
2264
|
-
showInstructions: 'Display manual configuration instructions',
|
|
2265
|
-
},
|
|
2266
|
-
},
|
|
2267
2226
|
};
|
|
2268
2227
|
exports.lib = {
|
|
2269
2228
|
process: {
|
|
@@ -2460,6 +2419,7 @@ exports.lib = {
|
|
|
2460
2419
|
},
|
|
2461
2420
|
},
|
|
2462
2421
|
projectUpload: {
|
|
2422
|
+
wrongPlatformVersionMetaFiles: `Detected components that require a minimum platform version of ${projects_1.PLATFORM_VERSIONS.v2025_2}. You need to update your platform version in your ${constants_1.PROJECT_CONFIG_FILE} and run ${(0, ui_1.uiCommandReference)('hs project upload')}`,
|
|
2463
2423
|
uploadProjectFiles: {
|
|
2464
2424
|
add: (projectName, accountIdentifier) => `Uploading ${chalk_1.default.bold(projectName)} project files to ${accountIdentifier}`,
|
|
2465
2425
|
fail: (projectName, accountIdentifier) => `Failed to upload ${chalk_1.default.bold(projectName)} project files to ${accountIdentifier}`,
|
package/lib/accountTypes.js
CHANGED
|
@@ -39,7 +39,5 @@ async function isUnifiedAccount(account) {
|
|
|
39
39
|
if (!accountId) {
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
return ((isStandardAccount(account) || isAppDeveloperAccount(account)) &&
|
|
44
|
-
isUngatedForUnifiedApps);
|
|
42
|
+
return (0, hasFeature_1.hasFeature)(accountId, constants_1.FEATURES.UNIFIED_APPS);
|
|
45
43
|
}
|
package/lib/commonOpts.d.ts
CHANGED
|
@@ -16,9 +16,7 @@ export declare function setLogLevel(options: Arguments<{
|
|
|
16
16
|
debug?: boolean;
|
|
17
17
|
networkDebug?: boolean;
|
|
18
18
|
}>): void;
|
|
19
|
-
export declare function getCommandName(argv: Arguments
|
|
20
|
-
_?: string[];
|
|
21
|
-
}>): string;
|
|
19
|
+
export declare function getCommandName(argv: Arguments): string;
|
|
22
20
|
export declare function getCmsPublishMode(options: Arguments<{
|
|
23
21
|
cmsPublishMode?: CmsPublishMode;
|
|
24
22
|
derivedAccountId?: number;
|
package/lib/commonOpts.js
CHANGED
|
@@ -138,7 +138,7 @@ function setLogLevel(options) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
function getCommandName(argv) {
|
|
141
|
-
return (argv && argv._ && argv._[0]) || '';
|
|
141
|
+
return String(argv && argv._ && argv._[0]) || '';
|
|
142
142
|
}
|
|
143
143
|
function getCmsPublishMode(options) {
|
|
144
144
|
// 1. --cmsPublishMode
|
|
@@ -112,10 +112,12 @@ async function logFireAlarms(accountId, command, version) {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
async function checkFireAlarms(
|
|
116
|
-
const { derivedAccountId } =
|
|
115
|
+
async function checkFireAlarms(argv) {
|
|
116
|
+
const { derivedAccountId } = argv;
|
|
117
117
|
try {
|
|
118
|
-
|
|
118
|
+
if (derivedAccountId) {
|
|
119
|
+
await logFireAlarms(derivedAccountId, argv._.join(' '), package_json_1.default.version);
|
|
120
|
+
}
|
|
119
121
|
}
|
|
120
122
|
catch (error) {
|
|
121
123
|
(0, errorHandlers_1.debugError)(error);
|
|
@@ -98,12 +98,6 @@ class AppDevModeInterface {
|
|
|
98
98
|
if (!this.appNode || !this.appData) {
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
// If the app is static auth, always prompt the user to install the app.
|
|
102
|
-
// We are currently going this because we have no method to determine if the static auth app
|
|
103
|
-
// is already installed in the portal
|
|
104
|
-
if (this.appNode.config.auth.type === constants_1.APP_AUTH_TYPES.STATIC) {
|
|
105
|
-
return (0, installAppPrompt_1.installAppPrompt)(await this.getAppInstallUrl(), false);
|
|
106
|
-
}
|
|
107
101
|
const { data: { isInstalledWithScopeGroups, previouslyAuthorizedScopeGroups }, } = await (0, localDevAuth_1.fetchAppInstallationData)(this.localDevState.targetTestingAccountId, this.localDevState.projectId, this.appNode.uid, this.appNode.config.auth.requiredScopes, this.appNode.config.auth.optionalScopes);
|
|
108
102
|
const isReinstall = previouslyAuthorizedScopeGroups.length > 0;
|
|
109
103
|
if (!isInstalledWithScopeGroups) {
|
package/lib/projects/upload.js
CHANGED
|
@@ -19,6 +19,7 @@ const node_util_1 = __importDefault(require("node:util"));
|
|
|
19
19
|
const en_1 = require("../../lang/en");
|
|
20
20
|
const ensureProjectExists_1 = require("./ensureProjectExists");
|
|
21
21
|
const logger_1 = require("../ui/logger");
|
|
22
|
+
const buildAndDeploy_1 = require("./buildAndDeploy");
|
|
22
23
|
async function uploadProjectFiles(accountId, projectName, filePath, uploadMessage, platformVersion, intermediateRepresentation) {
|
|
23
24
|
SpinniesManager_1.default.init({});
|
|
24
25
|
const accountIdentifier = (0, ui_1.uiAccountDescription)(accountId);
|
|
@@ -53,6 +54,11 @@ async function handleProjectUpload({ accountId, projectConfig, projectDir, callb
|
|
|
53
54
|
logger_1.uiLogger.log(en_1.lib.projectUpload.handleProjectUpload.emptySource(projectConfig.srcDir));
|
|
54
55
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
55
56
|
}
|
|
57
|
+
const hasHsMetaFiles = await (0, project_parsing_lib_1.projectContainsHsMetaFiles)(srcDir);
|
|
58
|
+
if (!(0, buildAndDeploy_1.useV3Api)(projectConfig.platformVersion) && hasHsMetaFiles) {
|
|
59
|
+
logger_1.uiLogger.error(en_1.lib.projectUpload.wrongPlatformVersionMetaFiles);
|
|
60
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
61
|
+
}
|
|
56
62
|
const tempFile = tmp_1.default.fileSync({ postfix: '.zip' });
|
|
57
63
|
logger_1.uiLogger.debug(en_1.lib.projectUpload.handleProjectUpload.compressing(tempFile.name));
|
|
58
64
|
const output = fs_extra_1.default.createWriteStream(tempFile.name);
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.1-experimental.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@hubspot/local-dev-lib": "3.7.0",
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.2.0",
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.2.2-beta.0",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.2",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.8.52",
|
|
13
|
-
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
14
13
|
"archiver": "7.0.1",
|
|
15
14
|
"boxen": "8.0.1",
|
|
16
15
|
"chalk": "4.1.2",
|
|
@@ -22,7 +21,6 @@
|
|
|
22
21
|
"fs-extra": "8.1.0",
|
|
23
22
|
"inquirer": "8.2.0",
|
|
24
23
|
"js-yaml": "4.1.0",
|
|
25
|
-
"mcp-framework": "^0.2.2",
|
|
26
24
|
"moment": "2.30.1",
|
|
27
25
|
"open": "7.4.2",
|
|
28
26
|
"p-queue": "6.6.2",
|
|
@@ -48,7 +46,7 @@
|
|
|
48
46
|
"@types/yargs": "^17.0.33",
|
|
49
47
|
"@typescript-eslint/eslint-plugin": "^8.30.1",
|
|
50
48
|
"@typescript-eslint/parser": "^8.11.0",
|
|
51
|
-
"axios": "^1.7.
|
|
49
|
+
"axios": "^1.7.4",
|
|
52
50
|
"eslint": "^8.56.0",
|
|
53
51
|
"eslint-plugin-import": "^2.31.0",
|
|
54
52
|
"husky": "^4.3.8",
|
|
@@ -100,8 +98,7 @@
|
|
|
100
98
|
},
|
|
101
99
|
"bin": {
|
|
102
100
|
"hs": "./bin/hs",
|
|
103
|
-
"hscms": "./bin/hscms"
|
|
104
|
-
"hsmcp": "./bin/hsmcp.js"
|
|
101
|
+
"hscms": "./bin/hscms"
|
|
105
102
|
},
|
|
106
103
|
"publishConfig": {
|
|
107
104
|
"access": "public",
|
package/types/Yargs.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type StringArgType = Options & {
|
|
|
26
26
|
};
|
|
27
27
|
export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs & {
|
|
28
28
|
profile?: string;
|
|
29
|
+
testingAccount?: string | number;
|
|
30
|
+
projectAccount?: string | number;
|
|
29
31
|
};
|
|
30
32
|
export type TestingArgs = {
|
|
31
33
|
qa?: boolean;
|
package/bin/hsmcp.d.ts
DELETED
package/bin/hsmcp.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
console.log('Starting MCP server...');
|
|
4
|
-
try {
|
|
5
|
-
require('../mcp-server/index');
|
|
6
|
-
}
|
|
7
|
-
catch (error) {
|
|
8
|
-
console.error('Failed to start MCP server:');
|
|
9
|
-
console.error('Error name:', error.name || 'Unknown');
|
|
10
|
-
console.error('Error message:', error.message || 'No message');
|
|
11
|
-
console.error('Full error:', error);
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const project_parsing_lib_1 = require("@hubspot/project-parsing-lib");
|
|
8
|
-
const project_parsing_lib_2 = require("@hubspot/project-parsing-lib");
|
|
9
|
-
const ui_1 = require("../../lib/ui");
|
|
10
|
-
const config_1 = require("../../lib/projects/config");
|
|
11
|
-
const lang_1 = require("../../lib/lang");
|
|
12
|
-
const index_1 = require("../../lib/errorHandlers/index");
|
|
13
|
-
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
14
|
-
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
15
|
-
const logger_1 = require("../../lib/ui/logger");
|
|
16
|
-
const command = 'validate';
|
|
17
|
-
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.project.subcommands.validate.describe`), false);
|
|
18
|
-
async function handler(args) {
|
|
19
|
-
const { derivedAccountId } = args;
|
|
20
|
-
const { projectConfig, projectDir } = await (0, config_1.getProjectConfig)();
|
|
21
|
-
(0, config_1.validateProjectConfig)(projectConfig, projectDir);
|
|
22
|
-
try {
|
|
23
|
-
await (0, project_parsing_lib_2.translate)({
|
|
24
|
-
projectSourceDir: path_1.default.join(projectDir, projectConfig.srcDir),
|
|
25
|
-
platformVersion: projectConfig.platformVersion,
|
|
26
|
-
accountId: derivedAccountId,
|
|
27
|
-
});
|
|
28
|
-
logger_1.uiLogger.success('Project validated successfully. No Errors');
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
if ((0, project_parsing_lib_1.isTranslationError)(e)) {
|
|
32
|
-
logger_1.uiLogger.error(e.toString());
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
(0, index_1.logError)(e);
|
|
36
|
-
}
|
|
37
|
-
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
38
|
-
}
|
|
39
|
-
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
40
|
-
}
|
|
41
|
-
function projectValidateBuilder(yargs) {
|
|
42
|
-
return yargs;
|
|
43
|
-
}
|
|
44
|
-
const builder = (0, yargsUtils_1.makeYargsBuilder)(projectValidateBuilder, command, describe, {
|
|
45
|
-
useGlobalOptions: true,
|
|
46
|
-
});
|
|
47
|
-
const projectValidateCommand = {
|
|
48
|
-
command,
|
|
49
|
-
describe,
|
|
50
|
-
handler,
|
|
51
|
-
builder,
|
|
52
|
-
};
|
|
53
|
-
exports.default = projectValidateCommand;
|
package/commands/setupMcp.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CommonArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
|
-
type SetupMcpArgs = CommonArgs & {
|
|
3
|
-
autoSetup?: boolean;
|
|
4
|
-
showInstructions?: boolean;
|
|
5
|
-
global?: boolean;
|
|
6
|
-
};
|
|
7
|
-
declare const setupMcpCommand: YargsCommandModule<unknown, SetupMcpArgs>;
|
|
8
|
-
export default setupMcpCommand;
|