Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
};
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`,
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;
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}/`,
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}/`,
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);
};
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;