@kubb/plugin-faker 5.1.2 → 5.1.3
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/OVERVIEW.md +18 -0
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/kubb-extension.json +189 -0
- package/package.json +8 -5
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://kubb.dev/schemas/kubb-extension.json",
|
|
3
|
+
"kind": "plugin",
|
|
4
|
+
"name": "plugin-faker",
|
|
5
|
+
"export": "pluginFaker",
|
|
6
|
+
"displayName": "Faker",
|
|
7
|
+
"description": "Generates a Faker.js mock-data factory for every schema in your OpenAPI spec.",
|
|
8
|
+
"category": "mocks",
|
|
9
|
+
"icon": {
|
|
10
|
+
"light": "https://kubb.dev/feature/faker.svg"
|
|
11
|
+
},
|
|
12
|
+
"tags": ["faker", "mock-data", "mocks", "fixtures", "testing", "codegen", "openapi"],
|
|
13
|
+
"docs": "https://kubb.dev/plugins/plugin-faker",
|
|
14
|
+
"compatibility": {
|
|
15
|
+
"kubb": ">=5.8.0",
|
|
16
|
+
"node": ">=22"
|
|
17
|
+
},
|
|
18
|
+
"options": [
|
|
19
|
+
{
|
|
20
|
+
"key": "outputPath",
|
|
21
|
+
"path": ["output", "path"],
|
|
22
|
+
"label": "Output Path",
|
|
23
|
+
"description": "Output folder for generated files",
|
|
24
|
+
"type": "text",
|
|
25
|
+
"default": "mocks"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"key": "barrel",
|
|
29
|
+
"path": ["output", "barrel"],
|
|
30
|
+
"label": "Barrel",
|
|
31
|
+
"description": "How index.ts barrel files are generated",
|
|
32
|
+
"type": "select",
|
|
33
|
+
"default": {
|
|
34
|
+
"type": "named"
|
|
35
|
+
},
|
|
36
|
+
"choices": [
|
|
37
|
+
{
|
|
38
|
+
"label": "named",
|
|
39
|
+
"value": {
|
|
40
|
+
"type": "named"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "named (nested)",
|
|
45
|
+
"value": {
|
|
46
|
+
"type": "named",
|
|
47
|
+
"nested": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"label": "all",
|
|
52
|
+
"value": {
|
|
53
|
+
"type": "all"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "all (nested)",
|
|
58
|
+
"value": {
|
|
59
|
+
"type": "all",
|
|
60
|
+
"nested": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"label": "false (disabled)",
|
|
65
|
+
"value": false
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "outputMode",
|
|
71
|
+
"path": ["output", "mode"],
|
|
72
|
+
"label": "Output Mode",
|
|
73
|
+
"description": "How the plugin consolidates its code into files. File mode writes everything into a single file, so the output path must include a file extension and cannot be grouped.",
|
|
74
|
+
"type": "select",
|
|
75
|
+
"default": "directory",
|
|
76
|
+
"choices": [
|
|
77
|
+
{
|
|
78
|
+
"label": "directory (one file per schema)",
|
|
79
|
+
"value": "directory"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "file (single file)",
|
|
83
|
+
"value": "file"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"key": "group",
|
|
89
|
+
"path": ["group"],
|
|
90
|
+
"label": "Group",
|
|
91
|
+
"description": "Group generated operations by OpenAPI tag or path",
|
|
92
|
+
"type": "select",
|
|
93
|
+
"default": null,
|
|
94
|
+
"choices": [
|
|
95
|
+
{
|
|
96
|
+
"label": "none",
|
|
97
|
+
"value": null
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"label": "by tag",
|
|
101
|
+
"value": {
|
|
102
|
+
"type": "tag"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"label": "by path",
|
|
107
|
+
"value": {
|
|
108
|
+
"type": "path"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"key": "excludeTags",
|
|
115
|
+
"path": ["exclude"],
|
|
116
|
+
"label": "Exclude Tags",
|
|
117
|
+
"description": "Comma-separated OpenAPI tags to exclude from generation",
|
|
118
|
+
"type": "list",
|
|
119
|
+
"item": {
|
|
120
|
+
"type": "tag",
|
|
121
|
+
"pattern": "$item"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"key": "includeTags",
|
|
126
|
+
"path": ["include"],
|
|
127
|
+
"label": "Include Tags",
|
|
128
|
+
"description": "Comma-separated OpenAPI tags to include. Only operations with these tags are generated",
|
|
129
|
+
"type": "list",
|
|
130
|
+
"item": {
|
|
131
|
+
"type": "tag",
|
|
132
|
+
"pattern": "$item"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"key": "dateParser",
|
|
137
|
+
"path": ["dateParser"],
|
|
138
|
+
"label": "Date Parser",
|
|
139
|
+
"type": "select",
|
|
140
|
+
"default": "faker",
|
|
141
|
+
"choices": [
|
|
142
|
+
{
|
|
143
|
+
"label": "faker",
|
|
144
|
+
"value": "faker"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"label": "dayjs",
|
|
148
|
+
"value": "dayjs"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"label": "moment",
|
|
152
|
+
"value": "moment"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"key": "regexGenerator",
|
|
158
|
+
"path": ["regexGenerator"],
|
|
159
|
+
"label": "Regex Generator",
|
|
160
|
+
"type": "select",
|
|
161
|
+
"default": "faker",
|
|
162
|
+
"choices": [
|
|
163
|
+
{
|
|
164
|
+
"label": "faker",
|
|
165
|
+
"value": "faker"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"label": "randexp",
|
|
169
|
+
"value": "randexp"
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"key": "locale",
|
|
175
|
+
"path": ["locale"],
|
|
176
|
+
"label": "Locale",
|
|
177
|
+
"description": "Faker locale used for generated values",
|
|
178
|
+
"type": "text",
|
|
179
|
+
"default": "en"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"key": "seed",
|
|
183
|
+
"path": ["seed"],
|
|
184
|
+
"label": "Seed",
|
|
185
|
+
"description": "Fixed seed for consistent output",
|
|
186
|
+
"type": "number"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-faker",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "Generate Faker.js mock data factories with Kubb. Produces realistic seed data and fixtures for development and testing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-generation",
|
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
],
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
42
|
+
"kubb-extension.json",
|
|
43
|
+
"OVERVIEW.md",
|
|
42
44
|
"!/**/**.test.**",
|
|
43
45
|
"!/**/__tests__/**",
|
|
44
46
|
"!/**/__snapshots__/**"
|
|
@@ -64,24 +66,25 @@
|
|
|
64
66
|
"import": "./dist/index.js",
|
|
65
67
|
"require": "./dist/index.cjs"
|
|
66
68
|
},
|
|
67
|
-
"./package.json": "./package.json"
|
|
69
|
+
"./package.json": "./package.json",
|
|
70
|
+
"./kubb-extension.json": "./kubb-extension.json"
|
|
68
71
|
},
|
|
69
72
|
"publishConfig": {
|
|
70
73
|
"access": "public",
|
|
71
74
|
"registry": "https://registry.npmjs.org/"
|
|
72
75
|
},
|
|
73
76
|
"dependencies": {
|
|
74
|
-
"@kubb/plugin-ts": "^5.0.
|
|
77
|
+
"@kubb/plugin-ts": "^5.0.8"
|
|
75
78
|
},
|
|
76
79
|
"devDependencies": {
|
|
77
80
|
"@faker-js/faker": "^10.6.0",
|
|
78
81
|
"@internals/shared": "0.0.0",
|
|
79
82
|
"@internals/utils": "0.0.0",
|
|
80
|
-
"kubb": "^5.8.
|
|
83
|
+
"kubb": "^5.8.1"
|
|
81
84
|
},
|
|
82
85
|
"peerDependencies": {
|
|
83
86
|
"@faker-js/faker": "^10.0.0",
|
|
84
|
-
"kubb": "^5.8.
|
|
87
|
+
"kubb": "^5.8.1"
|
|
85
88
|
},
|
|
86
89
|
"peerDependenciesMeta": {
|
|
87
90
|
"@faker-js/faker": {
|