Skip to content

Commit b955862

Browse files
authored
Merge pull request #70 from twilio/docs
documentation update
2 parents 02adaca + cee57da commit b955862

File tree

5 files changed

+106
-10
lines changed

5 files changed

+106
-10
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,31 @@
77

88
Twilio Flex plugins allow you to augment/change the behavior and appearance of a [Twilio Flex](https://www.twilio.com/flex) Contact Center using React.
99

10+
## User Guide
11+
12+
* [Creating a new plugin](packages/create-flex-plugin/README.md)
13+
* [Overriding configuration](packages/craco-config-flex-plugin/README.md)
14+
15+
## Changelog
16+
17+
Major changelogs can be found in the [changelog directory](/tree/master/changelog).
18+
1019
## Project Structure
1120

12-
This project is a monorepo project that is housing three separate packages for the creation of Twilio Flex plugins.
21+
This is a monorepo project managed by [lerna](https://github.com/lerna/lerna) for creating Twilio Flex plugins.
22+
23+
- [create-flex-plugin](packages/create-flex-plugin): The CLI tool to start a new Flex plugin project
24+
- [flex-plugin](packages/flex-plugin): Runtime dependency for Flex plugins
25+
- [craco-config-flex-plugin](packages/craco-config-flex-plugin): Config override for [craco](https://github.com/sharegate/craco) used to develop and build Flex plugins
1326

14-
- [`create-flex-plugin`](packages/create-flex-plugin) - The CLI tool to start a new Flex plugin project
15-
- [`flex-plugin`](packages/flex-plugin) - Runtime dependency for Flex plugins
16-
- [`craco-config-flex-plugin`](packages/craco-config-flex-plugin) - Config override for [`craco`](https://github.com/sharegate/craco) used to develop and build Flex plugins
1727

1828
## Contributing
1929

20-
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
30+
This project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
31+
32+
By cloning this project, you will be contributing to the plugin-builder itself. If you want to create a plugin instead, please instead use the guide in [creating a new plugin](packages/create-flex-plugin/README.md).
2133

22-
### 1. Create a fork of the project
34+
### 1. Create a Fork of the Project
2335

2436
Create a fork of this project for your GitHub user by clicking the `Fork` button at the top of this project
2537

@@ -32,14 +44,15 @@ npm install
3244
npx lerna bootstrap
3345
```
3446

35-
### 3. Contributing to a package
47+
### 3. Contributing to a Package
3648

37-
Please refer to the `README.md` of the respective packages in `packages/` for specific guidelines for those projects.
49+
Refer to the `README.md` of the respective packages in `packages/` for specific guidelines for those projects.
3850

3951
### 4. Submitting Changes
4052

4153
When you are happy with your changes, make sure to create a new branch with your changes and open a PR with your changes. For more info check out this [page describing the GitHub workflow](https://guides.github.com/introduction/flow/).
4254

55+
4356
## Contributors
4457

4558
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
File renamed without changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
![npm](https://img.shields.io/npm/v/craco-config-flex-plugin.svg?style=flat-square)
2+
![npm](https://img.shields.io/npm/dt/craco-config-flex-plugin.svg?style=flat-square)
3+
[![NpmLicense](https://img.shields.io/npm/l/craco-config-flex-plugin.svg?style=flat-square)](LICENSE.md)
4+
5+
# CRACO Config Flex Plugin
6+
7+
[CRACO](https://github.com/sharegate/craco) configuration override to build a Flex plugin.
8+
9+
## Installation
10+
11+
`craco-config-flex-plugin` dependency is added to your `package.json` when you create a new plugin with [create-flex-plugin](https://github.com/twilio/flex-plugin-builder/tree/master/packages/create-flex-plugin).
12+
13+
## Usage
14+
15+
You can edit the `craco.config.js` to provide your own configuration. Please visit [craco documentation](https://github.com/sharegate/craco/tree/master/packages/craco#configuration-overview) for more information.
16+
17+
## Contributing
18+
19+
Make sure to follow the instructions in the [main repository](https://github.com/twilio/flex-plugin-builder#contributing) to setup the project
20+
21+
```bash
22+
# Install dependencies and link local packages with each other
23+
cd packages/craco-config-flex-plugin
24+
npx lerna bootstrap
25+
26+
# Run tests
27+
npm test
28+
29+
# To use your local package in a different project
30+
npm link
31+
# then in a different project
32+
npm link craco-config-flex-plugin
33+
```
34+
35+
## Contributors
36+
37+
Thank you to all the lovely contributors to this project. Please check the main repository to see [all contributors](https://github.com/twilio/flex-plugin-builder#contributors).
38+
39+
## License
40+
41+
MIT

packages/create-flex-plugin/README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
![npm](https://img.shields.io/npm/dt/create-flex-plugin.svg?style=flat-square)
33
[![NpmLicense](https://img.shields.io/npm/l/create-flex-plugin.svg?style=flat-square)](LICENSE.md)
44

5-
# `create-flex-plugin`
5+
# Create Flex Plugin
66

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

@@ -47,11 +47,51 @@ name Name of your plugin. Needs to start with plugin-
4747
Options:
4848
--accountSid, -a The Account SID for your Flex Project
4949
--runtimeUrl, -r The URL to your Twilio Flex Runtime
50+
--template, -t A GitHub URL that contains your template
5051
--install Auto-install dependencies [boolean] [default: false]
5152
-h, --help Show help [boolean]
5253
-v, --version Show version number [boolean]
5354
```
5455

56+
### Creating a Plugin from Custom Template
57+
58+
When creating a new plugin, you may provide a `--template` URL to a GitHub page that contains your custom template.
59+
60+
#### Template Directory Hierarchy
61+
62+
Your GitHub project should be
63+
64+
```
65+
/
66+
template/
67+
src/
68+
index.js
69+
...
70+
...
71+
```
72+
73+
Create Flex Plugin will copy over the content from the `template` directory, and expects a `index.js`.
74+
75+
We will provide a `public/` folder as well as `package.json` but you may override these as well by providing them in your `template/` folder.
76+
77+
See [flex-plugin-template-sample](https://github.com/ktalebian/flex-plugin-template-sample) as an example.
78+
79+
#### Version Support
80+
81+
The `--template` link can contain a reference, which can be a `tag` or a `branch` name. For example
82+
83+
```
84+
create-flex-plugin --template https://github.com/ktalebian/flex-plugin-template-sample/tree/1.0.0
85+
```
86+
87+
would use the tagged version `1.0.0`, while
88+
89+
```
90+
create-flex-plugin --template https://github.com/ktalebian/flex-plugin-template-sample/tree/master
91+
```
92+
93+
would use the `master` branch.
94+
5595
## Contributing
5696

5797
Make sure to follow the instructions in the [main repository](https://github.com/twilio/flex-plugin-builder#contributing) to setup the project

packages/flex-plugin/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
![npm](https://img.shields.io/npm/dt/flex-plugin.svg?style=flat-square)
33
[![NpmLicense](https://img.shields.io/npm/l/flex-plugin.svg?style=flat-square)](LICENSE.md)
44

5-
# `flex-plugin`
5+
# Flex Plugin
66

77
Library to help building [Twilio Flex](https://www.twilio.com/flex) Plugins.
88

@@ -29,6 +29,8 @@ class MyPlugin extends FlexPlugin {
2929
loadPlugin(MyPlugin);
3030
```
3131

32+
Visit [Twilio Docs](https://www.twilio.com/docs/flex/tutorials/building-flex-plugins) for a tutorial on creating your first plugin.
33+
3234
## Contributing
3335

3436
Make sure to follow the instructions in the [main repository](https://github.com/twilio/flex-plugin-builder#contributing) to setup the project

0 commit comments

Comments
 (0)