@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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
12
|
+
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
13
|
+
const en_1 = require("../../lang/en");
|
|
14
|
+
const process_1 = require("../../lib/process");
|
|
15
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
16
|
+
const command = 'start';
|
|
17
|
+
const describe = undefined; // Leave hidden for now
|
|
18
|
+
async function handler(args) {
|
|
19
|
+
try {
|
|
20
|
+
await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
logger_1.uiLogger.error(en_1.commands.mcp.start.errors.needsNode20);
|
|
24
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
25
|
+
}
|
|
26
|
+
(0, usageTracking_1.trackCommandUsage)('mcp-start', {}, args.derivedAccountId);
|
|
27
|
+
await startMcpServer();
|
|
28
|
+
}
|
|
29
|
+
async function startMcpServer() {
|
|
30
|
+
try {
|
|
31
|
+
const serverPath = path_1.default.join(__dirname, '..', '..', 'mcp-server', 'server.js');
|
|
32
|
+
// Check if server file exists
|
|
33
|
+
if (!fs_1.default.existsSync(serverPath)) {
|
|
34
|
+
logger_1.uiLogger.error(en_1.commands.mcp.start.errors.serverFileNotFound(serverPath));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
logger_1.uiLogger.info(en_1.commands.mcp.start.startingServer);
|
|
38
|
+
logger_1.uiLogger.info(en_1.commands.mcp.start.stopInstructions);
|
|
39
|
+
// Start the server using ts-node
|
|
40
|
+
const child = (0, child_process_1.spawn)('node', [serverPath], {
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
env: {
|
|
43
|
+
...process.env,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
// Handle server process events
|
|
47
|
+
child.on('error', error => {
|
|
48
|
+
(0, errorHandlers_1.logError)(error);
|
|
49
|
+
logger_1.uiLogger.error(en_1.commands.mcp.start.errors.failedToStart);
|
|
50
|
+
});
|
|
51
|
+
child.on('close', () => {
|
|
52
|
+
logger_1.uiLogger.info(en_1.commands.mcp.start.stoppedSuccessfully);
|
|
53
|
+
});
|
|
54
|
+
(0, process_1.handleExit)(() => {
|
|
55
|
+
logger_1.uiLogger.info(en_1.commands.mcp.start.shuttingDown);
|
|
56
|
+
child.kill('SIGTERM');
|
|
57
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
logger_1.uiLogger.error(en_1.commands.mcp.start.errors.failedToStart);
|
|
62
|
+
(0, errorHandlers_1.logError)(error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function startBuilder(yargs) {
|
|
66
|
+
return yargs;
|
|
67
|
+
}
|
|
68
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(startBuilder, command, describe, {
|
|
69
|
+
useGlobalOptions: true,
|
|
70
|
+
});
|
|
71
|
+
const mcpStartCommand = {
|
|
72
|
+
command,
|
|
73
|
+
describe,
|
|
74
|
+
handler,
|
|
75
|
+
builder,
|
|
76
|
+
};
|
|
77
|
+
exports.default = mcpStartCommand;
|
package/commands/mcp.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const start_1 = __importDefault(require("./mcp/start"));
|
|
7
|
+
const setup_1 = __importDefault(require("./mcp/setup"));
|
|
8
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
9
|
+
const en_1 = require("../lang/en");
|
|
10
|
+
const command = 'mcp';
|
|
11
|
+
// Leave this as undefined to hide the command
|
|
12
|
+
const describe = undefined;
|
|
13
|
+
function mcpBuilder(yargs) {
|
|
14
|
+
yargs.command(start_1.default).command(setup_1.default).demandCommand(1, '');
|
|
15
|
+
return yargs;
|
|
16
|
+
}
|
|
17
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(mcpBuilder, command, en_1.commands.mcp.describe, {
|
|
18
|
+
useGlobalOptions: true,
|
|
19
|
+
});
|
|
20
|
+
const mcpCommand = {
|
|
21
|
+
command,
|
|
22
|
+
describe,
|
|
23
|
+
builder,
|
|
24
|
+
handler: () => { },
|
|
25
|
+
};
|
|
26
|
+
exports.default = mcpCommand;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type MarketplaceValidateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
src: string;
|
|
4
|
+
};
|
|
5
|
+
declare const marketplaceValidateCommand: YargsCommandModule<unknown, MarketplaceValidateArgs>;
|
|
6
|
+
export default marketplaceValidateCommand;
|
|
@@ -1,38 +1,48 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const { src, derivedAccountId } =
|
|
13
|
-
trackCommandUsage('validate',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
text:
|
|
17
|
-
path: src,
|
|
18
|
-
}),
|
|
6
|
+
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
7
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
8
|
+
const marketplaceValidate_1 = require("../../lib/marketplaceValidate");
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
10
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
|
+
const command = 'marketplace-validate <src>';
|
|
13
|
+
const describe = en_1.commands.module.subcommands.marketplaceValidate.describe;
|
|
14
|
+
async function handler(args) {
|
|
15
|
+
const { src, derivedAccountId } = args;
|
|
16
|
+
(0, usageTracking_1.trackCommandUsage)('validate', undefined, derivedAccountId);
|
|
17
|
+
SpinniesManager_1.default.init();
|
|
18
|
+
SpinniesManager_1.default.add('marketplaceValidation', {
|
|
19
|
+
text: en_1.commands.module.subcommands.marketplaceValidate.logs.validatingModule(src),
|
|
19
20
|
});
|
|
20
21
|
const assetType = 'MODULE';
|
|
21
|
-
const validationId = await kickOffValidation(derivedAccountId, assetType, src);
|
|
22
|
-
await pollForValidationFinish(derivedAccountId, validationId);
|
|
23
|
-
|
|
24
|
-
const validationResults = await fetchValidationResults(derivedAccountId, validationId);
|
|
25
|
-
processValidationErrors(
|
|
26
|
-
displayValidationResults(
|
|
27
|
-
process.exit();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
addConfigOptions(yargs);
|
|
31
|
-
addAccountOptions(yargs);
|
|
32
|
-
addUseEnvironmentOptions(yargs);
|
|
22
|
+
const validationId = await (0, marketplaceValidate_1.kickOffValidation)(derivedAccountId, assetType, src);
|
|
23
|
+
await (0, marketplaceValidate_1.pollForValidationFinish)(derivedAccountId, validationId);
|
|
24
|
+
SpinniesManager_1.default.remove('marketplaceValidation');
|
|
25
|
+
const validationResults = await (0, marketplaceValidate_1.fetchValidationResults)(derivedAccountId, validationId);
|
|
26
|
+
(0, marketplaceValidate_1.processValidationErrors)(en_1.commands.module.subcommands.marketplaceValidate.errors.invalidPath, validationResults);
|
|
27
|
+
(0, marketplaceValidate_1.displayValidationResults)(en_1.commands.module.subcommands.marketplaceValidate.results, validationResults);
|
|
28
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
29
|
+
}
|
|
30
|
+
function marketplaceValidateBuilder(yargs) {
|
|
33
31
|
yargs.positional('src', {
|
|
34
|
-
describe:
|
|
32
|
+
describe: en_1.commands.module.subcommands.marketplaceValidate.positionals.src,
|
|
35
33
|
type: 'string',
|
|
36
34
|
});
|
|
37
35
|
return yargs;
|
|
36
|
+
}
|
|
37
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(marketplaceValidateBuilder, command, describe, {
|
|
38
|
+
useConfigOptions: true,
|
|
39
|
+
useAccountOptions: true,
|
|
40
|
+
useEnvironmentOptions: true,
|
|
41
|
+
});
|
|
42
|
+
const marketplaceValidateCommand = {
|
|
43
|
+
command,
|
|
44
|
+
describe,
|
|
45
|
+
handler,
|
|
46
|
+
builder,
|
|
38
47
|
};
|
|
48
|
+
exports.default = marketplaceValidateCommand;
|
package/commands/module.d.ts
CHANGED
package/commands/module.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
addAccountOptions(yargs);
|
|
11
|
-
addGlobalOptions(yargs);
|
|
12
|
-
yargs.command(marketplaceValidate).demandCommand(1, '');
|
|
6
|
+
const marketplace_validate_1 = __importDefault(require("./module/marketplace-validate"));
|
|
7
|
+
const en_1 = require("../lang/en");
|
|
8
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
9
|
+
const command = 'module';
|
|
10
|
+
const describe = en_1.commands.module.describe;
|
|
11
|
+
function moduleBuilder(yargs) {
|
|
12
|
+
yargs.command(marketplace_validate_1.default).demandCommand(1, '');
|
|
13
13
|
return yargs;
|
|
14
|
+
}
|
|
15
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(moduleBuilder, command, describe, {
|
|
16
|
+
useGlobalOptions: true,
|
|
17
|
+
useConfigOptions: true,
|
|
18
|
+
useAccountOptions: true,
|
|
19
|
+
});
|
|
20
|
+
const moduleCommand = {
|
|
21
|
+
command,
|
|
22
|
+
describe,
|
|
23
|
+
builder,
|
|
24
|
+
handler: () => { },
|
|
14
25
|
};
|
|
26
|
+
exports.default = moduleCommand;
|
|
27
|
+
module.exports = moduleCommand;
|
package/commands/mv.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs, EnvironmentArgs } from '../types/Yargs';
|
|
3
|
-
export declare const command = "mv <srcPath> <destPath>";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../types/Yargs';
|
|
5
2
|
type MvArgs = CommonArgs & ConfigArgs & EnvironmentArgs & {
|
|
6
3
|
srcPath: string;
|
|
7
4
|
destPath: string;
|
|
8
5
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
6
|
+
declare const cmsMvCommand: YargsCommandModule<unknown, MvArgs>;
|
|
7
|
+
export default cmsMvCommand;
|
package/commands/mv.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const fileMapper_1 = require("@hubspot/local-dev-lib/api/fileMapper");
|
|
8
5
|
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
9
6
|
const index_2 = require("../lib/errorHandlers/index");
|
|
10
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
11
7
|
const usageTracking_1 = require("../lib/usageTracking");
|
|
12
8
|
const filesystem_1 = require("../lib/filesystem");
|
|
13
9
|
const lang_1 = require("../lib/lang");
|
|
14
10
|
const ui_1 = require("../lib/ui");
|
|
11
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
15
12
|
function getCorrectedDestPath(srcPath, destPath) {
|
|
16
13
|
if (!(0, filesystem_1.isPathFolder)(srcPath)) {
|
|
17
14
|
return destPath;
|
|
@@ -19,8 +16,8 @@ function getCorrectedDestPath(srcPath, destPath) {
|
|
|
19
16
|
// Makes sure that nested folders are moved independently
|
|
20
17
|
return `${destPath}/${srcPath.split('/').pop()}`;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const command = 'mv <srcPath> <destPath>';
|
|
20
|
+
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.mv.describe`), false);
|
|
24
21
|
async function handler(args) {
|
|
25
22
|
const { srcPath, destPath, derivedAccountId } = args;
|
|
26
23
|
(0, usageTracking_1.trackCommandUsage)('mv', undefined, derivedAccountId);
|
|
@@ -51,11 +48,7 @@ async function handler(args) {
|
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
|
-
function
|
|
55
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
56
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
57
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
58
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
51
|
+
function cmsMvBuilder(yargs) {
|
|
59
52
|
yargs.positional('srcPath', {
|
|
60
53
|
describe: 'Remote hubspot path',
|
|
61
54
|
type: 'string',
|
|
@@ -66,3 +59,16 @@ function builder(yargs) {
|
|
|
66
59
|
});
|
|
67
60
|
return yargs;
|
|
68
61
|
}
|
|
62
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(cmsMvBuilder, command, describe, {
|
|
63
|
+
useGlobalOptions: true,
|
|
64
|
+
useConfigOptions: true,
|
|
65
|
+
useAccountOptions: true,
|
|
66
|
+
useEnvironmentOptions: true,
|
|
67
|
+
});
|
|
68
|
+
const cmsMvCommand = {
|
|
69
|
+
command,
|
|
70
|
+
describe,
|
|
71
|
+
handler,
|
|
72
|
+
builder,
|
|
73
|
+
};
|
|
74
|
+
exports.default = cmsMvCommand;
|
package/commands/open.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs, EnvironmentArgs, AccountArgs } from '../types/Yargs';
|
|
3
|
-
export declare const command = "open [shortcut]";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, EnvironmentArgs, AccountArgs, YargsCommandModule } from '../types/Yargs';
|
|
5
2
|
type OpenArgs = CommonArgs & ConfigArgs & EnvironmentArgs & AccountArgs & {
|
|
6
3
|
shortcut?: string;
|
|
7
4
|
list?: boolean;
|
|
8
5
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
6
|
+
declare const openCommand: YargsCommandModule<unknown, OpenArgs>;
|
|
7
|
+
export default openCommand;
|
package/commands/open.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
7
3
|
const usageTracking_1 = require("../lib/usageTracking");
|
|
8
4
|
const links_1 = require("../lib/links");
|
|
9
5
|
const promptUtils_1 = require("../lib/prompts/promptUtils");
|
|
10
6
|
const lang_1 = require("../lib/lang");
|
|
11
7
|
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
8
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
12
9
|
const separator = ' => ';
|
|
13
10
|
async function createListPrompt(accountId) {
|
|
14
11
|
return (0, promptUtils_1.promptUser)([
|
|
@@ -22,8 +19,8 @@ async function createListPrompt(accountId) {
|
|
|
22
19
|
},
|
|
23
20
|
]);
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const command = 'open [shortcut]';
|
|
23
|
+
const describe = (0, lang_1.i18n)('commands.open.describe');
|
|
27
24
|
async function handler(args) {
|
|
28
25
|
const { shortcut, list, derivedAccountId } = args;
|
|
29
26
|
(0, usageTracking_1.trackCommandUsage)('open', undefined, derivedAccountId);
|
|
@@ -39,11 +36,7 @@ async function handler(args) {
|
|
|
39
36
|
}
|
|
40
37
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
41
38
|
}
|
|
42
|
-
function
|
|
43
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
44
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
45
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
46
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
39
|
+
function openBuilder(yargs) {
|
|
47
40
|
yargs.positional('[shortcut]', {
|
|
48
41
|
describe: (0, lang_1.i18n)('commands.open.positionals.shortcut.describe'),
|
|
49
42
|
type: 'string',
|
|
@@ -62,3 +55,16 @@ function builder(yargs) {
|
|
|
62
55
|
]);
|
|
63
56
|
return yargs;
|
|
64
57
|
}
|
|
58
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(openBuilder, command, describe, {
|
|
59
|
+
useGlobalOptions: true,
|
|
60
|
+
useConfigOptions: true,
|
|
61
|
+
useAccountOptions: true,
|
|
62
|
+
useEnvironmentOptions: true,
|
|
63
|
+
});
|
|
64
|
+
const openCommand = {
|
|
65
|
+
command,
|
|
66
|
+
describe,
|
|
67
|
+
handler,
|
|
68
|
+
builder,
|
|
69
|
+
};
|
|
70
|
+
exports.default = openCommand;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { YargsCommandModule, CommonArgs } from '../../types/Yargs';
|
|
2
2
|
type ProjectAddArgs = CommonArgs & {
|
|
3
|
-
type
|
|
4
|
-
name
|
|
3
|
+
type?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
features?: string[];
|
|
6
|
+
distribution?: string;
|
|
7
|
+
auth?: string;
|
|
5
8
|
};
|
|
6
9
|
declare const projectAddCommand: YargsCommandModule<unknown, ProjectAddArgs>;
|
|
7
10
|
export default projectAddCommand;
|
package/commands/project/add.js
CHANGED
|
@@ -1,87 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
8
|
-
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
9
3
|
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
10
4
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
|
-
const lang_1 = require("../../lib/lang");
|
|
12
|
-
const projectAddPrompt_1 = require("../../lib/prompts/projectAddPrompt");
|
|
13
5
|
const config_1 = require("../../lib/projects/config");
|
|
14
|
-
const create_1 = require("../../lib/projects/create");
|
|
15
|
-
const structure_1 = require("../../lib/projects/structure");
|
|
16
|
-
const Projects_1 = require("../../types/Projects");
|
|
17
6
|
const ui_1 = require("../../lib/ui");
|
|
18
|
-
const constants_1 = require("../../lib/constants");
|
|
19
7
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
20
8
|
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
10
|
+
const buildAndDeploy_1 = require("../../lib/projects/buildAndDeploy");
|
|
11
|
+
const legacyAddComponent_1 = require("../../lib/projects/add/legacyAddComponent");
|
|
12
|
+
const v3AddComponent_1 = require("../../lib/projects/add/v3AddComponent");
|
|
13
|
+
const constants_1 = require("../../lib/constants");
|
|
14
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
21
15
|
const command = 'add';
|
|
22
|
-
const describe = (0, ui_1.uiBetaTag)(
|
|
16
|
+
const describe = (0, ui_1.uiBetaTag)(en_1.commands.project.add.describe, false);
|
|
23
17
|
async function handler(args) {
|
|
24
|
-
const { derivedAccountId } = args;
|
|
25
|
-
(0, usageTracking_1.trackCommandUsage)('project-add', undefined, derivedAccountId);
|
|
26
|
-
const { projectConfig, projectDir } = await (0, config_1.getProjectConfig)();
|
|
27
|
-
if (!projectDir || !projectConfig) {
|
|
28
|
-
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.add.error.locationInProject`));
|
|
29
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
30
|
-
}
|
|
31
|
-
// We currently only support adding private apps to projects
|
|
32
|
-
let projectContainsPublicApp = false;
|
|
33
|
-
try {
|
|
34
|
-
const components = await (0, structure_1.findProjectComponents)(projectDir);
|
|
35
|
-
projectContainsPublicApp = components.some(c => c.type === Projects_1.ComponentTypes.PublicApp);
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
(0, errorHandlers_1.debugError)(err);
|
|
39
|
-
}
|
|
40
|
-
if (projectContainsPublicApp) {
|
|
41
|
-
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.add.error.projectContainsPublicApp`));
|
|
42
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
43
|
-
}
|
|
44
|
-
logger_1.logger.log('');
|
|
45
|
-
logger_1.logger.log((0, lang_1.i18n)(`commands.project.subcommands.add.creatingComponent`, {
|
|
46
|
-
projectName: projectConfig.name,
|
|
47
|
-
}));
|
|
48
|
-
logger_1.logger.log('');
|
|
49
|
-
let latestRepoReleaseTag;
|
|
50
18
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
19
|
+
const { derivedAccountId } = args;
|
|
20
|
+
(0, usageTracking_1.trackCommandUsage)('project-add', undefined, derivedAccountId);
|
|
21
|
+
const { projectConfig, projectDir } = await (0, config_1.getProjectConfig)();
|
|
22
|
+
if (!projectDir || !projectConfig) {
|
|
23
|
+
logger_1.uiLogger.error(en_1.commands.project.add.error.locationInProject);
|
|
24
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
25
|
+
}
|
|
26
|
+
const isV3ProjectCreate = (0, buildAndDeploy_1.useV3Api)(projectConfig.platformVersion);
|
|
27
|
+
if (isV3ProjectCreate) {
|
|
28
|
+
await (0, v3AddComponent_1.v3AddComponent)(args, projectDir, projectConfig);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
await (0, legacyAddComponent_1.legacyAddComponent)(args, projectDir, projectConfig);
|
|
55
32
|
}
|
|
56
33
|
}
|
|
57
|
-
catch (
|
|
58
|
-
(0, errorHandlers_1.
|
|
59
|
-
}
|
|
60
|
-
if (!latestRepoReleaseTag) {
|
|
61
|
-
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.add.error.failedToFetchComponentList`));
|
|
62
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
63
|
-
}
|
|
64
|
-
const components = await (0, create_1.getProjectComponentListFromRepo)(latestRepoReleaseTag);
|
|
65
|
-
if (!components.length) {
|
|
66
|
-
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.add.error.failedToFetchComponentList`));
|
|
67
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
68
|
-
}
|
|
69
|
-
const projectAddPromptResponse = await (0, projectAddPrompt_1.projectAddPrompt)(components, args);
|
|
70
|
-
try {
|
|
71
|
-
const componentPath = path_1.default.join(projectDir, projectConfig.srcDir, projectAddPromptResponse.componentTemplate.insertPath, projectAddPromptResponse.name);
|
|
72
|
-
await (0, github_1.cloneGithubRepo)(constants_1.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, componentPath, {
|
|
73
|
-
sourceDir: projectAddPromptResponse.componentTemplate.path,
|
|
74
|
-
tag: latestRepoReleaseTag,
|
|
75
|
-
hideLogs: true,
|
|
76
|
-
});
|
|
77
|
-
logger_1.logger.log('');
|
|
78
|
-
logger_1.logger.success((0, lang_1.i18n)(`commands.project.subcommands.add.success`, {
|
|
79
|
-
componentName: projectAddPromptResponse.name,
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
(0, errorHandlers_1.debugError)(error);
|
|
84
|
-
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.add.error.failedToDownloadComponent`));
|
|
34
|
+
catch (e) {
|
|
35
|
+
(0, errorHandlers_1.logError)(e);
|
|
85
36
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
86
37
|
}
|
|
87
38
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
@@ -89,24 +40,36 @@ async function handler(args) {
|
|
|
89
40
|
function projectAddBuilder(yargs) {
|
|
90
41
|
yargs.options({
|
|
91
42
|
type: {
|
|
92
|
-
describe:
|
|
43
|
+
describe: en_1.commands.project.add.options.type.describe,
|
|
93
44
|
type: 'string',
|
|
94
45
|
},
|
|
95
46
|
name: {
|
|
96
|
-
describe:
|
|
47
|
+
describe: en_1.commands.project.add.options.name.describe,
|
|
48
|
+
type: 'string',
|
|
49
|
+
},
|
|
50
|
+
distribution: {
|
|
51
|
+
describe: en_1.commands.project.add.options.distribution.describe,
|
|
52
|
+
hidden: true,
|
|
97
53
|
type: 'string',
|
|
54
|
+
choices: [constants_1.privateDistribution, constants_1.marketplaceDistribution],
|
|
55
|
+
},
|
|
56
|
+
auth: {
|
|
57
|
+
describe: en_1.commands.project.add.options.auth.describe,
|
|
58
|
+
hidden: true,
|
|
59
|
+
type: 'string',
|
|
60
|
+
choices: [constants_1.oAuth, constants_1.staticAuth],
|
|
61
|
+
},
|
|
62
|
+
features: {
|
|
63
|
+
describe: en_1.commands.project.add.options.features.describe,
|
|
64
|
+
hidden: true,
|
|
65
|
+
type: 'array',
|
|
98
66
|
},
|
|
99
67
|
});
|
|
100
|
-
yargs.example([
|
|
101
|
-
[
|
|
102
|
-
'$0 project add',
|
|
103
|
-
(0, lang_1.i18n)(`commands.project.subcommands.add.examples.default`),
|
|
104
|
-
],
|
|
105
|
-
]);
|
|
68
|
+
yargs.example([['$0 project add', en_1.commands.project.add.examples.default]]);
|
|
106
69
|
yargs.example([
|
|
107
70
|
[
|
|
108
71
|
'$0 project add --name="my-component" --type="components/example-app"',
|
|
109
|
-
|
|
72
|
+
en_1.commands.project.add.examples.withFlags,
|
|
110
73
|
],
|
|
111
74
|
]);
|
|
112
75
|
return yargs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
-
|
|
2
|
+
type CloneAppArgs = ConfigArgs & EnvironmentArgs & AccountArgs & CommonArgs & {
|
|
3
3
|
dest: string;
|
|
4
4
|
appId: number;
|
|
5
5
|
};
|
|
@@ -7,7 +7,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
9
9
|
const lang_1 = require("../../lib/lang");
|
|
10
|
-
const
|
|
10
|
+
const selectPublicAppForMigrationPrompt_1 = require("../../lib/prompts/selectPublicAppForMigrationPrompt");
|
|
11
11
|
const createProjectPrompt_1 = require("../../lib/prompts/createProjectPrompt");
|
|
12
12
|
const polling_1 = require("../../lib/polling");
|
|
13
13
|
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
@@ -46,7 +46,7 @@ async function handler(args) {
|
|
|
46
46
|
try {
|
|
47
47
|
appId = args.appId;
|
|
48
48
|
if (!appId) {
|
|
49
|
-
const appIdResponse = await (0,
|
|
49
|
+
const appIdResponse = await (0, selectPublicAppForMigrationPrompt_1.selectPublicAppForMigrationPrompt)({
|
|
50
50
|
accountId: derivedAccountId,
|
|
51
51
|
accountName,
|
|
52
52
|
isMigratingApp: false,
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type ProjectCreateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
4
|
-
name?: string;
|
|
5
|
-
dest?: string;
|
|
6
|
-
templateSource?: RepoPath;
|
|
7
|
-
template?: string;
|
|
8
|
-
};
|
|
1
|
+
import { YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
import { ProjectCreateArgs } from '../../lib/projects/create';
|
|
9
3
|
declare const projectCreateCommand: YargsCommandModule<unknown, ProjectCreateArgs>;
|
|
10
4
|
export default projectCreateCommand;
|