@fuzdev/fuz_util 0.50.1 → 0.51.0
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/path.d.ts +8 -2
- package/dist/path.d.ts.map +1 -1
- package/dist/path.js +8 -2
- package/dist/process.d.ts +4 -1
- package/dist/process.d.ts.map +1 -1
- package/dist/process.js +4 -1
- package/dist/source_json.d.ts +106 -6
- package/dist/source_json.d.ts.map +1 -1
- package/dist/source_json.js +27 -2
- package/package.json +10 -6
- package/src/lib/path.ts +8 -2
- package/src/lib/process.ts +4 -1
- package/src/lib/source_json.ts +27 -2
package/dist/path.d.ts
CHANGED
|
@@ -29,12 +29,18 @@ export type FileFilter = (path: string) => boolean;
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const to_file_path: (path_or_url: string | URL) => string;
|
|
31
31
|
/**
|
|
32
|
-
* @example
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* parse_path_parts('./foo/bar/baz.ts') // => ['foo', 'foo/bar', 'foo/bar/baz.ts']
|
|
35
|
+
* ```
|
|
33
36
|
*/
|
|
34
37
|
export declare const parse_path_parts: (path: string) => Array<string>;
|
|
35
38
|
/**
|
|
36
39
|
* Gets the individual parts of a path, ignoring dots and separators.
|
|
37
|
-
* @example
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* parse_path_segments('/foo/bar/baz.ts') // => ['foo', 'bar', 'baz.ts']
|
|
43
|
+
* ```
|
|
38
44
|
*/
|
|
39
45
|
export declare const parse_path_segments: (path: string) => Array<string>;
|
|
40
46
|
/**
|
package/dist/path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,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H,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,KAAK,CAAC,MAAM,CAU3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,KAAK,CAAC,MAAM,CACH,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,SAAS,GAClB;IACA,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACZ,GACD;IACA,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACZ,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,KAAK,CAAC,SAAS,CAgBnE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAC/B,UAAU,MAAM,GAAG,SAAS,EAC5B,SAAS,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KAC7B,OAKF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,EAAE,gCAA6B,KAAG,MAYpE,CAAC"}
|
package/dist/path.js
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const to_file_path = (path_or_url) => typeof path_or_url === 'string' ? path_or_url : decodeURIComponent(path_or_url.pathname);
|
|
5
5
|
/**
|
|
6
|
-
* @example
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* parse_path_parts('./foo/bar/baz.ts') // => ['foo', 'foo/bar', 'foo/bar/baz.ts']
|
|
9
|
+
* ```
|
|
7
10
|
*/
|
|
8
11
|
export const parse_path_parts = (path) => {
|
|
9
12
|
const segments = parse_path_segments(path);
|
|
@@ -18,7 +21,10 @@ export const parse_path_parts = (path) => {
|
|
|
18
21
|
};
|
|
19
22
|
/**
|
|
20
23
|
* Gets the individual parts of a path, ignoring dots and separators.
|
|
21
|
-
* @example
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* parse_path_segments('/foo/bar/baz.ts') // => ['foo', 'bar', 'baz.ts']
|
|
27
|
+
* ```
|
|
22
28
|
*/
|
|
23
29
|
export const parse_path_segments = (path) => path.split('/').filter((s) => s && s !== '.' && s !== '..');
|
|
24
30
|
/**
|
package/dist/process.d.ts
CHANGED
|
@@ -289,7 +289,10 @@ export declare const spawn_detached: (command: string, args?: ReadonlyArray<stri
|
|
|
289
289
|
/**
|
|
290
290
|
* Formats a child process for display.
|
|
291
291
|
*
|
|
292
|
-
* @example
|
|
292
|
+
* @example
|
|
293
|
+
* ```ts
|
|
294
|
+
* `pid(1234) <- node server.js`
|
|
295
|
+
* ```
|
|
293
296
|
*/
|
|
294
297
|
export declare const print_child_process: (child: ChildProcess) => string;
|
|
295
298
|
/**
|
package/dist/process.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/process.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,IAAI,wBAAwB,EACjC,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,oBAAoB,CAAC;AAa5B;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,YAAY,C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a,CAAC,MAAM,CAAM,EAChC,UAAU,mBAAmB,KAC3B,kBAqFF,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,MAAM,KAAG,OAcpD,CAAC"}
|
package/dist/process.js
CHANGED
|
@@ -401,7 +401,10 @@ export const spawn_detached = (command, args = [], options) => {
|
|
|
401
401
|
/**
|
|
402
402
|
* Formats a child process for display.
|
|
403
403
|
*
|
|
404
|
-
* @example
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* `pid(1234) <- node server.js`
|
|
407
|
+
* ```
|
|
405
408
|
*/
|
|
406
409
|
export const print_child_process = (child) => `${st('gray', 'pid(')}${child.pid ?? 'none'}${st('gray', ')')} ← ${st('green', child.spawnargs.join(' '))}`;
|
|
407
410
|
/**
|
package/dist/source_json.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ import { z } from 'zod';
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const DeclarationKind: z.ZodEnum<{
|
|
17
17
|
function: "function";
|
|
18
|
-
type: "type";
|
|
19
18
|
json: "json";
|
|
19
|
+
type: "type";
|
|
20
20
|
variable: "variable";
|
|
21
21
|
class: "class";
|
|
22
22
|
constructor: "constructor";
|
|
@@ -67,6 +67,19 @@ export declare const ComponentPropInfo: z.ZodObject<{
|
|
|
67
67
|
description: z.ZodOptional<z.ZodString>;
|
|
68
68
|
default_value: z.ZodOptional<z.ZodString>;
|
|
69
69
|
bindable: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
/** Code examples from `@example` tags. */
|
|
71
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
/** Deprecation message from `@deprecated` tag. */
|
|
73
|
+
deprecated_message: z.ZodOptional<z.ZodString>;
|
|
74
|
+
/** Related items from `@see` tags, in raw TSDoc format. */
|
|
75
|
+
see_also: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
+
/** Exceptions from `@throws` tags. */
|
|
77
|
+
throws: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
type: z.ZodOptional<z.ZodString>;
|
|
79
|
+
description: z.ZodString;
|
|
80
|
+
}, z.core.$loose>>>;
|
|
81
|
+
/** Version introduced, from `@since` tag. */
|
|
82
|
+
since: z.ZodOptional<z.ZodString>;
|
|
70
83
|
}, z.core.$loose>;
|
|
71
84
|
export type ComponentPropInfo = z.infer<typeof ComponentPropInfo>;
|
|
72
85
|
/**
|
|
@@ -79,8 +92,8 @@ export declare const DeclarationJson: z.ZodObject<{
|
|
|
79
92
|
name: z.ZodString;
|
|
80
93
|
kind: z.ZodEnum<{
|
|
81
94
|
function: "function";
|
|
82
|
-
type: "type";
|
|
83
95
|
json: "json";
|
|
96
|
+
type: "type";
|
|
84
97
|
variable: "variable";
|
|
85
98
|
class: "class";
|
|
86
99
|
constructor: "constructor";
|
|
@@ -129,6 +142,8 @@ export declare const DeclarationJson: z.ZodObject<{
|
|
|
129
142
|
}, z.core.$loose>>>;
|
|
130
143
|
/** Version introduced, from `@since` tag. */
|
|
131
144
|
since: z.ZodOptional<z.ZodString>;
|
|
145
|
+
/** Mutation documentation from `@mutates` tags (non-standard), mapping parameter names to descriptions. */
|
|
146
|
+
mutates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
132
147
|
/** Extended classes/interfaces. */
|
|
133
148
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
149
|
/** Implemented interfaces. */
|
|
@@ -145,6 +160,19 @@ export declare const DeclarationJson: z.ZodObject<{
|
|
|
145
160
|
description: z.ZodOptional<z.ZodString>;
|
|
146
161
|
default_value: z.ZodOptional<z.ZodString>;
|
|
147
162
|
bindable: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
/** Code examples from `@example` tags. */
|
|
164
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
+
/** Deprecation message from `@deprecated` tag. */
|
|
166
|
+
deprecated_message: z.ZodOptional<z.ZodString>;
|
|
167
|
+
/** Related items from `@see` tags, in raw TSDoc format. */
|
|
168
|
+
see_also: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
169
|
+
/** Exceptions from `@throws` tags. */
|
|
170
|
+
throws: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
+
type: z.ZodOptional<z.ZodString>;
|
|
172
|
+
description: z.ZodString;
|
|
173
|
+
}, z.core.$loose>>>;
|
|
174
|
+
/** Version introduced, from `@since` tag. */
|
|
175
|
+
since: z.ZodOptional<z.ZodString>;
|
|
148
176
|
}, z.core.$loose>>>;
|
|
149
177
|
/**
|
|
150
178
|
* Module paths (relative to src/lib) that re-export this declaration.
|
|
@@ -157,6 +185,16 @@ export declare const DeclarationJson: z.ZodObject<{
|
|
|
157
185
|
alias_of: z.ZodOptional<z.ZodObject<{
|
|
158
186
|
module: z.ZodString;
|
|
159
187
|
name: z.ZodString;
|
|
188
|
+
kind: z.ZodEnum<{
|
|
189
|
+
function: "function";
|
|
190
|
+
json: "json";
|
|
191
|
+
type: "type";
|
|
192
|
+
variable: "variable";
|
|
193
|
+
class: "class";
|
|
194
|
+
constructor: "constructor";
|
|
195
|
+
component: "component";
|
|
196
|
+
css: "css";
|
|
197
|
+
}>;
|
|
160
198
|
}, z.core.$strip>>;
|
|
161
199
|
}, z.core.$loose>;
|
|
162
200
|
export type DeclarationJson = z.infer<typeof DeclarationJson>;
|
|
@@ -171,8 +209,8 @@ export declare const ModuleJson: z.ZodObject<{
|
|
|
171
209
|
name: z.ZodString;
|
|
172
210
|
kind: z.ZodEnum<{
|
|
173
211
|
function: "function";
|
|
174
|
-
type: "type";
|
|
175
212
|
json: "json";
|
|
213
|
+
type: "type";
|
|
176
214
|
variable: "variable";
|
|
177
215
|
class: "class";
|
|
178
216
|
constructor: "constructor";
|
|
@@ -221,6 +259,8 @@ export declare const ModuleJson: z.ZodObject<{
|
|
|
221
259
|
}, z.core.$loose>>>;
|
|
222
260
|
/** Version introduced, from `@since` tag. */
|
|
223
261
|
since: z.ZodOptional<z.ZodString>;
|
|
262
|
+
/** Mutation documentation from `@mutates` tags (non-standard), mapping parameter names to descriptions. */
|
|
263
|
+
mutates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
224
264
|
/** Extended classes/interfaces. */
|
|
225
265
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
226
266
|
/** Implemented interfaces. */
|
|
@@ -237,6 +277,19 @@ export declare const ModuleJson: z.ZodObject<{
|
|
|
237
277
|
description: z.ZodOptional<z.ZodString>;
|
|
238
278
|
default_value: z.ZodOptional<z.ZodString>;
|
|
239
279
|
bindable: z.ZodOptional<z.ZodBoolean>;
|
|
280
|
+
/** Code examples from `@example` tags. */
|
|
281
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
282
|
+
/** Deprecation message from `@deprecated` tag. */
|
|
283
|
+
deprecated_message: z.ZodOptional<z.ZodString>;
|
|
284
|
+
/** Related items from `@see` tags, in raw TSDoc format. */
|
|
285
|
+
see_also: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
286
|
+
/** Exceptions from `@throws` tags. */
|
|
287
|
+
throws: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
288
|
+
type: z.ZodOptional<z.ZodString>;
|
|
289
|
+
description: z.ZodString;
|
|
290
|
+
}, z.core.$loose>>>;
|
|
291
|
+
/** Version introduced, from `@since` tag. */
|
|
292
|
+
since: z.ZodOptional<z.ZodString>;
|
|
240
293
|
}, z.core.$loose>>>;
|
|
241
294
|
/**
|
|
242
295
|
* Module paths (relative to src/lib) that re-export this declaration.
|
|
@@ -249,6 +302,16 @@ export declare const ModuleJson: z.ZodObject<{
|
|
|
249
302
|
alias_of: z.ZodOptional<z.ZodObject<{
|
|
250
303
|
module: z.ZodString;
|
|
251
304
|
name: z.ZodString;
|
|
305
|
+
kind: z.ZodEnum<{
|
|
306
|
+
function: "function";
|
|
307
|
+
json: "json";
|
|
308
|
+
type: "type";
|
|
309
|
+
variable: "variable";
|
|
310
|
+
class: "class";
|
|
311
|
+
constructor: "constructor";
|
|
312
|
+
component: "component";
|
|
313
|
+
css: "css";
|
|
314
|
+
}>;
|
|
252
315
|
}, z.core.$strip>>;
|
|
253
316
|
}, z.core.$loose>>>;
|
|
254
317
|
/** File-level JSDoc comment. */
|
|
@@ -278,8 +341,8 @@ export declare const SourceJson: z.ZodObject<{
|
|
|
278
341
|
name: z.ZodString;
|
|
279
342
|
kind: z.ZodEnum<{
|
|
280
343
|
function: "function";
|
|
281
|
-
type: "type";
|
|
282
344
|
json: "json";
|
|
345
|
+
type: "type";
|
|
283
346
|
variable: "variable";
|
|
284
347
|
class: "class";
|
|
285
348
|
constructor: "constructor";
|
|
@@ -328,6 +391,8 @@ export declare const SourceJson: z.ZodObject<{
|
|
|
328
391
|
}, z.core.$loose>>>;
|
|
329
392
|
/** Version introduced, from `@since` tag. */
|
|
330
393
|
since: z.ZodOptional<z.ZodString>;
|
|
394
|
+
/** Mutation documentation from `@mutates` tags (non-standard), mapping parameter names to descriptions. */
|
|
395
|
+
mutates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
331
396
|
/** Extended classes/interfaces. */
|
|
332
397
|
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
333
398
|
/** Implemented interfaces. */
|
|
@@ -344,6 +409,19 @@ export declare const SourceJson: z.ZodObject<{
|
|
|
344
409
|
description: z.ZodOptional<z.ZodString>;
|
|
345
410
|
default_value: z.ZodOptional<z.ZodString>;
|
|
346
411
|
bindable: z.ZodOptional<z.ZodBoolean>;
|
|
412
|
+
/** Code examples from `@example` tags. */
|
|
413
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
414
|
+
/** Deprecation message from `@deprecated` tag. */
|
|
415
|
+
deprecated_message: z.ZodOptional<z.ZodString>;
|
|
416
|
+
/** Related items from `@see` tags, in raw TSDoc format. */
|
|
417
|
+
see_also: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
418
|
+
/** Exceptions from `@throws` tags. */
|
|
419
|
+
throws: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
420
|
+
type: z.ZodOptional<z.ZodString>;
|
|
421
|
+
description: z.ZodString;
|
|
422
|
+
}, z.core.$loose>>>;
|
|
423
|
+
/** Version introduced, from `@since` tag. */
|
|
424
|
+
since: z.ZodOptional<z.ZodString>;
|
|
347
425
|
}, z.core.$loose>>>;
|
|
348
426
|
/**
|
|
349
427
|
* Module paths (relative to src/lib) that re-export this declaration.
|
|
@@ -356,6 +434,16 @@ export declare const SourceJson: z.ZodObject<{
|
|
|
356
434
|
alias_of: z.ZodOptional<z.ZodObject<{
|
|
357
435
|
module: z.ZodString;
|
|
358
436
|
name: z.ZodString;
|
|
437
|
+
kind: z.ZodEnum<{
|
|
438
|
+
function: "function";
|
|
439
|
+
json: "json";
|
|
440
|
+
type: "type";
|
|
441
|
+
variable: "variable";
|
|
442
|
+
class: "class";
|
|
443
|
+
constructor: "constructor";
|
|
444
|
+
component: "component";
|
|
445
|
+
css: "css";
|
|
446
|
+
}>;
|
|
359
447
|
}, z.core.$strip>>;
|
|
360
448
|
}, z.core.$loose>>>;
|
|
361
449
|
/** File-level JSDoc comment. */
|
|
@@ -374,14 +462,26 @@ export declare const SourceJson: z.ZodObject<{
|
|
|
374
462
|
export type SourceJson = z.infer<typeof SourceJson>;
|
|
375
463
|
/**
|
|
376
464
|
* Format declaration name with generic parameters for display.
|
|
377
|
-
*
|
|
465
|
+
*
|
|
466
|
+
* @deprecated Use `getDisplayName` from `@fuzdev/svelte-docinfo/types.js` instead.
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
* ```ts
|
|
470
|
+
* declaration_get_display_name({name: 'Map', kind: 'type', generic_params: [{name: 'K'}, {name: 'V'}]})
|
|
378
471
|
* // => 'Map<K, V>'
|
|
472
|
+
* ```
|
|
379
473
|
*/
|
|
380
474
|
export declare const declaration_get_display_name: (declaration: DeclarationJson) => string;
|
|
381
475
|
/**
|
|
382
476
|
* Generate TypeScript import statement for a declaration.
|
|
383
|
-
*
|
|
477
|
+
*
|
|
478
|
+
* @deprecated Use `generateImport` from `@fuzdev/svelte-docinfo/types.js` instead.
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* ```ts
|
|
482
|
+
* declaration_generate_import({name: 'Foo', kind: 'type'}, 'foo.ts', '@pkg/lib')
|
|
384
483
|
* // => "import type {Foo} from '@pkg/lib/foo.js';"
|
|
484
|
+
* ```
|
|
385
485
|
*/
|
|
386
486
|
export declare const declaration_generate_import: (declaration: DeclarationJson, module_path: string, library_name: string) => string;
|
|
387
487
|
//# sourceMappingURL=source_json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;EAS1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC5B,+BAA+B;;IAE/B,wDAAwD;;IAExD,sDAAsD;;iBAErD,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;
|
|
1
|
+
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAA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BAE/B,wDAAwD;;gBAExD,sDAAsD;;;YA2EtD,0CAA0C;;YAE1C,kDAAkD;;YAElD,2DAA2D;;YAE3D,sCAAsC;;;;;YAEtC,6CAA6C;;YAE7C,2GAA2G;;YAE3G,mCAAmC;;YAEnC,8BAA8B;;YAE9B,8CAA8C;;YAI9C,6CAA6C;;YAI7C,8BAA8B;;;;;;;;gBA9D9B,0CAA0C;;gBAE1C,kDAAkD;;gBAElD,2DAA2D;;gBAE3D,sCAAsC;;;;;gBAEtC,6CAA6C;;;YAwD7C;;;eAGG;;YAEH;;eAEG;;;;;;;;;;;;;;;;QAkBH,gCAAgC;;QAEhC,wDAAwD;;QAExD,4DAA4D;;QAE5D;;;WAGG;;;iBAYF,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GAAI,aAAa,eAAe,KAAG,MAS3E,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,GACvC,aAAa,eAAe,EAC5B,aAAa,MAAM,EACnB,cAAc,MAAM,KAClB,MAgBF,CAAC"}
|
package/dist/source_json.js
CHANGED
|
@@ -64,6 +64,16 @@ export const ComponentPropInfo = z.looseObject({
|
|
|
64
64
|
description: z.string().optional(),
|
|
65
65
|
default_value: z.string().optional(),
|
|
66
66
|
bindable: z.boolean().optional(),
|
|
67
|
+
/** Code examples from `@example` tags. */
|
|
68
|
+
examples: z.array(z.string()).optional(),
|
|
69
|
+
/** Deprecation message from `@deprecated` tag. */
|
|
70
|
+
deprecated_message: z.string().optional(),
|
|
71
|
+
/** Related items from `@see` tags, in raw TSDoc format. */
|
|
72
|
+
see_also: z.array(z.string()).optional(),
|
|
73
|
+
/** Exceptions from `@throws` tags. */
|
|
74
|
+
throws: z.array(z.looseObject({ type: z.string().optional(), description: z.string() })).optional(),
|
|
75
|
+
/** Version introduced, from `@since` tag. */
|
|
76
|
+
since: z.string().optional(),
|
|
67
77
|
});
|
|
68
78
|
/**
|
|
69
79
|
* Metadata for an exported declaration (function, type, class, component, etc.).
|
|
@@ -100,6 +110,8 @@ export const DeclarationJson = z.looseObject({
|
|
|
100
110
|
throws: z.array(z.looseObject({ type: z.string().optional(), description: z.string() })).optional(),
|
|
101
111
|
/** Version introduced, from `@since` tag. */
|
|
102
112
|
since: z.string().optional(),
|
|
113
|
+
/** Mutation documentation from `@mutates` tags (non-standard), mapping parameter names to descriptions. */
|
|
114
|
+
mutates: z.record(z.string(), z.string()).optional(),
|
|
103
115
|
/** Extended classes/interfaces. */
|
|
104
116
|
extends: z.array(z.string()).optional(),
|
|
105
117
|
/** Implemented interfaces. */
|
|
@@ -126,6 +138,7 @@ export const DeclarationJson = z.looseObject({
|
|
|
126
138
|
.object({
|
|
127
139
|
module: z.string(),
|
|
128
140
|
name: z.string(),
|
|
141
|
+
kind: DeclarationKind,
|
|
129
142
|
})
|
|
130
143
|
.optional(),
|
|
131
144
|
});
|
|
@@ -158,8 +171,14 @@ export const SourceJson = z.looseObject({
|
|
|
158
171
|
});
|
|
159
172
|
/**
|
|
160
173
|
* Format declaration name with generic parameters for display.
|
|
161
|
-
*
|
|
174
|
+
*
|
|
175
|
+
* @deprecated Use `getDisplayName` from `@fuzdev/svelte-docinfo/types.js` instead.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* declaration_get_display_name({name: 'Map', kind: 'type', generic_params: [{name: 'K'}, {name: 'V'}]})
|
|
162
180
|
* // => 'Map<K, V>'
|
|
181
|
+
* ```
|
|
163
182
|
*/
|
|
164
183
|
export const declaration_get_display_name = (declaration) => {
|
|
165
184
|
if (!declaration.generic_params?.length)
|
|
@@ -176,8 +195,14 @@ export const declaration_get_display_name = (declaration) => {
|
|
|
176
195
|
};
|
|
177
196
|
/**
|
|
178
197
|
* Generate TypeScript import statement for a declaration.
|
|
179
|
-
*
|
|
198
|
+
*
|
|
199
|
+
* @deprecated Use `generateImport` from `@fuzdev/svelte-docinfo/types.js` instead.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* declaration_generate_import({name: 'Foo', kind: 'type'}, 'foo.ts', '@pkg/lib')
|
|
180
204
|
* // => "import type {Foo} from '@pkg/lib/foo.js';"
|
|
205
|
+
* ```
|
|
181
206
|
*/
|
|
182
207
|
export const declaration_generate_import = (declaration, module_path, library_name) => {
|
|
183
208
|
const js_path = module_path.replace(/\.ts$/, '.js');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_util",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "utility belt for JS",
|
|
5
5
|
"glyph": "🦕",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -69,11 +69,12 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@changesets/changelog-git": "^0.2.1",
|
|
72
|
-
"@fuzdev/fuz_code": "^0.
|
|
73
|
-
"@fuzdev/fuz_css": "^0.
|
|
74
|
-
"@fuzdev/fuz_ui": "^0.
|
|
72
|
+
"@fuzdev/fuz_code": "^0.45.0",
|
|
73
|
+
"@fuzdev/fuz_css": "^0.50.0",
|
|
74
|
+
"@fuzdev/fuz_ui": "^0.183.1",
|
|
75
|
+
"@fuzdev/gro": "^0.192.1",
|
|
76
|
+
"@jridgewell/trace-mapping": "^0.3.31",
|
|
75
77
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
76
|
-
"@ryanatkn/gro": "^0.190.0",
|
|
77
78
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
78
79
|
"@sveltejs/kit": "^2.50.1",
|
|
79
80
|
"@sveltejs/package": "^2.5.7",
|
|
@@ -86,15 +87,18 @@
|
|
|
86
87
|
"eslint-plugin-svelte": "^3.14.0",
|
|
87
88
|
"esm-env": "^1.2.2",
|
|
88
89
|
"fast-deep-equal": "^3.1.3",
|
|
90
|
+
"magic-string": "^0.30.21",
|
|
89
91
|
"prettier": "^3.7.4",
|
|
90
92
|
"prettier-plugin-svelte": "^3.4.1",
|
|
91
93
|
"svelte": "^5.49.1",
|
|
92
94
|
"svelte-check": "^4.3.6",
|
|
95
|
+
"svelte2tsx": "^0.7.47",
|
|
93
96
|
"tslib": "^2.8.1",
|
|
94
97
|
"typescript": "^5.9.3",
|
|
95
98
|
"typescript-eslint": "^8.48.1",
|
|
96
99
|
"vitest": "^4.0.15",
|
|
97
|
-
"
|
|
100
|
+
"zimmerframe": "^1.1.4",
|
|
101
|
+
"zod": "^4.3.6"
|
|
98
102
|
},
|
|
99
103
|
"prettier": {
|
|
100
104
|
"plugins": [
|
package/src/lib/path.ts
CHANGED
|
@@ -37,7 +37,10 @@ export const to_file_path = (path_or_url: string | URL): string =>
|
|
|
37
37
|
typeof path_or_url === 'string' ? path_or_url : decodeURIComponent(path_or_url.pathname);
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* @example
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* parse_path_parts('./foo/bar/baz.ts') // => ['foo', 'foo/bar', 'foo/bar/baz.ts']
|
|
43
|
+
* ```
|
|
41
44
|
*/
|
|
42
45
|
export const parse_path_parts = (path: string): Array<string> => {
|
|
43
46
|
const segments = parse_path_segments(path);
|
|
@@ -53,7 +56,10 @@ export const parse_path_parts = (path: string): Array<string> => {
|
|
|
53
56
|
|
|
54
57
|
/**
|
|
55
58
|
* Gets the individual parts of a path, ignoring dots and separators.
|
|
56
|
-
* @example
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* parse_path_segments('/foo/bar/baz.ts') // => ['foo', 'bar', 'baz.ts']
|
|
62
|
+
* ```
|
|
57
63
|
*/
|
|
58
64
|
export const parse_path_segments = (path: string): Array<string> =>
|
|
59
65
|
path.split('/').filter((s) => s && s !== '.' && s !== '..');
|
package/src/lib/process.ts
CHANGED
|
@@ -616,7 +616,10 @@ export const spawn_detached = (
|
|
|
616
616
|
/**
|
|
617
617
|
* Formats a child process for display.
|
|
618
618
|
*
|
|
619
|
-
* @example
|
|
619
|
+
* @example
|
|
620
|
+
* ```ts
|
|
621
|
+
* `pid(1234) <- node server.js`
|
|
622
|
+
* ```
|
|
620
623
|
*/
|
|
621
624
|
export const print_child_process = (child: ChildProcess): string =>
|
|
622
625
|
`${st('gray', 'pid(')}${child.pid ?? 'none'}${st('gray', ')')} ← ${st('green', child.spawnargs.join(' '))}`;
|
package/src/lib/source_json.ts
CHANGED
|
@@ -72,6 +72,16 @@ export const ComponentPropInfo = z.looseObject({
|
|
|
72
72
|
description: z.string().optional(),
|
|
73
73
|
default_value: z.string().optional(),
|
|
74
74
|
bindable: z.boolean().optional(),
|
|
75
|
+
/** Code examples from `@example` tags. */
|
|
76
|
+
examples: z.array(z.string()).optional(),
|
|
77
|
+
/** Deprecation message from `@deprecated` tag. */
|
|
78
|
+
deprecated_message: z.string().optional(),
|
|
79
|
+
/** Related items from `@see` tags, in raw TSDoc format. */
|
|
80
|
+
see_also: z.array(z.string()).optional(),
|
|
81
|
+
/** Exceptions from `@throws` tags. */
|
|
82
|
+
throws: z.array(z.looseObject({type: z.string().optional(), description: z.string()})).optional(),
|
|
83
|
+
/** Version introduced, from `@since` tag. */
|
|
84
|
+
since: z.string().optional(),
|
|
75
85
|
});
|
|
76
86
|
export type ComponentPropInfo = z.infer<typeof ComponentPropInfo>;
|
|
77
87
|
|
|
@@ -110,6 +120,8 @@ export const DeclarationJson = z.looseObject({
|
|
|
110
120
|
throws: z.array(z.looseObject({type: z.string().optional(), description: z.string()})).optional(),
|
|
111
121
|
/** Version introduced, from `@since` tag. */
|
|
112
122
|
since: z.string().optional(),
|
|
123
|
+
/** Mutation documentation from `@mutates` tags (non-standard), mapping parameter names to descriptions. */
|
|
124
|
+
mutates: z.record(z.string(), z.string()).optional(),
|
|
113
125
|
/** Extended classes/interfaces. */
|
|
114
126
|
extends: z.array(z.string()).optional(),
|
|
115
127
|
/** Implemented interfaces. */
|
|
@@ -136,6 +148,7 @@ export const DeclarationJson = z.looseObject({
|
|
|
136
148
|
.object({
|
|
137
149
|
module: z.string(),
|
|
138
150
|
name: z.string(),
|
|
151
|
+
kind: DeclarationKind,
|
|
139
152
|
})
|
|
140
153
|
.optional(),
|
|
141
154
|
});
|
|
@@ -174,8 +187,14 @@ export type SourceJson = z.infer<typeof SourceJson>;
|
|
|
174
187
|
|
|
175
188
|
/**
|
|
176
189
|
* Format declaration name with generic parameters for display.
|
|
177
|
-
*
|
|
190
|
+
*
|
|
191
|
+
* @deprecated Use `getDisplayName` from `@fuzdev/svelte-docinfo/types.js` instead.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* declaration_get_display_name({name: 'Map', kind: 'type', generic_params: [{name: 'K'}, {name: 'V'}]})
|
|
178
196
|
* // => 'Map<K, V>'
|
|
197
|
+
* ```
|
|
179
198
|
*/
|
|
180
199
|
export const declaration_get_display_name = (declaration: DeclarationJson): string => {
|
|
181
200
|
if (!declaration.generic_params?.length) return declaration.name;
|
|
@@ -190,8 +209,14 @@ export const declaration_get_display_name = (declaration: DeclarationJson): stri
|
|
|
190
209
|
|
|
191
210
|
/**
|
|
192
211
|
* Generate TypeScript import statement for a declaration.
|
|
193
|
-
*
|
|
212
|
+
*
|
|
213
|
+
* @deprecated Use `generateImport` from `@fuzdev/svelte-docinfo/types.js` instead.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```ts
|
|
217
|
+
* declaration_generate_import({name: 'Foo', kind: 'type'}, 'foo.ts', '@pkg/lib')
|
|
194
218
|
* // => "import type {Foo} from '@pkg/lib/foo.js';"
|
|
219
|
+
* ```
|
|
195
220
|
*/
|
|
196
221
|
export const declaration_generate_import = (
|
|
197
222
|
declaration: DeclarationJson,
|