diff --git a/messages/config.md b/messages/config.md new file mode 100644 index 00000000..27b441f5 --- /dev/null +++ b/messages/config.md @@ -0,0 +1,7 @@ +# error.invalidBooleanConfigValue + +The config value can only be set to true or false + +# org-metadata-rest-deploy + +Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). diff --git a/src/configMeta.ts b/src/configMeta.ts index 3303bf36..3cde41a3 100644 --- a/src/configMeta.ts +++ b/src/configMeta.ts @@ -7,6 +7,10 @@ import type { ConfigValue } from '@salesforce/core'; +import { Messages } from '@salesforce/core/lib/messages'; +Messages.importMessagesDirectory(__dirname); +const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'config'); + export enum ConfigVars { /** * Allow users to use the REST api for deployments. @@ -17,12 +21,11 @@ export enum ConfigVars { export default [ { key: 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).', + description: messages.getMessage(ConfigVars.ORG_METADATA_REST_DEPLOY), hidden: true, input: { validator: (value: ConfigValue): boolean => typeof value === 'string' && ['true', 'false'].includes(value), - failedMessage: 'The config value can only be set to true or false', + failedMessage: messages.getMessage('error.invalidBooleanConfigValue'), }, }, ];