How to use the flex-dev-utils/dist/strings.multilineString 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 / pluginServer.ts View on Github external
export const _generatePluginServiceConfig = (port: number) => {
  const url = `'http://localhost:${port}/plugins';`;
  const str = multilineString(
    '// This file is auto-generated',
    'if (appConfig.pluginService.url === null) {',
    `  appConfig.pluginService.url = ${url}`,
    '}',
  );

  fs.writeFileSync(pluginsServiceConfigPath, str);
};
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / prints / finalMessage.ts View on Github external
const installCommand = config.yarn ? 'yarn' : 'npm install';
  const setupMessage = multilineString(
    `${headline('Setup:')}`,
    `$ cd ${config.name}/`,
    `$ ${installCommand}`,
  );

  const startCommand = `${tool} start`;
  const devMessage = multilineString(
    `${headline('Development:')}`,
    `$ cd ${config.name}/`,
    `$ ${startCommand}`,
  );

  const buildCommand = config.yarn ? 'yarn build' : 'npm run build';
  const buildMessage = multilineString(
    `${headline('Build Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${buildCommand}`,
  );

  const deployCommand = config.yarn ? 'yarn deploy' : 'npm run deploy';
  const deployMessage = multilineString(
    `${headline('Deploy Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${deployCommand}`,
  );

  let message = multilineString(
    `Your Twilio Flex Plugin project has been successfully created!`,
    `${config.install ? '' : `\n\n ${setupMessage}`}\n`,
    `${devMessage}\n`,
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / prints / finalMessage.ts View on Github external
const startCommand = `${tool} start`;
  const devMessage = multilineString(
    `${headline('Development:')}`,
    `$ cd ${config.name}/`,
    `$ ${startCommand}`,
  );

  const buildCommand = config.yarn ? 'yarn build' : 'npm run build';
  const buildMessage = multilineString(
    `${headline('Build Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${buildCommand}`,
  );

  const deployCommand = config.yarn ? 'yarn deploy' : 'npm run deploy';
  const deployMessage = multilineString(
    `${headline('Deploy Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${deployCommand}`,
  );

  let message = multilineString(
    `Your Twilio Flex Plugin project has been successfully created!`,
    `${config.install ? '' : `\n\n ${setupMessage}`}\n`,
    `${devMessage}\n`,
    `${buildMessage}\n`,
    `${deployMessage}\n`,
    'For more info check the README.md file or go to:',
    '➡ https://www.twilio.com/docs/flex',
  );

  const columns = (process.stdout.columns || 100) - 14;
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / prints / finalMessage.ts View on Github external
export default (config: FlexPluginArguments) => {
  const tool = config.yarn ? 'yarn' : 'npm';

  const installCommand = config.yarn ? 'yarn' : 'npm install';
  const setupMessage = multilineString(
    `${headline('Setup:')}`,
    `$ cd ${config.name}/`,
    `$ ${installCommand}`,
  );

  const startCommand = `${tool} start`;
  const devMessage = multilineString(
    `${headline('Development:')}`,
    `$ cd ${config.name}/`,
    `$ ${startCommand}`,
  );

  const buildCommand = config.yarn ? 'yarn build' : 'npm run build';
  const buildMessage = multilineString(
    `${headline('Build Command:')}`,
    `$ cd ${config.name}/`,
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / prints / finalMessage.ts View on Github external
export default (config: FlexPluginArguments) => {
  const tool = config.yarn ? 'yarn' : 'npm';

  const installCommand = config.yarn ? 'yarn' : 'npm install';
  const setupMessage = multilineString(
    `${headline('Setup:')}`,
    `$ cd ${config.name}/`,
    `$ ${installCommand}`,
  );

  const startCommand = `${tool} start`;
  const devMessage = multilineString(
    `${headline('Development:')}`,
    `$ cd ${config.name}/`,
    `$ ${startCommand}`,
  );

  const buildCommand = config.yarn ? 'yarn build' : 'npm run build';
  const buildMessage = multilineString(
    `${headline('Build Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${buildCommand}`,
  );

  const deployCommand = config.yarn ? 'yarn deploy' : 'npm run deploy';
  const deployMessage = multilineString(
    `${headline('Deploy Command:')}`,
    `$ cd ${config.name}/`,
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / prints / finalMessage.ts View on Github external
const buildCommand = config.yarn ? 'yarn build' : 'npm run build';
  const buildMessage = multilineString(
    `${headline('Build Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${buildCommand}`,
  );

  const deployCommand = config.yarn ? 'yarn deploy' : 'npm run deploy';
  const deployMessage = multilineString(
    `${headline('Deploy Command:')}`,
    `$ cd ${config.name}/`,
    `$ ${deployCommand}`,
  );

  let message = multilineString(
    `Your Twilio Flex Plugin project has been successfully created!`,
    `${config.install ? '' : `\n\n ${setupMessage}`}\n`,
    `${devMessage}\n`,
    `${buildMessage}\n`,
    `${deployMessage}\n`,
    'For more info check the README.md file or go to:',
    '➡ https://www.twilio.com/docs/flex',
  );

  const columns = (process.stdout.columns || 100) - 14;
  message = logger.wrap(message, columns, { hard: true });

  boxedInfo(message, false);
};
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / lib / cli.ts View on Github external
import yargs, { Argv, Options } from 'yargs';
import { multilineString } from 'flex-dev-utils/dist/strings';
import { runner } from 'flex-dev-utils';

import createFlexPlugin, { FlexPluginArguments } from './create-flex-plugin';

const usage = multilineString(
  'Creates a new Twilio Flex Plugin project',
  '',
  'Arguments:',
  'name\tName of your plugin. Needs to start with plugin-',
);

export interface CLIArguments {
  accountSid?: string;
  a?: string;
  runtimeUrl?: string;
  r?: string;
  install?: boolean;
  i?: boolean;
  name?: string;
  yarn?: boolean;
  y?: boolean;