@hubspot/cli 7.4.2-experimental.0 → 7.4.3-experimental.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.
@@ -31,7 +31,6 @@ const chalk_1 = __importDefault(require("chalk"));
31
31
  const project_parsing_lib_1 = require("@hubspot/project-parsing-lib");
32
32
  const projects_3 = require("@hubspot/local-dev-lib/constants/projects");
33
33
  const transform_1 = require("@hubspot/project-parsing-lib/src/lib/transform");
34
- const index_1 = require("@hubspot/local-dev-lib/errors/index");
35
34
  function getUnmigratableReason(reasonCode) {
36
35
  switch (reasonCode) {
37
36
  case projects_3.UNMIGRATABLE_REASONS.UP_TO_DATE:
@@ -114,7 +113,7 @@ async function handleMigrationSetup(derivedAccountId, options) {
114
113
  }
115
114
  const projectName = name ||
116
115
  (await (0, promptUtils_1.inputPrompt)((0, lang_1.i18n)('commands.project.subcommands.migrateApp.prompt.inputName')));
117
- const { projectExists } = await (0, projects_1.ensureProjectExists)(derivedAccountId, projectName, { forceCreate: false, allowCreate: false, noLogs: true });
116
+ const { projectExists } = await (0, projects_1.ensureProjectExists)(derivedAccountId, projectName, { allowCreate: false, noLogs: true });
118
117
  if (projectExists) {
119
118
  throw new Error((0, lang_1.i18n)('commands.project.subcommands.migrateApp.errors.projectAlreadyExists', {
120
119
  projectName,
@@ -274,34 +273,15 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
274
273
  }
275
274
  const createProjectPromptResponse = await (0, createProjectPrompt_1.createProjectPrompt)(options);
276
275
  const { name: projectName, dest: projectDest } = createProjectPromptResponse;
277
- try {
278
- await (0, projects_2.fetchProject)(derivedAccountId, projectName);
276
+ const { projectExists } = await (0, projects_1.ensureProjectExists)(derivedAccountId, projectName, {
277
+ allowCreate: false,
278
+ noLogs: true,
279
+ });
280
+ if (projectExists) {
279
281
  throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.projectAlreadyExists`, {
280
282
  projectName,
281
283
  }));
282
284
  }
283
- catch (error) {
284
- if (!(0, index_1.isSpecifiedError)(error, { statusCode: 404 })) {
285
- (0, errorHandlers_1.logError)(error, new errorHandlers_1.ApiErrorContext({ accountId: derivedAccountId }));
286
- return process.exit(exitCodes_1.EXIT_CODES.ERROR);
287
- }
288
- }
289
- // const { projectExists } = await ensureProjectExists(
290
- // derivedAccountId,
291
- // projectName,
292
- // {
293
- // allowCreate: false,
294
- // noLogs: true,
295
- // }
296
- // );
297
- //
298
- // if (projectExists) {
299
- // throw new Error(
300
- // i18n(`${i18nKey}.errors.projectAlreadyExists`, {
301
- // projectName,
302
- // })
303
- // );
304
- // }
305
285
  await (0, usageTracking_1.trackCommandMetadataUsage)('migrate-app', { step: 'STARTED' }, derivedAccountId);
306
286
  logger_1.logger.log('');
307
287
  (0, ui_1.uiLine)();
@@ -27,7 +27,7 @@ function logError(error, context) {
27
27
  if ((0, index_1.isHubSpotHttpError)(error) && context) {
28
28
  error.updateContext(context);
29
29
  }
30
- if ((0, index_1.isHubSpotHttpError)(error) && (0, index_1.isValidationError)(error)) {
30
+ if ((0, index_1.isHubSpotHttpError)(error)) {
31
31
  logger_1.logger.error(error.formattedValidationErrors());
32
32
  }
33
33
  else if (isErrorWithMessageOrReason(error)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.4.2-experimental.0",
3
+ "version": "7.4.3-experimental.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",