@kubb/plugin-msw 5.0.0-beta.4 → 5.0.0-beta.56
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 +39 -22
- package/dist/{components-vO0FIb2i.js → components-Bi7cN-ws.js} +111 -199
- package/dist/components-Bi7cN-ws.js.map +1 -0
- package/dist/{components-CLQ77DVn.cjs → components-Bp69JYOt.cjs} +113 -213
- package/dist/components-Bp69JYOt.cjs.map +1 -0
- package/dist/components.cjs +1 -2
- package/dist/components.d.ts +6 -19
- package/dist/components.js +2 -2
- package/dist/{generators-BPJCs1x1.js → generators-BnEvTy3q.js} +71 -39
- package/dist/generators-BnEvTy3q.js.map +1 -0
- package/dist/{generators-CrmMwWE4.cjs → generators-d22_s2UN.cjs} +69 -37
- package/dist/generators-d22_s2UN.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +16 -5
- package/dist/generators.js +1 -1
- package/dist/index.cjs +112 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +33 -4
- package/dist/index.js +113 -18
- package/dist/index.js.map +1 -1
- package/dist/types-B1yTWOfj.d.ts +99 -0
- package/package.json +13 -23
- package/src/components/Mock.tsx +7 -6
- package/src/components/MockWithFaker.tsx +7 -6
- package/src/components/Response.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/generators/handlersGenerator.ts +49 -0
- package/src/generators/index.ts +1 -1
- package/src/generators/mswGenerator.tsx +27 -16
- package/src/plugin.ts +35 -19
- package/src/resolvers/resolverMsw.ts +21 -5
- package/src/types.ts +36 -26
- package/src/utils.ts +26 -61
- package/dist/components-CLQ77DVn.cjs.map +0 -1
- package/dist/components-vO0FIb2i.js.map +0 -1
- package/dist/generators-BPJCs1x1.js.map +0 -1
- package/dist/generators-CrmMwWE4.cjs.map +0 -1
- package/dist/types-Dxu0KMQ4.d.ts +0 -89
- package/extension.yaml +0 -260
- package/src/components/Handlers.tsx +0 -19
- package/src/generators/handlersGenerator.tsx +0 -41
- /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generators-BPJCs1x1.js","names":[],"sources":["../src/generators/handlersGenerator.tsx","../src/generators/mswGenerator.tsx"],"sourcesContent":["import { defineGenerator } from '@kubb/core'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\nimport { transformName } from '../utils.ts'\n\nexport const handlersGenerator = defineGenerator<PluginMsw>({\n name: 'plugin-msw',\n renderer: jsxRenderer,\n operations(nodes, ctx) {\n const { resolver, config, root, adapter } = ctx\n const { output, group, transformers } = ctx.options\n\n const file = resolver.resolveFile({ name: 'handlers', extname: '.ts' }, { root, output, group })\n\n const imports = nodes.map((node) => {\n const operationName = transformName(resolver.resolveName(node.operationId), 'function', transformers)\n const operationFile = resolver.resolveFile(\n { name: resolver.resolveName(node.operationId), extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group },\n )\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = nodes.map((node) => `${transformName(resolver.resolveName(node.operationId), 'function', transformers)}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n","import { defineGenerator } from '@kubb/core'\nimport { pluginFakerName } from '@kubb/plugin-faker'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Mock, MockWithFaker, Response } from '../components'\nimport type { PluginMsw } from '../types'\nimport { getResponseTypes, getSuccessResponses, resolveFakerMeta, transformName } from '../utils.ts'\n\nexport const mswGenerator = defineGenerator<PluginMsw>({\n name: 'msw',\n renderer: jsxRenderer,\n operation(node, ctx) {\n const { driver, resolver, config, root, adapter } = ctx\n const { output, parser, baseURL, group, transformers } = ctx.options\n\n const fileName = resolver.resolveName(node.operationId)\n const mock = {\n name: transformName(fileName, 'function', transformers),\n file: resolver.resolveFile({ name: fileName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n }\n\n const fakerPlugin = parser === 'faker' ? driver.getPlugin(pluginFakerName) : undefined\n const faker =\n parser === 'faker' && fakerPlugin\n ? resolveFakerMeta(node, {\n root,\n fakerResolver: driver.getResolver(pluginFakerName),\n fakerOutput: fakerPlugin.options?.output ?? output,\n fakerGroup: fakerPlugin.options?.group,\n })\n : undefined\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs) return null\n const tsResolver = driver.getResolver(pluginTsName)\n\n const type = {\n file: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group },\n ),\n responseName: tsResolver.resolveResponseName(node),\n }\n\n const types = getResponseTypes(node, tsResolver)\n const successResponses = getSuccessResponses(node)\n const hasSuccessSchema = successResponses.some((response) => !!response.schema)\n\n const requestName = node.requestBody?.content?.[0]?.schema ? tsResolver.resolveDataName(node) : undefined\n\n return (\n <File\n baseName={mock.file.baseName}\n path={mock.file.path}\n meta={mock.file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['HttpResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import\n name={Array.from(new Set([type.responseName, ...types.map((t) => t[1]), ...(requestName ? [requestName] : [])]))}\n path={type.file.path}\n root={mock.file.path}\n isTypeOnly\n />\n {parser === 'faker' && faker && <File.Import name={[faker.name]} root={mock.file.path} path={faker.file.path} />}\n\n {types\n .filter(([code]) => code !== 'default')\n .map(([code, typeName]) => {\n const response = node.responses.find((item) => item.statusCode === String(code))\n if (!response) return null\n return <Response key={typeName} typeName={typeName} response={response} name={mock.name} />\n })}\n\n {parser === 'faker' && faker && hasSuccessSchema ? (\n <MockWithFaker name={mock.name} typeName={type.responseName} requestTypeName={requestName} fakerName={faker.name} node={node} baseURL={baseURL} />\n ) : (\n <Mock name={mock.name} typeName={type.responseName} requestTypeName={requestName} node={node} baseURL={baseURL} />\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;AAMA,MAAa,oBAAoB,gBAA2B;CAC1D,MAAM;CACN,UAAU;CACV,WAAW,OAAO,KAAK;EACrB,MAAM,EAAE,UAAU,QAAQ,MAAM,YAAY;EAC5C,MAAM,EAAE,QAAQ,OAAO,iBAAiB,IAAI;EAE5C,MAAM,OAAO,SAAS,YAAY;GAAE,MAAM;GAAY,SAAS;GAAO,EAAE;GAAE;GAAM;GAAQ;GAAO,CAAC;EAEhG,MAAM,UAAU,MAAM,KAAK,SAAS;GAClC,MAAM,gBAAgB,cAAc,SAAS,YAAY,KAAK,YAAY,EAAE,YAAY,aAAa;GACrG,MAAM,gBAAgB,SAAS,YAC7B;IAAE,MAAM,SAAS,YAAY,KAAK,YAAY;IAAE,SAAS;IAAO,KAAK,KAAK,KAAK,MAAM;IAAW,MAAM,KAAK;IAAM,EACjH;IAAE;IAAM;IAAQ;IAAO,CACxB;AAED,UAAO,oBAAC,KAAK,QAAN;IAAsC,MAAM,CAAC,cAAc;IAAE,MAAM,KAAK;IAAM,MAAM,cAAc;IAAQ,EAAxF,cAAc,KAA0E;IACjH;EAEF,MAAM,WAAW,MAAM,KAAK,SAAS,GAAG,cAAc,SAAS,YAAY,KAAK,YAAY,EAAE,YAAY,aAAa,CAAC,IAAI;AAE5H,SACE,qBAAC,MAAD;GACE,UAAU,KAAK;GACf,MAAM,KAAK;GACX,MAAM,KAAK;GACX,QAAQ,SAAS,cAAc,QAAQ,WAAW;IAAE;IAAQ;IAAQ,CAAC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AAK;KAAc,iBAAiB;KAAa,WAAW,MAAM;KAAY;KAAe;KAAW,CAAA,GAElJ,oBAAC,MAAD;KAAM,MAAM,KAAK;KAAM,UAAU,KAAK;KAAc,iBAAiB;KAAmB;KAAe;KAAW,CAAA;IAE/G;;;CAGZ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generators-CrmMwWE4.cjs","names":["jsxRenderer","transformName","File","Handlers","jsxRenderer","transformName","pluginFakerName","resolveFakerMeta","pluginTsName","getResponseTypes","getSuccessResponses","File","Response","MockWithFaker","Mock"],"sources":["../src/generators/handlersGenerator.tsx","../src/generators/mswGenerator.tsx"],"sourcesContent":["import { defineGenerator } from '@kubb/core'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\nimport { transformName } from '../utils.ts'\n\nexport const handlersGenerator = defineGenerator<PluginMsw>({\n name: 'plugin-msw',\n renderer: jsxRenderer,\n operations(nodes, ctx) {\n const { resolver, config, root, adapter } = ctx\n const { output, group, transformers } = ctx.options\n\n const file = resolver.resolveFile({ name: 'handlers', extname: '.ts' }, { root, output, group })\n\n const imports = nodes.map((node) => {\n const operationName = transformName(resolver.resolveName(node.operationId), 'function', transformers)\n const operationFile = resolver.resolveFile(\n { name: resolver.resolveName(node.operationId), extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group },\n )\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = nodes.map((node) => `${transformName(resolver.resolveName(node.operationId), 'function', transformers)}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n","import { defineGenerator } from '@kubb/core'\nimport { pluginFakerName } from '@kubb/plugin-faker'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Mock, MockWithFaker, Response } from '../components'\nimport type { PluginMsw } from '../types'\nimport { getResponseTypes, getSuccessResponses, resolveFakerMeta, transformName } from '../utils.ts'\n\nexport const mswGenerator = defineGenerator<PluginMsw>({\n name: 'msw',\n renderer: jsxRenderer,\n operation(node, ctx) {\n const { driver, resolver, config, root, adapter } = ctx\n const { output, parser, baseURL, group, transformers } = ctx.options\n\n const fileName = resolver.resolveName(node.operationId)\n const mock = {\n name: transformName(fileName, 'function', transformers),\n file: resolver.resolveFile({ name: fileName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n }\n\n const fakerPlugin = parser === 'faker' ? driver.getPlugin(pluginFakerName) : undefined\n const faker =\n parser === 'faker' && fakerPlugin\n ? resolveFakerMeta(node, {\n root,\n fakerResolver: driver.getResolver(pluginFakerName),\n fakerOutput: fakerPlugin.options?.output ?? output,\n fakerGroup: fakerPlugin.options?.group,\n })\n : undefined\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs) return null\n const tsResolver = driver.getResolver(pluginTsName)\n\n const type = {\n file: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group },\n ),\n responseName: tsResolver.resolveResponseName(node),\n }\n\n const types = getResponseTypes(node, tsResolver)\n const successResponses = getSuccessResponses(node)\n const hasSuccessSchema = successResponses.some((response) => !!response.schema)\n\n const requestName = node.requestBody?.content?.[0]?.schema ? tsResolver.resolveDataName(node) : undefined\n\n return (\n <File\n baseName={mock.file.baseName}\n path={mock.file.path}\n meta={mock.file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['HttpResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import\n name={Array.from(new Set([type.responseName, ...types.map((t) => t[1]), ...(requestName ? [requestName] : [])]))}\n path={type.file.path}\n root={mock.file.path}\n isTypeOnly\n />\n {parser === 'faker' && faker && <File.Import name={[faker.name]} root={mock.file.path} path={faker.file.path} />}\n\n {types\n .filter(([code]) => code !== 'default')\n .map(([code, typeName]) => {\n const response = node.responses.find((item) => item.statusCode === String(code))\n if (!response) return null\n return <Response key={typeName} typeName={typeName} response={response} name={mock.name} />\n })}\n\n {parser === 'faker' && faker && hasSuccessSchema ? (\n <MockWithFaker name={mock.name} typeName={type.responseName} requestTypeName={requestName} fakerName={faker.name} node={node} baseURL={baseURL} />\n ) : (\n <Mock name={mock.name} typeName={type.responseName} requestTypeName={requestName} node={node} baseURL={baseURL} />\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;AAMA,MAAa,qBAAA,GAAA,WAAA,iBAA+C;CAC1D,MAAM;CACN,UAAUA,mBAAAA;CACV,WAAW,OAAO,KAAK;EACrB,MAAM,EAAE,UAAU,QAAQ,MAAM,YAAY;EAC5C,MAAM,EAAE,QAAQ,OAAO,iBAAiB,IAAI;EAE5C,MAAM,OAAO,SAAS,YAAY;GAAE,MAAM;GAAY,SAAS;GAAO,EAAE;GAAE;GAAM;GAAQ;GAAO,CAAC;EAEhG,MAAM,UAAU,MAAM,KAAK,SAAS;GAClC,MAAM,gBAAgBC,mBAAAA,cAAc,SAAS,YAAY,KAAK,YAAY,EAAE,YAAY,aAAa;GACrG,MAAM,gBAAgB,SAAS,YAC7B;IAAE,MAAM,SAAS,YAAY,KAAK,YAAY;IAAE,SAAS;IAAO,KAAK,KAAK,KAAK,MAAM;IAAW,MAAM,KAAK;IAAM,EACjH;IAAE;IAAM;IAAQ;IAAO,CACxB;AAED,UAAO,iBAAA,GAAA,+BAAA,KAACC,mBAAAA,KAAK,QAAN;IAAsC,MAAM,CAAC,cAAc;IAAE,MAAM,KAAK;IAAM,MAAM,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CAAC,CAAC;KAChH,MAAM,KAAK,KAAK;KAChB,MAAM,KAAK,KAAK;KAChB,YAAA;KACA,CAAA;IACD,WAAW,WAAW,SAAS,iBAAA,GAAA,+BAAA,KAACA,mBAAAA,KAAK,QAAN;KAAa,MAAM,CAAC,MAAM,KAAK;KAAE,MAAM,KAAK,KAAK;KAAM,MAAM,MAAM,KAAK;KAAQ,CAAA;IAE/G,MACE,QAAQ,CAAC,UAAU,SAAS,UAAU,CACtC,KAAK,CAAC,MAAM,cAAc;KACzB,MAAM,WAAW,KAAK,UAAU,MAAM,SAAS,KAAK,eAAe,OAAO,KAAK,CAAC;AAChF,SAAI,CAAC,SAAU,QAAO;AACtB,YAAO,iBAAA,GAAA,+BAAA,KAACC,mBAAAA,UAAD;MAAmC;MAAoB;MAAU,MAAM,KAAK;MAAQ,EAArE,SAAqE;MAC3F;IAEH,WAAW,WAAW,SAAS,mBAC9B,iBAAA,GAAA,+BAAA,KAACC,mBAAAA,eAAD;KAAe,MAAM,KAAK;KAAM,UAAU,KAAK;KAAc,iBAAiB;KAAa,WAAW,MAAM;KAAY;KAAe;KAAW,CAAA,GAElJ,iBAAA,GAAA,+BAAA,KAACC,mBAAAA,MAAD;KAAM,MAAM,KAAK;KAAM,UAAU,KAAK;KAAc,iBAAiB;KAAmB;KAAe;KAAW,CAAA;IAE/G;;;CAGZ,CAAC"}
|
package/dist/types-Dxu0KMQ4.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { Exclude, Generator, Group, Include, Output, Override, PluginFactoryOptions, ResolveNameParams, Resolver, ast } from "@kubb/core";
|
|
3
|
-
|
|
4
|
-
//#region src/types.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Resolver for MSW that provides naming methods for handler functions.
|
|
7
|
-
*/
|
|
8
|
-
type ResolverMsw = Resolver & {
|
|
9
|
-
/**
|
|
10
|
-
* Resolves the handler function name for an operation.
|
|
11
|
-
*/
|
|
12
|
-
resolveName(this: ResolverMsw, name: string): string;
|
|
13
|
-
};
|
|
14
|
-
type Options = {
|
|
15
|
-
/**
|
|
16
|
-
* Specify the export location for the files and define the behavior of the output
|
|
17
|
-
* @default { path: 'handlers', barrelType: 'named' }
|
|
18
|
-
*/
|
|
19
|
-
output?: Output;
|
|
20
|
-
baseURL?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Group the MSW mocks based on the provided name.
|
|
23
|
-
*/
|
|
24
|
-
group?: Group;
|
|
25
|
-
/**
|
|
26
|
-
* Tags, operations, or paths to exclude from generation.
|
|
27
|
-
*/
|
|
28
|
-
exclude?: Array<Exclude>;
|
|
29
|
-
/**
|
|
30
|
-
* Tags, operations, or paths to include in generation.
|
|
31
|
-
*/
|
|
32
|
-
include?: Array<Include>;
|
|
33
|
-
/**
|
|
34
|
-
* Override options for specific tags, operations, or paths.
|
|
35
|
-
*/
|
|
36
|
-
override?: Array<Override<ResolvedOptions>>;
|
|
37
|
-
transformers?: {
|
|
38
|
-
/**
|
|
39
|
-
* Override the default naming for handlers.
|
|
40
|
-
*/
|
|
41
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Override naming conventions for function names and types.
|
|
45
|
-
*/
|
|
46
|
-
resolver?: Partial<ResolverMsw> & ThisType<ResolverMsw>;
|
|
47
|
-
/**
|
|
48
|
-
* AST visitor to transform generated nodes.
|
|
49
|
-
*/
|
|
50
|
-
transformer?: ast.Visitor;
|
|
51
|
-
/**
|
|
52
|
-
* Create `handlers.ts` file with all handlers grouped by methods.
|
|
53
|
-
* @default false
|
|
54
|
-
*/
|
|
55
|
-
handlers?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Which parser to use for generating response data.
|
|
58
|
-
*
|
|
59
|
-
* @default 'data'
|
|
60
|
-
*/
|
|
61
|
-
parser?: 'data' | 'faker';
|
|
62
|
-
/**
|
|
63
|
-
* Additional generators alongside the default generators.
|
|
64
|
-
*/
|
|
65
|
-
generators?: Array<Generator<PluginMsw>>;
|
|
66
|
-
};
|
|
67
|
-
type ResolvedOptions = {
|
|
68
|
-
output: Output;
|
|
69
|
-
group: Group | undefined;
|
|
70
|
-
exclude: NonNullable<Options['exclude']>;
|
|
71
|
-
include: Options['include'];
|
|
72
|
-
override: NonNullable<Options['override']>;
|
|
73
|
-
parser: NonNullable<Options['parser']>;
|
|
74
|
-
baseURL: Options['baseURL'] | undefined;
|
|
75
|
-
handlers: boolean;
|
|
76
|
-
transformers: NonNullable<Options['transformers']>;
|
|
77
|
-
resolver: ResolverMsw;
|
|
78
|
-
};
|
|
79
|
-
type PluginMsw = PluginFactoryOptions<'plugin-msw', Options, ResolvedOptions, ResolverMsw>;
|
|
80
|
-
declare global {
|
|
81
|
-
namespace Kubb {
|
|
82
|
-
interface PluginRegistry {
|
|
83
|
-
'plugin-msw': PluginMsw;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
export { PluginMsw as n, Options as t };
|
|
89
|
-
//# sourceMappingURL=types-Dxu0KMQ4.d.ts.map
|
package/extension.yaml
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
$schema: https://kubb.dev/schemas/extension.json
|
|
2
|
-
kind: plugin
|
|
3
|
-
id: plugin-msw
|
|
4
|
-
name: MSW
|
|
5
|
-
description: Generate Mock Service Worker (MSW) handlers from OpenAPI specifications.
|
|
6
|
-
category: mocks
|
|
7
|
-
type: official
|
|
8
|
-
npmPackage: "@kubb/plugin-msw"
|
|
9
|
-
docsPath: /plugins/plugin-msw
|
|
10
|
-
repo: https://github.com/kubb-labs/plugins
|
|
11
|
-
maintainers:
|
|
12
|
-
- name: Stijn Van Hulle
|
|
13
|
-
github: stijnvanhulle
|
|
14
|
-
compatibility:
|
|
15
|
-
kubb: ">=5.0.0"
|
|
16
|
-
node: ">=22"
|
|
17
|
-
tags:
|
|
18
|
-
- msw
|
|
19
|
-
- mock-service-worker
|
|
20
|
-
- api-mocking
|
|
21
|
-
- mocks
|
|
22
|
-
- testing
|
|
23
|
-
- codegen
|
|
24
|
-
- openapi
|
|
25
|
-
dependencies:
|
|
26
|
-
- plugin-ts
|
|
27
|
-
- plugin-faker
|
|
28
|
-
resources:
|
|
29
|
-
documentation: https://kubb.dev/plugins/plugin-msw
|
|
30
|
-
repository: https://github.com/kubb-labs/plugins
|
|
31
|
-
issues: https://github.com/kubb-labs/plugins/issues
|
|
32
|
-
changelog: https://github.com/kubb-labs/plugins/blob/main/packages/plugin-msw/CHANGELOG.md
|
|
33
|
-
codesandbox: https://codesandbox.io/p/github/kubb-labs/plugins/main/examples/msw
|
|
34
|
-
featured: false
|
|
35
|
-
icon:
|
|
36
|
-
light: https://kubb.dev/feature/msw.svg
|
|
37
|
-
intro: |
|
|
38
|
-
# @kubb/plugin-msw
|
|
39
|
-
|
|
40
|
-
Generate [MSW](https://mswjs.io/) API mock handlers from your OpenAPI schema. Mock API requests in development and tests with type-safe handlers.
|
|
41
|
-
options:
|
|
42
|
-
- name: output
|
|
43
|
-
type: Output
|
|
44
|
-
required: false
|
|
45
|
-
default: "{ path: 'handlers', barrelType: 'named' }"
|
|
46
|
-
description: Specify the export location for the files and define the behavior of the output.
|
|
47
|
-
properties:
|
|
48
|
-
- name: path
|
|
49
|
-
type: string
|
|
50
|
-
required: true
|
|
51
|
-
description: Output directory or file for the generated code, relative to the global `output.path`.
|
|
52
|
-
tip: |
|
|
53
|
-
if `output.path` is a file, `group` cannot be used.
|
|
54
|
-
default: "'handlers'"
|
|
55
|
-
- name: barrelType
|
|
56
|
-
type: "'all' | 'named' | 'propagate' | false"
|
|
57
|
-
required: false
|
|
58
|
-
default: "'named'"
|
|
59
|
-
description: Specify what to export and optionally disable barrel-file generation.
|
|
60
|
-
tip: |
|
|
61
|
-
Using `propagate` will prevent a plugin from creating a barrel file, but it will still propagate, allowing [`output.barrelType`](https://kubb.dev/docs/5.x/configuration#output-barreltype) to export the specific function or type.
|
|
62
|
-
examples:
|
|
63
|
-
- name: all
|
|
64
|
-
files:
|
|
65
|
-
- lang: typescript
|
|
66
|
-
code: |
|
|
67
|
-
export * from './gen/petService.ts'
|
|
68
|
-
twoslash: false
|
|
69
|
-
- name: named
|
|
70
|
-
files:
|
|
71
|
-
- lang: typescript
|
|
72
|
-
code: |
|
|
73
|
-
export { PetService } from './gen/petService.ts'
|
|
74
|
-
twoslash: false
|
|
75
|
-
- name: propagate
|
|
76
|
-
files:
|
|
77
|
-
- lang: typescript
|
|
78
|
-
code: ""
|
|
79
|
-
twoslash: false
|
|
80
|
-
- name: "false"
|
|
81
|
-
files:
|
|
82
|
-
- lang: typescript
|
|
83
|
-
code: ""
|
|
84
|
-
twoslash: false
|
|
85
|
-
- name: banner
|
|
86
|
-
type: "string | ((node: RootNode) => string)"
|
|
87
|
-
required: false
|
|
88
|
-
description: Add a banner comment at the top of every generated file. Accepts a static string or a function that receives the `RootNode` and returns a string.
|
|
89
|
-
- name: footer
|
|
90
|
-
type: "string | ((node: RootNode) => string)"
|
|
91
|
-
required: false
|
|
92
|
-
description: Add a footer comment at the end of every generated file. Accepts a static string or a function that receives the `RootNode` and returns a string.
|
|
93
|
-
- name: override
|
|
94
|
-
type: boolean
|
|
95
|
-
required: false
|
|
96
|
-
default: "false"
|
|
97
|
-
description: Whether Kubb overrides existing external files that can be generated if they already exist.
|
|
98
|
-
- name: handlers
|
|
99
|
-
type: boolean
|
|
100
|
-
required: false
|
|
101
|
-
default: "false"
|
|
102
|
-
description: Create a `handlers.ts` file with all handlers grouped by methods.
|
|
103
|
-
- name: contentType
|
|
104
|
-
type: "'application/json' | (string & {})"
|
|
105
|
-
required: false
|
|
106
|
-
description: |
|
|
107
|
-
Define which content type to use.
|
|
108
|
-
|
|
109
|
-
By default, Kubb uses the first JSON-valid media type.
|
|
110
|
-
- name: baseURL
|
|
111
|
-
type: string
|
|
112
|
-
required: false
|
|
113
|
-
description: Sets a custom base URL for all generated calls. When not set, the base URL is automatically taken from the OAS spec via the adapter (e.g. the `servers[0].url` field).
|
|
114
|
-
- name: group
|
|
115
|
-
type: Group
|
|
116
|
-
required: false
|
|
117
|
-
description: |
|
|
118
|
-
Grouping combines files in a folder based on a specific `type`.
|
|
119
|
-
examples:
|
|
120
|
-
- name: kubb.config.ts
|
|
121
|
-
files:
|
|
122
|
-
- lang: typescript
|
|
123
|
-
code: |
|
|
124
|
-
group: {
|
|
125
|
-
type: 'tag',
|
|
126
|
-
name({ group }) {
|
|
127
|
-
return `${group}Controller`
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
twoslash: false
|
|
131
|
-
body: |
|
|
132
|
-
With the configuration above, the generator emits:
|
|
133
|
-
|
|
134
|
-
```text
|
|
135
|
-
.
|
|
136
|
-
├── src/
|
|
137
|
-
│ └── petController/
|
|
138
|
-
│ │ ├── addPet.ts
|
|
139
|
-
│ │ └── getPet.ts
|
|
140
|
-
│ └── storeController/
|
|
141
|
-
│ ├── createStore.ts
|
|
142
|
-
│ └── getStoreById.ts
|
|
143
|
-
├── petStore.yaml
|
|
144
|
-
├── kubb.config.ts
|
|
145
|
-
└── package.json
|
|
146
|
-
```
|
|
147
|
-
properties:
|
|
148
|
-
- name: type
|
|
149
|
-
type: "'tag'"
|
|
150
|
-
required: true
|
|
151
|
-
description: Specify the property to group files by. Required when `group` is defined.
|
|
152
|
-
note: |
|
|
153
|
-
`Required: true*` means this is required only when the `group` option is used. The `group` option itself is optional.
|
|
154
|
-
body: |
|
|
155
|
-
- `'tag'`: Uses the first tag from `operation.getTags().at(0)?.name`
|
|
156
|
-
- name: name
|
|
157
|
-
type: "(context: GroupContext) => string"
|
|
158
|
-
required: false
|
|
159
|
-
default: (ctx) => `${ctx.group}Controller`
|
|
160
|
-
description: Return the name of a group based on the group name. This is used for file and identifier generation.
|
|
161
|
-
- name: parser
|
|
162
|
-
type: "'data' | 'faker'"
|
|
163
|
-
required: false
|
|
164
|
-
default: "'data'"
|
|
165
|
-
description: Choose which parser to use when generating response data.
|
|
166
|
-
body: |
|
|
167
|
-
- `'faker'` will use `@kubb/plugin-faker` to generate the data for the response.
|
|
168
|
-
- `'data'` will use your custom data to generate the data for the response.
|
|
169
|
-
- name: include
|
|
170
|
-
type: Array<Include>
|
|
171
|
-
required: false
|
|
172
|
-
description: Array containing include parameters to include tags, operations, methods, paths, or content types.
|
|
173
|
-
codeBlock:
|
|
174
|
-
lang: typescript
|
|
175
|
-
title: Include
|
|
176
|
-
code: |
|
|
177
|
-
export type Include = {
|
|
178
|
-
type: 'tag' | 'operationId' | 'path' | 'method' | 'contentType'
|
|
179
|
-
pattern: string | RegExp
|
|
180
|
-
}
|
|
181
|
-
- name: exclude
|
|
182
|
-
type: Array<Exclude>
|
|
183
|
-
required: false
|
|
184
|
-
description: Array containing exclude parameters to exclude or skip tags, operations, methods, paths, or content types.
|
|
185
|
-
codeBlock:
|
|
186
|
-
lang: typescript
|
|
187
|
-
title: Exclude
|
|
188
|
-
code: |
|
|
189
|
-
export type Exclude = {
|
|
190
|
-
type: 'tag' | 'operationId' | 'path' | 'method' | 'contentType'
|
|
191
|
-
pattern: string | RegExp
|
|
192
|
-
}
|
|
193
|
-
- name: override
|
|
194
|
-
type: Array<Override>
|
|
195
|
-
required: false
|
|
196
|
-
description: Array containing override parameters to override `options` based on tags, operations, methods, paths, or content types.
|
|
197
|
-
codeBlock:
|
|
198
|
-
lang: typescript
|
|
199
|
-
title: Override
|
|
200
|
-
code: |
|
|
201
|
-
export type Override = {
|
|
202
|
-
type: 'tag' | 'operationId' | 'path' | 'method' | 'contentType'
|
|
203
|
-
pattern: string | RegExp
|
|
204
|
-
options: PluginOptions
|
|
205
|
-
}
|
|
206
|
-
- name: generators
|
|
207
|
-
type: Array<Generator<PluginMsw>>
|
|
208
|
-
required: false
|
|
209
|
-
experimental: true
|
|
210
|
-
description: |
|
|
211
|
-
Define additional generators next to the built-in generators.
|
|
212
|
-
|
|
213
|
-
See [Generators](https://kubb.dev/docs/5.x/guides/creating-plugins) for more information on how to use generators.
|
|
214
|
-
- name: transformers
|
|
215
|
-
type: object
|
|
216
|
-
required: false
|
|
217
|
-
description: Customize the generated names based on the type provided by the plugin.
|
|
218
|
-
properties:
|
|
219
|
-
- name: name
|
|
220
|
-
type: "(name: string, type?: ResolveType) => string"
|
|
221
|
-
required: false
|
|
222
|
-
description: Customize the names based on the type that is provided by the plugin.
|
|
223
|
-
codeBlock:
|
|
224
|
-
lang: typescript
|
|
225
|
-
code: |
|
|
226
|
-
type ResolveType = 'file' | 'function' | 'type' | 'const'
|
|
227
|
-
examples:
|
|
228
|
-
- name: kubb.config.ts
|
|
229
|
-
files:
|
|
230
|
-
- lang: typescript
|
|
231
|
-
code: |
|
|
232
|
-
import { defineConfig } from 'kubb'
|
|
233
|
-
import { pluginMsw } from '@kubb/plugin-msw'
|
|
234
|
-
import { pluginTs } from '@kubb/plugin-ts'
|
|
235
|
-
|
|
236
|
-
export default defineConfig({
|
|
237
|
-
input: {
|
|
238
|
-
path: './petStore.yaml',
|
|
239
|
-
},
|
|
240
|
-
output: {
|
|
241
|
-
path: './src/gen',
|
|
242
|
-
},
|
|
243
|
-
plugins: [
|
|
244
|
-
pluginTs(),
|
|
245
|
-
pluginMsw({
|
|
246
|
-
output: {
|
|
247
|
-
path: './mocks',
|
|
248
|
-
barrelType: 'named',
|
|
249
|
-
banner: '/* eslint-disable no-alert, no-console */',
|
|
250
|
-
footer: '',
|
|
251
|
-
},
|
|
252
|
-
group: {
|
|
253
|
-
type: 'tag',
|
|
254
|
-
name: ({ group }) => `${group}Service`,
|
|
255
|
-
},
|
|
256
|
-
handlers: true,
|
|
257
|
-
}),
|
|
258
|
-
],
|
|
259
|
-
})
|
|
260
|
-
twoslash: false
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { File } from '@kubb/renderer-jsx'
|
|
2
|
-
import type { KubbReactNode } from '@kubb/renderer-jsx/types'
|
|
3
|
-
|
|
4
|
-
type HandlersProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Name of the function
|
|
7
|
-
*/
|
|
8
|
-
name: string
|
|
9
|
-
// custom
|
|
10
|
-
handlers: string[]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function Handlers({ name, handlers }: HandlersProps): KubbReactNode {
|
|
14
|
-
return (
|
|
15
|
-
<File.Source name={name} isIndexable isExportable>
|
|
16
|
-
{`export const ${name} = ${JSON.stringify(handlers).replaceAll(`"`, '')} as const`}
|
|
17
|
-
</File.Source>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defineGenerator } from '@kubb/core'
|
|
2
|
-
import { File, jsxRenderer } from '@kubb/renderer-jsx'
|
|
3
|
-
import { Handlers } from '../components/Handlers.tsx'
|
|
4
|
-
import type { PluginMsw } from '../types'
|
|
5
|
-
import { transformName } from '../utils.ts'
|
|
6
|
-
|
|
7
|
-
export const handlersGenerator = defineGenerator<PluginMsw>({
|
|
8
|
-
name: 'plugin-msw',
|
|
9
|
-
renderer: jsxRenderer,
|
|
10
|
-
operations(nodes, ctx) {
|
|
11
|
-
const { resolver, config, root, adapter } = ctx
|
|
12
|
-
const { output, group, transformers } = ctx.options
|
|
13
|
-
|
|
14
|
-
const file = resolver.resolveFile({ name: 'handlers', extname: '.ts' }, { root, output, group })
|
|
15
|
-
|
|
16
|
-
const imports = nodes.map((node) => {
|
|
17
|
-
const operationName = transformName(resolver.resolveName(node.operationId), 'function', transformers)
|
|
18
|
-
const operationFile = resolver.resolveFile(
|
|
19
|
-
{ name: resolver.resolveName(node.operationId), extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },
|
|
20
|
-
{ root, output, group },
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
const handlers = nodes.map((node) => `${transformName(resolver.resolveName(node.operationId), 'function', transformers)}()`)
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<File
|
|
30
|
-
baseName={file.baseName}
|
|
31
|
-
path={file.path}
|
|
32
|
-
meta={file.meta}
|
|
33
|
-
banner={resolver.resolveBanner(adapter.inputNode, { output, config })}
|
|
34
|
-
footer={resolver.resolveFooter(adapter.inputNode, { output, config })}
|
|
35
|
-
>
|
|
36
|
-
{imports}
|
|
37
|
-
<Handlers name={'handlers'} handlers={handlers} />
|
|
38
|
-
</File>
|
|
39
|
-
)
|
|
40
|
-
},
|
|
41
|
-
})
|
|
File without changes
|