@kubb/core 2.7.1 → 2.8.0

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.d.cts CHANGED
@@ -61,6 +61,13 @@ type Events = {
61
61
  executed: [executer: Executer];
62
62
  error: [error: Error];
63
63
  };
64
+ type GetFileProps<TOptions = object> = {
65
+ name: string;
66
+ mode?: KubbFile.Mode;
67
+ extName: KubbFile.Extname;
68
+ pluginKey: Plugin['key'];
69
+ options?: TOptions;
70
+ };
64
71
  declare class PluginManager {
65
72
  #private;
66
73
  readonly plugins: PluginWithLifeCycle[];
@@ -71,6 +78,9 @@ declare class PluginManager {
71
78
  readonly logger: Logger;
72
79
  readonly queue: PQueue;
73
80
  constructor(config: Config, options: Options$2);
81
+ getFile<TOptions = object>({ name, mode, extName, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{
82
+ pluginKey: Plugin['key'];
83
+ }>;
74
84
  resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
75
85
  resolveName: (params: ResolveNameParams) => string;
76
86
  /**
@@ -270,12 +280,7 @@ TAPI = any,
270
280
  /**
271
281
  * When calling `resolvePath` you can specify better types.
272
282
  */
273
- TResolvePathOptions extends object = object,
274
- /**
275
- * When using @kubb/react(based on React) you can specify here which types should be used when calling render.
276
- * Always extend from `AppMeta` of the core.
277
- */
278
- TAppMeta = unknown> = {
283
+ TResolvePathOptions extends object = object> = {
279
284
  name: TName;
280
285
  /**
281
286
  * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
@@ -287,8 +292,8 @@ TAppMeta = unknown> = {
287
292
  resolvePathOptions: TResolvePathOptions;
288
293
  appMeta: {
289
294
  pluginManager: PluginManager;
290
- plugin: Plugin<PluginFactoryOptions<TName, TOptions, TResolvedOptions, TAPI, TResolvePathOptions, TAppMeta>>;
291
- } & TAppMeta;
295
+ plugin: Plugin<PluginFactoryOptions<TName, TOptions, TResolvedOptions, TAPI, TResolvePathOptions>>;
296
+ };
292
297
  };
293
298
  type GetPluginFactoryOptions<TPlugin extends UserPlugin> = TPlugin extends UserPlugin<infer X> ? X : never;
294
299
  type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
@@ -317,7 +322,7 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
317
322
  api: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['api'];
318
323
  });
319
324
  type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
320
- type UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any, any>>;
325
+ type UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any>>;
321
326
  type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
322
327
  /**
323
328
  * Unique name used for the plugin
@@ -360,7 +365,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
360
365
  * @type hookFirst
361
366
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
362
367
  */
363
- resolvePath?: (this: PluginContext<TOptions>, baseName: string, directory?: string, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
368
+ resolvePath?: (this: PluginContext<TOptions>, baseName: string, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
364
369
  /**
365
370
  * Resolve to a name based on a string.
366
371
  * Useful when converting to PascalCase or camelCase.
@@ -395,7 +400,7 @@ type PluginCache = Record<string, [number, unknown]>;
395
400
  type ResolvePathParams<TOptions = object> = {
396
401
  pluginKey?: Plugin['key'];
397
402
  baseName: string;
398
- directory?: string | undefined;
403
+ mode?: KubbFile.Mode;
399
404
  /**
400
405
  * Options to be passed to 'resolvePath' 3th parameter
401
406
  */
package/dist/index.d.ts CHANGED
@@ -61,6 +61,13 @@ type Events = {
61
61
  executed: [executer: Executer];
62
62
  error: [error: Error];
63
63
  };
64
+ type GetFileProps<TOptions = object> = {
65
+ name: string;
66
+ mode?: KubbFile.Mode;
67
+ extName: KubbFile.Extname;
68
+ pluginKey: Plugin['key'];
69
+ options?: TOptions;
70
+ };
64
71
  declare class PluginManager {
65
72
  #private;
66
73
  readonly plugins: PluginWithLifeCycle[];
@@ -71,6 +78,9 @@ declare class PluginManager {
71
78
  readonly logger: Logger;
72
79
  readonly queue: PQueue;
73
80
  constructor(config: Config, options: Options$2);
81
+ getFile<TOptions = object>({ name, mode, extName, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{
82
+ pluginKey: Plugin['key'];
83
+ }>;
74
84
  resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
75
85
  resolveName: (params: ResolveNameParams) => string;
76
86
  /**
@@ -270,12 +280,7 @@ TAPI = any,
270
280
  /**
271
281
  * When calling `resolvePath` you can specify better types.
272
282
  */
273
- TResolvePathOptions extends object = object,
274
- /**
275
- * When using @kubb/react(based on React) you can specify here which types should be used when calling render.
276
- * Always extend from `AppMeta` of the core.
277
- */
278
- TAppMeta = unknown> = {
283
+ TResolvePathOptions extends object = object> = {
279
284
  name: TName;
280
285
  /**
281
286
  * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
@@ -287,8 +292,8 @@ TAppMeta = unknown> = {
287
292
  resolvePathOptions: TResolvePathOptions;
288
293
  appMeta: {
289
294
  pluginManager: PluginManager;
290
- plugin: Plugin<PluginFactoryOptions<TName, TOptions, TResolvedOptions, TAPI, TResolvePathOptions, TAppMeta>>;
291
- } & TAppMeta;
295
+ plugin: Plugin<PluginFactoryOptions<TName, TOptions, TResolvedOptions, TAPI, TResolvePathOptions>>;
296
+ };
292
297
  };
293
298
  type GetPluginFactoryOptions<TPlugin extends UserPlugin> = TPlugin extends UserPlugin<infer X> ? X : never;
294
299
  type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
@@ -317,7 +322,7 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
317
322
  api: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['api'];
318
323
  });
319
324
  type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
320
- type UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any, any>>;
325
+ type UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any>>;
321
326
  type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
322
327
  /**
323
328
  * Unique name used for the plugin
@@ -360,7 +365,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
360
365
  * @type hookFirst
361
366
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
362
367
  */
363
- resolvePath?: (this: PluginContext<TOptions>, baseName: string, directory?: string, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
368
+ resolvePath?: (this: PluginContext<TOptions>, baseName: string, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
364
369
  /**
365
370
  * Resolve to a name based on a string.
366
371
  * Useful when converting to PascalCase or camelCase.
@@ -395,7 +400,7 @@ type PluginCache = Record<string, [number, unknown]>;
395
400
  type ResolvePathParams<TOptions = object> = {
396
401
  pluginKey?: Plugin['key'];
397
402
  baseName: string;
398
- directory?: string | undefined;
403
+ mode?: KubbFile.Mode;
399
404
  /**
400
405
  * Options to be passed to 'resolvePath' 3th parameter
401
406
  */
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  createPlugin,
14
14
  isPromise,
15
15
  pluginName
16
- } from "./chunk-BHNAGXM3.js";
16
+ } from "./chunk-6KNLOEZF.js";
17
17
  import "./chunk-L3XMZMJ5.js";
18
18
  import "./chunk-JPSCPXBD.js";
19
19
  import "./chunk-SV7GUBBD.js";
package/dist/mocks.cjs CHANGED
@@ -1,11 +1,13 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-FNHECX2X.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-AXZ52CY2.cjs');
2
2
  require('./chunk-XXN4BH6X.cjs');
3
3
  require('./chunk-GNWOOGXA.cjs');
4
4
 
5
5
 
6
6
  var _chunkAWUFUNOJcjs = require('./chunk-AWUFUNOJ.cjs');
7
7
  require('./chunk-ZJ6GI35A.cjs');
8
- require('./chunk-IXCRUQPC.cjs');
8
+
9
+
10
+ var _chunkIXCRUQPCcjs = require('./chunk-IXCRUQPC.cjs');
9
11
  require('./chunk-X2JM3GAC.cjs');
10
12
 
11
13
 
@@ -28,6 +30,22 @@ var mockedPluginManager = {
28
30
  on(eventName, args) {
29
31
  },
30
32
  logLevel: "info"
33
+ },
34
+ getFile: ({ name, extName, pluginKey }) => {
35
+ const baseName = `${name}${extName}`;
36
+ let source = "";
37
+ try {
38
+ source = _chunkIXCRUQPCcjs.readSync.call(void 0, baseName);
39
+ } catch (_e) {
40
+ }
41
+ return {
42
+ path: baseName,
43
+ baseName,
44
+ meta: {
45
+ pluginKey
46
+ },
47
+ source
48
+ };
31
49
  }
32
50
  };
33
51
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAGO,IAAM,sBAAsB;AAAA,EACjC,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM;AAC/B,QAAI,SAAS,QAAQ;AACnB,aAAO,WAAW,IAAI;AAAA,IACxB;AAEA,WAAO;AAAA,EACT;AAAA,EACA,aAAa,CAAC,EAAE,SAAS,MAAM;AAAA,EAC/B,QAAQ;AAAA,IACN,KAAK,SAAS;AACZ,cAAQ,IAAI,OAAO;AAAA,IACrB;AAAA,IACA,GAAG,WAAW,MAAM;AAAA,IAAC;AAAA,IACrB,UAAU;AAAA,EACZ;AACF","sourcesContent":["import { pascalCase } from '../src/transformers/casing.ts'\n\nimport { PluginManager } from '../src/PluginManager.ts'\nexport const mockedPluginManager = {\n resolveName: ({ name, type }) => {\n if (type === 'type') {\n return pascalCase(name)\n }\n\n return name\n },\n resolvePath: ({ baseName }) => baseName,\n logger: {\n emit(message) {\n console.log(message)\n },\n on(eventName, args) {},\n logLevel: 'info',\n },\n} as PluginManager\n"]}
1
+ {"version":3,"sources":["../mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AAKO,IAAM,sBAAsB;AAAA,EACjC,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM;AAC/B,QAAI,SAAS,QAAQ;AACnB,aAAO,WAAW,IAAI;AAAA,IACxB;AAEA,WAAO;AAAA,EACT;AAAA,EACA,aAAa,CAAC,EAAE,SAAS,MAAM;AAAA,EAC/B,QAAQ;AAAA,IACN,KAAK,SAAS;AACZ,cAAQ,IAAI,OAAO;AAAA,IACrB;AAAA,IACA,GAAG,WAAW,MAAM;AAAA,IAAC;AAAA,IACrB,UAAU;AAAA,EACZ;AAAA,EACA,SAAS,CAAC,EAAE,MAAM,SAAS,UAAU,MAAM;AACzC,UAAM,WAAW,GAAG,IAAI,GAAG,OAAO;AAClC,QAAI,SAAS;AAEb,QAAI;AACF,eAAS,SAAS,QAAQ;AAAA,IAC5B,SAAS,IAAI;AAAA,IAEb;AAEA,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,MAAM;AAAA,QACJ;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import { pascalCase } from '../src/transformers/casing.ts'\n\nimport { PluginManager } from '../src/PluginManager.ts'\nimport { readSync } from '../src/fs/read.ts'\n\nexport const mockedPluginManager = {\n resolveName: ({ name, type }) => {\n if (type === 'type') {\n return pascalCase(name)\n }\n\n return name\n },\n resolvePath: ({ baseName }) => baseName,\n logger: {\n emit(message) {\n console.log(message)\n },\n on(eventName, args) {},\n logLevel: 'info',\n },\n getFile: ({ name, extName, pluginKey }) => {\n const baseName = `${name}${extName}`\n let source = ''\n\n try {\n source = readSync(baseName)\n } catch (_e) {\n //\n }\n\n return {\n path: baseName,\n baseName,\n meta: {\n pluginKey,\n },\n source,\n }\n },\n} as PluginManager\n"]}
package/dist/mocks.js CHANGED
@@ -1,11 +1,13 @@
1
- import "./chunk-BHNAGXM3.js";
1
+ import "./chunk-6KNLOEZF.js";
2
2
  import "./chunk-L3XMZMJ5.js";
3
3
  import "./chunk-JPSCPXBD.js";
4
4
  import {
5
5
  pascalCase
6
6
  } from "./chunk-SV7GUBBD.js";
7
7
  import "./chunk-WRGVBPK2.js";
8
- import "./chunk-XDO5ZSKZ.js";
8
+ import {
9
+ readSync
10
+ } from "./chunk-XDO5ZSKZ.js";
9
11
  import "./chunk-J2ES4PYI.js";
10
12
  import {
11
13
  init_esm_shims
@@ -28,6 +30,22 @@ var mockedPluginManager = {
28
30
  on(eventName, args) {
29
31
  },
30
32
  logLevel: "info"
33
+ },
34
+ getFile: ({ name, extName, pluginKey }) => {
35
+ const baseName = `${name}${extName}`;
36
+ let source = "";
37
+ try {
38
+ source = readSync(baseName);
39
+ } catch (_e) {
40
+ }
41
+ return {
42
+ path: baseName,
43
+ baseName,
44
+ meta: {
45
+ pluginKey
46
+ },
47
+ source
48
+ };
31
49
  }
32
50
  };
33
51
  export {
package/dist/mocks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../mocks/index.ts"],"sourcesContent":["import { pascalCase } from '../src/transformers/casing.ts'\n\nimport { PluginManager } from '../src/PluginManager.ts'\nexport const mockedPluginManager = {\n resolveName: ({ name, type }) => {\n if (type === 'type') {\n return pascalCase(name)\n }\n\n return name\n },\n resolvePath: ({ baseName }) => baseName,\n logger: {\n emit(message) {\n console.log(message)\n },\n on(eventName, args) {},\n logLevel: 'info',\n },\n} as PluginManager\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAGO,IAAM,sBAAsB;AAAA,EACjC,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM;AAC/B,QAAI,SAAS,QAAQ;AACnB,aAAO,WAAW,IAAI;AAAA,IACxB;AAEA,WAAO;AAAA,EACT;AAAA,EACA,aAAa,CAAC,EAAE,SAAS,MAAM;AAAA,EAC/B,QAAQ;AAAA,IACN,KAAK,SAAS;AACZ,cAAQ,IAAI,OAAO;AAAA,IACrB;AAAA,IACA,GAAG,WAAW,MAAM;AAAA,IAAC;AAAA,IACrB,UAAU;AAAA,EACZ;AACF;","names":[]}
1
+ {"version":3,"sources":["../mocks/index.ts"],"sourcesContent":["import { pascalCase } from '../src/transformers/casing.ts'\n\nimport { PluginManager } from '../src/PluginManager.ts'\nimport { readSync } from '../src/fs/read.ts'\n\nexport const mockedPluginManager = {\n resolveName: ({ name, type }) => {\n if (type === 'type') {\n return pascalCase(name)\n }\n\n return name\n },\n resolvePath: ({ baseName }) => baseName,\n logger: {\n emit(message) {\n console.log(message)\n },\n on(eventName, args) {},\n logLevel: 'info',\n },\n getFile: ({ name, extName, pluginKey }) => {\n const baseName = `${name}${extName}`\n let source = ''\n\n try {\n source = readSync(baseName)\n } catch (_e) {\n //\n }\n\n return {\n path: baseName,\n baseName,\n meta: {\n pluginKey,\n },\n source,\n }\n },\n} as PluginManager\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAKO,IAAM,sBAAsB;AAAA,EACjC,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM;AAC/B,QAAI,SAAS,QAAQ;AACnB,aAAO,WAAW,IAAI;AAAA,IACxB;AAEA,WAAO;AAAA,EACT;AAAA,EACA,aAAa,CAAC,EAAE,SAAS,MAAM;AAAA,EAC/B,QAAQ;AAAA,IACN,KAAK,SAAS;AACZ,cAAQ,IAAI,OAAO;AAAA,IACrB;AAAA,IACA,GAAG,WAAW,MAAM;AAAA,IAAC;AAAA,IACrB,UAAU;AAAA,EACZ;AAAA,EACA,SAAS,CAAC,EAAE,MAAM,SAAS,UAAU,MAAM;AACzC,UAAM,WAAW,GAAG,IAAI,GAAG,OAAO;AAClC,QAAI,SAAS;AAEb,QAAI;AACF,eAAS,SAAS,QAAQ;AAAA,IAC5B,SAAS,IAAI;AAAA,IAEb;AAEA,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,MAAM;AAAA,QACJ;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "Generator core",
5
5
  "keywords": [
6
6
  "typescript",
@@ -95,13 +95,13 @@
95
95
  "p-queue": "^8.0.1",
96
96
  "seedrandom": "^3.0.5",
97
97
  "semver": "^7.6.0",
98
- "@kubb/parser": "2.7.1",
99
- "@kubb/types": "2.7.1"
98
+ "@kubb/parser": "2.8.0",
99
+ "@kubb/types": "2.8.0"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/fs-extra": "^11.0.4",
103
103
  "@types/lodash.isequal": "^4.5.8",
104
- "@types/react": "^18.2.63",
104
+ "@types/react": "^18.2.64",
105
105
  "@types/seedrandom": "^3.0.8",
106
106
  "@types/semver": "^7.5.8",
107
107
  "eslint": "^8.57.0",
@@ -2,6 +2,7 @@
2
2
 
3
3
  import PQueue from 'p-queue'
4
4
 
5
+ import { readSync } from './fs/read.ts'
5
6
  import { transformReservedWord } from './transformers/transformReservedWord.ts'
6
7
  import { EventEmitter } from './utils/EventEmitter.ts'
7
8
  import { setUniqueName } from './utils/uniqueName.ts'
@@ -73,6 +74,14 @@ type Events = {
73
74
  error: [error: Error]
74
75
  }
75
76
 
77
+ type GetFileProps<TOptions = object> = {
78
+ name: string
79
+ mode?: KubbFile.Mode
80
+ extName: KubbFile.Extname
81
+ pluginKey: Plugin['key']
82
+ options?: TOptions
83
+ }
84
+
76
85
  export class PluginManager {
77
86
  readonly plugins: PluginWithLifeCycle[]
78
87
  readonly fileManager: FileManager
@@ -118,12 +127,37 @@ export class PluginManager {
118
127
  return this
119
128
  }
120
129
 
130
+ getFile<TOptions = object>({ name, mode, extName, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{ pluginKey: Plugin['key'] }> {
131
+ let source = ''
132
+ const baseName = `${name}${extName}` as const
133
+ const path = this.resolvePath({ baseName, mode, pluginKey, options })
134
+
135
+ if (!path) {
136
+ throw new Error(`Filepath should be defined for resolvedName "${name}" and pluginKey [${JSON.stringify(pluginKey)}]`)
137
+ }
138
+
139
+ try {
140
+ source = readSync(path)
141
+ } catch (_e) {
142
+ //
143
+ }
144
+
145
+ return {
146
+ path,
147
+ baseName,
148
+ meta: {
149
+ pluginKey,
150
+ },
151
+ source,
152
+ }
153
+ }
154
+
121
155
  resolvePath = <TOptions = object>(params: ResolvePathParams<TOptions>): KubbFile.OptionalPath => {
122
156
  if (params.pluginKey) {
123
157
  const paths = this.hookForPluginSync({
124
158
  pluginKey: params.pluginKey,
125
159
  hookName: 'resolvePath',
126
- parameters: [params.baseName, params.directory, params.options as object],
160
+ parameters: [params.baseName, params.mode, params.options as object],
127
161
  })
128
162
 
129
163
  if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
@@ -138,7 +172,7 @@ export class PluginManager {
138
172
  }
139
173
  return this.hookFirstSync({
140
174
  hookName: 'resolvePath',
141
- parameters: [params.baseName, params.directory, params.options as object],
175
+ parameters: [params.baseName, params.mode, params.options as object],
142
176
  }).result
143
177
  }
144
178
  resolveName = (params: ResolveNameParams): string => {
package/src/types.ts CHANGED
@@ -148,11 +148,6 @@ export type PluginFactoryOptions<
148
148
  * When calling `resolvePath` you can specify better types.
149
149
  */
150
150
  TResolvePathOptions extends object = object,
151
- /**
152
- * When using @kubb/react(based on React) you can specify here which types should be used when calling render.
153
- * Always extend from `AppMeta` of the core.
154
- */
155
- TAppMeta = unknown,
156
151
  > = {
157
152
  name: TName
158
153
  /**
@@ -165,8 +160,8 @@ export type PluginFactoryOptions<
165
160
  resolvePathOptions: TResolvePathOptions
166
161
  appMeta: {
167
162
  pluginManager: PluginManager
168
- plugin: Plugin<PluginFactoryOptions<TName, TOptions, TResolvedOptions, TAPI, TResolvePathOptions, TAppMeta>>
169
- } & TAppMeta
163
+ plugin: Plugin<PluginFactoryOptions<TName, TOptions, TResolvedOptions, TAPI, TResolvePathOptions>>
164
+ }
170
165
  }
171
166
 
172
167
  export type GetPluginFactoryOptions<TPlugin extends UserPlugin> = TPlugin extends UserPlugin<infer X> ? X : never
@@ -202,7 +197,7 @@ export type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOpti
202
197
 
203
198
  export type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>
204
199
 
205
- type UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any, any>>
200
+ type UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any>>
206
201
 
207
202
  export type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
208
203
  & {
@@ -254,7 +249,7 @@ export type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactor
254
249
  * @type hookFirst
255
250
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
256
251
  */
257
- resolvePath?: (this: PluginContext<TOptions>, baseName: string, directory?: string, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath
252
+ resolvePath?: (this: PluginContext<TOptions>, baseName: string, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath
258
253
  /**
259
254
  * Resolve to a name based on a string.
260
255
  * Useful when converting to PascalCase or camelCase.
@@ -293,7 +288,7 @@ export type PluginCache = Record<string, [number, unknown]>
293
288
  export type ResolvePathParams<TOptions = object> = {
294
289
  pluginKey?: Plugin['key']
295
290
  baseName: string
296
- directory?: string | undefined
291
+ mode?: KubbFile.Mode
297
292
  /**
298
293
  * Options to be passed to 'resolvePath' 3th parameter
299
294
  */