@twilio/flex-plugin-core-utils
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Flex Plugin Core Utils

A core utility package written in Node TypeScript which helps build plugins for Flex.

It uses Facebook's JSCodeshift to parse through Flex plugin code and perform different operations like migration/validation.

Usage

Validate

Validates the given plugin files (TSX/JSX/TS/JS) for violation of a list of rules for a given Flex UI version. These rules include checks against the following:

  1. Flex UI API Compatibility
  2. Flex UI Dependency Conflicts
  3. Direct DOM Manipulation.

Method

validate(filePaths: string[], rules: Rules, config: RunnerConfig)

Arguments

  • filePaths - Paths to plugin files which needs to be validated
  • rules - List of rules to check violations for in the given plugin files
  • config - JSCodeshift runner configuration options

Migrate

Migrates the given plugin files (TSX/JSX/TS/JS) to use the latest Flex Declarative Component API used to build on top of Flex.

Method

migrate(filePaths: string[], config: RunnerConfig)

Arguments

  • filePaths - Paths to plugin files which needs to be migrated
  • config - JSCodeshift runner configuration options

Note:

This is an utility package used by Twilio Flex Plugin Builder internally and is not meant to be used as a stand-alone package. We do not support it for use outside of Twilio.

Readme

Keywords

none

Package Sidebar

Install

npm i @twilio/flex-plugin-core-utils

Weekly Downloads

22

Version

1.1.1

License

Apache-2.0

Unpacked Size

258 kB

Total Files

118

Last publish

Collaborators

  • flex-runtime