@kubb/swagger-ts 2.0.0-beta.7 → 2.0.0-beta.9

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.
@@ -1,5 +1,5 @@
1
1
  import { ResolvePathOptions, Exclude, Include, Override, AppMeta as AppMeta$1, OasBuilder, OasTypes } from '@kubb/swagger';
2
- import { PluginFactoryOptions, ResolveNameParams, KubbFile } from '@kubb/core';
2
+ import { PluginFactoryOptions, KubbFile, ResolveNameParams } from '@kubb/core';
3
3
  import { ReactNode } from 'react';
4
4
 
5
5
  type Options = {
@@ -14,6 +14,10 @@ type Options = {
14
14
  * Name to be used for the `export * as {{exportAs}} from './'`
15
15
  */
16
16
  exportAs?: string;
17
+ /**
18
+ * Add an extension to the generated imports and exports, default it will not use an extension
19
+ */
20
+ extName?: KubbFile.Extname;
17
21
  };
18
22
  /**
19
23
  * Group the TypeScript types based on the provided name.
@@ -69,9 +73,7 @@ type Options = {
69
73
  name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
70
74
  };
71
75
  /**
72
- * Export Oas object as Oas type with import type { Infer } from `@kubb/swagger-ts/infer`
73
- * TODO add docs
74
- * @beta
76
+ * Export an Oas object as Oas type with `import type { Infer } from '@kubb/swagger-ts/oas'`
75
77
  */
76
78
  oasType?: boolean;
77
79
  };
@@ -1,5 +1,5 @@
1
1
  import { ResolvePathOptions, Exclude, Include, Override, AppMeta as AppMeta$1, OasBuilder, OasTypes } from '@kubb/swagger';
2
- import { PluginFactoryOptions, ResolveNameParams, KubbFile } from '@kubb/core';
2
+ import { PluginFactoryOptions, KubbFile, ResolveNameParams } from '@kubb/core';
3
3
  import { ReactNode } from 'react';
4
4
 
5
5
  type Options = {
@@ -14,6 +14,10 @@ type Options = {
14
14
  * Name to be used for the `export * as {{exportAs}} from './'`
15
15
  */
16
16
  exportAs?: string;
17
+ /**
18
+ * Add an extension to the generated imports and exports, default it will not use an extension
19
+ */
20
+ extName?: KubbFile.Extname;
17
21
  };
18
22
  /**
19
23
  * Group the TypeScript types based on the provided name.
@@ -69,9 +73,7 @@ type Options = {
69
73
  name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
70
74
  };
71
75
  /**
72
- * Export Oas object as Oas type with import type { Infer } from `@kubb/swagger-ts/infer`
73
- * TODO add docs
74
- * @beta
76
+ * Export an Oas object as Oas type with `import type { Infer } from '@kubb/swagger-ts/oas'`
75
77
  */
76
78
  oasType?: boolean;
77
79
  };
@@ -3192,7 +3192,7 @@ function Template({
3192
3192
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
3193
3193
  `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const`,
3194
3194
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
3195
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Type, { name: typeName, export: true, children: `Parse<typeof ${name}>` })
3195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` })
3196
3196
  ] });
3197
3197
  }
3198
3198
  var defaultTemplates = { default: Template };
@@ -3215,7 +3215,7 @@ Oas.File = function({ name, typeName, templates = defaultTemplates }) {
3215
3215
  path: file.path,
3216
3216
  meta: file.meta,
3217
3217
  children: [
3218
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Import, { name: ["Parse"], path: "@kubb/swagger-ts/infer", isTypeOnly: true }),
3218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Import, { name: ["Infer"], path: "@kubb/swagger-ts/oas", isTypeOnly: true }),
3219
3219
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(File.Source, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Oas, { Template: Template2, name, typeName }) })
3220
3220
  ]
3221
3221
  }
@@ -3487,7 +3487,6 @@ createPlugin((options) => {
3487
3487
  await this.fileManager.addIndexes({
3488
3488
  root,
3489
3489
  output,
3490
- extName: ".ts",
3491
3490
  meta: { pluginKey: this.plugin.key },
3492
3491
  options: {
3493
3492
  isTypeOnly: true