@fuzdev/fuz_ui 0.190.0 → 0.191.1
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/ContextmenuRootForSafariCompatibility.svelte +2 -2
- package/dist/MdzNodeView.svelte +3 -2
- package/dist/MdzNodeView.svelte.d.ts +1 -1
- package/dist/MdzNodeView.svelte.d.ts.map +1 -1
- package/dist/ProjectLinks.svelte +4 -2
- package/dist/ProjectLinks.svelte.d.ts.map +1 -1
- package/dist/analysis_context.d.ts +3 -3
- package/dist/analysis_context.js +3 -3
- package/dist/contextmenu_state.svelte.d.ts +7 -7
- package/dist/contextmenu_state.svelte.js +7 -7
- package/dist/docs_helpers.svelte.d.ts +7 -5
- package/dist/docs_helpers.svelte.d.ts.map +1 -1
- package/dist/docs_helpers.svelte.js +7 -5
- package/dist/intersect.svelte.d.ts +1 -1
- package/dist/intersect.svelte.js +1 -1
- package/dist/library_analysis.d.ts +6 -6
- package/dist/library_analysis.js +6 -6
- package/dist/library_gen.d.ts +4 -4
- package/dist/library_gen.js +4 -4
- package/dist/library_generate.d.ts +2 -2
- package/dist/library_helpers.d.ts +11 -11
- package/dist/library_helpers.js +11 -11
- package/dist/library_pipeline.d.ts +5 -5
- package/dist/library_pipeline.js +5 -5
- package/dist/logos.d.ts +7 -0
- package/dist/logos.d.ts.map +1 -1
- package/dist/logos.js +5 -0
- package/dist/mdz.d.ts +1 -14
- package/dist/mdz.d.ts.map +1 -1
- package/dist/mdz.js +64 -163
- package/dist/mdz_helpers.d.ts +26 -2
- package/dist/mdz_helpers.d.ts.map +1 -1
- package/dist/mdz_helpers.js +59 -5
- package/dist/mdz_lexer.d.ts.map +1 -1
- package/dist/mdz_lexer.js +18 -9
- package/dist/mdz_to_svelte.d.ts +5 -5
- package/dist/mdz_to_svelte.d.ts.map +1 -1
- package/dist/mdz_to_svelte.js +5 -5
- package/dist/mdz_token_parser.js +4 -3
- package/dist/module_helpers.d.ts +9 -9
- package/dist/module_helpers.js +9 -9
- package/dist/package_helpers.d.ts +20 -20
- package/dist/package_helpers.js +20 -20
- package/dist/storage.d.ts +4 -4
- package/dist/storage.js +4 -4
- package/dist/svelte_helpers.d.ts +13 -13
- package/dist/svelte_helpers.js +13 -13
- package/dist/svelte_preprocess_mdz.d.ts +2 -2
- package/dist/svelte_preprocess_mdz.js +2 -2
- package/dist/tome.d.ts +1 -1
- package/dist/tome.js +1 -1
- package/dist/ts_helpers.d.ts +24 -24
- package/dist/ts_helpers.js +24 -24
- package/dist/tsdoc_helpers.d.ts +6 -6
- package/dist/tsdoc_helpers.js +6 -6
- package/dist/tsdoc_mdz.js +1 -1
- package/package.json +8 -7
- package/src/lib/analysis_context.ts +3 -3
- package/src/lib/contextmenu_state.svelte.ts +7 -7
- package/src/lib/docs_helpers.svelte.ts +7 -5
- package/src/lib/intersect.svelte.ts +1 -1
- package/src/lib/library_analysis.ts +6 -6
- package/src/lib/library_gen.ts +4 -4
- package/src/lib/library_generate.ts +2 -2
- package/src/lib/library_helpers.ts +11 -11
- package/src/lib/library_pipeline.ts +5 -5
- package/src/lib/logos.ts +6 -0
- package/src/lib/mdz.ts +73 -177
- package/src/lib/mdz_helpers.ts +60 -5
- package/src/lib/mdz_lexer.ts +20 -9
- package/src/lib/mdz_to_svelte.ts +6 -5
- package/src/lib/mdz_token_parser.ts +4 -3
- package/src/lib/module_helpers.ts +9 -9
- package/src/lib/package_helpers.ts +20 -20
- package/src/lib/storage.ts +4 -4
- package/src/lib/svelte_helpers.ts +13 -13
- package/src/lib/svelte_preprocess_mdz.ts +2 -2
- package/src/lib/tome.ts +1 -1
- package/src/lib/ts_helpers.ts +24 -24
- package/src/lib/tsdoc_helpers.ts +6 -6
- package/src/lib/tsdoc_mdz.ts +1 -1
|
@@ -27,10 +27,10 @@ import type {PackageJson} from '@fuzdev/fuz_util/package_json.js';
|
|
|
27
27
|
/**
|
|
28
28
|
* Build GitHub file URL for a repository.
|
|
29
29
|
*
|
|
30
|
-
* @param repo_url
|
|
31
|
-
* @param file_path
|
|
32
|
-
* @param line
|
|
33
|
-
* @returns
|
|
30
|
+
* @param repo_url - repository URL (e.g., 'https://github.com/owner/repo')
|
|
31
|
+
* @param file_path - path to the file (leading './' is stripped)
|
|
32
|
+
* @param line - optional line number for deep linking
|
|
33
|
+
* @returns full GitHub URL to the file on the main branch
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```ts
|
|
@@ -53,9 +53,9 @@ export const url_github_file = (repo_url: string, file_path: string, line?: numb
|
|
|
53
53
|
/**
|
|
54
54
|
* Build GitHub organization URL from repo URL and repo name.
|
|
55
55
|
*
|
|
56
|
-
* @param repo_url
|
|
57
|
-
* @param repo_name
|
|
58
|
-
* @returns
|
|
56
|
+
* @param repo_url - repository URL (e.g., 'https://github.com/owner/repo')
|
|
57
|
+
* @param repo_name - repository name to strip from the URL
|
|
58
|
+
* @returns organization URL, or null if repo_url doesn't end with repo_name
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
61
61
|
* ```ts
|
|
@@ -70,8 +70,8 @@ export const url_github_org = (repo_url: string, repo_name: string): string | nu
|
|
|
70
70
|
/**
|
|
71
71
|
* Extract GitHub owner/org name from repository URL.
|
|
72
72
|
*
|
|
73
|
-
* @param repo_url
|
|
74
|
-
* @returns
|
|
73
|
+
* @param repo_url - repository URL (e.g., 'https://github.com/owner/repo')
|
|
74
|
+
* @returns owner name, or null if not a valid GitHub URL
|
|
75
75
|
*
|
|
76
76
|
* @example
|
|
77
77
|
* ```ts
|
|
@@ -95,8 +95,8 @@ export const repo_url_github_owner = (repo_url: string): string | null => {
|
|
|
95
95
|
/**
|
|
96
96
|
* Build npm package URL.
|
|
97
97
|
*
|
|
98
|
-
* @param package_name
|
|
99
|
-
* @returns
|
|
98
|
+
* @param package_name - package name (can be scoped like '@org/package')
|
|
99
|
+
* @returns full npm package page URL
|
|
100
100
|
*
|
|
101
101
|
* @example
|
|
102
102
|
* ```ts
|
|
@@ -115,8 +115,8 @@ export const url_npm_package = (package_name: string): string =>
|
|
|
115
115
|
* - It has exports defined
|
|
116
116
|
* - Its version is not the initial '0.0.1'
|
|
117
117
|
*
|
|
118
|
-
* @param package_json
|
|
119
|
-
* @returns
|
|
118
|
+
* @param package_json - the package.json object to check
|
|
119
|
+
* @returns `true` if the package appears to be published
|
|
120
120
|
*/
|
|
121
121
|
export const package_is_published = (package_json: PackageJson): boolean => {
|
|
122
122
|
return !package_json.private && !!package_json.exports && package_json.version !== '0.0.1';
|
|
@@ -125,8 +125,8 @@ export const package_is_published = (package_json: PackageJson): boolean => {
|
|
|
125
125
|
/**
|
|
126
126
|
* Extract repository name without scope from package name.
|
|
127
127
|
*
|
|
128
|
-
* @param name
|
|
129
|
-
* @returns
|
|
128
|
+
* @param name - package name (can be scoped like '@org/package')
|
|
129
|
+
* @returns repository name without scope
|
|
130
130
|
* @throws Error if scoped package name is malformed
|
|
131
131
|
*
|
|
132
132
|
* @example
|
|
@@ -158,8 +158,8 @@ export const repo_name_parse = (name: string): string => {
|
|
|
158
158
|
* Handles both string format and object format with `url` property.
|
|
159
159
|
* Strips common prefixes ('git+') and suffixes ('.git', '/').
|
|
160
160
|
*
|
|
161
|
-
* @param repository
|
|
162
|
-
* @returns
|
|
161
|
+
* @param repository - the repository field from package.json
|
|
162
|
+
* @returns clean repository URL, or null if not provided
|
|
163
163
|
*
|
|
164
164
|
* @example
|
|
165
165
|
* ```ts
|
|
@@ -189,9 +189,9 @@ export const repo_url_parse = (repository: PackageJson['repository']): string |
|
|
|
189
189
|
/**
|
|
190
190
|
* Build .well-known URL for package metadata files.
|
|
191
191
|
*
|
|
192
|
-
* @param homepage_url
|
|
193
|
-
* @param filename
|
|
194
|
-
* @returns
|
|
192
|
+
* @param homepage_url - package homepage URL
|
|
193
|
+
* @param filename - filename in .well-known directory
|
|
194
|
+
* @returns full URL to the .well-known file
|
|
195
195
|
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```ts
|
package/src/lib/storage.ts
CHANGED
|
@@ -18,10 +18,10 @@ export const save_to_storage = (key: string, value: any, is_json = false): void
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Utility function to load a value from `localStorage` with optional parsing
|
|
21
|
-
* @param key
|
|
22
|
-
* @param is_json
|
|
23
|
-
* @param parse_fn
|
|
24
|
-
* @returns
|
|
21
|
+
* @param key - the localStorage key
|
|
22
|
+
* @param is_json - whether to parse the value as JSON
|
|
23
|
+
* @param parse_fn - optional custom parsing function to transform the value
|
|
24
|
+
* @returns the parsed value or null if not found or parsing fails
|
|
25
25
|
*/
|
|
26
26
|
export const load_from_storage = <T>(
|
|
27
27
|
key: string,
|
|
@@ -76,12 +76,12 @@ export interface SvelteFileAnalysis {
|
|
|
76
76
|
* Returns raw analysis data matching `ModuleAnalysis` structure.
|
|
77
77
|
* Consumer decides filtering policy (Svelte components are never nodocs).
|
|
78
78
|
*
|
|
79
|
-
* @param source_file
|
|
80
|
-
* @param module_path
|
|
81
|
-
* @param checker TypeScript type checker
|
|
82
|
-
* @param options
|
|
83
|
-
* @param ctx
|
|
84
|
-
* @returns
|
|
79
|
+
* @param source_file - the source file info (from Gro filer, file system, or other source)
|
|
80
|
+
* @param module_path - the module path (relative to source root)
|
|
81
|
+
* @param checker - TypeScript type checker
|
|
82
|
+
* @param options - module source options for path extraction
|
|
83
|
+
* @param ctx - analysis context for collecting diagnostics
|
|
84
|
+
* @returns module analysis matching `ModuleAnalysis` structure
|
|
85
85
|
*/
|
|
86
86
|
export const svelte_analyze_module = (
|
|
87
87
|
source_file: SourceFileInfo,
|
|
@@ -118,11 +118,11 @@ export const svelte_analyze_module = (
|
|
|
118
118
|
*
|
|
119
119
|
* Suitable for use in documentation generators, build tools, and analysis.
|
|
120
120
|
*
|
|
121
|
-
* @param source_file
|
|
122
|
-
* @param module_path
|
|
123
|
-
* @param checker TypeScript type checker for type resolution
|
|
124
|
-
* @param ctx
|
|
125
|
-
* @returns
|
|
121
|
+
* @param source_file - source file info with path and content
|
|
122
|
+
* @param module_path - module path relative to source root (e.g., 'Alert.svelte')
|
|
123
|
+
* @param checker - TypeScript type checker for type resolution
|
|
124
|
+
* @param ctx - analysis context for collecting diagnostics
|
|
125
|
+
* @returns component declaration and optional module-level comment
|
|
126
126
|
*/
|
|
127
127
|
export const svelte_analyze_file = (
|
|
128
128
|
source_file: SourceFileInfo,
|
|
@@ -259,8 +259,8 @@ export const svelte_extract_script_content = (svelte_source: string): string | u
|
|
|
259
259
|
* Requires `@module` tag to identify module comments. The tag line is stripped
|
|
260
260
|
* from the output.
|
|
261
261
|
*
|
|
262
|
-
* @param script_content -
|
|
263
|
-
* @returns
|
|
262
|
+
* @param script_content - the content of the `<script>` tag
|
|
263
|
+
* @returns the cleaned module comment text, or undefined if none found
|
|
264
264
|
*/
|
|
265
265
|
export const svelte_extract_module_comment = (script_content: string): string | undefined => {
|
|
266
266
|
// Parse the script content as TypeScript and reuse the shared extraction logic
|
|
@@ -98,8 +98,8 @@ const PRECOMPILED_NAME = 'MdzPrecompiled';
|
|
|
98
98
|
/**
|
|
99
99
|
* Creates a Svelte preprocessor that compiles static `Mdz` content at build time.
|
|
100
100
|
*
|
|
101
|
-
* @param options
|
|
102
|
-
* @returns
|
|
101
|
+
* @param options - configuration for component/element resolution and file filtering
|
|
102
|
+
* @returns a Svelte `PreprocessorGroup` for use in `svelte.config.js`
|
|
103
103
|
*/
|
|
104
104
|
export const svelte_preprocess_mdz = (
|
|
105
105
|
options: SveltePreprocessMdzOptions = {},
|
package/src/lib/tome.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const Tome = z.object({
|
|
|
18
18
|
export type Tome = z.infer<typeof Tome>;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @param hash - URL fragment to append, with or without the
|
|
21
|
+
* @param hash - URL fragment to append, with or without the `#`
|
|
22
22
|
*/
|
|
23
23
|
export const to_tome_pathname = (
|
|
24
24
|
item: Tome | string,
|
package/src/lib/ts_helpers.ts
CHANGED
|
@@ -63,9 +63,9 @@ export interface ModuleExportsAnalysis {
|
|
|
63
63
|
/**
|
|
64
64
|
* Create TypeScript program for analysis.
|
|
65
65
|
*
|
|
66
|
-
* @param options
|
|
67
|
-
* @param log
|
|
68
|
-
* @returns
|
|
66
|
+
* @param options - configuration options for program creation
|
|
67
|
+
* @param log - optional logger for info messages
|
|
68
|
+
* @returns the program and type checker
|
|
69
69
|
* @throws Error if tsconfig.json is not found
|
|
70
70
|
*/
|
|
71
71
|
export const ts_create_program = (options?: TsProgramOptions, log?: Logger): TsProgram => {
|
|
@@ -100,13 +100,13 @@ export const ts_create_program = (options?: TsProgramOptions, log?: Logger): TsP
|
|
|
100
100
|
* This is a high-level function suitable for building documentation or library metadata.
|
|
101
101
|
* For lower-level analysis, use `ts_analyze_module_exports` directly.
|
|
102
102
|
*
|
|
103
|
-
* @param source_file_info
|
|
104
|
-
* @param ts_source_file TypeScript source file from the program
|
|
105
|
-
* @param module_path
|
|
106
|
-
* @param checker TypeScript type checker
|
|
107
|
-
* @param options
|
|
108
|
-
* @param ctx
|
|
109
|
-
* @returns
|
|
103
|
+
* @param source_file_info - the source file info (from Gro filer, file system, or other source)
|
|
104
|
+
* @param ts_source_file - TypeScript source file from the program
|
|
105
|
+
* @param module_path - the module path (relative to source root)
|
|
106
|
+
* @param checker - TypeScript type checker
|
|
107
|
+
* @param options - module source options for path extraction
|
|
108
|
+
* @param ctx - analysis context for collecting diagnostics
|
|
109
|
+
* @returns module metadata and re-export information
|
|
110
110
|
*/
|
|
111
111
|
export const ts_analyze_module = (
|
|
112
112
|
source_file_info: SourceFileInfo,
|
|
@@ -151,11 +151,11 @@ export const ts_analyze_module = (
|
|
|
151
151
|
* suitable for building documentation, API explorers, or analysis tools.
|
|
152
152
|
* For standard SvelteKit library layouts, use `module_create_source_options(process.cwd())`.
|
|
153
153
|
*
|
|
154
|
-
* @param source_file
|
|
155
|
-
* @param checker
|
|
156
|
-
* @param options
|
|
157
|
-
* @param ctx
|
|
158
|
-
* @returns
|
|
154
|
+
* @param source_file - the TypeScript source file to analyze
|
|
155
|
+
* @param checker - the TypeScript type checker
|
|
156
|
+
* @param options - module source options for path extraction in re-exports
|
|
157
|
+
* @param ctx - analysis context for collecting diagnostics
|
|
158
|
+
* @returns module comment, declarations, re-exports, and star exports
|
|
159
159
|
*/
|
|
160
160
|
export const ts_analyze_module_exports = (
|
|
161
161
|
source_file: ts.SourceFile,
|
|
@@ -275,11 +275,11 @@ export const ts_analyze_module_exports = (
|
|
|
275
275
|
* type analysis to produce complete declaration metadata. Suitable for use
|
|
276
276
|
* in documentation generators, IDE integrations, and other tooling.
|
|
277
277
|
*
|
|
278
|
-
* @param symbol
|
|
279
|
-
* @param source_file
|
|
280
|
-
* @param checker
|
|
281
|
-
* @param ctx
|
|
282
|
-
* @returns
|
|
278
|
+
* @param symbol - the TypeScript symbol to analyze
|
|
279
|
+
* @param source_file - the source file containing the symbol
|
|
280
|
+
* @param checker - the TypeScript type checker
|
|
281
|
+
* @param ctx - optional analysis context for collecting diagnostics
|
|
282
|
+
* @returns complete declaration metadata including docs, types, and parameters, plus nodocs flag
|
|
283
283
|
*/
|
|
284
284
|
export const ts_analyze_declaration = (
|
|
285
285
|
symbol: ts.Symbol,
|
|
@@ -431,10 +431,10 @@ export const ts_infer_declaration_kind = (symbol: ts.Symbol, node: ts.Node): Dec
|
|
|
431
431
|
* Shared helper for extracting parameter information from both standalone functions
|
|
432
432
|
* and class methods/constructors.
|
|
433
433
|
*
|
|
434
|
-
* @param sig
|
|
435
|
-
* @param checker TypeScript type checker for type resolution
|
|
436
|
-
* @param tsdoc_params
|
|
437
|
-
* @returns
|
|
434
|
+
* @param sig - the TypeScript signature to extract parameters from
|
|
435
|
+
* @param checker - TypeScript type checker for type resolution
|
|
436
|
+
* @param tsdoc_params - map of parameter names to TSDoc descriptions (from tsdoc.params)
|
|
437
|
+
* @returns array of parameter info objects
|
|
438
438
|
*/
|
|
439
439
|
export const ts_extract_signature_parameters = (
|
|
440
440
|
sig: ts.Signature,
|
package/src/lib/tsdoc_helpers.ts
CHANGED
|
@@ -83,8 +83,8 @@ export interface TsdocParsedComment {
|
|
|
83
83
|
* - `@since` - version information
|
|
84
84
|
* - `@mutates` - mutation documentation (non-standard)
|
|
85
85
|
*
|
|
86
|
-
* @param node
|
|
87
|
-
* @param source_file
|
|
86
|
+
* @param node - the TypeScript node to extract JSDoc from
|
|
87
|
+
* @param source_file - source file (used for extracting full ` @see` tag text)
|
|
88
88
|
*/
|
|
89
89
|
export const tsdoc_parse = (
|
|
90
90
|
node: ts.Node,
|
|
@@ -186,8 +186,8 @@ export const tsdoc_parse = (
|
|
|
186
186
|
* Consolidates the common pattern of assigning TSDoc fields to declarations,
|
|
187
187
|
* with conditional assignment for array fields (only if non-empty).
|
|
188
188
|
*
|
|
189
|
-
* @param declaration declaration object to update
|
|
190
|
-
* @param tsdoc parsed TSDoc comment (if available)
|
|
189
|
+
* @param declaration - declaration object to update
|
|
190
|
+
* @param tsdoc - parsed TSDoc comment (if available)
|
|
191
191
|
* @mutates declaration - adds doc_comment, deprecated_message, examples, see_also, throws, since fields
|
|
192
192
|
*/
|
|
193
193
|
export const tsdoc_apply_to_declaration = (
|
|
@@ -219,8 +219,8 @@ export const tsdoc_apply_to_declaration = (
|
|
|
219
219
|
*
|
|
220
220
|
* Transforms `/** ... *\/` style comments into clean text.
|
|
221
221
|
*
|
|
222
|
-
* @param comment_text
|
|
223
|
-
* @returns
|
|
222
|
+
* @param comment_text - the raw comment text including `/**` and `*\/` markers
|
|
223
|
+
* @returns cleaned comment text, or undefined if empty after cleaning
|
|
224
224
|
*/
|
|
225
225
|
export const tsdoc_clean_comment = (comment_text: string): string | undefined => {
|
|
226
226
|
const text = comment_text
|
package/src/lib/tsdoc_mdz.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import {mdz_is_url} from './
|
|
11
|
+
import {mdz_is_url} from './mdz_helpers.js';
|
|
12
12
|
|
|
13
13
|
/** Format a reference as mdz: URLs pass through, identifiers get backticks. */
|
|
14
14
|
const format_reference = (ref: string): string => (mdz_is_url(ref) ? ref : `\`${ref}\``);
|