@hubspot/cli 7.5.11-experimental.0 → 7.6.0-beta.1
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 +102 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +74 -87
- 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 +1 -2
- package/commands/app/migrate.js +7 -8
- 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 -8
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +29 -28
- 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 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -12
- 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 -74
- 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 +18 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- 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 -41
- 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 -10
- 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 +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- 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 +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +17 -8
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +17 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +52 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +77 -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 -29
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +17 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +17 -11
- package/commands/project/add.d.ts +5 -2
- package/commands/project/add.js +43 -80
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.d.ts +2 -8
- package/commands/project/create.js +84 -55
- package/commands/project/deploy.d.ts +2 -0
- package/commands/project/deploy.js +67 -13
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +88 -31
- package/commands/project/dev/unifiedFlow.d.ts +11 -2
- package/commands/project/dev/unifiedFlow.js +81 -41
- package/commands/project/listBuilds.js +2 -5
- package/commands/project/migrate.d.ts +1 -0
- 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 +1 -0
- package/commands/project/upload.js +22 -8
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project.js +4 -2
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -22
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -48
- package/commands/testAccount/create.d.ts +6 -0
- package/commands/testAccount/create.js +100 -0
- package/commands/testAccount/createConfig.d.ts +10 -0
- package/commands/testAccount/createConfig.js +98 -0
- package/commands/testAccount/delete.d.ts +6 -0
- package/commands/testAccount/delete.js +48 -0
- package/commands/testAccount.d.ts +3 -0
- package/commands/testAccount.js +28 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -15
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -17
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +32 -26
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -47
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -134
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -75
- package/lang/en.d.ts +1135 -660
- package/lang/en.js +935 -471
- package/lang/en.lyaml +30 -213
- package/lib/accountTypes.js +1 -2
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +29 -6
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +34 -55
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +29 -0
- package/lib/constants.js +30 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +3 -2
- package/lib/errorHandlers/index.js +7 -0
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -5
- 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/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +23 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +5 -3
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- 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 +18 -3
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -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} +20 -11
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +159 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- 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/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +5 -1
- package/lib/projects/upload.js +60 -20
- package/lib/projects/urls.d.ts +3 -0
- package/lib/projects/urls.js +17 -1
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
- package/lib/prompts/createProjectPrompt.d.ts +14 -5
- package/lib/prompts/createProjectPrompt.js +38 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -24
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -7
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +4 -1
- package/lib/prompts/promptUtils.js +5 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- 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 +24 -16
- 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 +10 -1
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -41
package/commands/upload.js
CHANGED
|
@@ -1,235 +1,217 @@
|
|
|
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
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const previewUrl = getThemePreviewUrl(filePath, accountId);
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const uploadFolder_1 = require("@hubspot/local-dev-lib/cms/uploadFolder");
|
|
9
|
+
const fileMapper_1 = require("@hubspot/local-dev-lib/fileMapper");
|
|
10
|
+
const fileMapper_2 = require("@hubspot/local-dev-lib/api/fileMapper");
|
|
11
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
12
|
+
const modules_1 = require("@hubspot/local-dev-lib/cms/modules");
|
|
13
|
+
const ignoreRules_1 = require("@hubspot/local-dev-lib/ignoreRules");
|
|
14
|
+
const themes_1 = require("@hubspot/local-dev-lib/cms/themes");
|
|
15
|
+
const handleFieldsJS_1 = require("@hubspot/local-dev-lib/cms/handleFieldsJS");
|
|
16
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
17
|
+
const commonOpts_1 = require("../lib/commonOpts");
|
|
18
|
+
const uploadPrompt_1 = require("../lib/prompts/uploadPrompt");
|
|
19
|
+
const promptUtils_1 = require("../lib/prompts/promptUtils");
|
|
20
|
+
const validation_1 = require("../lib/validation");
|
|
21
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
22
|
+
const upload_1 = require("../lib/upload");
|
|
23
|
+
const en_1 = require("../lang/en");
|
|
24
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
25
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
26
|
+
const logger_1 = require("../lib/ui/logger");
|
|
27
|
+
const command = 'upload [src] [dest]';
|
|
28
|
+
const describe = en_1.commands.upload.describe;
|
|
29
|
+
function logThemePreview(filePath, accountId) {
|
|
30
|
+
const previewUrl = (0, themes_1.getThemePreviewUrl)(filePath, accountId);
|
|
28
31
|
// Only log if we are actually in a theme
|
|
29
32
|
if (previewUrl) {
|
|
30
|
-
|
|
31
|
-
previewUrl,
|
|
32
|
-
}));
|
|
33
|
+
logger_1.uiLogger.log(en_1.commands.upload.previewUrl(previewUrl));
|
|
33
34
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!validateCmsPublishMode(
|
|
37
|
-
process.exit(EXIT_CODES.WARNING);
|
|
35
|
+
}
|
|
36
|
+
async function handler(args) {
|
|
37
|
+
if (!(0, validation_1.validateCmsPublishMode)(args)) {
|
|
38
|
+
process.exit(exitCodes_1.EXIT_CODES.WARNING);
|
|
38
39
|
}
|
|
39
|
-
const { derivedAccountId } =
|
|
40
|
-
const cmsPublishMode = getCmsPublishMode(
|
|
41
|
-
const uploadPromptAnswers = await uploadPrompt(
|
|
42
|
-
const src =
|
|
43
|
-
const saveOutput =
|
|
44
|
-
let dest =
|
|
45
|
-
let absoluteSrcPath =
|
|
40
|
+
const { derivedAccountId } = args;
|
|
41
|
+
const cmsPublishMode = (0, commonOpts_1.getCmsPublishMode)(args);
|
|
42
|
+
const uploadPromptAnswers = await (0, uploadPrompt_1.uploadPrompt)(args);
|
|
43
|
+
const src = args.src || uploadPromptAnswers.src;
|
|
44
|
+
const saveOutput = args.saveOutput;
|
|
45
|
+
let dest = args.dest || uploadPromptAnswers.dest;
|
|
46
|
+
let absoluteSrcPath = path_1.default.resolve((0, path_2.getCwd)(), src);
|
|
46
47
|
if (!dest) {
|
|
47
|
-
|
|
48
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.destinationRequired);
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
// Check for theme.json file and determine the root path for the project based on it if it exists
|
|
51
|
-
const themeJsonPath = getThemeJSONPath(absoluteSrcPath);
|
|
52
|
+
const themeJsonPath = (0, themes_1.getThemeJSONPath)(absoluteSrcPath);
|
|
52
53
|
const projectRoot = themeJsonPath
|
|
53
|
-
?
|
|
54
|
-
:
|
|
54
|
+
? path_1.default.dirname(themeJsonPath)
|
|
55
|
+
: path_1.default.dirname((0, path_2.getCwd)());
|
|
55
56
|
const convertFields = projectRoot &&
|
|
56
|
-
isConvertableFieldJs(projectRoot, absoluteSrcPath,
|
|
57
|
+
(0, handleFieldsJS_1.isConvertableFieldJs)(projectRoot, absoluteSrcPath, args.convertFields);
|
|
57
58
|
let fieldsJs;
|
|
58
59
|
if (convertFields) {
|
|
59
|
-
fieldsJs = await new FieldsJs(projectRoot, absoluteSrcPath, undefined,
|
|
60
|
+
fieldsJs = await new handleFieldsJS_1.FieldsJs(projectRoot, absoluteSrcPath, undefined, args.fieldOptions).init();
|
|
60
61
|
if (fieldsJs.rejected)
|
|
61
62
|
return;
|
|
62
63
|
// Ensures that the dest path is a .json. The user might pass '.js' accidentally - this ensures it just works.
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
if (fieldsJs.outputPath) {
|
|
65
|
+
absoluteSrcPath = fieldsJs.outputPath;
|
|
66
|
+
}
|
|
67
|
+
dest = path_1.default.join(path_1.default.dirname(dest), 'fields.json');
|
|
65
68
|
}
|
|
66
69
|
let stats;
|
|
67
70
|
try {
|
|
68
|
-
stats =
|
|
71
|
+
stats = fs_1.default.statSync(absoluteSrcPath);
|
|
69
72
|
if (!stats.isFile() && !stats.isDirectory()) {
|
|
70
|
-
|
|
71
|
-
path: src,
|
|
72
|
-
}));
|
|
73
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.invalidPath(src));
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
catch (e) {
|
|
77
|
-
|
|
78
|
-
path: src,
|
|
79
|
-
}));
|
|
78
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.invalidPath(src));
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
|
-
const normalizedDest = convertToUnixPath(dest);
|
|
83
|
-
trackCommandUsage('upload', { mode: cmsPublishMode, type: stats.isFile() ? 'file' : 'folder' }, derivedAccountId);
|
|
84
|
-
const srcDestIssues = await validateSrcAndDestPaths({ isLocal: true, path: src }, { isHubSpot: true, path: dest });
|
|
81
|
+
const normalizedDest = (0, path_2.convertToUnixPath)(dest);
|
|
82
|
+
(0, usageTracking_1.trackCommandUsage)('upload', { mode: cmsPublishMode, type: stats.isFile() ? 'file' : 'folder' }, derivedAccountId);
|
|
83
|
+
const srcDestIssues = await (0, modules_1.validateSrcAndDestPaths)({ isLocal: true, path: src }, { isHubSpot: true, path: dest });
|
|
85
84
|
if (srcDestIssues.length) {
|
|
86
|
-
srcDestIssues.forEach(({ message }) =>
|
|
87
|
-
process.exit(EXIT_CODES.WARNING);
|
|
85
|
+
srcDestIssues.forEach(({ message }) => logger_1.uiLogger.error(message));
|
|
86
|
+
process.exit(exitCodes_1.EXIT_CODES.WARNING);
|
|
88
87
|
}
|
|
89
88
|
if (stats.isFile()) {
|
|
90
|
-
if (!isAllowedExtension(src) && !convertFields) {
|
|
91
|
-
|
|
92
|
-
path: src,
|
|
93
|
-
}));
|
|
89
|
+
if (!(0, path_2.isAllowedExtension)(src) && !convertFields) {
|
|
90
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.invalidPath(src));
|
|
94
91
|
return;
|
|
95
92
|
}
|
|
96
|
-
if (shouldIgnoreFile(absoluteSrcPath)) {
|
|
97
|
-
|
|
98
|
-
path: src,
|
|
99
|
-
}));
|
|
93
|
+
if ((0, ignoreRules_1.shouldIgnoreFile)(absoluteSrcPath)) {
|
|
94
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.fileIgnored(src));
|
|
100
95
|
return;
|
|
101
96
|
}
|
|
102
|
-
upload(derivedAccountId, absoluteSrcPath, normalizedDest,
|
|
97
|
+
(0, fileMapper_2.upload)(derivedAccountId, absoluteSrcPath, normalizedDest, (0, fileMapper_1.getFileMapperQueryValues)(cmsPublishMode))
|
|
103
98
|
.then(() => {
|
|
104
|
-
|
|
105
|
-
accountId: derivedAccountId,
|
|
106
|
-
dest: normalizedDest,
|
|
107
|
-
src,
|
|
108
|
-
}));
|
|
99
|
+
logger_1.uiLogger.success(en_1.commands.upload.success.fileUploaded(src, normalizedDest, derivedAccountId));
|
|
109
100
|
logThemePreview(src, derivedAccountId);
|
|
110
101
|
})
|
|
111
102
|
.catch(error => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
src,
|
|
115
|
-
}));
|
|
116
|
-
logError(error, new ApiErrorContext({
|
|
103
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.uploadFailed(src, normalizedDest));
|
|
104
|
+
(0, index_1.logError)(error, new index_1.ApiErrorContext({
|
|
117
105
|
accountId: derivedAccountId,
|
|
118
106
|
request: normalizedDest,
|
|
119
107
|
payload: src,
|
|
120
108
|
}));
|
|
121
|
-
process.exit(EXIT_CODES.WARNING);
|
|
109
|
+
process.exit(exitCodes_1.EXIT_CODES.WARNING);
|
|
122
110
|
})
|
|
123
111
|
.finally(() => {
|
|
124
112
|
if (!convertFields)
|
|
125
113
|
return;
|
|
126
|
-
if (saveOutput) {
|
|
114
|
+
if (saveOutput && fieldsJs) {
|
|
127
115
|
fieldsJs.saveOutput();
|
|
128
116
|
}
|
|
129
|
-
|
|
117
|
+
if (fieldsJs) {
|
|
118
|
+
(0, handleFieldsJS_1.cleanupTmpDirSync)(fieldsJs.rootWriteDir);
|
|
119
|
+
}
|
|
130
120
|
});
|
|
131
121
|
}
|
|
132
122
|
else {
|
|
133
|
-
|
|
134
|
-
accountId: derivedAccountId,
|
|
135
|
-
dest,
|
|
136
|
-
src,
|
|
137
|
-
}));
|
|
123
|
+
logger_1.uiLogger.log(en_1.commands.upload.uploading(src, dest, derivedAccountId));
|
|
138
124
|
// Generate the first-pass file list in here, and pass to uploadFolder.
|
|
139
|
-
const filePaths = await getUploadableFileList(absoluteSrcPath,
|
|
140
|
-
if (
|
|
125
|
+
const filePaths = await (0, upload_1.getUploadableFileList)(absoluteSrcPath, args.convertFields ?? false);
|
|
126
|
+
if (args.clean) {
|
|
141
127
|
// If clean is true, will first delete the dest folder and then upload src. Cleans up files that only exist on HS.
|
|
142
|
-
let cleanUpload =
|
|
143
|
-
if (!
|
|
144
|
-
cleanUpload = await confirmPrompt(
|
|
145
|
-
accountId: derivedAccountId,
|
|
146
|
-
path: dest,
|
|
147
|
-
}), { defaultAnswer: false });
|
|
128
|
+
let cleanUpload = args.force;
|
|
129
|
+
if (!args.force) {
|
|
130
|
+
cleanUpload = await (0, promptUtils_1.confirmPrompt)(en_1.commands.upload.confirmCleanUpload(dest, derivedAccountId), { defaultAnswer: false });
|
|
148
131
|
}
|
|
149
132
|
if (cleanUpload) {
|
|
150
133
|
try {
|
|
151
|
-
await deleteFile(derivedAccountId, dest);
|
|
152
|
-
|
|
153
|
-
accountId: derivedAccountId,
|
|
154
|
-
filePath: dest,
|
|
155
|
-
}));
|
|
134
|
+
await (0, fileMapper_2.deleteFile)(derivedAccountId, dest);
|
|
135
|
+
logger_1.uiLogger.log(en_1.commands.upload.cleaning(dest, derivedAccountId));
|
|
156
136
|
}
|
|
157
137
|
catch (error) {
|
|
158
|
-
|
|
159
|
-
accountId: derivedAccountId,
|
|
160
|
-
path: dest,
|
|
161
|
-
}));
|
|
138
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.deleteFailed(dest, derivedAccountId));
|
|
162
139
|
}
|
|
163
140
|
}
|
|
164
141
|
}
|
|
165
|
-
uploadFolder(derivedAccountId, absoluteSrcPath, dest, {
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
(0, uploadFolder_1.uploadFolder)(derivedAccountId, absoluteSrcPath, dest, {}, {
|
|
143
|
+
convertFields: args.convertFields,
|
|
144
|
+
// @ts-expect-error - fieldOptions is a string or string[]
|
|
145
|
+
fieldOptions: args.fieldOptions ?? undefined,
|
|
146
|
+
saveOutput: args.saveOutput,
|
|
147
|
+
}, filePaths)
|
|
168
148
|
.then(results => {
|
|
169
|
-
if (!hasUploadErrors(results)) {
|
|
170
|
-
|
|
171
|
-
dest,
|
|
172
|
-
}));
|
|
149
|
+
if (!(0, uploadFolder_1.hasUploadErrors)(results)) {
|
|
150
|
+
logger_1.uiLogger.success(en_1.commands.upload.success.uploadComplete(dest));
|
|
173
151
|
logThemePreview(src, derivedAccountId);
|
|
174
152
|
}
|
|
175
153
|
else {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}));
|
|
179
|
-
process.exit(EXIT_CODES.WARNING);
|
|
154
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.someFilesFailed(dest));
|
|
155
|
+
process.exit(exitCodes_1.EXIT_CODES.WARNING);
|
|
180
156
|
}
|
|
181
157
|
})
|
|
182
158
|
.catch(error => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
src,
|
|
186
|
-
}));
|
|
187
|
-
logError(error, {
|
|
159
|
+
logger_1.uiLogger.error(en_1.commands.upload.errors.uploadFailed(src, dest));
|
|
160
|
+
(0, index_1.logError)(error, {
|
|
188
161
|
accountId: derivedAccountId,
|
|
189
162
|
});
|
|
190
|
-
process.exit(EXIT_CODES.WARNING);
|
|
163
|
+
process.exit(exitCodes_1.EXIT_CODES.WARNING);
|
|
191
164
|
});
|
|
192
165
|
}
|
|
193
|
-
}
|
|
194
|
-
|
|
166
|
+
}
|
|
167
|
+
function uploadBuilder(yargs) {
|
|
195
168
|
yargs.positional('src', {
|
|
196
|
-
describe:
|
|
169
|
+
describe: en_1.commands.upload.positionals.src,
|
|
197
170
|
type: 'string',
|
|
198
171
|
});
|
|
199
172
|
yargs.positional('dest', {
|
|
200
|
-
describe:
|
|
173
|
+
describe: en_1.commands.upload.positionals.dest,
|
|
201
174
|
type: 'string',
|
|
202
175
|
});
|
|
203
176
|
yargs.option('fieldOptions', {
|
|
204
|
-
describe:
|
|
177
|
+
describe: en_1.commands.upload.options.options,
|
|
205
178
|
type: 'array',
|
|
206
179
|
default: [''],
|
|
207
180
|
hidden: true,
|
|
208
181
|
});
|
|
209
182
|
yargs.option('saveOutput', {
|
|
210
|
-
describe:
|
|
183
|
+
describe: en_1.commands.upload.options.saveOutput,
|
|
211
184
|
type: 'boolean',
|
|
212
185
|
default: false,
|
|
213
186
|
});
|
|
214
187
|
yargs.option('convertFields', {
|
|
215
|
-
describe:
|
|
188
|
+
describe: en_1.commands.upload.options.convertFields,
|
|
216
189
|
type: 'boolean',
|
|
217
190
|
default: false,
|
|
218
191
|
});
|
|
219
192
|
yargs.option('clean', {
|
|
220
|
-
describe:
|
|
193
|
+
describe: en_1.commands.upload.options.clean,
|
|
221
194
|
type: 'boolean',
|
|
222
195
|
default: false,
|
|
223
196
|
});
|
|
224
197
|
yargs.option('force', {
|
|
225
|
-
describe:
|
|
198
|
+
describe: en_1.commands.upload.options.force,
|
|
226
199
|
type: 'boolean',
|
|
227
200
|
default: false,
|
|
228
201
|
});
|
|
229
|
-
addConfigOptions(yargs);
|
|
230
|
-
addAccountOptions(yargs);
|
|
231
|
-
addCmsPublishModeOptions(yargs, { write: true });
|
|
232
|
-
addUseEnvironmentOptions(yargs);
|
|
233
|
-
addGlobalOptions(yargs);
|
|
234
202
|
return yargs;
|
|
203
|
+
}
|
|
204
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(uploadBuilder, command, describe, {
|
|
205
|
+
useGlobalOptions: true,
|
|
206
|
+
useConfigOptions: true,
|
|
207
|
+
useAccountOptions: true,
|
|
208
|
+
useEnvironmentOptions: true,
|
|
209
|
+
useCmsPublishModeOptions: true,
|
|
210
|
+
});
|
|
211
|
+
const uploadCommand = {
|
|
212
|
+
command,
|
|
213
|
+
describe,
|
|
214
|
+
handler,
|
|
215
|
+
builder,
|
|
235
216
|
};
|
|
217
|
+
exports.default = uploadCommand;
|
package/commands/watch.d.ts
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { AccountArgs, CmsPublishModeArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
|
+
type WatchCommandArgs = ConfigArgs & AccountArgs & EnvironmentArgs & CommonArgs & CmsPublishModeArgs & {
|
|
3
|
+
src?: string;
|
|
4
|
+
dest?: string;
|
|
5
|
+
fieldOptions?: string[];
|
|
6
|
+
remove?: boolean;
|
|
7
|
+
initialUpload?: boolean;
|
|
8
|
+
disableInitial?: boolean;
|
|
9
|
+
notify?: string;
|
|
10
|
+
convertFields?: boolean;
|
|
11
|
+
saveOutput?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const watchCommand: YargsCommandModule<unknown, WatchCommandArgs>;
|
|
14
|
+
export default watchCommand;
|
package/commands/watch.js
CHANGED
|
@@ -1,145 +1,144 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const { remove, initialUpload, disableInitial, notify, derivedAccountId } =
|
|
21
|
-
if (!validateCmsPublishMode(
|
|
22
|
-
process.exit(EXIT_CODES.ERROR);
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const watch_1 = require("@hubspot/local-dev-lib/cms/watch");
|
|
9
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
10
|
+
const commonOpts_1 = require("../lib/commonOpts");
|
|
11
|
+
const uploadPrompt_1 = require("../lib/prompts/uploadPrompt");
|
|
12
|
+
const validation_1 = require("../lib/validation");
|
|
13
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
14
|
+
const en_1 = require("../lang/en");
|
|
15
|
+
const upload_1 = require("../lib/upload");
|
|
16
|
+
const errorHandlers_1 = require("../lib/errorHandlers");
|
|
17
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
18
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
19
|
+
const logger_1 = require("../lib/ui/logger");
|
|
20
|
+
const command = 'watch [src] [dest]';
|
|
21
|
+
const describe = en_1.commands.watch.describe;
|
|
22
|
+
const handler = async (args) => {
|
|
23
|
+
const { remove, initialUpload, disableInitial, notify, derivedAccountId } = args;
|
|
24
|
+
if (!(0, validation_1.validateCmsPublishMode)(args)) {
|
|
25
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
23
26
|
}
|
|
24
|
-
const cmsPublishMode = getCmsPublishMode(
|
|
25
|
-
const uploadPromptAnswers = await uploadPrompt(
|
|
26
|
-
const src =
|
|
27
|
-
const dest =
|
|
28
|
-
const absoluteSrcPath =
|
|
27
|
+
const cmsPublishMode = (0, commonOpts_1.getCmsPublishMode)(args);
|
|
28
|
+
const uploadPromptAnswers = await (0, uploadPrompt_1.uploadPrompt)(args);
|
|
29
|
+
const src = args.src || uploadPromptAnswers.src;
|
|
30
|
+
const dest = args.dest || uploadPromptAnswers.dest;
|
|
31
|
+
const absoluteSrcPath = path_1.default.resolve((0, path_2.getCwd)(), src);
|
|
29
32
|
try {
|
|
30
|
-
const stats =
|
|
33
|
+
const stats = fs_1.default.statSync(absoluteSrcPath);
|
|
31
34
|
if (!stats.isDirectory()) {
|
|
32
|
-
|
|
33
|
-
path: src,
|
|
34
|
-
}));
|
|
35
|
+
logger_1.uiLogger.log(en_1.commands.watch.errors.invalidPath(src));
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
catch (e) {
|
|
39
|
-
|
|
40
|
-
path: src,
|
|
41
|
-
}));
|
|
40
|
+
logger_1.uiLogger.log(en_1.commands.watch.errors.invalidPath(src));
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
43
|
if (!dest) {
|
|
45
|
-
|
|
44
|
+
logger_1.uiLogger.log(en_1.commands.watch.errors.destinationRequired);
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
47
|
let filesToUpload = [];
|
|
49
48
|
if (disableInitial) {
|
|
50
|
-
|
|
49
|
+
logger_1.uiLogger.info(en_1.commands.watch.warnings.disableInitial);
|
|
51
50
|
}
|
|
52
51
|
else if (!initialUpload) {
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
logger_1.uiLogger.info(en_1.commands.watch.warnings.notUploaded(src));
|
|
53
|
+
logger_1.uiLogger.info(en_1.commands.watch.warnings.initialUpload);
|
|
55
54
|
}
|
|
56
55
|
if (initialUpload) {
|
|
57
|
-
filesToUpload = await getUploadableFileList(absoluteSrcPath,
|
|
56
|
+
filesToUpload = await (0, upload_1.getUploadableFileList)(absoluteSrcPath, args.convertFields);
|
|
58
57
|
}
|
|
59
|
-
trackCommandUsage('watch', { mode: cmsPublishMode }, derivedAccountId);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
src,
|
|
64
|
-
dest,
|
|
65
|
-
accountId: derivedAccountId,
|
|
66
|
-
}));
|
|
67
|
-
logError(error, {
|
|
58
|
+
(0, usageTracking_1.trackCommandUsage)('watch', { mode: cmsPublishMode }, derivedAccountId);
|
|
59
|
+
const onUploadFolderError = (error) => {
|
|
60
|
+
logger_1.uiLogger.error(en_1.commands.watch.errors.folderFailed(src, dest, derivedAccountId));
|
|
61
|
+
(0, errorHandlers_1.logError)(error, {
|
|
68
62
|
accountId: derivedAccountId,
|
|
69
63
|
});
|
|
70
64
|
};
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
accountId: derivedAccountId,
|
|
77
|
-
}));
|
|
78
|
-
logError(error, new ApiErrorContext({
|
|
79
|
-
accountId: derivedAccountId,
|
|
80
|
-
request: dest,
|
|
65
|
+
const onUploadFileError = (file, destPath, accountId) => (error) => {
|
|
66
|
+
logger_1.uiLogger.error(en_1.commands.watch.errors.fileFailed(file, destPath, accountId));
|
|
67
|
+
(0, errorHandlers_1.logError)(error, new errorHandlers_1.ApiErrorContext({
|
|
68
|
+
accountId,
|
|
69
|
+
request: destPath,
|
|
81
70
|
payload: file,
|
|
82
71
|
}));
|
|
83
72
|
};
|
|
84
|
-
watch(derivedAccountId, absoluteSrcPath, dest, {
|
|
73
|
+
(0, watch_1.watch)(derivedAccountId, absoluteSrcPath, dest, {
|
|
85
74
|
cmsPublishMode,
|
|
86
75
|
remove,
|
|
87
|
-
disableInitial: initialUpload
|
|
76
|
+
disableInitial: !initialUpload,
|
|
88
77
|
notify,
|
|
89
|
-
commandOptions:
|
|
78
|
+
commandOptions: args,
|
|
90
79
|
filePaths: filesToUpload,
|
|
91
|
-
},
|
|
80
|
+
}, null, onUploadFolderError, undefined, onUploadFileError);
|
|
92
81
|
};
|
|
93
|
-
|
|
82
|
+
function watchBuilder(yargs) {
|
|
94
83
|
yargs.positional('src', {
|
|
95
|
-
describe:
|
|
84
|
+
describe: en_1.commands.watch.positionals.src,
|
|
96
85
|
type: 'string',
|
|
97
86
|
});
|
|
98
87
|
yargs.positional('dest', {
|
|
99
|
-
describe:
|
|
88
|
+
describe: en_1.commands.watch.positionals.dest,
|
|
100
89
|
type: 'string',
|
|
101
90
|
});
|
|
102
91
|
yargs.option('fieldOptions', {
|
|
103
|
-
describe:
|
|
92
|
+
describe: en_1.commands.watch.options.options,
|
|
104
93
|
type: 'array',
|
|
105
94
|
default: [''],
|
|
106
95
|
hidden: true,
|
|
107
96
|
});
|
|
108
97
|
yargs.option('remove', {
|
|
109
98
|
alias: 'r',
|
|
110
|
-
describe:
|
|
99
|
+
describe: en_1.commands.watch.options.remove,
|
|
111
100
|
type: 'boolean',
|
|
112
101
|
});
|
|
113
102
|
yargs.option('initial-upload', {
|
|
114
103
|
alias: 'i',
|
|
115
|
-
describe:
|
|
104
|
+
describe: en_1.commands.watch.options.initialUpload,
|
|
116
105
|
type: 'boolean',
|
|
117
106
|
});
|
|
118
107
|
yargs.option('disable-initial', {
|
|
119
|
-
describe:
|
|
108
|
+
describe: en_1.commands.watch.options.disableInitial,
|
|
120
109
|
type: 'boolean',
|
|
121
110
|
hidden: true,
|
|
122
111
|
});
|
|
123
112
|
yargs.option('notify', {
|
|
124
113
|
alias: 'n',
|
|
125
|
-
describe:
|
|
114
|
+
describe: en_1.commands.watch.options.notify,
|
|
126
115
|
type: 'string',
|
|
127
116
|
requiresArg: true,
|
|
128
117
|
});
|
|
129
118
|
yargs.option('convertFields', {
|
|
130
|
-
describe:
|
|
119
|
+
describe: en_1.commands.watch.options.convertFields,
|
|
131
120
|
type: 'boolean',
|
|
132
121
|
default: false,
|
|
133
122
|
});
|
|
134
123
|
yargs.option('saveOutput', {
|
|
135
|
-
describe:
|
|
124
|
+
describe: en_1.commands.watch.options.saveOutput,
|
|
136
125
|
type: 'boolean',
|
|
137
126
|
default: false,
|
|
138
127
|
});
|
|
139
|
-
addConfigOptions(yargs);
|
|
140
|
-
addAccountOptions(yargs);
|
|
141
|
-
addCmsPublishModeOptions(yargs, { write: true });
|
|
142
|
-
addUseEnvironmentOptions(yargs);
|
|
143
|
-
addGlobalOptions(yargs);
|
|
144
128
|
return yargs;
|
|
129
|
+
}
|
|
130
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(watchBuilder, command, describe, {
|
|
131
|
+
useConfigOptions: true,
|
|
132
|
+
useAccountOptions: true,
|
|
133
|
+
useGlobalOptions: true,
|
|
134
|
+
useEnvironmentOptions: true,
|
|
135
|
+
useCmsPublishModeOptions: { write: true },
|
|
136
|
+
});
|
|
137
|
+
const watchCommand = {
|
|
138
|
+
command,
|
|
139
|
+
describe,
|
|
140
|
+
handler,
|
|
141
|
+
builder,
|
|
145
142
|
};
|
|
143
|
+
exports.default = watchCommand;
|
|
144
|
+
module.exports = watchCommand;
|