@hubspot/cli 7.3.0 → 7.4.0-beta.0

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.
Files changed (88) hide show
  1. package/api/migrate.d.ts +61 -0
  2. package/api/migrate.js +44 -0
  3. package/bin/cli.js +10 -183
  4. package/commands/account/auth.d.ts +10 -0
  5. package/commands/account/auth.js +168 -0
  6. package/commands/account/clean.js +38 -5
  7. package/commands/account/createOverride.d.ts +10 -0
  8. package/commands/account/createOverride.js +104 -0
  9. package/commands/account/info.js +38 -4
  10. package/commands/account/list.js +23 -5
  11. package/commands/account/remove.js +36 -2
  12. package/commands/account/removeOverride.d.ts +10 -0
  13. package/commands/account/removeOverride.js +76 -0
  14. package/commands/account/use.js +25 -3
  15. package/commands/account.js +7 -2
  16. package/commands/app/migrate.d.ts +7 -0
  17. package/commands/app/migrate.js +95 -0
  18. package/commands/app.d.ts +6 -0
  19. package/commands/app.js +23 -0
  20. package/commands/auth.js +6 -2
  21. package/commands/cms/lighthouseScore.js +6 -2
  22. package/commands/config/migrate.d.ts +10 -0
  23. package/commands/config/migrate.js +84 -0
  24. package/commands/config/set.d.ts +10 -0
  25. package/commands/config/set.js +34 -29
  26. package/commands/config.d.ts +4 -1
  27. package/commands/config.js +45 -11
  28. package/commands/create/api-sample.js +3 -1
  29. package/commands/customObject/schema/delete.js +4 -1
  30. package/commands/customObject/schema/fetch-all.js +2 -1
  31. package/commands/customObject/schema/fetch.js +2 -1
  32. package/commands/init.js +9 -10
  33. package/commands/project/cloneApp.d.ts +9 -1
  34. package/commands/project/cloneApp.js +91 -76
  35. package/commands/project/migrateApp.d.ts +9 -1
  36. package/commands/project/migrateApp.js +43 -170
  37. package/commands/project/watch.js +12 -0
  38. package/lang/en.js +5 -2
  39. package/lang/en.lyaml +121 -10
  40. package/lib/app/migrate.d.ts +5 -0
  41. package/lib/app/migrate.js +242 -0
  42. package/lib/app/migrate_legacy.d.ts +4 -0
  43. package/lib/app/migrate_legacy.js +129 -0
  44. package/lib/configMigrate.d.ts +2 -0
  45. package/lib/configMigrate.js +104 -0
  46. package/lib/doctor/Diagnosis.d.ts +1 -2
  47. package/lib/doctor/Diagnosis.js +10 -6
  48. package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -0
  49. package/lib/doctor/DiagnosticInfoBuilder.js +1 -0
  50. package/lib/doctor/Doctor.d.ts +1 -0
  51. package/lib/doctor/Doctor.js +18 -0
  52. package/lib/middleware/__test__/configMiddleware.test.d.ts +1 -0
  53. package/lib/middleware/__test__/configMiddleware.test.js +194 -0
  54. package/lib/middleware/__test__/gitMiddleware.test.d.ts +1 -0
  55. package/lib/middleware/__test__/gitMiddleware.test.js +76 -0
  56. package/lib/middleware/__test__/notificationsMiddleware.test.d.ts +1 -0
  57. package/lib/middleware/__test__/notificationsMiddleware.test.js +10 -0
  58. package/lib/middleware/__test__/requestMiddleware.test.d.ts +1 -0
  59. package/lib/middleware/__test__/requestMiddleware.test.js +20 -0
  60. package/lib/middleware/__test__/utils.test.d.ts +1 -0
  61. package/lib/middleware/__test__/utils.test.js +53 -0
  62. package/lib/middleware/__test__/yargsChecksMiddleware.test.d.ts +1 -0
  63. package/lib/middleware/__test__/yargsChecksMiddleware.test.js +81 -0
  64. package/lib/middleware/configMiddleware.d.ts +13 -0
  65. package/lib/middleware/configMiddleware.js +109 -0
  66. package/lib/middleware/fireAlarmMiddleware.d.ts +4 -0
  67. package/lib/middleware/fireAlarmMiddleware.js +137 -0
  68. package/lib/middleware/gitMiddleware.d.ts +2 -0
  69. package/lib/middleware/gitMiddleware.js +14 -0
  70. package/lib/middleware/notificationsMiddleware.d.ts +1 -0
  71. package/lib/middleware/notificationsMiddleware.js +38 -0
  72. package/lib/middleware/requestMiddleware.d.ts +1 -0
  73. package/lib/middleware/requestMiddleware.js +11 -0
  74. package/lib/middleware/utils.d.ts +8 -0
  75. package/lib/middleware/utils.js +17 -0
  76. package/lib/middleware/yargsChecksMiddleware.d.ts +4 -0
  77. package/lib/middleware/yargsChecksMiddleware.js +24 -0
  78. package/lib/polling.d.ts +4 -0
  79. package/lib/polling.js +3 -3
  80. package/lib/prompts/promptUtils.d.ts +6 -4
  81. package/lib/prompts/promptUtils.js +3 -1
  82. package/lib/ui/SpinniesManager.d.ts +1 -1
  83. package/lib/ui/index.d.ts +3 -2
  84. package/lib/ui/index.js +11 -5
  85. package/lib/ui/spinniesUtils.d.ts +5 -5
  86. package/package.json +7 -6
  87. package/types/Prompts.d.ts +2 -2
  88. package/types/Yargs.d.ts +10 -0
@@ -0,0 +1,137 @@
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
+ exports.checkFireAlarms = checkFireAlarms;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const fireAlarm_1 = require("@hubspot/local-dev-lib/api/fireAlarm");
9
+ const logger_1 = require("@hubspot/local-dev-lib/logger");
10
+ const errorHandlers_1 = require("../errorHandlers");
11
+ const package_json_1 = __importDefault(require("../../package.json"));
12
+ const ui_1 = require("../ui");
13
+ const lang_1 = require("../lang");
14
+ /*
15
+ * Versions can be formatted like this:
16
+ * =7.2.2 -> targets the exact version 7.2.2
17
+ * =7.2.* -> targets all versions with a major of 7 and a minor of 2
18
+ * =7.* -> targets all versions with a major of 7
19
+ * =* -> targets all versions
20
+ * <=7.2.2 -> targets all versions equal to or less than 7.2.2
21
+ * <=7.2.* -> targets all versions equal to or less than 7.2
22
+ */
23
+ const WILDCARD = '*';
24
+ function isVersionTargeted(version, targetVersionString) {
25
+ // Assume we're targeting no versions if no version string is found
26
+ // Target all versions using the * wildcard
27
+ if (!targetVersionString) {
28
+ return false;
29
+ }
30
+ // Only support version targeting for the <= or = operator
31
+ if (!targetVersionString.startsWith('<=') &&
32
+ !targetVersionString.startsWith('=')) {
33
+ return false;
34
+ }
35
+ const targetVersion = targetVersionString.substring(targetVersionString.indexOf('=') + 1);
36
+ // Only allow exact version matching for tagged CLI releases (like -beta)
37
+ if (version.includes('-') || targetVersionString.includes('-')) {
38
+ if (!targetVersionString.startsWith('=')) {
39
+ return false;
40
+ }
41
+ return version === targetVersion;
42
+ }
43
+ const targetVersionParts = targetVersion.split('.');
44
+ const versionParts = version.split('.');
45
+ // Require the wildcard to be explicitly set to target all versions
46
+ if (versionParts.length < 3 &&
47
+ versionParts[versionParts.length - 1] !== WILDCARD) {
48
+ return false;
49
+ }
50
+ // Don't allow the less than or equal to operator to be used with the wildcard
51
+ // in the major version part (e.g. <=*)
52
+ if (targetVersionString.startsWith('<=') && versionParts[0] === WILDCARD) {
53
+ return false;
54
+ }
55
+ let targetAnyVersion = false;
56
+ return targetVersionParts.every((targetPart, i) => {
57
+ const versionPart = versionParts[i];
58
+ // Support generic version targeting (like 1.2.*)
59
+ if (targetPart === WILDCARD || targetAnyVersion) {
60
+ targetAnyVersion = true;
61
+ return true;
62
+ }
63
+ // Double check that the target part is a number
64
+ if (isNaN(Number(targetPart))) {
65
+ return false;
66
+ }
67
+ return targetVersionString.startsWith('<=')
68
+ ? Number(versionPart) <= Number(targetPart)
69
+ : Number(versionPart) === Number(targetPart);
70
+ });
71
+ }
72
+ function isCommandTargeted(command, targetCommandsString) {
73
+ // Require the wildcard to be explicitly set to target all commands
74
+ if (!targetCommandsString) {
75
+ return false;
76
+ }
77
+ if (targetCommandsString === WILDCARD) {
78
+ return true;
79
+ }
80
+ const targetCommands = targetCommandsString.split(',');
81
+ return targetCommands.some(cmd => command.startsWith(cmd));
82
+ }
83
+ function filterFireAlarm(fireAlarm, command, version) {
84
+ const commandIsTargeted = isCommandTargeted(command, fireAlarm.querySelector);
85
+ const versionIsTargeted = isVersionTargeted(version, fireAlarm.urlRegexPattern);
86
+ return commandIsTargeted && versionIsTargeted;
87
+ }
88
+ async function getFireAlarms(accountId, command, version) {
89
+ let relevantAlarms = [];
90
+ try {
91
+ const { data: fireAlarms } = await (0, fireAlarm_1.fetchFireAlarms)(accountId);
92
+ relevantAlarms = fireAlarms.filter(fireAlarm => filterFireAlarm(fireAlarm, command, version));
93
+ }
94
+ catch (error) {
95
+ (0, errorHandlers_1.debugError)(error);
96
+ }
97
+ return relevantAlarms;
98
+ }
99
+ async function logFireAlarms(accountId, command, version) {
100
+ const alarms = await getFireAlarms(accountId, command, version);
101
+ if (alarms.length > 0) {
102
+ const notifications = alarms.reduce((acc, alarm) => {
103
+ if (alarm.title && alarm.message) {
104
+ return (acc +
105
+ `${acc.length > 0 ? '\n\n' : ''}${chalk_1.default.bold(alarm.title)}\n${alarm.message}`);
106
+ }
107
+ return acc;
108
+ }, '');
109
+ let boxen;
110
+ try {
111
+ // The boxen package is exported as a module, so we have to use a dynamic import
112
+ boxen = (await import('boxen')).default;
113
+ }
114
+ catch (error) {
115
+ logger_1.logger.debug(`${(0, lang_1.i18n)('lib.middleware.fireAlarm.failedToLoadBoxen')}`);
116
+ return;
117
+ }
118
+ logger_1.logger.log(boxen(notifications, {
119
+ title: 'Notifications',
120
+ titleAlignment: 'left',
121
+ borderColor: ui_1.UI_COLORS.MARIGOLD,
122
+ margin: 1,
123
+ padding: 1,
124
+ textAlignment: 'left',
125
+ borderStyle: 'round',
126
+ }));
127
+ }
128
+ }
129
+ async function checkFireAlarms(args) {
130
+ const { derivedAccountId } = args;
131
+ try {
132
+ await logFireAlarms(derivedAccountId, args._.join(' '), package_json_1.default.version);
133
+ }
134
+ catch (error) {
135
+ (0, errorHandlers_1.debugError)(error);
136
+ }
137
+ }
@@ -0,0 +1,2 @@
1
+ import { Arguments } from 'yargs';
2
+ export declare function checkAndWarnGitInclusionMiddleware(argv: Arguments): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkAndWarnGitInclusionMiddleware = checkAndWarnGitInclusionMiddleware;
4
+ const config_1 = require("@hubspot/local-dev-lib/config");
5
+ const git_1 = require("../ui/git");
6
+ function checkAndWarnGitInclusionMiddleware(argv) {
7
+ // Skip this when no command is provided
8
+ if (argv._.length) {
9
+ const configPath = (0, config_1.getConfigPath)();
10
+ if (configPath) {
11
+ (0, git_1.checkAndWarnGitInclusion)(configPath);
12
+ }
13
+ }
14
+ }
@@ -0,0 +1 @@
1
+ export declare function notifyAboutUpdates(): void;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.notifyAboutUpdates = notifyAboutUpdates;
4
+ // Update-notifier is CommonJS, so we need to use require
5
+ const updateNotifier = require('update-notifier');
6
+ const chalk = require('chalk');
7
+ const pkg = require('../../package.json');
8
+ const { UI_COLORS, uiCommandReference } = require('../ui');
9
+ const { i18n } = require('../lang');
10
+ const notifier = updateNotifier({
11
+ pkg: { ...pkg, name: '@hubspot/cli' },
12
+ distTag: 'latest',
13
+ shouldNotifyInNpmScript: true,
14
+ });
15
+ const CMS_CLI_PACKAGE_NAME = '@hubspot/cms-cli';
16
+ function notifyAboutUpdates() {
17
+ notifier.notify({
18
+ message: pkg.name === CMS_CLI_PACKAGE_NAME
19
+ ? i18n(`commands.generalErrors.updateNotify.cmsUpdateNotification`, {
20
+ packageName: CMS_CLI_PACKAGE_NAME,
21
+ updateCommand: uiCommandReference('{updateCommand}'),
22
+ })
23
+ : i18n(`commands.generalErrors.updateNotify.cliUpdateNotification`, {
24
+ updateCommand: uiCommandReference('{updateCommand}'),
25
+ }),
26
+ defer: false,
27
+ boxenOptions: {
28
+ borderColor: UI_COLORS.MARIGOLD_DARK,
29
+ margin: 1,
30
+ padding: 1,
31
+ textAlignment: 'center',
32
+ borderStyle: 'round',
33
+ title: pkg.name === CMS_CLI_PACKAGE_NAME
34
+ ? null
35
+ : chalk.bold(i18n(`commands.generalErrors.updateNotify.notifyTitle`)),
36
+ },
37
+ });
38
+ }
@@ -0,0 +1 @@
1
+ export declare function setRequestHeaders(): void;
@@ -0,0 +1,11 @@
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
+ exports.setRequestHeaders = setRequestHeaders;
7
+ const http_1 = require("@hubspot/local-dev-lib/http");
8
+ const package_json_1 = __importDefault(require("../../package.json"));
9
+ function setRequestHeaders() {
10
+ (0, http_1.addUserAgentHeader)('HubSpot CLI', package_json_1.default.version);
11
+ }
@@ -0,0 +1,8 @@
1
+ type TargetCommandMap = {
2
+ [key: string]: {
3
+ target?: boolean;
4
+ subCommands?: TargetCommandMap;
5
+ };
6
+ };
7
+ export declare function isTargetedCommand(commandParts: (string | number)[], targetCommandMap: TargetCommandMap): boolean;
8
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTargetedCommand = isTargetedCommand;
4
+ function isTargetedCommand(commandParts, targetCommandMap) {
5
+ const currentCommand = commandParts[0];
6
+ if (!targetCommandMap[currentCommand]) {
7
+ return false;
8
+ }
9
+ if (targetCommandMap[currentCommand].target) {
10
+ return true;
11
+ }
12
+ const subCommands = targetCommandMap[currentCommand].subCommands || {};
13
+ if (commandParts.length > 1) {
14
+ return isTargetedCommand(commandParts.slice(1), subCommands);
15
+ }
16
+ return false;
17
+ }
@@ -0,0 +1,4 @@
1
+ import { Arguments } from 'yargs';
2
+ export declare function performChecks(argv: Arguments<{
3
+ src?: string;
4
+ }>): boolean;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.performChecks = performChecks;
4
+ const logger_1 = require("@hubspot/local-dev-lib/logger");
5
+ const exitCodes_1 = require("../enums/exitCodes");
6
+ const lang_1 = require("../lang");
7
+ const projects_1 = require("../projects");
8
+ const utils_1 = require("./utils");
9
+ const UPLOAD_AND_WATCH_COMMANDS = {
10
+ upload: { target: true },
11
+ watch: { target: true },
12
+ };
13
+ function performChecks(argv) {
14
+ // Require "project" command when running upload/watch inside of a project
15
+ if ((0, utils_1.isTargetedCommand)(argv._, UPLOAD_AND_WATCH_COMMANDS) &&
16
+ (0, projects_1.getIsInProject)(argv.src)) {
17
+ logger_1.logger.error((0, lang_1.i18n)(`commands.generalErrors.srcIsProject`, {
18
+ src: argv.src || './',
19
+ command: argv._.join(' '),
20
+ }));
21
+ process.exit(exitCodes_1.EXIT_CODES.ERROR);
22
+ }
23
+ return true;
24
+ }
package/lib/polling.d.ts CHANGED
@@ -6,6 +6,10 @@ export declare const DEFAULT_POLLING_STATES: {
6
6
  readonly REVERTED: "REVERTED";
7
7
  readonly FAILURE: "FAILURE";
8
8
  };
9
+ export declare const DEFAULT_POLLING_STATUS_LOOKUP: {
10
+ successStates: "SUCCESS"[];
11
+ errorStates: ("FAILURE" | "ERROR" | "REVERTED")[];
12
+ };
9
13
  type GenericPollingResponse = {
10
14
  status: string;
11
15
  };
package/lib/polling.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_POLLING_STATES = void 0;
3
+ exports.DEFAULT_POLLING_STATUS_LOOKUP = exports.DEFAULT_POLLING_STATES = void 0;
4
4
  exports.poll = poll;
5
5
  const constants_1 = require("./constants");
6
6
  exports.DEFAULT_POLLING_STATES = {
@@ -10,7 +10,7 @@ exports.DEFAULT_POLLING_STATES = {
10
10
  REVERTED: 'REVERTED',
11
11
  FAILURE: 'FAILURE',
12
12
  };
13
- const DEFAULT_POLLING_STATUS_LOOKUP = {
13
+ exports.DEFAULT_POLLING_STATUS_LOOKUP = {
14
14
  successStates: [exports.DEFAULT_POLLING_STATES.SUCCESS],
15
15
  errorStates: [
16
16
  exports.DEFAULT_POLLING_STATES.ERROR,
@@ -18,7 +18,7 @@ const DEFAULT_POLLING_STATUS_LOOKUP = {
18
18
  exports.DEFAULT_POLLING_STATES.FAILURE,
19
19
  ],
20
20
  };
21
- function poll(callback, statusLookup = DEFAULT_POLLING_STATUS_LOOKUP) {
21
+ function poll(callback, statusLookup = exports.DEFAULT_POLLING_STATUS_LOOKUP) {
22
22
  return new Promise((resolve, reject) => {
23
23
  const pollInterval = setInterval(async () => {
24
24
  try {
@@ -4,10 +4,12 @@ export declare function confirmPrompt(message: string, options?: {
4
4
  defaultAnswer?: boolean;
5
5
  when?: PromptWhen;
6
6
  }): Promise<boolean>;
7
- export declare function listPrompt(message: string, { choices, when, }: {
8
- choices: PromptChoices;
7
+ export declare function listPrompt<T = string>(message: string, { choices, when, }: {
8
+ choices: PromptChoices<T>;
9
9
  when?: PromptWhen;
10
- }): Promise<string>;
11
- export declare function inputPrompt(message: string, { when, }?: {
10
+ }): Promise<T>;
11
+ export declare function inputPrompt(message: string, { when, validate, defaultAnswer, }?: {
12
12
  when?: boolean | (() => boolean);
13
+ validate?: (input: string) => boolean | string;
14
+ defaultAnswer?: string;
13
15
  }): Promise<string>;
@@ -34,13 +34,15 @@ async function listPrompt(message, { choices, when, }) {
34
34
  ]);
35
35
  return choice;
36
36
  }
37
- async function inputPrompt(message, { when, } = {}) {
37
+ async function inputPrompt(message, { when, validate, defaultAnswer, } = {}) {
38
38
  const { input } = await promptUser([
39
39
  {
40
40
  name: 'input',
41
41
  type: 'input',
42
+ default: defaultAnswer,
42
43
  message,
43
44
  when,
45
+ validate,
44
46
  },
45
47
  ]);
46
48
  return input;
@@ -22,7 +22,7 @@ declare class SpinniesManager {
22
22
  succeed(name: string, options?: Partial<SpinnerState>): SpinnerState;
23
23
  fail(name: string, options?: Partial<SpinnerState>): SpinnerState;
24
24
  remove(name: string): SpinnerState;
25
- stopAll(newStatus?: typeof VALID_STATUSES[number]): {
25
+ stopAll(newStatus?: (typeof VALID_STATUSES)[number]): {
26
26
  [key: string]: SpinnerState;
27
27
  };
28
28
  private hasAnySpinners;
package/lib/ui/index.d.ts CHANGED
@@ -11,7 +11,8 @@ export declare function uiCommandReference(command: string, withQuotes?: boolean
11
11
  export declare function uiFeatureHighlight(features: string[], title?: string): void;
12
12
  export declare function uiBetaTag(message: string, log?: true): undefined;
13
13
  export declare function uiBetaTag(message: string, log: false): string;
14
- export declare function uiDeprecatedTag(message: string): void;
14
+ export declare function uiDeprecatedTag(message: string, log?: boolean): string | undefined;
15
15
  export declare function uiCommandDisabledBanner(command: string, url?: string, message?: string): void;
16
- export declare function uiDeprecatedDescription(message: string, command: string, url?: string): void;
16
+ export declare function uiDeprecatedDescription(message: string, command: string, url?: string): string | undefined;
17
17
  export declare function uiDeprecatedMessage(command: string, url?: string, message?: string): void;
18
+ export declare function indent(level: number): string;
package/lib/ui/index.js CHANGED
@@ -15,6 +15,7 @@ exports.uiDeprecatedTag = uiDeprecatedTag;
15
15
  exports.uiCommandDisabledBanner = uiCommandDisabledBanner;
16
16
  exports.uiDeprecatedDescription = uiDeprecatedDescription;
17
17
  exports.uiDeprecatedMessage = uiDeprecatedMessage;
18
+ exports.indent = indent;
18
19
  const chalk_1 = __importDefault(require("chalk"));
19
20
  const config_1 = require("@hubspot/local-dev-lib/config");
20
21
  const logger_1 = require("@hubspot/local-dev-lib/logger");
@@ -102,16 +103,17 @@ function uiBetaTag(message, log = true) {
102
103
  logger_1.logger.log(result);
103
104
  return;
104
105
  }
105
- else {
106
- return result;
107
- }
106
+ return result;
108
107
  }
109
- function uiDeprecatedTag(message) {
108
+ function uiDeprecatedTag(message, log = true) {
110
109
  const i18nKey = 'lib.ui';
111
110
  const terminalUISupport = getTerminalUISupport();
112
111
  const tag = (0, lang_1.i18n)(`${i18nKey}.deprecatedTag`);
113
112
  const result = `${terminalUISupport.color ? chalk_1.default.yellow(tag) : tag} ${message}`;
114
- logger_1.logger.log(result);
113
+ if (log) {
114
+ logger_1.logger.log(result);
115
+ }
116
+ return result;
115
117
  }
116
118
  function uiCommandDisabledBanner(command, url, message) {
117
119
  const i18nKey = 'lib.ui';
@@ -147,3 +149,7 @@ function uiDeprecatedMessage(command, url, message) {
147
149
  uiDeprecatedTag(tag);
148
150
  logger_1.logger.log();
149
151
  }
152
+ function indent(level) {
153
+ const indentation = ' ';
154
+ return indentation.repeat(level);
155
+ }
@@ -6,14 +6,14 @@ export type Spinner = {
6
6
  };
7
7
  export type SpinnerOptions = {
8
8
  text?: string;
9
- status?: typeof VALID_STATUSES[number];
9
+ status?: (typeof VALID_STATUSES)[number];
10
10
  indent?: number;
11
11
  spinner?: Partial<Spinner>;
12
12
  disableSpins?: boolean;
13
- color?: typeof VALID_COLORS[number];
14
- spinnerColor?: typeof VALID_COLORS[number];
15
- succeedColor?: typeof VALID_COLORS[number];
16
- failColor?: typeof VALID_COLORS[number];
13
+ color?: (typeof VALID_COLORS)[number];
14
+ spinnerColor?: (typeof VALID_COLORS)[number];
15
+ succeedColor?: (typeof VALID_COLORS)[number];
16
+ failColor?: (typeof VALID_COLORS)[number];
17
17
  succeedPrefix?: string;
18
18
  failPrefix?: string;
19
19
  };
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.3.0",
3
+ "version": "7.4.0-beta.0",
4
4
  "description": "The official CLI for developing on HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/HubSpot/hubspot-cli",
7
7
  "dependencies": {
8
- "@hubspot/local-dev-lib": "3.4.1",
9
- "@hubspot/project-parsing-lib": "0.1.5",
8
+ "@hubspot/local-dev-lib": "3.5.2",
9
+ "@hubspot/project-parsing-lib": "0.1.7",
10
10
  "@hubspot/serverless-dev-runtime": "7.0.2",
11
11
  "@hubspot/theme-preview-dev-server": "0.0.10",
12
12
  "@hubspot/ui-extensions-dev-server": "0.8.52",
13
13
  "archiver": "7.0.1",
14
+ "boxen": "8.0.1",
14
15
  "chalk": "4.1.2",
15
16
  "chokidar": "3.6.0",
16
17
  "cli-cursor": "3.1.0",
@@ -41,7 +42,7 @@
41
42
  "@types/semver": "^7.5.8",
42
43
  "@types/tmp": "^0.2.6",
43
44
  "@types/yargs": "^17.0.33",
44
- "@typescript-eslint/eslint-plugin": "^8.11.0",
45
+ "@typescript-eslint/eslint-plugin": "8.29.0",
45
46
  "@typescript-eslint/parser": "^8.11.0",
46
47
  "axios": "^1.7.2",
47
48
  "eslint": "^8.56.0",
@@ -62,9 +63,9 @@
62
63
  },
63
64
  "scripts": {
64
65
  "build": "ts-node ./scripts/build.ts",
65
- "lint": "eslint . && prettier --list-different ./**/*.{js,json}",
66
+ "lint": "eslint . && prettier --list-different './**/*.{ts,js,json}'",
66
67
  "list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
67
- "prettier:write": "prettier --write ./**/*.{ts,js,json}",
68
+ "prettier:write": "prettier --write './**/*.{ts,js,json}'",
68
69
  "test": "yarn node --experimental-vm-modules $(yarn bin jest)",
69
70
  "test-cli": "yarn build && yarn --cwd 'acceptance-tests' test-ci",
70
71
  "test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
@@ -3,9 +3,9 @@ export type GenericPromptResponse = {
3
3
  [key: string]: any;
4
4
  };
5
5
  type PromptType = 'confirm' | 'list' | 'checkbox' | 'input' | 'password' | 'number' | 'rawlist';
6
- export type PromptChoices = Array<string | {
6
+ export type PromptChoices<T = any> = Array<string | {
7
7
  name: string;
8
- value?: any;
8
+ value?: T;
9
9
  disabled?: string | boolean;
10
10
  }>;
11
11
  export type PromptWhen = boolean | (() => boolean);
package/types/Yargs.d.ts CHANGED
@@ -27,3 +27,13 @@ export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs;
27
27
  export type TestingArgs = {
28
28
  qa?: boolean;
29
29
  };
30
+ export type MigrateAppOptions = CommonArgs & AccountArgs & EnvironmentArgs & ConfigArgs & {
31
+ name: string;
32
+ dest: string;
33
+ appId: number;
34
+ platformVersion: string;
35
+ };
36
+ export type CloneAppArgs = ConfigArgs & EnvironmentArgs & AccountArgs & CommonArgs & {
37
+ dest: string;
38
+ appId: number;
39
+ };