@kubb/core 2.0.0-beta.12 → 2.0.0-beta.14
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/chunk-35FDNG5F.cjs +71 -0
- package/dist/chunk-35FDNG5F.cjs.map +1 -0
- package/dist/chunk-7CNPSL5M.js +85 -0
- package/dist/chunk-7CNPSL5M.js.map +1 -0
- package/dist/chunk-DKYWBKNH.js +18 -0
- package/dist/chunk-DKYWBKNH.js.map +1 -0
- package/dist/chunk-EZSRGYAY.js +128 -0
- package/dist/chunk-EZSRGYAY.js.map +1 -0
- package/dist/chunk-GBX7KRCX.cjs +162 -0
- package/dist/chunk-GBX7KRCX.cjs.map +1 -0
- package/dist/chunk-ICRPOCV4.cjs +2290 -0
- package/dist/chunk-ICRPOCV4.cjs.map +1 -0
- package/dist/chunk-LAS7UYTK.cjs +129 -0
- package/dist/chunk-LAS7UYTK.cjs.map +1 -0
- package/dist/chunk-LJHT3DNH.js +67 -0
- package/dist/chunk-LJHT3DNH.js.map +1 -0
- package/dist/chunk-MM42A6GN.cjs +91 -0
- package/dist/chunk-MM42A6GN.cjs.map +1 -0
- package/dist/chunk-SRGTC4FJ.js +129 -0
- package/dist/chunk-SRGTC4FJ.js.map +1 -0
- package/dist/chunk-ST7GHHSU.cjs +104 -0
- package/dist/chunk-ST7GHHSU.cjs.map +1 -0
- package/dist/chunk-U4C2WTCI.cjs +131 -0
- package/dist/chunk-U4C2WTCI.cjs.map +1 -0
- package/dist/chunk-UIQUKFF4.js +155 -0
- package/dist/chunk-UIQUKFF4.js.map +1 -0
- package/dist/chunk-WTSDXEWD.js +71 -0
- package/dist/chunk-WTSDXEWD.js.map +1 -0
- package/dist/fs.cjs +20 -2372
- package/dist/fs.cjs.map +1 -1
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +4 -2373
- package/dist/fs.js.map +1 -1
- package/dist/index.cjs +930 -3261
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +208 -3490
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +19 -141
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.d.cts +1 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +3 -135
- package/dist/logger.js.map +1 -1
- package/dist/transformers.cjs +40 -208
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.js +15 -201
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +22 -524
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +11 -517
- package/dist/utils.js.map +1 -1
- package/dist/{write-46ytbnu9.d.cts → write-A6VgHkYA.d.cts} +4 -1
- package/dist/{write-46ytbnu9.d.ts → write-A6VgHkYA.d.ts} +4 -1
- package/package.json +9 -8
- package/src/BarrelManager.ts +3 -3
- package/src/FileManager.ts +66 -62
- package/src/PluginManager.ts +11 -18
- package/src/build.ts +57 -32
- package/src/fs/clean.ts +2 -2
- package/src/fs/read.ts +1 -0
- package/src/fs/write.ts +40 -24
- package/src/logger.ts +10 -0
- package/src/utils/FunctionParams.ts +2 -2
- package/src/utils/URLPath.ts +5 -5
- package/src/utils/index.ts +0 -2
- package/dist/Queue-2-6pMcCx.d.cts +0 -32
- package/dist/Queue-2-6pMcCx.d.ts +0 -32
- package/src/utils/Queue.ts +0 -110
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PQueue from 'p-queue';
|
|
2
|
+
import { w as write, r as read } from './write-A6VgHkYA.cjs';
|
|
2
3
|
import { PossiblePromise, GreaterThan, TupleToUnion, ObjValueTuple } from '@kubb/types';
|
|
3
4
|
import { DirectoryTreeOptions } from 'directory-tree';
|
|
4
|
-
import { E as EventEmitter, Q as Queue, a as QueueJob } from './Queue-2-6pMcCx.cjs';
|
|
5
5
|
import { Logger, LogLevel } from './logger.cjs';
|
|
6
6
|
import 'ora';
|
|
7
7
|
|
|
@@ -14,6 +14,15 @@ type BarrelManagerOptions = {
|
|
|
14
14
|
extName?: KubbFile.Extname;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
18
|
+
#private;
|
|
19
|
+
constructor();
|
|
20
|
+
emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArg: TEvents[TEventName]): void;
|
|
21
|
+
on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
22
|
+
off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
23
|
+
removeAll(): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
18
27
|
/**
|
|
19
28
|
* Get the type of the first argument in a function.
|
|
@@ -38,11 +47,7 @@ type Options$2 = {
|
|
|
38
47
|
/**
|
|
39
48
|
* Task for the FileManager
|
|
40
49
|
*/
|
|
41
|
-
task:
|
|
42
|
-
/**
|
|
43
|
-
* Timeout between writes in the FileManager
|
|
44
|
-
*/
|
|
45
|
-
writeTimeout?: number;
|
|
50
|
+
task: (file: KubbFile.ResolvedFile) => Promise<KubbFile.ResolvedFile>;
|
|
46
51
|
};
|
|
47
52
|
type Events = {
|
|
48
53
|
execute: [executer: Executer];
|
|
@@ -54,10 +59,10 @@ declare class PluginManager {
|
|
|
54
59
|
readonly plugins: KubbPluginWithLifeCycle[];
|
|
55
60
|
readonly fileManager: FileManager;
|
|
56
61
|
readonly events: EventEmitter<Events>;
|
|
57
|
-
readonly queue: Queue;
|
|
58
62
|
readonly config: KubbConfig;
|
|
59
63
|
readonly executed: Array<Executer>;
|
|
60
64
|
readonly logger: Logger;
|
|
65
|
+
readonly queue: PQueue;
|
|
61
66
|
constructor(config: KubbConfig, options: Options$2);
|
|
62
67
|
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
|
|
63
68
|
resolveName: (params: ResolveNameParams) => string;
|
|
@@ -558,16 +563,12 @@ type AddIndexesProps = {
|
|
|
558
563
|
meta?: KubbFile.File['meta'];
|
|
559
564
|
};
|
|
560
565
|
type Options$1 = {
|
|
561
|
-
queue?:
|
|
562
|
-
task?:
|
|
563
|
-
/**
|
|
564
|
-
* Timeout between writes
|
|
565
|
-
*/
|
|
566
|
-
timeout?: number;
|
|
566
|
+
queue?: PQueue;
|
|
567
|
+
task?: (file: KubbFile.ResolvedFile) => Promise<KubbFile.ResolvedFile>;
|
|
567
568
|
};
|
|
568
569
|
declare class FileManager {
|
|
569
570
|
#private;
|
|
570
|
-
constructor(
|
|
571
|
+
constructor({ task, queue }?: Options$1);
|
|
571
572
|
get files(): Array<KubbFile.File>;
|
|
572
573
|
get isExecuting(): boolean;
|
|
573
574
|
add<T extends Array<KubbFile.File> = Array<KubbFile.File>>(...files: T): AddResult<T>;
|
|
@@ -578,6 +579,7 @@ declare class FileManager {
|
|
|
578
579
|
write(...params: Parameters<typeof write>): Promise<string | undefined>;
|
|
579
580
|
read(...params: Parameters<typeof read>): Promise<string>;
|
|
580
581
|
static getSource<TMeta extends KubbFile.FileMetaBase = KubbFile.FileMetaBase>(file: KubbFile.File<TMeta>): string;
|
|
582
|
+
static combineFiles<TMeta extends KubbFile.FileMetaBase = KubbFile.FileMetaBase>(files: Array<KubbFile.File<TMeta> | null>): Array<KubbFile.File<TMeta>>;
|
|
581
583
|
static getMode(path: string | undefined | null): KubbFile.Mode;
|
|
582
584
|
static get extensions(): Array<KubbFile.Extname>;
|
|
583
585
|
static isExtensionAllowed(baseName: string): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PQueue from 'p-queue';
|
|
2
|
+
import { w as write, r as read } from './write-A6VgHkYA.js';
|
|
2
3
|
import { PossiblePromise, GreaterThan, TupleToUnion, ObjValueTuple } from '@kubb/types';
|
|
3
4
|
import { DirectoryTreeOptions } from 'directory-tree';
|
|
4
|
-
import { E as EventEmitter, Q as Queue, a as QueueJob } from './Queue-2-6pMcCx.js';
|
|
5
5
|
import { Logger, LogLevel } from './logger.js';
|
|
6
6
|
import 'ora';
|
|
7
7
|
|
|
@@ -14,6 +14,15 @@ type BarrelManagerOptions = {
|
|
|
14
14
|
extName?: KubbFile.Extname;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
18
|
+
#private;
|
|
19
|
+
constructor();
|
|
20
|
+
emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArg: TEvents[TEventName]): void;
|
|
21
|
+
on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
22
|
+
off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
23
|
+
removeAll(): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
18
27
|
/**
|
|
19
28
|
* Get the type of the first argument in a function.
|
|
@@ -38,11 +47,7 @@ type Options$2 = {
|
|
|
38
47
|
/**
|
|
39
48
|
* Task for the FileManager
|
|
40
49
|
*/
|
|
41
|
-
task:
|
|
42
|
-
/**
|
|
43
|
-
* Timeout between writes in the FileManager
|
|
44
|
-
*/
|
|
45
|
-
writeTimeout?: number;
|
|
50
|
+
task: (file: KubbFile.ResolvedFile) => Promise<KubbFile.ResolvedFile>;
|
|
46
51
|
};
|
|
47
52
|
type Events = {
|
|
48
53
|
execute: [executer: Executer];
|
|
@@ -54,10 +59,10 @@ declare class PluginManager {
|
|
|
54
59
|
readonly plugins: KubbPluginWithLifeCycle[];
|
|
55
60
|
readonly fileManager: FileManager;
|
|
56
61
|
readonly events: EventEmitter<Events>;
|
|
57
|
-
readonly queue: Queue;
|
|
58
62
|
readonly config: KubbConfig;
|
|
59
63
|
readonly executed: Array<Executer>;
|
|
60
64
|
readonly logger: Logger;
|
|
65
|
+
readonly queue: PQueue;
|
|
61
66
|
constructor(config: KubbConfig, options: Options$2);
|
|
62
67
|
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
|
|
63
68
|
resolveName: (params: ResolveNameParams) => string;
|
|
@@ -558,16 +563,12 @@ type AddIndexesProps = {
|
|
|
558
563
|
meta?: KubbFile.File['meta'];
|
|
559
564
|
};
|
|
560
565
|
type Options$1 = {
|
|
561
|
-
queue?:
|
|
562
|
-
task?:
|
|
563
|
-
/**
|
|
564
|
-
* Timeout between writes
|
|
565
|
-
*/
|
|
566
|
-
timeout?: number;
|
|
566
|
+
queue?: PQueue;
|
|
567
|
+
task?: (file: KubbFile.ResolvedFile) => Promise<KubbFile.ResolvedFile>;
|
|
567
568
|
};
|
|
568
569
|
declare class FileManager {
|
|
569
570
|
#private;
|
|
570
|
-
constructor(
|
|
571
|
+
constructor({ task, queue }?: Options$1);
|
|
571
572
|
get files(): Array<KubbFile.File>;
|
|
572
573
|
get isExecuting(): boolean;
|
|
573
574
|
add<T extends Array<KubbFile.File> = Array<KubbFile.File>>(...files: T): AddResult<T>;
|
|
@@ -578,6 +579,7 @@ declare class FileManager {
|
|
|
578
579
|
write(...params: Parameters<typeof write>): Promise<string | undefined>;
|
|
579
580
|
read(...params: Parameters<typeof read>): Promise<string>;
|
|
580
581
|
static getSource<TMeta extends KubbFile.FileMetaBase = KubbFile.FileMetaBase>(file: KubbFile.File<TMeta>): string;
|
|
582
|
+
static combineFiles<TMeta extends KubbFile.FileMetaBase = KubbFile.FileMetaBase>(files: Array<KubbFile.File<TMeta> | null>): Array<KubbFile.File<TMeta>>;
|
|
581
583
|
static getMode(path: string | undefined | null): KubbFile.Mode;
|
|
582
584
|
static get extensions(): Array<KubbFile.Extname>;
|
|
583
585
|
static isExtensionAllowed(baseName: string): boolean;
|