@hubspot/cli 7.8.12-experimental.0 → 7.9.0-beta.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 +31 -25
- package/commands/__tests__/auth.test.js +5 -0
- package/commands/__tests__/cms.test.js +44 -1
- package/commands/__tests__/customObject.test.js +22 -1
- package/commands/__tests__/doctor.test.js +16 -16
- package/commands/__tests__/project.test.js +2 -0
- package/commands/account/auth.js +1 -0
- package/commands/account/clean.js +18 -27
- package/commands/account/createOverride.js +13 -31
- package/commands/account/info.js +20 -31
- package/commands/account/list.js +16 -22
- package/commands/account/remove.js +12 -20
- package/commands/account/removeOverride.js +11 -21
- package/commands/account/rename.js +6 -9
- package/commands/account/use.js +12 -26
- package/commands/account.js +2 -2
- package/commands/app/__tests__/migrate.test.js +5 -5
- package/commands/app/migrate.js +13 -18
- package/commands/app.js +1 -6
- package/commands/auth.d.ts +1 -0
- package/commands/auth.js +17 -7
- package/commands/{__tests__/remove.test.js → cms/__tests__/delete.test.js} +8 -8
- package/commands/{__tests__ → cms/__tests__}/fetch.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/function.test.js +7 -3
- package/commands/{__tests__ → cms/__tests__}/lint.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/list.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/mv.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/theme.test.js +9 -2
- package/commands/cms/app/create.d.ts +9 -0
- package/commands/cms/app/create.js +82 -0
- package/commands/cms/app.d.ts +3 -0
- package/commands/cms/app.js +17 -0
- package/commands/cms/convertFields.js +7 -9
- package/commands/cms/delete.d.ts +6 -0
- package/commands/cms/delete.js +43 -0
- package/commands/cms/fetch.d.ts +12 -0
- package/commands/cms/fetch.js +79 -0
- package/commands/{__tests__ → cms/function/__tests__}/logs.test.js +4 -5
- package/commands/cms/function/create.d.ts +12 -0
- package/commands/cms/function/create.js +84 -0
- package/commands/cms/function/deploy.d.ts +6 -0
- package/commands/cms/function/deploy.js +89 -0
- package/commands/cms/function/list.d.ts +6 -0
- package/commands/cms/function/list.js +60 -0
- package/commands/cms/function/logs.d.ts +10 -0
- package/commands/cms/function/logs.js +135 -0
- package/commands/cms/function/server.d.ts +10 -0
- package/commands/cms/function/server.js +69 -0
- package/commands/cms/function.d.ts +3 -0
- package/commands/cms/function.js +27 -0
- package/commands/cms/getReactModule.js +9 -14
- package/commands/cms/lighthouseScore.js +33 -36
- package/commands/cms/lint.d.ts +6 -0
- package/commands/cms/lint.js +83 -0
- package/commands/cms/list.d.ts +6 -0
- package/commands/cms/list.js +96 -0
- package/commands/cms/module/create.d.ts +11 -0
- package/commands/cms/module/create.js +84 -0
- package/commands/cms/module/marketplace-validate.d.ts +6 -0
- package/commands/cms/module/marketplace-validate.js +45 -0
- package/commands/cms/module.d.ts +3 -0
- package/commands/cms/module.js +17 -0
- package/commands/cms/mv.d.ts +7 -0
- package/commands/cms/mv.js +60 -0
- package/commands/cms/template/create.d.ts +9 -0
- package/commands/cms/template/create.js +72 -0
- package/commands/cms/template.d.ts +3 -0
- package/commands/cms/template.js +17 -0
- package/commands/{theme → cms/theme}/__tests__/marketplace-validate.test.js +2 -2
- package/commands/{theme → cms/theme}/__tests__/preview.test.js +2 -2
- package/commands/cms/theme/create.d.ts +6 -0
- package/commands/cms/theme/create.js +58 -0
- package/commands/cms/theme/generate-selectors.d.ts +6 -0
- package/commands/cms/theme/generate-selectors.js +171 -0
- package/commands/cms/theme/marketplace-validate.d.ts +6 -0
- package/commands/cms/theme/marketplace-validate.js +46 -0
- package/commands/cms/theme/preview.d.ts +12 -0
- package/commands/cms/theme/preview.js +224 -0
- package/commands/cms/theme.d.ts +3 -0
- package/commands/cms/theme.js +25 -0
- package/commands/cms/upload.d.ts +12 -0
- package/commands/cms/upload.js +212 -0
- package/commands/cms/watch.d.ts +14 -0
- package/commands/cms/watch.js +138 -0
- package/commands/cms/webpack/create.d.ts +6 -0
- package/commands/cms/webpack/create.js +58 -0
- package/commands/cms/webpack.d.ts +3 -0
- package/commands/cms/webpack.js +17 -0
- package/commands/cms.js +28 -2
- package/commands/completion.js +3 -3
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +64 -36
- package/commands/config.js +2 -2
- package/commands/create.js +6 -4
- package/commands/customObject/{schema/__tests__/create.test.js → __tests__/createSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/delete.test.js → __tests__/deleteSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/fetch-all.test.js → __tests__/fetch-all-schemas.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/fetch.test.js → __tests__/fetchSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/list.test.js → __tests__/listSchemas.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/update.test.js → __tests__/updateSchema.test.js} +5 -5
- package/commands/customObject/create.js +10 -12
- package/commands/customObject/createSchema.d.ts +6 -0
- package/commands/customObject/createSchema.js +56 -0
- package/commands/customObject/deleteSchema.d.ts +7 -0
- package/commands/customObject/deleteSchema.js +69 -0
- package/commands/customObject/fetchAllSchemas.d.ts +6 -0
- package/commands/customObject/fetchAllSchemas.js +57 -0
- package/commands/customObject/fetchSchema.d.ts +7 -0
- package/commands/customObject/fetchSchema.js +67 -0
- package/commands/customObject/listSchemas.d.ts +4 -0
- package/commands/customObject/listSchemas.js +35 -0
- package/commands/customObject/schema/create.d.ts +4 -6
- package/commands/customObject/schema/create.js +13 -38
- package/commands/customObject/schema/delete.d.ts +4 -7
- package/commands/customObject/schema/delete.js +15 -50
- package/commands/customObject/schema/fetch-all.d.ts +4 -6
- package/commands/customObject/schema/fetch-all.js +14 -40
- package/commands/customObject/schema/fetch.d.ts +4 -7
- package/commands/customObject/schema/fetch.js +14 -49
- package/commands/customObject/schema/list.d.ts +4 -4
- package/commands/customObject/schema/list.js +10 -19
- package/commands/customObject/schema/update.d.ts +4 -7
- package/commands/customObject/schema/update.js +15 -50
- package/commands/customObject/schema.js +5 -3
- package/commands/customObject/updateSchema.d.ts +7 -0
- package/commands/customObject/updateSchema.js +71 -0
- package/commands/customObject.js +22 -8
- package/commands/doctor.js +8 -11
- package/commands/feedback.js +7 -12
- package/commands/fetch.d.ts +4 -12
- package/commands/fetch.js +20 -47
- package/commands/filemanager/fetch.js +7 -7
- package/commands/filemanager/upload.js +15 -34
- package/commands/filemanager.js +2 -2
- package/commands/function/deploy.d.ts +4 -6
- package/commands/function/deploy.js +14 -89
- package/commands/function/list.d.ts +4 -6
- package/commands/function/list.js +14 -40
- package/commands/function/server.d.ts +4 -10
- package/commands/function/server.js +22 -31
- package/commands/function.d.ts +2 -4
- package/commands/function.js +25 -14
- package/commands/getStarted.js +2 -2
- package/commands/hubdb/clear.js +7 -15
- package/commands/hubdb/create.js +9 -15
- package/commands/hubdb/delete.js +8 -15
- package/commands/hubdb/fetch.js +6 -9
- package/commands/hubdb.d.ts +1 -1
- package/commands/hubdb.js +2 -2
- package/commands/init.js +2 -3
- package/commands/lint.d.ts +4 -6
- package/commands/lint.js +13 -65
- package/commands/list.d.ts +4 -6
- package/commands/list.js +14 -81
- package/commands/logs.d.ts +4 -10
- package/commands/logs.js +25 -94
- package/commands/module/marketplace-validate.d.ts +4 -6
- package/commands/module/marketplace-validate.js +15 -27
- package/commands/module.d.ts +2 -2
- package/commands/module.js +17 -15
- package/commands/mv.d.ts +4 -7
- package/commands/mv.js +14 -51
- package/commands/open.js +5 -5
- package/commands/project/__tests__/add.test.js +15 -13
- package/commands/project/__tests__/deploy.test.js +3 -4
- package/commands/project/__tests__/devUnifiedFlow.test.js +32 -0
- package/commands/project/__tests__/installDeps.test.js +8 -8
- package/commands/project/__tests__/list.test.js +31 -0
- package/commands/project/__tests__/logs.test.js +1 -1
- package/commands/project/__tests__/migrate.test.js +6 -5
- package/commands/project/__tests__/migrateApp.test.js +2 -5
- package/commands/project/__tests__/validate.test.js +98 -0
- package/commands/project/add.d.ts +2 -2
- package/commands/project/add.js +6 -5
- package/commands/project/cloneApp.js +14 -19
- package/commands/project/create.js +1 -2
- package/commands/project/deploy.js +3 -3
- package/commands/project/dev/deprecatedFlow.js +9 -18
- package/commands/project/dev/index.js +19 -17
- package/commands/project/dev/unifiedFlow.js +11 -4
- package/commands/project/download.js +15 -15
- package/commands/project/installDeps.d.ts +2 -2
- package/commands/project/installDeps.js +9 -8
- package/commands/project/list.d.ts +4 -0
- package/commands/project/list.js +62 -0
- package/commands/project/listBuilds.js +11 -20
- package/commands/project/logs.js +21 -24
- package/commands/project/migrate.js +5 -2
- package/commands/project/migrateApp.js +9 -15
- package/commands/project/open.js +6 -13
- package/commands/project/upload.d.ts +2 -2
- package/commands/project/upload.js +17 -26
- package/commands/project/validate.js +6 -6
- package/commands/project/watch.js +13 -22
- package/commands/project.js +4 -2
- package/commands/remove.d.ts +4 -6
- package/commands/remove.js +12 -24
- package/commands/sandbox/__tests__/create.test.js +5 -5
- package/commands/sandbox/create.js +22 -32
- package/commands/sandbox/delete.js +38 -63
- package/commands/sandbox.js +2 -2
- package/commands/secret/addSecret.js +7 -17
- package/commands/secret/deleteSecret.js +10 -20
- package/commands/secret/listSecret.js +8 -10
- package/commands/secret/updateSecret.js +9 -17
- package/commands/secret.js +2 -2
- package/commands/testAccount/__tests__/delete.test.js +2 -4
- package/commands/testAccount/create.js +2 -5
- package/commands/testAccount/delete.d.ts +4 -3
- package/commands/testAccount/delete.js +155 -14
- package/commands/theme/generate-selectors.d.ts +4 -6
- package/commands/theme/generate-selectors.js +14 -152
- package/commands/theme/marketplace-validate.d.ts +4 -6
- package/commands/theme/marketplace-validate.js +14 -25
- package/commands/theme/preview.d.ts +4 -12
- package/commands/theme/preview.js +18 -183
- package/commands/theme.d.ts +2 -2
- package/commands/theme.js +19 -13
- package/commands/upload.d.ts +4 -12
- package/commands/upload.js +19 -169
- package/commands/watch.d.ts +4 -14
- package/commands/watch.js +23 -88
- package/lang/en.d.ts +863 -542
- package/lang/en.js +912 -595
- package/lang/en.lyaml +4 -4
- package/lib/__tests__/buildAccount.test.js +4 -3
- package/lib/__tests__/commonOpts.test.js +1 -1
- package/lib/__tests__/dependencyManagement.test.js +1 -1
- package/lib/__tests__/developerTestAccounts.test.js +3 -3
- package/lib/__tests__/npm.test.js +1 -1
- package/lib/__tests__/oauth.test.js +4 -4
- package/lib/__tests__/process.test.js +10 -5
- package/lib/__tests__/sandboxSync.test.js +8 -8
- package/lib/__tests__/sandboxes.test.js +8 -8
- package/lib/__tests__/serverlessLogs.test.js +1 -1
- package/lib/__tests__/usageTracking.test.js +5 -5
- package/lib/__tests__/validation.test.js +2 -1
- package/lib/__tests__/yargsUtils.test.js +83 -9
- package/lib/app/__tests__/migrate.test.js +5 -5
- package/lib/app/__tests__/migrate_legacy.test.js +1 -1
- package/lib/app/migrate.js +1 -1
- package/lib/app/migrate_legacy.js +20 -24
- package/lib/buildAccount.d.ts +2 -2
- package/lib/buildAccount.js +32 -64
- package/lib/commonOpts.d.ts +1 -1
- package/lib/commonOpts.js +25 -22
- package/lib/configMigrate.js +88 -9
- package/lib/configOptions.js +7 -0
- package/lib/constants.d.ts +15 -1
- package/lib/constants.js +19 -1
- package/lib/dependencyManagement.js +9 -27
- package/lib/developerTestAccounts.js +9 -23
- package/lib/doctor/Diagnosis.js +11 -23
- package/lib/doctor/DiagnosticInfoBuilder.js +12 -11
- package/lib/doctor/Doctor.js +42 -90
- package/lib/doctor/__tests__/Doctor.test.js +4 -4
- package/lib/errorHandlers/index.js +12 -20
- package/lib/errorHandlers/suppressError.js +11 -18
- package/lib/generateSelectors.js +1 -1
- package/lib/lang.js +6 -5
- package/lib/links.js +4 -4
- package/lib/middleware/__test__/commandTargetingUtils.test.js +99 -0
- package/lib/middleware/__test__/configMiddleware.test.js +11 -11
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +6 -8
- package/lib/middleware/autoUpdateMiddleware.d.ts +2 -1
- package/lib/middleware/autoUpdateMiddleware.js +12 -2
- package/lib/middleware/commandTargetingUtils.d.ts +8 -0
- package/lib/middleware/commandTargetingUtils.js +74 -0
- package/lib/middleware/configMiddleware.d.ts +1 -1
- package/lib/middleware/configMiddleware.js +21 -81
- package/lib/middleware/gitMiddleware.js +5 -1
- package/lib/middleware/notificationsMiddleware.js +5 -11
- package/lib/middleware/yargsChecksMiddleware.js +6 -9
- package/lib/npm.js +2 -2
- package/lib/oauth.js +5 -5
- package/lib/process.js +5 -4
- package/lib/projectProfiles.d.ts +1 -1
- package/lib/projectProfiles.js +2 -10
- package/lib/projects/__tests__/AppDevModeInterface.test.js +101 -135
- package/lib/projects/__tests__/DevServerManager.test.js +183 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +6 -5
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +76 -45
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +161 -0
- package/lib/projects/__tests__/deploy.test.js +9 -9
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +2 -0
- package/lib/projects/__tests__/platformVersion.test.js +8 -8
- package/lib/projects/__tests__/projects.test.js +12 -12
- package/lib/projects/__tests__/structure.test.js +3 -3
- package/lib/projects/__tests__/upload.test.d.ts +1 -0
- package/lib/projects/__tests__/upload.test.js +82 -0
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +6 -6
- package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/{v3AddComponent.test.js → v2AddComponent.test.js} +39 -39
- package/lib/projects/add/{v3AddComponent.d.ts → v2AddComponent.d.ts} +1 -1
- package/lib/projects/add/{v3AddComponent.js → v2AddComponent.js} +5 -5
- package/lib/projects/create/__tests__/legacy.test.js +5 -5
- package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
- package/lib/projects/create/__tests__/{v3.test.js → v2.test.js} +3 -3
- package/lib/projects/create/index.js +4 -4
- package/lib/projects/create/legacy.js +2 -2
- package/lib/projects/create/{v3.d.ts → v2.d.ts} +3 -3
- package/lib/projects/create/{v3.js → v2.js} +5 -5
- package/lib/projects/deploy.d.ts +1 -1
- package/lib/projects/deploy.js +2 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +11 -3
- package/lib/projects/localDev/AppDevModeInterface.js +128 -115
- package/lib/projects/localDev/DevServerManager.d.ts +10 -29
- package/lib/projects/localDev/DevServerManager.js +20 -76
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +40 -0
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +120 -0
- package/lib/projects/localDev/LocalDevLogger.js +10 -11
- package/lib/projects/localDev/{LocalDevManager.js → LocalDevManager_DEPRECATED.js} +10 -11
- package/lib/projects/localDev/LocalDevProcess.js +3 -2
- package/lib/projects/localDev/LocalDevState.d.ts +3 -0
- package/lib/projects/localDev/LocalDevState.js +9 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +4 -1
- package/lib/projects/localDev/LocalDevWebsocketServer.js +46 -16
- package/lib/projects/localDev/UIExtensionsDevModeInterface.d.ts +13 -0
- package/lib/projects/localDev/UIExtensionsDevModeInterface.js +37 -0
- package/lib/projects/localDev/helpers/account.d.ts +1 -1
- package/lib/projects/localDev/helpers/account.js +2 -2
- package/lib/projects/localDev/helpers/process.d.ts +1 -0
- package/lib/projects/localDev/helpers/process.js +15 -0
- package/lib/projects/localDev/helpers/project.d.ts +1 -0
- package/lib/projects/localDev/helpers/project.js +39 -3
- package/lib/projects/localDev/localDevWebsocketServerUtils.d.ts +3 -0
- package/lib/projects/localDev/localDevWebsocketServerUtils.js +9 -0
- package/lib/projects/platformVersion.d.ts +1 -1
- package/lib/projects/platformVersion.js +1 -1
- package/lib/projects/structure.d.ts +2 -2
- package/lib/projects/structure.js +6 -6
- package/lib/projects/upload.d.ts +2 -3
- package/lib/projects/upload.js +17 -9
- package/lib/projects/urls.d.ts +0 -1
- package/lib/projects/urls.js +0 -3
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +1 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.js +10 -10
- package/lib/prompts/accountNamePrompt.js +14 -19
- package/lib/prompts/accountsPrompt.js +2 -2
- package/lib/prompts/cmsFieldPrompt.js +2 -2
- package/lib/prompts/createApiSamplePrompt.js +5 -5
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +10 -1
- package/lib/prompts/createFunctionPrompt.js +14 -14
- package/lib/prompts/createModulePrompt.js +9 -9
- package/lib/prompts/createTemplatePrompt.js +2 -2
- package/lib/prompts/downloadProjectPrompt.js +5 -8
- package/lib/prompts/installAppPrompt.d.ts +1 -6
- package/lib/prompts/installAppPrompt.js +1 -6
- package/lib/prompts/personalAccessKeyPrompt.js +3 -3
- package/lib/prompts/previewPrompt.js +6 -6
- package/lib/prompts/projectAddPrompt.d.ts +2 -2
- package/lib/prompts/projectAddPrompt.js +7 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +20 -32
- package/lib/prompts/projectNamePrompt.js +4 -8
- package/lib/prompts/projectsLogsPrompt.js +2 -4
- package/lib/prompts/promptUtils.js +27 -9
- package/lib/prompts/sandboxesPrompt.js +7 -7
- package/lib/prompts/secretPrompt.js +3 -3
- package/lib/prompts/selectAppPrompt.js +3 -3
- package/lib/prompts/selectHubDBTablePrompt.js +9 -13
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +15 -19
- package/lib/prompts/setAsDefaultAccountPrompt.js +4 -8
- package/lib/prompts/uploadPrompt.js +5 -5
- package/lib/sandboxSync.js +24 -41
- package/lib/sandboxes.js +19 -47
- package/lib/schema.js +3 -3
- package/lib/serverlessLogs.js +11 -13
- package/lib/theme/__tests__/migrate.test.js +6 -6
- package/lib/theme/migrate.js +2 -2
- package/lib/ui/SpinniesManager.d.ts +2 -0
- package/lib/ui/SpinniesManager.js +7 -0
- package/lib/ui/boxen.js +1 -2
- package/lib/ui/git.js +13 -10
- package/lib/ui/index.d.ts +6 -0
- package/lib/ui/index.js +55 -38
- package/lib/ui/serverlessFunctionLogs.js +9 -7
- package/lib/ui/uiMessages.d.ts +73 -0
- package/lib/ui/uiMessages.js +76 -0
- package/lib/usageTracking.js +7 -7
- package/lib/validation.js +20 -23
- package/lib/yargsUtils.d.ts +1 -1
- package/lib/yargsUtils.js +12 -5
- package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +4 -4
- package/mcp-server/tools/index.js +4 -0
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +23 -0
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +68 -0
- package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +11 -0
- package/mcp-server/tools/project/GetApplicationInfoTool.js +49 -0
- package/mcp-server/tools/project/GetConfigValuesTool.js +2 -2
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +2 -2
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +1 -1
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +169 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +115 -0
- package/mcp-server/utils/toolUsageTracking.js +2 -2
- package/package.json +8 -7
- package/types/Cms.d.ts +6 -6
- package/types/Yargs.d.ts +1 -1
- package/commands/app/__tests__/install.test.js +0 -47
- package/commands/app/install.d.ts +0 -8
- package/commands/app/install.js +0 -122
- package/lib/middleware/__test__/utils.test.js +0 -51
- package/lib/middleware/utils.d.ts +0 -8
- package/lib/middleware/utils.js +0 -14
- package/lib/projects/localDev/DevServerManagerV2.d.ts +0 -22
- package/lib/projects/localDev/DevServerManagerV2.js +0 -81
- /package/commands/{customObject/schema → cms}/__tests__/delete.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/fetch.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/function.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/lint.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/list.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/mv.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/theme.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/function/__tests__}/logs.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/generate-selectors.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/generate-selectors.test.js +0 -0
- /package/commands/{theme → cms/theme}/__tests__/marketplace-validate.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/preview.test.d.ts +0 -0
- /package/commands/{__tests__/remove.test.d.ts → customObject/__tests__/createSchema.test.d.ts} +0 -0
- /package/commands/{app/__tests__/install.test.d.ts → customObject/__tests__/deleteSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/create.test.d.ts → __tests__/fetch-all-schemas.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/fetch-all.test.d.ts → __tests__/fetchSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/fetch.test.d.ts → __tests__/listSchemas.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/list.test.d.ts → __tests__/updateSchema.test.d.ts} +0 -0
- /package/commands/{customObject/schema/__tests__/update.test.d.ts → project/__tests__/list.test.d.ts} +0 -0
- /package/{lib/middleware/__test__/utils.test.d.ts → commands/project/__tests__/validate.test.d.ts} +0 -0
- /package/{commands/create → lib/cmsAssets}/api-sample.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/api-sample.js +0 -0
- /package/{commands/create → lib/cmsAssets}/app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/function.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/function.js +0 -0
- /package/{commands/create → lib/cmsAssets}/index.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/index.js +0 -0
- /package/{commands/create → lib/cmsAssets}/module.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/module.js +0 -0
- /package/{commands/create → lib/cmsAssets}/react-app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/react-app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/template.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/template.js +0 -0
- /package/{commands/create → lib/cmsAssets}/vue-app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/vue-app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/webpack-serverless.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/webpack-serverless.js +0 -0
- /package/{commands/create → lib/cmsAssets}/website-theme.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/website-theme.js +0 -0
- /package/lib/{projects/add/__tests__/v3AddComponent.test.d.ts → middleware/__test__/commandTargetingUtils.test.d.ts} +0 -0
- /package/lib/projects/{create/__tests__/v3.test.d.ts → __tests__/DevServerManager.test.d.ts} +0 -0
- /package/lib/projects/localDev/{LocalDevManager.d.ts → LocalDevManager_DEPRECATED.d.ts} +0 -0
package/lib/constants.d.ts
CHANGED
|
@@ -76,7 +76,6 @@ export declare const APP_AUTH_TYPES: {
|
|
|
76
76
|
readonly STATIC: "static";
|
|
77
77
|
};
|
|
78
78
|
export declare const FEATURES: {
|
|
79
|
-
readonly UNIFIED_THEME_PREVIEW: "cms:react:unifiedThemePreview";
|
|
80
79
|
readonly UNIFIED_APPS: "Developers:UnifiedApps:PrivateBeta";
|
|
81
80
|
readonly SANDBOXES_V2: "sandboxes:v2:enabled";
|
|
82
81
|
readonly SANDBOXES_V2_CLI: "sandboxes:v2:cliEnabled";
|
|
@@ -96,16 +95,21 @@ export declare const LOCAL_DEV_UI_MESSAGE_SEND_TYPES: {
|
|
|
96
95
|
UPDATE_PROJECT_DATA: string;
|
|
97
96
|
UPDATE_UPLOAD_WARNINGS: string;
|
|
98
97
|
CLI_METADATA: string;
|
|
98
|
+
DEV_SERVERS_STARTED: string;
|
|
99
99
|
};
|
|
100
100
|
export declare const LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES: {
|
|
101
101
|
UPLOAD: string;
|
|
102
102
|
DEPLOY: string;
|
|
103
103
|
VIEWED_WELCOME_SCREEN: string;
|
|
104
|
+
APP_INSTALL_SUCCESS: string;
|
|
105
|
+
APP_INSTALL_INITIATED: string;
|
|
106
|
+
APP_INSTALL_FAILURE: string;
|
|
104
107
|
};
|
|
105
108
|
export declare const APP_INSTALLATION_STATES: {
|
|
106
109
|
readonly NOT_INSTALLED: "NOT_INSTALLED";
|
|
107
110
|
readonly INSTALLED: "INSTALLED";
|
|
108
111
|
readonly INSTALLED_WITH_OUTDATED_SCOPES: "INSTALLED_WITH_OUTDATED_SCOPES";
|
|
112
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
109
113
|
};
|
|
110
114
|
export declare const staticAuth = "static";
|
|
111
115
|
export declare const oAuth = "oauth";
|
|
@@ -119,9 +123,19 @@ export declare const GET_STARTED_OPTIONS: {
|
|
|
119
123
|
export declare const LOCAL_DEV_SERVER_MESSAGE_TYPES: {
|
|
120
124
|
readonly INITIAL: "INITIAL";
|
|
121
125
|
readonly WEBSOCKET_SERVER_CONNECTED: "WEBSOCKET_SERVER_CONNECTED";
|
|
126
|
+
readonly STATIC_AUTH_APP_INSTALL_SUCCESS: "APP_INSTALL_SUCCESS";
|
|
127
|
+
readonly STATIC_AUTH_APP_INSTALL_FAILURE: "APP_INSTALL_FAILURE";
|
|
128
|
+
readonly OAUTH_APP_INSTALL_INITIATED: "APP_INSTALL_INITIATED";
|
|
122
129
|
};
|
|
130
|
+
export declare const LOCAL_DEV_WEBSOCKET_SERVER_INSTANCE_ID = "local-dev-ui-websocket-server";
|
|
123
131
|
export declare const CONFIG_LOCAL_STATE_FLAGS: {
|
|
124
132
|
readonly LOCAL_DEV_UI_WELCOME: "LOCAL_DEV_UI_WELCOME";
|
|
125
133
|
};
|
|
126
134
|
export declare const EMPTY_PROJECT = "empty";
|
|
127
135
|
export declare const PROJECT_WITH_APP = "app";
|
|
136
|
+
export declare const LEGACY_SERVERLESS_FILE = "serverless.json";
|
|
137
|
+
export declare const LEGACY_PUBLIC_APP_FILE = "public-app.json";
|
|
138
|
+
export declare const LEGACY_PRIVATE_APP_FILE = "app.json";
|
|
139
|
+
export declare const THEME_FILE = "theme.json";
|
|
140
|
+
export declare const CMS_ASSETS_FILE = "cms-assets.json";
|
|
141
|
+
export declare const LEGACY_CONFIG_FILES: string[];
|
package/lib/constants.js
CHANGED
|
@@ -68,7 +68,6 @@ export const APP_AUTH_TYPES = {
|
|
|
68
68
|
STATIC: 'static',
|
|
69
69
|
};
|
|
70
70
|
export const FEATURES = {
|
|
71
|
-
UNIFIED_THEME_PREVIEW: 'cms:react:unifiedThemePreview',
|
|
72
71
|
UNIFIED_APPS: 'Developers:UnifiedApps:PrivateBeta',
|
|
73
72
|
SANDBOXES_V2: 'sandboxes:v2:enabled',
|
|
74
73
|
SANDBOXES_V2_CLI: 'sandboxes:v2:cliEnabled',
|
|
@@ -88,16 +87,21 @@ export const LOCAL_DEV_UI_MESSAGE_SEND_TYPES = {
|
|
|
88
87
|
UPDATE_PROJECT_DATA: 'server:updateProjectData',
|
|
89
88
|
UPDATE_UPLOAD_WARNINGS: 'server:updateUploadWarnings',
|
|
90
89
|
CLI_METADATA: 'server:cliMetadata',
|
|
90
|
+
DEV_SERVERS_STARTED: 'server:devServersStarted',
|
|
91
91
|
};
|
|
92
92
|
export const LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES = {
|
|
93
93
|
UPLOAD: 'client:upload',
|
|
94
94
|
DEPLOY: 'client:deploy',
|
|
95
95
|
VIEWED_WELCOME_SCREEN: 'client:viewedWelcomeScreen',
|
|
96
|
+
APP_INSTALL_SUCCESS: 'client:installSuccess',
|
|
97
|
+
APP_INSTALL_INITIATED: 'client:installInitiated',
|
|
98
|
+
APP_INSTALL_FAILURE: 'client:installFailure',
|
|
96
99
|
};
|
|
97
100
|
export const APP_INSTALLATION_STATES = {
|
|
98
101
|
NOT_INSTALLED: 'NOT_INSTALLED',
|
|
99
102
|
INSTALLED: 'INSTALLED',
|
|
100
103
|
INSTALLED_WITH_OUTDATED_SCOPES: 'INSTALLED_WITH_OUTDATED_SCOPES',
|
|
104
|
+
UNKNOWN: 'UNKNOWN',
|
|
101
105
|
};
|
|
102
106
|
export const staticAuth = 'static';
|
|
103
107
|
export const oAuth = 'oauth';
|
|
@@ -111,9 +115,23 @@ export const GET_STARTED_OPTIONS = {
|
|
|
111
115
|
export const LOCAL_DEV_SERVER_MESSAGE_TYPES = {
|
|
112
116
|
INITIAL: 'INITIAL',
|
|
113
117
|
WEBSOCKET_SERVER_CONNECTED: 'WEBSOCKET_SERVER_CONNECTED',
|
|
118
|
+
STATIC_AUTH_APP_INSTALL_SUCCESS: 'APP_INSTALL_SUCCESS',
|
|
119
|
+
STATIC_AUTH_APP_INSTALL_FAILURE: 'APP_INSTALL_FAILURE',
|
|
120
|
+
OAUTH_APP_INSTALL_INITIATED: 'APP_INSTALL_INITIATED',
|
|
114
121
|
};
|
|
122
|
+
export const LOCAL_DEV_WEBSOCKET_SERVER_INSTANCE_ID = 'local-dev-ui-websocket-server';
|
|
115
123
|
export const CONFIG_LOCAL_STATE_FLAGS = {
|
|
116
124
|
LOCAL_DEV_UI_WELCOME: 'LOCAL_DEV_UI_WELCOME',
|
|
117
125
|
};
|
|
118
126
|
export const EMPTY_PROJECT = 'empty';
|
|
119
127
|
export const PROJECT_WITH_APP = 'app';
|
|
128
|
+
export const LEGACY_SERVERLESS_FILE = 'serverless.json';
|
|
129
|
+
export const LEGACY_PUBLIC_APP_FILE = 'public-app.json';
|
|
130
|
+
export const LEGACY_PRIVATE_APP_FILE = 'app.json';
|
|
131
|
+
export const THEME_FILE = 'theme.json';
|
|
132
|
+
export const CMS_ASSETS_FILE = 'cms-assets.json';
|
|
133
|
+
export const LEGACY_CONFIG_FILES = [
|
|
134
|
+
LEGACY_SERVERLESS_FILE,
|
|
135
|
+
LEGACY_PRIVATE_APP_FILE,
|
|
136
|
+
LEGACY_PUBLIC_APP_FILE,
|
|
137
|
+
];
|
|
@@ -4,16 +4,12 @@ import path from 'path';
|
|
|
4
4
|
import { exec as execAsync } from 'node:child_process';
|
|
5
5
|
import { walk } from '@hubspot/local-dev-lib/fs';
|
|
6
6
|
import { getProjectConfig } from './projects/config.js';
|
|
7
|
-
import {
|
|
8
|
-
import { i18n } from './lang.js';
|
|
7
|
+
import { commands } from '../lang/en.js';
|
|
9
8
|
import SpinniesManager from './ui/SpinniesManager.js';
|
|
10
9
|
import { isGloballyInstalled, executeInstall, DEFAULT_PACKAGE_MANAGER, } from './npm.js';
|
|
11
10
|
class NoPackageJsonFilesError extends Error {
|
|
12
11
|
constructor(projectName) {
|
|
13
|
-
super(
|
|
14
|
-
projectName,
|
|
15
|
-
link: uiLink('Learn how to create a project from scratch.', 'https://developers.hubspot.com/beta-docs/guides/crm/intro/create-a-project'),
|
|
16
|
-
}));
|
|
12
|
+
super(commands.project.installDeps.noPackageJsonInProject(projectName));
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
export async function installPackages({ packages, installLocations, }) {
|
|
@@ -28,31 +24,20 @@ async function installPackagesInDirectory(directory, packages) {
|
|
|
28
24
|
SpinniesManager.init();
|
|
29
25
|
SpinniesManager.add(spinner, {
|
|
30
26
|
text: packages && packages.length
|
|
31
|
-
?
|
|
32
|
-
|
|
33
|
-
directory: relativeDir,
|
|
34
|
-
})
|
|
35
|
-
: i18n(`commands.project.subcommands.installDeps.installingDependencies`, {
|
|
36
|
-
directory: relativeDir,
|
|
37
|
-
}),
|
|
27
|
+
? commands.project.installDeps.addingDependenciesToLocation(`[${packages.join(', ')}]`, relativeDir)
|
|
28
|
+
: commands.project.installDeps.installingDependencies(relativeDir),
|
|
38
29
|
});
|
|
39
30
|
try {
|
|
40
31
|
await executeInstall(packages, null, { cwd: directory });
|
|
41
32
|
SpinniesManager.succeed(spinner, {
|
|
42
|
-
text:
|
|
43
|
-
directory: relativeDir,
|
|
44
|
-
}),
|
|
33
|
+
text: commands.project.installDeps.installationSuccessful(relativeDir),
|
|
45
34
|
});
|
|
46
35
|
}
|
|
47
36
|
catch (e) {
|
|
48
37
|
SpinniesManager.fail(spinner, {
|
|
49
|
-
text:
|
|
50
|
-
directory: relativeDir,
|
|
51
|
-
}),
|
|
38
|
+
text: commands.project.installDeps.installingDependenciesFailed(relativeDir),
|
|
52
39
|
});
|
|
53
|
-
throw new Error(
|
|
54
|
-
directory: relativeDir,
|
|
55
|
-
}), {
|
|
40
|
+
throw new Error(commands.project.installDeps.installingDependenciesFailed(relativeDir), {
|
|
56
41
|
cause: e,
|
|
57
42
|
});
|
|
58
43
|
}
|
|
@@ -62,14 +47,11 @@ export async function getProjectPackageJsonLocations(dir) {
|
|
|
62
47
|
if (!projectConfig ||
|
|
63
48
|
!projectConfig.projectDir ||
|
|
64
49
|
!projectConfig.projectConfig) {
|
|
65
|
-
throw new Error(
|
|
50
|
+
throw new Error(commands.project.installDeps.noProjectConfig);
|
|
66
51
|
}
|
|
67
52
|
const { projectDir, projectConfig: { srcDir, name }, } = projectConfig;
|
|
68
53
|
if (!(await isGloballyInstalled(DEFAULT_PACKAGE_MANAGER))) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
packageManager: DEFAULT_PACKAGE_MANAGER,
|
|
71
|
-
link: uiLink(DEFAULT_PACKAGE_MANAGER, 'https://docs.npmjs.com/downloading-and-installing-node-js-and-npm'),
|
|
72
|
-
}));
|
|
54
|
+
throw new Error(commands.project.installDeps.packageManagerNotInstalled(DEFAULT_PACKAGE_MANAGER));
|
|
73
55
|
}
|
|
74
56
|
if (!fs.existsSync(projectConfig.projectDir) ||
|
|
75
57
|
!fs.existsSync(path.join(projectDir, srcDir))) {
|
|
@@ -3,9 +3,9 @@ import { getAccountId, getConfigAccounts } from '@hubspot/local-dev-lib/config';
|
|
|
3
3
|
import { getAccountIdentifier } from '@hubspot/local-dev-lib/config/getAccountIdentifier';
|
|
4
4
|
import { fetchDeveloperTestAccounts } from '@hubspot/local-dev-lib/api/developerTestAccounts';
|
|
5
5
|
import { isMissingScopeError, isSpecifiedError, } from '@hubspot/local-dev-lib/errors/index';
|
|
6
|
-
import {
|
|
6
|
+
import { uiLogger } from './ui/logger.js';
|
|
7
7
|
import { getHubSpotWebsiteOrigin } from '@hubspot/local-dev-lib/urls';
|
|
8
|
-
import {
|
|
8
|
+
import { lib } from '../lang/en.js';
|
|
9
9
|
import { uiAccountDescription } from './ui/index.js';
|
|
10
10
|
import { logError } from './errorHandlers/index.js';
|
|
11
11
|
export function getHasDevTestAccounts(appDeveloperAccountConfig) {
|
|
@@ -39,42 +39,28 @@ export async function validateDevTestAccountUsageLimits(accountConfig) {
|
|
|
39
39
|
if (count >= limit) {
|
|
40
40
|
const hasDevTestAccounts = getHasDevTestAccounts(accountConfig);
|
|
41
41
|
if (hasDevTestAccounts) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
accountName: accountConfig.name || accountId,
|
|
44
|
-
limit,
|
|
45
|
-
}));
|
|
42
|
+
throw new Error(lib.developerTestAccount.create.failure.alreadyInConfig(accountConfig.name || accountId, limit));
|
|
46
43
|
}
|
|
47
44
|
else {
|
|
48
|
-
throw new Error(
|
|
49
|
-
accountName: accountConfig.name || accountId,
|
|
50
|
-
limit,
|
|
51
|
-
}));
|
|
45
|
+
throw new Error(lib.developerTestAccount.create.failure.limit(accountConfig.name || accountId, limit));
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
48
|
return data;
|
|
55
49
|
}
|
|
56
50
|
export function handleDeveloperTestAccountCreateError(err, accountId, env, portalLimit) {
|
|
57
51
|
if (isMissingScopeError(err)) {
|
|
58
|
-
|
|
59
|
-
accountName: uiAccountDescription(accountId),
|
|
60
|
-
}));
|
|
52
|
+
uiLogger.error(lib.developerTestAccount.create.failure.scopes.message);
|
|
61
53
|
const websiteOrigin = getHubSpotWebsiteOrigin(env);
|
|
62
54
|
const url = `${websiteOrigin}/personal-access-key/${accountId}`;
|
|
63
|
-
|
|
64
|
-
accountName: uiAccountDescription(accountId),
|
|
65
|
-
url,
|
|
66
|
-
}));
|
|
55
|
+
uiLogger.info(lib.developerTestAccount.create.failure.scopes.instructions(uiAccountDescription(accountId), url));
|
|
67
56
|
}
|
|
68
57
|
else if (isSpecifiedError(err, {
|
|
69
58
|
statusCode: 400,
|
|
70
59
|
errorType: 'TEST_PORTAL_LIMIT_REACHED',
|
|
71
60
|
})) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
limit: portalLimit,
|
|
76
|
-
}));
|
|
77
|
-
logger.log('');
|
|
61
|
+
uiLogger.log('');
|
|
62
|
+
uiLogger.error(lib.developerTestAccount.create.failure.limit(uiAccountDescription(accountId), portalLimit));
|
|
63
|
+
uiLogger.log('');
|
|
78
64
|
}
|
|
79
65
|
else {
|
|
80
66
|
logError(err);
|
package/lib/doctor/Diagnosis.js
CHANGED
|
@@ -3,7 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { helpers } from '../interpolation.js';
|
|
4
4
|
import { uiAccountDescription } from '../ui/index.js';
|
|
5
5
|
import { indent } from '../ui/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { lib } from '../../lang/en.js';
|
|
7
7
|
export class Diagnosis {
|
|
8
8
|
prefixes;
|
|
9
9
|
diagnosis;
|
|
@@ -18,38 +18,30 @@ export class Diagnosis {
|
|
|
18
18
|
};
|
|
19
19
|
this.diagnosis = {
|
|
20
20
|
cli: {
|
|
21
|
-
header:
|
|
21
|
+
header: lib.doctor.diagnosis.cli.header,
|
|
22
22
|
sections: [],
|
|
23
23
|
},
|
|
24
24
|
cliConfig: {
|
|
25
|
-
header:
|
|
25
|
+
header: lib.doctor.diagnosis.cliConfig.header,
|
|
26
26
|
sections: [],
|
|
27
27
|
},
|
|
28
28
|
defaultAccountOverrideFile: {
|
|
29
|
-
header:
|
|
29
|
+
header: lib.doctor.diagnosis.defaultAccountOverrideFile.header,
|
|
30
30
|
sections: [],
|
|
31
31
|
},
|
|
32
32
|
project: {
|
|
33
|
-
header:
|
|
33
|
+
header: lib.doctor.diagnosis.projectConfig.header,
|
|
34
34
|
subheaders: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
i18n(`lib.doctor.diagnosis.projectConfig.projectNameSubHeader`, {
|
|
39
|
-
projectName: diagnosticInfo.project?.config?.projectConfig?.name,
|
|
40
|
-
}),
|
|
35
|
+
lib.doctor.diagnosis.projectConfig.projectDirSubHeader(diagnosticInfo.project?.config?.projectDir || ''),
|
|
36
|
+
lib.doctor.diagnosis.projectConfig.projectNameSubHeader(diagnosticInfo.project?.config?.projectConfig?.name || ''),
|
|
41
37
|
],
|
|
42
38
|
sections: [],
|
|
43
39
|
},
|
|
44
40
|
};
|
|
45
41
|
if (diagnosticInfo.config) {
|
|
46
42
|
this.diagnosis.cliConfig.subheaders = [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
i18n(`lib.doctor.diagnosis.cliConfig.defaultAccountSubHeader`, {
|
|
51
|
-
accountDetails: uiAccountDescription(accountId),
|
|
52
|
-
}),
|
|
43
|
+
lib.doctor.diagnosis.cliConfig.configFileSubHeader(diagnosticInfo.config),
|
|
44
|
+
lib.doctor.diagnosis.cliConfig.defaultAccountSubHeader(uiAccountDescription(accountId)),
|
|
53
45
|
];
|
|
54
46
|
}
|
|
55
47
|
}
|
|
@@ -83,12 +75,8 @@ export class Diagnosis {
|
|
|
83
75
|
return '';
|
|
84
76
|
}
|
|
85
77
|
output.push('');
|
|
86
|
-
output.push(
|
|
87
|
-
|
|
88
|
-
}));
|
|
89
|
-
output.push(i18n(`lib.doctor.diagnosis.counts.warnings`, {
|
|
90
|
-
count: this.warningCount,
|
|
91
|
-
}));
|
|
78
|
+
output.push(lib.doctor.diagnosis.counts.errors(this.errorCount));
|
|
79
|
+
output.push(lib.doctor.diagnosis.counts.warnings(this.warningCount));
|
|
92
80
|
output.push('');
|
|
93
81
|
return output.join('\n');
|
|
94
82
|
}
|
|
@@ -2,22 +2,23 @@ import { getProjectConfig } from '../projects/config.js';
|
|
|
2
2
|
import { fetchProject } from '@hubspot/local-dev-lib/api/projects';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import pkg from '../../package.json' with { type: 'json' };
|
|
5
|
-
import {
|
|
5
|
+
import { uiLogger } from '../ui/logger.js';
|
|
6
6
|
import { getAccountId, getDefaultAccountOverrideFilePath, isConfigFlagEnabled, } from '@hubspot/local-dev-lib/config';
|
|
7
7
|
import { getAccountConfig, getConfigPath } from '@hubspot/local-dev-lib/config';
|
|
8
8
|
import { getAccessToken } from '@hubspot/local-dev-lib/personalAccessKey';
|
|
9
9
|
import { walk } from '@hubspot/local-dev-lib/fs';
|
|
10
10
|
import util from 'util';
|
|
11
11
|
import { exec as execAsync } from 'node:child_process';
|
|
12
|
+
import { CMS_ASSETS_FILE, LEGACY_PRIVATE_APP_FILE, LEGACY_PUBLIC_APP_FILE, LEGACY_SERVERLESS_FILE, PROJECT_CONFIG_FILE, THEME_FILE, } from '../constants.js';
|
|
12
13
|
// This needs to be hardcoded since we are using it in the TS type
|
|
13
14
|
const hubspotCli = '@hubspot/cli';
|
|
14
15
|
const configFiles = [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
LEGACY_SERVERLESS_FILE,
|
|
17
|
+
PROJECT_CONFIG_FILE,
|
|
18
|
+
LEGACY_PRIVATE_APP_FILE,
|
|
19
|
+
LEGACY_PUBLIC_APP_FILE,
|
|
20
|
+
THEME_FILE,
|
|
21
|
+
CMS_ASSETS_FILE,
|
|
21
22
|
];
|
|
22
23
|
export class DiagnosticInfoBuilder {
|
|
23
24
|
accountId;
|
|
@@ -89,7 +90,7 @@ export class DiagnosticInfoBuilder {
|
|
|
89
90
|
this.projectDetails = data;
|
|
90
91
|
}
|
|
91
92
|
catch (e) {
|
|
92
|
-
|
|
93
|
+
uiLogger.debug(e);
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
async fetchAccessToken() {
|
|
@@ -97,7 +98,7 @@ export class DiagnosticInfoBuilder {
|
|
|
97
98
|
this.accessToken = await getAccessToken(this.personalAccessKey, this.env, this.accountId);
|
|
98
99
|
}
|
|
99
100
|
catch (e) {
|
|
100
|
-
|
|
101
|
+
uiLogger.debug(e);
|
|
101
102
|
}
|
|
102
103
|
return this.accessToken;
|
|
103
104
|
}
|
|
@@ -109,7 +110,7 @@ export class DiagnosticInfoBuilder {
|
|
|
109
110
|
.map(filename => path.relative(this._projectConfig.projectDir, filename));
|
|
110
111
|
}
|
|
111
112
|
catch (e) {
|
|
112
|
-
|
|
113
|
+
uiLogger.debug(e);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
async getNpmVersion() {
|
|
@@ -119,7 +120,7 @@ export class DiagnosticInfoBuilder {
|
|
|
119
120
|
return stdout.toString().trim();
|
|
120
121
|
}
|
|
121
122
|
catch (e) {
|
|
122
|
-
|
|
123
|
+
uiLogger.debug(e);
|
|
123
124
|
return null;
|
|
124
125
|
}
|
|
125
126
|
}
|