@hubspot/cli 7.4.7-experimental.0 → 7.4.7
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 +8 -183
- package/commands/account/auth.d.ts +10 -0
- package/commands/account/auth.js +188 -0
- package/commands/account/clean.js +38 -5
- package/commands/account/createOverride.d.ts +10 -0
- package/commands/account/createOverride.js +104 -0
- package/commands/account/info.js +38 -4
- package/commands/account/list.js +23 -5
- package/commands/account/remove.js +36 -2
- package/commands/account/removeOverride.d.ts +10 -0
- package/commands/account/removeOverride.js +76 -0
- package/commands/account/use.js +25 -3
- package/commands/account.js +7 -2
- package/commands/app/migrate.d.ts +6 -6
- package/commands/app/migrate.js +62 -45
- package/commands/app.js +0 -2
- package/commands/auth.js +14 -11
- package/commands/cms/lighthouseScore.js +7 -3
- package/commands/cms.js +1 -2
- package/commands/completion.js +2 -3
- package/commands/config/migrate.d.ts +10 -0
- package/commands/config/migrate.js +84 -0
- package/commands/config/set.d.ts +10 -0
- package/commands/config/set.js +34 -29
- package/commands/config.d.ts +4 -1
- package/commands/config.js +45 -11
- package/commands/create/api-sample.js +3 -1
- package/commands/create/website-theme.js +1 -1
- package/commands/create.js +7 -8
- package/commands/customObject/schema/delete.js +4 -1
- package/commands/customObject/schema/fetch-all.js +2 -1
- package/commands/customObject/schema/fetch.js +2 -1
- package/commands/customObject.js +3 -4
- package/commands/doctor.js +5 -6
- package/commands/feedback.js +7 -8
- package/commands/fetch.js +6 -7
- package/commands/filemanager.js +1 -2
- package/commands/function.js +1 -2
- package/commands/hubdb/clear.js +5 -6
- package/commands/hubdb/create.js +7 -8
- package/commands/hubdb/delete.js +8 -7
- package/commands/hubdb/fetch.js +4 -5
- package/commands/hubdb.js +1 -2
- package/commands/init.js +18 -20
- package/commands/lint.js +3 -4
- package/commands/list.js +5 -6
- package/commands/logs.js +12 -13
- package/commands/module/marketplace-validate.js +5 -6
- package/commands/module.js +1 -3
- package/commands/mv.js +4 -5
- package/commands/open.js +4 -5
- package/commands/project/add.d.ts +3 -7
- package/commands/project/add.js +28 -23
- package/commands/project/cloneApp.d.ts +6 -8
- package/commands/project/cloneApp.js +49 -45
- package/commands/project/create.d.ts +10 -1
- package/commands/project/create.js +85 -63
- package/commands/project/deploy.d.ts +3 -6
- package/commands/project/deploy.js +27 -25
- package/commands/project/dev/deprecatedFlow.js +32 -25
- package/commands/project/dev/index.d.ts +4 -2
- package/commands/project/dev/index.js +31 -18
- package/commands/project/dev/unifiedFlow.js +10 -11
- 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 -27
- package/commands/project/logs.d.ts +10 -1
- package/commands/project/logs.js +73 -65
- package/commands/project/migrate.d.ts +6 -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/upload.d.ts +9 -1
- package/commands/project/upload.js +78 -54
- 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 +47 -35
- package/commands/remove.js +7 -5
- package/commands/sandbox/create.js +10 -11
- package/commands/sandbox/delete.js +18 -19
- package/commands/sandbox.js +1 -2
- package/commands/secret/addSecret.js +5 -6
- package/commands/secret/deleteSecret.js +12 -9
- package/commands/secret/listSecret.js +3 -4
- package/commands/secret/updateSecret.js +9 -8
- package/commands/secret.js +1 -2
- package/commands/theme/generate-selectors.js +5 -6
- package/commands/theme/marketplace-validate.js +5 -6
- package/commands/theme/preview.js +16 -16
- package/commands/theme.js +1 -2
- package/commands/upload.js +23 -24
- package/commands/watch.js +18 -19
- package/lang/en.d.ts +2806 -0
- package/lang/en.js +2659 -3300
- package/lang/en.lyaml +98 -41
- package/lib/accountTypes.d.ts +1 -0
- package/lib/accountTypes.js +12 -0
- package/lib/app/migrate.d.ts +10 -4
- package/lib/app/migrate.js +208 -94
- package/lib/app/migrate_legacy.d.ts +2 -2
- package/lib/app/migrate_legacy.js +10 -7
- package/lib/buildAccount.d.ts +1 -2
- package/lib/buildAccount.js +11 -10
- package/lib/commonOpts.d.ts +3 -4
- package/lib/commonOpts.js +46 -18
- package/lib/configMigrate.d.ts +2 -0
- package/lib/configMigrate.js +104 -0
- package/lib/configOptions.js +11 -10
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +5 -1
- package/lib/dependencyManagement.js +2 -2
- package/lib/doctor/Diagnosis.d.ts +1 -2
- package/lib/doctor/Diagnosis.js +19 -16
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +2 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +10 -9
- package/lib/doctor/Doctor.d.ts +1 -0
- package/lib/doctor/Doctor.js +57 -44
- package/lib/errorHandlers/index.js +6 -7
- package/lib/errorHandlers/suppressError.js +6 -7
- package/lib/generateSelectors.js +1 -2
- package/lib/hasFeature.d.ts +3 -1
- package/lib/middleware/__test__/configMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/configMiddleware.test.js +194 -0
- package/lib/middleware/__test__/gitMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/gitMiddleware.test.js +76 -0
- package/lib/middleware/__test__/notificationsMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/notificationsMiddleware.test.js +10 -0
- package/lib/middleware/__test__/requestMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/requestMiddleware.test.js +20 -0
- package/lib/middleware/__test__/utils.test.d.ts +1 -0
- package/lib/middleware/__test__/utils.test.js +53 -0
- package/lib/middleware/__test__/yargsChecksMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +81 -0
- package/lib/middleware/configMiddleware.d.ts +13 -0
- package/lib/middleware/configMiddleware.js +116 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +4 -0
- package/lib/middleware/fireAlarmMiddleware.js +123 -0
- package/lib/middleware/gitMiddleware.d.ts +2 -0
- package/lib/middleware/gitMiddleware.js +14 -0
- package/lib/middleware/notificationsMiddleware.d.ts +1 -0
- package/lib/middleware/notificationsMiddleware.js +38 -0
- package/lib/middleware/requestMiddleware.d.ts +1 -0
- package/lib/middleware/requestMiddleware.js +11 -0
- package/lib/middleware/utils.d.ts +8 -0
- package/lib/middleware/utils.js +17 -0
- package/lib/middleware/yargsChecksMiddleware.d.ts +4 -0
- package/lib/middleware/yargsChecksMiddleware.js +24 -0
- package/lib/oauth.js +1 -2
- package/lib/process.js +1 -2
- package/lib/projects/ProjectLogsManager.d.ts +1 -1
- package/lib/projects/ProjectLogsManager.js +16 -21
- package/lib/projects/buildAndDeploy.js +28 -39
- package/lib/projects/config.d.ts +9 -0
- package/lib/projects/config.js +79 -0
- package/lib/projects/create.js +5 -6
- package/lib/projects/ensureProjectExists.d.ts +11 -0
- package/lib/projects/ensureProjectExists.js +97 -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/{DevServerManagerV2.d.ts → projects/localDev/DevServerManagerV2.d.ts} +1 -1
- package/lib/{DevServerManagerV2.js → projects/localDev/DevServerManagerV2.js} +3 -4
- package/lib/{LocalDevManager.d.ts → projects/localDev/LocalDevManager.d.ts} +1 -1
- package/lib/{LocalDevManager.js → projects/localDev/LocalDevManager.js} +49 -82
- package/lib/{LocalDevManagerV2.d.ts → projects/localDev/LocalDevManagerV2.d.ts} +2 -2
- package/lib/{LocalDevManagerV2.js → projects/localDev/LocalDevManagerV2.js} +43 -75
- package/lib/{localDev.d.ts → projects/localDev/helpers.d.ts} +5 -4
- package/lib/{localDev.js → projects/localDev/helpers.js} +97 -114
- package/lib/projects/ui.d.ts +1 -0
- package/lib/projects/ui.js +15 -0
- package/lib/projects/upload.d.ts +13 -2
- package/lib/projects/upload.js +18 -34
- package/lib/projects/urls.d.ts +1 -0
- package/lib/projects/urls.js +6 -0
- 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.js +4 -5
- package/lib/prompts/createFunctionPrompt.js +13 -14
- package/lib/prompts/createModulePrompt.js +8 -9
- package/lib/prompts/createProjectPrompt.d.ts +11 -4
- package/lib/prompts/createProjectPrompt.js +14 -9
- package/lib/prompts/createTemplatePrompt.js +1 -2
- package/lib/prompts/downloadProjectPrompt.js +3 -4
- package/lib/prompts/installPublicAppPrompt.js +6 -5
- package/lib/prompts/personalAccessKeyPrompt.js +17 -18
- package/lib/prompts/previewPrompt.js +5 -6
- package/lib/prompts/projectAddPrompt.js +4 -5
- package/lib/prompts/projectDevTargetAccountPrompt.js +11 -12
- package/lib/prompts/projectNamePrompt.js +5 -6
- package/lib/prompts/projectsLogsPrompt.js +3 -2
- package/lib/prompts/promptUtils.d.ts +1 -1
- package/lib/prompts/sandboxesPrompt.js +5 -6
- package/lib/prompts/secretPrompt.js +2 -3
- package/lib/prompts/selectHubDBTablePrompt.js +11 -8
- package/lib/prompts/selectPublicAppPrompt.js +6 -7
- package/lib/prompts/setAsDefaultAccountPrompt.js +1 -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/ui/SpinniesManager.d.ts +1 -1
- 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 +4 -2
- package/lib/ui/index.js +16 -16
- package/lib/ui/logger.d.ts +10 -0
- package/lib/ui/logger.js +15 -0
- package/lib/ui/serverlessFunctionLogs.js +2 -3
- package/lib/ui/spinniesUtils.d.ts +5 -5
- package/lib/yargsUtils.d.ts +1 -1
- package/package.json +7 -6
- package/types/Yargs.d.ts +5 -11
- package/lib/projects/index.d.ts +0 -20
- package/lib/projects/index.js +0 -195
package/lib/projects/watch.js
CHANGED
|
@@ -8,16 +8,15 @@ const chokidar_1 = __importDefault(require("chokidar"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const p_queue_1 = __importDefault(require("p-queue"));
|
|
11
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
12
11
|
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
13
12
|
const extensions_1 = require("@hubspot/local-dev-lib/constants/extensions");
|
|
14
13
|
const ignoreRules_1 = require("@hubspot/local-dev-lib/ignoreRules");
|
|
15
14
|
const projects_1 = require("@hubspot/local-dev-lib/api/projects");
|
|
16
15
|
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
17
16
|
const errorHandlers_1 = require("../errorHandlers");
|
|
18
|
-
const lang_1 = require("../lang");
|
|
19
17
|
const constants_1 = require("../constants");
|
|
20
|
-
const
|
|
18
|
+
const en_1 = require("../../lang/en");
|
|
19
|
+
const logger_1 = require("../ui/logger");
|
|
21
20
|
const queue = new p_queue_1.default({
|
|
22
21
|
concurrency: 10,
|
|
23
22
|
});
|
|
@@ -44,18 +43,18 @@ function debounceQueueBuild(accountId, projectName, platformVersion) {
|
|
|
44
43
|
clearTimeout(timer);
|
|
45
44
|
}
|
|
46
45
|
timer = setTimeout(async () => {
|
|
47
|
-
logger_1.
|
|
46
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.pause);
|
|
48
47
|
queue.pause();
|
|
49
48
|
await queue.onIdle();
|
|
50
49
|
try {
|
|
51
50
|
await (0, projects_1.queueBuild)(accountId, projectName, platformVersion);
|
|
52
|
-
logger_1.
|
|
51
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.buildStarted);
|
|
53
52
|
}
|
|
54
53
|
catch (err) {
|
|
55
54
|
if ((0, index_1.isSpecifiedError)(err, {
|
|
56
55
|
subCategory: constants_1.PROJECT_ERROR_TYPES.MISSING_PROJECT_PROVISION,
|
|
57
56
|
})) {
|
|
58
|
-
logger_1.
|
|
57
|
+
logger_1.uiLogger.log(en_1.commands.project.watch.logs.watchCancelledFromUi);
|
|
59
58
|
process.exit(0);
|
|
60
59
|
}
|
|
61
60
|
else {
|
|
@@ -69,24 +68,24 @@ function debounceQueueBuild(accountId, projectName, platformVersion) {
|
|
|
69
68
|
await processStandByQueue(accountId, projectName, platformVersion);
|
|
70
69
|
}
|
|
71
70
|
queue.start();
|
|
72
|
-
logger_1.
|
|
73
|
-
logger_1.
|
|
71
|
+
logger_1.uiLogger.log(en_1.commands.project.watch.logs.resuming);
|
|
72
|
+
logger_1.uiLogger.log(`\n> Press ${chalk_1.default.bold('q')} to quit watching\n`);
|
|
74
73
|
}, 2000);
|
|
75
74
|
}
|
|
76
75
|
async function queueFileOrFolder(accountId, projectName, platformVersion, filePath, remotePath, action) {
|
|
77
76
|
if (action === 'upload' &&
|
|
78
77
|
!(0, path_2.isAllowedExtension)(filePath, Array.from(extensions_1.JSR_ALLOWED_EXTENSIONS))) {
|
|
79
|
-
logger_1.
|
|
78
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.extensionNotAllowed(filePath));
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
81
|
if ((0, ignoreRules_1.shouldIgnoreFile)(filePath, true)) {
|
|
83
|
-
logger_1.
|
|
82
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.ignored(filePath));
|
|
84
83
|
return;
|
|
85
84
|
}
|
|
86
85
|
if (!queue.isPaused) {
|
|
87
86
|
debounceQueueBuild(accountId, projectName, platformVersion);
|
|
88
87
|
}
|
|
89
|
-
logger_1.
|
|
88
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.uploading(filePath, remotePath));
|
|
90
89
|
return queue.add(async () => {
|
|
91
90
|
try {
|
|
92
91
|
if (action === 'upload') {
|
|
@@ -95,16 +94,20 @@ async function queueFileOrFolder(accountId, projectName, platformVersion, filePa
|
|
|
95
94
|
else if (action === 'deleteFile' || action === 'deleteFolder') {
|
|
96
95
|
await (0, projects_1.deleteFileFromBuild)(accountId, projectName, remotePath);
|
|
97
96
|
}
|
|
98
|
-
logger_1.
|
|
97
|
+
logger_1.uiLogger.log(
|
|
98
|
+
// @ts-expect-error
|
|
99
|
+
en_1.commands.project.watch.logs[`${action}Succeeded`](remotePath, filePath));
|
|
99
100
|
}
|
|
100
101
|
catch (err) {
|
|
101
|
-
logger_1.
|
|
102
|
+
logger_1.uiLogger.debug(
|
|
103
|
+
// @ts-expect-error
|
|
104
|
+
en_1.commands.project.watch.errors[`${action}Failed`](remotePath, filePath));
|
|
102
105
|
}
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
async function createNewBuild(accountId, projectName, platformVersion) {
|
|
106
109
|
try {
|
|
107
|
-
logger_1.
|
|
110
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.attemptNewBuild);
|
|
108
111
|
const { data: { buildId }, } = await (0, projects_1.provisionBuild)(accountId, projectName, platformVersion);
|
|
109
112
|
return buildId;
|
|
110
113
|
}
|
|
@@ -112,7 +115,7 @@ async function createNewBuild(accountId, projectName, platformVersion) {
|
|
|
112
115
|
(0, errorHandlers_1.logError)(err, new errorHandlers_1.ApiErrorContext({ accountId }));
|
|
113
116
|
if ((0, index_1.isSpecifiedError)(err, { subCategory: constants_1.PROJECT_ERROR_TYPES.PROJECT_LOCKED })) {
|
|
114
117
|
await (0, projects_1.cancelStagedBuild)(accountId, projectName);
|
|
115
|
-
logger_1.
|
|
118
|
+
logger_1.uiLogger.log(en_1.commands.project.watch.logs.previousStagingBuildCancelled);
|
|
116
119
|
}
|
|
117
120
|
process.exit(1);
|
|
118
121
|
}
|
|
@@ -121,7 +124,7 @@ async function handleWatchEvent(accountId, projectName, platformVersion, project
|
|
|
121
124
|
const remotePath = path_1.default.relative(projectSourceDir, filePath);
|
|
122
125
|
if (queue.isPaused) {
|
|
123
126
|
if (standbyQueue.find(file => file.filePath === filePath)) {
|
|
124
|
-
logger_1.
|
|
127
|
+
logger_1.uiLogger.debug(en_1.commands.project.watch.debug.fileAlreadyQueued(filePath));
|
|
125
128
|
}
|
|
126
129
|
else {
|
|
127
130
|
standbyQueue.push({
|
|
@@ -145,8 +148,8 @@ async function createWatcher(accountId, projectConfig, projectDir, handleBuildSt
|
|
|
145
148
|
ignored: file => (0, ignoreRules_1.shouldIgnoreFile)(file),
|
|
146
149
|
});
|
|
147
150
|
watcher.on('ready', async () => {
|
|
148
|
-
logger_1.
|
|
149
|
-
logger_1.
|
|
151
|
+
logger_1.uiLogger.log(en_1.commands.project.watch.logs.watching(projectDir));
|
|
152
|
+
logger_1.uiLogger.log(`\n> Press ${chalk_1.default.bold('q')} to quit watching\n`);
|
|
150
153
|
});
|
|
151
154
|
watcher.on('add', async (path) => {
|
|
152
155
|
handleWatchEvent(accountId, projectConfig.name, projectConfig.platformVersion, projectSourceDir, path);
|
|
@@ -7,24 +7,25 @@ const config_1 = require("@hubspot/local-dev-lib/config");
|
|
|
7
7
|
const promptUtils_1 = require("./promptUtils");
|
|
8
8
|
const lang_1 = require("../lang");
|
|
9
9
|
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
10
|
-
const i18nKey = 'lib.prompts.accountNamePrompt';
|
|
11
10
|
function getCliAccountNamePromptConfig(defaultName) {
|
|
12
11
|
return {
|
|
13
12
|
name: 'name',
|
|
14
|
-
message: (0, lang_1.i18n)(
|
|
13
|
+
message: (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.enterAccountName`),
|
|
15
14
|
default: defaultName,
|
|
16
15
|
validate(val) {
|
|
17
16
|
if (typeof val !== 'string') {
|
|
18
|
-
return (0, lang_1.i18n)(
|
|
17
|
+
return (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.invalidName`);
|
|
19
18
|
}
|
|
20
19
|
else if (!val.length) {
|
|
21
|
-
return (0, lang_1.i18n)(
|
|
20
|
+
return (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.nameRequired`);
|
|
22
21
|
}
|
|
23
22
|
else if (val.indexOf(' ') >= 0) {
|
|
24
|
-
return (0, lang_1.i18n)(
|
|
23
|
+
return (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.spacesInName`);
|
|
25
24
|
}
|
|
26
25
|
return (0, config_1.accountNameExistsInConfig)(val)
|
|
27
|
-
? (0, lang_1.i18n)(
|
|
26
|
+
? (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.accountNameExists`, {
|
|
27
|
+
name: val,
|
|
28
|
+
})
|
|
28
29
|
: true;
|
|
29
30
|
},
|
|
30
31
|
};
|
|
@@ -41,12 +42,12 @@ function hubspotAccountNamePrompt({ accountType, currentPortalCount = 0, }) {
|
|
|
41
42
|
let defaultName;
|
|
42
43
|
if (isSandbox) {
|
|
43
44
|
promptMessageString = isDevelopmentSandbox
|
|
44
|
-
? (0, lang_1.i18n)(
|
|
45
|
-
: (0, lang_1.i18n)(
|
|
45
|
+
? (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.enterDevelopmentSandboxName`)
|
|
46
|
+
: (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.enterStandardSandboxName`);
|
|
46
47
|
}
|
|
47
48
|
else if (isDeveloperTestAccount) {
|
|
48
|
-
promptMessageString = (0, lang_1.i18n)(
|
|
49
|
-
defaultName = (0, lang_1.i18n)(
|
|
49
|
+
promptMessageString = (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.enterDeveloperTestAccountName`);
|
|
50
|
+
defaultName = (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.developerTestAccountDefaultName`, {
|
|
50
51
|
count: currentPortalCount + 1,
|
|
51
52
|
});
|
|
52
53
|
}
|
|
@@ -56,13 +57,15 @@ function hubspotAccountNamePrompt({ accountType, currentPortalCount = 0, }) {
|
|
|
56
57
|
message: promptMessageString,
|
|
57
58
|
validate(val) {
|
|
58
59
|
if (typeof val !== 'string') {
|
|
59
|
-
return (0, lang_1.i18n)(
|
|
60
|
+
return (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.invalidName`);
|
|
60
61
|
}
|
|
61
62
|
else if (!val.trim().length) {
|
|
62
|
-
return (0, lang_1.i18n)(
|
|
63
|
+
return (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.nameRequired`);
|
|
63
64
|
}
|
|
64
65
|
return (0, config_1.accountNameExistsInConfig)(val)
|
|
65
|
-
? (0, lang_1.i18n)(
|
|
66
|
+
? (0, lang_1.i18n)(`lib.prompts.accountNamePrompt.errors.accountNameExists`, {
|
|
67
|
+
name: val,
|
|
68
|
+
})
|
|
66
69
|
: true;
|
|
67
70
|
},
|
|
68
71
|
default: defaultName,
|
|
@@ -12,7 +12,6 @@ function mapAccountChoices(portals) {
|
|
|
12
12
|
value: String(p.name || (0, getAccountIdentifier_1.getAccountIdentifier)(p)),
|
|
13
13
|
})) || []);
|
|
14
14
|
}
|
|
15
|
-
const i18nKey = 'commands.account.subcommands.use';
|
|
16
15
|
async function selectAccountFromConfig(prompt = '') {
|
|
17
16
|
const accountsList = (0, config_1.getConfigAccounts)();
|
|
18
17
|
const defaultAccount = (0, config_1.getConfigDefaultAccount)();
|
|
@@ -21,7 +20,7 @@ async function selectAccountFromConfig(prompt = '') {
|
|
|
21
20
|
type: 'list',
|
|
22
21
|
name: 'default',
|
|
23
22
|
pageSize: 20,
|
|
24
|
-
message: prompt || (0, lang_1.i18n)(
|
|
23
|
+
message: prompt || (0, lang_1.i18n)(`commands.account.subcommands.use.promptMessage`),
|
|
25
24
|
choices: mapAccountChoices(accountsList),
|
|
26
25
|
default: defaultAccount ?? undefined,
|
|
27
26
|
},
|
|
@@ -9,7 +9,6 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const promptUtils_1 = require("./promptUtils");
|
|
10
10
|
const lang_1 = require("../lang");
|
|
11
11
|
const escapeRegExp_1 = require("@hubspot/local-dev-lib/escapeRegExp");
|
|
12
|
-
const i18nKey = 'lib.prompts.uploadPrompt';
|
|
13
12
|
const FIELDS_FILES = ['fields.json', 'fields.js', 'fields.cjs', 'fields.mjs'];
|
|
14
13
|
async function fieldsJsPrompt(filePath, projectDir, skipFiles = []) {
|
|
15
14
|
const dirName = path_1.default.dirname(filePath);
|
|
@@ -33,7 +32,7 @@ async function fieldsJsPrompt(filePath, projectDir, skipFiles = []) {
|
|
|
33
32
|
}));
|
|
34
33
|
const promptVal = await (0, promptUtils_1.promptUser)([
|
|
35
34
|
{
|
|
36
|
-
message: (0, lang_1.i18n)(
|
|
35
|
+
message: (0, lang_1.i18n)(`lib.prompts.uploadPrompt.fieldsPrompt`, { dir: fileDir }),
|
|
37
36
|
type: 'list',
|
|
38
37
|
name: 'filePathChoice',
|
|
39
38
|
choices: selection,
|
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createApiSamplePrompt = createApiSamplePrompt;
|
|
4
4
|
const promptUtils_1 = require("./promptUtils");
|
|
5
5
|
const lang_1 = require("../lang");
|
|
6
|
-
const i18nKey = 'lib.prompts.createApiSamplePrompt';
|
|
7
6
|
function getSampleTypesPrompt(choices) {
|
|
8
7
|
return {
|
|
9
8
|
type: 'rawlist',
|
|
10
9
|
name: 'sampleType',
|
|
11
|
-
message: (0, lang_1.i18n)(
|
|
10
|
+
message: (0, lang_1.i18n)(`lib.prompts.createApiSamplePrompt.selectApiSampleApp`),
|
|
12
11
|
choices: choices.map(choice => ({
|
|
13
12
|
name: `${choice.name} - ${choice.description}`,
|
|
14
13
|
value: choice.id,
|
|
@@ -19,7 +18,7 @@ function getSampleTypesPrompt(choices) {
|
|
|
19
18
|
resolve(true);
|
|
20
19
|
}
|
|
21
20
|
else {
|
|
22
|
-
reject((0, lang_1.i18n)(
|
|
21
|
+
reject((0, lang_1.i18n)(`lib.prompts.createApiSamplePrompt.errors.apiSampleAppRequired`));
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
24
|
},
|
|
@@ -29,7 +28,7 @@ function getLanguagesPrompt(choices) {
|
|
|
29
28
|
return {
|
|
30
29
|
type: 'rawlist',
|
|
31
30
|
name: 'sampleLanguage',
|
|
32
|
-
message: (0, lang_1.i18n)(
|
|
31
|
+
message: (0, lang_1.i18n)(`lib.prompts.createApiSamplePrompt.selectLanguage`),
|
|
33
32
|
choices: choices.map(choice => ({
|
|
34
33
|
name: choice,
|
|
35
34
|
value: choice,
|
|
@@ -39,7 +38,7 @@ function getLanguagesPrompt(choices) {
|
|
|
39
38
|
if (input && input.length > 0) {
|
|
40
39
|
resolve(true);
|
|
41
40
|
}
|
|
42
|
-
reject((0, lang_1.i18n)(
|
|
41
|
+
reject((0, lang_1.i18n)(`lib.prompts.createApiSamplePrompt.errors.languageRequired`));
|
|
43
42
|
});
|
|
44
43
|
},
|
|
45
44
|
};
|
|
@@ -3,35 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createFunctionPrompt = createFunctionPrompt;
|
|
4
4
|
const promptUtils_1 = require("./promptUtils");
|
|
5
5
|
const lang_1 = require("../lang");
|
|
6
|
-
const i18nKey = 'lib.prompts.createFunctionPrompt';
|
|
7
6
|
const FUNCTIONS_FOLDER_PROMPT = {
|
|
8
7
|
name: 'functionsFolder',
|
|
9
|
-
message: (0, lang_1.i18n)(
|
|
8
|
+
message: (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.enterFolder`),
|
|
10
9
|
validate(val) {
|
|
11
10
|
if (typeof val !== 'string') {
|
|
12
|
-
return (0, lang_1.i18n)(
|
|
11
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.invalid`);
|
|
13
12
|
}
|
|
14
13
|
else if (!val.length) {
|
|
15
|
-
return (0, lang_1.i18n)(
|
|
14
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.blank`);
|
|
16
15
|
}
|
|
17
16
|
else if (val.indexOf(' ') >= 0) {
|
|
18
|
-
return (0, lang_1.i18n)(
|
|
17
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.space`);
|
|
19
18
|
}
|
|
20
19
|
return true;
|
|
21
20
|
},
|
|
22
21
|
};
|
|
23
22
|
const FUNCTION_FILENAME_PROMPT = {
|
|
24
23
|
name: 'filename',
|
|
25
|
-
message: (0, lang_1.i18n)(
|
|
24
|
+
message: (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.enterFilename`),
|
|
26
25
|
validate(val) {
|
|
27
26
|
if (typeof val !== 'string') {
|
|
28
|
-
return (0, lang_1.i18n)(
|
|
27
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.invalid`);
|
|
29
28
|
}
|
|
30
29
|
else if (!val.length) {
|
|
31
|
-
return (0, lang_1.i18n)(
|
|
30
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.blank`);
|
|
32
31
|
}
|
|
33
32
|
else if (val.indexOf(' ') >= 0) {
|
|
34
|
-
return (0, lang_1.i18n)(
|
|
33
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.space`);
|
|
35
34
|
}
|
|
36
35
|
return true;
|
|
37
36
|
},
|
|
@@ -39,22 +38,22 @@ const FUNCTION_FILENAME_PROMPT = {
|
|
|
39
38
|
const ENDPOINT_METHOD_PROMPT = {
|
|
40
39
|
type: 'list',
|
|
41
40
|
name: 'endpointMethod',
|
|
42
|
-
message: (0, lang_1.i18n)(
|
|
41
|
+
message: (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.selectEndpointMethod`),
|
|
43
42
|
default: 'GET',
|
|
44
43
|
choices: ['DELETE', 'GET', 'PATCH', 'POST', 'PUT'],
|
|
45
44
|
};
|
|
46
45
|
const ENDPOINT_PATH_PROMPT = {
|
|
47
46
|
name: 'endpointPath',
|
|
48
|
-
message: (0, lang_1.i18n)(
|
|
47
|
+
message: (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.enterEndpointPath`),
|
|
49
48
|
validate(val) {
|
|
50
49
|
if (typeof val !== 'string') {
|
|
51
|
-
return (0, lang_1.i18n)(
|
|
50
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.invalid`);
|
|
52
51
|
}
|
|
53
52
|
else if (!val.length) {
|
|
54
|
-
return (0, lang_1.i18n)(
|
|
53
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.blank`);
|
|
55
54
|
}
|
|
56
55
|
else if (val.indexOf(' ') >= 0) {
|
|
57
|
-
return (0, lang_1.i18n)(
|
|
56
|
+
return (0, lang_1.i18n)(`lib.prompts.createFunctionPrompt.errors.space`);
|
|
58
57
|
}
|
|
59
58
|
return true;
|
|
60
59
|
},
|
|
@@ -3,16 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createModulePrompt = createModulePrompt;
|
|
4
4
|
const promptUtils_1 = require("./promptUtils");
|
|
5
5
|
const lang_1 = require("../lang");
|
|
6
|
-
const i18nKey = 'lib.prompts.createModulePrompt';
|
|
7
6
|
const MODULE_LABEL_PROMPT = {
|
|
8
7
|
name: 'moduleLabel',
|
|
9
|
-
message: (0, lang_1.i18n)(
|
|
8
|
+
message: (0, lang_1.i18n)(`lib.prompts.createModulePrompt.enterLabel`),
|
|
10
9
|
validate(val) {
|
|
11
10
|
if (typeof val !== 'string') {
|
|
12
|
-
return (0, lang_1.i18n)(
|
|
11
|
+
return (0, lang_1.i18n)(`lib.prompts.createModulePrompt.errors.invalidLabel`);
|
|
13
12
|
}
|
|
14
13
|
else if (!val.length) {
|
|
15
|
-
return (0, lang_1.i18n)(
|
|
14
|
+
return (0, lang_1.i18n)(`lib.prompts.createModulePrompt.errors.labelRequired`);
|
|
16
15
|
}
|
|
17
16
|
return true;
|
|
18
17
|
},
|
|
@@ -20,13 +19,13 @@ const MODULE_LABEL_PROMPT = {
|
|
|
20
19
|
const REACT_TYPE_PROMPT = {
|
|
21
20
|
type: 'confirm',
|
|
22
21
|
name: 'reactType',
|
|
23
|
-
message: (0, lang_1.i18n)(
|
|
22
|
+
message: (0, lang_1.i18n)(`lib.prompts.createModulePrompt.selectReactType`),
|
|
24
23
|
default: false,
|
|
25
24
|
};
|
|
26
25
|
const CONTENT_TYPES_PROMPT = {
|
|
27
26
|
type: 'checkbox',
|
|
28
27
|
name: 'contentTypes',
|
|
29
|
-
message: (0, lang_1.i18n)(
|
|
28
|
+
message: (0, lang_1.i18n)(`lib.prompts.createModulePrompt.selectContentType`),
|
|
30
29
|
default: ['ANY'],
|
|
31
30
|
choices: [
|
|
32
31
|
{ name: 'Any', value: 'ANY' },
|
|
@@ -47,20 +46,20 @@ const CONTENT_TYPES_PROMPT = {
|
|
|
47
46
|
if (input.length > 0) {
|
|
48
47
|
resolve(true);
|
|
49
48
|
}
|
|
50
|
-
reject((0, lang_1.i18n)(
|
|
49
|
+
reject((0, lang_1.i18n)(`lib.prompts.createModulePrompt.errors.contentTypeRequired`));
|
|
51
50
|
});
|
|
52
51
|
},
|
|
53
52
|
};
|
|
54
53
|
const GLOBAL_PROMPT = {
|
|
55
54
|
type: 'confirm',
|
|
56
55
|
name: 'global',
|
|
57
|
-
message: (0, lang_1.i18n)(
|
|
56
|
+
message: (0, lang_1.i18n)(`lib.prompts.createModulePrompt.confirmGlobal`),
|
|
58
57
|
default: false,
|
|
59
58
|
};
|
|
60
59
|
const AVAILABLE_FOR_NEW_CONTENT = {
|
|
61
60
|
type: 'confirm',
|
|
62
61
|
name: 'availableForNewContent',
|
|
63
|
-
message: (0, lang_1.i18n)(
|
|
62
|
+
message: (0, lang_1.i18n)(`lib.prompts.createModulePrompt.availableForNewContent`),
|
|
64
63
|
default: true,
|
|
65
64
|
};
|
|
66
65
|
function createModulePrompt() {
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { ProjectTemplate } from '../../types/Projects';
|
|
2
|
-
type
|
|
2
|
+
type CreateProjectPromptResponseWithTemplate = {
|
|
3
3
|
name: string;
|
|
4
4
|
dest: string;
|
|
5
|
-
projectTemplate
|
|
5
|
+
projectTemplate: ProjectTemplate;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type CreateProjectPromptResponseWithoutTemplate = {
|
|
8
|
+
name: string;
|
|
9
|
+
dest: string;
|
|
10
|
+
projectTemplate?: undefined;
|
|
11
|
+
};
|
|
12
|
+
type PromptOptionsArg = {
|
|
8
13
|
name?: string;
|
|
9
14
|
dest?: string;
|
|
10
15
|
template?: string;
|
|
11
|
-
}
|
|
16
|
+
};
|
|
17
|
+
export declare function createProjectPrompt(promptOptions: PromptOptionsArg, projectTemplates: ProjectTemplate[]): Promise<CreateProjectPromptResponseWithTemplate>;
|
|
18
|
+
export declare function createProjectPrompt(promptOptions: PromptOptionsArg, projectTemplates?: undefined): Promise<CreateProjectPromptResponseWithoutTemplate>;
|
|
12
19
|
export {};
|
|
@@ -10,16 +10,15 @@ const path_2 = require("@hubspot/local-dev-lib/path");
|
|
|
10
10
|
const promptUtils_1 = require("./promptUtils");
|
|
11
11
|
const lang_1 = require("../lang");
|
|
12
12
|
const constants_1 = require("../constants");
|
|
13
|
-
const i18nKey = 'lib.prompts.createProjectPrompt';
|
|
14
13
|
function validateProjectDirectory(input) {
|
|
15
14
|
if (!input) {
|
|
16
|
-
return (0, lang_1.i18n)(
|
|
15
|
+
return (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.errors.destRequired`);
|
|
17
16
|
}
|
|
18
17
|
if (fs_1.default.existsSync(path_1.default.resolve((0, path_2.getCwd)(), path_1.default.join(input, constants_1.PROJECT_CONFIG_FILE)))) {
|
|
19
|
-
return (0, lang_1.i18n)(
|
|
18
|
+
return (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.errors.invalidDest`);
|
|
20
19
|
}
|
|
21
20
|
if (!(0, path_2.isValidPath)(input)) {
|
|
22
|
-
return (0, lang_1.i18n)(
|
|
21
|
+
return (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.errors.invalidCharacters`);
|
|
23
22
|
}
|
|
24
23
|
return true;
|
|
25
24
|
}
|
|
@@ -34,18 +33,18 @@ async function createProjectPrompt(promptOptions, projectTemplates) {
|
|
|
34
33
|
const result = await (0, promptUtils_1.promptUser)([
|
|
35
34
|
{
|
|
36
35
|
name: 'name',
|
|
37
|
-
message: (0, lang_1.i18n)(
|
|
36
|
+
message: (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.enterName`),
|
|
38
37
|
when: !promptOptions.name,
|
|
39
38
|
validate: (input) => {
|
|
40
39
|
if (!input) {
|
|
41
|
-
return (0, lang_1.i18n)(
|
|
40
|
+
return (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.errors.nameRequired`);
|
|
42
41
|
}
|
|
43
42
|
return true;
|
|
44
43
|
},
|
|
45
44
|
},
|
|
46
45
|
{
|
|
47
46
|
name: 'dest',
|
|
48
|
-
message: (0, lang_1.i18n)(
|
|
47
|
+
message: (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.enterDest`),
|
|
49
48
|
when: !promptOptions.dest,
|
|
50
49
|
default: answers => {
|
|
51
50
|
const projectName = (0, path_2.sanitizeFileName)(promptOptions.name || answers.name);
|
|
@@ -60,10 +59,10 @@ async function createProjectPrompt(promptOptions, projectTemplates) {
|
|
|
60
59
|
name: 'projectTemplate',
|
|
61
60
|
message: () => {
|
|
62
61
|
return promptOptions.template && !providedTemplateIsValid
|
|
63
|
-
? (0, lang_1.i18n)(
|
|
62
|
+
? (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.errors.invalidTemplate`, {
|
|
64
63
|
template: promptOptions.template,
|
|
65
64
|
})
|
|
66
|
-
: (0, lang_1.i18n)(
|
|
65
|
+
: (0, lang_1.i18n)(`lib.prompts.createProjectPrompt.selectTemplate`);
|
|
67
66
|
},
|
|
68
67
|
when: createProjectFromTemplate && !providedTemplateIsValid,
|
|
69
68
|
type: 'list',
|
|
@@ -86,5 +85,11 @@ async function createProjectPrompt(promptOptions, projectTemplates) {
|
|
|
86
85
|
if (providedTemplateIsValid) {
|
|
87
86
|
result.projectTemplate = findTemplateByNameOrLabel(projectTemplates, promptOptions.template);
|
|
88
87
|
}
|
|
88
|
+
if (projectTemplates && projectTemplates.length > 0) {
|
|
89
|
+
if (!result.projectTemplate) {
|
|
90
|
+
throw new Error((0, lang_1.i18n)(`lib.prompts.createProjectPrompt.errors.projectTemplateRequired`));
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
89
94
|
return result;
|
|
90
95
|
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createTemplatePrompt = createTemplatePrompt;
|
|
4
4
|
const promptUtils_1 = require("./promptUtils");
|
|
5
5
|
const lang_1 = require("../lang");
|
|
6
|
-
const i18nKey = 'lib.prompts.createTemplatePrompt';
|
|
7
6
|
const templateTypeChoices = [
|
|
8
7
|
{ name: 'page', value: 'page-template' },
|
|
9
8
|
{ name: 'email', value: 'email-template' },
|
|
@@ -16,7 +15,7 @@ const templateTypeChoices = [
|
|
|
16
15
|
const TEMPLATE_TYPE_PROMPT = {
|
|
17
16
|
type: 'list',
|
|
18
17
|
name: 'templateType',
|
|
19
|
-
message: (0, lang_1.i18n)(
|
|
18
|
+
message: (0, lang_1.i18n)(`lib.prompts.createTemplatePrompt.selectTemplate`),
|
|
20
19
|
default: 'page',
|
|
21
20
|
choices: templateTypeChoices,
|
|
22
21
|
};
|
|
@@ -8,14 +8,13 @@ const index_1 = require("../errorHandlers/index");
|
|
|
8
8
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
9
|
const exitCodes_1 = require("../enums/exitCodes");
|
|
10
10
|
const lang_1 = require("../lang");
|
|
11
|
-
const i18nKey = 'lib.prompts.downloadProjectPrompt';
|
|
12
11
|
async function createProjectsList(accountId) {
|
|
13
12
|
try {
|
|
14
13
|
if (accountId) {
|
|
15
14
|
const { data: projects } = await (0, projects_1.fetchProjects)(accountId);
|
|
16
15
|
return projects.results;
|
|
17
16
|
}
|
|
18
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
17
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.prompts.downloadProjectPrompt.errors.accountIdRequired`));
|
|
19
18
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
20
19
|
}
|
|
21
20
|
catch (e) {
|
|
@@ -32,11 +31,11 @@ async function downloadProjectPrompt(promptOptions) {
|
|
|
32
31
|
message: () => {
|
|
33
32
|
return promptOptions.project &&
|
|
34
33
|
!projectsList.find(p => p.name === promptOptions.name)
|
|
35
|
-
? (0, lang_1.i18n)(
|
|
34
|
+
? (0, lang_1.i18n)(`lib.prompts.downloadProjectPrompt.errors.projectNotFound`, {
|
|
36
35
|
projectName: promptOptions.project,
|
|
37
36
|
accountId: accountId || '',
|
|
38
37
|
})
|
|
39
|
-
: (0, lang_1.i18n)(
|
|
38
|
+
: (0, lang_1.i18n)(`lib.prompts.downloadProjectPrompt.selectProject`);
|
|
40
39
|
},
|
|
41
40
|
when: !promptOptions.project ||
|
|
42
41
|
!projectsList.find(p => p.name === promptOptions.project),
|
|
@@ -10,22 +10,23 @@ const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
|
10
10
|
const promptUtils_1 = require("./promptUtils");
|
|
11
11
|
const lang_1 = require("../lang");
|
|
12
12
|
const exitCodes_1 = require("../enums/exitCodes");
|
|
13
|
-
const i18nKey = 'lib.prompts.installPublicAppPrompt';
|
|
14
13
|
async function installPublicAppPrompt(env, targetAccountId, clientId, scopes, redirectUrls, isReinstall = false) {
|
|
15
14
|
logger_1.logger.log('');
|
|
16
15
|
if (isReinstall) {
|
|
17
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
16
|
+
logger_1.logger.log((0, lang_1.i18n)(`lib.prompts.installPublicAppPrompt.reinstallExplanation`));
|
|
18
17
|
}
|
|
19
18
|
else {
|
|
20
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
19
|
+
logger_1.logger.log((0, lang_1.i18n)(`lib.prompts.installPublicAppPrompt.explanation`));
|
|
21
20
|
}
|
|
22
21
|
const { shouldOpenBrowser } = await (0, promptUtils_1.promptUser)({
|
|
23
22
|
name: 'shouldOpenBrowser',
|
|
24
23
|
type: 'confirm',
|
|
25
|
-
message: (0, lang_1.i18n)(isReinstall
|
|
24
|
+
message: (0, lang_1.i18n)(isReinstall
|
|
25
|
+
? `lib.prompts.installPublicAppPrompt.reinstallPrompt`
|
|
26
|
+
: `lib.prompts.installPublicAppPrompt.prompt`),
|
|
26
27
|
});
|
|
27
28
|
if (!isReinstall && !shouldOpenBrowser) {
|
|
28
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
29
|
+
logger_1.logger.log((0, lang_1.i18n)(`lib.prompts.installPublicAppPrompt.decline`));
|
|
29
30
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
30
31
|
}
|
|
31
32
|
else if (!shouldOpenBrowser) {
|