@hubspot/cli 5.2.1-beta.0 → 5.2.1-beta.10
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 +7 -2
- package/bin/hs +1 -1
- package/commands/accounts/clean.js +8 -8
- package/commands/accounts/info.js +3 -3
- package/commands/accounts/list.js +14 -13
- package/commands/accounts/remove.js +1 -1
- package/commands/accounts/rename.js +3 -3
- package/commands/accounts/use.js +1 -1
- package/commands/accounts.js +3 -3
- package/commands/auth.js +7 -9
- package/commands/cms/convertFields.js +1 -1
- package/commands/cms/lighthouseScore.js +4 -4
- package/commands/cms/reactModules.js +1 -1
- package/commands/cms.js +3 -3
- package/commands/config/set/allowUsageTracking.js +1 -2
- package/commands/config/set/defaultMode.js +1 -1
- package/commands/config/set/httpTimeout.js +1 -1
- package/commands/config/set.js +1 -1
- package/commands/config.js +3 -3
- package/commands/create/api-sample.js +1 -1
- package/commands/create/module.js +1 -1
- package/commands/create/template.js +1 -1
- package/commands/create.js +1 -1
- package/commands/customObject/create.js +1 -1
- package/commands/customObject/schema/create.js +2 -3
- package/commands/customObject/schema/delete.js +1 -2
- package/commands/customObject/schema/fetch-all.js +1 -2
- package/commands/customObject/schema/fetch.js +1 -2
- package/commands/customObject/schema/list.js +1 -1
- package/commands/customObject/schema/update.js +2 -3
- package/commands/customObject/schema.js +1 -1
- package/commands/customObject.js +3 -3
- package/commands/feedback.js +4 -6
- package/commands/fetch.js +6 -6
- package/commands/filemanager/fetch.js +4 -4
- package/commands/filemanager/upload.js +4 -4
- package/commands/filemanager.js +4 -4
- package/commands/functions/deploy.js +7 -23
- package/commands/functions/list.js +4 -4
- package/commands/functions/server.js +4 -4
- package/commands/functions.js +3 -3
- package/commands/hubdb/clear.js +4 -4
- package/commands/hubdb/create.js +4 -4
- package/commands/hubdb/delete.js +4 -4
- package/commands/hubdb/fetch.js +4 -4
- package/commands/hubdb.js +3 -3
- package/commands/init.js +6 -8
- package/commands/lint.js +3 -3
- package/commands/list.js +4 -4
- package/commands/logs.js +4 -4
- package/commands/module/marketplace-validate.js +5 -5
- package/commands/module.js +3 -3
- package/commands/mv.js +4 -4
- package/commands/open.js +4 -4
- package/commands/project/add.js +1 -1
- package/commands/project/create.js +4 -4
- package/commands/project/deploy.js +4 -4
- package/commands/project/dev.js +139 -264
- package/commands/project/download.js +11 -7
- package/commands/project/listBuilds.js +4 -4
- package/commands/project/logs.js +4 -4
- package/commands/project/migrateApp.js +227 -0
- package/commands/project/open.js +12 -8
- package/commands/project/upload.js +15 -7
- package/commands/project/watch.js +4 -4
- package/commands/project.js +5 -3
- package/commands/remove.js +4 -4
- package/commands/sandbox/create.js +16 -16
- package/commands/sandbox/delete.js +5 -5
- package/commands/sandbox/sync.js +11 -9
- package/commands/sandbox.js +3 -3
- package/commands/secrets/addSecret.js +4 -4
- package/commands/secrets/deleteSecret.js +4 -4
- package/commands/secrets/listSecrets.js +4 -4
- package/commands/secrets/updateSecret.js +4 -4
- package/commands/secrets.js +3 -3
- package/commands/theme/generate-selectors.js +1 -1
- package/commands/theme/marketplace-validate.js +5 -5
- package/commands/theme/preview.js +52 -17
- package/commands/theme.js +1 -1
- package/commands/upload.js +5 -5
- package/commands/watch.js +61 -18
- package/jest.config.js +1 -0
- package/lang/en.lyaml +1426 -1336
- package/lib/DevServerManager.js +3 -2
- package/lib/LocalDevManager.js +194 -38
- package/lib/__tests__/{commonOpts.js → commonOpts.test.js} +3 -0
- package/lib/__tests__/downloadProjectPrompt.test.js +31 -0
- package/lib/__tests__/projects.test.js +13 -17
- package/lib/__tests__/{serverlessLogs.js → serverlessLogs.test.js} +1 -0
- package/lib/accountTypes.js +34 -0
- package/lib/buildAccount.js +197 -0
- package/lib/commonOpts.js +1 -1
- package/lib/constants.js +10 -0
- package/lib/developerTestAccounts.js +98 -4
- package/lib/errorHandlers/apiErrors.js +1 -1
- package/lib/errorHandlers/overrideErrors.js +1 -1
- package/lib/errorHandlers/standardErrors.js +1 -1
- package/lib/generate-selectors.js +1 -1
- package/lib/localDev.js +451 -0
- package/lib/marketplace-validate.js +11 -3
- package/lib/polling.js +26 -0
- package/lib/process.js +1 -1
- package/lib/projectStructure.js +12 -2
- package/lib/projects.js +99 -10
- package/lib/projectsWatch.js +1 -1
- package/lib/prompts/accountNamePrompt.js +81 -0
- package/lib/prompts/accountsPrompt.js +1 -1
- package/lib/prompts/activeInstallConfirmationPrompt.js +20 -0
- package/lib/prompts/buildIdPrompt.js +1 -1
- package/lib/prompts/cleanUploadPrompt.js +1 -1
- package/lib/prompts/cmsFieldPrompt.js +1 -1
- package/lib/prompts/createApiSamplePrompt.js +1 -1
- package/lib/prompts/createFunctionPrompt.js +1 -1
- package/lib/prompts/createModulePrompt.js +1 -1
- package/lib/prompts/createProjectPrompt.js +32 -10
- package/lib/prompts/createTemplatePrompt.js +1 -1
- package/lib/prompts/downloadProjectPrompt.js +5 -6
- package/lib/prompts/feedbackPrompt.js +1 -1
- package/lib/prompts/folderOverwritePrompt.js +1 -1
- package/lib/prompts/installPublicAppPrompt.js +42 -0
- package/lib/prompts/personalAccessKeyPrompt.js +3 -3
- package/lib/prompts/previewPrompt.js +19 -1
- package/lib/prompts/projectAddPrompt.js +1 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +127 -14
- package/lib/prompts/projectNamePrompt.js +2 -2
- package/lib/prompts/projectsLogsPrompt.js +1 -1
- package/lib/prompts/sandboxesPrompt.js +14 -43
- package/lib/prompts/secretPrompt.js +1 -1
- package/lib/prompts/selectPublicAppPrompt.js +69 -0
- package/lib/prompts/setAsDefaultAccountPrompt.js +1 -1
- package/lib/prompts/uploadPrompt.js +1 -1
- package/lib/sandboxSync.js +2 -2
- package/lib/sandboxes.js +168 -30
- package/lib/ui/git.js +1 -1
- package/lib/ui/index.js +5 -14
- package/lib/ui/serverlessFunctionLogs.js +1 -1
- package/package.json +6 -6
- package/lib/prompts/enterAccountNamePrompt.js +0 -33
- package/lib/sandboxCreate.js +0 -319
- /package/lib/__tests__/{validation.js → validation.test.js} +0 -0
package/bin/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ const updateNotifier = require('update-notifier');
|
|
|
5
5
|
const chalk = require('chalk');
|
|
6
6
|
|
|
7
7
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
8
|
+
const { addUserAgentHeader } = require('@hubspot/local-dev-lib/http');
|
|
8
9
|
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
|
|
9
10
|
const { setLogLevel, getCommandName } = require('../lib/commonOpts');
|
|
10
11
|
const {
|
|
@@ -48,7 +49,7 @@ const notifier = updateNotifier({
|
|
|
48
49
|
shouldNotifyInNpmScript: true,
|
|
49
50
|
});
|
|
50
51
|
|
|
51
|
-
const i18nKey = '
|
|
52
|
+
const i18nKey = 'commands.generalErrors';
|
|
52
53
|
|
|
53
54
|
const CLI_UPGRADE_MESSAGE =
|
|
54
55
|
chalk.bold('The CMS CLI is now the HubSpot CLI') +
|
|
@@ -110,9 +111,13 @@ const performChecks = argv => {
|
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
|
|
114
|
+
const setRequestHeaders = () => {
|
|
115
|
+
addUserAgentHeader('HubSpot CLI', pkg.version);
|
|
116
|
+
};
|
|
117
|
+
|
|
113
118
|
const argv = yargs
|
|
114
119
|
.usage('The command line interface to interact with HubSpot.')
|
|
115
|
-
.middleware([setLogLevel])
|
|
120
|
+
.middleware([setLogLevel, setRequestHeaders])
|
|
116
121
|
.exitProcess(false)
|
|
117
122
|
.fail(handleFailure)
|
|
118
123
|
.option('debug', {
|
package/bin/hs
CHANGED
|
@@ -13,7 +13,6 @@ const {
|
|
|
13
13
|
addUseEnvironmentOptions,
|
|
14
14
|
addTestingOptions,
|
|
15
15
|
} = require('../../lib/commonOpts');
|
|
16
|
-
const { getAccountName } = require('../../lib/sandboxes');
|
|
17
16
|
const { promptUser } = require('../../lib/prompts/promptUtils');
|
|
18
17
|
const { getTableContents } = require('../../lib/ui/table');
|
|
19
18
|
const SpinniesManager = require('../../lib/ui/SpinniesManager');
|
|
@@ -21,8 +20,9 @@ const { getConfig, deleteAccount } = require('@hubspot/local-dev-lib/config');
|
|
|
21
20
|
const {
|
|
22
21
|
isSpecifiedHubSpotAuthError,
|
|
23
22
|
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
23
|
+
const { uiAccountDescription } = require('../../lib/ui');
|
|
24
24
|
|
|
25
|
-
const i18nKey = '
|
|
25
|
+
const i18nKey = 'commands.accounts.subcommands.clean';
|
|
26
26
|
|
|
27
27
|
exports.command = 'clean';
|
|
28
28
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -87,7 +87,7 @@ exports.handler = async options => {
|
|
|
87
87
|
});
|
|
88
88
|
logger.log(
|
|
89
89
|
getTableContents(
|
|
90
|
-
accountsToRemove.map(p => [
|
|
90
|
+
accountsToRemove.map(p => [uiAccountDescription(p.portalId)]),
|
|
91
91
|
{ border: { bodyLeft: ' ' } }
|
|
92
92
|
)
|
|
93
93
|
);
|
|
@@ -111,7 +111,7 @@ exports.handler = async options => {
|
|
|
111
111
|
await deleteAccount(accountToRemove.name);
|
|
112
112
|
logger.log(
|
|
113
113
|
i18n(`${i18nKey}.removeSuccess`, {
|
|
114
|
-
accountName:
|
|
114
|
+
accountName: accountToRemove.name,
|
|
115
115
|
})
|
|
116
116
|
);
|
|
117
117
|
}
|
|
@@ -127,10 +127,10 @@ exports.handler = async options => {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
exports.builder = yargs => {
|
|
130
|
-
addConfigOptions(yargs
|
|
131
|
-
addAccountOptions(yargs
|
|
132
|
-
addUseEnvironmentOptions(yargs
|
|
133
|
-
addTestingOptions(yargs
|
|
130
|
+
addConfigOptions(yargs);
|
|
131
|
+
addAccountOptions(yargs);
|
|
132
|
+
addUseEnvironmentOptions(yargs);
|
|
133
|
+
addTestingOptions(yargs);
|
|
134
134
|
|
|
135
135
|
yargs.example([['$0 accounts clean']]);
|
|
136
136
|
|
|
@@ -10,7 +10,7 @@ const { loadAndValidateOptions } = require('../../lib/validation');
|
|
|
10
10
|
const { i18n } = require('../../lib/lang');
|
|
11
11
|
const { getTableContents } = require('../../lib/ui/table');
|
|
12
12
|
|
|
13
|
-
const i18nKey = '
|
|
13
|
+
const i18nKey = 'commands.accounts.subcommands.info';
|
|
14
14
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
15
15
|
|
|
16
16
|
exports.command = 'info [--account]';
|
|
@@ -39,8 +39,8 @@ exports.handler = async options => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
exports.builder = yargs => {
|
|
42
|
-
addConfigOptions(yargs
|
|
43
|
-
addAccountOptions(yargs
|
|
42
|
+
addConfigOptions(yargs);
|
|
43
|
+
addAccountOptions(yargs);
|
|
44
44
|
|
|
45
45
|
yargs.example([
|
|
46
46
|
['$0 accounts info', i18n(`${i18nKey}.examples.default`)],
|
|
@@ -9,15 +9,15 @@ const {
|
|
|
9
9
|
} = require('../../lib/commonOpts');
|
|
10
10
|
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
11
11
|
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
12
|
-
const { isSandbox,
|
|
13
|
-
|
|
12
|
+
const { isSandbox, isDeveloperTestAccount } = require('../../lib/accountTypes');
|
|
13
|
+
|
|
14
14
|
const { i18n } = require('../../lib/lang');
|
|
15
15
|
const {
|
|
16
16
|
HUBSPOT_ACCOUNT_TYPES,
|
|
17
17
|
HUBSPOT_ACCOUNT_TYPE_STRINGS,
|
|
18
18
|
} = require('@hubspot/local-dev-lib/constants/config');
|
|
19
19
|
|
|
20
|
-
const i18nKey = '
|
|
20
|
+
const i18nKey = 'commands.accounts.subcommands.list';
|
|
21
21
|
|
|
22
22
|
exports.command = 'list';
|
|
23
23
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -53,19 +53,20 @@ const sortAndMapPortals = portals => {
|
|
|
53
53
|
|
|
54
54
|
const getPortalData = mappedPortalData => {
|
|
55
55
|
const portalData = [];
|
|
56
|
-
Object.
|
|
56
|
+
Object.entries(mappedPortalData).forEach(([key, set]) => {
|
|
57
|
+
const hasParentPortal = set.filter(
|
|
58
|
+
p => p.portalId === parseInt(key, 10)
|
|
59
|
+
)[0];
|
|
57
60
|
set.forEach(portal => {
|
|
58
|
-
let name = portal.name
|
|
61
|
+
let name = `${portal.name} [${
|
|
62
|
+
HUBSPOT_ACCOUNT_TYPE_STRINGS[portal.accountType]
|
|
63
|
+
}]`;
|
|
59
64
|
if (isSandbox(portal)) {
|
|
60
|
-
|
|
61
|
-
if (set.length > 1) {
|
|
65
|
+
if (hasParentPortal && set.length > 1) {
|
|
62
66
|
name = `↳ ${name}`;
|
|
63
67
|
}
|
|
64
68
|
} else if (isDeveloperTestAccount(portal)) {
|
|
65
|
-
|
|
66
|
-
HUBSPOT_ACCOUNT_TYPE_STRINGS[HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST]
|
|
67
|
-
}]`;
|
|
68
|
-
if (set.length > 1) {
|
|
69
|
+
if (hasParentPortal && set.length > 1) {
|
|
69
70
|
name = `↳ ${name}`;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -103,8 +104,8 @@ exports.handler = async options => {
|
|
|
103
104
|
};
|
|
104
105
|
|
|
105
106
|
exports.builder = yargs => {
|
|
106
|
-
addConfigOptions(yargs
|
|
107
|
-
addAccountOptions(yargs
|
|
107
|
+
addConfigOptions(yargs);
|
|
108
|
+
addAccountOptions(yargs);
|
|
108
109
|
|
|
109
110
|
yargs.example([['$0 accounts list']]);
|
|
110
111
|
|
|
@@ -13,7 +13,7 @@ const { i18n } = require('../../lib/lang');
|
|
|
13
13
|
const { selectAccountFromConfig } = require('../../lib/prompts/accountsPrompt');
|
|
14
14
|
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
15
15
|
|
|
16
|
-
const i18nKey = '
|
|
16
|
+
const i18nKey = 'commands.accounts.subcommands.remove';
|
|
17
17
|
|
|
18
18
|
exports.command = 'remove [--account]';
|
|
19
19
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -10,7 +10,7 @@ const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
|
10
10
|
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
11
11
|
const { i18n } = require('../../lib/lang');
|
|
12
12
|
|
|
13
|
-
const i18nKey = '
|
|
13
|
+
const i18nKey = 'commands.accounts.subcommands.rename';
|
|
14
14
|
|
|
15
15
|
exports.command = 'rename <accountName> <newName>';
|
|
16
16
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -34,8 +34,8 @@ exports.handler = async options => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
exports.builder = yargs => {
|
|
37
|
-
addConfigOptions(yargs
|
|
38
|
-
addAccountOptions(yargs
|
|
37
|
+
addConfigOptions(yargs);
|
|
38
|
+
addAccountOptions(yargs);
|
|
39
39
|
|
|
40
40
|
yargs.positional('accountName', {
|
|
41
41
|
describe: i18n(`${i18nKey}.positionals.accountName.describe`),
|
package/commands/accounts/use.js
CHANGED
|
@@ -11,7 +11,7 @@ const { i18n } = require('../../lib/lang');
|
|
|
11
11
|
const { selectAccountFromConfig } = require('../../lib/prompts/accountsPrompt');
|
|
12
12
|
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
13
13
|
|
|
14
|
-
const i18nKey = '
|
|
14
|
+
const i18nKey = 'commands.accounts.subcommands.use';
|
|
15
15
|
|
|
16
16
|
exports.command = 'use [--account]';
|
|
17
17
|
exports.describe = i18n(`${i18nKey}.describe`);
|
package/commands/accounts.js
CHANGED
|
@@ -7,14 +7,14 @@ const info = require('./accounts/info');
|
|
|
7
7
|
const remove = require('./accounts/remove');
|
|
8
8
|
const clean = require('./accounts/clean');
|
|
9
9
|
|
|
10
|
-
const i18nKey = '
|
|
10
|
+
const i18nKey = 'commands.accounts';
|
|
11
11
|
|
|
12
12
|
exports.command = 'accounts';
|
|
13
13
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
14
14
|
|
|
15
15
|
exports.builder = yargs => {
|
|
16
|
-
addConfigOptions(yargs
|
|
17
|
-
addAccountOptions(yargs
|
|
16
|
+
addConfigOptions(yargs);
|
|
17
|
+
addAccountOptions(yargs);
|
|
18
18
|
|
|
19
19
|
yargs
|
|
20
20
|
.command({
|
package/commands/auth.js
CHANGED
|
@@ -31,9 +31,7 @@ const {
|
|
|
31
31
|
personalAccessKeyPrompt,
|
|
32
32
|
OAUTH_FLOW,
|
|
33
33
|
} = require('../lib/prompts/personalAccessKeyPrompt');
|
|
34
|
-
const {
|
|
35
|
-
enterAccountNamePrompt,
|
|
36
|
-
} = require('../lib/prompts/enterAccountNamePrompt');
|
|
34
|
+
const { cliAccountNamePrompt } = require('../lib/prompts/accountNamePrompt');
|
|
37
35
|
const {
|
|
38
36
|
setAsDefaultAccountPrompt,
|
|
39
37
|
} = require('../lib/prompts/setAsDefaultAccountPrompt');
|
|
@@ -50,7 +48,7 @@ const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
|
50
48
|
const { uiFeatureHighlight } = require('../lib/ui');
|
|
51
49
|
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
|
|
52
50
|
|
|
53
|
-
const i18nKey = '
|
|
51
|
+
const i18nKey = 'commands.auth';
|
|
54
52
|
|
|
55
53
|
const TRACKING_STATUS = {
|
|
56
54
|
STARTED: 'started',
|
|
@@ -129,7 +127,7 @@ exports.handler = async options => {
|
|
|
129
127
|
validName = updatedConfig.name;
|
|
130
128
|
|
|
131
129
|
if (!validName) {
|
|
132
|
-
const { name: namePrompt } = await
|
|
130
|
+
const { name: namePrompt } = await cliAccountNamePrompt(defaultName);
|
|
133
131
|
validName = namePrompt;
|
|
134
132
|
}
|
|
135
133
|
|
|
@@ -166,14 +164,14 @@ exports.handler = async options => {
|
|
|
166
164
|
logger.log('');
|
|
167
165
|
if (setAsDefault) {
|
|
168
166
|
logger.success(
|
|
169
|
-
i18n(`
|
|
167
|
+
i18n(`lib.prompts.setAsDefaultAccountPrompt.setAsDefaultAccount`, {
|
|
170
168
|
accountName,
|
|
171
169
|
})
|
|
172
170
|
);
|
|
173
171
|
} else {
|
|
174
172
|
const config = getConfig();
|
|
175
173
|
logger.info(
|
|
176
|
-
i18n(`
|
|
174
|
+
i18n(`lib.prompts.setAsDefaultAccountPrompt.keepingCurrentDefault`, {
|
|
177
175
|
accountName: config.defaultPortal,
|
|
178
176
|
})
|
|
179
177
|
);
|
|
@@ -218,8 +216,8 @@ exports.builder = yargs => {
|
|
|
218
216
|
},
|
|
219
217
|
});
|
|
220
218
|
|
|
221
|
-
addConfigOptions(yargs
|
|
222
|
-
addTestingOptions(yargs
|
|
219
|
+
addConfigOptions(yargs);
|
|
220
|
+
addTestingOptions(yargs);
|
|
223
221
|
|
|
224
222
|
return yargs;
|
|
225
223
|
};
|
|
@@ -13,7 +13,7 @@ const {
|
|
|
13
13
|
|
|
14
14
|
const { trackConvertFieldsUsage } = require('../../lib/usageTracking');
|
|
15
15
|
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
16
|
-
const i18nKey = '
|
|
16
|
+
const i18nKey = 'commands.convertFields';
|
|
17
17
|
|
|
18
18
|
exports.command = 'convert-fields';
|
|
19
19
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -20,7 +20,7 @@ const { HUBSPOT_FOLDER, MARKETPLACE_FOLDER } = require('../../lib/constants');
|
|
|
20
20
|
const { uiLink } = require('../../lib/ui');
|
|
21
21
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
22
22
|
|
|
23
|
-
const i18nKey = '
|
|
23
|
+
const i18nKey = 'commands.cms.subcommands.lighthouseScore';
|
|
24
24
|
|
|
25
25
|
const DEFAULT_TABLE_HEADER = [
|
|
26
26
|
'Accessibility',
|
|
@@ -310,9 +310,9 @@ exports.builder = yargs => {
|
|
|
310
310
|
],
|
|
311
311
|
]);
|
|
312
312
|
|
|
313
|
-
addConfigOptions(yargs
|
|
314
|
-
addAccountOptions(yargs
|
|
315
|
-
addUseEnvironmentOptions(yargs
|
|
313
|
+
addConfigOptions(yargs);
|
|
314
|
+
addAccountOptions(yargs);
|
|
315
|
+
addUseEnvironmentOptions(yargs);
|
|
316
316
|
|
|
317
317
|
return yargs;
|
|
318
318
|
};
|
|
@@ -5,7 +5,7 @@ const { i18n } = require('../../lib/lang');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
7
7
|
|
|
8
|
-
const i18nKey = '
|
|
8
|
+
const i18nKey = 'commands.cms.subcommands.reactModule';
|
|
9
9
|
|
|
10
10
|
exports.command = 'get-react-module [--name] [--dest]';
|
|
11
11
|
exports.describe = i18n(`${i18nKey}.describe`);
|
package/commands/cms.js
CHANGED
|
@@ -4,14 +4,14 @@ const lighthouseScore = require('./cms/lighthouseScore');
|
|
|
4
4
|
const convertFields = require('./cms/convertFields');
|
|
5
5
|
const reactModules = require('./cms/reactModules');
|
|
6
6
|
|
|
7
|
-
const i18nKey = '
|
|
7
|
+
const i18nKey = 'commands.cms';
|
|
8
8
|
|
|
9
9
|
exports.command = 'cms';
|
|
10
10
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
11
11
|
|
|
12
12
|
exports.builder = yargs => {
|
|
13
|
-
addConfigOptions(yargs
|
|
14
|
-
addAccountOptions(yargs
|
|
13
|
+
addConfigOptions(yargs);
|
|
14
|
+
addAccountOptions(yargs);
|
|
15
15
|
|
|
16
16
|
yargs
|
|
17
17
|
.command(lighthouseScore)
|
|
@@ -4,8 +4,7 @@ const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
|
4
4
|
const { promptUser } = require('../../../lib/prompts/promptUtils');
|
|
5
5
|
const { i18n } = require('../../../lib/lang');
|
|
6
6
|
|
|
7
|
-
const i18nKey =
|
|
8
|
-
'cli.commands.config.subcommands.set.options.allowUsageTracking';
|
|
7
|
+
const i18nKey = 'commands.config.subcommands.set.options.allowUsageTracking';
|
|
9
8
|
|
|
10
9
|
const enableOrDisableUsageTracking = async () => {
|
|
11
10
|
const { isEnabled } = await promptUser([
|
|
@@ -6,7 +6,7 @@ const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
|
6
6
|
const { promptUser } = require('../../../lib/prompts/promptUtils');
|
|
7
7
|
const { i18n } = require('../../../lib/lang');
|
|
8
8
|
|
|
9
|
-
const i18nKey = '
|
|
9
|
+
const i18nKey = 'commands.config.subcommands.set.options.defaultMode';
|
|
10
10
|
|
|
11
11
|
const ALL_MODES = Object.values(MODE);
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ const { promptUser } = require('../../../lib/prompts/promptUtils');
|
|
|
4
4
|
const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
5
5
|
const { i18n } = require('../../../lib/lang');
|
|
6
6
|
|
|
7
|
-
const i18nKey = '
|
|
7
|
+
const i18nKey = 'commands.config.subcommands.set.options.httpTimeout';
|
|
8
8
|
|
|
9
9
|
const enterTimeout = async () => {
|
|
10
10
|
const { timeout } = await promptUser([
|
package/commands/config/set.js
CHANGED
|
@@ -8,7 +8,7 @@ const { setDefaultMode } = require('./set/defaultMode');
|
|
|
8
8
|
const { setHttpTimeout } = require('./set/httpTimeout');
|
|
9
9
|
const { setAllowUsageTracking } = require('./set/allowUsageTracking');
|
|
10
10
|
|
|
11
|
-
const i18nKey = '
|
|
11
|
+
const i18nKey = 'commands.config.subcommands.set';
|
|
12
12
|
|
|
13
13
|
exports.command = 'set';
|
|
14
14
|
exports.describe = i18n(`${i18nKey}.describe`);
|
package/commands/config.js
CHANGED
|
@@ -2,14 +2,14 @@ const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
|
|
|
2
2
|
const { i18n } = require('../lib/lang');
|
|
3
3
|
const set = require('./config/set');
|
|
4
4
|
|
|
5
|
-
const i18nKey = '
|
|
5
|
+
const i18nKey = 'commands.config';
|
|
6
6
|
|
|
7
7
|
exports.command = 'config';
|
|
8
8
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
9
9
|
|
|
10
10
|
exports.builder = yargs => {
|
|
11
|
-
addConfigOptions(yargs
|
|
12
|
-
addAccountOptions(yargs
|
|
11
|
+
addConfigOptions(yargs);
|
|
12
|
+
addAccountOptions(yargs);
|
|
13
13
|
|
|
14
14
|
yargs.command(set).demandCommand(1, '');
|
|
15
15
|
|
|
@@ -14,7 +14,7 @@ const {
|
|
|
14
14
|
} = require('@hubspot/local-dev-lib/github');
|
|
15
15
|
const { i18n } = require('../../lib/lang');
|
|
16
16
|
|
|
17
|
-
const i18nKey = '
|
|
17
|
+
const i18nKey = 'commands.create.subcommands.apiSample';
|
|
18
18
|
|
|
19
19
|
module.exports = {
|
|
20
20
|
hidden: true,
|
|
@@ -5,7 +5,7 @@ const { createModulePrompt } = require('../../lib/prompts/createModulePrompt');
|
|
|
5
5
|
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
6
6
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
7
7
|
|
|
8
|
-
const i18nKey = '
|
|
8
|
+
const i18nKey = 'commands.create.subcommands.module';
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
dest: ({ dest }) => dest,
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
const { i18n } = require('../../lib/lang');
|
|
8
8
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
9
9
|
|
|
10
|
-
const i18nKey = '
|
|
10
|
+
const i18nKey = 'commands.create.subcommands.template';
|
|
11
11
|
|
|
12
12
|
module.exports = {
|
|
13
13
|
dest: ({ dest }) => dest,
|
package/commands/create.js
CHANGED
|
@@ -34,7 +34,7 @@ const { trackCommandUsage } = require('../lib/usageTracking');
|
|
|
34
34
|
const assets = require('./create/index');
|
|
35
35
|
const { i18n } = require('../lib/lang');
|
|
36
36
|
|
|
37
|
-
const i18nKey = '
|
|
37
|
+
const i18nKey = 'commands.create';
|
|
38
38
|
|
|
39
39
|
const SUPPORTED_ASSET_TYPES = Object.keys(assets)
|
|
40
40
|
.filter(t => !assets[t].hidden)
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
} = require('@hubspot/local-dev-lib/api/customObjects');
|
|
13
13
|
const { i18n } = require('../../lib/lang');
|
|
14
14
|
|
|
15
|
-
const i18nKey = '
|
|
15
|
+
const i18nKey = 'commands.customObject.subcommands.create';
|
|
16
16
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
17
17
|
|
|
18
18
|
exports.command = 'create <name> <definition>';
|
|
@@ -24,8 +24,7 @@ const {
|
|
|
24
24
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
|
25
25
|
const { i18n } = require('../../../lib/lang');
|
|
26
26
|
|
|
27
|
-
const i18nKey =
|
|
28
|
-
'cli.commands.customObject.subcommands.schema.subcommands.create';
|
|
27
|
+
const i18nKey = 'commands.customObject.subcommands.schema.subcommands.create';
|
|
29
28
|
const { EXIT_CODES } = require('../../../lib/enums/exitCodes');
|
|
30
29
|
|
|
31
30
|
exports.command = 'create <definition>';
|
|
@@ -75,7 +74,7 @@ exports.handler = async options => {
|
|
|
75
74
|
};
|
|
76
75
|
|
|
77
76
|
exports.builder = yargs => {
|
|
78
|
-
addTestingOptions(yargs
|
|
77
|
+
addTestingOptions(yargs);
|
|
79
78
|
|
|
80
79
|
yargs.positional('definition', {
|
|
81
80
|
describe: i18n(`${i18nKey}.positionals.definition.describe`),
|
|
@@ -9,8 +9,7 @@ const {
|
|
|
9
9
|
} = require('@hubspot/local-dev-lib/api/customObjects');
|
|
10
10
|
const { i18n } = require('../../../lib/lang');
|
|
11
11
|
|
|
12
|
-
const i18nKey =
|
|
13
|
-
'cli.commands.customObject.subcommands.schema.subcommands.delete';
|
|
12
|
+
const i18nKey = 'commands.customObject.subcommands.schema.subcommands.delete';
|
|
14
13
|
|
|
15
14
|
exports.command = 'delete <name>';
|
|
16
15
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -13,8 +13,7 @@ const {
|
|
|
13
13
|
const { i18n } = require('../../../lib/lang');
|
|
14
14
|
const { logSchemas } = require('../../../lib/schema');
|
|
15
15
|
|
|
16
|
-
const i18nKey =
|
|
17
|
-
'cli.commands.customObject.subcommands.schema.subcommands.fetchAll';
|
|
16
|
+
const i18nKey = 'commands.customObject.subcommands.schema.subcommands.fetchAll';
|
|
18
17
|
|
|
19
18
|
exports.command = 'fetch-all [dest]';
|
|
20
19
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -17,8 +17,7 @@ const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
|
17
17
|
const { getAccountId } = require('../../../lib/commonOpts');
|
|
18
18
|
const { i18n } = require('../../../lib/lang');
|
|
19
19
|
|
|
20
|
-
const i18nKey =
|
|
21
|
-
'cli.commands.customObject.subcommands.schema.subcommands.fetch';
|
|
20
|
+
const i18nKey = 'commands.customObject.subcommands.schema.subcommands.fetch';
|
|
22
21
|
|
|
23
22
|
exports.command = 'fetch <name> [dest]';
|
|
24
23
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -9,7 +9,7 @@ const { getAccountId } = require('../../../lib/commonOpts');
|
|
|
9
9
|
const { listSchemas } = require('../../../lib/schema');
|
|
10
10
|
const { i18n } = require('../../../lib/lang');
|
|
11
11
|
|
|
12
|
-
const i18nKey = '
|
|
12
|
+
const i18nKey = 'commands.customObject.subcommands.schema.subcommands.list';
|
|
13
13
|
|
|
14
14
|
exports.command = 'list';
|
|
15
15
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -24,8 +24,7 @@ const {
|
|
|
24
24
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
|
25
25
|
const { i18n } = require('../../../lib/lang');
|
|
26
26
|
|
|
27
|
-
const i18nKey =
|
|
28
|
-
'cli.commands.customObject.subcommands.schema.subcommands.update';
|
|
27
|
+
const i18nKey = 'commands.customObject.subcommands.schema.subcommands.update';
|
|
29
28
|
const { EXIT_CODES } = require('../../../lib/enums/exitCodes');
|
|
30
29
|
|
|
31
30
|
exports.command = 'update <name> <definition>';
|
|
@@ -75,7 +74,7 @@ exports.handler = async options => {
|
|
|
75
74
|
};
|
|
76
75
|
|
|
77
76
|
exports.builder = yargs => {
|
|
78
|
-
addTestingOptions(yargs
|
|
77
|
+
addTestingOptions(yargs);
|
|
79
78
|
|
|
80
79
|
yargs.positional('name', {
|
|
81
80
|
describe: i18n(`${i18nKey}.positionals.name.describe`),
|
|
@@ -6,7 +6,7 @@ const listCommand = require('./schema/list');
|
|
|
6
6
|
const updateSchema = require('./schema/update');
|
|
7
7
|
const { i18n } = require('../../lib/lang');
|
|
8
8
|
|
|
9
|
-
const i18nKey = '
|
|
9
|
+
const i18nKey = 'commands.customObject.subcommands.schema';
|
|
10
10
|
|
|
11
11
|
exports.command = 'schema';
|
|
12
12
|
exports.describe = i18n(`${i18nKey}.describe`);
|
package/commands/customObject.js
CHANGED
|
@@ -5,7 +5,7 @@ const { i18n } = require('../lib/lang');
|
|
|
5
5
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
6
6
|
const { uiBetaTag, uiLink } = require('../lib/ui');
|
|
7
7
|
|
|
8
|
-
const i18nKey = '
|
|
8
|
+
const i18nKey = 'commands.customObject';
|
|
9
9
|
|
|
10
10
|
exports.command = ['custom-object', 'custom', 'co'];
|
|
11
11
|
exports.describe = uiBetaTag(i18n(`${i18nKey}.describe`), false);
|
|
@@ -22,8 +22,8 @@ const logBetaMessage = () => {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
exports.builder = yargs => {
|
|
25
|
-
addConfigOptions(yargs
|
|
26
|
-
addAccountOptions(yargs
|
|
25
|
+
addConfigOptions(yargs);
|
|
26
|
+
addAccountOptions(yargs);
|
|
27
27
|
|
|
28
28
|
yargs
|
|
29
29
|
.middleware([logBetaMessage])
|
package/commands/feedback.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const open = require('open');
|
|
2
2
|
|
|
3
3
|
const { i18n } = require('../lib/lang');
|
|
4
|
-
const {
|
|
4
|
+
const { FEEDBACK_URLS } = require('../lib/constants');
|
|
5
5
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -9,7 +9,7 @@ const {
|
|
|
9
9
|
shouldOpenBrowserPrompt,
|
|
10
10
|
} = require('../lib/prompts/feedbackPrompt');
|
|
11
11
|
|
|
12
|
-
const i18nKey = '
|
|
12
|
+
const i18nKey = 'commands.project.subcommands.feedback';
|
|
13
13
|
|
|
14
14
|
exports.command = 'feedback';
|
|
15
15
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -22,10 +22,8 @@ exports.handler = async options => {
|
|
|
22
22
|
const { shouldOpen } = await shouldOpenBrowserPrompt(type, usedTypeFlag);
|
|
23
23
|
|
|
24
24
|
if (shouldOpen || usedTypeFlag) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
? FEEDBACK_URLS.BUG
|
|
28
|
-
: FEEDBACK_URLS.GENERAL;
|
|
25
|
+
// NOTE: for now, all feedback should go to the hubspot-cli repository
|
|
26
|
+
const url = FEEDBACK_URLS.BUG;
|
|
29
27
|
open(url, { url: true });
|
|
30
28
|
logger.success(i18n(`${i18nKey}.success`, { url }));
|
|
31
29
|
}
|
package/commands/fetch.js
CHANGED
|
@@ -14,7 +14,7 @@ const { validateMode, loadAndValidateOptions } = require('../lib/validation');
|
|
|
14
14
|
const { trackCommandUsage } = require('../lib/usageTracking');
|
|
15
15
|
const { i18n } = require('../lib/lang');
|
|
16
16
|
|
|
17
|
-
const i18nKey = '
|
|
17
|
+
const i18nKey = 'commands.fetch';
|
|
18
18
|
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
19
19
|
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
|
|
20
20
|
|
|
@@ -56,11 +56,11 @@ exports.handler = async options => {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
exports.builder = yargs => {
|
|
59
|
-
addConfigOptions(yargs
|
|
60
|
-
addAccountOptions(yargs
|
|
61
|
-
addOverwriteOptions(yargs
|
|
62
|
-
addModeOptions(yargs, { read: true }
|
|
63
|
-
addUseEnvironmentOptions(yargs
|
|
59
|
+
addConfigOptions(yargs);
|
|
60
|
+
addAccountOptions(yargs);
|
|
61
|
+
addOverwriteOptions(yargs);
|
|
62
|
+
addModeOptions(yargs, { read: true });
|
|
63
|
+
addUseEnvironmentOptions(yargs);
|
|
64
64
|
|
|
65
65
|
yargs.positional('src', {
|
|
66
66
|
describe: i18n(`${i18nKey}.positionals.src.describe`),
|