@hubspot/cli 7.5.4-experimental.0 → 7.5.4
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/migrate.d.ts +14 -4
- package/api/migrate.js +16 -2
- package/bin/cli.js +100 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +87 -80
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +33 -58
- package/commands/app/migrate.d.ts +5 -6
- package/commands/app/migrate.js +60 -44
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +10 -10
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +35 -35
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +22 -16
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -13
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +37 -46
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +18 -44
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +62 -75
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +20 -48
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -22
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -48
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -34
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +18 -42
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +22 -11
- package/commands/getStarted.d.ts +9 -0
- package/commands/getStarted.js +227 -0
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +21 -15
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +23 -17
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +24 -16
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +20 -14
- package/commands/hubdb/list.d.ts +4 -0
- package/commands/hubdb/list.js +83 -0
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +24 -47
- package/commands/init.d.ts +3 -7
- package/commands/init.js +25 -17
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -44
- package/commands/list.d.ts +3 -7
- package/commands/list.js +21 -16
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -45
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +50 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +75 -0
- package/commands/mcp.d.ts +3 -0
- package/commands/mcp.js +26 -0
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -30
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -12
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +20 -15
- package/commands/open.d.ts +3 -7
- package/commands/open.js +20 -15
- package/commands/project/add.d.ts +8 -9
- package/commands/project/add.js +53 -85
- package/commands/project/cloneApp.d.ts +6 -8
- package/commands/project/cloneApp.js +51 -47
- package/commands/project/create.d.ts +4 -1
- package/commands/project/create.js +132 -81
- package/commands/project/deploy.d.ts +5 -6
- package/commands/project/deploy.js +93 -37
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +41 -26
- package/commands/project/dev/index.d.ts +4 -5
- package/commands/project/dev/index.js +103 -33
- package/commands/project/dev/unifiedFlow.d.ts +11 -2
- package/commands/project/dev/unifiedFlow.js +85 -46
- package/commands/project/download.d.ts +3 -7
- package/commands/project/download.js +18 -19
- package/commands/project/installDeps.d.ts +6 -1
- package/commands/project/installDeps.js +48 -32
- package/commands/project/listBuilds.d.ts +3 -7
- package/commands/project/listBuilds.js +32 -30
- package/commands/project/logs.d.ts +10 -1
- package/commands/project/logs.js +73 -65
- package/commands/project/migrate.d.ts +7 -0
- package/commands/project/migrate.js +71 -0
- package/commands/project/migrateApp.d.ts +3 -8
- package/commands/project/migrateApp.js +23 -20
- package/commands/project/open.d.ts +3 -7
- package/commands/project/open.js +29 -21
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +209 -0
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/delete.js +123 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +10 -1
- package/commands/project/upload.js +94 -56
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project/watch.d.ts +6 -1
- package/commands/project/watch.js +95 -61
- package/commands/project.d.ts +3 -1
- package/commands/project.js +49 -35
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -20
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +27 -21
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +35 -29
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -44
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +21 -15
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +28 -18
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +19 -13
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +25 -17
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -49
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -16
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -18
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +36 -30
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -48
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -135
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -76
- package/lang/en.d.ts +3217 -0
- package/lang/en.js +3074 -3318
- package/lang/en.lyaml +41 -246
- package/lib/accountTypes.d.ts +1 -0
- package/lib/accountTypes.js +11 -0
- package/lib/app/migrate.d.ts +33 -4
- package/lib/app/migrate.js +232 -99
- package/lib/app/migrate_legacy.d.ts +2 -2
- package/lib/app/migrate_legacy.js +16 -13
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/buildAccount.d.ts +1 -2
- package/lib/buildAccount.js +11 -10
- package/lib/commonOpts.d.ts +4 -7
- package/lib/commonOpts.js +47 -19
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +39 -60
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -45
- package/lib/constants.d.ts +33 -0
- package/lib/constants.js +34 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +14 -40
- package/lib/doctor/Diagnosis.js +10 -11
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +10 -10
- package/lib/doctor/Doctor.js +45 -49
- package/lib/errorHandlers/index.js +13 -7
- package/lib/errorHandlers/suppressError.js +18 -26
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -6
- package/lib/hasFeature.d.ts +3 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/marketplaceValidate.d.ts +12 -2
- package/lib/marketplaceValidate.js +22 -29
- package/lib/mcp/setup.d.ts +21 -0
- package/lib/mcp/setup.js +218 -0
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +3 -3
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +32 -2
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +12 -24
- package/lib/middleware/yargsChecksMiddleware.js +2 -2
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/oauth.js +1 -2
- package/lib/process.js +1 -2
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- package/lib/projects/ProjectLogsManager.d.ts +1 -1
- package/lib/projects/ProjectLogsManager.js +16 -21
- package/lib/projects/add/legacyAddComponent.d.ts +5 -0
- package/lib/projects/add/legacyAddComponent.js +48 -0
- package/lib/projects/add/v3AddComponent.d.ts +8 -0
- package/lib/projects/add/v3AddComponent.js +85 -0
- package/lib/projects/buildAndDeploy.js +46 -42
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -0
- package/lib/projects/config.d.ts +9 -0
- package/lib/projects/config.js +79 -0
- package/lib/projects/create/index.d.ts +23 -0
- package/lib/projects/create/index.js +33 -0
- package/lib/projects/create/legacy.d.ts +6 -0
- package/lib/projects/{create.js → create/legacy.js} +23 -15
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/ensureProjectExists.d.ts +11 -0
- package/lib/projects/ensureProjectExists.js +97 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/{DevServerManager.d.ts → projects/localDev/DevServerManager.d.ts} +1 -1
- package/lib/{DevServerManager.js → projects/localDev/DevServerManager.js} +6 -6
- package/lib/projects/localDev/DevServerManagerV2.d.ts +22 -0
- package/lib/{DevServerManagerV2.js → projects/localDev/DevServerManagerV2.js} +22 -19
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +159 -0
- package/lib/{LocalDevManager.d.ts → projects/localDev/LocalDevManager.d.ts} +1 -1
- package/lib/{LocalDevManager.js → projects/localDev/LocalDevManager.js} +57 -83
- package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
- package/lib/projects/localDev/LocalDevProcess.js +201 -0
- package/lib/projects/localDev/LocalDevState.d.ts +50 -0
- package/lib/projects/localDev/LocalDevState.js +119 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +53 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
- package/lib/{localDev.d.ts → projects/localDev/helpers.d.ts} +6 -4
- package/lib/{localDev.js → projects/localDev/helpers.js} +127 -114
- package/lib/projects/ui.d.ts +1 -0
- package/lib/projects/ui.js +15 -0
- package/lib/projects/upload.d.ts +17 -2
- package/lib/projects/upload.js +74 -50
- package/lib/projects/urls.d.ts +4 -0
- package/lib/projects/urls.js +23 -1
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +21 -18
- package/lib/prompts/accountNamePrompt.js +16 -13
- package/lib/prompts/accountsPrompt.js +1 -2
- package/lib/prompts/cmsFieldPrompt.js +1 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createApiSamplePrompt.js +4 -5
- package/lib/prompts/createFunctionPrompt.js +13 -14
- package/lib/prompts/createModulePrompt.js +8 -9
- package/lib/prompts/createProjectPrompt.d.ts +20 -4
- package/lib/prompts/createProjectPrompt.js +43 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/createTemplatePrompt.js +1 -2
- package/lib/prompts/downloadProjectPrompt.js +3 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -25
- package/lib/prompts/previewPrompt.js +5 -6
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -8
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +15 -16
- package/lib/prompts/projectNamePrompt.js +5 -6
- package/lib/prompts/projectsLogsPrompt.js +3 -2
- package/lib/prompts/promptUtils.d.ts +4 -2
- package/lib/prompts/promptUtils.js +3 -1
- package/lib/prompts/sandboxesPrompt.js +5 -6
- package/lib/prompts/secretPrompt.js +2 -3
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/selectHubDBTablePrompt.js +11 -8
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -9
- package/lib/prompts/setAsDefaultAccountPrompt.js +11 -2
- package/lib/prompts/uploadPrompt.js +4 -5
- package/lib/sandboxSync.js +15 -14
- package/lib/sandboxes.js +12 -13
- package/lib/serverlessLogs.js +4 -6
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/boxen.d.ts +5 -0
- package/lib/ui/boxen.js +30 -0
- package/lib/ui/git.js +8 -9
- package/lib/ui/index.d.ts +3 -2
- package/lib/ui/index.js +15 -17
- package/lib/ui/logger.d.ts +10 -0
- package/lib/ui/logger.js +15 -0
- package/lib/ui/serverlessFunctionLogs.js +2 -3
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +5 -1
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/server.d.ts +1 -0
- package/mcp-server/server.js +18 -0
- package/mcp-server/tools/index.d.ts +2 -0
- package/mcp-server/tools/index.js +19 -0
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
- package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
- package/mcp-server/tools/project/CreateProjectTool.js +104 -0
- package/mcp-server/tools/project/DeployProject.d.ts +20 -0
- package/mcp-server/tools/project/DeployProject.js +50 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
- package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
- package/mcp-server/tools/project/UploadProjectTools.js +35 -0
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
- package/mcp-server/tools/project/constants.d.ts +3 -0
- package/mcp-server/tools/project/constants.js +13 -0
- package/mcp-server/types.d.ts +14 -0
- package/mcp-server/types.js +17 -0
- package/mcp-server/utils/command.d.ts +3 -0
- package/mcp-server/utils/command.js +16 -0
- package/mcp-server/utils/content.d.ts +3 -0
- package/mcp-server/utils/content.js +21 -0
- package/mcp-server/utils/project.d.ts +5 -0
- package/mcp-server/utils/project.js +17 -0
- package/package.json +25 -17
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +35 -0
- package/types/LocalDev.js +2 -0
- package/types/Projects.d.ts +19 -2
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +14 -11
- package/lib/DevServerManagerV2.d.ts +0 -33
- package/lib/LocalDevManagerV2.d.ts +0 -64
- package/lib/LocalDevManagerV2.js +0 -377
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/index.d.ts +0 -20
- package/lib/projects/index.js +0 -194
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -40
|
@@ -1,89 +1,96 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
logger.error(i18n(`${i18nKey}.error.failedToFetchProjectList`));
|
|
37
|
-
process.exit(EXIT_CODES.ERROR);
|
|
38
|
-
}
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
9
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
10
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
|
+
const config_1 = require("../../lib/projects/config");
|
|
12
|
+
const legacy_1 = require("../../lib/projects/create/legacy");
|
|
13
|
+
const v3_1 = require("../../lib/projects/create/v3");
|
|
14
|
+
const ui_1 = require("../../lib/ui");
|
|
15
|
+
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
16
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
17
|
+
const constants_1 = require("../../lib/constants");
|
|
18
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
19
|
+
const projects_1 = require("@hubspot/local-dev-lib/constants/projects");
|
|
20
|
+
const en_1 = require("../../lang/en");
|
|
21
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
22
|
+
const v3_2 = require("../../lib/projects/create/v3");
|
|
23
|
+
const create_1 = require("../../lib/projects/create");
|
|
24
|
+
const command = ['create', 'init'];
|
|
25
|
+
const describe = (0, ui_1.uiBetaTag)(en_1.commands.project.create.describe, false);
|
|
26
|
+
const { v2023_2, v2025_1, v2025_2 } = projects_1.PLATFORM_VERSIONS;
|
|
27
|
+
async function handler(args) {
|
|
28
|
+
const { derivedAccountId, platformVersion, templateSource } = args;
|
|
29
|
+
if (templateSource && !templateSource.includes('/')) {
|
|
30
|
+
logger_1.uiLogger.error(en_1.commands.project.create.errors.invalidTemplateSource);
|
|
31
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
32
|
+
}
|
|
33
|
+
const repo = templateSource || constants_1.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH;
|
|
34
|
+
let handleResult;
|
|
35
|
+
try {
|
|
36
|
+
handleResult = await (0, create_1.handleProjectCreationFlow)(args);
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
process.exit(EXIT_CODES.ERROR);
|
|
38
|
+
catch (error) {
|
|
39
|
+
(0, errorHandlers_1.logError)(error);
|
|
40
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
44
41
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const { authType, distribution, repoConfig, projectContents, createProjectPromptResponse, } = handleResult;
|
|
43
|
+
(0, usageTracking_1.trackCommandUsage)('project-create', {
|
|
44
|
+
type: createProjectPromptResponse.projectTemplate?.name ||
|
|
45
|
+
(createProjectPromptResponse.componentTemplates || [])
|
|
46
|
+
// @ts-expect-error
|
|
47
|
+
.map((item) => item.label)
|
|
48
|
+
.join(','),
|
|
49
|
+
}, derivedAccountId);
|
|
50
|
+
const projectDest = path_1.default.resolve((0, path_2.getCwd)(), createProjectPromptResponse.dest);
|
|
51
|
+
const { projectConfig: existingProjectConfig, projectDir: existingProjectDir, } = await (0, config_1.getProjectConfig)(projectDest);
|
|
49
52
|
// Exit if the target destination is within an existing project
|
|
50
|
-
if (existingProjectConfig &&
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
process.exit(EXIT_CODES.ERROR);
|
|
53
|
+
if (existingProjectConfig &&
|
|
54
|
+
existingProjectDir &&
|
|
55
|
+
projectDest.startsWith(existingProjectDir)) {
|
|
56
|
+
logger_1.uiLogger.error(en_1.commands.project.create.errors.cannotNestProjects(existingProjectDir));
|
|
57
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
55
58
|
}
|
|
59
|
+
const components = (0, v3_2.generateComponentPaths)({
|
|
60
|
+
createProjectPromptResponse,
|
|
61
|
+
platformVersion,
|
|
62
|
+
repoConfig,
|
|
63
|
+
projectContents,
|
|
64
|
+
authType,
|
|
65
|
+
distribution,
|
|
66
|
+
});
|
|
56
67
|
try {
|
|
57
|
-
await cloneGithubRepo(
|
|
58
|
-
sourceDir: createProjectPromptResponse.projectTemplate
|
|
59
|
-
tag: latestRepoReleaseTag,
|
|
68
|
+
await (0, github_1.cloneGithubRepo)(repo, projectDest, {
|
|
69
|
+
sourceDir: createProjectPromptResponse.projectTemplate?.path || components,
|
|
60
70
|
hideLogs: true,
|
|
71
|
+
branch: 'main',
|
|
61
72
|
});
|
|
62
73
|
}
|
|
63
74
|
catch (err) {
|
|
64
|
-
debugError(err);
|
|
65
|
-
|
|
66
|
-
process.exit(EXIT_CODES.ERROR);
|
|
75
|
+
(0, errorHandlers_1.debugError)(err);
|
|
76
|
+
logger_1.uiLogger.error(en_1.commands.project.create.errors.failedToDownloadProject);
|
|
77
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
67
78
|
}
|
|
68
|
-
const projectConfigPath =
|
|
69
|
-
const parsedConfigFile = JSON.parse(
|
|
70
|
-
writeProjectConfig(projectConfigPath, {
|
|
79
|
+
const projectConfigPath = path_1.default.join(projectDest, constants_1.PROJECT_CONFIG_FILE);
|
|
80
|
+
const parsedConfigFile = JSON.parse(fs_extra_1.default.readFileSync(projectConfigPath).toString());
|
|
81
|
+
(0, config_1.writeProjectConfig)(projectConfigPath, {
|
|
71
82
|
...parsedConfigFile,
|
|
72
83
|
name: createProjectPromptResponse.name,
|
|
73
84
|
});
|
|
74
85
|
// If the template is 'no-template', we need to manually create a src directory
|
|
75
|
-
if (createProjectPromptResponse.projectTemplate
|
|
76
|
-
EMPTY_PROJECT_TEMPLATE_NAME
|
|
77
|
-
|
|
86
|
+
if (createProjectPromptResponse.projectTemplate?.name ===
|
|
87
|
+
legacy_1.EMPTY_PROJECT_TEMPLATE_NAME ||
|
|
88
|
+
projectContents === v3_1.EMPTY_PROJECT) {
|
|
89
|
+
fs_extra_1.default.ensureDirSync(path_1.default.join(projectDest, 'src'));
|
|
78
90
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
projectDest,
|
|
83
|
-
}));
|
|
84
|
-
logger.log('');
|
|
85
|
-
logger.log(chalk.bold(i18n(`${i18nKey}.logs.welcomeMessage`)));
|
|
86
|
-
uiFeatureHighlight([
|
|
91
|
+
logger_1.uiLogger.success(en_1.commands.project.create.logs.success(createProjectPromptResponse.name, projectDest));
|
|
92
|
+
logger_1.uiLogger.log(en_1.commands.project.create.logs.welcomeMessage);
|
|
93
|
+
(0, ui_1.uiFeatureHighlight)([
|
|
87
94
|
'projectCommandTip',
|
|
88
95
|
'projectUploadCommand',
|
|
89
96
|
'projectDevCommand',
|
|
@@ -92,36 +99,80 @@ exports.handler = async (options) => {
|
|
|
92
99
|
'feedbackCommand',
|
|
93
100
|
'sampleProjects',
|
|
94
101
|
]);
|
|
95
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
96
|
-
}
|
|
97
|
-
|
|
102
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
103
|
+
}
|
|
104
|
+
function projectCreateBuilder(yargs) {
|
|
98
105
|
yargs.options({
|
|
99
106
|
name: {
|
|
100
|
-
describe:
|
|
107
|
+
describe: en_1.commands.project.create.options.name.describe,
|
|
101
108
|
type: 'string',
|
|
102
109
|
},
|
|
103
110
|
dest: {
|
|
104
|
-
describe:
|
|
111
|
+
describe: en_1.commands.project.create.options.dest.describe,
|
|
105
112
|
type: 'string',
|
|
106
113
|
},
|
|
107
114
|
template: {
|
|
108
|
-
|
|
115
|
+
// TODO: When we release 2025.2 scaffolding, we need to point out this is only valid for 2025.1 prior
|
|
116
|
+
describe: en_1.commands.project.create.options.template.describe,
|
|
109
117
|
type: 'string',
|
|
110
118
|
},
|
|
111
119
|
'template-source': {
|
|
112
|
-
describe:
|
|
120
|
+
describe: en_1.commands.project.create.options.templateSource.describe,
|
|
121
|
+
type: 'string',
|
|
122
|
+
},
|
|
123
|
+
'platform-version': {
|
|
124
|
+
describe: en_1.commands.project.create.options.platformVersion.describe,
|
|
125
|
+
hidden: true,
|
|
126
|
+
type: 'string',
|
|
127
|
+
choices: [v2023_2, v2025_1, v2025_2],
|
|
128
|
+
default: v2023_2,
|
|
129
|
+
},
|
|
130
|
+
'project-base': {
|
|
131
|
+
describe: en_1.commands.project.create.options.projectBase.describe,
|
|
132
|
+
hidden: true,
|
|
133
|
+
type: 'string',
|
|
134
|
+
choices: [v3_1.EMPTY_PROJECT, v3_1.PROJECT_WITH_APP],
|
|
135
|
+
},
|
|
136
|
+
distribution: {
|
|
137
|
+
describe: en_1.commands.project.create.options.distribution.describe,
|
|
138
|
+
hidden: true,
|
|
139
|
+
type: 'string',
|
|
140
|
+
choices: [constants_1.privateDistribution, constants_1.marketplaceDistribution],
|
|
141
|
+
},
|
|
142
|
+
auth: {
|
|
143
|
+
describe: en_1.commands.project.create.options.auth.describe,
|
|
144
|
+
hidden: true,
|
|
113
145
|
type: 'string',
|
|
146
|
+
choices: [constants_1.oAuth, constants_1.staticAuth],
|
|
147
|
+
},
|
|
148
|
+
features: {
|
|
149
|
+
describe: en_1.commands.project.create.options.features.describe,
|
|
150
|
+
hidden: true,
|
|
151
|
+
type: 'array',
|
|
114
152
|
},
|
|
115
153
|
});
|
|
116
|
-
yargs.
|
|
154
|
+
yargs.conflicts('template', 'features');
|
|
155
|
+
yargs.example([
|
|
156
|
+
['$0 project create', en_1.commands.project.create.examples.default],
|
|
157
|
+
]);
|
|
117
158
|
yargs.example([
|
|
118
159
|
[
|
|
119
160
|
'$0 project create --template-source HubSpot/ui-extensions-examples',
|
|
120
|
-
|
|
161
|
+
en_1.commands.project.create.examples.templateSource,
|
|
121
162
|
],
|
|
122
163
|
]);
|
|
123
|
-
addConfigOptions(yargs);
|
|
124
|
-
addAccountOptions(yargs);
|
|
125
|
-
addUseEnvironmentOptions(yargs);
|
|
126
164
|
return yargs;
|
|
165
|
+
}
|
|
166
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(projectCreateBuilder, command, describe, {
|
|
167
|
+
useGlobalOptions: true,
|
|
168
|
+
useAccountOptions: true,
|
|
169
|
+
useConfigOptions: true,
|
|
170
|
+
useEnvironmentOptions: true,
|
|
171
|
+
});
|
|
172
|
+
const projectCreateCommand = {
|
|
173
|
+
command,
|
|
174
|
+
describe,
|
|
175
|
+
handler,
|
|
176
|
+
builder,
|
|
127
177
|
};
|
|
178
|
+
exports.default = projectCreateCommand;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "deploy";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
export type ProjectDeployArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
6
3
|
project?: string;
|
|
7
4
|
build?: number;
|
|
8
5
|
buildId?: number;
|
|
6
|
+
profile?: string;
|
|
7
|
+
force: boolean;
|
|
9
8
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
9
|
+
declare const projectDeployCommand: YargsCommandModule<unknown, ProjectDeployArgs>;
|
|
10
|
+
export default projectDeployCommand;
|
|
@@ -3,8 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.builder = exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
6
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
7
|
const projects_1 = require("@hubspot/local-dev-lib/api/projects");
|
|
10
8
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
@@ -13,7 +11,7 @@ const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
|
13
11
|
const buildAndDeploy_1 = require("../../lib/projects/buildAndDeploy");
|
|
14
12
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
15
13
|
const index_2 = require("../../lib/errorHandlers/index");
|
|
16
|
-
const
|
|
14
|
+
const config_2 = require("../../lib/projects/config");
|
|
17
15
|
const buildAndDeploy_2 = require("../../lib/projects/buildAndDeploy");
|
|
18
16
|
const urls_1 = require("../../lib/projects/urls");
|
|
19
17
|
const projectNamePrompt_1 = require("../../lib/prompts/projectNamePrompt");
|
|
@@ -23,49 +21,83 @@ const ui_1 = require("../../lib/ui");
|
|
|
23
21
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
24
22
|
const ui_2 = require("../../lib/ui");
|
|
25
23
|
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const projectProfiles_1 = require("../../lib/projectProfiles");
|
|
25
|
+
const constants_1 = require("../../lib/constants");
|
|
26
|
+
const command = 'deploy';
|
|
27
|
+
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.project.subcommands.deploy.describe`), false);
|
|
29
28
|
function validateBuildId(buildId, deployedBuildId, latestBuildId, projectName, accountId) {
|
|
30
29
|
if (Number(buildId) > latestBuildId) {
|
|
31
|
-
return (0, lang_1.i18n)(
|
|
30
|
+
return (0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.buildIdDoesNotExist`, {
|
|
32
31
|
buildId: buildId,
|
|
33
32
|
projectName: projectName,
|
|
34
|
-
linkToProject: (0, ui_1.uiLink)((0, lang_1.i18n)(
|
|
33
|
+
linkToProject: (0, ui_1.uiLink)((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.viewProjectsBuilds`), (0, urls_1.getProjectDetailUrl)(projectName, accountId)),
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
if (Number(buildId) === deployedBuildId) {
|
|
38
|
-
return (0, lang_1.i18n)(
|
|
37
|
+
return (0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.buildAlreadyDeployed`, {
|
|
39
38
|
buildId: buildId,
|
|
40
|
-
linkToProject: (0, ui_1.uiLink)((0, lang_1.i18n)(
|
|
39
|
+
linkToProject: (0, ui_1.uiLink)((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.viewProjectsBuilds`), (0, urls_1.getProjectDetailUrl)(projectName, accountId)),
|
|
41
40
|
});
|
|
42
41
|
}
|
|
43
42
|
return true;
|
|
44
43
|
}
|
|
44
|
+
function logDeployErrors(errorData) {
|
|
45
|
+
logger_1.logger.error(errorData.message);
|
|
46
|
+
errorData.errors.forEach(err => {
|
|
47
|
+
if (err.subCategory === constants_1.PROJECT_ERROR_TYPES.DEPLOY_CONTAINS_REMOVALS) {
|
|
48
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.deployContainsRemovals`, {
|
|
49
|
+
componentName: err.context.COMPONENT_NAME,
|
|
50
|
+
forceFlag: (0, ui_2.uiCommandReference)('--force'),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
logger_1.logger.log(err.message);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
45
58
|
async function handler(args) {
|
|
46
|
-
const { derivedAccountId } = args;
|
|
59
|
+
const { derivedAccountId, project: projectOption, buildId: buildIdOption, force: forceOption, } = args;
|
|
47
60
|
const accountConfig = (0, config_1.getAccountConfig)(derivedAccountId);
|
|
48
|
-
const { project: projectOption, buildId: buildIdOption } = args;
|
|
49
61
|
const accountType = accountConfig && accountConfig.accountType;
|
|
50
|
-
|
|
51
|
-
const { projectConfig } = await (0,
|
|
62
|
+
let targetAccountId;
|
|
63
|
+
const { projectConfig, projectDir } = await (0, config_2.getProjectConfig)();
|
|
64
|
+
if ((0, buildAndDeploy_1.useV3Api)(projectConfig?.platformVersion)) {
|
|
65
|
+
if (args.profile) {
|
|
66
|
+
(0, projectProfiles_1.logProfileHeader)(args.profile);
|
|
67
|
+
const profile = (0, projectProfiles_1.loadProfile)(projectConfig, projectDir, args.profile);
|
|
68
|
+
if (!profile) {
|
|
69
|
+
(0, ui_1.uiLine)();
|
|
70
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
71
|
+
}
|
|
72
|
+
targetAccountId = profile.accountId;
|
|
73
|
+
(0, projectProfiles_1.logProfileFooter)(profile);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// A profile must be specified if this project has profiles configured
|
|
77
|
+
await (0, projectProfiles_1.exitIfUsingProfiles)(projectConfig, projectDir);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!targetAccountId) {
|
|
81
|
+
targetAccountId = derivedAccountId;
|
|
82
|
+
}
|
|
83
|
+
(0, usageTracking_1.trackCommandUsage)('project-deploy', accountType ? { type: accountType } : undefined, targetAccountId);
|
|
52
84
|
let projectName = projectOption;
|
|
53
85
|
if (!projectOption && projectConfig) {
|
|
54
86
|
projectName = projectConfig.name;
|
|
55
87
|
}
|
|
56
|
-
const namePromptResponse = await (0, projectNamePrompt_1.projectNamePrompt)(
|
|
88
|
+
const namePromptResponse = await (0, projectNamePrompt_1.projectNamePrompt)(targetAccountId, {
|
|
57
89
|
project: projectName,
|
|
58
90
|
});
|
|
59
91
|
projectName = namePromptResponse.projectName;
|
|
60
92
|
let buildIdToDeploy = buildIdOption;
|
|
61
93
|
try {
|
|
62
|
-
const { data: { latestBuild, deployedBuildId }, } = await (0, projects_1.fetchProject)(
|
|
94
|
+
const { data: { latestBuild, deployedBuildId }, } = await (0, projects_1.fetchProject)(targetAccountId, projectName);
|
|
63
95
|
if (!latestBuild || !latestBuild.buildId) {
|
|
64
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
96
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.noBuilds`));
|
|
65
97
|
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
66
98
|
}
|
|
67
99
|
if (buildIdToDeploy) {
|
|
68
|
-
const validationResult = validateBuildId(buildIdToDeploy, deployedBuildId, latestBuild.buildId, projectName,
|
|
100
|
+
const validationResult = validateBuildId(buildIdToDeploy, deployedBuildId, latestBuild.buildId, projectName, targetAccountId);
|
|
69
101
|
if (validationResult !== true) {
|
|
70
102
|
logger_1.logger.error(validationResult);
|
|
71
103
|
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
@@ -74,39 +106,44 @@ async function handler(args) {
|
|
|
74
106
|
else {
|
|
75
107
|
const deployBuildIdPromptResponse = await (0, promptUtils_1.promptUser)({
|
|
76
108
|
name: 'buildId',
|
|
77
|
-
message: (0, lang_1.i18n)(
|
|
109
|
+
message: (0, lang_1.i18n)(`commands.project.subcommands.deploy.deployBuildIdPrompt`),
|
|
78
110
|
default: latestBuild.buildId === deployedBuildId
|
|
79
111
|
? undefined
|
|
80
112
|
: latestBuild.buildId,
|
|
81
|
-
validate: buildId => validateBuildId(buildId, deployedBuildId, latestBuild.buildId, projectName,
|
|
113
|
+
validate: buildId => validateBuildId(buildId, deployedBuildId, latestBuild.buildId, projectName, targetAccountId),
|
|
82
114
|
});
|
|
83
115
|
buildIdToDeploy = deployBuildIdPromptResponse.buildId;
|
|
84
116
|
}
|
|
85
117
|
if (!buildIdToDeploy) {
|
|
86
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
118
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.noBuildId`));
|
|
87
119
|
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
88
120
|
}
|
|
89
|
-
const { data: deployResp } = await (0, projects_1.deployProject)(
|
|
121
|
+
const { data: deployResp } = await (0, projects_1.deployProject)(targetAccountId, projectName, buildIdToDeploy, (0, buildAndDeploy_1.useV3Api)(projectConfig?.platformVersion), forceOption);
|
|
90
122
|
if (!deployResp) {
|
|
91
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
123
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.deploy`));
|
|
92
124
|
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
93
125
|
}
|
|
94
|
-
await (0, buildAndDeploy_2.pollDeployStatus)(
|
|
126
|
+
await (0, buildAndDeploy_2.pollDeployStatus)(targetAccountId, projectName, Number(deployResp.id), buildIdToDeploy);
|
|
95
127
|
}
|
|
96
128
|
catch (e) {
|
|
97
129
|
if ((0, index_1.isHubSpotHttpError)(e) && e.status === 404) {
|
|
98
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
130
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.deploy.errors.projectNotFound`, {
|
|
99
131
|
projectName: chalk_1.default.bold(projectName),
|
|
100
|
-
accountIdentifier: (0, ui_2.uiAccountDescription)(
|
|
132
|
+
accountIdentifier: (0, ui_2.uiAccountDescription)(targetAccountId),
|
|
101
133
|
command: (0, ui_2.uiCommandReference)('hs project upload'),
|
|
102
134
|
}));
|
|
103
135
|
}
|
|
104
136
|
else if ((0, index_1.isHubSpotHttpError)(e) && e.status === 400) {
|
|
105
|
-
|
|
137
|
+
if (e.data?.message && e.data?.errors) {
|
|
138
|
+
logDeployErrors(e.data);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
logger_1.logger.error(e.message);
|
|
142
|
+
}
|
|
106
143
|
}
|
|
107
144
|
else {
|
|
108
145
|
(0, index_2.logError)(e, new index_2.ApiErrorContext({
|
|
109
|
-
accountId:
|
|
146
|
+
accountId: targetAccountId,
|
|
110
147
|
request: 'project deploy',
|
|
111
148
|
}));
|
|
112
149
|
}
|
|
@@ -116,32 +153,51 @@ async function handler(args) {
|
|
|
116
153
|
function projectDeployBuilder(yargs) {
|
|
117
154
|
yargs.options({
|
|
118
155
|
project: {
|
|
119
|
-
describe: (0, lang_1.i18n)(
|
|
156
|
+
describe: (0, lang_1.i18n)(`commands.project.subcommands.deploy.options.project.describe`),
|
|
120
157
|
type: 'string',
|
|
121
158
|
},
|
|
122
159
|
build: {
|
|
123
160
|
alias: ['build-id'],
|
|
124
|
-
describe: (0, lang_1.i18n)(
|
|
161
|
+
describe: (0, lang_1.i18n)(`commands.project.subcommands.deploy.options.build.describe`),
|
|
125
162
|
type: 'number',
|
|
126
163
|
},
|
|
164
|
+
profile: {
|
|
165
|
+
alias: ['p'],
|
|
166
|
+
describe: (0, lang_1.i18n)(`commands.project.subcommands.deploy.options.profile.describe`),
|
|
167
|
+
type: 'string',
|
|
168
|
+
hidden: true,
|
|
169
|
+
},
|
|
170
|
+
force: {
|
|
171
|
+
alias: ['f'],
|
|
172
|
+
describe: (0, lang_1.i18n)(`commands.project.subcommands.deploy.options.force.describe`),
|
|
173
|
+
default: false,
|
|
174
|
+
type: 'boolean',
|
|
175
|
+
},
|
|
127
176
|
});
|
|
177
|
+
yargs.conflicts('profile', 'project');
|
|
178
|
+
yargs.conflicts('profile', 'account');
|
|
128
179
|
yargs.example([
|
|
129
|
-
[
|
|
180
|
+
[
|
|
181
|
+
'$0 project deploy',
|
|
182
|
+
(0, lang_1.i18n)(`commands.project.subcommands.deploy.examples.default`),
|
|
183
|
+
],
|
|
130
184
|
[
|
|
131
185
|
'$0 project deploy --project="my-project" --build=5',
|
|
132
|
-
(0, lang_1.i18n)(
|
|
186
|
+
(0, lang_1.i18n)(`commands.project.subcommands.deploy.examples.withOptions`),
|
|
133
187
|
],
|
|
134
188
|
]);
|
|
135
189
|
return yargs;
|
|
136
190
|
}
|
|
137
|
-
|
|
191
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(projectDeployBuilder, command, describe, {
|
|
192
|
+
useGlobalOptions: true,
|
|
138
193
|
useConfigOptions: true,
|
|
139
194
|
useAccountOptions: true,
|
|
140
195
|
useEnvironmentOptions: true,
|
|
141
196
|
});
|
|
142
|
-
|
|
143
|
-
command
|
|
144
|
-
describe
|
|
145
|
-
builder
|
|
197
|
+
const projectDeployCommand = {
|
|
198
|
+
command,
|
|
199
|
+
describe,
|
|
200
|
+
builder,
|
|
146
201
|
handler,
|
|
147
202
|
};
|
|
203
|
+
exports.default = projectDeployCommand;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { ArgumentsCamelCase } from 'yargs';
|
|
2
|
-
import { CLIAccount } from '@hubspot/local-dev-lib/types/Accounts';
|
|
3
2
|
import { ProjectConfig } from '../../../types/Projects';
|
|
4
3
|
import { ProjectDevArgs } from '../../../types/Yargs';
|
|
5
|
-
|
|
4
|
+
type DeprecatedProjectDevFlowArgs = {
|
|
5
|
+
args: ArgumentsCamelCase<ProjectDevArgs>;
|
|
6
|
+
accountId: number;
|
|
7
|
+
projectConfig: ProjectConfig;
|
|
8
|
+
projectDir: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function deprecatedProjectDevFlow({ args, accountId, projectConfig, projectDir, }: DeprecatedProjectDevFlowArgs): Promise<void>;
|
|
11
|
+
export {};
|