refactor(transformer): move BoundIdentifier into oxc_traverse crate (#6293)

Pure refactor.
This commit is contained in:
overlookmotel 2024-10-05 16:00:49 +00:00
parent 07196ae0a8
commit 7b62966813
8 changed files with 15 additions and 17 deletions

View file

@ -129,12 +129,10 @@ use oxc_syntax::{
scope::{ScopeFlags, ScopeId},
symbol::SymbolFlags,
};
use oxc_traverse::{Ancestor, Traverse, TraverseCtx};
use oxc_traverse::{Ancestor, BoundIdentifier, Traverse, TraverseCtx};
use serde::Deserialize;
use crate::helpers::bindings::BoundIdentifier;
#[derive(Debug, Default, Clone, Deserialize)]
pub struct ArrowFunctionsOptions {
/// This option enables the following:

View file

@ -58,9 +58,9 @@ use oxc_ast::ast::*;
use oxc_semantic::{ReferenceFlags, SymbolFlags};
use oxc_span::SPAN;
use oxc_syntax::operator::{AssignmentOperator, LogicalOperator};
use oxc_traverse::{Traverse, TraverseCtx};
use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx};
use crate::{helpers::bindings::BoundIdentifier, TransformCtx};
use crate::TransformCtx;
pub struct LogicalAssignmentOperators<'a, 'ctx> {
ctx: &'ctx TransformCtx<'a>,

View file

@ -29,10 +29,6 @@ mod typescript;
mod plugins;
mod helpers {
pub mod bindings;
}
use std::path::Path;
use common::Common;

View file

@ -97,7 +97,9 @@ use oxc_syntax::{
symbol::SymbolFlags,
xml_entities::XML_ENTITIES,
};
use oxc_traverse::{Traverse, TraverseCtx};
use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx};
use crate::{common::module_imports::NamedImport, TransformCtx};
use super::diagnostics;
pub use super::{
@ -105,9 +107,6 @@ pub use super::{
jsx_source::ReactJsxSource,
options::{JsxOptions, JsxRuntime},
};
use crate::{
common::module_imports::NamedImport, helpers::bindings::BoundIdentifier, TransformCtx,
};
pub struct ReactJsx<'a, 'ctx> {
options: JsxOptions,

View file

@ -37,11 +37,12 @@ use oxc_ast::{ast::*, NONE};
use oxc_diagnostics::OxcDiagnostic;
use oxc_span::{Span, SPAN};
use oxc_syntax::{number::NumberBase, symbol::SymbolFlags};
use oxc_traverse::{Traverse, TraverseCtx};
use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx};
use ropey::Rope;
use crate::TransformCtx;
use super::utils::get_line_column;
use crate::{helpers::bindings::BoundIdentifier, TransformCtx};
const SOURCE: &str = "__source";
const FILE_NAME_VAR: &str = "jsxFileName";

View file

@ -5,7 +5,8 @@ use oxc_syntax::{
scope::ScopeId,
symbol::{SymbolFlags, SymbolId},
};
use oxc_traverse::TraverseCtx;
use crate::TraverseCtx;
/// Info about a binding, from which one can create a `BindingIdentifier` or `IdentifierReference`s.
///

View file

@ -12,10 +12,13 @@ use oxc_syntax::{
};
use crate::ancestor::{Ancestor, AncestorType};
mod ancestry;
mod ast_operations;
mod bound_identifier;
use ancestry::PopToken;
pub use ancestry::TraverseAncestry;
pub use bound_identifier::BoundIdentifier;
mod identifier;
mod scoping;
pub use scoping::TraverseScoping;

View file

@ -65,7 +65,7 @@ use oxc_ast::ast::Program;
use oxc_semantic::{ScopeTree, SymbolTable};
mod context;
pub use context::{TraverseAncestry, TraverseCtx, TraverseScoping};
pub use context::{BoundIdentifier, TraverseAncestry, TraverseCtx, TraverseScoping};
mod generated {
pub mod ancestor;