@kubb/plugin-cypress 5.0.12 → 5.0.14

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.cjs CHANGED
@@ -379,11 +379,11 @@ const cypressGenerator = (0, kubb_kit.defineGenerator)({
379
379
  //#region kubb-extension.json
380
380
  var compatibility = {
381
381
  "kubb": ">=5.8.3",
382
- "node": ">=22"
382
+ "node": ">=22.12"
383
383
  };
384
384
  //#endregion
385
385
  //#region package.json
386
- var version = "5.0.12";
386
+ var version = "5.0.14";
387
387
  //#endregion
388
388
  //#region src/resolvers/resolverCypress.ts
389
389
  /**
@@ -0,0 +1,132 @@
1
+ import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverPatch, ast } from "kubb/kit";
2
+ import { ResolverTs } from "@kubb/plugin-ts";
3
+ import { KubbReactNode } from "kubb/jsx";
4
+ //#region src/components/Request.d.ts
5
+ type Props = {
6
+ /**
7
+ * Name of the function
8
+ */
9
+ name: string;
10
+ /**
11
+ * AST operation node
12
+ */
13
+ node: ast.HttpOperationNode;
14
+ /**
15
+ * TypeScript resolver for resolving param/data/response type names
16
+ */
17
+ resolver: ResolverTs;
18
+ baseURL: string | null | undefined;
19
+ };
20
+ export declare function Request({ baseURL, name, resolver, node }: Props): KubbReactNode;
21
+ //#endregion
22
+ //#region src/types.d.ts
23
+ /**
24
+ * Resolver for Cypress that provides naming methods for test functions.
25
+ */
26
+ type ResolverCypress = Resolver;
27
+ /**
28
+ * Where the generated Cypress helpers are written and how they are exported, plus the optional
29
+ * `group` strategy. The `group` option organizes `output.mode: 'directory'` output into per-tag or per-path subdirectories.
30
+ *
31
+ * @default { path: 'cypress', barrel: { type: 'named' } }
32
+ */
33
+ type Options = OutputOptions & {
34
+ /**
35
+ * Base URL prepended to every request URL. When omitted, requests use the operation path
36
+ * only, so Cypress resolves it against its own `baseUrl`. The adapter's server URL is not used.
37
+ */
38
+ baseURL?: string;
39
+ /**
40
+ * Skip operations matching at least one entry in the list.
41
+ */
42
+ exclude?: Array<Exclude>;
43
+ /**
44
+ * Restrict generation to operations matching at least one entry in the list.
45
+ */
46
+ include?: Array<Include>;
47
+ /**
48
+ * Apply a different options object to operations matching a pattern.
49
+ */
50
+ override?: Array<Override<ResolvedOptions>>;
51
+ /**
52
+ * Override how helper names and file paths are built.
53
+ */
54
+ resolver?: ResolverPatch<ResolverCypress>;
55
+ /**
56
+ * Macros applied to each operation node before printing.
57
+ */
58
+ macros?: Array<ast.Macro>;
59
+ };
60
+ type ResolvedOptions = {
61
+ output: Output;
62
+ exclude: Array<Exclude>;
63
+ include: Array<Include> | undefined;
64
+ override: Array<Override<ResolvedOptions>>;
65
+ group: Group | null;
66
+ baseURL: Options['baseURL'] | undefined;
67
+ };
68
+ type PluginCypress = PluginType<'plugin-cypress', Options, ResolvedOptions, ResolverCypress>;
69
+ declare global {
70
+ namespace Kubb {
71
+ interface PluginRegistry {
72
+ 'plugin-cypress': PluginCypress;
73
+ }
74
+ }
75
+ }
76
+ //#endregion
77
+ //#region src/generators/cypressGenerator.d.ts
78
+ /**
79
+ * Built-in generator for `@kubb/plugin-cypress`. Emits one typed
80
+ * `cy.request()` wrapper per OpenAPI operation, ready to call inside Cypress
81
+ * test specs and custom commands.
82
+ */
83
+ export declare const cypressGenerator: import("kubb/kit").Generator<PluginCypress, unknown>;
84
+ //#endregion
85
+ //#region src/plugin.d.ts
86
+ /**
87
+ * Canonical plugin name for `@kubb/plugin-cypress`. Used for driver lookups and
88
+ * cross-plugin dependency references.
89
+ */
90
+ export declare const pluginCypressName = "plugin-cypress";
91
+ /**
92
+ * Generates one typed `cy.request()` wrapper per OpenAPI operation. Each helper
93
+ * has typed path params, body, query, and a typed response, so failing API
94
+ * calls in Cypress show up at compile time instead of inside the test runner.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * import { defineConfig } from 'kubb/config'
99
+ * import { pluginTs } from '@kubb/plugin-ts'
100
+ * import { pluginCypress } from '@kubb/plugin-cypress'
101
+ *
102
+ * export default defineConfig({
103
+ * input: './petStore.yaml',
104
+ * output: { path: './src/gen' },
105
+ * plugins: [
106
+ * pluginTs(),
107
+ * pluginCypress({
108
+ * output: { path: './cypress' },
109
+ * }),
110
+ * ],
111
+ * })
112
+ * ```
113
+ */
114
+ export declare const pluginCypress: import("kubb/kit").PluginFactory<PluginCypress>;
115
+ //#endregion
116
+ //#region src/resolvers/resolverCypress.d.ts
117
+ /**
118
+ * Default resolver used by `@kubb/plugin-cypress`. Decides the names and file
119
+ * paths for every generated `cy.request()` wrapper. Functions and files use
120
+ * camelCase, matching the convention from `@kubb/plugin-axios` and `@kubb/plugin-fetch`.
121
+ *
122
+ * @example Resolve a helper name
123
+ * ```ts
124
+ * import { resolverCypress } from '@kubb/plugin-cypress'
125
+ *
126
+ * resolverCypress.name('list pets') // 'listPets'
127
+ * ```
128
+ */
129
+ export declare const resolverCypress: import("kubb/kit").Resolver;
130
+ //#endregion
131
+ export { type PluginCypress, type ResolverCypress, pluginCypress as default };
132
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
1
  import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverPatch, ast } from "kubb/kit";
3
- import { KubbReactNode } from "kubb/jsx";
4
2
  import { ResolverTs } from "@kubb/plugin-ts";
3
+ import { KubbReactNode } from "kubb/jsx";
5
4
  //#region src/components/Request.d.ts
6
5
  type Props = {
7
6
  /**
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import "./rolldown-runtime-C0LytTxp.js";
2
1
  import { Resolver, Url, addGenerator, ast, createResolver, defineExtension, defineGenerator, setMacros, setResolver } from "kubb/kit";
3
2
  import { File, Function, jsxRenderer } from "kubb/jsx";
4
3
  import { jsx, jsxs } from "kubb/jsx/jsx-runtime";
5
4
  import { pluginTsName } from "@kubb/plugin-ts";
5
+ //#endregion
6
6
  //#region ../../internals/shared/src/operation.ts
7
7
  /**
8
8
  * Builds the `ResolverFileParams` every operation generator passes to
@@ -375,11 +375,11 @@ const cypressGenerator = defineGenerator({
375
375
  //#region kubb-extension.json
376
376
  var compatibility = {
377
377
  "kubb": ">=5.8.3",
378
- "node": ">=22"
378
+ "node": ">=22.12"
379
379
  };
380
380
  //#endregion
381
381
  //#region package.json
382
- var version = "5.0.12";
382
+ var version = "5.0.14";
383
383
  //#endregion
384
384
  //#region src/resolvers/resolverCypress.ts
385
385
  /**
@@ -20,7 +20,7 @@
20
20
  "dependencies": ["plugin-ts"],
21
21
  "compatibility": {
22
22
  "kubb": ">=5.8.3",
23
- "node": ">=22"
23
+ "node": ">=22.12"
24
24
  },
25
25
  "options": [
26
26
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-cypress",
3
- "version": "5.0.12",
3
+ "version": "5.0.14",
4
4
  "description": "Generate Cypress request commands and e2e test fixtures with Kubb for automated API testing.",
5
5
  "keywords": [
6
6
  "code-generation",
@@ -51,9 +51,14 @@
51
51
  "typesVersions": {},
52
52
  "exports": {
53
53
  ".": {
54
- "types": "./dist/index.d.ts",
55
- "import": "./dist/index.js",
56
- "require": "./dist/index.cjs"
54
+ "import": {
55
+ "types": "./dist/index.d.ts",
56
+ "default": "./dist/index.js"
57
+ },
58
+ "require": {
59
+ "types": "./dist/index.d.cts",
60
+ "default": "./dist/index.cjs"
61
+ }
57
62
  },
58
63
  "./package.json": "./package.json",
59
64
  "./kubb-extension.json": "./kubb-extension.json"
@@ -63,17 +68,17 @@
63
68
  "registry": "https://registry.npmjs.org/"
64
69
  },
65
70
  "dependencies": {
66
- "@kubb/plugin-ts": "^5.0.12"
71
+ "@kubb/plugin-ts": "^5.0.14"
67
72
  },
68
73
  "devDependencies": {
69
74
  "@internals/shared": "0.0.0",
70
75
  "@internals/utils": "0.0.0",
71
76
  "cypress": "^16.1.1",
72
- "kubb": "^5.10.2"
77
+ "kubb": "^5.10.3"
73
78
  },
74
79
  "peerDependencies": {
75
80
  "cypress": "^15.0.0 || ^16.0.0",
76
- "kubb": "^5.10.2"
81
+ "kubb": "^5.10.3"
77
82
  },
78
83
  "peerDependenciesMeta": {
79
84
  "cypress": {
@@ -81,7 +86,7 @@
81
86
  }
82
87
  },
83
88
  "engines": {
84
- "node": ">=22"
89
+ "node": ">=22.12"
85
90
  },
86
91
  "scripts": {
87
92
  "build": "tsdown",
@@ -1,8 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __name = (target, value) => __defProp(target, "name", {
4
- value,
5
- configurable: true
6
- });
7
- //#endregion
8
- export { __name as t };