@kubb/fabric-core 0.1.1 → 0.1.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.
- package/dist/App-DZuROf6f.d.ts +292 -0
- package/dist/App-zyf9KG3p.d.cts +292 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/defineApp-D3B0bU-z.d.cts +14 -0
- package/dist/defineApp-DJVMk9lc.d.ts +14 -0
- package/dist/index.cjs +165 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -8
- package/dist/index.d.ts +4 -8
- package/dist/index.js +154 -77
- package/dist/index.js.map +1 -1
- package/dist/parsers/typescript.cjs +5 -6
- package/dist/parsers/typescript.d.cts +3 -51
- package/dist/parsers/typescript.d.ts +3 -51
- package/dist/parsers/typescript.js +2 -3
- package/dist/parsers.cjs +7 -0
- package/dist/parsers.d.cts +14 -0
- package/dist/parsers.d.ts +14 -0
- package/dist/parsers.js +4 -0
- package/dist/plugins.cjs +76 -0
- package/dist/plugins.cjs.map +1 -0
- package/dist/plugins.d.cts +28 -0
- package/dist/plugins.d.ts +28 -0
- package/dist/plugins.js +71 -0
- package/dist/plugins.js.map +1 -0
- package/dist/tsxParser-C741ZKCN.js +26 -0
- package/dist/tsxParser-C741ZKCN.js.map +1 -0
- package/dist/tsxParser-HDf_3TMc.cjs +37 -0
- package/dist/tsxParser-HDf_3TMc.cjs.map +1 -0
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/{typescript-C60gWBu8.js → typescriptParser-BBGeFKlP.js} +52 -69
- package/dist/typescriptParser-BBGeFKlP.js.map +1 -0
- package/dist/{typescript-Z90jN87k.cjs → typescriptParser-BBbbmG5W.cjs} +61 -108
- package/dist/typescriptParser-BBbbmG5W.cjs.map +1 -0
- package/dist/typescriptParser-C-sBy1iR.d.cts +50 -0
- package/dist/typescriptParser-CtMmz0UV.d.ts +50 -0
- package/package.json +13 -13
- package/src/App.ts +91 -0
- package/src/FileManager.ts +12 -12
- package/src/FileProcessor.ts +49 -46
- package/src/createFile.ts +1 -1
- package/src/defineApp.ts +47 -72
- package/src/index.ts +1 -1
- package/src/parsers/createParser.ts +8 -0
- package/src/parsers/defaultParser.ts +10 -0
- package/src/parsers/index.ts +5 -0
- package/src/parsers/tsxParser.ts +11 -0
- package/src/parsers/types.ts +12 -2
- package/src/parsers/{typescript.ts → typescriptParser.ts} +8 -4
- package/src/plugins/createPlugin.ts +10 -0
- package/src/plugins/fsPlugin.ts +112 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/types.ts +15 -0
- package/src/types.ts +4 -1
- package/src/utils/AsyncEventEmitter.ts +37 -0
- package/src/utils/getRelativePath.ts +32 -0
- package/src/utils/trimExtName.ts +3 -0
- package/dist/KubbFile-BrN7Wwp6.d.cts +0 -119
- package/dist/KubbFile-BzVkcu9M.d.ts +0 -119
- package/dist/createFileParser-BD8yn0LT.cjs +0 -14
- package/dist/createFileParser-BD8yn0LT.cjs.map +0 -1
- package/dist/createFileParser-Cix3AMLd.js +0 -8
- package/dist/createFileParser-Cix3AMLd.js.map +0 -1
- package/dist/default-DCpuPmrL.js +0 -10
- package/dist/default-DCpuPmrL.js.map +0 -1
- package/dist/default-DNBu_jsL.cjs +0 -15
- package/dist/default-DNBu_jsL.cjs.map +0 -1
- package/dist/defineApp-CZYKsxTp.d.ts +0 -95
- package/dist/defineApp-c9lWJ96_.d.cts +0 -95
- package/dist/parsers/default.cjs +0 -4
- package/dist/parsers/default.d.cts +0 -8
- package/dist/parsers/default.d.ts +0 -8
- package/dist/parsers/default.js +0 -4
- package/dist/parsers/tsx.cjs +0 -5
- package/dist/parsers/tsx.d.cts +0 -8
- package/dist/parsers/tsx.d.ts +0 -8
- package/dist/parsers/tsx.js +0 -5
- package/dist/tsx-BSUaIML3.cjs +0 -16
- package/dist/tsx-BSUaIML3.cjs.map +0 -1
- package/dist/tsx-DBAk9dqS.js +0 -11
- package/dist/tsx-DBAk9dqS.js.map +0 -1
- package/dist/types-CkbelZaS.d.ts +0 -15
- package/dist/types-GueHciQ3.d.cts +0 -15
- package/dist/typescript-C60gWBu8.js.map +0 -1
- package/dist/typescript-Z90jN87k.cjs.map +0 -1
- package/src/fs.ts +0 -167
- package/src/parsers/createFileParser.ts +0 -5
- package/src/parsers/default.ts +0 -7
- package/src/parsers/tsx.ts +0 -8
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
declare namespace KubbFile_d_exports {
|
|
2
|
-
export { AdvancedPath, BaseName, Export, Extname, File, Import, Mode, OptionalPath, Path, ResolvedExport, ResolvedFile, ResolvedImport, Source };
|
|
3
|
-
}
|
|
4
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
5
|
-
type Import = {
|
|
6
|
-
/**
|
|
7
|
-
* Import name to be used
|
|
8
|
-
* @example ["useState"]
|
|
9
|
-
* @example "React"
|
|
10
|
-
*/
|
|
11
|
-
name: string | Array<string | {
|
|
12
|
-
propertyName: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* Path for the import
|
|
17
|
-
* @example '@kubb/core'
|
|
18
|
-
*/
|
|
19
|
-
path: string;
|
|
20
|
-
/**
|
|
21
|
-
* Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
|
|
22
|
-
*/
|
|
23
|
-
isTypeOnly?: boolean;
|
|
24
|
-
isNameSpace?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
27
|
-
*/
|
|
28
|
-
root?: string;
|
|
29
|
-
};
|
|
30
|
-
type Source = {
|
|
31
|
-
name?: string;
|
|
32
|
-
value?: string;
|
|
33
|
-
isTypeOnly?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Has const or type 'export'
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
isExportable?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* When set, barrel generation will add this
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
isIndexable?: boolean;
|
|
44
|
-
};
|
|
45
|
-
type Export = {
|
|
46
|
-
/**
|
|
47
|
-
* Export name to be used.
|
|
48
|
-
* @example ["useState"]
|
|
49
|
-
* @example "React"
|
|
50
|
-
*/
|
|
51
|
-
name?: string | Array<string>;
|
|
52
|
-
/**
|
|
53
|
-
* Path for the import.
|
|
54
|
-
* @example '@kubb/core'
|
|
55
|
-
*/
|
|
56
|
-
path: string;
|
|
57
|
-
/**
|
|
58
|
-
* Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
|
|
59
|
-
*/
|
|
60
|
-
isTypeOnly?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
|
|
63
|
-
*/
|
|
64
|
-
asAlias?: boolean;
|
|
65
|
-
};
|
|
66
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
67
|
-
type Mode = 'single' | 'split';
|
|
68
|
-
/**
|
|
69
|
-
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
70
|
-
* Based on UNIX basename
|
|
71
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
72
|
-
*/
|
|
73
|
-
type BaseName = `${string}.${string}`;
|
|
74
|
-
/**
|
|
75
|
-
* Path will be full qualified path to a specified file
|
|
76
|
-
*/
|
|
77
|
-
type Path = string;
|
|
78
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
79
|
-
type OptionalPath = Path | undefined | null;
|
|
80
|
-
type File<TMeta extends object = object> = {
|
|
81
|
-
/**
|
|
82
|
-
* Name to be used to create the path
|
|
83
|
-
* Based on UNIX basename, `${name}.extname`
|
|
84
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
85
|
-
*/
|
|
86
|
-
baseName: BaseName;
|
|
87
|
-
/**
|
|
88
|
-
* Path will be full qualified path to a specified file
|
|
89
|
-
*/
|
|
90
|
-
path: AdvancedPath<BaseName> | Path;
|
|
91
|
-
sources: Array<Source>;
|
|
92
|
-
imports?: Array<Import>;
|
|
93
|
-
exports?: Array<Export>;
|
|
94
|
-
/**
|
|
95
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
96
|
-
*/
|
|
97
|
-
meta?: TMeta;
|
|
98
|
-
banner?: string;
|
|
99
|
-
footer?: string;
|
|
100
|
-
};
|
|
101
|
-
type ResolvedImport = Import;
|
|
102
|
-
type ResolvedExport = Export;
|
|
103
|
-
type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
|
|
104
|
-
/**
|
|
105
|
-
* @default hash
|
|
106
|
-
*/
|
|
107
|
-
id: string;
|
|
108
|
-
/**
|
|
109
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
110
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
111
|
-
*/
|
|
112
|
-
name: string;
|
|
113
|
-
extname: Extname;
|
|
114
|
-
imports: Array<ResolvedImport>;
|
|
115
|
-
exports: Array<ResolvedExport>;
|
|
116
|
-
};
|
|
117
|
-
//#endregion
|
|
118
|
-
export { ResolvedFile as a, Path as i, File as n, KubbFile_d_exports as r, Extname as t };
|
|
119
|
-
//# sourceMappingURL=KubbFile-BrN7Wwp6.d.cts.map
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
declare namespace KubbFile_d_exports {
|
|
2
|
-
export { AdvancedPath, BaseName, Export, Extname, File, Import, Mode, OptionalPath, Path, ResolvedExport, ResolvedFile, ResolvedImport, Source };
|
|
3
|
-
}
|
|
4
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
5
|
-
type Import = {
|
|
6
|
-
/**
|
|
7
|
-
* Import name to be used
|
|
8
|
-
* @example ["useState"]
|
|
9
|
-
* @example "React"
|
|
10
|
-
*/
|
|
11
|
-
name: string | Array<string | {
|
|
12
|
-
propertyName: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* Path for the import
|
|
17
|
-
* @example '@kubb/core'
|
|
18
|
-
*/
|
|
19
|
-
path: string;
|
|
20
|
-
/**
|
|
21
|
-
* Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
|
|
22
|
-
*/
|
|
23
|
-
isTypeOnly?: boolean;
|
|
24
|
-
isNameSpace?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
27
|
-
*/
|
|
28
|
-
root?: string;
|
|
29
|
-
};
|
|
30
|
-
type Source = {
|
|
31
|
-
name?: string;
|
|
32
|
-
value?: string;
|
|
33
|
-
isTypeOnly?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Has const or type 'export'
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
isExportable?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* When set, barrel generation will add this
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
isIndexable?: boolean;
|
|
44
|
-
};
|
|
45
|
-
type Export = {
|
|
46
|
-
/**
|
|
47
|
-
* Export name to be used.
|
|
48
|
-
* @example ["useState"]
|
|
49
|
-
* @example "React"
|
|
50
|
-
*/
|
|
51
|
-
name?: string | Array<string>;
|
|
52
|
-
/**
|
|
53
|
-
* Path for the import.
|
|
54
|
-
* @example '@kubb/core'
|
|
55
|
-
*/
|
|
56
|
-
path: string;
|
|
57
|
-
/**
|
|
58
|
-
* Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
|
|
59
|
-
*/
|
|
60
|
-
isTypeOnly?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
|
|
63
|
-
*/
|
|
64
|
-
asAlias?: boolean;
|
|
65
|
-
};
|
|
66
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
67
|
-
type Mode = 'single' | 'split';
|
|
68
|
-
/**
|
|
69
|
-
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
70
|
-
* Based on UNIX basename
|
|
71
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
72
|
-
*/
|
|
73
|
-
type BaseName = `${string}.${string}`;
|
|
74
|
-
/**
|
|
75
|
-
* Path will be full qualified path to a specified file
|
|
76
|
-
*/
|
|
77
|
-
type Path = string;
|
|
78
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
79
|
-
type OptionalPath = Path | undefined | null;
|
|
80
|
-
type File<TMeta extends object = object> = {
|
|
81
|
-
/**
|
|
82
|
-
* Name to be used to create the path
|
|
83
|
-
* Based on UNIX basename, `${name}.extname`
|
|
84
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
85
|
-
*/
|
|
86
|
-
baseName: BaseName;
|
|
87
|
-
/**
|
|
88
|
-
* Path will be full qualified path to a specified file
|
|
89
|
-
*/
|
|
90
|
-
path: AdvancedPath<BaseName> | Path;
|
|
91
|
-
sources: Array<Source>;
|
|
92
|
-
imports?: Array<Import>;
|
|
93
|
-
exports?: Array<Export>;
|
|
94
|
-
/**
|
|
95
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
96
|
-
*/
|
|
97
|
-
meta?: TMeta;
|
|
98
|
-
banner?: string;
|
|
99
|
-
footer?: string;
|
|
100
|
-
};
|
|
101
|
-
type ResolvedImport = Import;
|
|
102
|
-
type ResolvedExport = Export;
|
|
103
|
-
type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
|
|
104
|
-
/**
|
|
105
|
-
* @default hash
|
|
106
|
-
*/
|
|
107
|
-
id: string;
|
|
108
|
-
/**
|
|
109
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
110
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
111
|
-
*/
|
|
112
|
-
name: string;
|
|
113
|
-
extname: Extname;
|
|
114
|
-
imports: Array<ResolvedImport>;
|
|
115
|
-
exports: Array<ResolvedExport>;
|
|
116
|
-
};
|
|
117
|
-
//#endregion
|
|
118
|
-
export { ResolvedFile as a, Path as i, File as n, KubbFile_d_exports as r, Extname as t };
|
|
119
|
-
//# sourceMappingURL=KubbFile-BzVkcu9M.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/parsers/createFileParser.ts
|
|
3
|
-
function createFileParser(parser) {
|
|
4
|
-
return parser;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
Object.defineProperty(exports, 'createFileParser', {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return createFileParser;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=createFileParser-BD8yn0LT.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFileParser-BD8yn0LT.cjs","names":[],"sources":["../src/parsers/createFileParser.ts"],"sourcesContent":["import type { Parser } from './types.ts'\n\nexport function createFileParser<TMeta extends object = object>(parser: Parser<TMeta>): Parser<TMeta> {\n return parser\n}\n"],"mappings":";;AAEA,SAAgB,iBAAgD,QAAsC;AACpG,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFileParser-Cix3AMLd.js","names":[],"sources":["../src/parsers/createFileParser.ts"],"sourcesContent":["import type { Parser } from './types.ts'\n\nexport function createFileParser<TMeta extends object = object>(parser: Parser<TMeta>): Parser<TMeta> {\n return parser\n}\n"],"mappings":";AAEA,SAAgB,iBAAgD,QAAsC;AACpG,QAAO"}
|
package/dist/default-DCpuPmrL.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { t as createFileParser } from "./createFileParser-Cix3AMLd.js";
|
|
2
|
-
|
|
3
|
-
//#region src/parsers/default.ts
|
|
4
|
-
const defaultParser = createFileParser({ async print(file) {
|
|
5
|
-
return file.sources.map((item) => item.value).join("\n\n");
|
|
6
|
-
} });
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { defaultParser as t };
|
|
10
|
-
//# sourceMappingURL=default-DCpuPmrL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-DCpuPmrL.js","names":[],"sources":["../src/parsers/default.ts"],"sourcesContent":["import { createFileParser } from './createFileParser.ts'\n\nexport const defaultParser = createFileParser({\n async print(file) {\n return file.sources.map((item) => item.value).join('\\n\\n')\n },\n})\n"],"mappings":";;;AAEA,MAAa,gBAAgB,iBAAiB,EAC5C,MAAM,MAAM,MAAM;AAChB,QAAO,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;GAE7D,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const require_createFileParser = require('./createFileParser-BD8yn0LT.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/parsers/default.ts
|
|
4
|
-
const defaultParser = require_createFileParser.createFileParser({ async print(file) {
|
|
5
|
-
return file.sources.map((item) => item.value).join("\n\n");
|
|
6
|
-
} });
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
Object.defineProperty(exports, 'defaultParser', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return defaultParser;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=default-DNBu_jsL.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-DNBu_jsL.cjs","names":["createFileParser"],"sources":["../src/parsers/default.ts"],"sourcesContent":["import { createFileParser } from './createFileParser.ts'\n\nexport const defaultParser = createFileParser({\n async print(file) {\n return file.sources.map((item) => item.value).join('\\n\\n')\n },\n})\n"],"mappings":";;;AAEA,MAAa,gBAAgBA,0CAAiB,EAC5C,MAAM,MAAM,MAAM;AAChB,QAAO,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;GAE7D,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { a as ResolvedFile, i as Path, n as File, t as Extname } from "./KubbFile-BzVkcu9M.js";
|
|
2
|
-
|
|
3
|
-
//#region src/utils/EventEmitter.d.ts
|
|
4
|
-
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(maxListener?: number);
|
|
7
|
-
emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArg: TEvents[TEventName]): void;
|
|
8
|
-
on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
9
|
-
off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
10
|
-
removeAll(): void;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/FileProcessor.d.ts
|
|
14
|
-
type FileProcessorEvents = {
|
|
15
|
-
start: [{
|
|
16
|
-
files: ResolvedFile[];
|
|
17
|
-
}];
|
|
18
|
-
finish: [{
|
|
19
|
-
files: ResolvedFile[];
|
|
20
|
-
}];
|
|
21
|
-
'file:start': [{
|
|
22
|
-
file: ResolvedFile;
|
|
23
|
-
}];
|
|
24
|
-
'file:finish': [{
|
|
25
|
-
file: ResolvedFile;
|
|
26
|
-
}];
|
|
27
|
-
};
|
|
28
|
-
type ProcessFilesProps = {
|
|
29
|
-
extension?: Record<Extname, Extname | ''>;
|
|
30
|
-
dryRun?: boolean;
|
|
31
|
-
};
|
|
32
|
-
declare class FileProcessor extends EventEmitter<FileProcessorEvents> {
|
|
33
|
-
#private;
|
|
34
|
-
constructor(maxListener?: number);
|
|
35
|
-
run(files: Array<ResolvedFile>, {
|
|
36
|
-
dryRun,
|
|
37
|
-
extension
|
|
38
|
-
}: ProcessFilesProps): Promise<ResolvedFile[]>;
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/FileManager.d.ts
|
|
42
|
-
declare class FileManager {
|
|
43
|
-
#private;
|
|
44
|
-
constructor();
|
|
45
|
-
add(...files: Array<File>): Promise<ResolvedFile<object>[]>;
|
|
46
|
-
flush(): void;
|
|
47
|
-
getByPath(path: Path): ResolvedFile | null;
|
|
48
|
-
deleteByPath(path: Path): void;
|
|
49
|
-
clear(): void;
|
|
50
|
-
get files(): Array<ResolvedFile>;
|
|
51
|
-
get processor(): {
|
|
52
|
-
run(options: ProcessFilesProps): Promise<ResolvedFile<object>[]>;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/defineApp.d.ts
|
|
57
|
-
type Component = any;
|
|
58
|
-
type PluginInstallFunction<Options$1 = any[]> = Options$1 extends unknown[] ? (app: App, ...options: Options$1) => any : (app: App, options: Options$1) => any;
|
|
59
|
-
type ObjectPlugin<Options$1 = any[]> = {
|
|
60
|
-
install: PluginInstallFunction<Options$1>;
|
|
61
|
-
};
|
|
62
|
-
type FunctionPlugin<Options$1 = any[]> = PluginInstallFunction<Options$1> & Partial<ObjectPlugin<Options$1>>;
|
|
63
|
-
type AppRenderer = {
|
|
64
|
-
render(): Promise<void> | void;
|
|
65
|
-
renderToString(): Promise<string> | string;
|
|
66
|
-
waitUntilExit(): Promise<void>;
|
|
67
|
-
};
|
|
68
|
-
type AppContext<TOptions = unknown> = {
|
|
69
|
-
options?: TOptions;
|
|
70
|
-
fileManager: FileManager;
|
|
71
|
-
addFile(...files: Array<File>): Promise<void>;
|
|
72
|
-
files: Array<ResolvedFile>;
|
|
73
|
-
clear: () => void;
|
|
74
|
-
};
|
|
75
|
-
type RootRenderFunction<THostElement, TContext extends AppContext> = (this: TContext, container: THostElement, context: TContext) => AppRenderer;
|
|
76
|
-
type Plugin<Options$1 = any[], P extends unknown[] = (Options$1 extends unknown[] ? Options$1 : [Options$1])> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
77
|
-
type WriteOptions = {
|
|
78
|
-
extension?: Record<Extname, Extname | ''>;
|
|
79
|
-
dryRun?: boolean;
|
|
80
|
-
};
|
|
81
|
-
interface App {
|
|
82
|
-
_component: Component;
|
|
83
|
-
render(): Promise<void>;
|
|
84
|
-
renderToString(): Promise<string>;
|
|
85
|
-
files: Array<ResolvedFile>;
|
|
86
|
-
use<Options>(plugin: Plugin<Options>, options: NoInfer<Options>): this;
|
|
87
|
-
write(options?: WriteOptions): Promise<void>;
|
|
88
|
-
addFile(...files: Array<File>): Promise<void>;
|
|
89
|
-
waitUntilExit(): Promise<void>;
|
|
90
|
-
}
|
|
91
|
-
type DefineApp<TContext extends AppContext> = (rootComponent?: Component, options?: TContext['options']) => App;
|
|
92
|
-
declare function defineApp<THostElement, TContext extends AppContext>(instance: RootRenderFunction<THostElement, TContext>): DefineApp<TContext>;
|
|
93
|
-
//#endregion
|
|
94
|
-
export { FileManager as a, defineApp as i, AppContext as n, FileProcessor as o, DefineApp as r, App as t };
|
|
95
|
-
//# sourceMappingURL=defineApp-CZYKsxTp.d.ts.map
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { a as ResolvedFile, i as Path, n as File, t as Extname } from "./KubbFile-BrN7Wwp6.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/utils/EventEmitter.d.ts
|
|
4
|
-
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(maxListener?: number);
|
|
7
|
-
emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArg: TEvents[TEventName]): void;
|
|
8
|
-
on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
9
|
-
off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
10
|
-
removeAll(): void;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/FileProcessor.d.ts
|
|
14
|
-
type FileProcessorEvents = {
|
|
15
|
-
start: [{
|
|
16
|
-
files: ResolvedFile[];
|
|
17
|
-
}];
|
|
18
|
-
finish: [{
|
|
19
|
-
files: ResolvedFile[];
|
|
20
|
-
}];
|
|
21
|
-
'file:start': [{
|
|
22
|
-
file: ResolvedFile;
|
|
23
|
-
}];
|
|
24
|
-
'file:finish': [{
|
|
25
|
-
file: ResolvedFile;
|
|
26
|
-
}];
|
|
27
|
-
};
|
|
28
|
-
type ProcessFilesProps = {
|
|
29
|
-
extension?: Record<Extname, Extname | ''>;
|
|
30
|
-
dryRun?: boolean;
|
|
31
|
-
};
|
|
32
|
-
declare class FileProcessor extends EventEmitter<FileProcessorEvents> {
|
|
33
|
-
#private;
|
|
34
|
-
constructor(maxListener?: number);
|
|
35
|
-
run(files: Array<ResolvedFile>, {
|
|
36
|
-
dryRun,
|
|
37
|
-
extension
|
|
38
|
-
}: ProcessFilesProps): Promise<ResolvedFile[]>;
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/FileManager.d.ts
|
|
42
|
-
declare class FileManager {
|
|
43
|
-
#private;
|
|
44
|
-
constructor();
|
|
45
|
-
add(...files: Array<File>): Promise<ResolvedFile<object>[]>;
|
|
46
|
-
flush(): void;
|
|
47
|
-
getByPath(path: Path): ResolvedFile | null;
|
|
48
|
-
deleteByPath(path: Path): void;
|
|
49
|
-
clear(): void;
|
|
50
|
-
get files(): Array<ResolvedFile>;
|
|
51
|
-
get processor(): {
|
|
52
|
-
run(options: ProcessFilesProps): Promise<ResolvedFile<object>[]>;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/defineApp.d.ts
|
|
57
|
-
type Component = any;
|
|
58
|
-
type PluginInstallFunction<Options$1 = any[]> = Options$1 extends unknown[] ? (app: App, ...options: Options$1) => any : (app: App, options: Options$1) => any;
|
|
59
|
-
type ObjectPlugin<Options$1 = any[]> = {
|
|
60
|
-
install: PluginInstallFunction<Options$1>;
|
|
61
|
-
};
|
|
62
|
-
type FunctionPlugin<Options$1 = any[]> = PluginInstallFunction<Options$1> & Partial<ObjectPlugin<Options$1>>;
|
|
63
|
-
type AppRenderer = {
|
|
64
|
-
render(): Promise<void> | void;
|
|
65
|
-
renderToString(): Promise<string> | string;
|
|
66
|
-
waitUntilExit(): Promise<void>;
|
|
67
|
-
};
|
|
68
|
-
type AppContext<TOptions = unknown> = {
|
|
69
|
-
options?: TOptions;
|
|
70
|
-
fileManager: FileManager;
|
|
71
|
-
addFile(...files: Array<File>): Promise<void>;
|
|
72
|
-
files: Array<ResolvedFile>;
|
|
73
|
-
clear: () => void;
|
|
74
|
-
};
|
|
75
|
-
type RootRenderFunction<THostElement, TContext extends AppContext> = (this: TContext, container: THostElement, context: TContext) => AppRenderer;
|
|
76
|
-
type Plugin<Options$1 = any[], P extends unknown[] = (Options$1 extends unknown[] ? Options$1 : [Options$1])> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
77
|
-
type WriteOptions = {
|
|
78
|
-
extension?: Record<Extname, Extname | ''>;
|
|
79
|
-
dryRun?: boolean;
|
|
80
|
-
};
|
|
81
|
-
interface App {
|
|
82
|
-
_component: Component;
|
|
83
|
-
render(): Promise<void>;
|
|
84
|
-
renderToString(): Promise<string>;
|
|
85
|
-
files: Array<ResolvedFile>;
|
|
86
|
-
use<Options>(plugin: Plugin<Options>, options: NoInfer<Options>): this;
|
|
87
|
-
write(options?: WriteOptions): Promise<void>;
|
|
88
|
-
addFile(...files: Array<File>): Promise<void>;
|
|
89
|
-
waitUntilExit(): Promise<void>;
|
|
90
|
-
}
|
|
91
|
-
type DefineApp<TContext extends AppContext> = (rootComponent?: Component, options?: TContext['options']) => App;
|
|
92
|
-
declare function defineApp<THostElement, TContext extends AppContext>(instance: RootRenderFunction<THostElement, TContext>): DefineApp<TContext>;
|
|
93
|
-
//#endregion
|
|
94
|
-
export { FileManager as a, defineApp as i, AppContext as n, FileProcessor as o, DefineApp as r, App as t };
|
|
95
|
-
//# sourceMappingURL=defineApp-c9lWJ96_.d.cts.map
|
package/dist/parsers/default.cjs
DELETED
package/dist/parsers/default.js
DELETED
package/dist/parsers/tsx.cjs
DELETED
package/dist/parsers/tsx.d.cts
DELETED
package/dist/parsers/tsx.d.ts
DELETED
package/dist/parsers/tsx.js
DELETED
package/dist/tsx-BSUaIML3.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const require_typescript = require('./typescript-Z90jN87k.cjs');
|
|
2
|
-
const require_createFileParser = require('./createFileParser-BD8yn0LT.cjs');
|
|
3
|
-
|
|
4
|
-
//#region src/parsers/tsx.ts
|
|
5
|
-
const tsxParser = require_createFileParser.createFileParser({ async print(file, options = { extname: ".tsx" }) {
|
|
6
|
-
return require_typescript.typeScriptParser.print(file, options);
|
|
7
|
-
} });
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
Object.defineProperty(exports, 'tsxParser', {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return tsxParser;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=tsx-BSUaIML3.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsx-BSUaIML3.cjs","names":["createFileParser","typeScriptParser"],"sources":["../src/parsers/tsx.ts"],"sourcesContent":["import { typeScriptParser } from './typescript.ts'\nimport { createFileParser } from './createFileParser.ts'\n\nexport const tsxParser = createFileParser({\n async print(file, options = { extname: '.tsx' }) {\n return typeScriptParser.print(file, options)\n },\n})\n"],"mappings":";;;;AAGA,MAAa,YAAYA,0CAAiB,EACxC,MAAM,MAAM,MAAM,UAAU,EAAE,SAAS,QAAQ,EAAE;AAC/C,QAAOC,oCAAiB,MAAM,MAAM,QAAQ;GAE/C,CAAC"}
|
package/dist/tsx-DBAk9dqS.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { i as typeScriptParser } from "./typescript-C60gWBu8.js";
|
|
2
|
-
import { t as createFileParser } from "./createFileParser-Cix3AMLd.js";
|
|
3
|
-
|
|
4
|
-
//#region src/parsers/tsx.ts
|
|
5
|
-
const tsxParser = createFileParser({ async print(file, options = { extname: ".tsx" }) {
|
|
6
|
-
return typeScriptParser.print(file, options);
|
|
7
|
-
} });
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { tsxParser as t };
|
|
11
|
-
//# sourceMappingURL=tsx-DBAk9dqS.js.map
|
package/dist/tsx-DBAk9dqS.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsx-DBAk9dqS.js","names":[],"sources":["../src/parsers/tsx.ts"],"sourcesContent":["import { typeScriptParser } from './typescript.ts'\nimport { createFileParser } from './createFileParser.ts'\n\nexport const tsxParser = createFileParser({\n async print(file, options = { extname: '.tsx' }) {\n return typeScriptParser.print(file, options)\n },\n})\n"],"mappings":";;;;AAGA,MAAa,YAAY,iBAAiB,EACxC,MAAM,MAAM,MAAM,UAAU,EAAE,SAAS,QAAQ,EAAE;AAC/C,QAAO,iBAAiB,MAAM,MAAM,QAAQ;GAE/C,CAAC"}
|
package/dist/types-CkbelZaS.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { a as ResolvedFile, t as Extname } from "./KubbFile-BzVkcu9M.js";
|
|
2
|
-
|
|
3
|
-
//#region src/parsers/types.d.ts
|
|
4
|
-
type PrintOptions = {
|
|
5
|
-
extname?: Extname;
|
|
6
|
-
};
|
|
7
|
-
type Parser<TMeta extends object = object> = {
|
|
8
|
-
/**
|
|
9
|
-
* Convert a file to string
|
|
10
|
-
*/
|
|
11
|
-
print: (file: ResolvedFile<TMeta>, options: PrintOptions) => Promise<string>;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Parser as t };
|
|
15
|
-
//# sourceMappingURL=types-CkbelZaS.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { a as ResolvedFile, t as Extname } from "./KubbFile-BrN7Wwp6.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/parsers/types.d.ts
|
|
4
|
-
type PrintOptions = {
|
|
5
|
-
extname?: Extname;
|
|
6
|
-
};
|
|
7
|
-
type Parser<TMeta extends object = object> = {
|
|
8
|
-
/**
|
|
9
|
-
* Convert a file to string
|
|
10
|
-
*/
|
|
11
|
-
print: (file: ResolvedFile<TMeta>, options: PrintOptions) => Promise<string>;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Parser as t };
|
|
15
|
-
//# sourceMappingURL=types-GueHciQ3.d.cts.map
|