Skip to content

Commit

Permalink
fix: dont use Messages for configMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Nov 8, 2023
1 parent 46c3625 commit a4d33a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 0 additions & 7 deletions messages/config.md

This file was deleted.

10 changes: 4 additions & 6 deletions src/configMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import { ConfigValue, Messages } from '@salesforce/core';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'config');
import type { ConfigValue } from '@salesforce/core';

export enum ConfigVars {
/**
Expand All @@ -20,11 +17,12 @@ export enum ConfigVars {
export default [
{
key: ConfigVars.ORG_METADATA_REST_DEPLOY,
description: messages.getMessage(ConfigVars.ORG_METADATA_REST_DEPLOY),
// @salesforce/core's Messages class is not used here because it's an expensive import to be used in an init hook
description: 'Whether deployments use the Metadata REST API (true) or SOAP API (false, default value).',
hidden: true,
input: {
validator: (value: ConfigValue): boolean => typeof value === 'string' && ['true', 'false'].includes(value),
failedMessage: messages.getMessage('error.invalidBooleanConfigValue'),
failedMessage: 'The config value can only be set to true or false',
},
},
];

0 comments on commit a4d33a2

Please sign in to comment.