@kubb/core 4.11.1 → 4.11.2

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.
Files changed (39) hide show
  1. package/dist/{getBarrelFiles-BkDzzugQ.cjs → getBarrelFiles-8VEWWk9Z.cjs} +80 -111
  2. package/dist/getBarrelFiles-8VEWWk9Z.cjs.map +1 -0
  3. package/dist/{getBarrelFiles-BVMBhc50.d.cts → getBarrelFiles-B_2WDywH.d.cts} +3 -3
  4. package/dist/{getBarrelFiles-a-GlnjYa.js → getBarrelFiles-DQ0hksqD.js} +80 -111
  5. package/dist/getBarrelFiles-DQ0hksqD.js.map +1 -0
  6. package/dist/{getBarrelFiles-DjQ68d4e.d.ts → getBarrelFiles-ZIHk_1ln.d.ts} +3 -3
  7. package/dist/hooks.d.cts +1 -1
  8. package/dist/hooks.d.ts +1 -1
  9. package/dist/index.cjs +261 -42
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +5 -7
  12. package/dist/index.d.ts +5 -7
  13. package/dist/index.js +262 -43
  14. package/dist/index.js.map +1 -1
  15. package/dist/{logger-DIA19Yfz.js → logger-CQn6sdC0.js} +72 -7
  16. package/dist/{logger-CPt4U57Z.cjs.map → logger-CQn6sdC0.js.map} +1 -1
  17. package/dist/{logger-CPt4U57Z.cjs → logger-US5g7KdM.cjs} +72 -7
  18. package/dist/logger-US5g7KdM.cjs.map +1 -0
  19. package/dist/{logger-C96jDrSt.d.ts → logger-mq06Cxxv.d.cts} +29 -4
  20. package/dist/{logger-BJDkLsF0.d.cts → logger-o16AyvGp.d.ts} +29 -4
  21. package/dist/logger.cjs +1 -1
  22. package/dist/logger.d.cts +1 -1
  23. package/dist/logger.d.ts +1 -1
  24. package/dist/logger.js +1 -1
  25. package/dist/{types-tSSA1oz8.d.cts → types-CCEy_FVr.d.cts} +36 -27
  26. package/dist/{types-69-evK37.d.ts → types-DgfEZ3IN.d.ts} +36 -27
  27. package/dist/utils.cjs +1 -1
  28. package/dist/utils.d.cts +2 -2
  29. package/dist/utils.d.ts +2 -2
  30. package/dist/utils.js +1 -1
  31. package/package.json +1 -1
  32. package/src/PluginManager.ts +81 -114
  33. package/src/build.ts +229 -25
  34. package/src/logger.ts +87 -9
  35. package/src/utils/ciDetection.ts +40 -0
  36. package/src/utils/diagnostics.ts +15 -0
  37. package/dist/getBarrelFiles-BkDzzugQ.cjs.map +0 -1
  38. package/dist/getBarrelFiles-a-GlnjYa.js.map +0 -1
  39. package/dist/logger-DIA19Yfz.js.map +0 -1
@@ -1,18 +1,39 @@
1
- import { n as Logger, o as EventEmitter } from "./logger-BJDkLsF0.cjs";
1
+ import { n as Logger, o as EventEmitter } from "./logger-mq06Cxxv.cjs";
2
2
  import { KubbFile } from "@kubb/fabric-core/types";
3
3
  import { Fabric } from "@kubb/react-fabric";
4
4
 
5
5
  //#region src/PluginManager.d.ts
6
6
  type RequiredPluginLifecycle = Required<PluginLifecycle>;
7
7
  type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
8
- type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
9
- message: string;
8
+ type ExecutingMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
10
9
  strategy: Strategy;
11
10
  hookName: H;
12
11
  plugin: Plugin;
13
12
  parameters?: unknown[] | undefined;
14
13
  output?: unknown;
15
14
  };
15
+ type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
16
+ duration: number;
17
+ strategy: Strategy;
18
+ hookName: H;
19
+ plugin: Plugin;
20
+ parameters?: unknown[] | undefined;
21
+ output?: unknown;
22
+ };
23
+ type ErrorMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
24
+ hookName: H;
25
+ duration: number;
26
+ strategy: Strategy;
27
+ parameters?: unknown[] | undefined;
28
+ plugin: Plugin;
29
+ };
30
+ type ProgressStartMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
31
+ hookName: H;
32
+ plugins: Array<Plugin>;
33
+ };
34
+ type ProgressStopMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
35
+ hookName: H;
36
+ };
16
37
  type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
17
38
  type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
18
39
  result: Result;
@@ -27,9 +48,11 @@ type Options = {
27
48
  concurrency?: number;
28
49
  };
29
50
  type Events = {
30
- executing: [executer: Executer];
31
- executed: [executer: Executer];
32
- error: [error: Error];
51
+ progress_start: [meta: ProgressStartMeta];
52
+ progress_stop: [meta: ProgressStopMeta];
53
+ executing: [meta: ExecutingMeta];
54
+ executed: [meta: ExecutedMeta];
55
+ error: [error: Error, meta: ErrorMeta];
33
56
  };
34
57
  type GetFileProps<TOptions = object> = {
35
58
  name: string;
@@ -43,8 +66,6 @@ declare class PluginManager {
43
66
  #private;
44
67
  readonly events: EventEmitter<Events>;
45
68
  readonly config: Config;
46
- readonly executed: Array<Executer>;
47
- readonly logger: Logger;
48
69
  readonly options: Options;
49
70
  constructor(config: Config, options: Options);
50
71
  getContext<TOptions extends PluginFactoryOptions>(plugin: Plugin<TOptions>): PluginContext<TOptions> & Record<string, any>;
@@ -70,13 +91,11 @@ declare class PluginManager {
70
91
  hookForPlugin<H extends PluginLifecycleHooks>({
71
92
  pluginKey,
72
93
  hookName,
73
- parameters,
74
- message
94
+ parameters
75
95
  }: {
76
96
  pluginKey: Plugin['key'];
77
97
  hookName: H;
78
98
  parameters: PluginParameter<H>;
79
- message: string;
80
99
  }): Promise<Array<ReturnType<ParseResult<H>> | null>>;
81
100
  /**
82
101
  * Run a specific hookName for plugin x.
@@ -84,13 +103,11 @@ declare class PluginManager {
84
103
  hookForPluginSync<H extends PluginLifecycleHooks>({
85
104
  pluginKey,
86
105
  hookName,
87
- parameters,
88
- message
106
+ parameters
89
107
  }: {
90
108
  pluginKey: Plugin['key'];
91
109
  hookName: H;
92
110
  parameters: PluginParameter<H>;
93
- message: string;
94
111
  }): Array<ReturnType<ParseResult<H>>> | null;
95
112
  /**
96
113
  * First non-null result stops and will return it's value.
@@ -98,13 +115,11 @@ declare class PluginManager {
98
115
  hookFirst<H extends PluginLifecycleHooks>({
99
116
  hookName,
100
117
  parameters,
101
- skipped,
102
- message
118
+ skipped
103
119
  }: {
104
120
  hookName: H;
105
121
  parameters: PluginParameter<H>;
106
122
  skipped?: ReadonlySet<Plugin> | null;
107
- message: string;
108
123
  }): Promise<SafeParseResult<H>>;
109
124
  /**
110
125
  * First non-null result stops and will return it's value.
@@ -112,37 +127,31 @@ declare class PluginManager {
112
127
  hookFirstSync<H extends PluginLifecycleHooks>({
113
128
  hookName,
114
129
  parameters,
115
- skipped,
116
- message
130
+ skipped
117
131
  }: {
118
132
  hookName: H;
119
133
  parameters: PluginParameter<H>;
120
134
  skipped?: ReadonlySet<Plugin> | null;
121
- message: string;
122
135
  }): SafeParseResult<H>;
123
136
  /**
124
137
  * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
125
138
  */
126
139
  hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
127
140
  hookName,
128
- parameters,
129
- message
141
+ parameters
130
142
  }: {
131
143
  hookName: H;
132
144
  parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
133
- message: string;
134
145
  }): Promise<Awaited<TOuput>[]>;
135
146
  /**
136
147
  * Chains plugins
137
148
  */
138
149
  hookSeq<H extends PluginLifecycleHooks>({
139
150
  hookName,
140
- parameters,
141
- message
151
+ parameters
142
152
  }: {
143
153
  hookName: H;
144
154
  parameters?: PluginParameter<H>;
145
- message: string;
146
155
  }): Promise<void>;
147
156
  getPluginByKey(pluginKey: Plugin['key']): Plugin | undefined;
148
157
  getPluginsByKey(hookName: keyof PluginWithLifeCycle, pluginKey: Plugin['key']): Plugin[];
@@ -466,4 +475,4 @@ type Group = {
466
475
  };
467
476
  //#endregion
468
477
  export { getMode as C, PluginManager as S, ResolvePathParams as _, InputData as a, UserPluginWithLifeCycle as b, Plugin as c, PluginKey as d, PluginLifecycle as f, ResolveNameParams as g, PluginWithLifeCycle as h, Group as i, PluginContext as l, PluginParameter as m, Config as n, InputPath as o, PluginLifecycleHooks as p, GetPluginFactoryOptions as r, Output as s, BarrelType as t, PluginFactoryOptions as u, UserConfig as v, PossiblePromise as x, UserPlugin as y };
469
- //# sourceMappingURL=types-tSSA1oz8.d.cts.map
478
+ //# sourceMappingURL=types-CCEy_FVr.d.cts.map
@@ -1,18 +1,39 @@
1
- import { n as Logger, o as EventEmitter } from "./logger-C96jDrSt.js";
1
+ import { n as Logger, o as EventEmitter } from "./logger-o16AyvGp.js";
2
2
  import { Fabric } from "@kubb/react-fabric";
3
3
  import { KubbFile } from "@kubb/fabric-core/types";
4
4
 
5
5
  //#region src/PluginManager.d.ts
6
6
  type RequiredPluginLifecycle = Required<PluginLifecycle>;
7
7
  type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
8
- type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
9
- message: string;
8
+ type ExecutingMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
10
9
  strategy: Strategy;
11
10
  hookName: H;
12
11
  plugin: Plugin;
13
12
  parameters?: unknown[] | undefined;
14
13
  output?: unknown;
15
14
  };
15
+ type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
16
+ duration: number;
17
+ strategy: Strategy;
18
+ hookName: H;
19
+ plugin: Plugin;
20
+ parameters?: unknown[] | undefined;
21
+ output?: unknown;
22
+ };
23
+ type ErrorMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
24
+ hookName: H;
25
+ duration: number;
26
+ strategy: Strategy;
27
+ parameters?: unknown[] | undefined;
28
+ plugin: Plugin;
29
+ };
30
+ type ProgressStartMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
31
+ hookName: H;
32
+ plugins: Array<Plugin>;
33
+ };
34
+ type ProgressStopMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
35
+ hookName: H;
36
+ };
16
37
  type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
17
38
  type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
18
39
  result: Result;
@@ -27,9 +48,11 @@ type Options = {
27
48
  concurrency?: number;
28
49
  };
29
50
  type Events = {
30
- executing: [executer: Executer];
31
- executed: [executer: Executer];
32
- error: [error: Error];
51
+ progress_start: [meta: ProgressStartMeta];
52
+ progress_stop: [meta: ProgressStopMeta];
53
+ executing: [meta: ExecutingMeta];
54
+ executed: [meta: ExecutedMeta];
55
+ error: [error: Error, meta: ErrorMeta];
33
56
  };
34
57
  type GetFileProps<TOptions = object> = {
35
58
  name: string;
@@ -43,8 +66,6 @@ declare class PluginManager {
43
66
  #private;
44
67
  readonly events: EventEmitter<Events>;
45
68
  readonly config: Config;
46
- readonly executed: Array<Executer>;
47
- readonly logger: Logger;
48
69
  readonly options: Options;
49
70
  constructor(config: Config, options: Options);
50
71
  getContext<TOptions extends PluginFactoryOptions>(plugin: Plugin<TOptions>): PluginContext<TOptions> & Record<string, any>;
@@ -70,13 +91,11 @@ declare class PluginManager {
70
91
  hookForPlugin<H extends PluginLifecycleHooks>({
71
92
  pluginKey,
72
93
  hookName,
73
- parameters,
74
- message
94
+ parameters
75
95
  }: {
76
96
  pluginKey: Plugin['key'];
77
97
  hookName: H;
78
98
  parameters: PluginParameter<H>;
79
- message: string;
80
99
  }): Promise<Array<ReturnType<ParseResult<H>> | null>>;
81
100
  /**
82
101
  * Run a specific hookName for plugin x.
@@ -84,13 +103,11 @@ declare class PluginManager {
84
103
  hookForPluginSync<H extends PluginLifecycleHooks>({
85
104
  pluginKey,
86
105
  hookName,
87
- parameters,
88
- message
106
+ parameters
89
107
  }: {
90
108
  pluginKey: Plugin['key'];
91
109
  hookName: H;
92
110
  parameters: PluginParameter<H>;
93
- message: string;
94
111
  }): Array<ReturnType<ParseResult<H>>> | null;
95
112
  /**
96
113
  * First non-null result stops and will return it's value.
@@ -98,13 +115,11 @@ declare class PluginManager {
98
115
  hookFirst<H extends PluginLifecycleHooks>({
99
116
  hookName,
100
117
  parameters,
101
- skipped,
102
- message
118
+ skipped
103
119
  }: {
104
120
  hookName: H;
105
121
  parameters: PluginParameter<H>;
106
122
  skipped?: ReadonlySet<Plugin> | null;
107
- message: string;
108
123
  }): Promise<SafeParseResult<H>>;
109
124
  /**
110
125
  * First non-null result stops and will return it's value.
@@ -112,37 +127,31 @@ declare class PluginManager {
112
127
  hookFirstSync<H extends PluginLifecycleHooks>({
113
128
  hookName,
114
129
  parameters,
115
- skipped,
116
- message
130
+ skipped
117
131
  }: {
118
132
  hookName: H;
119
133
  parameters: PluginParameter<H>;
120
134
  skipped?: ReadonlySet<Plugin> | null;
121
- message: string;
122
135
  }): SafeParseResult<H>;
123
136
  /**
124
137
  * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
125
138
  */
126
139
  hookParallel<H extends PluginLifecycleHooks, TOuput = void>({
127
140
  hookName,
128
- parameters,
129
- message
141
+ parameters
130
142
  }: {
131
143
  hookName: H;
132
144
  parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
133
- message: string;
134
145
  }): Promise<Awaited<TOuput>[]>;
135
146
  /**
136
147
  * Chains plugins
137
148
  */
138
149
  hookSeq<H extends PluginLifecycleHooks>({
139
150
  hookName,
140
- parameters,
141
- message
151
+ parameters
142
152
  }: {
143
153
  hookName: H;
144
154
  parameters?: PluginParameter<H>;
145
- message: string;
146
155
  }): Promise<void>;
147
156
  getPluginByKey(pluginKey: Plugin['key']): Plugin | undefined;
148
157
  getPluginsByKey(hookName: keyof PluginWithLifeCycle, pluginKey: Plugin['key']): Plugin[];
@@ -466,4 +475,4 @@ type Group = {
466
475
  };
467
476
  //#endregion
468
477
  export { getMode as C, PluginManager as S, ResolvePathParams as _, InputData as a, UserPluginWithLifeCycle as b, Plugin as c, PluginKey as d, PluginLifecycle as f, ResolveNameParams as g, PluginWithLifeCycle as h, Group as i, PluginContext as l, PluginParameter as m, Config as n, InputPath as o, PluginLifecycleHooks as p, GetPluginFactoryOptions as r, Output as s, BarrelType as t, PluginFactoryOptions as u, UserConfig as v, PossiblePromise as x, UserPlugin as y };
469
- //# sourceMappingURL=types-69-evK37.d.ts.map
478
+ //# sourceMappingURL=types-DgfEZ3IN.d.ts.map
package/dist/utils.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_getBarrelFiles = require('./getBarrelFiles-BkDzzugQ.cjs');
2
+ const require_getBarrelFiles = require('./getBarrelFiles-8VEWWk9Z.cjs');
3
3
  const require_transformers = require('./transformers-B-zCAPV-.cjs');
4
4
  let node_path = require("node:path");
5
5
  node_path = require_chunk.__toESM(node_path);
package/dist/utils.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { x as PossiblePromise } from "./types-tSSA1oz8.cjs";
2
- import { n as getBarrelFiles } from "./getBarrelFiles-BVMBhc50.cjs";
1
+ import { x as PossiblePromise } from "./types-CCEy_FVr.cjs";
2
+ import { n as getBarrelFiles } from "./getBarrelFiles-B_2WDywH.cjs";
3
3
 
4
4
  //#region src/utils/buildJSDoc.d.ts
5
5
 
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { x as PossiblePromise } from "./types-69-evK37.js";
2
- import { n as getBarrelFiles } from "./getBarrelFiles-DjQ68d4e.js";
1
+ import { x as PossiblePromise } from "./types-DgfEZ3IN.js";
2
+ import { n as getBarrelFiles } from "./getBarrelFiles-ZIHk_1ln.js";
3
3
 
4
4
  //#region src/utils/buildJSDoc.d.ts
5
5
 
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getUniqueName, n as URLPath, o as setUniqueName, t as getBarrelFiles } from "./getBarrelFiles-a-GlnjYa.js";
1
+ import { a as getUniqueName, n as URLPath, o as setUniqueName, t as getBarrelFiles } from "./getBarrelFiles-DQ0hksqD.js";
2
2
  import { m as camelCase } from "./transformers-CjdbeLAK.js";
3
3
  import path from "node:path";
4
4
  import { orderBy } from "natural-orderby";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "4.11.1",
3
+ "version": "4.11.2",
4
4
  "description": "Core functionality for Kubb's plugin-based code generation system, providing the foundation for transforming OpenAPI specifications.",
5
5
  "keywords": [
6
6
  "typescript",