@kubb/core 3.0.0-alpha.2 → 3.0.0-alpha.4
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/{FileManager-Bw-FNS3q.d.cts → FileManager--scIq4y4.d.cts} +26 -18
- package/dist/{FileManager-BW--rO8q.d.ts → FileManager-CaejIVBd.d.ts} +26 -18
- package/dist/chunk-25NKJ3DV.js +1063 -0
- package/dist/chunk-25NKJ3DV.js.map +1 -0
- package/dist/chunk-34BPAXR2.cjs +1071 -0
- package/dist/chunk-34BPAXR2.cjs.map +1 -0
- package/dist/{chunk-3OXCZ5DJ.js → chunk-EFQPHF4E.js} +29 -21
- package/dist/chunk-EFQPHF4E.js.map +1 -0
- package/dist/{chunk-LM2YQC3T.cjs → chunk-QRIDQ4RG.cjs} +38 -23
- package/dist/chunk-QRIDQ4RG.cjs.map +1 -0
- package/dist/{chunk-SA2GZKXS.js → chunk-UUBPTMRW.js} +49 -37
- package/dist/chunk-UUBPTMRW.js.map +1 -0
- package/dist/{chunk-ADC5UNZ5.cjs → chunk-V5THHXXQ.cjs} +259 -250
- package/dist/chunk-V5THHXXQ.cjs.map +1 -0
- package/dist/index.cjs +44 -108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -15
- package/dist/index.d.ts +4 -15
- package/dist/index.js +27 -91
- package/dist/index.js.map +1 -1
- package/dist/{logger-DChjnJMn.d.cts → logger-dzAcLeAA.d.cts} +12 -19
- package/dist/{logger-DChjnJMn.d.ts → logger-dzAcLeAA.d.ts} +12 -19
- package/dist/logger.cjs +3 -4
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.d.cts +1 -2
- package/dist/logger.d.ts +1 -2
- package/dist/logger.js +2 -3
- package/dist/mocks.cjs +3 -3
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +2 -4
- package/dist/mocks.d.ts +2 -4
- package/dist/mocks.js +2 -2
- package/dist/mocks.js.map +1 -1
- package/dist/prompt-6FWP747F.cjs +760 -0
- package/dist/prompt-6FWP747F.cjs.map +1 -0
- package/dist/prompt-HK3MWREM.js +755 -0
- package/dist/prompt-HK3MWREM.js.map +1 -0
- package/package.json +7 -8
- package/src/FileManager.ts +62 -42
- package/src/PluginManager.ts +4 -20
- package/src/build.ts +24 -91
- package/src/errors.ts +0 -11
- package/src/index.ts +0 -1
- package/src/logger.ts +42 -33
- package/dist/chunk-3OXCZ5DJ.js.map +0 -1
- package/dist/chunk-ADC5UNZ5.cjs.map +0 -1
- package/dist/chunk-LM2YQC3T.cjs.map +0 -1
- package/dist/chunk-SA2GZKXS.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import PQueue from 'p-queue';
|
|
2
1
|
import { write, read } from '@kubb/fs';
|
|
3
2
|
import * as KubbFile from '@kubb/fs/types';
|
|
4
3
|
import { BaseName, File, UUID } from '@kubb/fs/src/types.ts';
|
|
5
4
|
import { PossiblePromise, GreaterThan } from '@kubb/types';
|
|
6
5
|
import { DirectoryTreeOptions } from 'directory-tree';
|
|
7
|
-
import { E as EventEmitter, L as Logger } from './logger-
|
|
6
|
+
import { E as EventEmitter, L as Logger } from './logger-dzAcLeAA.cjs';
|
|
8
7
|
|
|
9
8
|
type BarrelManagerOptions = {
|
|
10
9
|
treeNode?: DirectoryTreeOptions;
|
|
@@ -34,12 +33,8 @@ type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseRe
|
|
|
34
33
|
result: Result;
|
|
35
34
|
plugin: Plugin;
|
|
36
35
|
};
|
|
37
|
-
type Options
|
|
36
|
+
type Options = {
|
|
38
37
|
logger: Logger;
|
|
39
|
-
/**
|
|
40
|
-
* Task for the FileManager
|
|
41
|
-
*/
|
|
42
|
-
task: (file: ResolvedFile) => Promise<ResolvedFile>;
|
|
43
38
|
};
|
|
44
39
|
type Events = {
|
|
45
40
|
execute: [executer: Executer];
|
|
@@ -61,8 +56,7 @@ declare class PluginManager {
|
|
|
61
56
|
readonly config: Config;
|
|
62
57
|
readonly executed: Array<Executer>;
|
|
63
58
|
readonly logger: Logger;
|
|
64
|
-
|
|
65
|
-
constructor(config: Config, options: Options$1);
|
|
59
|
+
constructor(config: Config, options: Options);
|
|
66
60
|
getFile<TOptions = object>({ name, mode, extName, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{
|
|
67
61
|
pluginKey: Plugin['key'];
|
|
68
62
|
}>;
|
|
@@ -411,27 +405,41 @@ type AddIndexesProps = {
|
|
|
411
405
|
options?: BarrelManagerOptions;
|
|
412
406
|
meta?: FileWithMeta['meta'];
|
|
413
407
|
};
|
|
414
|
-
type Options = {
|
|
415
|
-
queue?: PQueue;
|
|
416
|
-
task?: (file: ResolvedFile) => Promise<ResolvedFile>;
|
|
417
|
-
};
|
|
418
408
|
declare class FileManager {
|
|
419
409
|
#private;
|
|
420
|
-
constructor(
|
|
410
|
+
constructor();
|
|
421
411
|
get files(): Array<FileWithMeta>;
|
|
422
|
-
get isExecuting(): boolean;
|
|
423
412
|
add<T extends Array<FileWithMeta> = Array<FileWithMeta>>(...files: T): AddResult<T>;
|
|
424
|
-
|
|
413
|
+
getIndexFiles({ root, output, meta, logger, options }: AddIndexesProps): Promise<ResolvedFile[]>;
|
|
425
414
|
getCacheByUUID(UUID: KubbFile.UUID): FileWithMeta | undefined;
|
|
426
415
|
get(path: KubbFile.Path): Array<FileWithMeta> | undefined;
|
|
427
416
|
remove(path: KubbFile.Path): void;
|
|
428
|
-
write(...params: Parameters<typeof write>):
|
|
429
|
-
read(...params: Parameters<typeof read>):
|
|
417
|
+
write(...params: Parameters<typeof write>): ReturnType<typeof write>;
|
|
418
|
+
read(...params: Parameters<typeof read>): ReturnType<typeof read>;
|
|
419
|
+
processFiles(...params: Parameters<typeof processFiles>): ReturnType<typeof processFiles>;
|
|
430
420
|
static getSource<TMeta extends FileMetaBase = FileMetaBase>(file: FileWithMeta<TMeta>): Promise<string>;
|
|
431
421
|
static combineFiles<TMeta extends FileMetaBase = FileMetaBase>(files: Array<FileWithMeta<TMeta> | null>): Array<FileWithMeta<TMeta>>;
|
|
432
422
|
static getMode(path: string | undefined | null): KubbFile.Mode;
|
|
433
423
|
static get extensions(): Array<KubbFile.Extname>;
|
|
434
424
|
static isJavascript(baseName: string): boolean;
|
|
435
425
|
}
|
|
426
|
+
type WriteFilesProps = {
|
|
427
|
+
files: KubbFile.File[];
|
|
428
|
+
logger: Logger;
|
|
429
|
+
dryRun?: boolean;
|
|
430
|
+
};
|
|
431
|
+
declare function processFiles({ dryRun, logger, files }: WriteFilesProps): Promise<{
|
|
432
|
+
source: string;
|
|
433
|
+
id?: string;
|
|
434
|
+
baseName: `${string}.${string}`;
|
|
435
|
+
path: KubbFile.AdvancedPath<TBaseName> | KubbFile.Path;
|
|
436
|
+
imports?: KubbFile.Import[];
|
|
437
|
+
exports?: KubbFile.Export[];
|
|
438
|
+
override?: boolean;
|
|
439
|
+
meta?: object | undefined;
|
|
440
|
+
exportable?: boolean;
|
|
441
|
+
env?: NodeJS.ProcessEnv;
|
|
442
|
+
language?: string;
|
|
443
|
+
}[]>;
|
|
436
444
|
|
|
437
445
|
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 };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import PQueue from 'p-queue';
|
|
2
1
|
import { write, read } from '@kubb/fs';
|
|
3
2
|
import * as KubbFile from '@kubb/fs/types';
|
|
4
3
|
import { BaseName, File, UUID } from '@kubb/fs/src/types.ts';
|
|
5
4
|
import { PossiblePromise, GreaterThan } from '@kubb/types';
|
|
6
5
|
import { DirectoryTreeOptions } from 'directory-tree';
|
|
7
|
-
import { E as EventEmitter, L as Logger } from './logger-
|
|
6
|
+
import { E as EventEmitter, L as Logger } from './logger-dzAcLeAA.js';
|
|
8
7
|
|
|
9
8
|
type BarrelManagerOptions = {
|
|
10
9
|
treeNode?: DirectoryTreeOptions;
|
|
@@ -34,12 +33,8 @@ type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseRe
|
|
|
34
33
|
result: Result;
|
|
35
34
|
plugin: Plugin;
|
|
36
35
|
};
|
|
37
|
-
type Options
|
|
36
|
+
type Options = {
|
|
38
37
|
logger: Logger;
|
|
39
|
-
/**
|
|
40
|
-
* Task for the FileManager
|
|
41
|
-
*/
|
|
42
|
-
task: (file: ResolvedFile) => Promise<ResolvedFile>;
|
|
43
38
|
};
|
|
44
39
|
type Events = {
|
|
45
40
|
execute: [executer: Executer];
|
|
@@ -61,8 +56,7 @@ declare class PluginManager {
|
|
|
61
56
|
readonly config: Config;
|
|
62
57
|
readonly executed: Array<Executer>;
|
|
63
58
|
readonly logger: Logger;
|
|
64
|
-
|
|
65
|
-
constructor(config: Config, options: Options$1);
|
|
59
|
+
constructor(config: Config, options: Options);
|
|
66
60
|
getFile<TOptions = object>({ name, mode, extName, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{
|
|
67
61
|
pluginKey: Plugin['key'];
|
|
68
62
|
}>;
|
|
@@ -411,27 +405,41 @@ type AddIndexesProps = {
|
|
|
411
405
|
options?: BarrelManagerOptions;
|
|
412
406
|
meta?: FileWithMeta['meta'];
|
|
413
407
|
};
|
|
414
|
-
type Options = {
|
|
415
|
-
queue?: PQueue;
|
|
416
|
-
task?: (file: ResolvedFile) => Promise<ResolvedFile>;
|
|
417
|
-
};
|
|
418
408
|
declare class FileManager {
|
|
419
409
|
#private;
|
|
420
|
-
constructor(
|
|
410
|
+
constructor();
|
|
421
411
|
get files(): Array<FileWithMeta>;
|
|
422
|
-
get isExecuting(): boolean;
|
|
423
412
|
add<T extends Array<FileWithMeta> = Array<FileWithMeta>>(...files: T): AddResult<T>;
|
|
424
|
-
|
|
413
|
+
getIndexFiles({ root, output, meta, logger, options }: AddIndexesProps): Promise<ResolvedFile[]>;
|
|
425
414
|
getCacheByUUID(UUID: KubbFile.UUID): FileWithMeta | undefined;
|
|
426
415
|
get(path: KubbFile.Path): Array<FileWithMeta> | undefined;
|
|
427
416
|
remove(path: KubbFile.Path): void;
|
|
428
|
-
write(...params: Parameters<typeof write>):
|
|
429
|
-
read(...params: Parameters<typeof read>):
|
|
417
|
+
write(...params: Parameters<typeof write>): ReturnType<typeof write>;
|
|
418
|
+
read(...params: Parameters<typeof read>): ReturnType<typeof read>;
|
|
419
|
+
processFiles(...params: Parameters<typeof processFiles>): ReturnType<typeof processFiles>;
|
|
430
420
|
static getSource<TMeta extends FileMetaBase = FileMetaBase>(file: FileWithMeta<TMeta>): Promise<string>;
|
|
431
421
|
static combineFiles<TMeta extends FileMetaBase = FileMetaBase>(files: Array<FileWithMeta<TMeta> | null>): Array<FileWithMeta<TMeta>>;
|
|
432
422
|
static getMode(path: string | undefined | null): KubbFile.Mode;
|
|
433
423
|
static get extensions(): Array<KubbFile.Extname>;
|
|
434
424
|
static isJavascript(baseName: string): boolean;
|
|
435
425
|
}
|
|
426
|
+
type WriteFilesProps = {
|
|
427
|
+
files: KubbFile.File[];
|
|
428
|
+
logger: Logger;
|
|
429
|
+
dryRun?: boolean;
|
|
430
|
+
};
|
|
431
|
+
declare function processFiles({ dryRun, logger, files }: WriteFilesProps): Promise<{
|
|
432
|
+
source: string;
|
|
433
|
+
id?: string;
|
|
434
|
+
baseName: `${string}.${string}`;
|
|
435
|
+
path: KubbFile.AdvancedPath<TBaseName> | KubbFile.Path;
|
|
436
|
+
imports?: KubbFile.Import[];
|
|
437
|
+
exports?: KubbFile.Export[];
|
|
438
|
+
override?: boolean;
|
|
439
|
+
meta?: object | undefined;
|
|
440
|
+
exportable?: boolean;
|
|
441
|
+
env?: NodeJS.ProcessEnv;
|
|
442
|
+
language?: string;
|
|
443
|
+
}[]>;
|
|
436
444
|
|
|
437
445
|
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 };
|