How to use the flex-dev-utils.logger.debug function in flex-dev-utils

To help you get started, we’ve selected a few flex-dev-utils 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 twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / scripts / start.ts View on Github external
const start = async (...args: string[]) => {
  logger.debug('Running dev-server');

  // Finds the first available free port where two consecutive ports are free
  const port = await findPorts();
  process.env.PORT = port.toString();

  // This script runs after React Script is finished running
  process.env.BROWSER = join(__dirname, 'start', 'browser.js');

  const exitCode = await craco('start', ...args);
  exit(exitCode, args);
};
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / scripts / build.ts View on Github external
const build = async (...args: string[]) => {
  logger.debug('Building Flex plugin bundle');

  // This prints a hosting instruction specific to react applications
  // We should replace it with instruction about Twilio Assets
  // hijack('react-dev-utils/printHostingInstructions', () => {
  //   // to be filled
  // });

  const exitCode = await craco('build', ...args);
  exit(exitCode, args);
};
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / scripts / start.ts View on Github external
const start = () => {
  logger.debug('Running dev-server');

  // This will overwrite React App from opening the browser and allows us to control the flow
  process.env.BROWSER = join(__dirname, 'sub', 'browser.js');

  require(resolve(cracoScriptPath));
};
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / scripts / remove.ts View on Github external
const remove = async () => {
  logger.debug('Removing Flex plugin');

  const pluginName = logger.colors.blue(paths.packageName);
  const question = `Are you sure you want to permanently remove plugin ${pluginName}?`;
  const answer = await confirm(question, 'N');

  if (!answer) {
    return process.exit(0);
  }

  await _doRemove();
};
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / http.ts View on Github external
public upload = (url: string, formData: FormData): Promise => {
    logger.debug('Uploading formData to %s', url);
    logger.trace(formData);

    return axios
      .post(url, formData, {
        headers: formData.getHeaders(),
        auth: {
          username: this.config.auth.accountSid,
          password: this.config.auth.authToken,
        },
      })
      .then((resp) => resp.data)
      .catch(this.onError);
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / http.ts View on Github external
public get(uri: string): Promise {
    logger.debug('Making GET request to %s/%s', this.config.baseURL, uri);

    return this.client
      .get(uri)
      .then((resp) => resp.data || {});
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / scripts / deploy.ts View on Github external
const deploy = async (...argv: string[]) => {
  logger.debug('Deploying Flex plugin');

  const disallowVersioning = argv.includes('--disallow-versioning');
  let nextVersion = argv[1] as string;
  const bump = argv[0];
  const opts = {
    isPublic: argv.includes('--public'),
    overwrite: argv.includes('--overwrite') || disallowVersioning,
    disallowVersioning,
  };

  if (!disallowVersioning) {
    if (!allowedBumps.includes(bump)) {
      throw new FlexPluginError(`Version bump can only be one of ${allowedBumps.join(', ')}`);
    }

    if (bump === 'custom' && !argv[1]) {
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / scripts / check-start.ts View on Github external
const checkStart = async () => {
  logger.debug('Checking Flex plugin project directory');
  const allowSkip = process.env.SKIP_PREFLIGHT_CHECK === 'true';

  _checkAppConfig();
  _checkCracoConfig();
  _checkPublicDirSync(allowSkip);
  _checkExternalDepsVersions(allowSkip);
};
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / http.ts View on Github external
public post(uri: string, data: any): Promise {
    logger.debug('Making POST request to %s/%s with data %s', this.config.baseURL, uri, JSON.stringify(data));
    if (!this.jsonPOST) {
      data = stringify(data);
    }

    return this.client
      .post(uri, data)
      .then((resp) => resp.data);
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / http.ts View on Github external
public delete(uri: string): Promise {
    logger.debug('Making DELETE request to %s/%s', this.config.baseURL, uri);

    return this.client
      .delete(uri);
  }