@twilio/flex-plugin-core-utils
v1.1.1
Published
Node utility package that helps migrate Flex plugins to use Flex Declarative Component APIs
Downloads
47
Readme
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:
- Flex UI API Compatibility
- Flex UI Dependency Conflicts
- Direct DOM Manipulation.
Method
validate(filePaths: string[], rules: Rules, config: RunnerConfig)
Arguments
filePaths
- Paths to plugin files which needs to be validatedrules
- List of rules to check violations for in the given plugin filesconfig
- 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 migratedconfig
- 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.