@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.
Files changed (90) hide show
  1. package/dist/App-DZuROf6f.d.ts +292 -0
  2. package/dist/App-zyf9KG3p.d.cts +292 -0
  3. package/dist/chunk-CUT6urMc.cjs +30 -0
  4. package/dist/defineApp-D3B0bU-z.d.cts +14 -0
  5. package/dist/defineApp-DJVMk9lc.d.ts +14 -0
  6. package/dist/index.cjs +165 -88
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +4 -8
  9. package/dist/index.d.ts +4 -8
  10. package/dist/index.js +154 -77
  11. package/dist/index.js.map +1 -1
  12. package/dist/parsers/typescript.cjs +5 -6
  13. package/dist/parsers/typescript.d.cts +3 -51
  14. package/dist/parsers/typescript.d.ts +3 -51
  15. package/dist/parsers/typescript.js +2 -3
  16. package/dist/parsers.cjs +7 -0
  17. package/dist/parsers.d.cts +14 -0
  18. package/dist/parsers.d.ts +14 -0
  19. package/dist/parsers.js +4 -0
  20. package/dist/plugins.cjs +76 -0
  21. package/dist/plugins.cjs.map +1 -0
  22. package/dist/plugins.d.cts +28 -0
  23. package/dist/plugins.d.ts +28 -0
  24. package/dist/plugins.js +71 -0
  25. package/dist/plugins.js.map +1 -0
  26. package/dist/tsxParser-C741ZKCN.js +26 -0
  27. package/dist/tsxParser-C741ZKCN.js.map +1 -0
  28. package/dist/tsxParser-HDf_3TMc.cjs +37 -0
  29. package/dist/tsxParser-HDf_3TMc.cjs.map +1 -0
  30. package/dist/types.d.cts +2 -2
  31. package/dist/types.d.ts +2 -2
  32. package/dist/{typescript-C60gWBu8.js → typescriptParser-BBGeFKlP.js} +52 -69
  33. package/dist/typescriptParser-BBGeFKlP.js.map +1 -0
  34. package/dist/{typescript-Z90jN87k.cjs → typescriptParser-BBbbmG5W.cjs} +61 -108
  35. package/dist/typescriptParser-BBbbmG5W.cjs.map +1 -0
  36. package/dist/typescriptParser-C-sBy1iR.d.cts +50 -0
  37. package/dist/typescriptParser-CtMmz0UV.d.ts +50 -0
  38. package/package.json +13 -13
  39. package/src/App.ts +91 -0
  40. package/src/FileManager.ts +12 -12
  41. package/src/FileProcessor.ts +49 -46
  42. package/src/createFile.ts +1 -1
  43. package/src/defineApp.ts +47 -72
  44. package/src/index.ts +1 -1
  45. package/src/parsers/createParser.ts +8 -0
  46. package/src/parsers/defaultParser.ts +10 -0
  47. package/src/parsers/index.ts +5 -0
  48. package/src/parsers/tsxParser.ts +11 -0
  49. package/src/parsers/types.ts +12 -2
  50. package/src/parsers/{typescript.ts → typescriptParser.ts} +8 -4
  51. package/src/plugins/createPlugin.ts +10 -0
  52. package/src/plugins/fsPlugin.ts +112 -0
  53. package/src/plugins/index.ts +3 -0
  54. package/src/plugins/types.ts +15 -0
  55. package/src/types.ts +4 -1
  56. package/src/utils/AsyncEventEmitter.ts +37 -0
  57. package/src/utils/getRelativePath.ts +32 -0
  58. package/src/utils/trimExtName.ts +3 -0
  59. package/dist/KubbFile-BrN7Wwp6.d.cts +0 -119
  60. package/dist/KubbFile-BzVkcu9M.d.ts +0 -119
  61. package/dist/createFileParser-BD8yn0LT.cjs +0 -14
  62. package/dist/createFileParser-BD8yn0LT.cjs.map +0 -1
  63. package/dist/createFileParser-Cix3AMLd.js +0 -8
  64. package/dist/createFileParser-Cix3AMLd.js.map +0 -1
  65. package/dist/default-DCpuPmrL.js +0 -10
  66. package/dist/default-DCpuPmrL.js.map +0 -1
  67. package/dist/default-DNBu_jsL.cjs +0 -15
  68. package/dist/default-DNBu_jsL.cjs.map +0 -1
  69. package/dist/defineApp-CZYKsxTp.d.ts +0 -95
  70. package/dist/defineApp-c9lWJ96_.d.cts +0 -95
  71. package/dist/parsers/default.cjs +0 -4
  72. package/dist/parsers/default.d.cts +0 -8
  73. package/dist/parsers/default.d.ts +0 -8
  74. package/dist/parsers/default.js +0 -4
  75. package/dist/parsers/tsx.cjs +0 -5
  76. package/dist/parsers/tsx.d.cts +0 -8
  77. package/dist/parsers/tsx.d.ts +0 -8
  78. package/dist/parsers/tsx.js +0 -5
  79. package/dist/tsx-BSUaIML3.cjs +0 -16
  80. package/dist/tsx-BSUaIML3.cjs.map +0 -1
  81. package/dist/tsx-DBAk9dqS.js +0 -11
  82. package/dist/tsx-DBAk9dqS.js.map +0 -1
  83. package/dist/types-CkbelZaS.d.ts +0 -15
  84. package/dist/types-GueHciQ3.d.cts +0 -15
  85. package/dist/typescript-C60gWBu8.js.map +0 -1
  86. package/dist/typescript-Z90jN87k.cjs.map +0 -1
  87. package/src/fs.ts +0 -167
  88. package/src/parsers/createFileParser.ts +0 -5
  89. package/src/parsers/default.ts +0 -7
  90. 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,8 +0,0 @@
1
- //#region src/parsers/createFileParser.ts
2
- function createFileParser(parser) {
3
- return parser;
4
- }
5
-
6
- //#endregion
7
- export { createFileParser as t };
8
- //# sourceMappingURL=createFileParser-Cix3AMLd.js.map
@@ -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"}
@@ -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
@@ -1,4 +0,0 @@
1
- require('../createFileParser-BD8yn0LT.cjs');
2
- const require_default = require('../default-DNBu_jsL.cjs');
3
-
4
- exports.defaultParser = require_default.defaultParser;
@@ -1,8 +0,0 @@
1
- import "../KubbFile-BrN7Wwp6.cjs";
2
- import { t as Parser } from "../types-GueHciQ3.cjs";
3
-
4
- //#region src/parsers/default.d.ts
5
- declare const defaultParser: Parser<object>;
6
- //#endregion
7
- export { defaultParser };
8
- //# sourceMappingURL=default.d.cts.map
@@ -1,8 +0,0 @@
1
- import "../KubbFile-BzVkcu9M.js";
2
- import { t as Parser } from "../types-CkbelZaS.js";
3
-
4
- //#region src/parsers/default.d.ts
5
- declare const defaultParser: Parser<object>;
6
- //#endregion
7
- export { defaultParser };
8
- //# sourceMappingURL=default.d.ts.map
@@ -1,4 +0,0 @@
1
- import "../createFileParser-Cix3AMLd.js";
2
- import { t as defaultParser } from "../default-DCpuPmrL.js";
3
-
4
- export { defaultParser };
@@ -1,5 +0,0 @@
1
- require('../typescript-Z90jN87k.cjs');
2
- require('../createFileParser-BD8yn0LT.cjs');
3
- const require_tsx = require('../tsx-BSUaIML3.cjs');
4
-
5
- exports.tsxParser = require_tsx.tsxParser;
@@ -1,8 +0,0 @@
1
- import "../KubbFile-BrN7Wwp6.cjs";
2
- import { t as Parser } from "../types-GueHciQ3.cjs";
3
-
4
- //#region src/parsers/tsx.d.ts
5
- declare const tsxParser: Parser<object>;
6
- //#endregion
7
- export { tsxParser };
8
- //# sourceMappingURL=tsx.d.cts.map
@@ -1,8 +0,0 @@
1
- import "../KubbFile-BzVkcu9M.js";
2
- import { t as Parser } from "../types-CkbelZaS.js";
3
-
4
- //#region src/parsers/tsx.d.ts
5
- declare const tsxParser: Parser<object>;
6
- //#endregion
7
- export { tsxParser };
8
- //# sourceMappingURL=tsx.d.ts.map
@@ -1,5 +0,0 @@
1
- import "../typescript-C60gWBu8.js";
2
- import "../createFileParser-Cix3AMLd.js";
3
- import { t as tsxParser } from "../tsx-DBAk9dqS.js";
4
-
5
- export { tsxParser };
@@ -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"}
@@ -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
@@ -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"}
@@ -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