(source_id: string): string Extract module path relative to src/lib from absolute source ID.
source_id
stringreturns
string Module path and metadata helpers.
Provides utilities for working with source module paths, file types, and import relationships in the package generation system.
All functions are prefixed with
module_for clarity.
11 declarations
(source_id: string): string Extract module path relative to src/lib from absolute source ID.
source_idstringstring (module_path: string): string Extract component name from a Svelte module path.
module_pathstringstring (module_path: string): string Convert module path to module key format (with ./ prefix).
module_pathstringstring (path: string): boolean pathstringboolean (path: string): boolean pathstringboolean (path: string): boolean pathstringboolean (path: string): boolean pathstringboolean (path: string): boolean pathstringboolean (path: string, options?: ModuleSourceOptions | undefined): boolean Check if a path matches source criteria.
Checks source directory paths, file extensions, and exclusion patterns. Uses defaults if no options provided.
Rejects nested repo paths by ensuring the first /src/ leads to the source directory
(e.g. rejects /src/fixtures/repos/foo/src/lib/index.ts because /src/fixtures/ ≠ /src/lib/).
pathFull path to check
stringoptions?Configuration options (uses defaults if not provided)
ModuleSourceOptions | undefinedboolean True if the path matches all criteria
Required<ModuleSourceOptions> Default options for module source detection.
ModuleSourceOptions Configuration for module source detection.
Allows customizing which paths are considered source modules, useful for projects with non-standard directory structures.
source_pathsSource directory paths to include.
Array<string>extensionsFile extensions to analyze.
Array<string>exclude_patternsPatterns to exclude (matched against full path).
Array<RegExp>