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/flex-plugin-scripts

v7.0.7

Published

Scripts to run, build and deploy Flex plugins

Downloads

28,994

Readme

npm npm NpmLicense

Flex Plugin Scripts

Scripts to run, build, and deploy Flex plugin.

Installation

This repo will automatically be installed as part of creating a new plugin.

Verbose/Debug Mode

All scripts can run with DEBUG=1 for a more verbose mode. You may also use TRACE=1 for an even more verbose mode.

Customizing the Configuration

Plugin Builder is built using Webpack.js and uses Jest for testing. For users, they will not need to modify any of the Webpack/Jest configurations. For those who do, you can have full control over the Webpack/Jest!

Create a *.config.js in the root directory of your application. For Jest, create a jest.config.js. For Webpack, create a webpack.config.js. For Webpack DevServer, create a webpack.dev.js. Each of these configurations file should be of the format below:

module.exports = (config, { isProd, isDev, isTest }) => {
  /**
   * Modify the configuration and then return it
   */

  return config;
}

Scripts

Deploy

The deploy script is used to build and deploy your Flex plugin directly to Twilio Assets using the Serverless API.

Usage: npm run deploy -- {options}

The script will build and deploy your plugin to Twilio Assets using Serverless API. Please note that your AccountSid and AuthToken are required to use this script.

Options

--public

By default, plugins are uploaded as Private plugin. A plugin can be uploaded as Public by setting the --public flag:

npm run deploy -- --public

Multiple Accounts

Plugin Builder v3 stores your credentials locally in your keychain so you do not have to re-enter your credentials every time. If you like to provide a new set of AccountSid / AuthToken, you may set them as environmental variables before invoking the deploy command:

TWILIO_ACCOUNT_SID=ACxxx TWILIO_AUTH_TOKEN=abc123 npm run deploy

This will use the newly provided credentials and save them in the keychain as well. If you have multiple accounts saved in the keychain, you will be prompted to select on at runtime:

? Select from one of the following Account Sids (Use arrow keys)
❯ AC0000000000000000000000000000000 
  AC0000000000000000000000000000001
  AC0000000000000000000000000000002

Invoking with the TWILIO_ACCOUNT_SID environmental variable, however, will remove this step and the script will use the provided account.

Build

The build script bundles your plugin into a single minified JavaScript file.

Usage: npm run build

Test

The test scripts run your unit tests using jest.

Usage: npm run test

Start

The start scripts sets up the server locally so you develop your Flex plugin in real-time.

Usage: npm run start

Changing server port

By the default, the script will try to start a server on port 3000, or the first available port larger than 3000. You can provide a custom port using the PORT environmental variable:

PORT=4000 npm run start

Remove

The remove script removes/delete the the plugin permanently.

Usage: npm run remove

Info

The info script provides information about your plugin, including the version of important packages that are currently installed.

Use this script to provide information to the Twilio support team whenever you are having an issue with your plugin-builder.

Usage: npm run info

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/flex-plugin
npx lerna bootstrap

# Run tests
npm test

# To use your local package in a different project
npm link
# then in a different project
npm link flex-plugin

Contributors

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

License

MIT