@hubspot/cli 4.1.2 → 4.1.3-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 CHANGED
@@ -38,7 +38,6 @@ const moduleCommand = require('../commands/module');
38
38
  const configCommand = require('../commands/config');
39
39
  const accountsCommand = require('../commands/accounts');
40
40
  const sandboxesCommand = require('../commands/sandbox');
41
- const processCommand = require('../commands/process');
42
41
  const cmsCommand = require('../commands/cms');
43
42
  const feedbackCommand = require('../commands/feedback');
44
43
  const { EXIT_CODES } = require('../lib/enums/exitCodes');
@@ -159,7 +158,6 @@ const argv = yargs
159
158
  .command(configCommand)
160
159
  .command(accountsCommand)
161
160
  .command(sandboxesCommand)
162
- .command(processCommand, false)
163
161
  .command(feedbackCommand)
164
162
  .help()
165
163
  .recommendCommands()
@@ -11,11 +11,11 @@ const {
11
11
  isProcessableFieldsJs,
12
12
  } = require('@hubspot/cli-lib/lib/handleFieldsJs');
13
13
 
14
- const { trackProcessFieldsUsage } = require('../lib/usageTracking');
15
- const i18nKey = 'cli.commands.process';
14
+ const { trackProcessFieldsUsage } = require('../../lib/usageTracking');
15
+ const i18nKey = 'cli.commands.convertFields';
16
16
 
17
- exports.command = 'process';
18
- exports.describe = false;
17
+ exports.command = 'convert-fields';
18
+ exports.describe = i18n(`${i18nKey}.describe`);
19
19
 
20
20
  const invalidPath = src => {
21
21
  logger.error(
@@ -38,7 +38,7 @@ const DEFAULT_TABLE_HEADER = [
38
38
  ];
39
39
 
40
40
  exports.command = 'lighthouse-score [--theme]';
41
- exports.describe = i18n(`${i18nKey}.describe`);
41
+ exports.describe = false; // i18n(`${i18nKey}.describe`);
42
42
 
43
43
  const selectTheme = async accountId => {
44
44
  const { theme: selectedTheme } = await promptUser([
package/commands/cms.js CHANGED
@@ -1,16 +1,21 @@
1
+ const { i18n } = require('@hubspot/cli-lib/lib/lang');
1
2
  const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
2
3
  const lighthouseScore = require('./cms/lighthouseScore');
4
+ const convertFields = require('./cms/convertFields');
3
5
 
4
- // const i18nKey = 'cli.commands.cms';
6
+ const i18nKey = 'cli.commands.cms';
5
7
 
6
8
  exports.command = 'cms';
7
- exports.describe = false; // i18n(`${i18nKey}.describe`);
9
+ exports.describe = i18n(`${i18nKey}.describe`);
8
10
 
9
11
  exports.builder = yargs => {
10
12
  addConfigOptions(yargs, true);
11
13
  addAccountOptions(yargs, true);
12
14
 
13
- yargs.command(lighthouseScore).demandCommand(1, '');
15
+ yargs
16
+ .command(lighthouseScore)
17
+ .command(convertFields)
18
+ .demandCommand(1, '');
14
19
 
15
20
  return yargs;
16
21
  };
@@ -1,30 +1,39 @@
1
+ const chalk = require('chalk');
1
2
  const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
2
3
  const schemaCommand = require('./customObject/schema');
3
4
  const createCommand = require('./customObject/create');
4
5
  const { i18n } = require('@hubspot/cli-lib/lib/lang');
6
+ const { logger } = require('@hubspot/cli-lib/logger');
7
+ const { uiBetaWarning } = require('../lib/ui');
5
8
 
6
9
  const i18nKey = 'cli.commands.customObject';
7
10
 
8
11
  exports.command = ['custom-object', 'custom', 'co'];
9
12
  exports.describe = i18n(`${i18nKey}.describe`);
10
13
 
14
+ const logBetaMessage = () => {
15
+ uiBetaWarning(() => {
16
+ logger.log(chalk.reset.yellow(i18n(`${i18nKey}.betaMessage`)));
17
+ logger.log(
18
+ chalk.reset.yellow(
19
+ i18n(`${i18nKey}.seeMoreLink`, {
20
+ link:
21
+ 'https://developers.hubspot.com/docs/api/crm/crm-custom-objects',
22
+ })
23
+ )
24
+ );
25
+ });
26
+ };
27
+
11
28
  exports.builder = yargs => {
12
29
  addConfigOptions(yargs, true);
13
30
  addAccountOptions(yargs, true);
14
31
 
15
32
  yargs
33
+ .middleware([logBetaMessage])
16
34
  .command(schemaCommand)
17
35
  .command(createCommand)
18
36
  .demandCommand(1, '');
19
37
 
20
- console.warn(i18n(`${i18nKey}.warning`));
21
- console.warn(i18n(`${i18nKey}.betaMessage`));
22
- console.warn(
23
- i18n(`${i18nKey}.seeMoreLink`, {
24
- link: 'https://developers.hubspot.com/docs/api/crm/crm-custom-objects',
25
- })
26
- );
27
- console.warn(i18n(`${i18nKey}.warning`));
28
-
29
38
  return yargs;
30
39
  };
@@ -314,14 +314,11 @@ exports.builder = yargs => {
314
314
  describe: i18n(`${i18nKey}.options.saveOutput.describe`),
315
315
  type: 'boolean',
316
316
  default: false,
317
- hidden: true,
318
317
  });
319
- yargs.option('processFieldsJs', {
320
- describe: i18n(`${i18nKey}.options.processFields.describe`),
321
- alias: ['processFields'],
318
+ yargs.option('convertFields', {
319
+ describe: i18n(`${i18nKey}.options.convertFields.describe`),
322
320
  type: 'boolean',
323
321
  default: false,
324
- hidden: true,
325
322
  });
326
323
  return yargs;
327
324
  };
package/commands/watch.js CHANGED
@@ -128,18 +128,15 @@ exports.builder = yargs => {
128
128
  type: 'string',
129
129
  requiresArg: true,
130
130
  });
131
- yargs.option('processFieldsJs', {
132
- describe: i18n(`${i18nKey}.options.processFields.describe`),
133
- alias: ['processFields'],
131
+ yargs.option('convertFields', {
132
+ describe: i18n(`${i18nKey}.options.convertFields.describe`),
134
133
  type: 'boolean',
135
134
  default: false,
136
- hidden: true,
137
135
  });
138
136
  yargs.option('saveOutput', {
139
137
  describe: i18n(`${i18nKey}.options.saveOutput.describe`),
140
138
  type: 'boolean',
141
139
  default: false,
142
- hidden: true,
143
140
  });
144
141
  return yargs;
145
142
  };
package/lib/ui.js CHANGED
@@ -49,7 +49,7 @@ const uiLink = (linkText, url) => {
49
49
  return terminalUISupport.color ? chalk.cyan(result) : result;
50
50
  } else {
51
51
  return terminalUISupport.color
52
- ? `${linkText}: ${chalk.cyan(encodedUrl)}`
52
+ ? `${linkText}: ${chalk.reset.cyan(encodedUrl)}`
53
53
  : `${linkText}: ${encodedUrl}`;
54
54
  }
55
55
  };
@@ -93,8 +93,17 @@ const uiFeatureHighlight = (commands, title) => {
93
93
  });
94
94
  };
95
95
 
96
+ const uiBetaWarning = logMessage => {
97
+ const i18nKey = 'cli.lib.ui.betaWarning';
98
+
99
+ logger.log(i18n(`${i18nKey}.header`));
100
+ logMessage();
101
+ logger.log(i18n(`${i18nKey}.footer`));
102
+ };
103
+
96
104
  module.exports = {
97
105
  uiAccountDescription,
106
+ uiBetaWarning,
98
107
  uiFeatureHighlight,
99
108
  uiInfoSection,
100
109
  uiLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "4.1.2",
3
+ "version": "4.1.3-beta.1",
4
4
  "description": "CLI for working with HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,8 +8,8 @@
8
8
  "url": "https://github.com/HubSpot/hubspot-cms-tools"
9
9
  },
10
10
  "dependencies": {
11
- "@hubspot/cli-lib": "4.1.2",
12
- "@hubspot/serverless-dev-runtime": "4.1.2",
11
+ "@hubspot/cli-lib": "4.1.3-beta.1",
12
+ "@hubspot/serverless-dev-runtime": "4.1.3-beta.1",
13
13
  "archiver": "^5.3.0",
14
14
  "chalk": "^4.1.2",
15
15
  "express": "^4.17.1",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "0b6dc63dca8bd9d5da6e5a86f954f988b9ec5587"
40
+ "gitHead": "09aad0058afb7b7986d766d3d9e9b752c077cf3f"
41
41
  }