@kubb/plugin-cypress 5.0.0-alpha.9 → 5.0.0-beta.10

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/dist/index.js CHANGED
@@ -1,79 +1,560 @@
1
1
  import "./chunk--u3MIqq1.js";
2
- import { n as camelCase } from "./components-BK_6GU4v.js";
3
- import { t as cypressGenerator } from "./generators-B3FWG2Ck.js";
4
- import path from "node:path";
5
- import { createPlugin, getBarrelFiles, getMode } from "@kubb/core";
6
- import { OperationGenerator, pluginOasName } from "@kubb/plugin-oas";
7
- import { pluginTsName } from "@kubb/plugin-ts";
2
+ import { ast, defineGenerator, definePlugin, defineResolver } from "@kubb/core";
3
+ import { functionPrinter, pluginTsName } from "@kubb/plugin-ts";
4
+ import { File, Function, jsxRenderer } from "@kubb/renderer-jsx";
5
+ import { jsx, jsxs } from "@kubb/renderer-jsx/jsx-runtime";
6
+ //#region ../../internals/utils/src/casing.ts
7
+ /**
8
+ * Shared implementation for camelCase and PascalCase conversion.
9
+ * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
10
+ * and capitalizes each word according to `pascal`.
11
+ *
12
+ * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
13
+ */
14
+ function toCamelOrPascal(text, pascal) {
15
+ return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
16
+ if (word.length > 1 && word === word.toUpperCase()) return word;
17
+ if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
18
+ return word.charAt(0).toUpperCase() + word.slice(1);
19
+ }).join("").replace(/[^a-zA-Z0-9]/g, "");
20
+ }
21
+ /**
22
+ * Splits `text` on `.` and applies `transformPart` to each segment.
23
+ * The last segment receives `isLast = true`, all earlier segments receive `false`.
24
+ * Segments are joined with `/` to form a file path.
25
+ *
26
+ * Only splits on dots followed by a letter so that version numbers
27
+ * embedded in operationIds (e.g. `v2025.0`) are kept intact.
28
+ */
29
+ function applyToFileParts(text, transformPart) {
30
+ const parts = text.split(/\.(?=[a-zA-Z])/);
31
+ return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
32
+ }
33
+ /**
34
+ * Converts `text` to camelCase.
35
+ * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
36
+ *
37
+ * @example
38
+ * camelCase('hello-world') // 'helloWorld'
39
+ * camelCase('pet.petId', { isFile: true }) // 'pet/petId'
40
+ */
41
+ function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
42
+ if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
43
+ prefix,
44
+ suffix
45
+ } : {}));
46
+ return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
47
+ }
48
+ //#endregion
49
+ //#region ../../internals/utils/src/reserved.ts
50
+ /**
51
+ * JavaScript and Java reserved words.
52
+ * @link https://github.com/jonschlinkert/reserved/blob/master/index.js
53
+ */
54
+ const reservedWords = new Set([
55
+ "abstract",
56
+ "arguments",
57
+ "boolean",
58
+ "break",
59
+ "byte",
60
+ "case",
61
+ "catch",
62
+ "char",
63
+ "class",
64
+ "const",
65
+ "continue",
66
+ "debugger",
67
+ "default",
68
+ "delete",
69
+ "do",
70
+ "double",
71
+ "else",
72
+ "enum",
73
+ "eval",
74
+ "export",
75
+ "extends",
76
+ "false",
77
+ "final",
78
+ "finally",
79
+ "float",
80
+ "for",
81
+ "function",
82
+ "goto",
83
+ "if",
84
+ "implements",
85
+ "import",
86
+ "in",
87
+ "instanceof",
88
+ "int",
89
+ "interface",
90
+ "let",
91
+ "long",
92
+ "native",
93
+ "new",
94
+ "null",
95
+ "package",
96
+ "private",
97
+ "protected",
98
+ "public",
99
+ "return",
100
+ "short",
101
+ "static",
102
+ "super",
103
+ "switch",
104
+ "synchronized",
105
+ "this",
106
+ "throw",
107
+ "throws",
108
+ "transient",
109
+ "true",
110
+ "try",
111
+ "typeof",
112
+ "var",
113
+ "void",
114
+ "volatile",
115
+ "while",
116
+ "with",
117
+ "yield",
118
+ "Array",
119
+ "Date",
120
+ "hasOwnProperty",
121
+ "Infinity",
122
+ "isFinite",
123
+ "isNaN",
124
+ "isPrototypeOf",
125
+ "length",
126
+ "Math",
127
+ "name",
128
+ "NaN",
129
+ "Number",
130
+ "Object",
131
+ "prototype",
132
+ "String",
133
+ "toString",
134
+ "undefined",
135
+ "valueOf"
136
+ ]);
137
+ /**
138
+ * Returns `true` when `name` is a syntactically valid JavaScript variable name.
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * isValidVarName('status') // true
143
+ * isValidVarName('class') // false (reserved word)
144
+ * isValidVarName('42foo') // false (starts with digit)
145
+ * ```
146
+ */
147
+ function isValidVarName(name) {
148
+ if (!name || reservedWords.has(name)) return false;
149
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name);
150
+ }
151
+ //#endregion
152
+ //#region ../../internals/utils/src/urlPath.ts
153
+ /**
154
+ * Parses and transforms an OpenAPI/Swagger path string into various URL formats.
155
+ *
156
+ * @example
157
+ * const p = new URLPath('/pet/{petId}')
158
+ * p.URL // '/pet/:petId'
159
+ * p.template // '`/pet/${petId}`'
160
+ */
161
+ var URLPath = class {
162
+ /**
163
+ * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
164
+ */
165
+ path;
166
+ #options;
167
+ constructor(path, options = {}) {
168
+ this.path = path;
169
+ this.#options = options;
170
+ }
171
+ /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * new URLPath('/pet/{petId}').URL // '/pet/:petId'
176
+ * ```
177
+ */
178
+ get URL() {
179
+ return this.toURLPath();
180
+ }
181
+ /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
182
+ *
183
+ * @example
184
+ * ```ts
185
+ * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
186
+ * new URLPath('/pet/{petId}').isURL // false
187
+ * ```
188
+ */
189
+ get isURL() {
190
+ try {
191
+ return !!new URL(this.path).href;
192
+ } catch {
193
+ return false;
194
+ }
195
+ }
196
+ /**
197
+ * Converts the OpenAPI path to a TypeScript template literal string.
198
+ *
199
+ * @example
200
+ * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
201
+ * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
202
+ */
203
+ get template() {
204
+ return this.toTemplateString();
205
+ }
206
+ /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * new URLPath('/pet/{petId}').object
211
+ * // { url: '/pet/:petId', params: { petId: 'petId' } }
212
+ * ```
213
+ */
214
+ get object() {
215
+ return this.toObject();
216
+ }
217
+ /** Returns a map of path parameter names, or `undefined` when the path has no parameters.
218
+ *
219
+ * @example
220
+ * ```ts
221
+ * new URLPath('/pet/{petId}').params // { petId: 'petId' }
222
+ * new URLPath('/pet').params // undefined
223
+ * ```
224
+ */
225
+ get params() {
226
+ return this.toParamsObject();
227
+ }
228
+ #transformParam(raw) {
229
+ const param = isValidVarName(raw) ? raw : camelCase(raw);
230
+ return this.#options.casing === "camelcase" ? camelCase(param) : param;
231
+ }
232
+ /**
233
+ * Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
234
+ */
235
+ #eachParam(fn) {
236
+ for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
237
+ const raw = match[1];
238
+ fn(raw, this.#transformParam(raw));
239
+ }
240
+ }
241
+ toObject({ type = "path", replacer, stringify } = {}) {
242
+ const object = {
243
+ url: type === "path" ? this.toURLPath() : this.toTemplateString({ replacer }),
244
+ params: this.toParamsObject()
245
+ };
246
+ if (stringify) {
247
+ if (type === "template") return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
248
+ if (object.params) return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
249
+ return `{ url: '${object.url}' }`;
250
+ }
251
+ return object;
252
+ }
253
+ /**
254
+ * Converts the OpenAPI path to a TypeScript template literal string.
255
+ * An optional `replacer` can transform each extracted parameter name before interpolation.
256
+ *
257
+ * @example
258
+ * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
259
+ */
260
+ toTemplateString({ prefix = "", replacer } = {}) {
261
+ return `\`${prefix}${this.path.split(/\{([^}]+)\}/).map((part, i) => {
262
+ if (i % 2 === 0) return part;
263
+ const param = this.#transformParam(part);
264
+ return `\${${replacer ? replacer(param) : param}}`;
265
+ }).join("")}\``;
266
+ }
267
+ /**
268
+ * Extracts all `{param}` segments from the path and returns them as a key-value map.
269
+ * An optional `replacer` transforms each parameter name in both key and value positions.
270
+ * Returns `undefined` when no path parameters are found.
271
+ *
272
+ * @example
273
+ * ```ts
274
+ * new URLPath('/pet/{petId}/tag/{tagId}').toParamsObject()
275
+ * // { petId: 'petId', tagId: 'tagId' }
276
+ * ```
277
+ */
278
+ toParamsObject(replacer) {
279
+ const params = {};
280
+ this.#eachParam((_raw, param) => {
281
+ const key = replacer ? replacer(param) : param;
282
+ params[key] = key;
283
+ });
284
+ return Object.keys(params).length > 0 ? params : void 0;
285
+ }
286
+ /** Converts the OpenAPI path to Express-style colon syntax.
287
+ *
288
+ * @example
289
+ * ```ts
290
+ * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
291
+ * ```
292
+ */
293
+ toURLPath() {
294
+ return this.path.replace(/\{([^}]+)\}/g, ":$1");
295
+ }
296
+ };
297
+ //#endregion
298
+ //#region ../../internals/shared/src/operation.ts
299
+ function getOperationParameters(node, options = {}) {
300
+ const params = ast.caseParams(node.parameters, options.paramsCasing);
301
+ return {
302
+ path: params.filter((param) => param.in === "path"),
303
+ query: params.filter((param) => param.in === "query"),
304
+ header: params.filter((param) => param.in === "header"),
305
+ cookie: params.filter((param) => param.in === "cookie")
306
+ };
307
+ }
308
+ function getStatusCodeNumber(statusCode) {
309
+ const code = Number(statusCode);
310
+ return Number.isNaN(code) ? void 0 : code;
311
+ }
312
+ function isErrorStatusCode(statusCode) {
313
+ const code = getStatusCodeNumber(statusCode);
314
+ return code !== void 0 && code >= 400;
315
+ }
316
+ function resolveErrorNames(node, resolver) {
317
+ return node.responses.filter((response) => isErrorStatusCode(response.statusCode)).map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
318
+ }
319
+ function resolveStatusCodeNames(node, resolver) {
320
+ return node.responses.map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
321
+ }
322
+ function resolveOperationTypeNames(node, resolver, options = {}) {
323
+ const { path, query, header } = getOperationParameters(node, { paramsCasing: options.paramsCasing });
324
+ const responseStatusNames = options.responseStatusNames === "error" ? resolveErrorNames(node, resolver) : options.responseStatusNames === false ? [] : resolveStatusCodeNames(node, resolver);
325
+ const exclude = new Set(options.exclude ?? []);
326
+ const paramNames = [
327
+ ...path.map((param) => resolver.resolvePathParamsName(node, param)),
328
+ ...query.map((param) => resolver.resolveQueryParamsName(node, param)),
329
+ ...header.map((param) => resolver.resolveHeaderParamsName(node, param))
330
+ ];
331
+ const bodyAndResponseNames = [node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : void 0, resolver.resolveResponseName(node)];
332
+ return (options.order === "body-response-first" ? [
333
+ ...bodyAndResponseNames,
334
+ ...paramNames,
335
+ ...responseStatusNames
336
+ ] : [
337
+ ...paramNames,
338
+ ...bodyAndResponseNames,
339
+ ...responseStatusNames
340
+ ]).filter((name) => Boolean(name) && !exclude.has(name));
341
+ }
342
+ //#endregion
343
+ //#region src/components/Request.tsx
344
+ const declarationPrinter = functionPrinter({ mode: "declaration" });
345
+ function Request({ baseURL = "", name, dataReturnType, resolver, node, paramsType, pathParamsType, paramsCasing }) {
346
+ const paramsNode = ast.createOperationParams(node, {
347
+ paramsType,
348
+ pathParamsType,
349
+ paramsCasing,
350
+ resolver,
351
+ extraParams: [ast.createFunctionParameter({
352
+ name: "options",
353
+ type: ast.createParamsType({
354
+ variant: "reference",
355
+ name: "Partial<Cypress.RequestOptions>"
356
+ }),
357
+ default: "{}"
358
+ })]
359
+ });
360
+ const paramsSignature = declarationPrinter.print(paramsNode) ?? "";
361
+ const responseType = resolver.resolveResponseName(node);
362
+ const returnType = dataReturnType === "data" ? `Cypress.Chainable<${responseType}>` : `Cypress.Chainable<Cypress.Response<${responseType}>>`;
363
+ const casedPathParams = getOperationParameters(node, { paramsCasing }).path;
364
+ const pathParamNameMap = new Map(casedPathParams.map((p) => [camelCase(p.name), p.name]));
365
+ const urlTemplate = new URLPath(node.path, { casing: paramsCasing }).toTemplateString({
366
+ prefix: baseURL,
367
+ replacer: (param) => pathParamNameMap.get(camelCase(param)) ?? param
368
+ });
369
+ const requestOptions = [`method: '${node.method}'`, `url: ${urlTemplate}`];
370
+ const queryParams = getOperationParameters(node).query;
371
+ if (queryParams.length > 0) {
372
+ const casedQueryParams = getOperationParameters(node, { paramsCasing }).query;
373
+ if (casedQueryParams.some((p, i) => p.name !== queryParams[i].name)) {
374
+ const pairs = queryParams.map((orig, i) => `${orig.name}: params.${casedQueryParams[i].name}`).join(", ");
375
+ requestOptions.push(`qs: params ? { ${pairs} } : undefined`);
376
+ } else requestOptions.push("qs: params");
377
+ }
378
+ const headerParams = getOperationParameters(node).header;
379
+ if (headerParams.length > 0) {
380
+ const casedHeaderParams = getOperationParameters(node, { paramsCasing }).header;
381
+ if (casedHeaderParams.some((p, i) => p.name !== headerParams[i].name)) {
382
+ const pairs = headerParams.map((orig, i) => `'${orig.name}': headers.${casedHeaderParams[i].name}`).join(", ");
383
+ requestOptions.push(`headers: headers ? { ${pairs} } : undefined`);
384
+ } else requestOptions.push("headers");
385
+ }
386
+ if (node.requestBody?.content?.[0]?.schema) requestOptions.push("body: data");
387
+ requestOptions.push("...options");
388
+ return /* @__PURE__ */ jsx(File.Source, {
389
+ name,
390
+ isIndexable: true,
391
+ isExportable: true,
392
+ children: /* @__PURE__ */ jsx(Function, {
393
+ name,
394
+ export: true,
395
+ params: paramsSignature,
396
+ returnType,
397
+ children: dataReturnType === "data" ? `return cy.request<${responseType}>({
398
+ ${requestOptions.join(",\n ")}
399
+ }).then((res) => res.body)` : `return cy.request<${responseType}>({
400
+ ${requestOptions.join(",\n ")}
401
+ })`
402
+ })
403
+ });
404
+ }
405
+ //#endregion
406
+ //#region src/generators/cypressGenerator.tsx
407
+ const cypressGenerator = defineGenerator({
408
+ name: "cypress",
409
+ renderer: jsxRenderer,
410
+ operation(node, ctx) {
411
+ const { adapter, config, resolver, driver, root } = ctx;
412
+ const { output, baseURL, dataReturnType, paramsCasing, paramsType, pathParamsType, group } = ctx.options;
413
+ const pluginTs = driver.getPlugin(pluginTsName);
414
+ if (!pluginTs) return null;
415
+ const tsResolver = driver.getResolver(pluginTsName);
416
+ const importedTypeNames = resolveOperationTypeNames(node, tsResolver, { paramsCasing });
417
+ const meta = {
418
+ name: resolver.resolveName(node.operationId),
419
+ file: resolver.resolveFile({
420
+ name: node.operationId,
421
+ extname: ".ts",
422
+ tag: node.tags[0] ?? "default",
423
+ path: node.path
424
+ }, {
425
+ root,
426
+ output,
427
+ group
428
+ }),
429
+ fileTs: tsResolver.resolveFile({
430
+ name: node.operationId,
431
+ extname: ".ts",
432
+ tag: node.tags[0] ?? "default",
433
+ path: node.path
434
+ }, {
435
+ root,
436
+ output: pluginTs.options?.output ?? output,
437
+ group: pluginTs.options?.group
438
+ })
439
+ };
440
+ return /* @__PURE__ */ jsxs(File, {
441
+ baseName: meta.file.baseName,
442
+ path: meta.file.path,
443
+ meta: meta.file.meta,
444
+ banner: resolver.resolveBanner(adapter.inputNode, {
445
+ output,
446
+ config
447
+ }),
448
+ footer: resolver.resolveFooter(adapter.inputNode, {
449
+ output,
450
+ config
451
+ }),
452
+ children: [meta.fileTs && importedTypeNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
453
+ name: importedTypeNames,
454
+ root: meta.file.path,
455
+ path: meta.fileTs.path,
456
+ isTypeOnly: true
457
+ }), /* @__PURE__ */ jsx(Request, {
458
+ name: meta.name,
459
+ node,
460
+ resolver: tsResolver,
461
+ dataReturnType,
462
+ paramsCasing,
463
+ paramsType,
464
+ pathParamsType,
465
+ baseURL
466
+ })]
467
+ });
468
+ }
469
+ });
470
+ //#endregion
471
+ //#region src/resolvers/resolverCypress.ts
472
+ /**
473
+ * Naming convention resolver for Cypress plugin.
474
+ *
475
+ * Provides default naming helpers using camelCase for functions and file paths.
476
+ *
477
+ * @example
478
+ * `resolverCypress.default('list pets', 'function') // → 'listPets'`
479
+ */
480
+ const resolverCypress = defineResolver(() => ({
481
+ name: "default",
482
+ pluginName: "plugin-cypress",
483
+ default(name, type) {
484
+ return camelCase(name, { isFile: type === "file" });
485
+ },
486
+ resolveName(name) {
487
+ return this.default(name, "function");
488
+ },
489
+ resolvePathName(name, type) {
490
+ return this.default(name, type);
491
+ }
492
+ }));
493
+ //#endregion
8
494
  //#region src/plugin.ts
495
+ /**
496
+ * Canonical plugin name for `@kubb/plugin-cypress`, used to identify the plugin
497
+ * in driver lookups and warnings.
498
+ */
9
499
  const pluginCypressName = "plugin-cypress";
10
- const pluginCypress = createPlugin((options) => {
500
+ /**
501
+ * The `@kubb/plugin-cypress` plugin factory.
502
+ *
503
+ * Generates Cypress `cy.request()` test functions from an OpenAPI/AST `RootNode`.
504
+ * Walks operations, delegates rendering to the active generators,
505
+ * and writes barrel files based on `output.barrelType`.
506
+ *
507
+ * @example
508
+ * ```ts
509
+ * import pluginCypress from '@kubb/plugin-cypress'
510
+ *
511
+ * export default defineConfig({
512
+ * plugins: [pluginCypress({ output: { path: 'cypress' } })],
513
+ * })
514
+ * ```
515
+ */
516
+ const pluginCypress = definePlugin((options) => {
11
517
  const { output = {
12
518
  path: "cypress",
13
519
  barrelType: "named"
14
- }, group, dataReturnType = "data", exclude = [], include, override = [], transformers = {}, generators = [cypressGenerator].filter(Boolean), contentType, baseURL, paramsCasing, paramsType = "inline", pathParamsType = paramsType === "object" ? "object" : options.pathParamsType || "inline" } = options;
520
+ }, group, exclude = [], include, override = [], dataReturnType = "data", baseURL, paramsCasing, paramsType = "inline", pathParamsType = paramsType === "object" ? "object" : options.pathParamsType || "inline", resolver: userResolver, transformer: userTransformer, generators: userGenerators = [] } = options;
521
+ const groupConfig = group ? {
522
+ ...group,
523
+ name: group.name ? group.name : (ctx) => {
524
+ if (group.type === "path") return `${ctx.group.split("/")[1]}`;
525
+ return `${camelCase(ctx.group)}Requests`;
526
+ }
527
+ } : void 0;
15
528
  return {
16
529
  name: pluginCypressName,
17
- options: {
18
- output,
19
- dataReturnType,
20
- group,
21
- baseURL,
22
- paramsCasing,
23
- paramsType,
24
- pathParamsType
25
- },
26
- pre: [pluginOasName, pluginTsName].filter(Boolean),
27
- resolvePath(baseName, pathMode, options) {
28
- const root = path.resolve(this.config.root, this.config.output.path);
29
- if ((pathMode ?? getMode(path.resolve(root, output.path))) === "single")
30
- /**
31
- * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
32
- * Other plugins then need to call addOrAppend instead of just add from the fileManager class
33
- */
34
- return path.resolve(root, output.path);
35
- if (group && (options?.group?.path || options?.group?.tag)) {
36
- const groupName = group?.name ? group.name : (ctx) => {
37
- if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
38
- return `${camelCase(ctx.group)}Requests`;
39
- };
40
- return path.resolve(root, output.path, groupName({ group: group.type === "path" ? options.group.path : options.group.tag }), baseName);
41
- }
42
- return path.resolve(root, output.path, baseName);
43
- },
44
- resolveName(name, type) {
45
- const resolvedName = camelCase(name, { isFile: type === "file" });
46
- if (type) return transformers?.name?.(resolvedName, type) || resolvedName;
47
- return resolvedName;
48
- },
49
- async install() {
50
- const root = path.resolve(this.config.root, this.config.output.path);
51
- const mode = getMode(path.resolve(root, output.path));
52
- const oas = await this.getOas();
53
- const files = await new OperationGenerator(this.plugin.options, {
54
- fabric: this.fabric,
55
- oas,
56
- driver: this.driver,
57
- events: this.events,
58
- plugin: this.plugin,
59
- contentType,
530
+ options,
531
+ dependencies: [pluginTsName],
532
+ hooks: { "kubb:plugin:setup"(ctx) {
533
+ const resolver = userResolver ? {
534
+ ...resolverCypress,
535
+ ...userResolver
536
+ } : resolverCypress;
537
+ ctx.setOptions({
538
+ output,
60
539
  exclude,
61
540
  include,
62
541
  override,
63
- mode
64
- }).build(...generators);
65
- await this.upsertFile(...files);
66
- const barrelFiles = await getBarrelFiles(this.fabric.files, {
67
- type: output.barrelType ?? "named",
68
- root,
69
- output,
70
- meta: { pluginName: this.plugin.name }
542
+ dataReturnType,
543
+ group: groupConfig,
544
+ baseURL,
545
+ paramsCasing,
546
+ paramsType,
547
+ pathParamsType,
548
+ resolver
71
549
  });
72
- await this.upsertFile(...barrelFiles);
73
- }
550
+ ctx.setResolver(resolver);
551
+ if (userTransformer) ctx.setTransformer(userTransformer);
552
+ ctx.addGenerator(cypressGenerator);
553
+ for (const gen of userGenerators) ctx.addGenerator(gen);
554
+ } }
74
555
  };
75
556
  });
76
557
  //#endregion
77
- export { pluginCypress, pluginCypressName };
558
+ export { Request, cypressGenerator, pluginCypress as default, pluginCypress, pluginCypressName, resolverCypress };
78
559
 
79
560
  //# sourceMappingURL=index.js.map