@kubb/core 3.0.0-alpha.2 → 3.0.0-alpha.20

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 (107) hide show
  1. package/README.md +13 -4
  2. package/dist/{FileManager-BW--rO8q.d.ts → FileManager-DQtWE_rp.d.ts} +112 -72
  3. package/dist/{FileManager-Bw-FNS3q.d.cts → FileManager-qZTz0oZl.d.cts} +112 -72
  4. package/dist/chunk-253UUWI5.cjs +101 -0
  5. package/dist/chunk-253UUWI5.cjs.map +1 -0
  6. package/dist/chunk-2EU7DMPM.js +96 -0
  7. package/dist/chunk-2EU7DMPM.js.map +1 -0
  8. package/dist/chunk-4X5FFJPJ.js +8 -13
  9. package/dist/chunk-4X5FFJPJ.js.map +1 -1
  10. package/dist/chunk-7O42P6ET.cjs +1088 -0
  11. package/dist/chunk-7O42P6ET.cjs.map +1 -0
  12. package/dist/chunk-CLTNHSMO.js +895 -0
  13. package/dist/chunk-CLTNHSMO.js.map +1 -0
  14. package/dist/{chunk-3OXCZ5DJ.js → chunk-E6CN2CZC.js} +63 -54
  15. package/dist/chunk-E6CN2CZC.js.map +1 -0
  16. package/dist/chunk-HBQM723K.js +1049 -0
  17. package/dist/chunk-HBQM723K.js.map +1 -0
  18. package/dist/{chunk-LM2YQC3T.cjs → chunk-HRJU3XOH.cjs} +81 -51
  19. package/dist/chunk-HRJU3XOH.cjs.map +1 -0
  20. package/dist/chunk-OAGN4FY6.cjs +42 -0
  21. package/dist/chunk-OAGN4FY6.cjs.map +1 -0
  22. package/dist/chunk-P37BU33L.cjs +1537 -0
  23. package/dist/chunk-P37BU33L.cjs.map +1 -0
  24. package/dist/{chunk-67C6RBGQ.cjs → chunk-U3S2ZR6C.cjs} +28 -29
  25. package/dist/chunk-U3S2ZR6C.cjs.map +1 -0
  26. package/dist/index.cjs +551 -599
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +6 -19
  29. package/dist/index.d.ts +6 -19
  30. package/dist/index.js +442 -512
  31. package/dist/index.js.map +1 -1
  32. package/dist/{logger-DChjnJMn.d.cts → logger-DvbHXjIO.d.cts} +29 -19
  33. package/dist/{logger-DChjnJMn.d.ts → logger-DvbHXjIO.d.ts} +29 -19
  34. package/dist/logger.cjs +25 -15
  35. package/dist/logger.cjs.map +1 -1
  36. package/dist/logger.d.cts +1 -2
  37. package/dist/logger.d.ts +1 -2
  38. package/dist/logger.js +3 -15
  39. package/dist/logger.js.map +1 -1
  40. package/dist/mocks.cjs +42 -31
  41. package/dist/mocks.cjs.map +1 -1
  42. package/dist/mocks.d.cts +7 -9
  43. package/dist/mocks.d.ts +7 -9
  44. package/dist/mocks.js +35 -33
  45. package/dist/mocks.js.map +1 -1
  46. package/dist/prompt-TK4KVZVL.cjs +760 -0
  47. package/dist/prompt-TK4KVZVL.cjs.map +1 -0
  48. package/dist/prompt-WQQUN22Z.js +749 -0
  49. package/dist/prompt-WQQUN22Z.js.map +1 -0
  50. package/dist/transformers.cjs +215 -49
  51. package/dist/transformers.cjs.map +1 -1
  52. package/dist/transformers.d.cts +1 -3
  53. package/dist/transformers.d.ts +1 -3
  54. package/dist/transformers.js +148 -35
  55. package/dist/transformers.js.map +1 -1
  56. package/dist/utils.cjs +65 -26
  57. package/dist/utils.cjs.map +1 -1
  58. package/dist/utils.d.cts +32 -3
  59. package/dist/utils.d.ts +32 -3
  60. package/dist/utils.js +3 -26
  61. package/dist/utils.js.map +1 -1
  62. package/package.json +10 -13
  63. package/src/BarrelManager.ts +95 -109
  64. package/src/{Generator.ts → BaseGenerator.ts} +1 -1
  65. package/src/FileManager.ts +190 -298
  66. package/src/PackageManager.ts +1 -1
  67. package/src/PluginManager.ts +149 -90
  68. package/src/PromiseManager.ts +1 -1
  69. package/src/__snapshots__/barrel.json +93 -0
  70. package/src/__snapshots__/grouped.json +120 -0
  71. package/src/__snapshots__/ordered.json +68 -0
  72. package/src/build.ts +87 -122
  73. package/src/config.ts +1 -1
  74. package/src/errors.ts +0 -11
  75. package/src/index.ts +2 -3
  76. package/src/logger.ts +76 -34
  77. package/src/plugin.ts +2 -5
  78. package/src/transformers/escape.ts +0 -10
  79. package/src/transformers/index.ts +2 -3
  80. package/src/transformers/trim.ts +0 -4
  81. package/src/types.ts +36 -5
  82. package/src/utils/TreeNode.ts +132 -50
  83. package/src/utils/executeStrategies.ts +3 -3
  84. package/src/utils/index.ts +2 -1
  85. package/src/utils/parser.ts +166 -0
  86. package/dist/chunk-3OXCZ5DJ.js.map +0 -1
  87. package/dist/chunk-5JZNFPUP.js +0 -309
  88. package/dist/chunk-5JZNFPUP.js.map +0 -1
  89. package/dist/chunk-67C6RBGQ.cjs.map +0 -1
  90. package/dist/chunk-ADC5UNZ5.cjs +0 -1227
  91. package/dist/chunk-ADC5UNZ5.cjs.map +0 -1
  92. package/dist/chunk-HMLY7DHA.js +0 -16
  93. package/dist/chunk-HMLY7DHA.js.map +0 -1
  94. package/dist/chunk-JKZG2IJR.js +0 -283
  95. package/dist/chunk-JKZG2IJR.js.map +0 -1
  96. package/dist/chunk-LM2YQC3T.cjs.map +0 -1
  97. package/dist/chunk-PZT4CTBV.cjs +0 -299
  98. package/dist/chunk-PZT4CTBV.cjs.map +0 -1
  99. package/dist/chunk-SA2GZKXS.js +0 -596
  100. package/dist/chunk-SA2GZKXS.js.map +0 -1
  101. package/dist/chunk-XCPFG6DO.cjs +0 -66
  102. package/dist/chunk-XCPFG6DO.cjs.map +0 -1
  103. package/dist/chunk-YTSNYMHW.cjs +0 -320
  104. package/dist/chunk-YTSNYMHW.cjs.map +0 -1
  105. package/schema.json +0 -86
  106. package/src/utils/cache.ts +0 -35
  107. package/src/utils/getParser.ts +0 -17
@@ -1,19 +1,8 @@
1
- import PQueue from 'p-queue';
2
1
  import { write, read } from '@kubb/fs';
3
2
  import * as KubbFile from '@kubb/fs/types';
4
- import { BaseName, File, UUID } from '@kubb/fs/src/types.ts';
3
+ import { ResolvedFile } from '@kubb/fs/types';
5
4
  import { PossiblePromise, GreaterThan } from '@kubb/types';
6
- import { DirectoryTreeOptions } from 'directory-tree';
7
- import { E as EventEmitter, L as Logger } from './logger-DChjnJMn.cjs';
8
-
9
- type BarrelManagerOptions = {
10
- treeNode?: DirectoryTreeOptions;
11
- isTypeOnly?: boolean;
12
- /**
13
- * Add .ts or .js
14
- */
15
- extName?: KubbFile.Extname;
16
- };
5
+ import { E as EventEmitter, L as Logger } from './logger-DvbHXjIO.cjs';
17
6
 
18
7
  type RequiredPluginLifecycle = Required<PluginLifecycle>;
19
8
  /**
@@ -23,6 +12,7 @@ type RequiredPluginLifecycle = Required<PluginLifecycle>;
23
12
  type Argument0<H extends keyof PluginLifecycle> = Parameters<RequiredPluginLifecycle[H]>[0];
24
13
  type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookReduceArg0' | 'hookSeq';
25
14
  type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
15
+ message: string;
26
16
  strategy: Strategy;
27
17
  hookName: H;
28
18
  plugin: Plugin;
@@ -34,15 +24,11 @@ type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseRe
34
24
  result: Result;
35
25
  plugin: Plugin;
36
26
  };
37
- type Options$1 = {
27
+ type Options = {
38
28
  logger: Logger;
39
- /**
40
- * Task for the FileManager
41
- */
42
- task: (file: ResolvedFile) => Promise<ResolvedFile>;
43
29
  };
44
30
  type Events = {
45
- execute: [executer: Executer];
31
+ executing: [executer: Executer];
46
32
  executed: [executer: Executer];
47
33
  error: [error: Error];
48
34
  };
@@ -55,14 +41,14 @@ type GetFileProps<TOptions = object> = {
55
41
  };
56
42
  declare class PluginManager {
57
43
  #private;
58
- readonly plugins: PluginWithLifeCycle[];
44
+ readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
59
45
  readonly fileManager: FileManager;
60
46
  readonly events: EventEmitter<Events>;
61
47
  readonly config: Config;
62
48
  readonly executed: Array<Executer>;
63
49
  readonly logger: Logger;
64
- readonly queue: PQueue;
65
- constructor(config: Config, options: Options$1);
50
+ readonly options: Options;
51
+ constructor(config: Config, options: Options);
66
52
  getFile<TOptions = object>({ name, mode, extName, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{
67
53
  pluginKey: Plugin['key'];
68
54
  }>;
@@ -75,69 +61,69 @@ declare class PluginManager {
75
61
  /**
76
62
  * Run a specific hookName for plugin x.
77
63
  */
78
- hookForPlugin<H extends PluginLifecycleHooks>({ pluginKey, hookName, parameters, }: {
64
+ hookForPlugin<H extends PluginLifecycleHooks>({ pluginKey, hookName, parameters, message, }: {
79
65
  pluginKey: Plugin['key'];
80
66
  hookName: H;
81
67
  parameters: PluginParameter<H>;
82
- }): Promise<Array<ReturnType<ParseResult<H>> | null>> | null;
68
+ message: string;
69
+ }): Promise<Array<ReturnType<ParseResult<H>> | null>>;
83
70
  /**
84
71
  * Run a specific hookName for plugin x.
85
72
  */
86
- hookForPluginSync<H extends PluginLifecycleHooks>({ pluginKey, hookName, parameters, }: {
73
+ hookForPluginSync<H extends PluginLifecycleHooks>({ pluginKey, hookName, parameters, message, }: {
87
74
  pluginKey: Plugin['key'];
88
75
  hookName: H;
89
76
  parameters: PluginParameter<H>;
77
+ message: string;
90
78
  }): Array<ReturnType<ParseResult<H>>> | null;
91
79
  /**
92
80
  * First non-null result stops and will return it's value.
93
81
  */
94
- hookFirst<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, }: {
82
+ hookFirst<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, message, }: {
95
83
  hookName: H;
96
84
  parameters: PluginParameter<H>;
97
85
  skipped?: ReadonlySet<Plugin> | null;
86
+ message: string;
98
87
  }): Promise<SafeParseResult<H>>;
99
88
  /**
100
89
  * First non-null result stops and will return it's value.
101
90
  */
102
- hookFirstSync<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, }: {
91
+ hookFirstSync<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, message, }: {
103
92
  hookName: H;
104
93
  parameters: PluginParameter<H>;
105
94
  skipped?: ReadonlySet<Plugin> | null;
95
+ message: string;
106
96
  }): SafeParseResult<H>;
107
97
  /**
108
98
  * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
109
99
  */
110
- hookParallel<H extends PluginLifecycleHooks, TOuput = void>({ hookName, parameters, }: {
100
+ hookParallel<H extends PluginLifecycleHooks, TOuput = void>({ hookName, parameters, message, }: {
111
101
  hookName: H;
112
102
  parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined;
103
+ message: string;
113
104
  }): Promise<Awaited<TOuput>[]>;
114
105
  /**
115
106
  * Chain all plugins, `reduce` can be passed through to handle every returned value. The return value of the first plugin will be used as the first parameter for the plugin after that.
116
107
  */
117
- hookReduceArg0<H extends PluginLifecycleHooks>({ hookName, parameters, reduce, }: {
108
+ hookReduceArg0<H extends PluginLifecycleHooks>({ hookName, parameters, reduce, message, }: {
118
109
  hookName: H;
119
110
  parameters: PluginParameter<H>;
120
111
  reduce: (reduction: Argument0<H>, result: ReturnType<ParseResult<H>>, plugin: Plugin) => PossiblePromise<Argument0<H> | null>;
112
+ message: string;
121
113
  }): Promise<Argument0<H>>;
122
114
  /**
123
115
  * Chains plugins
124
116
  */
125
- hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters }: {
117
+ hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters, message, }: {
126
118
  hookName: H;
127
119
  parameters?: PluginParameter<H>;
120
+ message: string;
128
121
  }): Promise<void>;
129
122
  getPluginsByKey(hookName: keyof PluginLifecycle, pluginKey: Plugin['key']): Plugin[];
130
123
  static getDependedPlugins<T1 extends PluginFactoryOptions, T2 extends PluginFactoryOptions = never, T3 extends PluginFactoryOptions = never, TOutput = T3 extends never ? (T2 extends never ? [T1: Plugin<T1>] : [T1: Plugin<T1>, T2: Plugin<T2>]) : [T1: Plugin<T1>, T2: Plugin<T2>, T3: Plugin<T3>]>(plugins: Array<Plugin>, dependedPluginNames: string | string[]): TOutput;
131
124
  static get hooks(): readonly ["buildStart", "resolvePath", "resolveName", "buildEnd"];
132
125
  }
133
126
 
134
- interface Cache<TStore extends object = object> {
135
- delete(id: keyof TStore): boolean;
136
- get(id: keyof TStore): TStore[keyof TStore] | null;
137
- has(id: keyof TStore): boolean;
138
- set(id: keyof TStore, value: unknown): void;
139
- }
140
-
141
127
  /**
142
128
  * Config used in `kubb.config.js`
143
129
  *
@@ -202,6 +188,11 @@ type Config<TInput = Input> = {
202
188
  * @default true
203
189
  */
204
190
  write?: boolean;
191
+ /**
192
+ * Define what needs to exported, here you can also disable the export of barrel files
193
+ * @default `'barrelNamed'`
194
+ */
195
+ exportType?: 'barrel' | 'barrelNamed' | false;
205
196
  };
206
197
  /**
207
198
  * Array of Kubb plugins to use.
@@ -266,7 +257,7 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
266
257
  options: TOptions['resolvedOptions'];
267
258
  /**
268
259
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
269
- * Can be used to validate depended plugins.
260
+ * Can be used to validate dependent plugins.
270
261
  */
271
262
  pre?: Array<string>;
272
263
  /**
@@ -293,7 +284,7 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
293
284
  key: TOptions['key'];
294
285
  /**
295
286
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
296
- * Can be used to validate depended plugins.
287
+ * Can be used to validate dependent plugins.
297
288
  */
298
289
  pre?: Array<string>;
299
290
  /**
@@ -360,10 +351,9 @@ type ResolveNameParams = {
360
351
  };
361
352
  type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
362
353
  config: Config;
363
- cache: Cache<PluginCache>;
364
354
  fileManager: FileManager;
365
355
  pluginManager: PluginManager;
366
- addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.File>>;
356
+ addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
367
357
  resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
368
358
  resolveName: (params: ResolveNameParams) => string;
369
359
  logger: Logger;
@@ -376,62 +366,112 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
376
366
  */
377
367
  plugin: Plugin<TOptions>;
378
368
  };
379
-
380
- type ResolvedFile<TMeta extends FileMetaBase = FileMetaBase, TBaseName extends BaseName = BaseName> = File<TMeta, TBaseName> & {
369
+ type Output = {
370
+ /**
371
+ * Output to save the generated files.
372
+ */
373
+ path: string;
374
+ /**
375
+ * Name to be used for the `export * as {{exportAs}} from './'`
376
+ */
377
+ exportAs?: string;
378
+ /**
379
+ * Add an extension to the generated imports and exports, default it will not use an extension
380
+ */
381
+ extName?: KubbFile.Extname;
382
+ /**
383
+ * Define what needs to exported, here you can also disable the export of barrel files
384
+ * @default `'barrelNamed'`
385
+ */
386
+ exportType?: 'barrel' | 'barrelNamed' | false;
381
387
  /**
382
- * @default crypto.randomUUID()
388
+ * Add a footer text in the beginning of every file
383
389
  */
384
- id: UUID;
390
+ footer?: string;
385
391
  /**
386
- * Contains the first part of the baseName, generated based on baseName
387
- * @link https://nodejs.org/api/path.html#pathformatpathobject
392
+ * Add a banner text in the beginning of every file
388
393
  */
394
+ banner?: string;
395
+ };
396
+
397
+ type BarrelData = {
398
+ file?: KubbFile.File;
399
+ /**
400
+ * @deprecated use file instead
401
+ */
402
+ type: KubbFile.Mode;
403
+ path: string;
389
404
  name: string;
390
405
  };
406
+ declare class TreeNode {
407
+ #private;
408
+ data: BarrelData;
409
+ parent?: TreeNode;
410
+ children: Array<TreeNode>;
411
+ constructor(data: BarrelData, parent?: TreeNode);
412
+ addChild(data: BarrelData): TreeNode;
413
+ get root(): TreeNode;
414
+ get leaves(): Array<TreeNode>;
415
+ forEach(callback: (treeNode: TreeNode) => void): this;
416
+ findDeep(predicate?: (value: TreeNode, index: number, obj: TreeNode[]) => boolean): TreeNode | undefined;
417
+ forEachDeep(callback: (treeNode: TreeNode) => void): void;
418
+ filterDeep(callback: (treeNode: TreeNode) => boolean): Array<TreeNode>;
419
+ mapDeep<T>(callback: (treeNode: TreeNode) => T): Array<T>;
420
+ static build(files: KubbFile.File[], root?: string): TreeNode | null;
421
+ }
422
+ type DirectoryTree = {
423
+ name: string;
424
+ path: string;
425
+ file?: KubbFile.File;
426
+ children: Array<DirectoryTree>;
427
+ };
428
+
391
429
  type FileMetaBase = {
392
430
  pluginKey?: Plugin['key'];
393
431
  };
394
- type FileWithMeta<TMeta extends FileMetaBase = FileMetaBase> = KubbFile.File<TMeta>;
395
- type AddResult<T extends Array<FileWithMeta>> = Promise<Awaited<GreaterThan<T['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
432
+ type AddResult<T extends Array<KubbFile.File>> = Promise<Awaited<GreaterThan<T['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
396
433
  type AddIndexesProps = {
397
434
  /**
398
435
  * Root based on root and output.path specified in the config
399
436
  */
400
437
  root: string;
438
+ files: KubbFile.File[];
401
439
  /**
402
440
  * Output for plugin
403
441
  */
404
442
  output: {
405
443
  path: string;
406
- exportAs?: string;
407
444
  extName?: KubbFile.Extname;
445
+ exportAs?: string;
408
446
  exportType?: 'barrel' | 'barrelNamed' | false;
409
447
  };
410
- logger: Logger;
411
- options?: BarrelManagerOptions;
412
- meta?: FileWithMeta['meta'];
413
- };
414
- type Options = {
415
- queue?: PQueue;
416
- task?: (file: ResolvedFile) => Promise<ResolvedFile>;
448
+ group?: {
449
+ output: string;
450
+ exportAs: string;
451
+ };
452
+ logger?: Logger;
453
+ meta?: FileMetaBase;
417
454
  };
418
455
  declare class FileManager {
419
456
  #private;
420
- constructor({ task, queue }?: Options);
421
- get files(): Array<FileWithMeta>;
422
- get isExecuting(): boolean;
423
- add<T extends Array<FileWithMeta> = Array<FileWithMeta>>(...files: T): AddResult<T>;
424
- addIndexes({ root, output, meta, logger, options }: AddIndexesProps): Promise<void>;
425
- getCacheByUUID(UUID: KubbFile.UUID): FileWithMeta | undefined;
426
- get(path: KubbFile.Path): Array<FileWithMeta> | undefined;
427
- remove(path: KubbFile.Path): void;
428
- write(...params: Parameters<typeof write>): Promise<string | undefined>;
429
- read(...params: Parameters<typeof read>): Promise<string>;
430
- static getSource<TMeta extends FileMetaBase = FileMetaBase>(file: FileWithMeta<TMeta>): Promise<string>;
431
- static combineFiles<TMeta extends FileMetaBase = FileMetaBase>(files: Array<FileWithMeta<TMeta> | null>): Array<FileWithMeta<TMeta>>;
457
+ constructor();
458
+ get files(): Array<KubbFile.ResolvedFile>;
459
+ get orderedFiles(): Array<KubbFile.ResolvedFile>;
460
+ get groupedFiles(): DirectoryTree | null;
461
+ get treeNode(): TreeNode | null;
462
+ add<T extends Array<KubbFile.File> = Array<KubbFile.File>>(...files: T): AddResult<T>;
463
+ clear(): void;
464
+ getCacheById(id: string): KubbFile.File | undefined;
465
+ getByPath(path: KubbFile.Path): KubbFile.ResolvedFile | undefined;
466
+ deleteByPath(path: KubbFile.Path): void;
467
+ getBarrelFiles({ files, meta, root, output, logger }: AddIndexesProps): Promise<KubbFile.File[]>;
468
+ write(...params: Parameters<typeof write>): ReturnType<typeof write>;
469
+ read(...params: Parameters<typeof read>): ReturnType<typeof read>;
432
470
  static getMode(path: string | undefined | null): KubbFile.Mode;
433
- static get extensions(): Array<KubbFile.Extname>;
434
- static isJavascript(baseName: string): boolean;
435
471
  }
472
+ type GetSourceOptions = {
473
+ logger?: Logger;
474
+ };
475
+ declare function getSource<TMeta extends FileMetaBase = FileMetaBase>(file: ResolvedFile<TMeta>, { logger }?: GetSourceOptions): Promise<string>;
436
476
 
437
- export { type Config as C, FileManager as F, type GetPluginFactoryOptions as G, type InputPath as I, type PluginContext as P, type ResolvePathParams as R, type UserConfig as U, PluginManager as a, type PluginFactoryOptions as b, type UserPluginWithLifeCycle as c, type FileMetaBase as d, type InputData as e, type PluginKey as f, type UserPlugin as g, type Plugin as h, type PluginWithLifeCycle as i, type PluginLifecycle as j, type PluginLifecycleHooks as k, type PluginParameter as l, type PluginCache as m, type ResolveNameParams as n };
477
+ export { type Config as C, FileManager as F, type GetPluginFactoryOptions as G, type InputPath as I, type Output as O, type PluginContext as P, type ResolvePathParams as R, type UserConfig as U, PluginManager as a, type PluginFactoryOptions as b, type UserPluginWithLifeCycle as c, type FileMetaBase as d, type InputData as e, type PluginKey as f, getSource as g, type UserPlugin as h, type Plugin as i, type PluginWithLifeCycle as j, type PluginLifecycle as k, type PluginLifecycleHooks as l, type PluginParameter as m, type PluginCache as n, type ResolveNameParams as o };
@@ -0,0 +1,101 @@
1
+ 'use strict';
2
+
3
+ var chunkOAGN4FY6_cjs = require('./chunk-OAGN4FY6.cjs');
4
+
5
+ // src/transformers/transformReservedWord.ts
6
+ chunkOAGN4FY6_cjs.init_cjs_shims();
7
+ var reservedWords = [
8
+ "abstract",
9
+ "arguments",
10
+ "boolean",
11
+ "break",
12
+ "byte",
13
+ "case",
14
+ "catch",
15
+ "char",
16
+ "class",
17
+ "const",
18
+ "continue",
19
+ "debugger",
20
+ "default",
21
+ "delete",
22
+ "do",
23
+ "double",
24
+ "else",
25
+ "enum",
26
+ "eval",
27
+ "export",
28
+ "extends",
29
+ "false",
30
+ "final",
31
+ "finally",
32
+ "float",
33
+ "for",
34
+ "function",
35
+ "goto",
36
+ "if",
37
+ "implements",
38
+ "import",
39
+ "in",
40
+ "instanceof",
41
+ "int",
42
+ "interface",
43
+ "let",
44
+ "long",
45
+ "native",
46
+ "new",
47
+ "null",
48
+ "package",
49
+ "private",
50
+ "protected",
51
+ "public",
52
+ "return",
53
+ "short",
54
+ "static",
55
+ "super",
56
+ "switch",
57
+ "synchronized",
58
+ "this",
59
+ "throw",
60
+ "throws",
61
+ "transient",
62
+ "true",
63
+ "try",
64
+ "typeof",
65
+ "var",
66
+ "void",
67
+ "volatile",
68
+ "while",
69
+ "with",
70
+ "yield",
71
+ "Array",
72
+ "Date",
73
+ "eval",
74
+ "function",
75
+ "hasOwnProperty",
76
+ "Infinity",
77
+ "isFinite",
78
+ "isNaN",
79
+ "isPrototypeOf",
80
+ "length",
81
+ "Math",
82
+ "name",
83
+ "NaN",
84
+ "Number",
85
+ "Object",
86
+ "prototype",
87
+ "String",
88
+ "toString",
89
+ "undefined",
90
+ "valueOf"
91
+ ];
92
+ function transformReservedWord(word) {
93
+ if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
94
+ return `_${word}`;
95
+ }
96
+ return word;
97
+ }
98
+
99
+ exports.transformReservedWord = transformReservedWord;
100
+ //# sourceMappingURL=chunk-253UUWI5.cjs.map
101
+ //# sourceMappingURL=chunk-253UUWI5.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transformers/transformReservedWord.ts"],"names":["init_cjs_shims"],"mappings":";;;;;AAAAA,gCAAA,EAAA,CAAA;AAGA,IAAM,aAAgB,GAAA;AAAA,EACpB,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAEA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AACF,CAAA,CAAA;AAEO,SAAS,sBAAsB,IAAsB,EAAA;AAC1D,EAAK,IAAA,IAAA,IAAQ,cAAc,QAAS,CAAA,IAAI,KAAM,IAAM,EAAA,KAAA,CAAM,KAAK,CAAG,EAAA;AAChE,IAAA,OAAO,IAAI,IAAI,CAAA,CAAA,CAAA;AAAA,GACjB;AAEA,EAAO,OAAA,IAAA,CAAA;AACT","file":"chunk-253UUWI5.cjs","sourcesContent":["/**\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = [\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n\n 'Array',\n 'Date',\n 'eval',\n 'function',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n]\n\nexport function transformReservedWord(word: string): string {\n if ((word && reservedWords.includes(word)) || word?.match(/^\\d/)) {\n return `_${word}`\n }\n\n return word\n}\n"]}
@@ -0,0 +1,96 @@
1
+ // src/transformers/transformReservedWord.ts
2
+ var reservedWords = [
3
+ "abstract",
4
+ "arguments",
5
+ "boolean",
6
+ "break",
7
+ "byte",
8
+ "case",
9
+ "catch",
10
+ "char",
11
+ "class",
12
+ "const",
13
+ "continue",
14
+ "debugger",
15
+ "default",
16
+ "delete",
17
+ "do",
18
+ "double",
19
+ "else",
20
+ "enum",
21
+ "eval",
22
+ "export",
23
+ "extends",
24
+ "false",
25
+ "final",
26
+ "finally",
27
+ "float",
28
+ "for",
29
+ "function",
30
+ "goto",
31
+ "if",
32
+ "implements",
33
+ "import",
34
+ "in",
35
+ "instanceof",
36
+ "int",
37
+ "interface",
38
+ "let",
39
+ "long",
40
+ "native",
41
+ "new",
42
+ "null",
43
+ "package",
44
+ "private",
45
+ "protected",
46
+ "public",
47
+ "return",
48
+ "short",
49
+ "static",
50
+ "super",
51
+ "switch",
52
+ "synchronized",
53
+ "this",
54
+ "throw",
55
+ "throws",
56
+ "transient",
57
+ "true",
58
+ "try",
59
+ "typeof",
60
+ "var",
61
+ "void",
62
+ "volatile",
63
+ "while",
64
+ "with",
65
+ "yield",
66
+ "Array",
67
+ "Date",
68
+ "eval",
69
+ "function",
70
+ "hasOwnProperty",
71
+ "Infinity",
72
+ "isFinite",
73
+ "isNaN",
74
+ "isPrototypeOf",
75
+ "length",
76
+ "Math",
77
+ "name",
78
+ "NaN",
79
+ "Number",
80
+ "Object",
81
+ "prototype",
82
+ "String",
83
+ "toString",
84
+ "undefined",
85
+ "valueOf"
86
+ ];
87
+ function transformReservedWord(word) {
88
+ if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
89
+ return `_${word}`;
90
+ }
91
+ return word;
92
+ }
93
+
94
+ export { transformReservedWord };
95
+ //# sourceMappingURL=chunk-2EU7DMPM.js.map
96
+ //# sourceMappingURL=chunk-2EU7DMPM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transformers/transformReservedWord.ts"],"names":[],"mappings":";AAGA,IAAM,aAAgB,GAAA;AAAA,EACpB,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAEA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AACF,CAAA,CAAA;AAEO,SAAS,sBAAsB,IAAsB,EAAA;AAC1D,EAAK,IAAA,IAAA,IAAQ,cAAc,QAAS,CAAA,IAAI,KAAM,IAAM,EAAA,KAAA,CAAM,KAAK,CAAG,EAAA;AAChE,IAAA,OAAO,IAAI,IAAI,CAAA,CAAA,CAAA;AAAA,GACjB;AAEA,EAAO,OAAA,IAAA,CAAA;AACT","file":"chunk-2EU7DMPM.js","sourcesContent":["/**\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = [\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n\n 'Array',\n 'Date',\n 'eval',\n 'function',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n]\n\nexport function transformReservedWord(word: string): string {\n if ((word && reservedWords.includes(word)) || word?.match(/^\\d/)) {\n return `_${word}`\n }\n\n return word\n}\n"]}
@@ -1,3 +1,5 @@
1
+ import { camelCase as camelCase$1, pascalCase as pascalCase$1, pathCase as pathCase$1 } from 'change-case';
2
+
1
3
  // ../../node_modules/.pnpm/natural-orderby@3.0.2/node_modules/natural-orderby/dist/index.js
2
4
  var compareNumbers = function compareNumbers2(numberA, numberB) {
3
5
  if (numberA < numberB) {
@@ -299,15 +301,12 @@ function orderBy(collection, identifiers, orders) {
299
301
  var validatedOrders = getOrders(orders);
300
302
  return baseOrderBy(collection, validatedIdentifiers, validatedOrders);
301
303
  }
302
-
303
- // src/transformers/casing.ts
304
- import { camelCase as changeCamelCase, pascalCase as changePascalCase, pathCase as changePathCase } from "change-case";
305
304
  function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
306
305
  if (isFile) {
307
306
  const splitArray = text.split(".");
308
307
  return splitArray.map((item, i) => i === splitArray.length - 1 ? camelCase(item, { prefix, suffix }) : camelCase(item)).join("/");
309
308
  }
310
- return changeCamelCase(`${prefix} ${text} ${suffix}`, {
309
+ return camelCase$1(`${prefix} ${text} ${suffix}`, {
311
310
  delimiter: "",
312
311
  mergeAmbiguousCharacters: true
313
312
  });
@@ -317,7 +316,7 @@ function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
317
316
  const splitArray = text.split(".");
318
317
  return splitArray.map((item, i) => i === splitArray.length - 1 ? pascalCase(item, { prefix, suffix }) : camelCase(item)).join("/");
319
318
  }
320
- return changePascalCase(`${prefix} ${text} ${suffix}`, {
319
+ return pascalCase$1(`${prefix} ${text} ${suffix}`, {
321
320
  delimiter: "",
322
321
  mergeAmbiguousCharacters: true
323
322
  });
@@ -327,15 +326,8 @@ function pathCase(text, { isFile, prefix = "", suffix = "" } = {}) {
327
326
  const splitArray = text.split(".");
328
327
  return splitArray.map((item, i) => i === splitArray.length - 1 ? pathCase(item, { prefix, suffix }) : camelCase(item)).join("/");
329
328
  }
330
- return changePathCase(`${prefix} ${text} ${suffix}`, { delimiter: "" });
329
+ return pathCase$1(`${prefix} ${text} ${suffix}`, { delimiter: "" });
331
330
  }
332
-
333
- export {
334
- orderBy,
335
- camelCase,
336
- pascalCase,
337
- pathCase
338
- };
339
331
  /*! Bundled license information:
340
332
 
341
333
  natural-orderby/dist/index.js:
@@ -350,4 +342,7 @@ natural-orderby/dist/index.js:
350
342
  * @license MIT
351
343
  *)
352
344
  */
345
+
346
+ export { camelCase, orderBy, pascalCase, pathCase };
347
+ //# sourceMappingURL=chunk-4X5FFJPJ.js.map
353
348
  //# sourceMappingURL=chunk-4X5FFJPJ.js.map