Create a Widget
1. Prerequisites
Node.js 7 or higher.
AB Tasty Widget CLI.
The AB Tasty Widget CLI is required to develop and test a widget. To install it, enter:
npm install -g @abtasty/widget-cli
Note: you can also use yarn instead of npm.
2. Create your widget
Thanks to the AB Tasty widget CLI, you can easily create a production-ready widget right out of the box. It already follows our best practices! Just run the command below and answer the questions:
widget new
3. File structure
Once your widget is generated, you will find theses files in your project's folder:
src/main.js
This is the entry point of your widget's code. From here you can import other JS files, and use the latests versions of Javascript if you want to. See guide for javascript file.
src/form.js
Widget configuration form. See guide for configuration form.
icon.png
Widget icon (mandatory size: 200x200px). This is the icon that will be featured on the AB Tasty Marketplace.
4. Files locations
You can specify each file location in your package.json
as shown below (these are the default values):
"main": "dist/main.js",
"form": "dist/form.js",
"icon": "icon.png",