|
1 |
| -# Sample Webpack Addon |
| 1 | +# Telegram for Piecewise |
2 | 2 |
|
3 |
| -This directory includes a sample addon that can be compiled with Webpack. You may find this useful if you depend on, for example, third-party client-side libraries for your addon. |
| 3 | +This is an "officially-unofficial" addon for [Piecewise](https://piecewise.im/), a tool that allows you to build chat bots with blocks. |
4 | 4 |
|
5 |
| -## The gist of this |
| 5 | +## Use it |
6 | 6 |
|
7 |
| -Your Webpack addon must export, a default singular class library that binds to `plugin` and extends `LazuritePlugin`. This is easier said than done, thus this example. |
| 7 | +First, you'll need to purchase Piecewise on [Steam](https://store.steampowered.com/app/1702210/Piecewise_build_chat_bots_with_blocks/) or [itch.io](https://piecewiselabs.itch.io/). Then you'll need to download the `aimer` branch by following the instructions [here](https://doc.piecewise.im/tutorials/aimer/). |
8 | 8 |
|
9 |
| -## Get it running |
| 9 | +If you purchase and install Piecewise through Steam, you can then install the Telegram for Piecewise addon through the Steam Workshop [here](https://steamcommunity.com/sharedfiles/filedetails/?id=2982485357). I upload releases there occasionally. |
10 | 10 |
|
11 |
| -`cp sample-webpack-addon /my/sample/addon/dir && cd /my/sample/addon/dir && npm i && webpack --watch --mode development` |
| 11 | +You can also download the `im.piecewise.telegram.js` file from the Releases and drop it in your `addons` folder, next to `Piecewise.exe`, `Piecewise.app`, or `piecewise`. |
12 | 12 |
|
13 |
| -Linking the resulting `dist/main.js` to your addons folder will make it show up in Piecewise. Remember, you'll have to refresh the editor whenever you make a change. |
| 13 | +## Build it |
14 | 14 |
|
15 |
| -## Distribute your addon |
| 15 | +Everything is built into one .js file using `webpack`. Clone the repository, `npm i`, and then `npx webpack build --mode production`. Then you'll have a nice `main.js` file to drop into your `addons` directory. |
16 | 16 |
|
17 |
| -Once your addon is finished, build it: |
| 17 | +## Develop it |
18 | 18 |
|
19 |
| -`webpack build --mode production` |
| 19 | +For general information about creating Piecewise addons, see [the documentation](https://doc.piecewise.im/tutorials/plugins/). |
20 | 20 |
|
21 |
| -Then, the resulting `main.js` in `dist` should be all you need. To follow convention, name it using reverse-DNS notation, i.e. `im.piecewise.addon.js`. |
| 21 | +Similarly to building the package, you can run `webpack` with a `watch` parameter that will auto-rebuild the package when something changes. For example, you might run `webpack watch --mode development` and link the produced `dist/main.js` to your `addons` folder. |
| 22 | + |
| 23 | +## License |
| 24 | + |
| 25 | +This program is free software: you can redistribute it and/or modify |
| 26 | +it under the terms of the GNU General Public License as published by |
| 27 | +the Free Software Foundation, either version 3 of the License, or |
| 28 | +(at your option) any later version. |
| 29 | + |
| 30 | +This program is distributed in the hope that it will be useful, |
| 31 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 32 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 33 | +GNU General Public License for more details. |
| 34 | + |
| 35 | +You should have received a copy of the GNU General Public License |
| 36 | +along with this program. If not, see <https://www.gnu.org/licenses/>. |
0 commit comments