npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@twilio/create-flex-plugin

v7.1.0

Published

Toolkit to create a new Twilio Flex plugin

Downloads

9,837

Readme

Version Download License

Create Flex Plugin

Command-line tool to create, develop and build a new Twilio Flex Plugin.

Usage

There is a variety of ways to use/install. The quickest way is:

npm init flex-plugin plugin-demo
cd plugin-demo
npm start

How to install/run using npm

Using npm:

# Via npm init
npm init flex-plugin plugin-demo

# Via npx
npx create-flex-plugin plugin-demo

# Install globally
npm install -g create-flex-plugin
create-flex-plugin plugin-demo

Using yarn:

# Via npm init
npm init flex-plugin plugin-demo --yarn

# Via npx
npx create-flex-plugin plugin-demo --yarn

# Install globally
npm install -g create-flex-plugin
create-flex-plugin plugin-demo --yarn

Note: Support for yarn only exists for @twilio/flex-ui > 1.18.0. If you are upgrading from an older version of the plugin-builder, you'll need to add add react-emotion and pin it to 9.2.6.

Command line arguments:

create-flex-plugin <name>

Creates a new Twilio Flex Plugin project

Arguments:
name    Name of your plugin. Needs to start with `plugin-`

Options:
  --accountSid, -a  The Account SID for your Flex Project
  --runtimeUrl, -r  The URL to your Twilio Flex Runtime
  --template, -t    A GitHub URL that contains your template
  --typescript, -s  Create a typescript project
  --install         Auto-install dependencies                   [boolean] [default: false]
  --yarn, -y        Use yarn 
  -h, --help        Show help                                   [boolean] [default: false]
  -v, --version     Show version number                         [boolean] [default: false]

Creating a Plugin from Custom Template

When creating a new plugin, you may provide a --template URL to a GitHub repo containing the source code of a Flex plugin. Create Flex Plugin will copy over the entire content from the directory, including all scripts, files and directories that are not part of the src folder. The repo has to be a valid node repository which means that it expects files such as package.json, .gitignore, README.md, etc to be present.

Template Directory Hierarchy

Your GitHub project should be

/
     src/
      index.js
      ...
    ...

Create Flex Plugin will copy over the content from the directory, and expects an index.js in the src folder. We will also provide a public/ folder and a package.json but you may override these by including them in your base GitHub repo.

See flex-plugin-template-sample for a basic example and plugin-agent-autoresponse for a more complete example.

Version Support

The --template link can contain a reference, which can be a tag or a branch name. For example

create-flex-plugin <plugin-name> --template https://github.com/ktalebian/flex-plugin-template-sample/tree/1.0.0

would use the tagged version 1.0.0, while

create-flex-plugin <plugin-name> --template https://github.com/ktalebian/flex-plugin-template-sample/tree/master

would use the master branch.

Contributing

Make sure to follow the instructions in the main repository to set up the project.

# Install dependencies and link local packages with each other
cd packages/create-flex-plugin
npx lerna bootstrap

# Run tests
npm test

# To execute your local version the CLI
npm link
create-flex-plugin --help

Contributors

Thank you to all the lovely contributors to this project. Please check the main repository to see all contributors.

License

MIT