Skip to content

Commit

Permalink
Merge pull request #961 from HubSpot/swap-cli-lib-deps-5
Browse files Browse the repository at this point in the history
Use local-dev-lib for files and schema modules
  • Loading branch information
camden11 authored Dec 6, 2023
2 parents 5c92038 + b10a0db commit 093fc42
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/commands/cms/convertFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/cms/themes');
const { i18n } = require('../../lib/lang');
const {
FieldsJs,
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/commands/customObject/schema/fetch-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/commands/customObject/schema/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/customObjects');
const { fetchSchema } = require('@hubspot/cli-lib/api/fileTransport');
const { getCwd } = require('@hubspot/cli-lib/path');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const { getUploadableFileList } = require('../lib/upload');
const {
getThemePreviewUrl,
getThemeJSONPath,
} = require('@hubspot/cli-lib/lib/files');
} = require('@hubspot/local-dev-lib/cms/themes');
const { i18n } = require('../lib/lang');
const i18nKey = 'cli.commands.upload';
const { EXIT_CODES } = require('../lib/enums/exitCodes');
Expand Down
1 change: 1 addition & 0 deletions packages/cli/lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ const listSchemas = async accountId => {
};

module.exports = {
logSchemas,
listSchemas,
};

0 comments on commit 093fc42

Please sign in to comment.