From c4ff07de7293be53e7b1f306891d8b6e67620e81 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 5 Dec 2023 14:41:37 -0500 Subject: [PATCH 1/4] use local-dev-lib for schemas / customObjects --- packages/cli/commands/customObject/schema/fetch-all.js | 9 +++++++-- packages/cli/commands/customObject/schema/fetch.js | 5 ++++- packages/cli/lib/schema.js | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/cli/commands/customObject/schema/fetch-all.js b/packages/cli/commands/customObject/schema/fetch-all.js index b2ba14735..09ed28c03 100644 --- a/packages/cli/commands/customObject/schema/fetch-all.js +++ b/packages/cli/commands/customObject/schema/fetch-all.js @@ -6,8 +6,12 @@ const { const { loadAndValidateOptions } = require('../../../lib/validation'); const { trackCommandUsage } = require('../../../lib/usageTracking'); const { getAccountId } = require('../../../lib/commonOpts'); -const { downloadSchemas, getResolvedPath } = require('@hubspot/cli-lib/schema'); +const { + downloadSchemas, + getResolvedPath, +} = require('@hubspot/local-dev-lib/customObjects'); const { i18n } = require('../../../lib/lang'); +const { logSchemas } = require('../../../lib/schema'); const i18nKey = 'cli.commands.customObject.subcommands.schema.subcommands.fetchAll'; @@ -23,7 +27,8 @@ exports.handler = async options => { trackCommandUsage('custom-object-schema-fetch-all', null, accountId); try { - await downloadSchemas(accountId, options.dest); + const schemas = await downloadSchemas(accountId, options.dest); + logSchemas(schemas); logger.success( i18n(`${i18nKey}.success.fetch`, { path: getResolvedPath(options.dest), diff --git a/packages/cli/commands/customObject/schema/fetch.js b/packages/cli/commands/customObject/schema/fetch.js index bb18e30a2..ecd4a29ad 100644 --- a/packages/cli/commands/customObject/schema/fetch.js +++ b/packages/cli/commands/customObject/schema/fetch.js @@ -5,7 +5,10 @@ const { logErrorInstance, } = require('../../../lib/errorHandlers/standardErrors'); const { ConfigFlags } = require('@hubspot/cli-lib/lib/constants'); -const { downloadSchema, getResolvedPath } = require('@hubspot/cli-lib/schema'); +const { + downloadSchema, + getResolvedPath, +} = require('@hubspot/local-dev-lib/schema'); const { fetchSchema } = require('@hubspot/cli-lib/api/fileTransport'); const { getCwd } = require('@hubspot/cli-lib/path'); diff --git a/packages/cli/lib/schema.js b/packages/cli/lib/schema.js index 090604bb5..8b0c20f40 100644 --- a/packages/cli/lib/schema.js +++ b/packages/cli/lib/schema.js @@ -27,5 +27,6 @@ const listSchemas = async accountId => { }; module.exports = { + logSchemas, listSchemas, }; From 68023c932ea5da8e2564291d78f1262db3886545 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 5 Dec 2023 15:27:04 -0500 Subject: [PATCH 2/4] use local-dev-lib for themes / files --- packages/cli/commands/cms/convertFields.js | 2 +- packages/cli/commands/upload.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/commands/cms/convertFields.js b/packages/cli/commands/cms/convertFields.js index cc681b4b7..a526d854c 100644 --- a/packages/cli/commands/cms/convertFields.js +++ b/packages/cli/commands/cms/convertFields.js @@ -4,7 +4,7 @@ const { createIgnoreFilter } = require('@hubspot/local-dev-lib/ignoreRules'); const { isAllowedExtension, getCwd } = require('@hubspot/cli-lib/path'); const { logger } = require('@hubspot/cli-lib/logger'); const { walk } = require('@hubspot/local-dev-lib/fs'); -const { getThemeJSONPath } = require('@hubspot/cli-lib/lib/files'); +const { getThemeJSONPath } = require('@hubspot/local-dev-lib/themes'); const { i18n } = require('../../lib/lang'); const { FieldsJs, diff --git a/packages/cli/commands/upload.js b/packages/cli/commands/upload.js index 55a23e55e..bc01c69e6 100644 --- a/packages/cli/commands/upload.js +++ b/packages/cli/commands/upload.js @@ -33,7 +33,7 @@ const { getUploadableFileList } = require('../lib/upload'); const { getThemePreviewUrl, getThemeJSONPath, -} = require('@hubspot/cli-lib/lib/files'); +} = require('@hubspot/local-dev-lib/themes'); const { i18n } = require('../lib/lang'); const i18nKey = 'cli.commands.upload'; const { EXIT_CODES } = require('../lib/enums/exitCodes'); From bbffe3de707b93695711e5468d62a110ffd5a9e4 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 5 Dec 2023 16:41:56 -0500 Subject: [PATCH 3/4] fix themes import path --- packages/cli/commands/cms/convertFields.js | 2 +- packages/cli/commands/upload.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/commands/cms/convertFields.js b/packages/cli/commands/cms/convertFields.js index a526d854c..59b9163a4 100644 --- a/packages/cli/commands/cms/convertFields.js +++ b/packages/cli/commands/cms/convertFields.js @@ -4,7 +4,7 @@ const { createIgnoreFilter } = require('@hubspot/local-dev-lib/ignoreRules'); const { isAllowedExtension, getCwd } = require('@hubspot/cli-lib/path'); const { logger } = require('@hubspot/cli-lib/logger'); const { walk } = require('@hubspot/local-dev-lib/fs'); -const { getThemeJSONPath } = require('@hubspot/local-dev-lib/themes'); +const { getThemeJSONPath } = require('@hubspot/local-dev-lib/cms/themes'); const { i18n } = require('../../lib/lang'); const { FieldsJs, diff --git a/packages/cli/commands/upload.js b/packages/cli/commands/upload.js index bc01c69e6..45c555b65 100644 --- a/packages/cli/commands/upload.js +++ b/packages/cli/commands/upload.js @@ -33,7 +33,7 @@ const { getUploadableFileList } = require('../lib/upload'); const { getThemePreviewUrl, getThemeJSONPath, -} = require('@hubspot/local-dev-lib/themes'); +} = require('@hubspot/local-dev-lib/cms/themes'); const { i18n } = require('../lib/lang'); const i18nKey = 'cli.commands.upload'; const { EXIT_CODES } = require('../lib/enums/exitCodes'); From b10a0dbbcca9dd2679a75b5623c36178e4638d6b Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Wed, 6 Dec 2023 10:36:18 -0500 Subject: [PATCH 4/4] fix schema import --- packages/cli/commands/customObject/schema/fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/commands/customObject/schema/fetch.js b/packages/cli/commands/customObject/schema/fetch.js index ecd4a29ad..ba55e610e 100644 --- a/packages/cli/commands/customObject/schema/fetch.js +++ b/packages/cli/commands/customObject/schema/fetch.js @@ -8,7 +8,7 @@ const { ConfigFlags } = require('@hubspot/cli-lib/lib/constants'); const { downloadSchema, getResolvedPath, -} = require('@hubspot/local-dev-lib/schema'); +} = require('@hubspot/local-dev-lib/customObjects'); const { fetchSchema } = require('@hubspot/cli-lib/api/fileTransport'); const { getCwd } = require('@hubspot/cli-lib/path');