@kubb/plugin-msw 3.8.0 → 3.9.1

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.
@@ -14,6 +14,7 @@ var mswGenerator = pluginOas.createReactGenerator({
14
14
  name: "msw",
15
15
  Operation({ operation }) {
16
16
  const {
17
+ pluginManager,
17
18
  plugin: {
18
19
  options: { output, parser, baseURL }
19
20
  }
@@ -32,34 +33,44 @@ var mswGenerator = pluginOas.createReactGenerator({
32
33
  file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
33
34
  schemas: getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" })
34
35
  };
35
- return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: mock.file.baseName, path: mock.file.path, meta: mock.file.meta, banner: utils.getBanner({ oas, output }), footer: utils.getFooter({ oas, output }), children: [
36
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["http"], path: "msw" }),
37
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseResolver"], isTypeOnly: true, path: "msw" }),
38
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [type.schemas.response.name], path: type.file.path, root: mock.file.path, isTypeOnly: true }),
39
- parser === "faker" && faker.file && faker.schemas.response && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [faker.schemas.response.name], root: mock.file.path, path: faker.file.path }),
40
- parser === "faker" && /* @__PURE__ */ jsxRuntime.jsx(
41
- chunkMZZLONMV_cjs.MockWithFaker,
42
- {
43
- name: mock.name,
44
- typeName: type.schemas.response.name,
45
- fakerName: faker.schemas.response.name,
46
- method: operation.method,
47
- baseURL,
48
- url: new utils$1.URLPath(operation.path).toURLPath()
49
- }
50
- ),
51
- parser === "data" && /* @__PURE__ */ jsxRuntime.jsx(
52
- chunkMZZLONMV_cjs.Mock,
53
- {
54
- name: mock.name,
55
- typeName: type.schemas.response.name,
56
- fakerName: faker.schemas.response.name,
57
- method: operation.method,
58
- baseURL,
59
- url: new utils$1.URLPath(operation.path).toURLPath()
60
- }
61
- )
62
- ] });
36
+ return /* @__PURE__ */ jsxRuntime.jsxs(
37
+ react.File,
38
+ {
39
+ baseName: mock.file.baseName,
40
+ path: mock.file.path,
41
+ meta: mock.file.meta,
42
+ banner: utils.getBanner({ oas, output, config: pluginManager.config }),
43
+ footer: utils.getFooter({ oas, output }),
44
+ children: [
45
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["http"], path: "msw" }),
46
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseResolver"], isTypeOnly: true, path: "msw" }),
47
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [type.schemas.response.name], path: type.file.path, root: mock.file.path, isTypeOnly: true }),
48
+ parser === "faker" && faker.file && faker.schemas.response && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [faker.schemas.response.name], root: mock.file.path, path: faker.file.path }),
49
+ parser === "faker" && /* @__PURE__ */ jsxRuntime.jsx(
50
+ chunkMZZLONMV_cjs.MockWithFaker,
51
+ {
52
+ name: mock.name,
53
+ typeName: type.schemas.response.name,
54
+ fakerName: faker.schemas.response.name,
55
+ method: operation.method,
56
+ baseURL,
57
+ url: new utils$1.URLPath(operation.path).toURLPath()
58
+ }
59
+ ),
60
+ parser === "data" && /* @__PURE__ */ jsxRuntime.jsx(
61
+ chunkMZZLONMV_cjs.Mock,
62
+ {
63
+ name: mock.name,
64
+ typeName: type.schemas.response.name,
65
+ fakerName: faker.schemas.response.name,
66
+ method: operation.method,
67
+ baseURL,
68
+ url: new utils$1.URLPath(operation.path).toURLPath()
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ );
63
74
  }
64
75
  });
65
76
  var handlersGenerator = pluginOas.createReactGenerator({
@@ -81,7 +92,7 @@ var handlersGenerator = pluginOas.createReactGenerator({
81
92
  baseName: file.baseName,
82
93
  path: file.path,
83
94
  meta: file.meta,
84
- banner: utils.getBanner({ oas, output: plugin.options.output }),
95
+ banner: utils.getBanner({ oas, output: plugin.options.output, config: pluginManager.config }),
85
96
  footer: utils.getFooter({ oas, output: plugin.options.output }),
86
97
  children: [
87
98
  imports,
@@ -94,5 +105,5 @@ var handlersGenerator = pluginOas.createReactGenerator({
94
105
 
95
106
  exports.handlersGenerator = handlersGenerator;
96
107
  exports.mswGenerator = mswGenerator;
97
- //# sourceMappingURL=chunk-U26REKBP.cjs.map
98
- //# sourceMappingURL=chunk-U26REKBP.cjs.map
108
+ //# sourceMappingURL=chunk-N5C3UG5M.cjs.map
109
+ //# sourceMappingURL=chunk-N5C3UG5M.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/mswGenerator.tsx","../src/generators/handlersGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","pluginFakerName","pluginTsName","jsxs","File","getBanner","getFooter","jsx","MockWithFaker","URLPath","Mock","Handlers"],"mappings":";;;;;;;;;;;;AAUO,IAAM,eAAeA,8BAAgC,CAAA;AAAA,EAC1D,IAAM,EAAA,KAAA;AAAA,EACN,SAAA,CAAU,EAAE,SAAA,EAAa,EAAA;AACvB,IAAM,MAAA;AAAA,MACJ,aAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,OAAS,EAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,OAAQ;AAAA;AACrC,QACEC,YAAkB,EAAA;AACtB,IAAA,MAAM,MAAMC,YAAO,EAAA;AACnB,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAYC,yBAAoB,EAAA;AAE7D,IAAA,MAAM,IAAO,GAAA;AAAA,MACX,MAAM,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,CAAA;AAAA,MAC7C,IAAA,EAAM,QAAQ,SAAS;AAAA,KACzB;AAEA,IAAA,MAAM,KAAQ,GAAA;AAAA,MACZ,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,WAAW,CAACC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EAAA,MAAA,EAAQ,MAAO,CAAA,OAAA,CAAQ,MAAQ,EAAA,MAAA,EAAQ,aAAc,CAAA,MAAA,EAAQ,CAAA;AAAA,QACtF,MAAA,EAAQC,gBAAU,EAAE,GAAA,EAAK,QAAQ,MAAO,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAAA,QAEvD,QAAA,EAAA;AAAA,UAAA,OAAA;AAAA,0BACDC,cAAAA,CAACI,0BAAS,EAAA,EAAA,IAAA,EAAM,YAAY,QAAoB,EAAA;AAAA;AAAA;AAAA,KAClD;AAAA;AAGN,CAAC","file":"chunk-N5C3UG5M.cjs","sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { pluginFakerName } from '@kubb/plugin-faker'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Mock, MockWithFaker } from '../components'\nimport type { PluginMsw } from '../types'\n\nexport const mswGenerator = createReactGenerator<PluginMsw>({\n name: 'msw',\n Operation({ operation }) {\n const {\n pluginManager,\n plugin: {\n options: { output, parser, baseURL },\n },\n } = useApp<PluginMsw>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const mock = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const faker = {\n file: getFile(operation, { pluginKey: [pluginFakerName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginFakerName], type: 'function' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File\n baseName={mock.file.baseName}\n path={mock.file.path}\n meta={mock.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['ResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import name={[type.schemas.response.name]} path={type.file.path} root={mock.file.path} isTypeOnly />\n {parser === 'faker' && faker.file && faker.schemas.response && (\n <File.Import name={[faker.schemas.response.name]} root={mock.file.path} path={faker.file.path} />\n )}\n\n {parser === 'faker' && (\n <MockWithFaker\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n {parser === 'data' && (\n <Mock\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n </File>\n )\n },\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\n\nexport const handlersGenerator = createReactGenerator<PluginMsw>({\n name: 'plugin-msw',\n Operations({ operations }) {\n const { pluginManager, plugin } = useApp<PluginMsw>()\n const oas = useOas()\n const { getName, getFile } = useOperationManager()\n\n const file = pluginManager.getFile({ name: 'handlers', extname: '.ts', pluginKey: plugin.key })\n\n const imports = operations.map((operation) => {\n const operationFile = getFile(operation, { pluginKey: plugin.key })\n const operationName = getName(operation, { pluginKey: plugin.key, type: 'function' })\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = operations.map((operation) => `${getName(operation, { type: 'function', pluginKey: plugin.key })}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n"]}
@@ -12,6 +12,7 @@ var mswGenerator = createReactGenerator({
12
12
  name: "msw",
13
13
  Operation({ operation }) {
14
14
  const {
15
+ pluginManager,
15
16
  plugin: {
16
17
  options: { output, parser, baseURL }
17
18
  }
@@ -30,34 +31,44 @@ var mswGenerator = createReactGenerator({
30
31
  file: getFile(operation, { pluginKey: [pluginTsName] }),
31
32
  schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
32
33
  };
33
- return /* @__PURE__ */ jsxs(File, { baseName: mock.file.baseName, path: mock.file.path, meta: mock.file.meta, banner: getBanner({ oas, output }), footer: getFooter({ oas, output }), children: [
34
- /* @__PURE__ */ jsx(File.Import, { name: ["http"], path: "msw" }),
35
- /* @__PURE__ */ jsx(File.Import, { name: ["ResponseResolver"], isTypeOnly: true, path: "msw" }),
36
- /* @__PURE__ */ jsx(File.Import, { name: [type.schemas.response.name], path: type.file.path, root: mock.file.path, isTypeOnly: true }),
37
- parser === "faker" && faker.file && faker.schemas.response && /* @__PURE__ */ jsx(File.Import, { name: [faker.schemas.response.name], root: mock.file.path, path: faker.file.path }),
38
- parser === "faker" && /* @__PURE__ */ jsx(
39
- MockWithFaker,
40
- {
41
- name: mock.name,
42
- typeName: type.schemas.response.name,
43
- fakerName: faker.schemas.response.name,
44
- method: operation.method,
45
- baseURL,
46
- url: new URLPath(operation.path).toURLPath()
47
- }
48
- ),
49
- parser === "data" && /* @__PURE__ */ jsx(
50
- Mock,
51
- {
52
- name: mock.name,
53
- typeName: type.schemas.response.name,
54
- fakerName: faker.schemas.response.name,
55
- method: operation.method,
56
- baseURL,
57
- url: new URLPath(operation.path).toURLPath()
58
- }
59
- )
60
- ] });
34
+ return /* @__PURE__ */ jsxs(
35
+ File,
36
+ {
37
+ baseName: mock.file.baseName,
38
+ path: mock.file.path,
39
+ meta: mock.file.meta,
40
+ banner: getBanner({ oas, output, config: pluginManager.config }),
41
+ footer: getFooter({ oas, output }),
42
+ children: [
43
+ /* @__PURE__ */ jsx(File.Import, { name: ["http"], path: "msw" }),
44
+ /* @__PURE__ */ jsx(File.Import, { name: ["ResponseResolver"], isTypeOnly: true, path: "msw" }),
45
+ /* @__PURE__ */ jsx(File.Import, { name: [type.schemas.response.name], path: type.file.path, root: mock.file.path, isTypeOnly: true }),
46
+ parser === "faker" && faker.file && faker.schemas.response && /* @__PURE__ */ jsx(File.Import, { name: [faker.schemas.response.name], root: mock.file.path, path: faker.file.path }),
47
+ parser === "faker" && /* @__PURE__ */ jsx(
48
+ MockWithFaker,
49
+ {
50
+ name: mock.name,
51
+ typeName: type.schemas.response.name,
52
+ fakerName: faker.schemas.response.name,
53
+ method: operation.method,
54
+ baseURL,
55
+ url: new URLPath(operation.path).toURLPath()
56
+ }
57
+ ),
58
+ parser === "data" && /* @__PURE__ */ jsx(
59
+ Mock,
60
+ {
61
+ name: mock.name,
62
+ typeName: type.schemas.response.name,
63
+ fakerName: faker.schemas.response.name,
64
+ method: operation.method,
65
+ baseURL,
66
+ url: new URLPath(operation.path).toURLPath()
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ );
61
72
  }
62
73
  });
63
74
  var handlersGenerator = createReactGenerator({
@@ -79,7 +90,7 @@ var handlersGenerator = createReactGenerator({
79
90
  baseName: file.baseName,
80
91
  path: file.path,
81
92
  meta: file.meta,
82
- banner: getBanner({ oas, output: plugin.options.output }),
93
+ banner: getBanner({ oas, output: plugin.options.output, config: pluginManager.config }),
83
94
  footer: getFooter({ oas, output: plugin.options.output }),
84
95
  children: [
85
96
  imports,
@@ -91,5 +102,5 @@ var handlersGenerator = createReactGenerator({
91
102
  });
92
103
 
93
104
  export { handlersGenerator, mswGenerator };
94
- //# sourceMappingURL=chunk-4SW3NCYH.js.map
95
- //# sourceMappingURL=chunk-4SW3NCYH.js.map
105
+ //# sourceMappingURL=chunk-PAT3XAAU.js.map
106
+ //# sourceMappingURL=chunk-PAT3XAAU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/mswGenerator.tsx","../src/generators/handlersGener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,SAAW,EAAA,EAAE,WAAW,MAAO,CAAA,GAAA,EAAK,IAAM,EAAA,UAAA,EAAY,CAAA;AAEpF,MAAA,uBAAOC,GAACC,CAAAA,IAAAA,CAAK,MAAL,EAAA,EAAqC,MAAM,CAAC,aAAa,CAAG,EAAA,IAAA,EAAM,KAAK,IAAM,EAAA,IAAA,EAAM,aAAc,CAAA,IAAA,EAAA,EAAhF,cAAc,IAAwE,CAAA;AAAA,KAChH,CAAA;AAED,IAAA,MAAM,WAAW,UAAW,CAAA,GAAA,CAAI,CAAC,SAAA,KAAc,GAAG,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,SAAW,EAAA,MAAA,CAAO,GAAI,EAAC,CAAC,CAAI,EAAA,CAAA,CAAA;AAErH,IAAA,uBACEC,IAAAA;AAAA,MAACD,IAAAA;AAAA,MAAA;AAAA,QACC,UAAU,IAAK,CAAA,QAAA;AAAA,QACf,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,MAAA,EAAQE,SAAU,CAAA,EAAE,GAAK,EAAA,MAAA,EAAQ,MAAO,CAAA,OAAA,CAAQ,MAAQ,EAAA,MAAA,EAAQ,aAAc,CAAA,MAAA,EAAQ,CAAA;AAAA,QACtF,MAAA,EAAQC,UAAU,EAAE,GAAA,EAAK,QAAQ,MAAO,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAAA,QAEvD,QAAA,EAAA;AAAA,UAAA,OAAA;AAAA,0BACDJ,GAAAA,CAAC,QAAS,EAAA,EAAA,IAAA,EAAM,YAAY,QAAoB,EAAA;AAAA;AAAA;AAAA,KAClD;AAAA;AAGN,CAAC","file":"chunk-PAT3XAAU.js","sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { pluginFakerName } from '@kubb/plugin-faker'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Mock, MockWithFaker } from '../components'\nimport type { PluginMsw } from '../types'\n\nexport const mswGenerator = createReactGenerator<PluginMsw>({\n name: 'msw',\n Operation({ operation }) {\n const {\n pluginManager,\n plugin: {\n options: { output, parser, baseURL },\n },\n } = useApp<PluginMsw>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const mock = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const faker = {\n file: getFile(operation, { pluginKey: [pluginFakerName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginFakerName], type: 'function' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File\n baseName={mock.file.baseName}\n path={mock.file.path}\n meta={mock.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['ResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import name={[type.schemas.response.name]} path={type.file.path} root={mock.file.path} isTypeOnly />\n {parser === 'faker' && faker.file && faker.schemas.response && (\n <File.Import name={[faker.schemas.response.name]} root={mock.file.path} path={faker.file.path} />\n )}\n\n {parser === 'faker' && (\n <MockWithFaker\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n {parser === 'data' && (\n <Mock\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n </File>\n )\n },\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\n\nexport const handlersGenerator = createReactGenerator<PluginMsw>({\n name: 'plugin-msw',\n Operations({ operations }) {\n const { pluginManager, plugin } = useApp<PluginMsw>()\n const oas = useOas()\n const { getName, getFile } = useOperationManager()\n\n const file = pluginManager.getFile({ name: 'handlers', extname: '.ts', pluginKey: plugin.key })\n\n const imports = operations.map((operation) => {\n const operationFile = getFile(operation, { pluginKey: plugin.key })\n const operationName = getName(operation, { pluginKey: plugin.key, type: 'function' })\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = operations.map((operation) => `${getName(operation, { type: 'function', pluginKey: plugin.key })}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n"]}
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkU26REKBP_cjs = require('./chunk-U26REKBP.cjs');
3
+ var chunkN5C3UG5M_cjs = require('./chunk-N5C3UG5M.cjs');
4
4
  require('./chunk-MZZLONMV.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "handlersGenerator", {
9
9
  enumerable: true,
10
- get: function () { return chunkU26REKBP_cjs.handlersGenerator; }
10
+ get: function () { return chunkN5C3UG5M_cjs.handlersGenerator; }
11
11
  });
12
12
  Object.defineProperty(exports, "mswGenerator", {
13
13
  enumerable: true,
14
- get: function () { return chunkU26REKBP_cjs.mswGenerator; }
14
+ get: function () { return chunkN5C3UG5M_cjs.mswGenerator; }
15
15
  });
16
16
  //# sourceMappingURL=generators.cjs.map
17
17
  //# sourceMappingURL=generators.cjs.map
@@ -1,4 +1,4 @@
1
- export { handlersGenerator, mswGenerator } from './chunk-4SW3NCYH.js';
1
+ export { handlersGenerator, mswGenerator } from './chunk-PAT3XAAU.js';
2
2
  import './chunk-VFRXFST2.js';
3
3
  //# sourceMappingURL=generators.js.map
4
4
  //# sourceMappingURL=generators.js.map
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkU26REKBP_cjs = require('./chunk-U26REKBP.cjs');
3
+ var chunkN5C3UG5M_cjs = require('./chunk-N5C3UG5M.cjs');
4
4
  require('./chunk-MZZLONMV.cjs');
5
5
  var path = require('path');
6
6
  var core = require('@kubb/core');
@@ -24,7 +24,7 @@ var pluginMsw = core.createPlugin((options) => {
24
24
  transformers: transformers$1 = {},
25
25
  handlers = false,
26
26
  parser = "data",
27
- generators = [chunkU26REKBP_cjs.mswGenerator, handlers ? chunkU26REKBP_cjs.handlersGenerator : void 0].filter(Boolean),
27
+ generators = [chunkN5C3UG5M_cjs.mswGenerator, handlers ? chunkN5C3UG5M_cjs.handlersGenerator : void 0].filter(Boolean),
28
28
  contentType,
29
29
  baseURL
30
30
  } = options;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mswGenerator, handlersGenerator } from './chunk-4SW3NCYH.js';
1
+ import { mswGenerator, handlersGenerator } from './chunk-PAT3XAAU.js';
2
2
  import './chunk-VFRXFST2.js';
3
3
  import path from 'node:path';
4
4
  import { createPlugin, PluginManager, FileManager } from '@kubb/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-msw",
3
- "version": "3.8.0",
3
+ "version": "3.9.1",
4
4
  "description": "Generator swagger",
5
5
  "keywords": [
6
6
  "typescript",
@@ -12,11 +12,11 @@
12
12
  ],
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git://github.com/kubb-labs/kubb.git",
15
+ "url": "https://github.com/kubb-labs/kubb.git",
16
16
  "directory": "packages/plugin-msw"
17
17
  },
18
18
  "license": "MIT",
19
- "author": "Stijn Van Hulle <stijn@stijnvanhulle.be",
19
+ "author": "stijnvanhulle",
20
20
  "sideEffects": false,
21
21
  "type": "module",
22
22
  "exports": {
@@ -74,21 +74,21 @@
74
74
  "!/**/__tests__/**"
75
75
  ],
76
76
  "dependencies": {
77
- "@kubb/core": "3.8.0",
78
- "@kubb/fs": "3.8.0",
79
- "@kubb/oas": "3.8.0",
80
- "@kubb/plugin-faker": "3.8.0",
81
- "@kubb/plugin-oas": "3.8.0",
82
- "@kubb/plugin-ts": "3.8.0",
83
- "@kubb/react": "3.8.0"
77
+ "@kubb/core": "3.9.1",
78
+ "@kubb/fs": "3.9.1",
79
+ "@kubb/oas": "3.9.1",
80
+ "@kubb/plugin-faker": "3.9.1",
81
+ "@kubb/plugin-oas": "3.9.1",
82
+ "@kubb/plugin-ts": "3.9.1",
83
+ "@kubb/react": "3.9.1"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@types/react": "^18.3.20",
87
87
  "react": "^18.3.1",
88
88
  "tsup": "^8.4.0",
89
89
  "typescript": "^5.8.3",
90
- "@kubb/config-ts": "3.8.0",
91
- "@kubb/config-tsup": "3.8.0"
90
+ "@kubb/config-ts": "3.9.1",
91
+ "@kubb/config-tsup": "3.9.1"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "@kubb/react": "^3.0.0"
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
1
5
  import { http } from 'msw'
2
6
 
3
7
  export function createPets(data?: CreatePetsMutationResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Response)) {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
1
5
  import { http } from 'msw'
2
6
 
3
7
  export function deletePetsPetid(data?: DeletePetsPetidMutationResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)) {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
1
5
  import { http } from 'msw'
2
6
 
3
7
  export function listPets(data?: ListPetsQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
1
5
  import { http } from 'msw'
2
6
 
3
7
  export function listPets(data?: ListPetsQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
1
5
  import { listPets, createPets, showPetById } from './findByTags'
2
6
 
3
7
  export const handlers = [listPets(), createPets(), showPetById()] as const
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
1
5
  import { http } from 'msw'
2
6
 
3
7
  export function showPetById(data?: ShowPetByIdQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
@@ -28,7 +28,7 @@ export const handlersGenerator = createReactGenerator<PluginMsw>({
28
28
  baseName={file.baseName}
29
29
  path={file.path}
30
30
  meta={file.meta}
31
- banner={getBanner({ oas, output: plugin.options.output })}
31
+ banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}
32
32
  footer={getFooter({ oas, output: plugin.options.output })}
33
33
  >
34
34
  {imports}
@@ -12,6 +12,7 @@ export const mswGenerator = createReactGenerator<PluginMsw>({
12
12
  name: 'msw',
13
13
  Operation({ operation }) {
14
14
  const {
15
+ pluginManager,
15
16
  plugin: {
16
17
  options: { output, parser, baseURL },
17
18
  },
@@ -35,7 +36,13 @@ export const mswGenerator = createReactGenerator<PluginMsw>({
35
36
  }
36
37
 
37
38
  return (
38
- <File baseName={mock.file.baseName} path={mock.file.path} meta={mock.file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>
39
+ <File
40
+ baseName={mock.file.baseName}
41
+ path={mock.file.path}
42
+ meta={mock.file.meta}
43
+ banner={getBanner({ oas, output, config: pluginManager.config })}
44
+ footer={getFooter({ oas, output })}
45
+ >
39
46
  <File.Import name={['http']} path="msw" />
40
47
  <File.Import name={['ResponseResolver']} isTypeOnly path="msw" />
41
48
  <File.Import name={[type.schemas.response.name]} path={type.file.path} root={mock.file.path} isTypeOnly />
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/generators/mswGenerator.tsx","../src/generators/handlersGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","jsx","File","jsxs","getBanner","getFooter"],"mappings":";;;;;;;;;;AAUO,IAAM,eAAe,oBAAgC,CAAA;AAAA,EAC1D,IAAM,EAAA,KAAA;AAAA,EACN,SAAA,CAAU,EAAE,SAAA,EAAa,EAAA;AACvB,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAS,EAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,OAAQ;AAAA;AACrC,QACE,MAAkB,EAAA;AACtB,IAAA,MAAM,MAAM,MAAO,EAAA;AACnB,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAY,mBAAoB,EAAA;AAE7D,IAAA,MAAM,IAAO,GAAA;AAAA,MACX,MAAM,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,CAAA;AAAA,MAC7C,IAAA,EAAM,QAAQ,SAAS;AAAA,KACzB;AAEA,IAAA,MAAM,KAAQ,GAAA;AAAA,MACZ,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,WAAW,CAAC,eAAe,GAAG,CAAA;AAAA,MACzD,OAAA,EAAS,UAAW,CAAA,SAAA,EAAW,EAAE,SAAA,EAAW,CAAC,eAAe,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY;AAAA,KACnF;AAEA,IAAA,MAAM,IAAO,GAAA;AAAA,MACX,IAAA,EAAM,QAAQ,SAAW,EAAA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ClD;AAAA;AAGN,CAAC","file":"chunk-4SW3NCYH.js","sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { pluginFakerName } from '@kubb/plugin-faker'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Mock, MockWithFaker } from '../components'\nimport type { PluginMsw } from '../types'\n\nexport const mswGenerator = createReactGenerator<PluginMsw>({\n name: 'msw',\n Operation({ operation }) {\n const {\n plugin: {\n options: { output, parser, baseURL },\n },\n } = useApp<PluginMsw>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const mock = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const faker = {\n file: getFile(operation, { pluginKey: [pluginFakerName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginFakerName], type: 'function' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File baseName={mock.file.baseName} path={mock.file.path} meta={mock.file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['ResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import name={[type.schemas.response.name]} path={type.file.path} root={mock.file.path} isTypeOnly />\n {parser === 'faker' && faker.file && faker.schemas.response && (\n <File.Import name={[faker.schemas.response.name]} root={mock.file.path} path={faker.file.path} />\n )}\n\n {parser === 'faker' && (\n <MockWithFaker\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n {parser === 'data' && (\n <Mock\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n </File>\n )\n },\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\n\nexport const handlersGenerator = createReactGenerator<PluginMsw>({\n name: 'plugin-msw',\n Operations({ operations }) {\n const { pluginManager, plugin } = useApp<PluginMsw>()\n const oas = useOas()\n const { getName, getFile } = useOperationManager()\n\n const file = pluginManager.getFile({ name: 'handlers', extname: '.ts', pluginKey: plugin.key })\n\n const imports = operations.map((operation) => {\n const operationFile = getFile(operation, { pluginKey: plugin.key })\n const operationName = getName(operation, { pluginKey: plugin.key, type: 'function' })\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = operations.map((operation) => `${getName(operation, { type: 'function', pluginKey: plugin.key })}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/generators/mswGenerator.tsx","../src/generators/handlersGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","pluginFakerName","pluginTsName","jsxs","File","getBanner","getFooter","jsx","MockWithFaker","URLPath","Mock","Handlers"],"mappings":";;;;;;;;;;;;AAUO,IAAM,eAAeA,8BAAgC,CAAA;AAAA,EAC1D,IAAM,EAAA,KAAA;AAAA,EACN,SAAA,CAAU,EAAE,SAAA,EAAa,EAAA;AACvB,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAS,EAAA,EAAE,MAAQ,E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,CAAA,GAAA,CAAI,CAAC,SAAA,KAAc,GAAG,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,SAAW,EAAA,MAAA,CAAO,GAAI,EAAC,CAAC,CAAI,EAAA,CAAA,CAAA;AAErH,IAAA,uBACED,eAAAA;AAAA,MAACC,UAAAA;AAAA,MAAA;AAAA,QACC,UAAU,IAAK,CAAA,QAAA;AAAA,QACf,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,MAAA,EAAQC,gBAAU,EAAE,GAAA,EAAK,QAAQ,MAAO,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAAA,QACxD,MAAA,EAAQC,gBAAU,EAAE,GAAA,EAAK,QAAQ,MAAO,CAAA,OAAA,CAAQ,QAAQ,CAAA;AAAA,QAEvD,QAAA,EAAA;AAAA,UAAA,OAAA;AAAA,0BACDC,cAAAA,CAACI,0BAAS,EAAA,EAAA,IAAA,EAAM,YAAY,QAAoB,EAAA;AAAA;AAAA;AAAA,KAClD;AAAA;AAGN,CAAC","file":"chunk-U26REKBP.cjs","sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { pluginFakerName } from '@kubb/plugin-faker'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Mock, MockWithFaker } from '../components'\nimport type { PluginMsw } from '../types'\n\nexport const mswGenerator = createReactGenerator<PluginMsw>({\n name: 'msw',\n Operation({ operation }) {\n const {\n plugin: {\n options: { output, parser, baseURL },\n },\n } = useApp<PluginMsw>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const mock = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const faker = {\n file: getFile(operation, { pluginKey: [pluginFakerName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginFakerName], type: 'function' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File baseName={mock.file.baseName} path={mock.file.path} meta={mock.file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['ResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import name={[type.schemas.response.name]} path={type.file.path} root={mock.file.path} isTypeOnly />\n {parser === 'faker' && faker.file && faker.schemas.response && (\n <File.Import name={[faker.schemas.response.name]} root={mock.file.path} path={faker.file.path} />\n )}\n\n {parser === 'faker' && (\n <MockWithFaker\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n {parser === 'data' && (\n <Mock\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n )}\n </File>\n )\n },\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\n\nexport const handlersGenerator = createReactGenerator<PluginMsw>({\n name: 'plugin-msw',\n Operations({ operations }) {\n const { pluginManager, plugin } = useApp<PluginMsw>()\n const oas = useOas()\n const { getName, getFile } = useOperationManager()\n\n const file = pluginManager.getFile({ name: 'handlers', extname: '.ts', pluginKey: plugin.key })\n\n const imports = operations.map((operation) => {\n const operationFile = getFile(operation, { pluginKey: plugin.key })\n const operationName = getName(operation, { pluginKey: plugin.key, type: 'function' })\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = operations.map((operation) => `${getName(operation, { type: 'function', pluginKey: plugin.key })}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n"]}