@fuzdev/fuz_ui 0.191.0 → 0.191.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert.svelte +1 -1
- package/dist/ContextmenuRootForSafariCompatibility.svelte +1 -1
- package/dist/ProjectLinks.svelte +7 -3
- package/dist/ProjectLinks.svelte.d.ts.map +1 -1
- package/dist/analysis_context.d.ts +8 -4
- package/dist/analysis_context.d.ts.map +1 -1
- package/dist/analysis_context.js +8 -4
- package/dist/contextmenu_state.svelte.d.ts +3 -3
- package/dist/contextmenu_state.svelte.js +3 -3
- package/dist/csp.d.ts +4 -4
- package/dist/csp.js +4 -4
- package/dist/docs_helpers.svelte.d.ts +1 -1
- package/dist/docs_helpers.svelte.js +1 -1
- package/dist/library.svelte.d.ts +4 -4
- package/dist/library.svelte.js +4 -4
- package/dist/library_analysis.d.ts +5 -5
- package/dist/library_analysis.d.ts.map +1 -1
- package/dist/library_analysis.js +4 -4
- package/dist/library_gen.d.ts +10 -8
- package/dist/library_gen.d.ts.map +1 -1
- package/dist/library_gen.js +8 -8
- package/dist/library_generate.d.ts +2 -2
- package/dist/library_generate.js +2 -2
- package/dist/library_helpers.d.ts +5 -3
- package/dist/library_helpers.d.ts.map +1 -1
- package/dist/library_helpers.js +5 -3
- package/dist/library_output.d.ts +7 -7
- package/dist/library_output.d.ts.map +1 -1
- package/dist/library_output.js +5 -5
- package/dist/library_pipeline.d.ts +9 -5
- package/dist/library_pipeline.d.ts.map +1 -1
- package/dist/library_pipeline.js +9 -5
- package/dist/logos.d.ts +15 -1
- package/dist/logos.d.ts.map +1 -1
- package/dist/logos.js +13 -3
- package/dist/mdz.js +7 -7
- package/dist/mdz_helpers.d.ts +3 -3
- package/dist/mdz_helpers.js +3 -3
- package/dist/mdz_to_svelte.d.ts +4 -4
- package/dist/mdz_to_svelte.js +4 -4
- package/dist/module.svelte.d.ts +1 -1
- package/dist/module.svelte.js +1 -1
- package/dist/module_helpers.d.ts +3 -3
- package/dist/module_helpers.js +2 -2
- package/dist/package_helpers.d.ts +12 -12
- package/dist/package_helpers.js +12 -12
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +1 -1
- package/dist/svelte_helpers.d.ts +4 -4
- package/dist/svelte_helpers.js +4 -4
- package/dist/svelte_preprocess_mdz.d.ts +5 -5
- package/dist/svelte_preprocess_mdz.js +7 -7
- package/dist/tome.d.ts +1 -1
- package/dist/tome.js +1 -1
- package/dist/ts_helpers.d.ts +9 -9
- package/dist/ts_helpers.d.ts.map +1 -1
- package/dist/ts_helpers.js +7 -7
- package/dist/tsdoc_helpers.d.ts +1 -1
- package/dist/tsdoc_helpers.js +1 -1
- package/dist/vite_plugin_library_well_known.d.ts +2 -2
- package/dist/vite_plugin_library_well_known.js +1 -1
- package/package.json +6 -6
- package/src/lib/analysis_context.ts +8 -4
- package/src/lib/contextmenu_state.svelte.ts +3 -3
- package/src/lib/csp.ts +4 -4
- package/src/lib/docs_helpers.svelte.ts +1 -1
- package/src/lib/library.svelte.ts +4 -4
- package/src/lib/library_analysis.ts +5 -5
- package/src/lib/library_gen.ts +10 -8
- package/src/lib/library_generate.ts +2 -2
- package/src/lib/library_helpers.ts +5 -3
- package/src/lib/library_output.ts +7 -7
- package/src/lib/library_pipeline.ts +9 -5
- package/src/lib/logos.ts +15 -3
- package/src/lib/mdz.ts +10 -10
- package/src/lib/mdz_helpers.ts +3 -3
- package/src/lib/mdz_to_svelte.ts +4 -4
- package/src/lib/module.svelte.ts +1 -1
- package/src/lib/module_helpers.ts +3 -3
- package/src/lib/package_helpers.ts +12 -12
- package/src/lib/storage.ts +1 -1
- package/src/lib/svelte_helpers.ts +4 -4
- package/src/lib/svelte_preprocess_mdz.ts +15 -15
- package/src/lib/tome.ts +1 -1
- package/src/lib/ts_helpers.ts +9 -9
- package/src/lib/tsdoc_helpers.ts +1 -1
- package/src/lib/vite_plugin_library_well_known.ts +2 -2
package/dist/storage.js
CHANGED
|
@@ -20,7 +20,7 @@ export const save_to_storage = (key, value, is_json = false) => {
|
|
|
20
20
|
* @param key - the localStorage key
|
|
21
21
|
* @param is_json - whether to parse the value as JSON
|
|
22
22
|
* @param parse_fn - optional custom parsing function to transform the value
|
|
23
|
-
* @returns
|
|
23
|
+
* @returns the parsed value or null if not found or parsing fails
|
|
24
24
|
*/
|
|
25
25
|
export const load_from_storage = (key, is_json = false, parse_fn) => {
|
|
26
26
|
if (!BROWSER)
|
package/dist/svelte_helpers.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface SvelteFileAnalysis {
|
|
|
48
48
|
* @param checker - TypeScript type checker
|
|
49
49
|
* @param options - module source options for path extraction
|
|
50
50
|
* @param ctx - analysis context for collecting diagnostics
|
|
51
|
-
* @returns
|
|
51
|
+
* @returns module analysis matching `ModuleAnalysis` structure
|
|
52
52
|
*/
|
|
53
53
|
export declare const svelte_analyze_module: (source_file: SourceFileInfo, module_path: string, checker: ts.TypeChecker, options: ModuleSourceOptions, ctx: AnalysisContext) => ModuleAnalysis;
|
|
54
54
|
/**
|
|
@@ -65,7 +65,7 @@ export declare const svelte_analyze_module: (source_file: SourceFileInfo, module
|
|
|
65
65
|
* @param module_path - module path relative to source root (e.g., 'Alert.svelte')
|
|
66
66
|
* @param checker - TypeScript type checker for type resolution
|
|
67
67
|
* @param ctx - analysis context for collecting diagnostics
|
|
68
|
-
* @returns
|
|
68
|
+
* @returns component declaration and optional module-level comment
|
|
69
69
|
*/
|
|
70
70
|
export declare const svelte_analyze_file: (source_file: SourceFileInfo, module_path: string, checker: ts.TypeChecker, ctx: AnalysisContext) => SvelteFileAnalysis;
|
|
71
71
|
/**
|
|
@@ -85,8 +85,8 @@ export declare const svelte_extract_script_content: (svelte_source: string) => s
|
|
|
85
85
|
* Requires `@module` tag to identify module comments. The tag line is stripped
|
|
86
86
|
* from the output.
|
|
87
87
|
*
|
|
88
|
-
* @param script_content -
|
|
89
|
-
* @returns
|
|
88
|
+
* @param script_content - the content of the `<script>` tag
|
|
89
|
+
* @returns the cleaned module comment text, or undefined if none found
|
|
90
90
|
*/
|
|
91
91
|
export declare const svelte_extract_module_comment: (script_content: string) => string | undefined;
|
|
92
92
|
//# sourceMappingURL=svelte_helpers.d.ts.map
|
package/dist/svelte_helpers.js
CHANGED
|
@@ -58,7 +58,7 @@ const svelte_assert_version = () => {
|
|
|
58
58
|
* @param checker - TypeScript type checker
|
|
59
59
|
* @param options - module source options for path extraction
|
|
60
60
|
* @param ctx - analysis context for collecting diagnostics
|
|
61
|
-
* @returns
|
|
61
|
+
* @returns module analysis matching `ModuleAnalysis` structure
|
|
62
62
|
*/
|
|
63
63
|
export const svelte_analyze_module = (source_file, module_path, checker, options, ctx) => {
|
|
64
64
|
// Use the existing helper for core analysis
|
|
@@ -90,7 +90,7 @@ export const svelte_analyze_module = (source_file, module_path, checker, options
|
|
|
90
90
|
* @param module_path - module path relative to source root (e.g., 'Alert.svelte')
|
|
91
91
|
* @param checker - TypeScript type checker for type resolution
|
|
92
92
|
* @param ctx - analysis context for collecting diagnostics
|
|
93
|
-
* @returns
|
|
93
|
+
* @returns component declaration and optional module-level comment
|
|
94
94
|
*/
|
|
95
95
|
export const svelte_analyze_file = (source_file, module_path, checker, ctx) => {
|
|
96
96
|
svelte_assert_version();
|
|
@@ -172,8 +172,8 @@ export const svelte_extract_script_content = (svelte_source) => {
|
|
|
172
172
|
* Requires `@module` tag to identify module comments. The tag line is stripped
|
|
173
173
|
* from the output.
|
|
174
174
|
*
|
|
175
|
-
* @param script_content -
|
|
176
|
-
* @returns
|
|
175
|
+
* @param script_content - the content of the `<script>` tag
|
|
176
|
+
* @returns the cleaned module comment text, or undefined if none found
|
|
177
177
|
*/
|
|
178
178
|
export const svelte_extract_module_comment = (script_content) => {
|
|
179
179
|
// Parse the script content as TypeScript and reuse the shared extraction logic
|
|
@@ -26,18 +26,18 @@ export interface SveltePreprocessMdzOptions {
|
|
|
26
26
|
* Value: import path (e.g., '$lib/Alert.svelte').
|
|
27
27
|
*
|
|
28
28
|
* If mdz content references a component not in this map,
|
|
29
|
-
* that Mdz usage is skipped (left as runtime).
|
|
29
|
+
* that `Mdz` usage is skipped (left as runtime).
|
|
30
30
|
*/
|
|
31
31
|
components?: Record<string, string>;
|
|
32
32
|
/**
|
|
33
33
|
* Allowed HTML elements in mdz content.
|
|
34
34
|
* If mdz content references an element not in this list,
|
|
35
|
-
* that Mdz usage is skipped (left as runtime).
|
|
35
|
+
* that `Mdz` usage is skipped (left as runtime).
|
|
36
36
|
*/
|
|
37
37
|
elements?: Array<string>;
|
|
38
38
|
/**
|
|
39
|
-
* Import sources that resolve to the Mdz component.
|
|
40
|
-
* Used to verify that `Mdz` in templates refers to fuz_ui's Mdz.svelte
|
|
39
|
+
* Import sources that resolve to the `Mdz` component.
|
|
40
|
+
* Used to verify that `Mdz` in templates refers to fuz_ui's `Mdz.svelte`.
|
|
41
41
|
*
|
|
42
42
|
* @default ['@fuzdev/fuz_ui/Mdz.svelte']
|
|
43
43
|
*/
|
|
@@ -59,7 +59,7 @@ export interface SveltePreprocessMdzOptions {
|
|
|
59
59
|
* Creates a Svelte preprocessor that compiles static `Mdz` content at build time.
|
|
60
60
|
*
|
|
61
61
|
* @param options - configuration for component/element resolution and file filtering
|
|
62
|
-
* @returns
|
|
62
|
+
* @returns a Svelte `PreprocessorGroup` for use in `svelte.config.js`
|
|
63
63
|
*/
|
|
64
64
|
export declare const svelte_preprocess_mdz: (options?: SveltePreprocessMdzOptions) => PreprocessorGroup;
|
|
65
65
|
//# sourceMappingURL=svelte_preprocess_mdz.d.ts.map
|
|
@@ -25,7 +25,7 @@ const PRECOMPILED_NAME = 'MdzPrecompiled';
|
|
|
25
25
|
* Creates a Svelte preprocessor that compiles static `Mdz` content at build time.
|
|
26
26
|
*
|
|
27
27
|
* @param options - configuration for component/element resolution and file filtering
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns a Svelte `PreprocessorGroup` for use in `svelte.config.js`
|
|
29
29
|
*/
|
|
30
30
|
export const svelte_preprocess_mdz = (options = {}) => {
|
|
31
31
|
const { exclude = [], components = {}, elements: elements_array = [], component_imports = ['@fuzdev/fuz_ui/Mdz.svelte'], compiled_component_import = '@fuzdev/fuz_ui/MdzPrecompiled.svelte', on_error = process.env.CI === 'true' ? 'throw' : 'log', } = options;
|
|
@@ -328,7 +328,7 @@ const remove_dead_const_bindings = (s, ast, transformations, source) => {
|
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
330
|
/**
|
|
331
|
-
* Builds the replacement string for a transformed Mdz component.
|
|
331
|
+
* Builds the replacement string for a transformed `Mdz` component.
|
|
332
332
|
*
|
|
333
333
|
* Reconstructs the opening tag as `<MdzPrecompiled` with all attributes except `content`,
|
|
334
334
|
* using source text slicing to preserve exact formatting and dynamic expressions.
|
|
@@ -350,13 +350,13 @@ const build_replacement = (node, exclude_attrs, children_markup, source) => {
|
|
|
350
350
|
return `${opening}${children_markup}</${PRECOMPILED_NAME}>`;
|
|
351
351
|
};
|
|
352
352
|
/**
|
|
353
|
-
* Determines which Mdz import declarations can be safely removed or trimmed.
|
|
353
|
+
* Determines which `Mdz` import declarations can be safely removed or trimmed.
|
|
354
354
|
*
|
|
355
355
|
* An import is removable when:
|
|
356
356
|
* 1. All template usages of that name were successfully transformed.
|
|
357
357
|
* 2. The identifier is not referenced elsewhere in script or template expressions.
|
|
358
358
|
*
|
|
359
|
-
* For multi-specifier imports, only the Mdz specifier is removed (partial removal).
|
|
359
|
+
* For multi-specifier imports, only the `Mdz` specifier is removed (partial removal).
|
|
360
360
|
* For single-specifier imports, the entire declaration is removed.
|
|
361
361
|
*/
|
|
362
362
|
const find_removable_mdz_imports = (ast, mdz_names, total_usages, transformed_usages) => {
|
|
@@ -399,13 +399,13 @@ const find_removable_mdz_imports = (ast, mdz_names, total_usages, transformed_us
|
|
|
399
399
|
* Manages import additions and removals.
|
|
400
400
|
*
|
|
401
401
|
* Adds the `MdzPrecompiled` import and other required imports (DocsLink, Code, resolve).
|
|
402
|
-
* Removes Mdz import declarations that are no longer referenced.
|
|
402
|
+
* Removes `Mdz` import declarations that are no longer referenced.
|
|
403
403
|
*
|
|
404
404
|
* Handles both full removal (single-specifier imports) and partial removal
|
|
405
|
-
* (multi-specifier imports where only the Mdz specifier is removed).
|
|
405
|
+
* (multi-specifier imports where only the `Mdz` specifier is removed).
|
|
406
406
|
*
|
|
407
407
|
* To avoid MagicString boundary conflicts when the insertion position falls inside
|
|
408
|
-
* a removal range, one removable Mdz import is overwritten with the MdzPrecompiled
|
|
408
|
+
* a removal range, one removable `Mdz` import is overwritten with the `MdzPrecompiled`
|
|
409
409
|
* import line instead of using separate remove + appendLeft.
|
|
410
410
|
*/
|
|
411
411
|
const manage_imports = (s, ast, transformations, removable_imports, compiled_component_import, source) => {
|
package/dist/tome.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const Tome: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export type Tome = z.infer<typeof Tome>;
|
|
12
12
|
/**
|
|
13
|
-
* @param hash - URL fragment to append, with or without the
|
|
13
|
+
* @param hash - URL fragment to append, with or without the `#`
|
|
14
14
|
*/
|
|
15
15
|
export declare const to_tome_pathname: (item: Tome | string, docs_path?: string, hash?: string) => string;
|
|
16
16
|
export declare const tomes_context: {
|
package/dist/tome.js
CHANGED
|
@@ -13,7 +13,7 @@ export const Tome = z.object({
|
|
|
13
13
|
related_declarations: z.array(z.string()),
|
|
14
14
|
});
|
|
15
15
|
/**
|
|
16
|
-
* @param hash - URL fragment to append, with or without the
|
|
16
|
+
* @param hash - URL fragment to append, with or without the `#`
|
|
17
17
|
*/
|
|
18
18
|
export const to_tome_pathname = (item, docs_path = DOCS_PATH_DEFAULT, hash) => {
|
|
19
19
|
const name = typeof item === 'string' ? item : item.name;
|
package/dist/ts_helpers.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { DeclarationAnalysis, ReExportInfo, ModuleAnalysis } from './librar
|
|
|
18
18
|
export interface TsProgramOptions {
|
|
19
19
|
/** Project root directory. @default './' */
|
|
20
20
|
root?: string;
|
|
21
|
-
/** Path to tsconfig.json (relative to root). @default 'tsconfig.json' */
|
|
21
|
+
/** Path to `tsconfig.json` (relative to root). @default 'tsconfig.json' */
|
|
22
22
|
tsconfig?: string;
|
|
23
23
|
/** Override compiler options. */
|
|
24
24
|
compiler_options?: ts.CompilerOptions;
|
|
@@ -38,7 +38,7 @@ export interface ModuleExportsAnalysis {
|
|
|
38
38
|
module_comment?: string;
|
|
39
39
|
/** All exported declarations with nodocs flags - consumer filters based on policy. */
|
|
40
40
|
declarations: Array<DeclarationAnalysis>;
|
|
41
|
-
/** Same-name re-exports (for building also_exported_from in post-processing). */
|
|
41
|
+
/** Same-name re-exports (for building `also_exported_from` in post-processing). */
|
|
42
42
|
re_exports: Array<ReExportInfo>;
|
|
43
43
|
/** Star exports (`export * from './module'`) - module paths that are fully re-exported. */
|
|
44
44
|
star_exports: Array<string>;
|
|
@@ -48,8 +48,8 @@ export interface ModuleExportsAnalysis {
|
|
|
48
48
|
*
|
|
49
49
|
* @param options - configuration options for program creation
|
|
50
50
|
* @param log - optional logger for info messages
|
|
51
|
-
* @returns
|
|
52
|
-
* @throws Error if tsconfig.json is not found
|
|
51
|
+
* @returns the program and type checker
|
|
52
|
+
* @throws Error if `tsconfig.json` is not found
|
|
53
53
|
*/
|
|
54
54
|
export declare const ts_create_program: (options?: TsProgramOptions, log?: Logger) => TsProgram;
|
|
55
55
|
/**
|
|
@@ -67,7 +67,7 @@ export declare const ts_create_program: (options?: TsProgramOptions, log?: Logge
|
|
|
67
67
|
* @param checker - TypeScript type checker
|
|
68
68
|
* @param options - module source options for path extraction
|
|
69
69
|
* @param ctx - analysis context for collecting diagnostics
|
|
70
|
-
* @returns
|
|
70
|
+
* @returns module metadata and re-export information
|
|
71
71
|
*/
|
|
72
72
|
export declare const ts_analyze_module: (source_file_info: SourceFileInfo, ts_source_file: ts.SourceFile, module_path: string, checker: ts.TypeChecker, options: ModuleSourceOptions, ctx: AnalysisContext) => ModuleAnalysis;
|
|
73
73
|
/**
|
|
@@ -87,7 +87,7 @@ export declare const ts_analyze_module: (source_file_info: SourceFileInfo, ts_so
|
|
|
87
87
|
* @param checker - the TypeScript type checker
|
|
88
88
|
* @param options - module source options for path extraction in re-exports
|
|
89
89
|
* @param ctx - analysis context for collecting diagnostics
|
|
90
|
-
* @returns
|
|
90
|
+
* @returns module comment, declarations, re-exports, and star exports
|
|
91
91
|
*/
|
|
92
92
|
export declare const ts_analyze_module_exports: (source_file: ts.SourceFile, checker: ts.TypeChecker, options: ModuleSourceOptions, ctx: AnalysisContext) => ModuleExportsAnalysis;
|
|
93
93
|
/**
|
|
@@ -101,7 +101,7 @@ export declare const ts_analyze_module_exports: (source_file: ts.SourceFile, che
|
|
|
101
101
|
* @param source_file - the source file containing the symbol
|
|
102
102
|
* @param checker - the TypeScript type checker
|
|
103
103
|
* @param ctx - optional analysis context for collecting diagnostics
|
|
104
|
-
* @returns
|
|
104
|
+
* @returns complete declaration metadata including docs, types, and parameters, plus nodocs flag
|
|
105
105
|
*/
|
|
106
106
|
export declare const ts_analyze_declaration: (symbol: ts.Symbol, source_file: ts.SourceFile, checker: ts.TypeChecker, ctx: AnalysisContext) => DeclarationAnalysis;
|
|
107
107
|
/**
|
|
@@ -110,7 +110,7 @@ export declare const ts_analyze_declaration: (symbol: ts.Symbol, source_file: ts
|
|
|
110
110
|
* Requires `@module` tag to identify module comments. The tag line is stripped
|
|
111
111
|
* from the output. Supports optional module renaming: `@module custom-name`.
|
|
112
112
|
*
|
|
113
|
-
* @see https://typedoc.org/documents/Tags._module.html
|
|
113
|
+
* @see {@link https://typedoc.org/documents/Tags._module.html}
|
|
114
114
|
*/
|
|
115
115
|
export declare const ts_extract_module_comment: (source_file: ts.SourceFile) => string | undefined;
|
|
116
116
|
/**
|
|
@@ -133,7 +133,7 @@ export declare const ts_infer_declaration_kind: (symbol: ts.Symbol, node: ts.Nod
|
|
|
133
133
|
* @param sig - the TypeScript signature to extract parameters from
|
|
134
134
|
* @param checker - TypeScript type checker for type resolution
|
|
135
135
|
* @param tsdoc_params - map of parameter names to TSDoc descriptions (from tsdoc.params)
|
|
136
|
-
* @returns
|
|
136
|
+
* @returns array of parameter info objects
|
|
137
137
|
*/
|
|
138
138
|
export declare const ts_extract_signature_parameters: (sig: ts.Signature, checker: ts.TypeChecker, tsdoc_params: Map<string, string> | undefined) => Array<{
|
|
139
139
|
name: string;
|
package/dist/ts_helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ts_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EACX,eAAe,EAEf,eAAe,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAC,WAAW,EAAkD,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,cAAc,EAInB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAC,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"ts_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ts_helpers.ts"],"names":[],"mappings":"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"}
|
package/dist/ts_helpers.js
CHANGED
|
@@ -13,8 +13,8 @@ import { module_extract_dependencies, module_extract_path, module_is_source, } f
|
|
|
13
13
|
*
|
|
14
14
|
* @param options - configuration options for program creation
|
|
15
15
|
* @param log - optional logger for info messages
|
|
16
|
-
* @returns
|
|
17
|
-
* @throws Error if tsconfig.json is not found
|
|
16
|
+
* @returns the program and type checker
|
|
17
|
+
* @throws Error if `tsconfig.json` is not found
|
|
18
18
|
*/
|
|
19
19
|
export const ts_create_program = (options, log) => {
|
|
20
20
|
const root = options?.root ?? './';
|
|
@@ -48,7 +48,7 @@ export const ts_create_program = (options, log) => {
|
|
|
48
48
|
* @param checker - TypeScript type checker
|
|
49
49
|
* @param options - module source options for path extraction
|
|
50
50
|
* @param ctx - analysis context for collecting diagnostics
|
|
51
|
-
* @returns
|
|
51
|
+
* @returns module metadata and re-export information
|
|
52
52
|
*/
|
|
53
53
|
export const ts_analyze_module = (source_file_info, ts_source_file, module_path, checker, options, ctx) => {
|
|
54
54
|
// Use the mid-level helper for core analysis
|
|
@@ -82,7 +82,7 @@ export const ts_analyze_module = (source_file_info, ts_source_file, module_path,
|
|
|
82
82
|
* @param checker - the TypeScript type checker
|
|
83
83
|
* @param options - module source options for path extraction in re-exports
|
|
84
84
|
* @param ctx - analysis context for collecting diagnostics
|
|
85
|
-
* @returns
|
|
85
|
+
* @returns module comment, declarations, re-exports, and star exports
|
|
86
86
|
*/
|
|
87
87
|
export const ts_analyze_module_exports = (source_file, checker, options, ctx) => {
|
|
88
88
|
const declarations = [];
|
|
@@ -184,7 +184,7 @@ export const ts_analyze_module_exports = (source_file, checker, options, ctx) =>
|
|
|
184
184
|
* @param source_file - the source file containing the symbol
|
|
185
185
|
* @param checker - the TypeScript type checker
|
|
186
186
|
* @param ctx - optional analysis context for collecting diagnostics
|
|
187
|
-
* @returns
|
|
187
|
+
* @returns complete declaration metadata including docs, types, and parameters, plus nodocs flag
|
|
188
188
|
*/
|
|
189
189
|
export const ts_analyze_declaration = (symbol, source_file, checker, ctx) => {
|
|
190
190
|
const name = symbol.name;
|
|
@@ -227,7 +227,7 @@ export const ts_analyze_declaration = (symbol, source_file, checker, ctx) => {
|
|
|
227
227
|
* Requires `@module` tag to identify module comments. The tag line is stripped
|
|
228
228
|
* from the output. Supports optional module renaming: `@module custom-name`.
|
|
229
229
|
*
|
|
230
|
-
* @see https://typedoc.org/documents/Tags._module.html
|
|
230
|
+
* @see {@link https://typedoc.org/documents/Tags._module.html}
|
|
231
231
|
*/
|
|
232
232
|
export const ts_extract_module_comment = (source_file) => {
|
|
233
233
|
const full_text = source_file.getFullText();
|
|
@@ -328,7 +328,7 @@ export const ts_infer_declaration_kind = (symbol, node) => {
|
|
|
328
328
|
* @param sig - the TypeScript signature to extract parameters from
|
|
329
329
|
* @param checker - TypeScript type checker for type resolution
|
|
330
330
|
* @param tsdoc_params - map of parameter names to TSDoc descriptions (from tsdoc.params)
|
|
331
|
-
* @returns
|
|
331
|
+
* @returns array of parameter info objects
|
|
332
332
|
*/
|
|
333
333
|
export const ts_extract_signature_parameters = (sig, checker, tsdoc_params) => {
|
|
334
334
|
return sig.parameters.map((param) => {
|
package/dist/tsdoc_helpers.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export declare const tsdoc_apply_to_declaration: (declaration: DeclarationJson,
|
|
|
104
104
|
* Transforms `/** ... *\/` style comments into clean text.
|
|
105
105
|
*
|
|
106
106
|
* @param comment_text - the raw comment text including `/**` and `*\/` markers
|
|
107
|
-
* @returns
|
|
107
|
+
* @returns cleaned comment text, or undefined if empty after cleaning
|
|
108
108
|
*/
|
|
109
109
|
export declare const tsdoc_clean_comment: (comment_text: string) => string | undefined;
|
|
110
110
|
//# sourceMappingURL=tsdoc_helpers.d.ts.map
|
package/dist/tsdoc_helpers.js
CHANGED
|
@@ -183,7 +183,7 @@ export const tsdoc_apply_to_declaration = (declaration, tsdoc) => {
|
|
|
183
183
|
* Transforms `/** ... *\/` style comments into clean text.
|
|
184
184
|
*
|
|
185
185
|
* @param comment_text - the raw comment text including `/**` and `*\/` markers
|
|
186
|
-
* @returns
|
|
186
|
+
* @returns cleaned comment text, or undefined if empty after cleaning
|
|
187
187
|
*/
|
|
188
188
|
export const tsdoc_clean_comment = (comment_text) => {
|
|
189
189
|
const text = comment_text
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
export interface VitePluginLibraryWellKnownOptions {
|
|
3
3
|
/**
|
|
4
|
-
* Path to the library.json file (relative to vite.config.ts).
|
|
4
|
+
* Path to the `library.json` file (relative to `vite.config.ts`).
|
|
5
5
|
* @default './src/routes/library.json'
|
|
6
6
|
*/
|
|
7
7
|
library_path?: string;
|
|
@@ -9,7 +9,7 @@ export interface VitePluginLibraryWellKnownOptions {
|
|
|
9
9
|
/**
|
|
10
10
|
* Vite plugin that publishes `package.json` and `library.json` to `.well-known/`.
|
|
11
11
|
*
|
|
12
|
-
* Requires a generated library.json file (created by `library_gen` from `gro gen`).
|
|
12
|
+
* Requires a generated `library.json` file (created by `library_gen` from `gro gen`).
|
|
13
13
|
* The plugin reads this JSON file and publishes its metadata to `.well-known/` for
|
|
14
14
|
* both dev and production builds.
|
|
15
15
|
*
|
|
@@ -9,7 +9,7 @@ const respond_json = (res, body) => {
|
|
|
9
9
|
/**
|
|
10
10
|
* Vite plugin that publishes `package.json` and `library.json` to `.well-known/`.
|
|
11
11
|
*
|
|
12
|
-
* Requires a generated library.json file (created by `library_gen` from `gro gen`).
|
|
12
|
+
* Requires a generated `library.json` file (created by `library_gen` from `gro gen`).
|
|
13
13
|
* The plugin reads this JSON file and publishes its metadata to `.well-known/` for
|
|
14
14
|
* both dev and production builds.
|
|
15
15
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.191.
|
|
3
|
+
"version": "0.191.2",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
5
|
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "🧶",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@changesets/changelog-git": "^0.2.1",
|
|
83
83
|
"@fuzdev/fuz_code": "^0.45.1",
|
|
84
|
-
"@fuzdev/fuz_css": "^0.
|
|
84
|
+
"@fuzdev/fuz_css": "^0.58.0",
|
|
85
85
|
"@fuzdev/fuz_util": "^0.55.0",
|
|
86
|
-
"@fuzdev/gro": "^0.197.
|
|
86
|
+
"@fuzdev/gro": "^0.197.2",
|
|
87
87
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
88
88
|
"@ryanatkn/eslint-config": "^0.10.1",
|
|
89
89
|
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"jsdom": "^27.2.0",
|
|
101
101
|
"magic-string": "^0.30.21",
|
|
102
102
|
"prettier": "^3.7.4",
|
|
103
|
-
"prettier-plugin-svelte": "^3.
|
|
104
|
-
"svelte": "^5.
|
|
103
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
104
|
+
"svelte": "^5.54.1",
|
|
105
105
|
"svelte-check": "^4.4.5",
|
|
106
|
-
"svelte2tsx": "^0.7.
|
|
106
|
+
"svelte2tsx": "^0.7.52",
|
|
107
107
|
"tslib": "^2.8.1",
|
|
108
108
|
"typescript": "^5.9.3",
|
|
109
109
|
"typescript-eslint": "^8.48.1",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Analysis functions follow a two-tier error model:
|
|
10
10
|
*
|
|
11
|
-
* **Accumulated (non-fatal)** - Collected in AnalysisContext
|
|
11
|
+
* **Accumulated (non-fatal)** - Collected in `AnalysisContext`, analysis continues:
|
|
12
12
|
* - Type resolution failures (complex generics, circular refs)
|
|
13
13
|
* - Missing or unparseable JSDoc
|
|
14
14
|
* - Individual member/prop extraction failures
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
|
+
* ```ts
|
|
47
48
|
* const ctx = new AnalysisContext();
|
|
48
49
|
* // ... analysis functions add diagnostics via ctx.add(...)
|
|
49
50
|
* if (ctx.has_errors()) {
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
* console.error(`${err.file}:${err.line}: ${err.message}`);
|
|
52
53
|
* }
|
|
53
54
|
* }
|
|
55
|
+
* ```
|
|
54
56
|
*
|
|
55
57
|
* @module
|
|
56
58
|
*/
|
|
@@ -157,6 +159,7 @@ export type Diagnostic =
|
|
|
157
159
|
* report collected diagnostics.
|
|
158
160
|
*
|
|
159
161
|
* @example
|
|
162
|
+
* ```ts
|
|
160
163
|
* const ctx = new AnalysisContext();
|
|
161
164
|
* ts_analyze_module_exports(source_file, checker, options, ctx);
|
|
162
165
|
* if (ctx.has_errors()) {
|
|
@@ -165,12 +168,13 @@ export type Diagnostic =
|
|
|
165
168
|
* console.error(format_diagnostic(d));
|
|
166
169
|
* }
|
|
167
170
|
* }
|
|
171
|
+
* ```
|
|
168
172
|
*/
|
|
169
173
|
export class AnalysisContext {
|
|
170
174
|
readonly diagnostics: Array<Diagnostic> = [];
|
|
171
175
|
|
|
172
176
|
/**
|
|
173
|
-
* Add a
|
|
177
|
+
* Add a `Diagnostic` to the collection.
|
|
174
178
|
*/
|
|
175
179
|
add(diagnostic: Diagnostic): void {
|
|
176
180
|
this.diagnostics.push(diagnostic);
|
|
@@ -205,7 +209,7 @@ export class AnalysisContext {
|
|
|
205
209
|
}
|
|
206
210
|
|
|
207
211
|
/**
|
|
208
|
-
* Get diagnostics of a specific
|
|
212
|
+
* Get diagnostics of a specific `DiagnosticKind`.
|
|
209
213
|
*/
|
|
210
214
|
by_kind<K extends DiagnosticKind>(kind: K): Array<Extract<Diagnostic, {kind: K}>> {
|
|
211
215
|
return this.diagnostics.filter((d) => d.kind === kind) as Array<Extract<Diagnostic, {kind: K}>>;
|
|
@@ -227,7 +231,7 @@ export interface FormatDiagnosticOptions {
|
|
|
227
231
|
*
|
|
228
232
|
* @param diagnostic - the diagnostic to format
|
|
229
233
|
* @param options - formatting options
|
|
230
|
-
* @returns
|
|
234
|
+
* @returns formatted string like './file.ts:10:5: error: message'
|
|
231
235
|
*/
|
|
232
236
|
export const format_diagnostic = (
|
|
233
237
|
diagnostic: Diagnostic,
|
|
@@ -76,10 +76,10 @@ export interface ContextmenuStateOptions {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* Creates a
|
|
79
|
+
* Creates a contextmenu store.
|
|
80
80
|
* See usage with `ContextmenuRoot.svelte` and `Contextmenu.svelte`.
|
|
81
81
|
*
|
|
82
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event
|
|
82
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event}
|
|
83
83
|
*/
|
|
84
84
|
export class ContextmenuState {
|
|
85
85
|
layout: Dimensions; // TODO $state?
|
|
@@ -305,7 +305,7 @@ export class ContextmenuState {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
/**
|
|
308
|
-
* Used by `ContextmenuEntry` and custom entry components
|
|
308
|
+
* Used by `ContextmenuEntry.svelte` and custom entry components.
|
|
309
309
|
* @initializes
|
|
310
310
|
*/
|
|
311
311
|
add_entry(run: () => ContextmenuRun, disabled: () => boolean = () => false): EntryState {
|
package/src/lib/csp.ts
CHANGED
|
@@ -184,7 +184,7 @@ export type CspDirectiveValue<T extends CspDirective> = Defined<CspDirectives[T]
|
|
|
184
184
|
export const csp_trust_levels = ['low', 'medium', 'high'] as const;
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
|
-
* Numeric values for CSP trust levels
|
|
187
|
+
* Numeric values for CSP trust levels. See `csp_trust_levels`.
|
|
188
188
|
* Lower is less trusted.
|
|
189
189
|
* Includes `undefined` in the type for safety.
|
|
190
190
|
*/
|
|
@@ -265,7 +265,7 @@ export const COLOR_SCHEME_SCRIPT_HASH = 'sha256-QOxqn7EUzb3ydF9SALJoJGWSvywW9R0A
|
|
|
265
265
|
/**
|
|
266
266
|
* The base CSP directive defaults.
|
|
267
267
|
* Prioritizes safety but loosens around media and styles, relying on defense-in-depth.
|
|
268
|
-
* Customizable via `CreateCspDirectivesOptions
|
|
268
|
+
* Customizable via `CreateCspDirectivesOptions`.
|
|
269
269
|
*/
|
|
270
270
|
export const csp_directive_value_defaults: Record<
|
|
271
271
|
CspDirective,
|
|
@@ -336,9 +336,9 @@ export const csp_directive_required_trust_defaults: Record<CspDirective, CspTrus
|
|
|
336
336
|
* Fuz excludes deprecated directives, so those are intentionally omitted,
|
|
337
337
|
* but any newer missing directives are bugs.
|
|
338
338
|
*
|
|
339
|
-
* Could be
|
|
339
|
+
* Could be co-located but is currently here to keep that module smaller.
|
|
340
340
|
*
|
|
341
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy
|
|
341
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy}
|
|
342
342
|
*/
|
|
343
343
|
export const csp_directive_specs: Array<CspDirectiveSpec> = [
|
|
344
344
|
{
|
|
@@ -9,7 +9,7 @@ import {create_context} from './context_helpers.js';
|
|
|
9
9
|
* Unlike `slugify` from `@fuzdev/fuz_util/path.js` which lowercases,
|
|
10
10
|
* this keeps the original casing so API declarations like `AsyncStatus`
|
|
11
11
|
* and `async_status` produce distinct fragment IDs.
|
|
12
|
-
* Used by the Tome documentation system for heading and section anchors.
|
|
12
|
+
* Used by the `Tome` documentation system for heading and section anchors.
|
|
13
13
|
* @param str - the string to convert to a fragment
|
|
14
14
|
* @returns a URL-safe fragment identifier with case preserved
|
|
15
15
|
*/
|
|
@@ -17,10 +17,10 @@ export const parse_library_url_prefix = (value: unknown): string => {
|
|
|
17
17
|
* Rich runtime representation of a library.
|
|
18
18
|
*
|
|
19
19
|
* Wraps `LibraryJson` with computed properties and provides the root
|
|
20
|
-
* of the API documentation hierarchy: Library →
|
|
20
|
+
* of the API documentation hierarchy: `Library` → `Module` → `Declaration`.
|
|
21
21
|
*
|
|
22
|
-
* @see module.svelte.ts for Module class
|
|
23
|
-
* @see declaration.svelte.ts for Declaration class
|
|
22
|
+
* @see `module.svelte.ts` for `Module` class
|
|
23
|
+
* @see `declaration.svelte.ts` for `Declaration` class
|
|
24
24
|
*/
|
|
25
25
|
export class Library {
|
|
26
26
|
readonly library_json: LibraryJson = $state.raw()!;
|
|
@@ -58,7 +58,7 @@ export class Library {
|
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* All modules as rich Module instances.
|
|
61
|
+
* All modules as rich `Module` instances.
|
|
62
62
|
*/
|
|
63
63
|
readonly modules = $derived(
|
|
64
64
|
this.source_json.modules
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
* }
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
|
-
* @see ts_helpers.ts for TypeScript-specific analysis
|
|
40
|
-
* @see svelte_helpers.ts for Svelte component analysis
|
|
41
|
-
* @see module_helpers.ts for path utilities and SourceFileInfo
|
|
39
|
+
* @see `ts_helpers.ts` for TypeScript-specific analysis
|
|
40
|
+
* @see `svelte_helpers.ts` for Svelte component analysis
|
|
41
|
+
* @see `module_helpers.ts` for path utilities and `SourceFileInfo`
|
|
42
42
|
*
|
|
43
43
|
* @module
|
|
44
44
|
*/
|
|
@@ -63,7 +63,7 @@ import type {AnalysisContext} from './analysis_context.js';
|
|
|
63
63
|
export interface DeclarationAnalysis {
|
|
64
64
|
/** The analyzed declaration metadata. */
|
|
65
65
|
declaration: DeclarationJson;
|
|
66
|
-
/** Whether the declaration is marked
|
|
66
|
+
/** Whether the declaration is marked `@nodocs` (should be excluded from documentation). */
|
|
67
67
|
nodocs: boolean;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -118,7 +118,7 @@ export interface ModuleAnalysis {
|
|
|
118
118
|
* @param options - module source options for path extraction
|
|
119
119
|
* @param ctx - analysis context for collecting diagnostics
|
|
120
120
|
* @param log - optional logger for warnings
|
|
121
|
-
* @returns
|
|
121
|
+
* @returns module metadata and re-exports, or undefined if source file not found in program
|
|
122
122
|
*/
|
|
123
123
|
export const library_analyze_module = (
|
|
124
124
|
source_file: SourceFileInfo,
|
package/src/lib/library_gen.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* For build-tool agnostic usage, see `library_generate.ts`.
|
|
9
9
|
*
|
|
10
|
-
* @see library_generate.ts for the generic generation entry point
|
|
11
|
-
* @see library_pipeline.ts for pipeline helpers
|
|
12
|
-
* @see library_output.ts for output file generation
|
|
10
|
+
* @see `library_generate.ts` for the generic generation entry point
|
|
11
|
+
* @see `library_pipeline.ts` for pipeline helpers
|
|
12
|
+
* @see `library_output.ts` for output file generation
|
|
13
13
|
*
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
@@ -46,6 +46,7 @@ export interface LibraryGenOptions {
|
|
|
46
46
|
* Use `library_throw_on_duplicates` for strict flat namespace enforcement.
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
|
+
* ```ts
|
|
49
50
|
* // Throw on duplicates (strict flat namespace)
|
|
50
51
|
* library_gen({ on_duplicates: library_throw_on_duplicates });
|
|
51
52
|
*
|
|
@@ -57,12 +58,13 @@ export interface LibraryGenOptions {
|
|
|
57
58
|
* }
|
|
58
59
|
* }
|
|
59
60
|
* });
|
|
61
|
+
* ```
|
|
60
62
|
*/
|
|
61
63
|
on_duplicates?: OnDuplicatesCallback;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
|
-
* Convert Gro's Disknode to the build-tool agnostic SourceFileInfo interface.
|
|
67
|
+
* Convert Gro's `Disknode` to the build-tool agnostic `SourceFileInfo` interface.
|
|
66
68
|
*
|
|
67
69
|
* Use this when you want to analyze files using Gro's filer directly.
|
|
68
70
|
*
|
|
@@ -83,7 +85,7 @@ export const source_file_from_disknode = (disknode: Disknode): SourceFileInfo =>
|
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
|
-
* Collect source files from Gro disknodes, filtering BEFORE conversion to SourceFileInfo
|
|
88
|
+
* Collect source files from Gro disknodes, filtering BEFORE conversion to `SourceFileInfo`.
|
|
87
89
|
*
|
|
88
90
|
* This avoids errors from files outside source directories (like test fixtures that may
|
|
89
91
|
* have malformed paths or missing content). The filtering uses `module_is_source` which
|
|
@@ -129,12 +131,12 @@ export const library_collect_source_files_from_disknodes = (
|
|
|
129
131
|
};
|
|
130
132
|
|
|
131
133
|
/**
|
|
132
|
-
* Creates a Gen object for generating library metadata with full TypeScript analysis.
|
|
134
|
+
* Creates a `Gen` object for generating library metadata with full TypeScript analysis.
|
|
133
135
|
*
|
|
134
136
|
* This is the Gro-specific entry point. It handles:
|
|
135
137
|
* - Reading files from Gro's filer
|
|
136
|
-
* - Loading package.json via Gro utilities
|
|
137
|
-
* - Returning output in Gro's Gen format
|
|
138
|
+
* - Loading `package.json` via Gro utilities
|
|
139
|
+
* - Returning output in Gro's `Gen` format
|
|
138
140
|
*
|
|
139
141
|
* For build-tool agnostic usage, use `library_generate` directly.
|
|
140
142
|
*
|