Skip to content

Commit

Permalink
ast_name_tracker: track external references in ESM snippets (#105)
Browse files Browse the repository at this point in the history
Adds a new crate `ast_name_tracker` for tracking declared and shadowed
names in ESM snippets.

This is necessary to track any statistics on a per-symbol level without
aggregating dependencies on the module-level, as it can operate on the
source level.

---------

Co-authored-by: Max Huang-Hobbs <[email protected]>
  • Loading branch information
Adjective-Object and Max Huang-Hobbs authored Dec 2, 2024
1 parent b12b737 commit 599271a
Show file tree
Hide file tree
Showing 5 changed files with 582 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "ast_name_tracker: track external references in ESM snippets",
"packageName": "@good-fences/api",
"email": "[email protected]",
"dependentChangeType": "none"
}
26 changes: 26 additions & 0 deletions crates/ast_name_tracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "ast-name-tracker"
version = "0.2.0-beta.1"
authors = ["Maxwell Huang-Hobbs <[email protected]>"]
license = "Apache-2.0"
description = """
Tracks name references among nodes in an AST
"""
edition = "2018"

[lib]
crate-type = ["lib"]

[dependencies]
ahashmap = { version = "0.2.0", path = "../ahashmap" }
logger = { version = "0.2.0", path = "../logger" }
logger_srcfile = { version = "0.2.0", path = "../logger_srcfile" }
swc_atoms = "0.6.7"
swc_common.workspace = true
swc_ecma_ast.workspace = true
swc_ecma_visit.workspace = true
thiserror.workspace = true

[dev-dependencies]
swc_utils_parse = { path = "../swc_utils_parse" }
pretty_assertions.workspace = true
1 change: 1 addition & 0 deletions crates/ast_name_tracker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod visitor;
Loading

0 comments on commit 599271a

Please sign in to comment.