@kubb/plugin-ts 4.1.4 → 4.2.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.
package/src/plugin.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  import path from 'node:path'
2
-
3
- import { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'
2
+ import { createPlugin, type Group, getBarrelFiles, getMode, type Plugin, PluginManager } from '@kubb/core'
4
3
  import { camelCase, pascalCase } from '@kubb/core/transformers'
5
- import { OperationGenerator, SchemaGenerator, pluginOasName } from '@kubb/plugin-oas'
6
-
7
- import type { Plugin } from '@kubb/core'
8
4
  import type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'
5
+ import { OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'
9
6
  import { oasGenerator, typeGenerator } from './generators'
10
7
  import type { PluginTs } from './types.ts'
11
8
 
@@ -57,7 +54,7 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
57
54
  pre: [pluginOasName],
58
55
  resolvePath(baseName, pathMode, options) {
59
56
  const root = path.resolve(this.config.root, this.config.output.path)
60
- const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))
57
+ const mode = pathMode ?? getMode(path.resolve(root, output.path))
61
58
 
62
59
  if (mode === 'single') {
63
60
  /**
@@ -103,7 +100,7 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
103
100
 
104
101
  const oas = await swaggerPlugin.context.getOas()
105
102
  const root = path.resolve(this.config.root, this.config.output.path)
106
- const mode = FileManager.getMode(path.resolve(root, output.path))
103
+ const mode = getMode(path.resolve(root, output.path))
107
104
 
108
105
  const schemaGenerator = new SchemaGenerator(this.plugin.options, {
109
106
  oas,
@@ -133,7 +130,7 @@ export const pluginTs = createPlugin<PluginTs>((options) => {
133
130
  const operationFiles = await operationGenerator.build(...generators)
134
131
  await this.addFile(...operationFiles)
135
132
 
136
- const barrelFiles = await this.fileManager.getBarrelFiles({
133
+ const barrelFiles = await getBarrelFiles(this.fileManager.files, {
137
134
  type: output.barrelType ?? 'named',
138
135
  root,
139
136
  output,