Skip to main content

Module analyzer

Module analyzer 

Source
Expand description

Dependency analyzer — scan all JS files, build import graph, and partition files into groups (one core file + its transitive deps).

A “core file” is a file that is NOT imported by any other file. Each core file becomes the root of a group. Non-core files can belong to multiple groups.

Structs§

FileGroup
A file group: one core file + all files transitively imported by it.

Functions§

analyze_groups
Analyze all JS files in in_dir and return file groups.
sanitize_module_name
Convert a module name (from filename) to a valid Zig identifier suffix. Non-ASCII characters are converted to Unicode codepoint format _uXXXX.
strip_imports_extract_exports
Strip import and export statements from JS source, and collect all exported function/var/class names.