How to use the @salesforce/core.Messages.importMessagesDirectory function in @salesforce/core

To help you get started, we’ve selected a few @salesforce/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ChuckJonas / sfdx-git-packager / src / commands / git / package.ts View on Github external
import { fs, Messages } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import * as jsdiff from 'diff';
import { promises as fsPromise } from 'fs';
import { dirname, isAbsolute, join, relative } from 'path';
import * as tmp from 'tmp';
import { getResolver, resolveMetadata } from '../../metadataResolvers';
import { copyFileFromRef, getIgnore, purgeFolder, spawnPromise } from '../../util';

interface DiffResults {
  changed: string[];
  removed: string[];
}

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-git-packager', 'package');

export default class Package extends SfdxCommand {

  public static description = messages.getMessage('commandDescription');

  public static examples = [
    '$ sfdx git:package -s my-awesome-feature -t master -d deploy/my-feature',
    '$ sfdx git:package -d deploy/my-feature',
    '$ sfdx git:package -s feature-b -d deploy/feature-b'
  ];

  // not sure what this does...
github wadewegner / sfdx-waw-plugin / src / commands / waw / codeclean / check.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import { get } from 'request-promise';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ApexLogGet extends SfdxCommand {
  public static description = messages.getMessage('codeclean.check.description');
  public static examples = [];

  public static readonly flagsConfig = {
    id: flags.string({
      char: 'i',
      description: messages.getMessage('codeclean.flags.id'),
      required: true
    })
  };
github wadewegner / sfdx-waw-plugin / src / commands / waw / auth / username / login.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { AuthInfo, Messages } from '@salesforce/core';
import { AnyJson, getString } from '@salesforce/ts-types';
import * as jsforce from 'jsforce';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ApexLogGet extends SfdxCommand {
  public static description = messages.getMessage('auth.username.login.description');
  public static examples = [];

  public static readonly flagsConfig = {
    instanceurl: flags.url({
      char: 'r',
      description: messages.getMessage('auth.username.login.flags.instanceurl')
    }),
    username: flags.string({
      char: 'u',
github wadewegner / sfdx-waw-plugin / src / commands / waw / workbench / open.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Global, Messages, SfdxError } from '@salesforce/core';
import { JsonMap } from '@salesforce/ts-types';
import * as fsx from 'fs-extra';
import * as open from 'open';
import { join } from 'path';
import * as url from 'url';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('workbench.open.description');
  public static examples = [];

  protected static flagsConfig = {
    targetworkbenchurl: flags.string({
      char: 't',
      description: messages.getMessage('workbench.open.flags.targetworkbenchurl')
    }),
    setdefaultworkbenchurl: flags.string({
      char: 's',
github wadewegner / sfdx-waw-plugin / src / commands / waw / source / oss.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages, SfdxError } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import * as fs from 'fs';
import * as urlExists from 'url-exists';

import * as files from '../../../lib/files';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('source.oss.description');
  public static examples = [];

  public static readonly flagsConfig = {
    repository: flags.string({
      char: 'r',
      description: messages.getMessage('source.oss.flags.repository'),
      required: true
    }),
    path: flags.string({
github nawforce / ApexLink / assist / cli / src / commands / apexlink / check.ts View on Github external
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import { flags, SfdxCommand } from "@salesforce/command";
import { Messages, SfdxError } from "@salesforce/core";
import { AnyJson } from "@salesforce/ts-types";
import * as fs from "fs";
import { InfoMessages, MessageWriter, CSVWriter } from "../../api/messages";
import Org from "../../api/org";
import Server from "../../api/server";

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages("apexlink", "check");

export default class Check extends SfdxCommand {
  public static description = messages.getMessage("commandDescription");

  public static examples = [
    `$ sfdx apexlink:check`,
    `$ sfdx apexlink:check --verbose --warnings projects/myproject`,
    `$ sfdx apexlink:check --zombies --json myns=projects/base projects/extension`
  ];

  public static args = [
    {
github wadewegner / sfdx-waw-plugin / src / commands / waw / codeclean / results.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import { get } from 'request-promise';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ApexLogGet extends SfdxCommand {
  public static description = messages.getMessage('codeclean.results.description');
  public static examples = [];

  public static readonly flagsConfig = {
    id: flags.string({
      char: 'i',
      description: messages.getMessage('codeclean.flags.id'),
      required: true
    })
  };
github wadewegner / sfdx-waw-plugin / src / commands / waw / connectedapp / create.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { set } from '@salesforce/kit';
import { writeFile } from 'fs-extra';
import { MetadataInfo, SaveResult } from 'jsforce';
import * as forge from 'node-forge';
import { getSelfSignedCertificate } from '../../../lib/certs';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('connectedapp.create.description');
  public static examples = [];

  public static readonly flagsConfig = {
    name: flags.string({
      char: 'n',
      description: messages.getMessage('connectedapp.create.flags.name'),
      required: true
    }),
    label: flags.string({