Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,22 +294,40 @@ library and API (generated in `src/routes/`):
- `package_helpers.ts` - generic package/repo utilities (`url_github_file`,
`repo_url_parse`, `package_is_published`)

TypeScript and Svelte analysis:

- `ts_helpers.ts` - TypeScript compiler API utilities
- high-level: `ts_analyze_declaration`, `ts_analyze_module_exports`
- low-level: `ts_extract_function_info`, `ts_extract_class_info`, etc.
- `svelte_helpers.ts` - Svelte component analysis
- high-level: `svelte_analyze_file`
- low-level: `svelte_analyze_component`, `svelte_extract_props`
- `tsdoc_helpers.ts` - TSDoc/JSDoc parsing
- `tsdoc_parse`, `tsdoc_apply_to_declaration`
- `module_helpers.ts` - module path utilities
- predicates: `module_matches_source`, `module_is_typescript`, `module_is_svelte`
- utilities: `module_extract_path`, `module_get_component_name`, `module_extract_dependencies`
- configuration: `ModuleSourceOptions`, `MODULE_SOURCE_DEFAULTS`
- `library_analysis.ts` - unified analysis entry point (`library_analyze_module`)
- `library_pipeline.ts` - pipeline orchestration helpers
Library Documentation Generation:

**Architecture** (after scope refactor):

1. **Analysis Layer** (`@fuzdev/svelte-docinfo`):
- Pure TypeScript/Svelte source analysis
- API: `library_analyze({source_files, options}) → {modules: ModuleJson[]}`
- No package metadata, no output generation
- See `@fuzdev/svelte-docinfo/CLAUDE.md` for details

2. **Type Layer** (`@fuzdev/fuz_util`):
- Shared type definitions: `SourceJson`, `LibraryJson`, `ModuleJson`, `DeclarationJson`
- Metadata parsing: `library_json_parse(package_json, source_json)`
- GitHub/npm URL generation

3. **Integration Layer** (fuz_ui):
- `library_gen.ts` - Gro genfile that orchestrates generation
- `library_output.ts` - generates library.json and library.ts wrapper
- Uses `library_analyze()` from svelte-docinfo for analysis
- Wraps results with `SourceJson` from fuz_util
- Generates output files with GitHub/npm metadata via `LibraryJson`

4. **Runtime Layer** (fuz_ui):
- `library.svelte.ts` - `Library` class wraps `LibraryJson` with reactive properties
- `module.svelte.ts` - `Module` class wraps `ModuleJson`
- `declaration.svelte.ts` - `Declaration` class wraps `DeclarationJson`
- Used by documentation UI components

**Flow**:
```
source files → library_analyze() → modules[]
modules[] → wrap with SourceJson → library_json_parse()
→ LibraryJson → library_generate_output() → library.json + library.ts
```

browser and DOM:

Expand Down
64 changes: 64 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/LibraryDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module_is_svelte,
module_is_css,
module_is_json,
} from './module_helpers.js';
} from '@fuzdev/svelte-docinfo/module_helpers.js';

const {
library,
Expand Down
250 changes: 0 additions & 250 deletions src/lib/analysis_context.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/declaration.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
type DeclarationJson,
declaration_generate_import,
declaration_get_display_name,
} from '@fuzdev/fuz_util/source_json.js';
} from '@fuzdev/svelte-docinfo/source_json.js';

import type {Module} from './module.svelte.js';
import {url_github_file} from './package_helpers.js';
Expand Down
Loading
Loading