@hubspot/cli 8.0.10-experimental.7 → 8.0.11-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/api/__tests__/migrate.test.d.ts +1 -0
- package/api/__tests__/migrate.test.js +199 -0
- package/commands/__tests__/account.test.d.ts +1 -0
- package/commands/__tests__/account.test.js +69 -0
- package/commands/__tests__/auth.test.d.ts +1 -0
- package/commands/__tests__/auth.test.js +43 -0
- package/commands/__tests__/cms.test.d.ts +1 -0
- package/commands/__tests__/cms.test.js +87 -0
- package/commands/__tests__/config.test.d.ts +1 -0
- package/commands/__tests__/config.test.js +44 -0
- package/commands/__tests__/customObject.test.d.ts +1 -0
- package/commands/__tests__/customObject.test.js +68 -0
- package/commands/__tests__/doctor.test.d.ts +1 -0
- package/commands/__tests__/doctor.test.js +132 -0
- package/commands/__tests__/feedback.test.d.ts +1 -0
- package/commands/__tests__/feedback.test.js +24 -0
- package/commands/__tests__/filemanager.test.d.ts +1 -0
- package/commands/__tests__/filemanager.test.js +45 -0
- package/commands/__tests__/getStarted.test.d.ts +1 -0
- package/commands/__tests__/getStarted.test.js +173 -0
- package/commands/__tests__/hubdb.test.d.ts +1 -0
- package/commands/__tests__/hubdb.test.js +50 -0
- package/commands/__tests__/init.test.d.ts +1 -0
- package/commands/__tests__/init.test.js +42 -0
- package/commands/__tests__/mcp.test.d.ts +1 -0
- package/commands/__tests__/mcp.test.js +46 -0
- package/commands/__tests__/open.test.d.ts +1 -0
- package/commands/__tests__/open.test.js +58 -0
- package/commands/__tests__/project.test.d.ts +1 -0
- package/commands/__tests__/project.test.js +125 -0
- package/commands/__tests__/sandbox.test.d.ts +1 -0
- package/commands/__tests__/sandbox.test.js +44 -0
- package/commands/__tests__/secret.test.d.ts +1 -0
- package/commands/__tests__/secret.test.js +49 -0
- package/commands/__tests__/testAccount.test.d.ts +1 -0
- package/commands/__tests__/testAccount.test.js +57 -0
- package/commands/__tests__/upgrade.test.d.ts +1 -0
- package/commands/__tests__/upgrade.test.js +309 -0
- package/commands/account/__tests__/auth.test.d.ts +1 -0
- package/commands/account/__tests__/auth.test.js +206 -0
- package/commands/account/__tests__/clean.test.d.ts +1 -0
- package/commands/account/__tests__/clean.test.js +28 -0
- package/commands/account/__tests__/createOverride.test.d.ts +1 -0
- package/commands/account/__tests__/createOverride.test.js +32 -0
- package/commands/account/__tests__/info.test.d.ts +1 -0
- package/commands/account/__tests__/info.test.js +28 -0
- package/commands/account/__tests__/list.test.d.ts +1 -0
- package/commands/account/__tests__/list.test.js +153 -0
- package/commands/account/__tests__/remove.test.d.ts +1 -0
- package/commands/account/__tests__/remove.test.js +36 -0
- package/commands/account/__tests__/removeOverride.d.ts +1 -0
- package/commands/account/__tests__/removeOverride.js +25 -0
- package/commands/account/__tests__/rename.test.d.ts +1 -0
- package/commands/account/__tests__/rename.test.js +82 -0
- package/commands/account/__tests__/use.test.d.ts +1 -0
- package/commands/account/__tests__/use.test.js +170 -0
- package/commands/app/__tests__/migrate.test.d.ts +1 -0
- package/commands/app/__tests__/migrate.test.js +111 -0
- package/commands/app/secret/__tests__/add.test.d.ts +1 -0
- package/commands/app/secret/__tests__/add.test.js +140 -0
- package/commands/app/secret/__tests__/delete.test.d.ts +1 -0
- package/commands/app/secret/__tests__/delete.test.js +28 -0
- package/commands/app/secret/__tests__/list.test.d.ts +1 -0
- package/commands/app/secret/__tests__/list.test.js +25 -0
- package/commands/app/secret/__tests__/update.test.d.ts +1 -0
- package/commands/app/secret/__tests__/update.test.js +28 -0
- package/commands/cms/__tests__/delete.test.d.ts +1 -0
- package/commands/cms/__tests__/delete.test.js +39 -0
- package/commands/cms/__tests__/fetch.test.d.ts +1 -0
- package/commands/cms/__tests__/fetch.test.js +156 -0
- package/commands/cms/__tests__/function.test.d.ts +1 -0
- package/commands/cms/__tests__/function.test.js +50 -0
- package/commands/cms/__tests__/lint.test.d.ts +1 -0
- package/commands/cms/__tests__/lint.test.js +33 -0
- package/commands/cms/__tests__/list.test.d.ts +1 -0
- package/commands/cms/__tests__/list.test.js +42 -0
- package/commands/cms/__tests__/module.test.d.ts +1 -0
- package/commands/cms/__tests__/module.test.js +45 -0
- package/commands/cms/__tests__/mv.test.d.ts +1 -0
- package/commands/cms/__tests__/mv.test.js +46 -0
- package/commands/cms/__tests__/theme.test.d.ts +1 -0
- package/commands/cms/__tests__/theme.test.js +54 -0
- package/commands/cms/__tests__/upload.test.d.ts +1 -0
- package/commands/cms/__tests__/upload.test.js +312 -0
- package/commands/cms/__tests__/watch.test.d.ts +1 -0
- package/commands/cms/__tests__/watch.test.js +204 -0
- package/commands/cms/function/__tests__/logs.test.d.ts +1 -0
- package/commands/cms/function/__tests__/logs.test.js +70 -0
- package/commands/cms/theme/__tests__/generate-selectors.test.d.ts +1 -0
- package/commands/cms/theme/__tests__/generate-selectors.test.js +28 -0
- package/commands/cms/theme/__tests__/marketplace-validate.test.d.ts +1 -0
- package/commands/cms/theme/__tests__/marketplace-validate.test.js +36 -0
- package/commands/cms/theme/__tests__/preview.test.d.ts +1 -0
- package/commands/cms/theme/__tests__/preview.test.js +54 -0
- package/commands/customObject/__tests__/create.test.d.ts +1 -0
- package/commands/customObject/__tests__/create.test.js +40 -0
- package/commands/customObject/__tests__/createSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/createSchema.test.js +28 -0
- package/commands/customObject/__tests__/deleteSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/deleteSchema.test.js +42 -0
- package/commands/customObject/__tests__/fetch-all-schemas.test.d.ts +1 -0
- package/commands/customObject/__tests__/fetch-all-schemas.test.js +41 -0
- package/commands/customObject/__tests__/fetchSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/fetchSchema.test.js +45 -0
- package/commands/customObject/__tests__/listSchemas.test.d.ts +1 -0
- package/commands/customObject/__tests__/listSchemas.test.js +29 -0
- package/commands/customObject/__tests__/updateSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/updateSchema.test.js +40 -0
- package/commands/filemanager/__tests__/fetch.test.d.ts +1 -0
- package/commands/filemanager/__tests__/fetch.test.js +32 -0
- package/commands/filemanager/__tests__/upload.test.d.ts +1 -0
- package/commands/filemanager/__tests__/upload.test.js +191 -0
- package/commands/hubdb/__tests__/clear.test.d.ts +1 -0
- package/commands/hubdb/__tests__/clear.test.js +28 -0
- package/commands/hubdb/__tests__/create.test.d.ts +1 -0
- package/commands/hubdb/__tests__/create.test.js +28 -0
- package/commands/hubdb/__tests__/delete.test.d.ts +1 -0
- package/commands/hubdb/__tests__/delete.test.js +28 -0
- package/commands/hubdb/__tests__/fetch.test.d.ts +1 -0
- package/commands/hubdb/__tests__/fetch.test.js +28 -0
- package/commands/hubdb/__tests__/list.test.d.ts +1 -0
- package/commands/hubdb/__tests__/list.test.js +88 -0
- package/commands/mcp/__tests__/setup.test.d.ts +1 -0
- package/commands/mcp/__tests__/setup.test.js +26 -0
- package/commands/mcp/__tests__/start.test.d.ts +1 -0
- package/commands/mcp/__tests__/start.test.js +144 -0
- package/commands/project/__tests__/add.test.d.ts +1 -0
- package/commands/project/__tests__/add.test.js +107 -0
- package/commands/project/__tests__/create.test.d.ts +1 -0
- package/commands/project/__tests__/create.test.js +97 -0
- package/commands/project/__tests__/deploy.test.d.ts +1 -0
- package/commands/project/__tests__/deploy.test.js +307 -0
- package/commands/project/__tests__/dev.test.d.ts +1 -0
- package/commands/project/__tests__/dev.test.js +273 -0
- package/commands/project/__tests__/devUnifiedFlow.test.d.ts +1 -0
- package/commands/project/__tests__/devUnifiedFlow.test.js +434 -0
- package/commands/project/__tests__/download.test.d.ts +1 -0
- package/commands/project/__tests__/download.test.js +39 -0
- package/commands/project/__tests__/info.test.d.ts +1 -0
- package/commands/project/__tests__/info.test.js +145 -0
- package/commands/project/__tests__/installDeps.test.d.ts +1 -0
- package/commands/project/__tests__/installDeps.test.js +140 -0
- package/commands/project/__tests__/lint.test.d.ts +1 -0
- package/commands/project/__tests__/lint.test.js +704 -0
- package/commands/project/__tests__/list.test.d.ts +1 -0
- package/commands/project/__tests__/list.test.js +31 -0
- package/commands/project/__tests__/listBuilds.test.d.ts +1 -0
- package/commands/project/__tests__/listBuilds.test.js +38 -0
- package/commands/project/__tests__/logs.test.d.ts +1 -0
- package/commands/project/__tests__/logs.test.js +202 -0
- package/commands/project/__tests__/migrate.test.d.ts +1 -0
- package/commands/project/__tests__/migrate.test.js +106 -0
- package/commands/project/__tests__/open.test.d.ts +1 -0
- package/commands/project/__tests__/open.test.js +39 -0
- package/commands/project/__tests__/profile.test.d.ts +1 -0
- package/commands/project/__tests__/profile.test.js +42 -0
- package/commands/project/__tests__/updateDeps.test.d.ts +1 -0
- package/commands/project/__tests__/updateDeps.test.js +140 -0
- package/commands/project/__tests__/upload.test.d.ts +1 -0
- package/commands/project/__tests__/upload.test.js +234 -0
- package/commands/project/__tests__/validate.test.d.ts +1 -0
- package/commands/project/__tests__/validate.test.js +381 -0
- package/commands/project/__tests__/watch.test.d.ts +1 -0
- package/commands/project/__tests__/watch.test.js +35 -0
- package/commands/project/info.d.ts +4 -0
- package/commands/project/info.js +67 -0
- package/commands/project.js +2 -0
- package/commands/sandbox/__tests__/create.test.d.ts +1 -0
- package/commands/sandbox/__tests__/create.test.js +198 -0
- package/commands/sandbox/__tests__/delete.test.d.ts +1 -0
- package/commands/sandbox/__tests__/delete.test.js +31 -0
- package/commands/secret/__tests__/addSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/addSecret.test.js +162 -0
- package/commands/secret/__tests__/deleteSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/deleteSecret.test.js +41 -0
- package/commands/secret/__tests__/listSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/listSecret.test.js +29 -0
- package/commands/secret/__tests__/updateSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/updateSecret.test.js +29 -0
- package/commands/testAccount/__tests__/create.test.d.ts +1 -0
- package/commands/testAccount/__tests__/create.test.js +106 -0
- package/commands/testAccount/__tests__/createConfig.test.d.ts +1 -0
- package/commands/testAccount/__tests__/createConfig.test.js +32 -0
- package/commands/testAccount/__tests__/delete.test.d.ts +1 -0
- package/commands/testAccount/__tests__/delete.test.js +29 -0
- package/commands/testAccount/__tests__/importData.test.d.ts +1 -0
- package/commands/testAccount/__tests__/importData.test.js +92 -0
- package/lang/en.d.ts +31 -0
- package/lang/en.js +31 -0
- package/lib/__tests__/CLIWebSocketServer.test.d.ts +1 -0
- package/lib/__tests__/CLIWebSocketServer.test.js +252 -0
- package/lib/__tests__/accountAuth.test.d.ts +1 -0
- package/lib/__tests__/accountAuth.test.js +258 -0
- package/lib/__tests__/accountTypes.test.d.ts +1 -0
- package/lib/__tests__/accountTypes.test.js +98 -0
- package/lib/__tests__/buildAccount.test.d.ts +1 -0
- package/lib/__tests__/buildAccount.test.js +211 -0
- package/lib/__tests__/cliUpgradeUtils.test.d.ts +1 -0
- package/lib/__tests__/cliUpgradeUtils.test.js +131 -0
- package/lib/__tests__/commandSuggestion.test.d.ts +1 -0
- package/lib/__tests__/commandSuggestion.test.js +121 -0
- package/lib/__tests__/commonOpts.test.d.ts +1 -0
- package/lib/__tests__/commonOpts.test.js +80 -0
- package/lib/__tests__/dependencyManagement.test.d.ts +1 -0
- package/lib/__tests__/dependencyManagement.test.js +1067 -0
- package/lib/__tests__/developerTestAccounts.test.d.ts +1 -0
- package/lib/__tests__/developerTestAccounts.test.js +156 -0
- package/lib/__tests__/hasFeature.test.d.ts +1 -0
- package/lib/__tests__/hasFeature.test.js +167 -0
- package/lib/__tests__/http.test.d.ts +1 -0
- package/lib/__tests__/http.test.js +40 -0
- package/lib/__tests__/importData.test.d.ts +1 -0
- package/lib/__tests__/importData.test.js +98 -0
- package/lib/__tests__/npmCli.test.d.ts +1 -0
- package/lib/__tests__/npmCli.test.js +84 -0
- package/lib/__tests__/oauth.test.d.ts +1 -0
- package/lib/__tests__/oauth.test.js +109 -0
- package/lib/__tests__/parsing.test.d.ts +1 -0
- package/lib/__tests__/parsing.test.js +34 -0
- package/lib/__tests__/polling.test.d.ts +1 -0
- package/lib/__tests__/polling.test.js +76 -0
- package/lib/__tests__/process.test.d.ts +1 -0
- package/lib/__tests__/process.test.js +89 -0
- package/lib/__tests__/sandboxes.test.d.ts +1 -0
- package/lib/__tests__/sandboxes.test.js +128 -0
- package/lib/__tests__/serverlessLogs.test.d.ts +1 -0
- package/lib/__tests__/serverlessLogs.test.js +163 -0
- package/lib/__tests__/usageTracking.test.d.ts +1 -0
- package/lib/__tests__/usageTracking.test.js +197 -0
- package/lib/__tests__/validation.test.d.ts +1 -0
- package/lib/__tests__/validation.test.js +143 -0
- package/lib/__tests__/yargsUtils.test.d.ts +1 -0
- package/lib/__tests__/yargsUtils.test.js +124 -0
- package/lib/app/__tests__/migrate.test.d.ts +1 -0
- package/lib/app/__tests__/migrate.test.js +638 -0
- package/lib/doctor/__tests__/Diagnosis.test.d.ts +1 -0
- package/lib/doctor/__tests__/Diagnosis.test.js +84 -0
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.d.ts +1 -0
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +177 -0
- package/lib/doctor/__tests__/Doctor.test.d.ts +1 -0
- package/lib/doctor/__tests__/Doctor.test.js +560 -0
- package/lib/errorHandlers/__tests__/index.test.d.ts +1 -0
- package/lib/errorHandlers/__tests__/index.test.js +278 -0
- package/lib/mcp/__tests__/setup.test.d.ts +1 -0
- package/lib/mcp/__tests__/setup.test.js +523 -0
- package/lib/middleware/__tests__/commandTargetingUtils.test.d.ts +1 -0
- package/lib/middleware/__tests__/commandTargetingUtils.test.js +99 -0
- package/lib/middleware/__tests__/configMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/configMiddleware.test.js +118 -0
- package/lib/middleware/__tests__/gitMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/gitMiddleware.test.js +43 -0
- package/lib/middleware/__tests__/requestMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/requestMiddleware.test.js +15 -0
- 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.d.ts +1 -0
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.js +39 -0
- package/lib/projects/__tests__/AppDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/AppDevModeInterface.test.js +541 -0
- package/lib/projects/__tests__/DevServerManager.test.d.ts +1 -0
- package/lib/projects/__tests__/DevServerManager.test.js +185 -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.d.ts +1 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +481 -0
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.d.ts +1 -0
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +231 -0
- package/lib/projects/__tests__/ProjectLogsManager.test.d.ts +1 -0
- package/lib/projects/__tests__/ProjectLogsManager.test.js +302 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +160 -0
- package/lib/projects/__tests__/components.test.d.ts +1 -0
- package/lib/projects/__tests__/components.test.js +440 -0
- package/lib/projects/__tests__/deploy.test.d.ts +1 -0
- package/lib/projects/__tests__/deploy.test.js +231 -0
- package/lib/projects/__tests__/localDevProjectHelpers.test.d.ts +1 -0
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +120 -0
- package/lib/projects/__tests__/platformVersion.test.d.ts +1 -0
- package/lib/projects/__tests__/platformVersion.test.js +63 -0
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.d.ts +1 -0
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.js +328 -0
- package/lib/projects/__tests__/projectInfo.test.d.ts +1 -0
- package/lib/projects/__tests__/projectInfo.test.js +114 -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.d.ts +1 -0
- package/lib/projects/__tests__/projects.test.js +58 -0
- package/lib/projects/__tests__/structure.test.d.ts +1 -0
- package/lib/projects/__tests__/structure.test.js +210 -0
- package/lib/projects/__tests__/uieLinting.test.d.ts +1 -0
- package/lib/projects/__tests__/uieLinting.test.js +631 -0
- package/lib/projects/__tests__/upload.test.d.ts +1 -0
- package/lib/projects/__tests__/upload.test.js +183 -0
- package/lib/projects/add/__tests__/legacyAddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +245 -0
- package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/v2AddComponent.test.js +343 -0
- package/lib/projects/create/__tests__/legacy.test.d.ts +1 -0
- package/lib/projects/create/__tests__/legacy.test.js +72 -0
- package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
- package/lib/projects/create/__tests__/v2.test.js +257 -0
- package/lib/projects/projectInfo.d.ts +22 -0
- package/lib/projects/projectInfo.js +104 -0
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.js +157 -0
- package/lib/prompts/__tests__/createFunctionPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createFunctionPrompt.test.js +129 -0
- package/lib/prompts/__tests__/createModulePrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createModulePrompt.test.js +187 -0
- package/lib/prompts/__tests__/createTemplatePrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createTemplatePrompt.test.js +102 -0
- package/lib/prompts/__tests__/downloadProjectPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +31 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.js +143 -0
- package/lib/prompts/__tests__/projectsLogsPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +37 -0
- package/lib/prompts/__tests__/selectProjectTemplatePrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/selectProjectTemplatePrompt.test.js +160 -0
- package/lib/theme/__tests__/migrate.test.d.ts +1 -0
- package/lib/theme/__tests__/migrate.test.js +247 -0
- package/lib/ui/__tests__/SpinniesManager.test.d.ts +1 -0
- package/lib/ui/__tests__/SpinniesManager.test.js +488 -0
- package/lib/ui/__tests__/removeAnsiCodes.test.d.ts +1 -0
- package/lib/ui/__tests__/removeAnsiCodes.test.js +84 -0
- package/mcp-server/tools/cms/HsCreateTemplateTool.d.ts +1 -1
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +254 -0
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.js +227 -0
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.js +208 -0
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.js +186 -0
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.js +124 -0
- package/mcp-server/tools/cms/__tests__/HsListTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsListTool.test.js +124 -0
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.js +157 -0
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +131 -0
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +461 -0
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.js +125 -0
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +125 -0
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +210 -0
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +146 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +124 -0
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.js +307 -0
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +242 -0
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +209 -0
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +158 -0
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +187 -0
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +118 -0
- package/mcp-server/utils/__tests__/command.test.d.ts +1 -0
- package/mcp-server/utils/__tests__/command.test.js +275 -0
- package/mcp-server/utils/__tests__/content.test.d.ts +1 -0
- package/mcp-server/utils/__tests__/content.test.js +164 -0
- package/mcp-server/utils/__tests__/feedbackTracking.test.d.ts +1 -0
- package/mcp-server/utils/__tests__/feedbackTracking.test.js +69 -0
- package/package.json +2 -6
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import * as commonOpts from '../../lib/commonOpts.js';
|
|
3
|
+
import feedbackCommand from '../feedback.js';
|
|
4
|
+
vi.mock('yargs');
|
|
5
|
+
vi.mock('../../lib/commonOpts');
|
|
6
|
+
describe('commands/feedback', () => {
|
|
7
|
+
describe('command', () => {
|
|
8
|
+
it('should have the correct command structure', () => {
|
|
9
|
+
expect(feedbackCommand.command).toEqual('feedback');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe('describe', () => {
|
|
13
|
+
it('should provide a description', () => {
|
|
14
|
+
expect(feedbackCommand.describe).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe('builder', () => {
|
|
18
|
+
it('should support the correct options', () => {
|
|
19
|
+
feedbackCommand.builder(yargs);
|
|
20
|
+
expect(commonOpts.addGlobalOptions).toHaveBeenCalledTimes(1);
|
|
21
|
+
expect(commonOpts.addGlobalOptions).toHaveBeenCalledWith(yargs);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import fetch from '../filemanager/fetch.js';
|
|
3
|
+
import upload from '../filemanager/upload.js';
|
|
4
|
+
import fileManagerCommands from '../filemanager.js';
|
|
5
|
+
vi.mock('../filemanager/fetch');
|
|
6
|
+
vi.mock('../filemanager/upload');
|
|
7
|
+
vi.mock('../../lib/commonOpts');
|
|
8
|
+
const commandSpy = vi
|
|
9
|
+
.spyOn(yargs, 'command')
|
|
10
|
+
.mockReturnValue(yargs);
|
|
11
|
+
const demandCommandSpy = vi
|
|
12
|
+
.spyOn(yargs, 'demandCommand')
|
|
13
|
+
.mockReturnValue(yargs);
|
|
14
|
+
describe('commands/filemanager', () => {
|
|
15
|
+
describe('command', () => {
|
|
16
|
+
it('should have the correct command structure', () => {
|
|
17
|
+
expect(fileManagerCommands.command).toEqual('filemanager');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('describe', () => {
|
|
21
|
+
it('should provide a description', () => {
|
|
22
|
+
expect(fileManagerCommands.describe).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
describe('builder', () => {
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
commandSpy.mockClear();
|
|
28
|
+
demandCommandSpy.mockClear();
|
|
29
|
+
});
|
|
30
|
+
const subcommands = [fetch, upload];
|
|
31
|
+
it('should demand the command takes one positional argument', () => {
|
|
32
|
+
fileManagerCommands.builder(yargs);
|
|
33
|
+
expect(demandCommandSpy).toHaveBeenCalledTimes(1);
|
|
34
|
+
expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
|
|
35
|
+
});
|
|
36
|
+
it('should add the correct number of sub commands', () => {
|
|
37
|
+
fileManagerCommands.builder(yargs);
|
|
38
|
+
expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
|
|
39
|
+
});
|
|
40
|
+
it.each(subcommands)('should attach the %s subcommand', module => {
|
|
41
|
+
fileManagerCommands.builder(yargs);
|
|
42
|
+
expect(commandSpy).toHaveBeenCalledWith(module);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import getStartedCommand from '../getStarted.js';
|
|
2
|
+
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
3
|
+
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
4
|
+
import { getConfigAccountById } from '@hubspot/local-dev-lib/config';
|
|
5
|
+
import { projectNameAndDestPrompt } from '../../lib/prompts/projectNameAndDestPrompt.js';
|
|
6
|
+
import { cloneGithubRepo } from '@hubspot/local-dev-lib/github';
|
|
7
|
+
import { getProjectConfig, writeProjectConfig, } from '../../lib/projects/config.js';
|
|
8
|
+
import { getProjectPackageJsonLocations, installPackages, } from '../../lib/dependencyManagement.js';
|
|
9
|
+
import { GET_STARTED_OPTIONS } from '../../lib/constants.js';
|
|
10
|
+
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
11
|
+
import open from 'open';
|
|
12
|
+
import { renderInteractive } from '../../ui/render.js';
|
|
13
|
+
import { getGetStartedFlow } from '../../ui/components/getStarted/GetStartedFlow.js';
|
|
14
|
+
vi.mock('../../lib/prompts/promptUtils');
|
|
15
|
+
vi.mock('../../lib/prompts/projectNameAndDestPrompt');
|
|
16
|
+
vi.mock('../../lib/projects/config');
|
|
17
|
+
vi.mock('../../lib/errorHandlers');
|
|
18
|
+
vi.mock('@hubspot/local-dev-lib/github');
|
|
19
|
+
vi.mock('../../lib/dependencyManagement');
|
|
20
|
+
vi.mock('@hubspot/local-dev-lib/config');
|
|
21
|
+
vi.mock('../../ui/render');
|
|
22
|
+
vi.mock('../../ui/components/getStarted/GetStartedFlow');
|
|
23
|
+
vi.mock('open');
|
|
24
|
+
vi.mock('fs-extra', () => ({
|
|
25
|
+
default: {
|
|
26
|
+
readFileSync: vi.fn().mockReturnValue('{"name": "test-project"}'),
|
|
27
|
+
existsSync: vi.fn().mockReturnValue(false),
|
|
28
|
+
readdirSync: vi.fn().mockReturnValue(['file1.js', 'file2.js']),
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
31
|
+
describe('commands/get-started', () => {
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
// @TODO Revisit config mocking in tests
|
|
34
|
+
getConfigAccountById.mockReturnValue({
|
|
35
|
+
accountId: 12345,
|
|
36
|
+
name: 'Test Account',
|
|
37
|
+
authType: 'personalaccesskey',
|
|
38
|
+
personalAccessKey: 'test-key',
|
|
39
|
+
env: 'prod',
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('command', () => {
|
|
43
|
+
it('should have the correct command structure', () => {
|
|
44
|
+
expect(getStartedCommand.command).toEqual('get-started');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('describe', () => {
|
|
48
|
+
it('should have a defined describe property', () => {
|
|
49
|
+
expect(getStartedCommand.describe).toBeDefined();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('command structure', () => {
|
|
53
|
+
it('should have handler function', () => {
|
|
54
|
+
expect(getStartedCommand.handler).toBeDefined();
|
|
55
|
+
expect(typeof getStartedCommand.handler).toBe('function');
|
|
56
|
+
});
|
|
57
|
+
it('should have builder function', () => {
|
|
58
|
+
expect(getStartedCommand.builder).toBeDefined();
|
|
59
|
+
expect(typeof getStartedCommand.builder).toBe('function');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('handler', () => {
|
|
63
|
+
const mockArgs = {
|
|
64
|
+
derivedAccountId: 12345,
|
|
65
|
+
templateSource: undefined,
|
|
66
|
+
name: 'test-project',
|
|
67
|
+
dest: 'test-destination',
|
|
68
|
+
d: false,
|
|
69
|
+
debug: false,
|
|
70
|
+
c: undefined,
|
|
71
|
+
config: undefined,
|
|
72
|
+
a: undefined,
|
|
73
|
+
account: undefined,
|
|
74
|
+
'use-env': undefined,
|
|
75
|
+
useEnv: undefined,
|
|
76
|
+
_: [],
|
|
77
|
+
$0: 'hs',
|
|
78
|
+
};
|
|
79
|
+
beforeEach(() => {
|
|
80
|
+
trackCommandUsage.mockResolvedValue(undefined);
|
|
81
|
+
projectNameAndDestPrompt.mockResolvedValue({
|
|
82
|
+
dest: 'test-destination',
|
|
83
|
+
name: 'test-project',
|
|
84
|
+
});
|
|
85
|
+
cloneGithubRepo.mockResolvedValue(true);
|
|
86
|
+
getProjectConfig.mockResolvedValue({
|
|
87
|
+
projectConfig: null,
|
|
88
|
+
projectDir: null,
|
|
89
|
+
});
|
|
90
|
+
writeProjectConfig.mockResolvedValue(true);
|
|
91
|
+
getProjectPackageJsonLocations.mockResolvedValue(['/path/to/package/dir']);
|
|
92
|
+
installPackages.mockResolvedValue(undefined);
|
|
93
|
+
process.exit = vi.fn();
|
|
94
|
+
});
|
|
95
|
+
describe('CMS flow', () => {
|
|
96
|
+
it('should handle CMS option selection', async () => {
|
|
97
|
+
promptUser.mockResolvedValue({
|
|
98
|
+
default: GET_STARTED_OPTIONS.CMS,
|
|
99
|
+
});
|
|
100
|
+
await getStartedCommand.handler(mockArgs);
|
|
101
|
+
expect(process.exit).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
|
|
102
|
+
});
|
|
103
|
+
it('should open Design Manager when user confirms and browser is available', async () => {
|
|
104
|
+
promptUser
|
|
105
|
+
.mockResolvedValueOnce({ default: GET_STARTED_OPTIONS.CMS })
|
|
106
|
+
.mockResolvedValueOnce({ shouldOpen: true });
|
|
107
|
+
await getStartedCommand.handler(mockArgs);
|
|
108
|
+
expect(open).toHaveBeenCalledWith(expect.stringContaining('design-manager'), { url: true });
|
|
109
|
+
});
|
|
110
|
+
it('should use Ink flow when v2 flag is enabled', async () => {
|
|
111
|
+
getGetStartedFlow.mockImplementation(() => null);
|
|
112
|
+
renderInteractive.mockResolvedValue(undefined);
|
|
113
|
+
await getStartedCommand.handler({ ...mockArgs, v2: true });
|
|
114
|
+
expect(renderInteractive).toHaveBeenCalled();
|
|
115
|
+
expect(promptUser).not.toHaveBeenCalled();
|
|
116
|
+
expect(process.exit).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('App flow', () => {
|
|
120
|
+
beforeEach(() => {
|
|
121
|
+
promptUser
|
|
122
|
+
.mockResolvedValueOnce({
|
|
123
|
+
default: GET_STARTED_OPTIONS.APP,
|
|
124
|
+
})
|
|
125
|
+
.mockResolvedValueOnce({
|
|
126
|
+
shouldUpload: true,
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
it('should handle App option selection', async () => {
|
|
130
|
+
await getStartedCommand.handler(mockArgs);
|
|
131
|
+
expect(projectNameAndDestPrompt).toHaveBeenCalledWith(mockArgs);
|
|
132
|
+
expect(cloneGithubRepo).toHaveBeenCalled();
|
|
133
|
+
});
|
|
134
|
+
it('should handle upload flow when user confirms', async () => {
|
|
135
|
+
promptUser
|
|
136
|
+
.mockResolvedValueOnce({ default: GET_STARTED_OPTIONS.APP })
|
|
137
|
+
.mockResolvedValueOnce({ shouldUpload: true });
|
|
138
|
+
const mockProjectConfig = {
|
|
139
|
+
name: 'test-project',
|
|
140
|
+
srcDir: 'src',
|
|
141
|
+
platformVersion: '1.0.0',
|
|
142
|
+
};
|
|
143
|
+
getProjectConfig
|
|
144
|
+
.mockResolvedValueOnce({
|
|
145
|
+
projectConfig: null,
|
|
146
|
+
projectDir: null,
|
|
147
|
+
})
|
|
148
|
+
.mockResolvedValueOnce({
|
|
149
|
+
projectConfig: mockProjectConfig,
|
|
150
|
+
projectDir: '/path/to/project',
|
|
151
|
+
});
|
|
152
|
+
await getStartedCommand.handler(mockArgs);
|
|
153
|
+
expect(promptUser).toHaveBeenCalledWith([
|
|
154
|
+
expect.objectContaining({
|
|
155
|
+
type: 'confirm',
|
|
156
|
+
name: 'shouldUpload',
|
|
157
|
+
message: expect.any(String),
|
|
158
|
+
default: true,
|
|
159
|
+
}),
|
|
160
|
+
]);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe('tracking', () => {
|
|
164
|
+
it('should track command usage', async () => {
|
|
165
|
+
promptUser.mockResolvedValue({
|
|
166
|
+
default: GET_STARTED_OPTIONS.APP,
|
|
167
|
+
});
|
|
168
|
+
await getStartedCommand.handler(mockArgs);
|
|
169
|
+
expect(trackCommandUsage).toHaveBeenCalledWith('get-started', {}, mockArgs.derivedAccountId);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import clear from '../hubdb/clear.js';
|
|
3
|
+
import create from '../hubdb/create.js';
|
|
4
|
+
import deleteCommand from '../hubdb/delete.js';
|
|
5
|
+
import fetch from '../hubdb/fetch.js';
|
|
6
|
+
import list from '../hubdb/list.js';
|
|
7
|
+
import hubdbCommands from '../hubdb.js';
|
|
8
|
+
vi.mock('../hubdb/clear');
|
|
9
|
+
vi.mock('../hubdb/create');
|
|
10
|
+
vi.mock('../hubdb/delete');
|
|
11
|
+
vi.mock('../hubdb/fetch');
|
|
12
|
+
vi.mock('../../lib/commonOpts');
|
|
13
|
+
const commandSpy = vi
|
|
14
|
+
.spyOn(yargs, 'command')
|
|
15
|
+
.mockReturnValue(yargs);
|
|
16
|
+
const demandCommandSpy = vi
|
|
17
|
+
.spyOn(yargs, 'demandCommand')
|
|
18
|
+
.mockReturnValue(yargs);
|
|
19
|
+
describe('commands/hubdb', () => {
|
|
20
|
+
describe('command', () => {
|
|
21
|
+
it('should have the correct command structure', () => {
|
|
22
|
+
expect(hubdbCommands.command).toEqual('hubdb');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
describe('describe', () => {
|
|
26
|
+
it('should provide a description', () => {
|
|
27
|
+
expect(hubdbCommands.describe).toBeDefined();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('builder', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
commandSpy.mockClear();
|
|
33
|
+
demandCommandSpy.mockClear();
|
|
34
|
+
});
|
|
35
|
+
const subcommands = [clear, create, deleteCommand, fetch, list];
|
|
36
|
+
it('should demand the command takes one positional argument', () => {
|
|
37
|
+
hubdbCommands.builder(yargs);
|
|
38
|
+
expect(demandCommandSpy).toHaveBeenCalledTimes(1);
|
|
39
|
+
expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
|
|
40
|
+
});
|
|
41
|
+
it('should add the correct number of sub commands', () => {
|
|
42
|
+
hubdbCommands.builder(yargs);
|
|
43
|
+
expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
|
|
44
|
+
});
|
|
45
|
+
it.each(subcommands)('should attach the %s subcommand', module => {
|
|
46
|
+
hubdbCommands.builder(yargs);
|
|
47
|
+
expect(commandSpy).toHaveBeenCalledWith(module);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import { addConfigOptions, addTestingOptions } from '../../lib/commonOpts.js';
|
|
3
|
+
import initCommand from '../init.js';
|
|
4
|
+
vi.mock('../../lib/commonOpts');
|
|
5
|
+
const optionsSpy = vi
|
|
6
|
+
.spyOn(yargs, 'options')
|
|
7
|
+
.mockReturnValue(yargs);
|
|
8
|
+
describe('commands/init', () => {
|
|
9
|
+
describe('command', () => {
|
|
10
|
+
it('should have the correct command structure', () => {
|
|
11
|
+
expect(initCommand.command).toEqual('init');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
describe('describe', () => {
|
|
15
|
+
it('should provide a description', () => {
|
|
16
|
+
expect(initCommand.describe).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('builder', () => {
|
|
20
|
+
it('should support the correct options', () => {
|
|
21
|
+
initCommand.builder(yargs);
|
|
22
|
+
expect(optionsSpy).toHaveBeenCalledTimes(1);
|
|
23
|
+
expect(optionsSpy).toHaveBeenCalledWith({
|
|
24
|
+
'auth-type': expect.objectContaining({
|
|
25
|
+
type: 'string',
|
|
26
|
+
choices: ['personalaccesskey', 'oauth2'],
|
|
27
|
+
default: 'personalaccesskey',
|
|
28
|
+
}),
|
|
29
|
+
account: expect.objectContaining({ type: 'string' }),
|
|
30
|
+
'disable-tracking': expect.objectContaining({
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
hidden: true,
|
|
33
|
+
default: false,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
37
|
+
expect(addConfigOptions).toHaveBeenCalledWith(yargs);
|
|
38
|
+
expect(addTestingOptions).toHaveBeenCalledTimes(1);
|
|
39
|
+
expect(addTestingOptions).toHaveBeenCalledWith(yargs);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import startCommand from '../mcp/start.js';
|
|
3
|
+
import setupCommand from '../mcp/setup.js';
|
|
4
|
+
import mcpCommand from '../mcp.js';
|
|
5
|
+
vi.mock('../mcp/start');
|
|
6
|
+
vi.mock('../mcp/setup');
|
|
7
|
+
vi.mock('../../lib/commonOpts');
|
|
8
|
+
const commandSpy = vi
|
|
9
|
+
.spyOn(yargs, 'command')
|
|
10
|
+
.mockReturnValue(yargs);
|
|
11
|
+
const demandCommandSpy = vi
|
|
12
|
+
.spyOn(yargs, 'demandCommand')
|
|
13
|
+
.mockReturnValue(yargs);
|
|
14
|
+
describe('commands/mcp', () => {
|
|
15
|
+
describe('command', () => {
|
|
16
|
+
it('should have the correct command structure', () => {
|
|
17
|
+
expect(mcpCommand.command).toEqual('mcp');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('describe', () => {
|
|
21
|
+
it('should provide a description', () => {
|
|
22
|
+
expect(mcpCommand.describe).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
describe('builder', () => {
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
commandSpy.mockClear();
|
|
28
|
+
demandCommandSpy.mockClear();
|
|
29
|
+
});
|
|
30
|
+
const subcommands = [startCommand, setupCommand];
|
|
31
|
+
it('should demand the command takes one positional argument', () => {
|
|
32
|
+
mcpCommand.builder(yargs);
|
|
33
|
+
expect(demandCommandSpy).toHaveBeenCalledTimes(1);
|
|
34
|
+
expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
|
|
35
|
+
});
|
|
36
|
+
it('should add the correct number of sub commands', () => {
|
|
37
|
+
mcpCommand.builder(yargs);
|
|
38
|
+
expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
|
|
39
|
+
});
|
|
40
|
+
it.each(subcommands)('should attach the %s subcommand', module => {
|
|
41
|
+
mcpCommand.builder(yargs);
|
|
42
|
+
expect(module).toBeDefined();
|
|
43
|
+
expect(commandSpy).toHaveBeenCalledWith(module);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import openCommand from '../open.js';
|
|
3
|
+
import * as commonOpts from '../../lib/commonOpts.js';
|
|
4
|
+
vi.mock('../../lib/commonOpts');
|
|
5
|
+
// Spies are now safe to create since the methods exist on the mock
|
|
6
|
+
const positionalSpy = vi.spyOn(mockYargs, 'positional');
|
|
7
|
+
const optionSpy = vi.spyOn(mockYargs, 'option');
|
|
8
|
+
const exampleSpy = vi.spyOn(mockYargs, 'example');
|
|
9
|
+
describe('commands/open', () => {
|
|
10
|
+
describe('command', () => {
|
|
11
|
+
it('should have the correct command structure', () => {
|
|
12
|
+
expect(openCommand.command).toBe('open [shortcut]');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
describe('describe', () => {
|
|
16
|
+
it('should provide a description', () => {
|
|
17
|
+
expect(openCommand.describe).toBeDefined();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('builder', () => {
|
|
21
|
+
it('should support the correct options', () => {
|
|
22
|
+
openCommand.builder(yargs);
|
|
23
|
+
expect(commonOpts.addGlobalOptions).toHaveBeenCalledTimes(1);
|
|
24
|
+
expect(commonOpts.addGlobalOptions).toHaveBeenCalledWith(yargs);
|
|
25
|
+
expect(commonOpts.addConfigOptions).toHaveBeenCalledTimes(1);
|
|
26
|
+
expect(commonOpts.addConfigOptions).toHaveBeenCalledWith(yargs);
|
|
27
|
+
expect(commonOpts.addAccountOptions).toHaveBeenCalledTimes(1);
|
|
28
|
+
expect(commonOpts.addAccountOptions).toHaveBeenCalledWith(yargs);
|
|
29
|
+
expect(commonOpts.addUseEnvironmentOptions).toHaveBeenCalledTimes(1);
|
|
30
|
+
expect(commonOpts.addUseEnvironmentOptions).toHaveBeenCalledWith(yargs);
|
|
31
|
+
});
|
|
32
|
+
it('should add the shortcut positional argument', () => {
|
|
33
|
+
openCommand.builder(yargs);
|
|
34
|
+
expect(positionalSpy).toHaveBeenCalledWith('[shortcut]', {
|
|
35
|
+
describe: expect.any(String),
|
|
36
|
+
type: 'string',
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
it('should add the list option', () => {
|
|
40
|
+
openCommand.builder(yargs);
|
|
41
|
+
expect(optionSpy).toHaveBeenCalledWith('list', {
|
|
42
|
+
alias: 'l',
|
|
43
|
+
describe: expect.any(String),
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it('should add examples', () => {
|
|
48
|
+
openCommand.builder(yargs);
|
|
49
|
+
expect(exampleSpy).toHaveBeenCalledWith([
|
|
50
|
+
['$0 open'],
|
|
51
|
+
['$0 open --list'],
|
|
52
|
+
['$0 open settings'],
|
|
53
|
+
['$0 open settings/navigation'],
|
|
54
|
+
['$0 open sn'],
|
|
55
|
+
]);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import deploy from '../project/deploy.js';
|
|
3
|
+
import create from '../project/create.js';
|
|
4
|
+
import upload from '../project/upload.js';
|
|
5
|
+
import listBuilds from '../project/listBuilds.js';
|
|
6
|
+
import logs from '../project/logs.js';
|
|
7
|
+
import watch from '../project/watch.js';
|
|
8
|
+
import download from '../project/download.js';
|
|
9
|
+
import open from '../project/open.js';
|
|
10
|
+
import dev from '../project/dev/index.js';
|
|
11
|
+
import add from '../project/add.js';
|
|
12
|
+
import migrate from '../project/migrate.js';
|
|
13
|
+
import installDeps from '../project/installDeps.js';
|
|
14
|
+
import lint from '../project/lint.js';
|
|
15
|
+
import updateDeps from '../project/updateDeps.js';
|
|
16
|
+
import validate from '../project/validate.js';
|
|
17
|
+
import profileCommands from '../project/profile.js';
|
|
18
|
+
import list from '../project/list.js';
|
|
19
|
+
import projectCommand from '../project.js';
|
|
20
|
+
import * as projectConfigLib from '../../lib/projects/config.js';
|
|
21
|
+
import * as platformVersionLib from '../../lib/projects/platformVersion.js';
|
|
22
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
23
|
+
vi.mock('../project/deploy');
|
|
24
|
+
vi.mock('../project/create');
|
|
25
|
+
vi.mock('../project/upload');
|
|
26
|
+
vi.mock('../project/listBuilds');
|
|
27
|
+
vi.mock('../project/logs');
|
|
28
|
+
vi.mock('../project/watch');
|
|
29
|
+
vi.mock('../project/download');
|
|
30
|
+
vi.mock('../project/open');
|
|
31
|
+
vi.mock('../project/dev');
|
|
32
|
+
vi.mock('../project/add');
|
|
33
|
+
vi.mock('../project/migrateApp', () => ({
|
|
34
|
+
default: {},
|
|
35
|
+
}));
|
|
36
|
+
vi.mock('../project/cloneApp', () => ({
|
|
37
|
+
default: {},
|
|
38
|
+
}));
|
|
39
|
+
vi.mock('../project/migrate', () => ({
|
|
40
|
+
default: {},
|
|
41
|
+
}));
|
|
42
|
+
vi.mock('../project/installDeps');
|
|
43
|
+
vi.mock('../project/lint');
|
|
44
|
+
vi.mock('../project/profile');
|
|
45
|
+
vi.mock('../../lib/commonOpts');
|
|
46
|
+
vi.mock('../../lib/projects/config.js');
|
|
47
|
+
vi.mock('../../lib/projects/platformVersion.js');
|
|
48
|
+
const commandSpy = vi
|
|
49
|
+
.spyOn(yargs, 'command')
|
|
50
|
+
.mockReturnValue(yargs);
|
|
51
|
+
const demandCommandSpy = vi
|
|
52
|
+
.spyOn(yargs, 'demandCommand')
|
|
53
|
+
.mockReturnValue(yargs);
|
|
54
|
+
const getProjectConfigSpy = vi.spyOn(projectConfigLib, 'getProjectConfig');
|
|
55
|
+
const isUnsupportedPlatformVersionSpy = vi.spyOn(platformVersionLib, 'isUnsupportedPlatformVersion');
|
|
56
|
+
const processExitSpy = vi.spyOn(process, 'exit');
|
|
57
|
+
const uiLoggerErrorSpy = vi.spyOn(uiLogger, 'error');
|
|
58
|
+
describe('commands/project', () => {
|
|
59
|
+
beforeEach(() => {
|
|
60
|
+
vi.clearAllMocks();
|
|
61
|
+
// @ts-expect-error Mock implementation
|
|
62
|
+
processExitSpy.mockImplementation(() => { });
|
|
63
|
+
});
|
|
64
|
+
describe('command', () => {
|
|
65
|
+
it('should have the correct command structure', () => {
|
|
66
|
+
expect(projectCommand.command).toEqual(['project', 'projects']);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe('describe', () => {
|
|
70
|
+
it('should provide a description', () => {
|
|
71
|
+
expect(projectCommand.describe).toBeDefined();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('builder', () => {
|
|
75
|
+
const subcommands = [
|
|
76
|
+
create,
|
|
77
|
+
add,
|
|
78
|
+
watch,
|
|
79
|
+
dev,
|
|
80
|
+
upload,
|
|
81
|
+
deploy,
|
|
82
|
+
logs,
|
|
83
|
+
listBuilds,
|
|
84
|
+
download,
|
|
85
|
+
open,
|
|
86
|
+
migrate,
|
|
87
|
+
installDeps,
|
|
88
|
+
lint,
|
|
89
|
+
updateDeps,
|
|
90
|
+
profileCommands,
|
|
91
|
+
validate,
|
|
92
|
+
list,
|
|
93
|
+
];
|
|
94
|
+
it('should demand the command takes one positional argument', () => {
|
|
95
|
+
projectCommand.builder(yargs);
|
|
96
|
+
expect(demandCommandSpy).toHaveBeenCalledTimes(1);
|
|
97
|
+
expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
|
|
98
|
+
});
|
|
99
|
+
it('should add the correct number of sub commands', () => {
|
|
100
|
+
projectCommand.builder(yargs);
|
|
101
|
+
expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
|
|
102
|
+
});
|
|
103
|
+
it.each(subcommands)('should attach the %s subcommand', module => {
|
|
104
|
+
projectCommand.builder(yargs);
|
|
105
|
+
expect(module).toBeDefined();
|
|
106
|
+
expect(commandSpy).toHaveBeenCalledWith(module);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe('middleware - validatePlatformVersion', () => {
|
|
110
|
+
it('should have platform version validation functions available', () => {
|
|
111
|
+
// Verify the necessary functions are available for middleware
|
|
112
|
+
expect(getProjectConfigSpy).toBeDefined();
|
|
113
|
+
expect(isUnsupportedPlatformVersionSpy).toBeDefined();
|
|
114
|
+
expect(uiLoggerErrorSpy).toBeDefined();
|
|
115
|
+
expect(processExitSpy).toBeDefined();
|
|
116
|
+
});
|
|
117
|
+
it('should register middleware when building', async () => {
|
|
118
|
+
// Verify middleware is registered during builder execution
|
|
119
|
+
await projectCommand.builder(yargs);
|
|
120
|
+
// The middleware should be registered (we can't easily test async middleware execution)
|
|
121
|
+
// but we verify the builder completes successfully
|
|
122
|
+
expect(projectCommand.builder).toBeDefined();
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import create from '../sandbox/create.js';
|
|
3
|
+
import del from '../sandbox/delete.js';
|
|
4
|
+
import sandboxCommands from '../sandbox.js';
|
|
5
|
+
vi.mock('../sandbox/create');
|
|
6
|
+
vi.mock('../sandbox/delete');
|
|
7
|
+
const commandSpy = vi
|
|
8
|
+
.spyOn(yargs, 'command')
|
|
9
|
+
.mockReturnValue(yargs);
|
|
10
|
+
const demandCommandSpy = vi
|
|
11
|
+
.spyOn(yargs, 'demandCommand')
|
|
12
|
+
.mockReturnValue(yargs);
|
|
13
|
+
describe('commands/sandbox', () => {
|
|
14
|
+
describe('command', () => {
|
|
15
|
+
it('should have the correct command structure', () => {
|
|
16
|
+
expect(sandboxCommands.command).toEqual(['sandbox', 'sandboxes']);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('describe', () => {
|
|
20
|
+
it('should provide a description', () => {
|
|
21
|
+
expect(sandboxCommands.describe).toBeDefined();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe('builder', () => {
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
commandSpy.mockClear();
|
|
27
|
+
demandCommandSpy.mockClear();
|
|
28
|
+
});
|
|
29
|
+
const subcommands = [create, del];
|
|
30
|
+
it('should demand the command takes one positional argument', () => {
|
|
31
|
+
sandboxCommands.builder(yargs);
|
|
32
|
+
expect(demandCommandSpy).toHaveBeenCalledTimes(1);
|
|
33
|
+
expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
|
|
34
|
+
});
|
|
35
|
+
it('should add the correct number of sub commands', () => {
|
|
36
|
+
sandboxCommands.builder(yargs);
|
|
37
|
+
expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
|
|
38
|
+
});
|
|
39
|
+
it.each(subcommands)('should attach the %s subcommand', module => {
|
|
40
|
+
sandboxCommands.builder(yargs);
|
|
41
|
+
expect(commandSpy).toHaveBeenCalledWith(module);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|