@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
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
contact?: boolean;
|
|
6
|
-
watch?: boolean;
|
|
7
|
-
'log-output'?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const functionServerCommand: YargsCommandModule<unknown, FunctionServerArgs>;
|
|
10
|
-
export default functionServerCommand;
|
|
1
|
+
import { YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
import { FunctionServerArgs } from '../cms/function/server.js';
|
|
3
|
+
declare const deprecatedFunctionServerCommand: YargsCommandModule<unknown, FunctionServerArgs>;
|
|
4
|
+
export default deprecatedFunctionServerCommand;
|
|
@@ -1,66 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
// This package is not typed, so we need to use require
|
|
4
|
-
import { start as startTestServer } from '@hubspot/serverless-dev-runtime';
|
|
5
|
-
import { i18n } from '../../lib/lang.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../../lib/ui/index.js';
|
|
2
|
+
import cmsFunctionServerCommand from '../cms/function/server.js';
|
|
6
3
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
4
|
+
import { commands } from '../../lang/en.js';
|
|
7
5
|
const command = 'server <path>';
|
|
8
|
-
const describe =
|
|
6
|
+
const describe = uiDeprecatedTag(cmsFunctionServerCommand.describe, false);
|
|
9
7
|
async function handler(args) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
logger.debug(i18n('commands.function.subcommands.server.debug.startingServer', {
|
|
13
|
-
functionPath,
|
|
14
|
-
}));
|
|
15
|
-
startTestServer({
|
|
16
|
-
accountId: derivedAccountId,
|
|
17
|
-
...args,
|
|
18
|
-
});
|
|
8
|
+
uiCommandRelocatedMessage('hs cms function server');
|
|
9
|
+
await cmsFunctionServerCommand.handler(args);
|
|
19
10
|
}
|
|
20
|
-
function
|
|
11
|
+
function deprecatedFunctionServerBuilder(yargs) {
|
|
21
12
|
yargs.positional('path', {
|
|
22
|
-
describe:
|
|
13
|
+
describe: commands.cms.subcommands.function.subcommands.server.positionals.path
|
|
14
|
+
.describe,
|
|
23
15
|
type: 'string',
|
|
24
16
|
});
|
|
25
17
|
yargs.options({
|
|
26
18
|
port: {
|
|
27
|
-
describe:
|
|
19
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.port
|
|
20
|
+
.describe,
|
|
28
21
|
type: 'string',
|
|
29
22
|
default: 5432,
|
|
30
23
|
},
|
|
31
24
|
contact: {
|
|
32
|
-
describe:
|
|
25
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.contact
|
|
26
|
+
.describe,
|
|
33
27
|
type: 'boolean',
|
|
34
28
|
default: true,
|
|
35
29
|
},
|
|
36
30
|
watch: {
|
|
37
|
-
describe:
|
|
31
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.watch
|
|
32
|
+
.describe,
|
|
38
33
|
type: 'boolean',
|
|
39
34
|
default: true,
|
|
40
35
|
},
|
|
41
36
|
'log-output': {
|
|
42
|
-
describe:
|
|
37
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.logOutput
|
|
38
|
+
.describe,
|
|
43
39
|
type: 'boolean',
|
|
44
40
|
default: false,
|
|
45
41
|
},
|
|
46
42
|
});
|
|
47
|
-
yargs.example([
|
|
48
|
-
[
|
|
49
|
-
'$0 functions server ./tmp/myFunctionFolder.functions',
|
|
50
|
-
i18n('commands.function.subcommands.server.examples.default'),
|
|
51
|
-
],
|
|
52
|
-
]);
|
|
53
43
|
return yargs;
|
|
54
44
|
}
|
|
55
|
-
const
|
|
45
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionServerCommand.describe, 'hs cms function server');
|
|
46
|
+
const builder = makeYargsBuilder(deprecatedFunctionServerBuilder, command, verboseDescribe, {
|
|
56
47
|
useConfigOptions: true,
|
|
57
48
|
useAccountOptions: true,
|
|
58
49
|
useEnvironmentOptions: true,
|
|
59
50
|
});
|
|
60
|
-
const
|
|
61
|
-
|
|
51
|
+
const deprecatedFunctionServerCommand = {
|
|
52
|
+
...cmsFunctionServerCommand,
|
|
62
53
|
describe,
|
|
63
54
|
handler,
|
|
64
55
|
builder,
|
|
65
56
|
};
|
|
66
|
-
export default
|
|
57
|
+
export default deprecatedFunctionServerCommand;
|
package/commands/function.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { YargsCommandModuleBucket } from '../types/Yargs.js';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
declare const functionCommand: YargsCommandModuleBucket;
|
|
5
|
-
export default functionCommand;
|
|
2
|
+
declare const deprecatedFunctionCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default deprecatedFunctionCommand;
|
package/commands/function.js
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import { uiLogger } from '../lib/ui/logger.js';
|
|
3
|
+
import cmsFunctionCommand from './cms/function.js';
|
|
4
|
+
import listCommand from './function/list.js';
|
|
5
|
+
import deployCommand from './function/deploy.js';
|
|
6
|
+
import serverCommand from './function/server.js';
|
|
5
7
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
const command = ['function', 'functions'];
|
|
9
|
+
const describe = uiDeprecatedTag(cmsFunctionCommand.describe, false);
|
|
10
|
+
// We cannot use the builder from cmsFunctionCommand because it includes the create and logs commands
|
|
8
11
|
function functionBuilder(yargs) {
|
|
9
|
-
yargs
|
|
12
|
+
yargs
|
|
13
|
+
.command(listCommand)
|
|
14
|
+
.command(deployCommand)
|
|
15
|
+
.command(serverCommand)
|
|
16
|
+
.demandCommand(1, '');
|
|
10
17
|
return yargs;
|
|
11
18
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionCommand.describe, 'hs cms function');
|
|
20
|
+
const builder = makeYargsBuilder(functionBuilder, command, verboseDescribe);
|
|
21
|
+
async function handler(args) {
|
|
22
|
+
uiCommandRelocatedMessage('hs cms function');
|
|
23
|
+
uiLogger.log('');
|
|
24
|
+
await cmsFunctionCommand.handler(args);
|
|
25
|
+
}
|
|
26
|
+
const deprecatedFunctionCommand = {
|
|
27
|
+
...cmsFunctionCommand,
|
|
17
28
|
describe,
|
|
18
29
|
builder,
|
|
19
|
-
handler
|
|
30
|
+
handler,
|
|
20
31
|
};
|
|
21
|
-
export default
|
|
32
|
+
export default deprecatedFunctionCommand;
|
package/commands/getStarted.js
CHANGED
|
@@ -17,7 +17,7 @@ import { PROJECT_CONFIG_FILE, GET_STARTED_OPTIONS, HUBSPOT_PROJECT_COMPONENTS_GI
|
|
|
17
17
|
import { writeProjectConfig, getProjectConfig, validateProjectConfig, } from '../lib/projects/config.js';
|
|
18
18
|
import { getProjectPackageJsonLocations, installPackages, } from '../lib/dependencyManagement.js';
|
|
19
19
|
import { pollProjectBuildAndDeploy } from '../lib/projects/pollProjectBuildAndDeploy.js';
|
|
20
|
-
import {
|
|
20
|
+
import { isV2Project } from '../lib/projects/platformVersion.js';
|
|
21
21
|
import { openLink } from '../lib/links.js';
|
|
22
22
|
import { getStaticAuthAppInstallUrl } from '../lib/app/urls.js';
|
|
23
23
|
import { getEnv } from '@hubspot/local-dev-lib/config';
|
|
@@ -191,7 +191,7 @@ async function handler(args) {
|
|
|
191
191
|
uploadMessage: 'Initial upload from get-started command',
|
|
192
192
|
forceCreate: true, // Auto-create project on HubSpot
|
|
193
193
|
isUploadCommand: false,
|
|
194
|
-
sendIR:
|
|
194
|
+
sendIR: isV2Project(newProjectConfig.platformVersion),
|
|
195
195
|
skipValidation: false,
|
|
196
196
|
});
|
|
197
197
|
if (uploadError) {
|
package/commands/hubdb/clear.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
2
2
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
3
3
|
import { clearHubDbTableRows } from '@hubspot/local-dev-lib/hubdb';
|
|
4
4
|
import { publishTable } from '@hubspot/local-dev-lib/api/hubdb';
|
|
5
5
|
import { selectHubDBTablePrompt } from '../../lib/prompts/selectHubDBTablePrompt.js';
|
|
6
6
|
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
7
|
-
import {
|
|
7
|
+
import { commands } from '../../lang/en.js';
|
|
8
8
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
9
9
|
const command = 'clear [table-id]';
|
|
10
|
-
const describe =
|
|
10
|
+
const describe = commands.hubdb.subcommands.clear.describe;
|
|
11
11
|
async function handler(args) {
|
|
12
12
|
const { derivedAccountId } = args;
|
|
13
13
|
trackCommandUsage('hubdb-clear', {}, derivedAccountId);
|
|
@@ -20,20 +20,12 @@ async function handler(args) {
|
|
|
20
20
|
});
|
|
21
21
|
const { deletedRowCount } = await clearHubDbTableRows(derivedAccountId, tableId);
|
|
22
22
|
if (deletedRowCount > 0) {
|
|
23
|
-
|
|
24
|
-
deletedRowCount,
|
|
25
|
-
tableId,
|
|
26
|
-
}));
|
|
23
|
+
uiLogger.log(commands.hubdb.subcommands.clear.logs.removedRows(deletedRowCount, tableId));
|
|
27
24
|
const { data: { rowCount }, } = await publishTable(derivedAccountId, tableId);
|
|
28
|
-
|
|
29
|
-
rowCount,
|
|
30
|
-
tableId,
|
|
31
|
-
}));
|
|
25
|
+
uiLogger.log(commands.hubdb.subcommands.clear.logs.rowCount(tableId, rowCount));
|
|
32
26
|
}
|
|
33
27
|
else {
|
|
34
|
-
|
|
35
|
-
tableId,
|
|
36
|
-
}));
|
|
28
|
+
uiLogger.log(commands.hubdb.subcommands.clear.logs.tableEmpty(tableId));
|
|
37
29
|
}
|
|
38
30
|
}
|
|
39
31
|
catch (e) {
|
|
@@ -42,7 +34,7 @@ async function handler(args) {
|
|
|
42
34
|
}
|
|
43
35
|
function hubdbClearBuilder(yargs) {
|
|
44
36
|
yargs.positional('table-id', {
|
|
45
|
-
describe:
|
|
37
|
+
describe: commands.hubdb.subcommands.clear.positionals.tableId.describe,
|
|
46
38
|
type: 'string',
|
|
47
39
|
});
|
|
48
40
|
return yargs;
|
package/commands/hubdb/create.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import {
|
|
2
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
3
3
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
4
4
|
import { getCwd, untildify, isValidPath } from '@hubspot/local-dev-lib/path';
|
|
5
5
|
import { createHubDbTable } from '@hubspot/local-dev-lib/hubdb';
|
|
6
6
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
7
7
|
import { checkAndConvertToJson } from '../../lib/validation.js';
|
|
8
8
|
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
9
|
-
import {
|
|
9
|
+
import { commands } from '../../lang/en.js';
|
|
10
10
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
12
12
|
const command = 'create';
|
|
13
|
-
const describe =
|
|
13
|
+
const describe = commands.hubdb.subcommands.create.describe;
|
|
14
14
|
function selectPathPrompt(options) {
|
|
15
15
|
return promptUser([
|
|
16
16
|
{
|
|
17
17
|
name: 'path',
|
|
18
|
-
message:
|
|
18
|
+
message: commands.hubdb.subcommands.create.enterPath,
|
|
19
19
|
when: !options.path,
|
|
20
20
|
validate: (input) => {
|
|
21
21
|
if (!input) {
|
|
22
|
-
return
|
|
22
|
+
return commands.hubdb.subcommands.create.errors.pathRequired;
|
|
23
23
|
}
|
|
24
24
|
if (!isValidPath(input)) {
|
|
25
|
-
return
|
|
25
|
+
return commands.hubdb.subcommands.create.errors.invalidCharacters;
|
|
26
26
|
}
|
|
27
27
|
return true;
|
|
28
28
|
},
|
|
@@ -45,22 +45,16 @@ async function handler(args) {
|
|
|
45
45
|
process.exit(EXIT_CODES.ERROR);
|
|
46
46
|
}
|
|
47
47
|
const table = await createHubDbTable(derivedAccountId, path.resolve(getCwd(), filePath));
|
|
48
|
-
|
|
49
|
-
accountId: derivedAccountId,
|
|
50
|
-
rowCount: table.rowCount,
|
|
51
|
-
tableId: table.tableId,
|
|
52
|
-
}));
|
|
48
|
+
uiLogger.success(commands.hubdb.subcommands.create.success.create(table.tableId, derivedAccountId, table.rowCount));
|
|
53
49
|
}
|
|
54
50
|
catch (e) {
|
|
55
|
-
|
|
56
|
-
filePath: filePath || '',
|
|
57
|
-
}));
|
|
51
|
+
uiLogger.error(commands.hubdb.subcommands.create.errors.create(filePath || ''));
|
|
58
52
|
logError(e);
|
|
59
53
|
}
|
|
60
54
|
}
|
|
61
55
|
function hubdbCreateBuilder(yargs) {
|
|
62
56
|
yargs.options('path', {
|
|
63
|
-
describe:
|
|
57
|
+
describe: commands.hubdb.subcommands.create.options.path.describe,
|
|
64
58
|
type: 'string',
|
|
65
59
|
});
|
|
66
60
|
return yargs;
|
package/commands/hubdb/delete.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
2
2
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
3
3
|
import { deleteTable } from '@hubspot/local-dev-lib/api/hubdb';
|
|
4
4
|
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
5
5
|
import { selectHubDBTablePrompt } from '../../lib/prompts/selectHubDBTablePrompt.js';
|
|
6
6
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
7
7
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
8
|
-
import {
|
|
8
|
+
import { commands } from '../../lang/en.js';
|
|
9
9
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
10
10
|
const command = 'delete [table-id]';
|
|
11
|
-
const describe =
|
|
11
|
+
const describe = commands.hubdb.subcommands.delete.describe;
|
|
12
12
|
async function handler(args) {
|
|
13
13
|
const { force, derivedAccountId } = args;
|
|
14
14
|
trackCommandUsage('hubdb-delete', {}, derivedAccountId);
|
|
@@ -23,35 +23,28 @@ async function handler(args) {
|
|
|
23
23
|
const { shouldDeleteTable } = await promptUser({
|
|
24
24
|
name: 'shouldDeleteTable',
|
|
25
25
|
type: 'confirm',
|
|
26
|
-
message:
|
|
27
|
-
tableId,
|
|
28
|
-
}),
|
|
26
|
+
message: commands.hubdb.subcommands.delete.shouldDeleteTable(tableId),
|
|
29
27
|
});
|
|
30
28
|
if (!shouldDeleteTable) {
|
|
31
29
|
process.exit(EXIT_CODES.SUCCESS);
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
await deleteTable(derivedAccountId, tableId);
|
|
35
|
-
|
|
36
|
-
accountId: derivedAccountId,
|
|
37
|
-
tableId,
|
|
38
|
-
}));
|
|
33
|
+
uiLogger.success(commands.hubdb.subcommands.delete.success.delete(tableId, derivedAccountId));
|
|
39
34
|
process.exit(EXIT_CODES.SUCCESS);
|
|
40
35
|
}
|
|
41
36
|
catch (e) {
|
|
42
|
-
|
|
43
|
-
tableId: args.tableId || '',
|
|
44
|
-
}));
|
|
37
|
+
uiLogger.error(commands.hubdb.subcommands.delete.errors.delete(args.tableId || ''));
|
|
45
38
|
logError(e);
|
|
46
39
|
}
|
|
47
40
|
}
|
|
48
41
|
function hubdbDeleteBuilder(yargs) {
|
|
49
42
|
yargs.positional('table-id', {
|
|
50
|
-
describe:
|
|
43
|
+
describe: commands.hubdb.subcommands.delete.positionals.tableId.describe,
|
|
51
44
|
type: 'string',
|
|
52
45
|
});
|
|
53
46
|
yargs.option('force', {
|
|
54
|
-
describe:
|
|
47
|
+
describe: commands.hubdb.subcommands.delete.options.force.describe,
|
|
55
48
|
type: 'boolean',
|
|
56
49
|
});
|
|
57
50
|
return yargs;
|
package/commands/hubdb/fetch.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
2
2
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
3
3
|
import { downloadHubDbTable } from '@hubspot/local-dev-lib/hubdb';
|
|
4
4
|
import { selectHubDBTablePrompt } from '../../lib/prompts/selectHubDBTablePrompt.js';
|
|
5
5
|
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
6
|
-
import {
|
|
6
|
+
import { commands } from '../../lang/en.js';
|
|
7
7
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
8
8
|
const command = 'fetch [table-id] [dest]';
|
|
9
|
-
const describe =
|
|
9
|
+
const describe = commands.hubdb.subcommands.fetch.describe;
|
|
10
10
|
async function handler(args) {
|
|
11
11
|
const { derivedAccountId } = args;
|
|
12
12
|
trackCommandUsage('hubdb-fetch', {}, derivedAccountId);
|
|
@@ -19,10 +19,7 @@ async function handler(args) {
|
|
|
19
19
|
const tableId = args.tableId || promptAnswers.tableId;
|
|
20
20
|
const dest = args.dest || promptAnswers.dest;
|
|
21
21
|
const { filePath } = await downloadHubDbTable(derivedAccountId, tableId, dest);
|
|
22
|
-
|
|
23
|
-
path: filePath,
|
|
24
|
-
tableId,
|
|
25
|
-
}));
|
|
22
|
+
uiLogger.success(commands.hubdb.subcommands.fetch.success.fetch(tableId, filePath));
|
|
26
23
|
}
|
|
27
24
|
catch (e) {
|
|
28
25
|
logError(e);
|
|
@@ -30,11 +27,11 @@ async function handler(args) {
|
|
|
30
27
|
}
|
|
31
28
|
function hubdbFetchBuilder(yargs) {
|
|
32
29
|
yargs.positional('table-id', {
|
|
33
|
-
describe:
|
|
30
|
+
describe: commands.hubdb.subcommands.fetch.positionals.tableId.describe,
|
|
34
31
|
type: 'string',
|
|
35
32
|
});
|
|
36
33
|
yargs.positional('dest', {
|
|
37
|
-
describe:
|
|
34
|
+
describe: commands.hubdb.subcommands.fetch.positionals.dest.describe,
|
|
38
35
|
type: 'string',
|
|
39
36
|
});
|
|
40
37
|
return yargs;
|
package/commands/hubdb.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { YargsCommandModuleBucket } from '../types/Yargs.js';
|
|
2
2
|
export declare const command = "hubdb";
|
|
3
|
-
export declare const describe:
|
|
3
|
+
export declare const describe: "Commands for managing HubDB tables.";
|
|
4
4
|
declare const hubdbCommand: YargsCommandModuleBucket;
|
|
5
5
|
export default hubdbCommand;
|
package/commands/hubdb.js
CHANGED
|
@@ -3,10 +3,10 @@ import fetchCommand from './hubdb/fetch.js';
|
|
|
3
3
|
import deleteCommand from './hubdb/delete.js';
|
|
4
4
|
import clearCommand from './hubdb/clear.js';
|
|
5
5
|
import listCommand from './hubdb/list.js';
|
|
6
|
-
import {
|
|
6
|
+
import { commands } from '../lang/en.js';
|
|
7
7
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
8
8
|
export const command = 'hubdb';
|
|
9
|
-
export const describe =
|
|
9
|
+
export const describe = commands.hubdb.describe;
|
|
10
10
|
function hubdbBuilder(yargs) {
|
|
11
11
|
yargs
|
|
12
12
|
.command(clearCommand)
|
package/commands/init.js
CHANGED
|
@@ -9,7 +9,7 @@ import { getCwd } from '@hubspot/local-dev-lib/path';
|
|
|
9
9
|
import { toKebabCase } from '@hubspot/local-dev-lib/text';
|
|
10
10
|
import { ENVIRONMENTS } from '@hubspot/local-dev-lib/constants/environments';
|
|
11
11
|
import { getAccountIdentifier } from '@hubspot/local-dev-lib/config/getAccountIdentifier';
|
|
12
|
-
import {
|
|
12
|
+
import { setCLILogLevel } from '../lib/commonOpts.js';
|
|
13
13
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
14
14
|
import { handleExit } from '../lib/process.js';
|
|
15
15
|
import { debugError, logError } from '../lib/errorHandlers/index.js';
|
|
@@ -74,7 +74,7 @@ async function handler(args) {
|
|
|
74
74
|
PERSONAL_ACCESS_KEY_AUTH_METHOD.value;
|
|
75
75
|
const configPath = (configFlagValue && path.join(getCwd(), configFlagValue)) ||
|
|
76
76
|
getConfigPath('', useHiddenConfig);
|
|
77
|
-
|
|
77
|
+
setCLILogLevel(args);
|
|
78
78
|
if (!disableTracking) {
|
|
79
79
|
trackCommandUsage('init', {
|
|
80
80
|
authType,
|
|
@@ -99,7 +99,6 @@ async function handler(args) {
|
|
|
99
99
|
uiLogger.error(commands.init.errors.bothConfigFilesNotAllowed(path));
|
|
100
100
|
process.exit(EXIT_CODES.ERROR);
|
|
101
101
|
}
|
|
102
|
-
trackAuthAction('init', authType, TRACKING_STATUS.STARTED, parsedUserProvidedAccountId);
|
|
103
102
|
createEmptyConfigFile({ path: configPath }, useHiddenConfig);
|
|
104
103
|
//Needed to load deprecated config
|
|
105
104
|
loadConfig(configPath, args);
|
package/commands/lint.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const lintCommand: YargsCommandModule<unknown, LintArgs>;
|
|
6
|
-
export default lintCommand;
|
|
1
|
+
import { YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
import { LintArgs } from './cms/lint.js';
|
|
3
|
+
declare const deprecatedCmsLintCommand: YargsCommandModule<unknown, LintArgs>;
|
|
4
|
+
export default deprecatedCmsLintCommand;
|
package/commands/lint.js
CHANGED
|
@@ -1,83 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { logError } from '../lib/errorHandlers/index.js';
|
|
4
|
-
import { trackCommandUsage } from '../lib/usageTracking.js';
|
|
5
|
-
import { i18n } from '../lib/lang.js';
|
|
6
|
-
import { resolveLocalPath } from '../lib/filesystem.js';
|
|
7
|
-
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import cmsLintCommand from './cms/lint.js';
|
|
8
3
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
4
|
+
import { commands } from '../lang/en.js';
|
|
9
5
|
const command = 'lint <path>';
|
|
10
|
-
|
|
11
|
-
const describe = undefined; //'Lint a file or folder for HubL syntax';
|
|
12
|
-
function getErrorsFromHublValidationObject(validation) {
|
|
13
|
-
return ((validation && validation.meta && validation.meta.template_errors) || []);
|
|
14
|
-
}
|
|
15
|
-
function printHublValidationError(err) {
|
|
16
|
-
const { severity, message, lineno, startPosition } = err;
|
|
17
|
-
const method = severity === 'FATAL' ? 'error' : 'warn';
|
|
18
|
-
logger[method]('[%d, %d]: %s', lineno, startPosition, message);
|
|
19
|
-
}
|
|
20
|
-
function printHublValidationResult({ file, validation }) {
|
|
21
|
-
let count = 0;
|
|
22
|
-
if (!validation) {
|
|
23
|
-
return count;
|
|
24
|
-
}
|
|
25
|
-
const errors = getErrorsFromHublValidationObject(validation);
|
|
26
|
-
if (!errors.length) {
|
|
27
|
-
return count;
|
|
28
|
-
}
|
|
29
|
-
logger.group(file);
|
|
30
|
-
errors.forEach(err => {
|
|
31
|
-
if (err.reason !== 'SYNTAX_ERROR') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
++count;
|
|
35
|
-
printHublValidationError(err);
|
|
36
|
-
});
|
|
37
|
-
logger.groupEnd();
|
|
38
|
-
return count;
|
|
39
|
-
}
|
|
6
|
+
const describe = uiDeprecatedTag(cmsLintCommand.describe, false);
|
|
40
7
|
async function handler(args) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const groupName = i18n(`commands.lint.groupName`, {
|
|
44
|
-
path: localPath,
|
|
45
|
-
});
|
|
46
|
-
trackCommandUsage('lint', undefined, derivedAccountId);
|
|
47
|
-
logger.group(groupName);
|
|
48
|
-
let count = 0;
|
|
49
|
-
try {
|
|
50
|
-
await lint(derivedAccountId, localPath, (result) => {
|
|
51
|
-
return (count += printHublValidationResult(result));
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
logger.groupEnd();
|
|
56
|
-
logError(err, { accountId: derivedAccountId });
|
|
57
|
-
process.exit(EXIT_CODES.ERROR);
|
|
58
|
-
}
|
|
59
|
-
logger.groupEnd();
|
|
60
|
-
logger.log(i18n(`commands.lint.issuesFound`, {
|
|
61
|
-
count,
|
|
62
|
-
}));
|
|
8
|
+
uiCommandRelocatedMessage('hs cms lint');
|
|
9
|
+
await cmsLintCommand.handler(args);
|
|
63
10
|
}
|
|
64
|
-
function
|
|
11
|
+
function deprecatedCmsLintBuilder(yargs) {
|
|
65
12
|
yargs.positional('path', {
|
|
66
|
-
describe:
|
|
13
|
+
describe: commands.cms.subcommands.lint.positionals.path.describe,
|
|
67
14
|
required: true,
|
|
68
15
|
type: 'string',
|
|
69
16
|
});
|
|
70
17
|
return yargs;
|
|
71
18
|
}
|
|
72
|
-
const
|
|
19
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsLintCommand.describe, 'hs cms lint');
|
|
20
|
+
const builder = makeYargsBuilder(deprecatedCmsLintBuilder, command, verboseDescribe, {
|
|
73
21
|
useGlobalOptions: true,
|
|
74
22
|
useConfigOptions: true,
|
|
75
23
|
useAccountOptions: true,
|
|
76
24
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
25
|
+
const deprecatedCmsLintCommand = {
|
|
26
|
+
...cmsLintCommand,
|
|
79
27
|
describe,
|
|
80
28
|
handler,
|
|
81
29
|
builder,
|
|
82
30
|
};
|
|
83
|
-
export default
|
|
31
|
+
export default deprecatedCmsLintCommand;
|
package/commands/list.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const cmsListCommand: YargsCommandModule<unknown, ListArgs>;
|
|
6
|
-
export default cmsListCommand;
|
|
1
|
+
import { YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
import { ListArgs } from './cms/list.js';
|
|
3
|
+
declare const deprecatedCmsListCommand: YargsCommandModule<unknown, ListArgs>;
|
|
4
|
+
export default deprecatedCmsListCommand;
|