@fuzdev/fuz_ui 0.194.0 → 0.195.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.
Files changed (61) hide show
  1. package/dist/DeclarationDetail.svelte +139 -64
  2. package/dist/DeclarationDetail.svelte.d.ts +9 -0
  3. package/dist/DeclarationDetail.svelte.d.ts.map +1 -1
  4. package/dist/LibraryDetail.svelte +14 -10
  5. package/dist/LibraryDetail.svelte.d.ts +7 -0
  6. package/dist/LibraryDetail.svelte.d.ts.map +1 -1
  7. package/dist/declaration.svelte.d.ts +233 -25
  8. package/dist/declaration.svelte.d.ts.map +1 -1
  9. package/dist/declaration.svelte.js +71 -23
  10. package/dist/library.svelte.js +1 -1
  11. package/dist/library_gen.d.ts +24 -17
  12. package/dist/library_gen.d.ts.map +1 -1
  13. package/dist/library_gen.js +52 -32
  14. package/dist/library_output.d.ts +5 -4
  15. package/dist/library_output.d.ts.map +1 -1
  16. package/dist/library_output.js +11 -8
  17. package/dist/module.svelte.d.ts +21 -7
  18. package/dist/module.svelte.d.ts.map +1 -1
  19. package/dist/module.svelte.js +26 -11
  20. package/dist/tsdoc_mdz.d.ts +6 -1
  21. package/dist/tsdoc_mdz.d.ts.map +1 -1
  22. package/dist/tsdoc_mdz.js +23 -2
  23. package/package.json +10 -8
  24. package/src/lib/declaration.svelte.ts +90 -35
  25. package/src/lib/library.svelte.ts +1 -1
  26. package/src/lib/library_gen.ts +65 -42
  27. package/src/lib/library_output.ts +11 -8
  28. package/src/lib/module.svelte.ts +29 -16
  29. package/src/lib/tsdoc_mdz.ts +25 -2
  30. package/dist/analysis_context.d.ts +0 -199
  31. package/dist/analysis_context.d.ts.map +0 -1
  32. package/dist/analysis_context.js +0 -138
  33. package/dist/library_analysis.d.ts +0 -112
  34. package/dist/library_analysis.d.ts.map +0 -1
  35. package/dist/library_analysis.js +0 -106
  36. package/dist/library_generate.d.ts +0 -94
  37. package/dist/library_generate.d.ts.map +0 -1
  38. package/dist/library_generate.js +0 -147
  39. package/dist/library_pipeline.d.ts +0 -113
  40. package/dist/library_pipeline.d.ts.map +0 -1
  41. package/dist/library_pipeline.js +0 -160
  42. package/dist/module_helpers.d.ts +0 -334
  43. package/dist/module_helpers.d.ts.map +0 -1
  44. package/dist/module_helpers.js +0 -317
  45. package/dist/svelte_helpers.d.ts +0 -92
  46. package/dist/svelte_helpers.d.ts.map +0 -1
  47. package/dist/svelte_helpers.js +0 -367
  48. package/dist/ts_helpers.d.ts +0 -181
  49. package/dist/ts_helpers.d.ts.map +0 -1
  50. package/dist/ts_helpers.js +0 -674
  51. package/dist/tsdoc_helpers.d.ts +0 -119
  52. package/dist/tsdoc_helpers.d.ts.map +0 -1
  53. package/dist/tsdoc_helpers.js +0 -207
  54. package/src/lib/analysis_context.ts +0 -254
  55. package/src/lib/library_analysis.ts +0 -168
  56. package/src/lib/library_generate.ts +0 -215
  57. package/src/lib/library_pipeline.ts +0 -221
  58. package/src/lib/module_helpers.ts +0 -501
  59. package/src/lib/svelte_helpers.ts +0 -539
  60. package/src/lib/ts_helpers.ts +0 -862
  61. package/src/lib/tsdoc_helpers.ts +0 -246
@@ -1,25 +1,32 @@
1
1
  /**
2
2
  * Gro-specific library metadata generation.
3
3
  *
4
- * This module provides Gro integration for library generation. It wraps the generic
5
- * `library_generate` function with Gro's `Gen` interface and provides adapters for
6
- * converting Gro's `Disknode` to the build-tool agnostic `SourceFileInfo`.
4
+ * This module provides Gro integration for library generation. It uses svelte-docinfo's
5
+ * pure analysis (`analyze`) and wraps the results with fuz_ui's opinionated
6
+ * LibraryJson format (GitHub/npm metadata).
7
7
  *
8
- * For build-tool agnostic usage, see `library_generate.ts`.
8
+ * For build-tool agnostic usage, see `svelte-docinfo`.
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 svelte-docinfo/analyze.js for the generic analysis entry point
11
+ * @see svelte-docinfo/postprocess.js for post-processing helpers
12
+ * @see library_output.js for output file generation
13
13
  *
14
14
  * @module
15
15
  */
16
16
  import { package_json_load } from '@fuzdev/gro/package_json.js';
17
- import { module_create_source_options, module_validate_source_options, module_is_source, module_get_source_root, } from './module_helpers.js';
18
- import { library_generate } from './library_generate.js';
17
+ import { analyze, createSourceOptions, } from 'svelte-docinfo';
18
+ import { normalizeSourceOptions, isSource, getSourceRoot } from 'svelte-docinfo/source-config.js';
19
+ import { library_generate_output } from './library_output.js';
19
20
  /**
20
21
  * Convert Gro's `Disknode` to the build-tool agnostic `SourceFileInfo` interface.
21
22
  *
22
- * Use this when you want to analyze files using Gro's filer directly.
23
+ * Use this when you want to analyze files using Gro's filer directly. The
24
+ * `dependencies` field is populated from the filer's forward-edge graph — the
25
+ * svelte-docinfo session honors it as pre-resolved input and skips its own
26
+ * lex+resolve pass for these files, avoiding duplicate work the filer already did.
27
+ *
28
+ * Reverse edges (`dependents`) are not threaded through — svelte-docinfo
29
+ * computes them internally from the forward edges of the owned set.
23
30
  *
24
31
  * @throws Error if disknode has no content (should be loaded by Gro filer)
25
32
  */
@@ -31,14 +38,13 @@ export const source_file_from_disknode = (disknode) => {
31
38
  id: disknode.id,
32
39
  content: disknode.contents,
33
40
  dependencies: [...disknode.dependencies.keys()],
34
- dependents: [...disknode.dependents.keys()],
35
41
  };
36
42
  };
37
43
  /**
38
44
  * Collect source files from Gro disknodes, filtering BEFORE conversion to `SourceFileInfo`.
39
45
  *
40
46
  * This avoids errors from files outside source directories (like test fixtures that may
41
- * have malformed paths or missing content). The filtering uses `module_is_source` which
47
+ * have malformed paths or missing content). The filtering uses `isSource` which
42
48
  * checks `source_paths` to only include files in configured source directories.
43
49
  *
44
50
  * @param disknodes - iterator of Gro disknodes from filer
@@ -46,22 +52,24 @@ export const source_file_from_disknode = (disknode) => {
46
52
  * @param log - optional logger for status messages
47
53
  */
48
54
  export const library_collect_source_files_from_disknodes = (disknodes, options, log) => {
49
- // Validate options early to fail fast on misconfiguration
50
- module_validate_source_options(options);
55
+ // Normalize options (throws on invalid config) and use the normalized form
56
+ // for downstream `isSource` / `getSourceRoot` calls, so callers that pass
57
+ // raw options (not via `createSourceOptions`) get consistent path handling.
58
+ const normalized_options = normalizeSourceOptions(options);
51
59
  const all_disknodes = Array.from(disknodes);
52
60
  log?.info(`received ${all_disknodes.length} files total from filer`);
53
61
  const source_files = [];
54
62
  for (const disknode of all_disknodes) {
55
63
  // Filter by source_paths BEFORE trying to convert
56
64
  // This avoids errors from test fixtures or other non-source files
57
- if (!module_is_source(disknode.id, options)) {
65
+ if (!isSource(disknode.id, normalized_options)) {
58
66
  continue;
59
67
  }
60
68
  source_files.push(source_file_from_disknode(disknode));
61
69
  }
62
70
  log?.info(`found ${source_files.length} source files to analyze`);
63
71
  if (source_files.length === 0) {
64
- const effective_root = module_get_source_root(options);
72
+ const effective_root = getSourceRoot(normalized_options);
65
73
  log?.warn(`No source files found in ${effective_root} - generating empty library metadata`);
66
74
  return [];
67
75
  }
@@ -74,10 +82,12 @@ export const library_collect_source_files_from_disknodes = (disknodes, options,
74
82
  *
75
83
  * This is the Gro-specific entry point. It handles:
76
84
  * - Reading files from Gro's filer
77
- * - Loading `package.json` via Gro utilities
78
- * - Returning output in Gro's `Gen` format
85
+ * - Loading package.json via Gro utilities
86
+ * - Analyzing source with svelte-docinfo (pure analysis)
87
+ * - Wrapping with LibraryJson (GitHub/npm metadata)
88
+ * - Returning output in Gro's Gen format
79
89
  *
80
- * For build-tool agnostic usage, use `library_generate` directly.
90
+ * For build-tool agnostic usage, use `analyze` directly.
81
91
  *
82
92
  * Usage in a `.gen.ts` file:
83
93
  *
@@ -95,29 +105,39 @@ export const library_gen = (options) => {
95
105
  generate: async ({ log, filer }) => {
96
106
  log.info('generating library metadata with full TypeScript analysis...');
97
107
  // Build source options with project_root from cwd
98
- const source_options = options?.source && 'project_root' in options.source
108
+ const source_options = options?.source && 'projectRoot' in options.source
99
109
  ? options.source
100
- : module_create_source_options(process.cwd(), options?.source);
110
+ : createSourceOptions(process.cwd(), options?.source);
101
111
  // Ensure filer is initialized
102
112
  await filer.init();
103
113
  // Read package.json
104
114
  const package_json = await package_json_load();
105
115
  // Collect source files from Gro filer
106
116
  const source_files = library_collect_source_files_from_disknodes(filer.files.values(), source_options, log);
107
- // Use generic library_generate for the actual work
108
- const result = library_generate({
109
- source_files,
110
- package_json,
111
- source_options,
112
- on_duplicates: options?.on_duplicates,
113
- log,
117
+ // Get pure analysis from svelte-docinfo (no package metadata).
118
+ const { modules } = await analyze({
119
+ sourceFiles: source_files,
120
+ sourceOptions: source_options,
121
+ onDuplicates: options?.on_duplicates,
122
+ log: log, // Type cast needed due to workspace dependency duplication
114
123
  });
124
+ if (!package_json.version) {
125
+ throw new Error('package.json is missing required "version" field');
126
+ }
127
+ // Wrap modules with package metadata (fuz_ui's own SourceJson type)
128
+ const source_json = {
129
+ name: package_json.name,
130
+ version: package_json.version,
131
+ repository: typeof package_json.repository === 'string'
132
+ ? package_json.repository
133
+ : package_json.repository?.url,
134
+ modules: modules, // TODO: remove cast when fuz_util SourceJson uses svelte-docinfo types
135
+ };
136
+ // Generate output files with fuz_ui's LibraryJson wrapper
137
+ const { json_content, ts_content } = library_generate_output(package_json, source_json);
115
138
  log.info('library metadata generation complete');
116
139
  // Return array of files in Gro's expected format
117
- return [
118
- { content: result.ts_content },
119
- { content: result.json_content, filename: 'library.json' },
120
- ];
140
+ return [{ content: ts_content }, { content: json_content, filename: 'library.json' }];
121
141
  },
122
142
  };
123
143
  };
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Library output generation.
3
3
  *
4
- * Generates the `library.json` and `library.ts` files from analyzed metadata.
4
+ * Generates the library.json and library.ts files from analyzed metadata.
5
+ * Uses svelte-docinfo's `compactReplacer` to strip Zod default values
6
+ * (empty arrays, false booleans) for compact JSON output.
5
7
  *
6
- * @see `library_generate.ts` for the main generation entry point
7
- * @see `library_pipeline.ts` for pipeline orchestration functions
8
- * @see `library_gen.ts` for Gro-specific integration
8
+ * @see `library_gen.ts` for the main generation entry point
9
+ * @see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
9
10
  *
10
11
  * @module
11
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"library_output.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAGhE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,cAAc,WAAW,EACzB,aAAa,UAAU,KACrB,mBAuBF,CAAC"}
1
+ {"version":3,"file":"library_output.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAIhE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,cAAc,WAAW,EACzB,aAAa,UAAU,KACrB,mBAwBF,CAAC"}
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * Library output generation.
3
3
  *
4
- * Generates the `library.json` and `library.ts` files from analyzed metadata.
4
+ * Generates the library.json and library.ts files from analyzed metadata.
5
+ * Uses svelte-docinfo's `compactReplacer` to strip Zod default values
6
+ * (empty arrays, false booleans) for compact JSON output.
5
7
  *
6
- * @see `library_generate.ts` for the main generation entry point
7
- * @see `library_pipeline.ts` for pipeline orchestration functions
8
- * @see `library_gen.ts` for Gro-specific integration
8
+ * @see `library_gen.ts` for the main generation entry point
9
+ * @see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
9
10
  *
10
11
  * @module
11
12
  */
12
13
  import { library_json_parse } from '@fuzdev/fuz_util/library_json.js';
14
+ import { compactReplacer } from 'svelte-docinfo';
13
15
  /**
14
16
  * Generate the `library.json` and `library.ts` file contents.
15
17
  * Parses at generation time so runtime only needs the pre-computed result.
@@ -21,15 +23,16 @@ import { library_json_parse } from '@fuzdev/fuz_util/library_json.js';
21
23
  * (JSON imports get widened types like `string` instead of literal unions)
22
24
  */
23
25
  export const library_generate_output = (package_json, source_json) => {
24
- const is_this_fuz_util = package_json.name === '@fuzdev/fuz_util';
25
- const fuz_util_prefix = is_this_fuz_util ? './' : '@fuzdev/fuz_util/';
26
+ // Compact source_json (strips Zod default values like empty arrays and false booleans)
27
+ // Only applied to source_json, not the outer library_json package metadata
28
+ const compacted_source_json = JSON.parse(JSON.stringify(source_json, compactReplacer));
26
29
  // Parse at generation time, not runtime
27
- const library_json = library_json_parse(package_json, source_json);
30
+ const library_json = library_json_parse(package_json, compacted_source_json);
28
31
  const json_content = JSON.stringify(library_json, null, '\t') + '\n';
29
32
  const banner = '// generated by library.gen.ts - do not edit';
30
33
  const ts_content = `${banner}
31
34
 
32
- import type {LibraryJson} from '${fuz_util_prefix}library_json.js';
35
+ import type {LibraryJson} from '@fuzdev/fuz_util/library_json.js';
33
36
 
34
37
  import json from './library.json' with {type: 'json'};
35
38
 
@@ -1,14 +1,28 @@
1
- import type { ModuleJson } from '@fuzdev/fuz_util/source_json.js';
1
+ import type { ModuleJsonInput } from 'svelte-docinfo/types.js';
2
2
  import { Declaration } from './declaration.svelte.js';
3
3
  import type { Library } from './library.svelte.js';
4
4
  /**
5
5
  * Rich runtime representation of a module with computed properties.
6
+ *
7
+ * Wraps svelte-docinfo's `ModuleJson` with reactive derivations,
8
+ * URL generation, and `Declaration` instances.
9
+ *
10
+ * @see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
11
+ * @see `declaration.svelte.ts` for the `Declaration` wrapper class
6
12
  */
7
13
  export declare class Module {
8
14
  readonly library: Library;
9
- readonly module_json: ModuleJson;
10
- /**
11
- * Canonical module path (e.g., 'Alert.ts', 'helpers/foo.ts').
15
+ readonly module_json: ModuleJsonInput;
16
+ /**
17
+ * Canonical module path — `src/lib/`-relative, with source extension
18
+ * (`.ts`, `.svelte`, etc.). Examples: `'Alert.ts'`, `'helpers/foo.ts'`,
19
+ * `'actions/composables.ts'`.
20
+ *
21
+ * This is the key `Library.module_by_path` indexes, so it's also the
22
+ * exact string TSDoc backtick references must use to auto-link to a
23
+ * module via `DocsLink.svelte` (e.g., `` `actions/composables.ts` ``).
24
+ * A leading `./` or a `.js` runtime extension will not match. Top-level
25
+ * files match by bare filename; nested files require the full sub-path.
12
26
  */
13
27
  path: string;
14
28
  /**
@@ -33,12 +47,12 @@ export declare class Module {
33
47
  /**
34
48
  * Modules this imports (paths relative to src/lib).
35
49
  */
36
- dependencies: string[] | undefined;
50
+ dependencies: string[];
37
51
  /**
38
52
  * Modules that import this (paths relative to src/lib).
39
53
  */
40
- dependents: string[] | undefined;
41
- constructor(library: Library, module_json: ModuleJson);
54
+ dependents: string[];
55
+ constructor(library: Library, module_json: ModuleJsonInput);
42
56
  /**
43
57
  * Look up a declaration by name within this module.
44
58
  */
@@ -1 +1 @@
1
- {"version":3,"file":"module.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/module.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGjD;;GAEG;AACH,qBAAa,MAAM;IAClB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAiB;IAC1C,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAiB;IAEjD;;OAEG;IACH,IAAI,SAAmC;IAEvC;;OAEG;IACH,WAAW,SAA8B;IAEzC,cAAc,qBAA6C;IAE3D;;OAEG;IACH,YAAY,gBAMV;IAEF;;OAEG;IACH,OAAO,SAAgE;IAEvE;;OAEG;IACH,UAAU,qBAIR;IAEF,gBAAgB,EAAE,OAAO,CAEvB;IAEF,kBAAkB,EAAE,OAAO,CAA+C;IAE1E;;OAEG;IACH,YAAY,uBAA2C;IAEvD;;OAEG;IACH,UAAU,uBAAyC;gBAEvC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU;IAKrD;;OAEG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;CAG9D"}
1
+ {"version":3,"file":"module.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/module.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGjD;;;;;;;;GAQG;AACH,qBAAa,MAAM;IAClB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAiB;IAI1C,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAiB;IAEtD;;;;;;;;;;OAUG;IACH,IAAI,SAAmC;IAEvC;;OAEG;IACH,WAAW,SAA8B;IAEzC,cAAc,qBAA4C;IAE1D;;OAEG;IACH,YAAY,gBAIV;IAEF;;OAEG;IACH,OAAO,SAAgE;IAEvE;;OAEG;IACH,UAAU,qBAIR;IAEF,gBAAgB,EAAE,OAAO,CAA8D;IAEvF,kBAAkB,EAAE,OAAO,CAAmC;IAE9D;;OAEG;IACH,YAAY,WAAiD;IAE7D;;OAEG;IACH,UAAU,WAA+C;gBAE7C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe;IAK1D;;OAEG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;CAG9D"}
@@ -2,27 +2,42 @@ import { Declaration } from './declaration.svelte.js';
2
2
  import { url_github_file } from './package_helpers.js';
3
3
  /**
4
4
  * Rich runtime representation of a module with computed properties.
5
+ *
6
+ * Wraps svelte-docinfo's `ModuleJson` with reactive derivations,
7
+ * URL generation, and `Declaration` instances.
8
+ *
9
+ * @see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
10
+ * @see `declaration.svelte.ts` for the `Declaration` wrapper class
5
11
  */
6
12
  export class Module {
7
13
  library = $state.raw();
14
+ // `library.json` is compacted (svelte-docinfo's `compactReplacer` strips empty
15
+ // default arrays), so the on-disk data is the `*Input` shape. Typing it as
16
+ // input makes TypeScript force guards on defaulted-array reads.
8
17
  module_json = $state.raw();
9
18
  /**
10
- * Canonical module path (e.g., 'Alert.ts', 'helpers/foo.ts').
19
+ * Canonical module path — `src/lib/`-relative, with source extension
20
+ * (`.ts`, `.svelte`, etc.). Examples: `'Alert.ts'`, `'helpers/foo.ts'`,
21
+ * `'actions/composables.ts'`.
22
+ *
23
+ * This is the key `Library.module_by_path` indexes, so it's also the
24
+ * exact string TSDoc backtick references must use to auto-link to a
25
+ * module via `DocsLink.svelte` (e.g., `` `actions/composables.ts` ``).
26
+ * A leading `./` or a `.js` runtime extension will not match. Top-level
27
+ * files match by bare filename; nested files require the full sub-path.
11
28
  */
12
29
  path = $derived(this.module_json.path);
13
30
  /**
14
31
  * Import-style path with ./ prefix.
15
32
  */
16
33
  path_import = $derived('./' + this.path);
17
- module_comment = $derived(this.module_json.module_comment);
34
+ module_comment = $derived(this.module_json.moduleComment);
18
35
  /**
19
36
  * Array of `Declaration` instances. Filters out default exports.
20
37
  */
21
- declarations = $derived(this.module_json.declarations
22
- ? this.module_json.declarations
23
- .filter((declaration_json) => declaration_json.name !== 'default')
24
- .map((declaration_json) => new Declaration(this, declaration_json))
25
- : []);
38
+ declarations = $derived((this.module_json.declarations ?? [])
39
+ .filter((declaration_json) => declaration_json.name !== 'default')
40
+ .map((declaration_json) => new Declaration(this, declaration_json)));
26
41
  /**
27
42
  * API documentation URL for this module.
28
43
  */
@@ -33,16 +48,16 @@ export class Module {
33
48
  url_github = $derived(this.library.repo_url
34
49
  ? url_github_file(this.library.repo_url, `src/lib/${this.path}`)
35
50
  : undefined);
36
- has_declarations = $derived(!!(this.module_json.declarations && this.module_json.declarations.length > 0));
37
- has_module_comment = $derived(!!this.module_json.module_comment);
51
+ has_declarations = $derived((this.module_json.declarations?.length ?? 0) > 0);
52
+ has_module_comment = $derived(!!this.module_comment);
38
53
  /**
39
54
  * Modules this imports (paths relative to src/lib).
40
55
  */
41
- dependencies = $derived(this.module_json.dependencies);
56
+ dependencies = $derived(this.module_json.dependencies ?? []);
42
57
  /**
43
58
  * Modules that import this (paths relative to src/lib).
44
59
  */
45
- dependents = $derived(this.module_json.dependents);
60
+ dependents = $derived(this.module_json.dependents ?? []);
46
61
  constructor(library, module_json) {
47
62
  this.library = library;
48
63
  this.module_json = module_json;
@@ -11,10 +11,12 @@
11
11
  * Convert raw TSDoc `@see` content to mdz format for rendering.
12
12
  *
13
13
  * Handles TSDoc link syntax:
14
- * - `{@link url|text}` → `[text](url)` (markdown link)
14
+ * - `{@link url|text}` → `[text](url)` (markdown link, TSDoc canonical form)
15
+ * - `{@link url text}` → `[text](url)` (TS-lenient space-separated form)
15
16
  * - `{@link https://...}` → `https://...` (bare URL, auto-linked by mdz)
16
17
  * - `{@link identifier}` → `` `identifier` `` (code formatting)
17
18
  * - Bare URLs → returned as-is
19
+ * - Bare markdown links (`[text](url)` ...) → returned as-is
18
20
  * - Bare identifiers → wrapped in backticks
19
21
  * - `identifier description text` → `` `identifier` description text `` (first token is the reference)
20
22
  *
@@ -32,6 +34,9 @@
32
34
  * tsdoc_see_to_mdz('https://example.com')
33
35
  * // → 'https://example.com'
34
36
  *
37
+ * tsdoc_see_to_mdz('[svelte-docinfo](https://github.com/ryanatkn/svelte-docinfo) for the analysis library')
38
+ * // → '[svelte-docinfo](https://github.com/ryanatkn/svelte-docinfo) for the analysis library'
39
+ *
35
40
  * tsdoc_see_to_mdz('library_gen.ts for Gro-specific integration')
36
41
  * // → '`library_gen.ts` for Gro-specific integration'
37
42
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"tsdoc_mdz.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/tsdoc_mdz.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MA6BlD,CAAC"}
1
+ {"version":3,"file":"tsdoc_mdz.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/tsdoc_mdz.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MA+ClD,CAAC"}
package/dist/tsdoc_mdz.js CHANGED
@@ -14,10 +14,12 @@ const format_reference = (ref) => (mdz_is_url(ref) ? ref : `\`${ref}\``);
14
14
  * Convert raw TSDoc `@see` content to mdz format for rendering.
15
15
  *
16
16
  * Handles TSDoc link syntax:
17
- * - `{@link url|text}` → `[text](url)` (markdown link)
17
+ * - `{@link url|text}` → `[text](url)` (markdown link, TSDoc canonical form)
18
+ * - `{@link url text}` → `[text](url)` (TS-lenient space-separated form)
18
19
  * - `{@link https://...}` → `https://...` (bare URL, auto-linked by mdz)
19
20
  * - `{@link identifier}` → `` `identifier` `` (code formatting)
20
21
  * - Bare URLs → returned as-is
22
+ * - Bare markdown links (`[text](url)` ...) → returned as-is
21
23
  * - Bare identifiers → wrapped in backticks
22
24
  * - `identifier description text` → `` `identifier` description text `` (first token is the reference)
23
25
  *
@@ -35,6 +37,9 @@ const format_reference = (ref) => (mdz_is_url(ref) ? ref : `\`${ref}\``);
35
37
  * tsdoc_see_to_mdz('https://example.com')
36
38
  * // → 'https://example.com'
37
39
  *
40
+ * tsdoc_see_to_mdz('[svelte-docinfo](https://github.com/ryanatkn/svelte-docinfo) for the analysis library')
41
+ * // → '[svelte-docinfo](https://github.com/ryanatkn/svelte-docinfo) for the analysis library'
42
+ *
38
43
  * tsdoc_see_to_mdz('library_gen.ts for Gro-specific integration')
39
44
  * // → '`library_gen.ts` for Gro-specific integration'
40
45
  * ```
@@ -47,15 +52,31 @@ export const tsdoc_see_to_mdz = (content) => {
47
52
  const link_match = /^\{@(?:link|see)\s+([^}]+)\}$/.exec(trimmed);
48
53
  if (link_match) {
49
54
  const inner = link_match[1].trim();
50
- // Check for pipe separator (custom display text)
55
+ // Pipe separator takes precedence (TSDoc canonical form)
51
56
  const pipe_index = inner.indexOf('|');
52
57
  if (pipe_index !== -1) {
53
58
  const reference = inner.slice(0, pipe_index).trim();
54
59
  const display_text = inner.slice(pipe_index + 1).trim();
55
60
  return `[${display_text}](${reference})`;
56
61
  }
62
+ // Space-separated form: TS accepts `{@link url text}` as equivalent to `{@link url|text}`.
63
+ // Only treat space as a separator when the first token looks like a link target (URL),
64
+ // so identifier-style references like `module.function` aren't split.
65
+ const space_index = inner.indexOf(' ');
66
+ if (space_index !== -1) {
67
+ const reference = inner.slice(0, space_index);
68
+ if (mdz_is_url(reference)) {
69
+ const display_text = inner.slice(space_index + 1).trim();
70
+ return `[${display_text}](${reference})`;
71
+ }
72
+ }
57
73
  return format_reference(inner);
58
74
  }
75
+ // Pass through bare markdown links (`[text](url)` optionally followed by description)
76
+ // so authors can write `@see [text](url) for context` directly.
77
+ if (trimmed.charCodeAt(0) === 91 /* [ */ && /^\[[^\]]+\]\([^)\s]+\)/.test(trimmed)) {
78
+ return trimmed;
79
+ }
59
80
  // Split at first whitespace: first token is the reference, rest is description
60
81
  const space_index = trimmed.indexOf(' ');
61
82
  if (space_index === -1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_ui",
3
- "version": "0.194.0",
3
+ "version": "0.195.1",
4
4
  "description": "Svelte UI library",
5
5
  "tagline": "friendly user zystem",
6
6
  "glyph": "🧶",
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "type": "module",
35
35
  "engines": {
36
- "node": ">=22.15"
36
+ "node": ">=24.14"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@fuzdev/fuz_code": ">=0.45.1",
40
40
  "@fuzdev/fuz_css": ">=0.53.0",
41
- "@fuzdev/fuz_util": ">=0.52.0",
42
- "@fuzdev/gro": ">=0.195.0",
41
+ "@fuzdev/fuz_util": ">=0.61.1",
42
+ "@fuzdev/gro": ">=0.199.1",
43
43
  "@jridgewell/trace-mapping": "^0.3",
44
44
  "@sveltejs/kit": "^2.47.3",
45
45
  "@types/estree": "^1",
@@ -80,6 +80,7 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@changesets/changelog-git": "^0.2.1",
83
+ "@fuzdev/blake3_wasm": "^0.1.0",
83
84
  "@fuzdev/fuz_code": "^0.45.1",
84
85
  "@fuzdev/fuz_css": "^0.60.0",
85
86
  "@fuzdev/fuz_util": "^0.61.1",
@@ -88,7 +89,7 @@
88
89
  "@ryanatkn/eslint-config": "^0.12.1",
89
90
  "@sveltejs/acorn-typescript": "^1.0.9",
90
91
  "@sveltejs/adapter-static": "^3.0.10",
91
- "@sveltejs/kit": "^2.55.0",
92
+ "@sveltejs/kit": "^2.61.1",
92
93
  "@sveltejs/package": "^2.5.7",
93
94
  "@sveltejs/vite-plugin-svelte": "^6.2.4",
94
95
  "@types/estree": "^1.0.8",
@@ -101,9 +102,10 @@
101
102
  "magic-string": "^0.30.21",
102
103
  "prettier": "^3.7.4",
103
104
  "prettier-plugin-svelte": "^3.5.1",
104
- "svelte": "^5.55.0",
105
- "svelte-check": "^4.4.5",
106
- "svelte2tsx": "^0.7.52",
105
+ "svelte": "^5.55.10",
106
+ "svelte-check": "^4.4.8",
107
+ "svelte-docinfo": "^0.1.0",
108
+ "svelte2tsx": "^0.7.55",
107
109
  "tslib": "^2.8.1",
108
110
  "typescript": "^5.9.3",
109
111
  "typescript-eslint": "^8.48.1",