@mochabug/adaptkit 1.0.0-rc.24 → 1.0.0-rc.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -45
- package/assets/tsconf.json +1 -2
- package/bin/index.js +2 -2
- package/bin/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,82 +1,87 @@
|
|
|
1
|
-
# @mochabug/adaptkit
|
|
1
|
+
# @mochabug/adaptkit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**@mochabug/adaptkit** is the official CLI tool for developing and managing plugins for the Mochabug Adapt platform. Built with Node.js 22 compatibility, adaptkit streamlines the entire plugin development workflow.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- 🧙♂️ Emulate your plugins in a cloud environment with just a flick of your wand
|
|
7
|
-
- 🧚 Add and modify vertices to your plugin project with ease
|
|
8
|
-
- 🌟 Automagically handle tedious tasks that often bog down software development
|
|
5
|
+
## Key Features
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
- Create new plugin projects with scaffolding
|
|
8
|
+
- Add vertices (tasks) to existing plugins
|
|
9
|
+
- Emulate plugins locally for testing
|
|
10
|
+
- Publish plugins to the Mochabug Adapt platform
|
|
11
|
+
- Manage plugin versioning with semantic versioning
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
## Plugin Architecture
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
- **Action**: Performs tasks without interacting with external systems
|
|
16
|
-
- **Cron Trigger**: Triggers actions at specified intervals, like clockwork
|
|
17
|
-
- **External Trigger**: Activates tasks from an external endpoint, bringing the magic to the outside world
|
|
18
|
-
- **Browser**: Runs tasks within a browser, where requests end up on the external endpoint
|
|
15
|
+
Plugins are composed of **vertices** - the fundamental building blocks that define tasks. Each vertex consists of:
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
### Executor (Required)
|
|
18
|
+
The core logic that performs tasks. Available types:
|
|
19
|
+
- **Action** - Performs tasks without external system interactions
|
|
20
|
+
- **Cron Trigger** - Executes tasks at scheduled intervals
|
|
21
|
+
- **External Trigger** - Responds to external endpoint events
|
|
22
|
+
- **Browser** - Runs tasks within a browser environment
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
### Configurator (Optional)
|
|
25
|
+
Provides UI for customizing executor behavior on the Mochabug Adapt platform.
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
## Installation
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
30
|
npm install -g @mochabug/adaptkit
|
|
28
31
|
```
|
|
29
32
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
With @mochabug/adaptkit installed, you can now wield your newfound powers to develop and manage your plugin projects! Here's a guide to help you harness the magic:
|
|
33
|
-
|
|
34
|
-
1. **Create a template project for plugin development**
|
|
33
|
+
## Commands
|
|
35
34
|
|
|
35
|
+
### Initialize a Plugin Project
|
|
36
36
|
```bash
|
|
37
|
-
adaptkit
|
|
37
|
+
adaptkit init
|
|
38
38
|
```
|
|
39
|
+
Creates a new plugin with `manifest.json`, executor/configurator templates, and schema files.
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
2. **Emulate your plugins in the cloud environment**
|
|
43
|
-
|
|
41
|
+
### Add Vertices to Your Plugin
|
|
44
42
|
```bash
|
|
45
|
-
adaptkit
|
|
43
|
+
adaptkit add
|
|
46
44
|
```
|
|
45
|
+
Interactively adds new vertices to your existing plugin project.
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
### Emulate Plugin Locally
|
|
48
|
+
```bash
|
|
49
|
+
adaptkit emulate
|
|
50
|
+
```
|
|
51
|
+
Test your plugin in a local environment. Requires the Mochabug Adapt sandbox:
|
|
51
52
|
|
|
52
53
|
```bash
|
|
53
54
|
docker run --rm -it -p 51001:51001 -p 51002:51002 -p 51003:51003 -p 51004:51004 -p 51005:51005 mochabug/adaptsandbox:latest
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
1. **Add and modify vertices**
|
|
57
|
+
The 5 ports simulate different vertex types, the graphical interface, and the adaptkit publish endpoint.
|
|
59
58
|
|
|
59
|
+
### Publish to Mochabug Adapt
|
|
60
60
|
```bash
|
|
61
|
-
adaptkit
|
|
61
|
+
adaptkit publish
|
|
62
62
|
```
|
|
63
|
+
Deploy your plugin to the Mochabug Adapt platform for production use.
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
4. **Publish your plugin to the Mochabug Adapt platform**
|
|
67
|
-
|
|
65
|
+
### Version Management
|
|
68
66
|
```bash
|
|
69
|
-
adaptkit --
|
|
67
|
+
adaptkit version --patch # Increment patch version
|
|
68
|
+
adaptkit version --minor # Increment minor version
|
|
69
|
+
adaptkit version --major # Increment major version
|
|
70
70
|
```
|
|
71
|
+
Updates the semantic version in your plugin's `manifest.json`.
|
|
72
|
+
|
|
73
|
+
## Node.js 22 Compatibility
|
|
74
|
+
|
|
75
|
+
Adaptkit is built with full Node.js 22 support, leveraging modern JavaScript features and native ES modules for optimal performance and compatibility.
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
## Documentation
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
For comprehensive documentation and API references, visit [Mochabug Developer Portal](https://developers.mochabug.com).
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
## Contributing
|
|
77
82
|
|
|
78
|
-
|
|
83
|
+
We welcome community contributions! Please [open an issue](https://github.com/mochabug/adaptkit/issues) or [submit a pull request](https://github.com/mochabug/adaptkit/pulls) on GitHub.
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
## License
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
Apache License 2.0
|
package/assets/tsconf.json
CHANGED
package/bin/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// <define:__PACKAGE_JSON__>
|
|
4
|
-
var define_PACKAGE_JSON_default = { name: "@mochabug/adaptkit", version: "1.0.0-rc.
|
|
4
|
+
var define_PACKAGE_JSON_default = { name: "@mochabug/adaptkit", version: "1.0.0-rc.25" };
|
|
5
5
|
|
|
6
6
|
// node_modules/@bufbuild/protobuf/dist/esm/is-message.js
|
|
7
7
|
function isMessage(arg, schema) {
|
|
@@ -5084,7 +5084,7 @@ async function init(dir) {
|
|
|
5084
5084
|
const installSpinner = ora2("Setting up npm packages...").start();
|
|
5085
5085
|
try {
|
|
5086
5086
|
await execPromise2(
|
|
5087
|
-
"npm install --save-dev @mochabug/adapt-plugin-
|
|
5087
|
+
"npm install --save-dev @mochabug/adapt-plugin-builder typescript @types/node",
|
|
5088
5088
|
{
|
|
5089
5089
|
cwd
|
|
5090
5090
|
}
|