whistle.mockbubu 1.0.0-dev.3 → 1.0.0-dev.4
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 +63 -2
- package/package.json +1 -1
- package/README_EN.md +0 -60
package/README.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# whistle.mockbubu
|
|
2
2
|
|
|
3
|
+
whistle.mockbubu is an extension script plugin for [whistle](https://github.com/avwo/whistle) that provides the following features:
|
|
4
|
+
|
|
5
|
+
- Real-time generation of mock files from captured API responses
|
|
6
|
+
- Mock file management
|
|
7
|
+
|
|
8
|
+
# Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
$ w2 install whistle.mockbubu
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
# Usage
|
|
15
|
+
|
|
16
|
+
### Configure [whistle rules](https://avwo.github.io/whistle/rules/)
|
|
17
|
+
|
|
18
|
+
> Default mode uses pathname
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
pattern mockbubu://[mode]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Generate Mock Files
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
#### Pathname Mode: Uses the interface's origin + pathname as the filename
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
pattern mockbubu:// or pattern mockbubu://pathname
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> After configuring the rules and enabling the plugin, mockbubu will capture matching request data in real-time
|
|
35
|
+
|
|
36
|
+
[](https://postimg.cc/21Nw93SQ)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### Start Mocking
|
|
41
|
+
|
|
42
|
+
**Step 1:** Enable the mock switch for the file. When mockbubu intercepts the corresponding request, it will directly return the matched request data. After enabling the mock switch, you can manage file content in the Response panel.
|
|
43
|
+
|
|
44
|
+
**Step 2:** Manage file content in the Response panel
|
|
45
|
+
|
|
46
|
+
**Edit Files**
|
|
47
|
+
|
|
48
|
+
- Supports file editing
|
|
49
|
+
- Supports keyboard shortcuts for saving: Mac: Command + S / Windows: Ctrl + S
|
|
50
|
+
|
|
51
|
+
**Multiple Versions**
|
|
52
|
+
|
|
53
|
+
- Supports creating different versions of file content. Click to switch between different versions for instant effect and return that version's data
|
|
54
|
+
- The "source" version is the default generated version containing the original API response data and supports modification
|
|
55
|
+
|
|
56
|
+
**Switch Mock Files**
|
|
57
|
+
|
|
58
|
+
- Mock return content uses the currently selected version
|
|
59
|
+
|
|
60
|
+
[](https://postimg.cc/Js3Qfms9)
|
|
61
|
+
|
|
62
|
+
# whistle.mockbubu
|
|
63
|
+
|
|
3
64
|
whistle.mockbubu 是[whistle](https://github.com/avwo/whistle)的一个扩展脚本插件,包括以下功能
|
|
4
65
|
|
|
5
66
|
- 实时生成捕获接口的 mock 文件
|
|
@@ -30,7 +91,7 @@ pattern mockbubu:// 或者 pattern mockbubu://pathname
|
|
|
30
91
|
```
|
|
31
92
|
> 配置规则并开启插件后,mockbubu将实时获取匹配到的请求数据
|
|
32
93
|
|
|
33
|
-
](https://postimg.cc/21Nw93SQ)
|
|
34
95
|
|
|
35
96
|
---
|
|
36
97
|
|
|
@@ -55,4 +116,4 @@ pattern mockbubu:// 或者 pattern mockbubu://pathname
|
|
|
55
116
|
|
|
56
117
|
- mock 返回内容使用当前选中的版本
|
|
57
118
|
|
|
58
|
-
](https://postimg.cc/Js3Qfms9)
|
package/package.json
CHANGED
package/README_EN.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# whistle.mockbubu
|
|
2
|
-
|
|
3
|
-
whistle.mockbubu is an extension script plugin for [whistle](https://github.com/avwo/whistle) that provides the following features:
|
|
4
|
-
|
|
5
|
-
- Real-time generation of mock files from captured API responses
|
|
6
|
-
- Mock file management
|
|
7
|
-
|
|
8
|
-
# Installation
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
$ w2 install whistle.mockbubu
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
# Usage
|
|
15
|
-
|
|
16
|
-
### Configure [whistle rules](https://avwo.github.io/whistle/rules/)
|
|
17
|
-
|
|
18
|
-
> Default mode uses pathname
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
pattern mockbubu://[mode]
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Generate Mock Files
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
#### Pathname Mode: Uses the interface's origin + pathname as the filename
|
|
29
|
-
|
|
30
|
-
```text
|
|
31
|
-
pattern mockbubu:// or pattern mockbubu://pathname
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
> After configuring the rules and enabling the plugin, mockbubu will capture matching request data in real-time
|
|
35
|
-
|
|
36
|
-

|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
### Start Mocking
|
|
41
|
-
|
|
42
|
-
**Step 1:** Enable the mock switch for the file. When mockbubu intercepts the corresponding request, it will directly return the matched request data. After enabling the mock switch, you can manage file content in the Response panel.
|
|
43
|
-
|
|
44
|
-
**Step 2:** Manage file content in the Response panel
|
|
45
|
-
|
|
46
|
-
**Edit Files**
|
|
47
|
-
|
|
48
|
-
- Supports file editing
|
|
49
|
-
- Supports keyboard shortcuts for saving: Mac: Command + S / Windows: Ctrl + S
|
|
50
|
-
|
|
51
|
-
**Multiple Versions**
|
|
52
|
-
|
|
53
|
-
- Supports creating different versions of file content. Click to switch between different versions for instant effect and return that version's data
|
|
54
|
-
- The "source" version is the default generated version containing the original API response data and supports modification
|
|
55
|
-
|
|
56
|
-
**Switch Mock Files**
|
|
57
|
-
|
|
58
|
-
- Mock return content uses the currently selected version
|
|
59
|
-
|
|
60
|
-

|