@kubb/fabric-core 0.5.3 → 0.5.5
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/README.md +21 -23
- package/dist/{Fabric-BzIhBn8t.d.cts → Fabric-CtqeUUFU.d.ts} +24 -25
- package/dist/{Fabric-igvWKffO.d.ts → Fabric-DlBN6CDR.d.cts} +24 -25
- package/dist/{defaultParser-n9VW2iVf.cjs → defaultParser-CIF-0xIK.cjs} +3 -3
- package/dist/{defaultParser-n9VW2iVf.cjs.map → defaultParser-CIF-0xIK.cjs.map} +1 -1
- package/dist/{defaultParser-Csot2aaT.js → defaultParser-DPHcM2NR.js} +3 -3
- package/dist/{defaultParser-Csot2aaT.js.map → defaultParser-DPHcM2NR.js.map} +1 -1
- package/dist/defineParser-Bxv4mb-N.js +11 -0
- package/dist/{createParser-D_ANHZTa.js.map → defineParser-Bxv4mb-N.js.map} +1 -1
- package/dist/defineParser-DODGK4rM.cjs +17 -0
- package/dist/{createParser-C4IkyTs5.cjs.map → defineParser-DODGK4rM.cjs.map} +1 -1
- package/dist/{defineProperty-Bhq3jwZe.cjs → defineProperty-BOlj8-IY.cjs} +10 -10
- package/dist/{defineProperty-Bhq3jwZe.cjs.map → defineProperty-BOlj8-IY.cjs.map} +1 -1
- package/dist/{defineProperty-BQu382bn.js → defineProperty-D2uejjT1.js} +10 -10
- package/dist/{defineProperty-BQu382bn.js.map → defineProperty-D2uejjT1.js.map} +1 -1
- package/dist/index.cjs +77 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -22
- package/dist/index.d.ts +7 -22
- package/dist/index.js +78 -87
- package/dist/index.js.map +1 -1
- package/dist/parsers/typescript.cjs +2 -2
- package/dist/parsers/typescript.d.cts +2 -2
- package/dist/parsers/typescript.d.ts +2 -2
- package/dist/parsers/typescript.js +2 -2
- package/dist/parsers.cjs +5 -5
- package/dist/parsers.cjs.map +1 -1
- package/dist/parsers.d.cts +6 -6
- package/dist/parsers.d.ts +6 -6
- package/dist/parsers.js +5 -5
- package/dist/parsers.js.map +1 -1
- package/dist/plugins.cjs +37 -37
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +4 -4
- package/dist/plugins.d.ts +4 -4
- package/dist/plugins.js +37 -37
- package/dist/plugins.js.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{typescriptParser-BN1vEX-I.d.ts → typescriptParser-BAlwCe3a.d.ts} +2 -2
- package/dist/{typescriptParser-Cw2wm0gX.js → typescriptParser-BLX7eX2k.js} +3 -3
- package/dist/{typescriptParser-Cw2wm0gX.js.map → typescriptParser-BLX7eX2k.js.map} +1 -1
- package/dist/{typescriptParser-BlRK18rx.d.cts → typescriptParser-CnzxSeDN.d.cts} +2 -2
- package/dist/{typescriptParser-DRdx9q2o.cjs → typescriptParser-OjFZ_DeI.cjs} +3 -3
- package/dist/{typescriptParser-DRdx9q2o.cjs.map → typescriptParser-OjFZ_DeI.cjs.map} +1 -1
- package/package.json +1 -1
- package/src/Fabric.ts +28 -24
- package/src/FileManager.ts +6 -6
- package/src/FileProcessor.ts +5 -5
- package/src/createFabric.ts +96 -2
- package/src/index.ts +0 -1
- package/src/parsers/defaultParser.ts +2 -2
- package/src/parsers/{createParser.ts → defineParser.ts} +1 -1
- package/src/parsers/index.ts +1 -2
- package/src/parsers/tsxParser.ts +2 -2
- package/src/parsers/typescriptParser.ts +2 -2
- package/src/plugins/barrelPlugin.ts +3 -3
- package/src/plugins/{createPlugin.ts → definePlugin.ts} +1 -1
- package/src/plugins/fsPlugin.ts +3 -3
- package/src/plugins/graphPlugin.ts +3 -3
- package/src/plugins/index.ts +1 -1
- package/src/plugins/loggerPlugin.ts +41 -31
- package/dist/createParser-C4IkyTs5.cjs +0 -17
- package/dist/createParser-D_ANHZTa.js +0 -11
- package/src/defineFabric.ts +0 -119
package/README.md
CHANGED
|
@@ -83,26 +83,24 @@ Returns a Fabric instance with:
|
|
|
83
83
|
- `fabric.files` — getter with all queued files.
|
|
84
84
|
- `fabric.context` — internal context holding events, options, FileManager, installed plugins/parsers.
|
|
85
85
|
|
|
86
|
-
### `defineFabric(instance?): () => Fabric`
|
|
87
|
-
Factory to create your own `createFabric` with an optional bootstrap `instance(fabric)` called on creation.
|
|
88
86
|
|
|
89
87
|
### Events (emitted by the core during processing)
|
|
90
|
-
- `start`
|
|
91
|
-
- `end`
|
|
92
|
-
- `render { fabric }`
|
|
93
|
-
- `
|
|
94
|
-
- `
|
|
95
|
-
- `
|
|
96
|
-
- `file:start { file, index, total }`
|
|
97
|
-
- `file:end { file, index, total }`
|
|
98
|
-
- `
|
|
99
|
-
- `
|
|
100
|
-
- `
|
|
88
|
+
- `lifecycle:start`
|
|
89
|
+
- `lifecycle:end`
|
|
90
|
+
- `lifecycle:render { fabric }`
|
|
91
|
+
- `files:added { files }`
|
|
92
|
+
- `files:writing:start { files }`
|
|
93
|
+
- `files:writing:end { files }`
|
|
94
|
+
- `file:processing:start { file, index, total }`
|
|
95
|
+
- `file:processing:end { file, index, total }`
|
|
96
|
+
- `files:processing:start { files }`
|
|
97
|
+
- `files:processing:update { file, source, processed, percentage, total }`
|
|
98
|
+
- `files:processing:end { files }`
|
|
101
99
|
|
|
102
100
|
|
|
103
101
|
## Plugins
|
|
104
102
|
#### `fsPlugin`
|
|
105
|
-
Writes files to disk on `
|
|
103
|
+
Writes files to disk on `files:processing:update`, supports dry runs and cleaning an output folder before writing.
|
|
106
104
|
|
|
107
105
|
```
|
|
108
106
|
import { fsPlugin } from '@kubb/fabric-core/plugins'
|
|
@@ -111,7 +109,7 @@ import { fsPlugin } from '@kubb/fabric-core/plugins'
|
|
|
111
109
|
| Option | Type | Default | Description |
|
|
112
110
|
|---|----------------------------------------------------------------------|---|-----------------------------------------------------------------------|
|
|
113
111
|
| dryRun | `boolean` | `false` | If true, do not write files to disk. |
|
|
114
|
-
| onBeforeWrite | `(path: string, data: string \| undefined) => void \| Promise<void>` | — | Called right before each file write on `
|
|
112
|
+
| onBeforeWrite | `(path: string, data: string \| undefined) => void \| Promise<void>` | — | Called right before each file write on `files:processing:update`. |
|
|
115
113
|
| clean | `{ path: string }` | — | If provided, removes the directory at `path` before writing any files. |
|
|
116
114
|
|
|
117
115
|
Injected `fabric.write` options (via `fsPlugin`):
|
|
@@ -121,7 +119,7 @@ Injected `fabric.write` options (via `fsPlugin`):
|
|
|
121
119
|
| extension | `Record<Extname, Extname \| ''>` | — | Maps input file extensions to output extensions. When set, the matching parser (by extNames) is used. |
|
|
122
120
|
|
|
123
121
|
#### `barrelPlugin`
|
|
124
|
-
Generates `index.ts` barrel files per folder
|
|
122
|
+
Generates `index.ts` barrel files per folder when `files:writing:start` is triggered. `writeEntry` creates a single entry barrel at `root`.
|
|
125
123
|
|
|
126
124
|
```
|
|
127
125
|
import { barrelPlugin } from '@kubb/fabric-core/plugins'
|
|
@@ -191,7 +189,7 @@ Injected methods (via `reactPlugin`):
|
|
|
191
189
|
| `renderToString` | `(App: React.ElementType) => Promise<string> \| string` | Render a React component tree and return the final output as a string (without writing to stdout). |
|
|
192
190
|
| `waitUntilExit` | `() => Promise<void>` | Wait until the rendered app exits, resolves when unmounted and emits the core `end` event. |
|
|
193
191
|
|
|
194
|
-
#### `
|
|
192
|
+
#### `definePlugin`
|
|
195
193
|
|
|
196
194
|
Factory to declare a plugin that can be registered via `fabric.use`.
|
|
197
195
|
|
|
@@ -205,12 +203,12 @@ Example:
|
|
|
205
203
|
|
|
206
204
|
```ts
|
|
207
205
|
import { createFabric } from '@kubb/fabric-core'
|
|
208
|
-
import {
|
|
206
|
+
import { definePlugin } from '@kubb/fabric-core/plugins'
|
|
209
207
|
|
|
210
|
-
const helloPlugin =
|
|
208
|
+
const helloPlugin = definePlugin<{ name?: string }, { sayHello: (msg?: string) => void }>({
|
|
211
209
|
name: 'helloPlugin',
|
|
212
210
|
install(fabric, options) {
|
|
213
|
-
fabric.context.events.on('start', () => {
|
|
211
|
+
fabric.context.events.on('lifecycle:start', () => {
|
|
214
212
|
console.log('Fabric started')
|
|
215
213
|
})
|
|
216
214
|
},
|
|
@@ -267,7 +265,7 @@ import { defaultParser } @kubb/fabric-core/parsers`
|
|
|
267
265
|
|---|---|---|--------------------------------------------------------------------------|
|
|
268
266
|
| file | `KubbFile.File` | -| File that will be used to be parsed. |
|
|
269
267
|
|
|
270
|
-
#### `
|
|
268
|
+
#### `defineParser`
|
|
271
269
|
Factory to declare a parser that can be registered via `fabric.use` and selected by `extNames` during `fabirc.write`.
|
|
272
270
|
|
|
273
271
|
| Field | Required | Description |
|
|
@@ -281,9 +279,9 @@ Example:
|
|
|
281
279
|
|
|
282
280
|
```ts
|
|
283
281
|
import { createFabric } from '@kubb/fabric-core'
|
|
284
|
-
import {
|
|
282
|
+
import { defineParser } from '@kubb/fabric-core/parsers'
|
|
285
283
|
|
|
286
|
-
const vueParser =
|
|
284
|
+
const vueParser = defineParser<{ banner?: string }>({
|
|
287
285
|
name: 'vueParser',
|
|
288
286
|
extNames: ['.vue'],
|
|
289
287
|
async install(fabric, options) {
|
|
@@ -254,52 +254,51 @@ type FabricMode = 'sequential' | 'parallel';
|
|
|
254
254
|
*/
|
|
255
255
|
interface FabricEvents {
|
|
256
256
|
/** Called at the beginning of the app lifecycle. */
|
|
257
|
-
start: [];
|
|
257
|
+
'lifecycle:start': [];
|
|
258
258
|
/** Called at the end of the app lifecycle. */
|
|
259
|
-
end: [];
|
|
260
|
-
/** Called when Fabric is rendering. */
|
|
261
|
-
render: [{
|
|
259
|
+
'lifecycle:end': [];
|
|
260
|
+
/** Called when Fabric is rendering. Provides the Fabric instance. */
|
|
261
|
+
'lifecycle:render': [{
|
|
262
262
|
fabric: Fabric;
|
|
263
263
|
}];
|
|
264
|
-
/** Called once before any files are processed. */
|
|
265
|
-
'
|
|
264
|
+
/** Called once before any files are processed. Provides all files that will be processed. */
|
|
265
|
+
'files:processing:start': [{
|
|
266
266
|
files: ResolvedFile[];
|
|
267
267
|
}];
|
|
268
|
-
/**
|
|
269
|
-
|
|
270
|
-
*/
|
|
271
|
-
'file:add': [{
|
|
268
|
+
/** Called when FileManager is adding files to its cache. */
|
|
269
|
+
'files:added': [{
|
|
272
270
|
files: ResolvedFile[];
|
|
273
271
|
}];
|
|
274
|
-
'file
|
|
272
|
+
/** Called when resolving a file's path. Allows modification of the file path. */
|
|
273
|
+
'file:path:resolving': [{
|
|
275
274
|
file: File;
|
|
276
275
|
}];
|
|
277
|
-
'file
|
|
276
|
+
/** Called when resolving a file's name. Allows modification of the file name. */
|
|
277
|
+
'file:name:resolving': [{
|
|
278
278
|
file: File;
|
|
279
279
|
}];
|
|
280
|
-
|
|
280
|
+
/** Called before writing files to disk. Provides all files that will be written. */
|
|
281
|
+
'files:writing:start': [{
|
|
281
282
|
files: ResolvedFile[];
|
|
282
283
|
}];
|
|
283
|
-
|
|
284
|
+
/** Called after writing files to disk. Provides all files that were written. */
|
|
285
|
+
'files:writing:end': [{
|
|
284
286
|
files: ResolvedFile[];
|
|
285
287
|
}];
|
|
286
|
-
/** Called
|
|
287
|
-
'file:start': [{
|
|
288
|
+
/** Called when processing of an individual file begins. Provides file, current index, and total count. */
|
|
289
|
+
'file:processing:start': [{
|
|
288
290
|
file: ResolvedFile;
|
|
289
291
|
index: number;
|
|
290
292
|
total: number;
|
|
291
293
|
}];
|
|
292
|
-
/** Called
|
|
293
|
-
'file:end': [{
|
|
294
|
+
/** Called when processing of an individual file completes. Provides file, current index, and total count. */
|
|
295
|
+
'file:processing:end': [{
|
|
294
296
|
file: ResolvedFile;
|
|
295
297
|
index: number;
|
|
296
298
|
total: number;
|
|
297
299
|
}];
|
|
298
|
-
/**
|
|
299
|
-
|
|
300
|
-
* Useful for progress bars or logging.
|
|
301
|
-
*/
|
|
302
|
-
'process:progress': [{
|
|
300
|
+
/** Called periodically to indicate processing progress. Useful for progress bars or logging. */
|
|
301
|
+
'files:processing:update': [{
|
|
303
302
|
processed: number;
|
|
304
303
|
total: number;
|
|
305
304
|
percentage: number;
|
|
@@ -307,7 +306,7 @@ interface FabricEvents {
|
|
|
307
306
|
file: ResolvedFile;
|
|
308
307
|
}];
|
|
309
308
|
/** Called once all files have been processed successfully. */
|
|
310
|
-
'
|
|
309
|
+
'files:processing:end': [{
|
|
311
310
|
files: ResolvedFile[];
|
|
312
311
|
}];
|
|
313
312
|
}
|
|
@@ -372,4 +371,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
|
|
|
372
371
|
}
|
|
373
372
|
//#endregion
|
|
374
373
|
export { FabricOptions as a, FileManager as c, UserParser as d, Extname as f, ResolvedFile as h, FabricMode as i, FileProcessor as l, KubbFile_d_exports as m, FabricConfig as n, Plugin as o, File as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u };
|
|
375
|
-
//# sourceMappingURL=Fabric-
|
|
374
|
+
//# sourceMappingURL=Fabric-CtqeUUFU.d.ts.map
|
|
@@ -254,52 +254,51 @@ type FabricMode = 'sequential' | 'parallel';
|
|
|
254
254
|
*/
|
|
255
255
|
interface FabricEvents {
|
|
256
256
|
/** Called at the beginning of the app lifecycle. */
|
|
257
|
-
start: [];
|
|
257
|
+
'lifecycle:start': [];
|
|
258
258
|
/** Called at the end of the app lifecycle. */
|
|
259
|
-
end: [];
|
|
260
|
-
/** Called when Fabric is rendering. */
|
|
261
|
-
render: [{
|
|
259
|
+
'lifecycle:end': [];
|
|
260
|
+
/** Called when Fabric is rendering. Provides the Fabric instance. */
|
|
261
|
+
'lifecycle:render': [{
|
|
262
262
|
fabric: Fabric;
|
|
263
263
|
}];
|
|
264
|
-
/** Called once before any files are processed. */
|
|
265
|
-
'
|
|
264
|
+
/** Called once before any files are processed. Provides all files that will be processed. */
|
|
265
|
+
'files:processing:start': [{
|
|
266
266
|
files: ResolvedFile[];
|
|
267
267
|
}];
|
|
268
|
-
/**
|
|
269
|
-
|
|
270
|
-
*/
|
|
271
|
-
'file:add': [{
|
|
268
|
+
/** Called when FileManager is adding files to its cache. */
|
|
269
|
+
'files:added': [{
|
|
272
270
|
files: ResolvedFile[];
|
|
273
271
|
}];
|
|
274
|
-
'file
|
|
272
|
+
/** Called when resolving a file's path. Allows modification of the file path. */
|
|
273
|
+
'file:path:resolving': [{
|
|
275
274
|
file: File;
|
|
276
275
|
}];
|
|
277
|
-
'file
|
|
276
|
+
/** Called when resolving a file's name. Allows modification of the file name. */
|
|
277
|
+
'file:name:resolving': [{
|
|
278
278
|
file: File;
|
|
279
279
|
}];
|
|
280
|
-
|
|
280
|
+
/** Called before writing files to disk. Provides all files that will be written. */
|
|
281
|
+
'files:writing:start': [{
|
|
281
282
|
files: ResolvedFile[];
|
|
282
283
|
}];
|
|
283
|
-
|
|
284
|
+
/** Called after writing files to disk. Provides all files that were written. */
|
|
285
|
+
'files:writing:end': [{
|
|
284
286
|
files: ResolvedFile[];
|
|
285
287
|
}];
|
|
286
|
-
/** Called
|
|
287
|
-
'file:start': [{
|
|
288
|
+
/** Called when processing of an individual file begins. Provides file, current index, and total count. */
|
|
289
|
+
'file:processing:start': [{
|
|
288
290
|
file: ResolvedFile;
|
|
289
291
|
index: number;
|
|
290
292
|
total: number;
|
|
291
293
|
}];
|
|
292
|
-
/** Called
|
|
293
|
-
'file:end': [{
|
|
294
|
+
/** Called when processing of an individual file completes. Provides file, current index, and total count. */
|
|
295
|
+
'file:processing:end': [{
|
|
294
296
|
file: ResolvedFile;
|
|
295
297
|
index: number;
|
|
296
298
|
total: number;
|
|
297
299
|
}];
|
|
298
|
-
/**
|
|
299
|
-
|
|
300
|
-
* Useful for progress bars or logging.
|
|
301
|
-
*/
|
|
302
|
-
'process:progress': [{
|
|
300
|
+
/** Called periodically to indicate processing progress. Useful for progress bars or logging. */
|
|
301
|
+
'files:processing:update': [{
|
|
303
302
|
processed: number;
|
|
304
303
|
total: number;
|
|
305
304
|
percentage: number;
|
|
@@ -307,7 +306,7 @@ interface FabricEvents {
|
|
|
307
306
|
file: ResolvedFile;
|
|
308
307
|
}];
|
|
309
308
|
/** Called once all files have been processed successfully. */
|
|
310
|
-
'
|
|
309
|
+
'files:processing:end': [{
|
|
311
310
|
files: ResolvedFile[];
|
|
312
311
|
}];
|
|
313
312
|
}
|
|
@@ -372,4 +371,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
|
|
|
372
371
|
}
|
|
373
372
|
//#endregion
|
|
374
373
|
export { FabricOptions as a, FileManager as c, UserParser as d, Extname as f, ResolvedFile as h, FabricMode as i, FileProcessor as l, KubbFile_d_exports as m, FabricConfig as n, Plugin as o, File as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u };
|
|
375
|
-
//# sourceMappingURL=Fabric-
|
|
374
|
+
//# sourceMappingURL=Fabric-DlBN6CDR.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_defineParser = require('./defineParser-DODGK4rM.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/parsers/defaultParser.ts
|
|
4
|
-
const defaultParser =
|
|
4
|
+
const defaultParser = require_defineParser.defineParser({
|
|
5
5
|
name: "default",
|
|
6
6
|
extNames: [".json"],
|
|
7
7
|
install() {},
|
|
@@ -17,4 +17,4 @@ Object.defineProperty(exports, 'defaultParser', {
|
|
|
17
17
|
return defaultParser;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
//# sourceMappingURL=defaultParser-
|
|
20
|
+
//# sourceMappingURL=defaultParser-CIF-0xIK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultParser-
|
|
1
|
+
{"version":3,"file":"defaultParser-CIF-0xIK.cjs","names":["defineParser"],"sources":["../src/parsers/defaultParser.ts"],"sourcesContent":["import { defineParser } from './defineParser.ts'\n\nexport const defaultParser = defineParser({\n name: 'default',\n extNames: ['.json'],\n install() {},\n async parse(file) {\n return file.sources.map((item) => item.value).join('\\n\\n')\n },\n})\n"],"mappings":";;;AAEA,MAAa,gBAAgBA,kCAAa;CACxC,MAAM;CACN,UAAU,CAAC,QAAQ;CACnB,UAAU;CACV,MAAM,MAAM,MAAM;AAChB,SAAO,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;;CAE7D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as defineParser } from "./defineParser-Bxv4mb-N.js";
|
|
2
2
|
|
|
3
3
|
//#region src/parsers/defaultParser.ts
|
|
4
|
-
const defaultParser =
|
|
4
|
+
const defaultParser = defineParser({
|
|
5
5
|
name: "default",
|
|
6
6
|
extNames: [".json"],
|
|
7
7
|
install() {},
|
|
@@ -12,4 +12,4 @@ const defaultParser = createParser({
|
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
export { defaultParser as t };
|
|
15
|
-
//# sourceMappingURL=defaultParser-
|
|
15
|
+
//# sourceMappingURL=defaultParser-DPHcM2NR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultParser-
|
|
1
|
+
{"version":3,"file":"defaultParser-DPHcM2NR.js","names":[],"sources":["../src/parsers/defaultParser.ts"],"sourcesContent":["import { defineParser } from './defineParser.ts'\n\nexport const defaultParser = defineParser({\n name: 'default',\n extNames: ['.json'],\n install() {},\n async parse(file) {\n return file.sources.map((item) => item.value).join('\\n\\n')\n },\n})\n"],"mappings":";;;AAEA,MAAa,gBAAgB,aAAa;CACxC,MAAM;CACN,UAAU,CAAC,QAAQ;CACnB,UAAU;CACV,MAAM,MAAM,MAAM;AAChB,SAAO,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;;CAE7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"defineParser-Bxv4mb-N.js","names":[],"sources":["../src/parsers/defineParser.ts"],"sourcesContent":["import type { Parser, UserParser } from './types.ts'\n\nexport function defineParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta> {\n return {\n type: 'parser',\n ...parser,\n }\n}\n"],"mappings":";AAEA,SAAgB,aAA6D,QAA8D;AACzI,QAAO;EACL,MAAM;EACN,GAAG;EACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/parsers/defineParser.ts
|
|
3
|
+
function defineParser(parser) {
|
|
4
|
+
return {
|
|
5
|
+
type: "parser",
|
|
6
|
+
...parser
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
Object.defineProperty(exports, 'defineParser', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return defineParser;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=defineParser-DODGK4rM.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"defineParser-DODGK4rM.cjs","names":[],"sources":["../src/parsers/defineParser.ts"],"sourcesContent":["import type { Parser, UserParser } from './types.ts'\n\nexport function defineParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta> {\n return {\n type: 'parser',\n ...parser,\n }\n}\n"],"mappings":";;AAEA,SAAgB,aAA6D,QAA8D;AACzI,QAAO;EACL,MAAM;EACN,GAAG;EACJ"}
|
|
@@ -248,38 +248,38 @@ function createFile(file) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
//#endregion
|
|
251
|
-
//#region \0@oxc-project+runtime@0.
|
|
251
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/checkPrivateRedeclaration.js
|
|
252
252
|
function _checkPrivateRedeclaration(e$1, t$3) {
|
|
253
253
|
if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
//#endregion
|
|
257
|
-
//#region \0@oxc-project+runtime@0.
|
|
257
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldInitSpec.js
|
|
258
258
|
function _classPrivateFieldInitSpec(e$1, t$3, a) {
|
|
259
259
|
_checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
//#endregion
|
|
263
|
-
//#region \0@oxc-project+runtime@0.
|
|
263
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/assertClassBrand.js
|
|
264
264
|
function _assertClassBrand(e$1, t$3, n$3) {
|
|
265
265
|
if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
|
|
266
266
|
throw new TypeError("Private element is not present on this object");
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
//#endregion
|
|
270
|
-
//#region \0@oxc-project+runtime@0.
|
|
270
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldGet2.js
|
|
271
271
|
function _classPrivateFieldGet2(s, a) {
|
|
272
272
|
return s.get(_assertClassBrand(s, a));
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
//#endregion
|
|
276
|
-
//#region \0@oxc-project+runtime@0.
|
|
276
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldSet2.js
|
|
277
277
|
function _classPrivateFieldSet2(s, a, r$3) {
|
|
278
278
|
return s.set(_assertClassBrand(s, a), r$3), r$3;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region \0@oxc-project+runtime@0.
|
|
282
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
283
283
|
function _typeof(o) {
|
|
284
284
|
"@babel/helpers - typeof";
|
|
285
285
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -290,7 +290,7 @@ function _typeof(o) {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
//#endregion
|
|
293
|
-
//#region \0@oxc-project+runtime@0.
|
|
293
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
|
|
294
294
|
function toPrimitive(t$3, r$3) {
|
|
295
295
|
if ("object" != _typeof(t$3) || !t$3) return t$3;
|
|
296
296
|
var e$1 = t$3[Symbol.toPrimitive];
|
|
@@ -303,14 +303,14 @@ function toPrimitive(t$3, r$3) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
//#endregion
|
|
306
|
-
//#region \0@oxc-project+runtime@0.
|
|
306
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
|
|
307
307
|
function toPropertyKey(t$3) {
|
|
308
308
|
var i$1 = toPrimitive(t$3, "string");
|
|
309
309
|
return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
//#endregion
|
|
313
|
-
//#region \0@oxc-project+runtime@0.
|
|
313
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
|
|
314
314
|
function _defineProperty(e$1, r$3, t$3) {
|
|
315
315
|
return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
|
|
316
316
|
value: t$3,
|
|
@@ -363,4 +363,4 @@ Object.defineProperty(exports, 'createFile', {
|
|
|
363
363
|
return createFile;
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
-
//# sourceMappingURL=defineProperty-
|
|
366
|
+
//# sourceMappingURL=defineProperty-BOlj8-IY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineProperty-Bhq3jwZe.cjs","names":["n","r","e","t","e","r","n","i","t","r","n","i","e","e","t","n","r","i","uniqueBy","exports","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>","path","trimExtName"],"sources":["../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js","../src/createFile.ts"],"sourcesContent":["const e={done:!0,hasNext:!1},t={done:!1,hasNext:!1},n=()=>e,r=e=>({hasNext:!0,next:e,done:!1});export{t as SKIP_ITEM,n as lazyEmptyEvaluator,r as lazyIdentityEvaluator};\n//# sourceMappingURL=utilityEvaluators-DORpnx39.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";function t(e,...t){let a=e,o=t.map(e=>`lazy`in e?r(e):void 0),s=0;for(;s<t.length;){if(o[s]===void 0||!i(a)){let e=t[s];a=e(a),s+=1;continue}let e=[];for(let n=s;n<t.length;n++){let t=o[n];if(t===void 0||(e.push(t),t.isSingle))break}let r=[];for(let t of a)if(n(t,r,e))break;let{isSingle:c}=e.at(-1);a=c?r[0]:r,s+=e.length}return a}function n(t,r,i){if(i.length===0)return r.push(t),!1;let a=t,o=e,s=!1;for(let[e,t]of i.entries()){let{index:c,items:l}=t;if(l.push(a),o=t(a,c,l),t.index+=1,o.hasNext){if(o.hasMany??!1){for(let t of o.next)if(n(t,r,i.slice(e+1)))return!0;return s}a=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&r.push(a),s}function r(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function i(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}export{t as pipe};\n//# sourceMappingURL=pipe-jLehR9-P.js.map","import{pipe as e}from\"./pipe-jLehR9-P.js\";function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e(t,r),r)}throw Error(`Wrong number of arguments`)}export{t as purryFromLazy};\n//# sourceMappingURL=purryFromLazy-3oywCNIb.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";import{purryFromLazy as t}from\"./purryFromLazy-3oywCNIb.js\";function n(...e){return t(r,e)}function r(t){let n=t,r=new Set;return(t,i,a)=>{let o=n(t,i,a);return r.has(o)?e:(r.add(o),{done:!1,hasNext:!0,next:t})}}export{n as uniqueBy};\n//# sourceMappingURL=uniqueBy-C_PxkF_D.js.map","import { createHash } from 'node:crypto'\nimport path from 'node:path'\nimport { orderBy } from 'natural-orderby'\nimport { uniqueBy } from 'remeda'\nimport type * as KubbFile from './KubbFile.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nexport function combineSources(sources: Array<KubbFile.Source>): Array<KubbFile.Source> {\n return uniqueBy(sources, (obj) => {\n // For named sources, deduplicate by name, isExportable, and isTypeOnly\n // For unnamed sources, include the value to avoid deduplicating different code blocks\n // If both name and value are undefined, use an empty string as the unique identifier\n const uniqueId = obj.name ?? obj.value ?? ''\n const isExportable = obj.isExportable ?? false\n const isTypeOnly = obj.isTypeOnly ?? false\n return `${uniqueId}:${isExportable}:${isTypeOnly}`\n })\n}\n\nexport function combineExports(exports: Array<KubbFile.Export>): Array<KubbFile.Export> {\n const sorted = orderBy(exports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Export> = []\n // Map to track items by path for O(1) lookup\n const pathMap = new Map<string, KubbFile.Export>()\n // Map to track unique items by path+name+isTypeOnly+asAlias\n const uniqueMap = new Map<string, KubbFile.Export>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Export>()\n\n for (const curr of sorted) {\n const name = curr.name\n const pathKey = curr.path\n const prevByPath = pathMap.get(pathKey)\n\n // Create unique key for path+name+isTypeOnly\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${pathKey}:${nameKey}:${curr.isTypeOnly}`\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${pathKey}:${nameKey}`\n const prevByPathAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathAndIsTypeOnly) {\n // we already have an export that has the same path and name but uses `isTypeOnly` (export type ...)\n continue\n }\n\n // Create unique key for path+name+isTypeOnly+asAlias\n const uniqueKey = `${pathNameTypeKey}:${curr.asAlias || ''}`\n const uniquePrev = uniqueMap.get(uniqueKey)\n\n // we already have an item that was unique enough or name field is empty or prev asAlias is set but current has no changes\n if (uniquePrev || (Array.isArray(name) && !name.length) || (prevByPath?.asAlias && !curr.asAlias)) {\n continue\n }\n\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name: Array.isArray(name) ? [...new Set(name)] : name,\n }\n prev.push(newItem)\n pathMap.set(pathKey, newItem)\n uniqueMap.set(uniqueKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])]\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(uniqueKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\nexport function combineImports(imports: Array<KubbFile.Import>, exports: Array<KubbFile.Export>, source?: string): Array<KubbFile.Import> {\n const exportedNameLookup = new Set<string>()\n for (const item of exports) {\n const { name } = item\n if (!name) {\n continue\n }\n\n if (Array.isArray(name)) {\n for (const value of name) {\n if (value) {\n exportedNameLookup.add(value)\n }\n }\n continue\n }\n\n exportedNameLookup.add(name)\n }\n\n const usageCache = new Map<string, boolean>()\n const hasImportInSource = (importName: string): boolean => {\n if (!source) {\n return true\n }\n\n const cached = usageCache.get(importName)\n if (cached !== undefined) {\n return cached\n }\n\n const isUsed = source.includes(importName) || exportedNameLookup.has(importName)\n usageCache.set(importName, isUsed)\n\n return isUsed\n }\n\n const sorted = orderBy(imports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Import> = []\n // Map to track items by path+isTypeOnly for O(1) lookup\n const pathTypeMap = new Map<string, KubbFile.Import>()\n // Map to track unique items by path+name+isTypeOnly\n const uniqueMap = new Map<string, KubbFile.Import>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Import>()\n\n for (const curr of sorted) {\n let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name\n\n if (curr.path === curr.root) {\n // root and path are the same file, remove the \"./\" import\n continue\n }\n\n // merge all names and check if the importName is being used in the generated source and if not filter those imports out\n if (Array.isArray(name)) {\n name = name.filter((item) => (typeof item === 'string' ? hasImportInSource(item) : hasImportInSource(item.propertyName)))\n }\n\n const pathTypeKey = `${curr.path}:${curr.isTypeOnly}`\n const prevByPath = pathTypeMap.get(pathTypeKey)\n\n // Create key for name comparison\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${curr.path}:${nameKey}:${curr.isTypeOnly}`\n const uniquePrev = uniqueMap.get(pathNameTypeKey)\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${curr.path}:${nameKey}`\n const prevByPathNameAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathNameAndIsTypeOnly) {\n // we already have an import that has the same path and name but uses `isTypeOnly` (import type ...)\n continue\n }\n\n // already unique enough or name is empty\n if (uniquePrev || (Array.isArray(name) && !name.length)) {\n continue\n }\n\n // new item, append name\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name,\n }\n prev.push(newItem)\n pathTypeMap.set(pathTypeKey, newItem)\n uniqueMap.set(pathNameTypeKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...name])]\n continue\n }\n\n // no import was found in the source, ignore import\n if (!Array.isArray(name) && name && !hasImportInSource(name)) {\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(pathNameTypeKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\n/**\n * Helper to create a file with name and id set\n */\nexport function createFile<TMeta extends object = object>(file: KubbFile.File<TMeta>): KubbFile.ResolvedFile<TMeta> {\n const extname = path.extname(file.baseName) as KubbFile.Extname\n if (!extname) {\n throw new Error(`No extname found for ${file.baseName}`)\n }\n\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n const exports = file.exports?.length ? combineExports(file.exports) : []\n const imports = file.imports?.length && source ? combineImports(file.imports, exports, source) : []\n const sources = file.sources?.length ? combineSources(file.sources) : []\n\n return {\n ...file,\n id: createHash('sha256').update(file.path).digest('hex'),\n name: trimExtName(file.baseName),\n extname,\n imports: imports,\n exports: exports,\n sources: sources,\n meta: file.meta || ({} as TMeta),\n }\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;AAAA,MAAM,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAAC,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACA,YAAM,GAAEC,OAAE,SAA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AAI,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,kBAAkB,KAAK,CAC1D;AAGF,OAAK,KAAK,KAAK;AACf,YAAU,IAAI,iBAAiB,KAAK;AAEpC,MAAI,KAAK,WACP,qBAAoB,IAAI,aAAa,KAAK;;AAI9C,QAAO;;;;;AAMT,SAAgB,WAA0C,MAA0D;;CAClH,MAAM,UAAUC,kBAAK,QAAQ,KAAK,SAAS;AAC3C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB,KAAK,WAAW;CAG1D,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;CAClE,MAAMH,8BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;CACxE,MAAM,4BAAU,KAAK,uEAAS,WAAU,SAAS,eAAe,KAAK,SAASA,WAAS,OAAO,GAAG,EAAE;CACnG,MAAM,4BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;AAExE,QAAO;EACL,GAAG;EACH,gCAAe,SAAS,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,MAAM;EACxD,MAAMI,gCAAY,KAAK,SAAS;EAChC;EACS;EACT,SAASJ;EACA;EACT,MAAM,KAAK,QAAS,EAAE;EACvB"}
|
|
1
|
+
{"version":3,"file":"defineProperty-BOlj8-IY.cjs","names":["n","r","e","t","e","r","n","i","t","r","n","i","e","e","t","n","r","i","uniqueBy","exports","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>","path","trimExtName"],"sources":["../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js","../src/createFile.ts"],"sourcesContent":["const e={done:!0,hasNext:!1},t={done:!1,hasNext:!1},n=()=>e,r=e=>({hasNext:!0,next:e,done:!1});export{t as SKIP_ITEM,n as lazyEmptyEvaluator,r as lazyIdentityEvaluator};\n//# sourceMappingURL=utilityEvaluators-DORpnx39.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";function t(e,...t){let a=e,o=t.map(e=>`lazy`in e?r(e):void 0),s=0;for(;s<t.length;){if(o[s]===void 0||!i(a)){let e=t[s];a=e(a),s+=1;continue}let e=[];for(let n=s;n<t.length;n++){let t=o[n];if(t===void 0||(e.push(t),t.isSingle))break}let r=[];for(let t of a)if(n(t,r,e))break;let{isSingle:c}=e.at(-1);a=c?r[0]:r,s+=e.length}return a}function n(t,r,i){if(i.length===0)return r.push(t),!1;let a=t,o=e,s=!1;for(let[e,t]of i.entries()){let{index:c,items:l}=t;if(l.push(a),o=t(a,c,l),t.index+=1,o.hasNext){if(o.hasMany??!1){for(let t of o.next)if(n(t,r,i.slice(e+1)))return!0;return s}a=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&r.push(a),s}function r(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function i(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}export{t as pipe};\n//# sourceMappingURL=pipe-jLehR9-P.js.map","import{pipe as e}from\"./pipe-jLehR9-P.js\";function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e(t,r),r)}throw Error(`Wrong number of arguments`)}export{t as purryFromLazy};\n//# sourceMappingURL=purryFromLazy-3oywCNIb.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";import{purryFromLazy as t}from\"./purryFromLazy-3oywCNIb.js\";function n(...e){return t(r,e)}function r(t){let n=t,r=new Set;return(t,i,a)=>{let o=n(t,i,a);return r.has(o)?e:(r.add(o),{done:!1,hasNext:!0,next:t})}}export{n as uniqueBy};\n//# sourceMappingURL=uniqueBy-C_PxkF_D.js.map","import { createHash } from 'node:crypto'\nimport path from 'node:path'\nimport { orderBy } from 'natural-orderby'\nimport { uniqueBy } from 'remeda'\nimport type * as KubbFile from './KubbFile.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nexport function combineSources(sources: Array<KubbFile.Source>): Array<KubbFile.Source> {\n return uniqueBy(sources, (obj) => {\n // For named sources, deduplicate by name, isExportable, and isTypeOnly\n // For unnamed sources, include the value to avoid deduplicating different code blocks\n // If both name and value are undefined, use an empty string as the unique identifier\n const uniqueId = obj.name ?? obj.value ?? ''\n const isExportable = obj.isExportable ?? false\n const isTypeOnly = obj.isTypeOnly ?? false\n return `${uniqueId}:${isExportable}:${isTypeOnly}`\n })\n}\n\nexport function combineExports(exports: Array<KubbFile.Export>): Array<KubbFile.Export> {\n const sorted = orderBy(exports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Export> = []\n // Map to track items by path for O(1) lookup\n const pathMap = new Map<string, KubbFile.Export>()\n // Map to track unique items by path+name+isTypeOnly+asAlias\n const uniqueMap = new Map<string, KubbFile.Export>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Export>()\n\n for (const curr of sorted) {\n const name = curr.name\n const pathKey = curr.path\n const prevByPath = pathMap.get(pathKey)\n\n // Create unique key for path+name+isTypeOnly\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${pathKey}:${nameKey}:${curr.isTypeOnly}`\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${pathKey}:${nameKey}`\n const prevByPathAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathAndIsTypeOnly) {\n // we already have an export that has the same path and name but uses `isTypeOnly` (export type ...)\n continue\n }\n\n // Create unique key for path+name+isTypeOnly+asAlias\n const uniqueKey = `${pathNameTypeKey}:${curr.asAlias || ''}`\n const uniquePrev = uniqueMap.get(uniqueKey)\n\n // we already have an item that was unique enough or name field is empty or prev asAlias is set but current has no changes\n if (uniquePrev || (Array.isArray(name) && !name.length) || (prevByPath?.asAlias && !curr.asAlias)) {\n continue\n }\n\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name: Array.isArray(name) ? [...new Set(name)] : name,\n }\n prev.push(newItem)\n pathMap.set(pathKey, newItem)\n uniqueMap.set(uniqueKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])]\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(uniqueKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\nexport function combineImports(imports: Array<KubbFile.Import>, exports: Array<KubbFile.Export>, source?: string): Array<KubbFile.Import> {\n const exportedNameLookup = new Set<string>()\n for (const item of exports) {\n const { name } = item\n if (!name) {\n continue\n }\n\n if (Array.isArray(name)) {\n for (const value of name) {\n if (value) {\n exportedNameLookup.add(value)\n }\n }\n continue\n }\n\n exportedNameLookup.add(name)\n }\n\n const usageCache = new Map<string, boolean>()\n const hasImportInSource = (importName: string): boolean => {\n if (!source) {\n return true\n }\n\n const cached = usageCache.get(importName)\n if (cached !== undefined) {\n return cached\n }\n\n const isUsed = source.includes(importName) || exportedNameLookup.has(importName)\n usageCache.set(importName, isUsed)\n\n return isUsed\n }\n\n const sorted = orderBy(imports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : v.name),\n ])\n\n const prev: Array<KubbFile.Import> = []\n // Map to track items by path+isTypeOnly for O(1) lookup\n const pathTypeMap = new Map<string, KubbFile.Import>()\n // Map to track unique items by path+name+isTypeOnly\n const uniqueMap = new Map<string, KubbFile.Import>()\n // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = new Map<string, KubbFile.Import>()\n\n for (const curr of sorted) {\n let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name\n\n if (curr.path === curr.root) {\n // root and path are the same file, remove the \"./\" import\n continue\n }\n\n // merge all names and check if the importName is being used in the generated source and if not filter those imports out\n if (Array.isArray(name)) {\n name = name.filter((item) => (typeof item === 'string' ? hasImportInSource(item) : hasImportInSource(item.propertyName)))\n }\n\n const pathTypeKey = `${curr.path}:${curr.isTypeOnly}`\n const prevByPath = pathTypeMap.get(pathTypeKey)\n\n // Create key for name comparison\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${curr.path}:${nameKey}:${curr.isTypeOnly}`\n const uniquePrev = uniqueMap.get(pathNameTypeKey)\n // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${curr.path}:${nameKey}`\n const prevByPathNameAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathNameAndIsTypeOnly) {\n // we already have an import that has the same path and name but uses `isTypeOnly` (import type ...)\n continue\n }\n\n // already unique enough or name is empty\n if (uniquePrev || (Array.isArray(name) && !name.length)) {\n continue\n }\n\n // new item, append name\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name,\n }\n prev.push(newItem)\n pathTypeMap.set(pathTypeKey, newItem)\n uniqueMap.set(pathNameTypeKey, newItem)\n // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...name])]\n continue\n }\n\n // no import was found in the source, ignore import\n if (!Array.isArray(name) && name && !hasImportInSource(name)) {\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(pathNameTypeKey, curr)\n // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\n }\n\n return prev\n}\n\n/**\n * Helper to create a file with name and id set\n */\nexport function createFile<TMeta extends object = object>(file: KubbFile.File<TMeta>): KubbFile.ResolvedFile<TMeta> {\n const extname = path.extname(file.baseName) as KubbFile.Extname\n if (!extname) {\n throw new Error(`No extname found for ${file.baseName}`)\n }\n\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n const exports = file.exports?.length ? combineExports(file.exports) : []\n const imports = file.imports?.length && source ? combineImports(file.imports, exports, source) : []\n const sources = file.sources?.length ? combineSources(file.sources) : []\n\n return {\n ...file,\n id: createHash('sha256').update(file.path).digest('hex'),\n name: trimExtName(file.baseName),\n extname,\n imports: imports,\n exports: exports,\n sources: sources,\n meta: file.meta || ({} as TMeta),\n }\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;AAAA,MAAM,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAAC,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACA,YAAM,GAAEC,OAAE,SAAI;CAAC,SAAQ,CAAC;CAAE,MAAKC;CAAE,MAAK,CAAC;CAAE;;;;ACAjC,SAASC,IAAE,KAAE,GAAGA,KAAE;CAAC,IAAI,IAAEC,KAAE,IAAED,IAAE,KAAI,QAAG,UAASC,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B,IAAI,aAAa,KAAK;;AAI9C,QAAO;;;;;AAMT,SAAgB,WAA0C,MAA0D;;CAClH,MAAM,UAAUC,kBAAK,QAAQ,KAAK,SAAS;AAC3C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB,KAAK,WAAW;CAG1D,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;CAClE,MAAMH,8BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;CACxE,MAAM,4BAAU,KAAK,uEAAS,WAAU,SAAS,eAAe,KAAK,SAASA,WAAS,OAAO,GAAG,EAAE;CACnG,MAAM,4BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;AAExE,QAAO;EACL,GAAG;EACH,gCAAe,SAAS,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,MAAM;EACxD,MAAMI,gCAAY,KAAK,SAAS;EAChC;EACS;EACT,SAASJ;EACA;EACT,MAAM,KAAK,QAAS,EAAE;EACvB"}
|
|
@@ -247,38 +247,38 @@ function createFile(file) {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
//#endregion
|
|
250
|
-
//#region \0@oxc-project+runtime@0.
|
|
250
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/checkPrivateRedeclaration.js
|
|
251
251
|
function _checkPrivateRedeclaration(e$1, t$3) {
|
|
252
252
|
if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
//#endregion
|
|
256
|
-
//#region \0@oxc-project+runtime@0.
|
|
256
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldInitSpec.js
|
|
257
257
|
function _classPrivateFieldInitSpec(e$1, t$3, a) {
|
|
258
258
|
_checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
//#endregion
|
|
262
|
-
//#region \0@oxc-project+runtime@0.
|
|
262
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/assertClassBrand.js
|
|
263
263
|
function _assertClassBrand(e$1, t$3, n$3) {
|
|
264
264
|
if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
|
|
265
265
|
throw new TypeError("Private element is not present on this object");
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
//#endregion
|
|
269
|
-
//#region \0@oxc-project+runtime@0.
|
|
269
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldGet2.js
|
|
270
270
|
function _classPrivateFieldGet2(s, a) {
|
|
271
271
|
return s.get(_assertClassBrand(s, a));
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
//#endregion
|
|
275
|
-
//#region \0@oxc-project+runtime@0.
|
|
275
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/classPrivateFieldSet2.js
|
|
276
276
|
function _classPrivateFieldSet2(s, a, r$3) {
|
|
277
277
|
return s.set(_assertClassBrand(s, a), r$3), r$3;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
//#endregion
|
|
281
|
-
//#region \0@oxc-project+runtime@0.
|
|
281
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
282
282
|
function _typeof(o) {
|
|
283
283
|
"@babel/helpers - typeof";
|
|
284
284
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -289,7 +289,7 @@ function _typeof(o) {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
//#endregion
|
|
292
|
-
//#region \0@oxc-project+runtime@0.
|
|
292
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
|
|
293
293
|
function toPrimitive(t$3, r$3) {
|
|
294
294
|
if ("object" != _typeof(t$3) || !t$3) return t$3;
|
|
295
295
|
var e$1 = t$3[Symbol.toPrimitive];
|
|
@@ -302,14 +302,14 @@ function toPrimitive(t$3, r$3) {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
//#endregion
|
|
305
|
-
//#region \0@oxc-project+runtime@0.
|
|
305
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
|
|
306
306
|
function toPropertyKey(t$3) {
|
|
307
307
|
var i$1 = toPrimitive(t$3, "string");
|
|
308
308
|
return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
//#endregion
|
|
312
|
-
//#region \0@oxc-project+runtime@0.
|
|
312
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
|
|
313
313
|
function _defineProperty(e$1, r$3, t$3) {
|
|
314
314
|
return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
|
|
315
315
|
value: t$3,
|
|
@@ -321,4 +321,4 @@ function _defineProperty(e$1, r$3, t$3) {
|
|
|
321
321
|
|
|
322
322
|
//#endregion
|
|
323
323
|
export { _classPrivateFieldInitSpec as a, _assertClassBrand as i, _classPrivateFieldSet2 as n, _checkPrivateRedeclaration as o, _classPrivateFieldGet2 as r, createFile as s, _defineProperty as t };
|
|
324
|
-
//# sourceMappingURL=defineProperty-
|
|
324
|
+
//# sourceMappingURL=defineProperty-D2uejjT1.js.map
|