Skip to content

Commit

Permalink
refactor(ast_tools): rename oxc_ast_codegen to oxc_ast_tools. (#4846
Browse files Browse the repository at this point in the history
)

This PR renames the `oxc_ast_codegen` crate to `oxc_ast_tools`, It improves the readability and organization of the codebase by giving the crate a name that better reflects its purpose and contents.

It also improves the error message in CI.
  • Loading branch information
rzvxa committed Aug 12, 2024
1 parent 0a23610 commit 8e8fcd0
Show file tree
Hide file tree
Showing 39 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/.generated_ast_watch_list.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# To edit this generated file you have to edit `tasks/ast_codegen/src/main.rs`
# To edit this generated file you have to edit `tasks/ast_tools/src/main.rs`
# Auto-generated code, DO NOT EDIT DIRECTLY!

src:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ jobs:
if: steps.filter.outputs.src == 'true'
with:
components: rustfmt
cache-key: codegen
cache-key: ast_changes
save-cache: ${{ github.ref_name == 'main' }}

- name: Check AST Changes
if: steps.filter.outputs.src == 'true'
run: |
cargo run -p oxc_ast_codegen
echo 'AST changes must be commited to the repo.'
git diff --exit-code
cargo run -p oxc_ast_tools
git diff --exit-code ||
echo 'AST changes caused the "generated" code to get outdated. Have you forgotten to run the `just ast` command and/or commit generated codes?'
20 changes: 10 additions & 10 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
#![allow(non_snake_case)]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/ast/jsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
#![allow(non_snake_case)]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/ast/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
#![allow(non_snake_case)]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
#![allow(non_snake_case)]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/assert_layouts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/assert_layouts.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/assert_layouts.rs`

use std::mem::{align_of, offset_of, size_of};

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/ast_builder.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/ast_builder.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/ast_builder.rs`

#![allow(
clippy::default_trait_access,
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/ast_kind.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/ast_kind.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/ast_kind.rs`

use oxc_span::{GetSpan, Span};

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_clone_in.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_clone_in.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/derive_clone_in.rs`

#![allow(clippy::default_trait_access)]

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_get_span.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_get_span.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/derive_get_span.rs`

#![allow(clippy::match_same_arms)]

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_get_span_mut.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_get_span.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/derive_get_span.rs`

#![allow(clippy::match_same_arms)]

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/visit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/visit.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/visit.rs`

//! Visitor Pattern
//!
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/visit.rs`
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/visit.rs`

//! Visitor Pattern
//!
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ website path:

# sync ast changes
ast:
cargo run -p oxc_ast_codegen
cargo run -p oxc_ast_tools
just check
4 changes: 2 additions & 2 deletions tasks/ast_codegen/Cargo.toml → tasks/ast_tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "oxc_ast_codegen"
name = "oxc_ast_tools"
version = "0.0.0"
publish = false
edition.workspace = true
Expand All @@ -9,7 +9,7 @@ license.workspace = true
workspace = true

[[bin]]
name = "oxc_ast_codegen"
name = "oxc_ast_tools"
test = false
doctest = false

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::{define_pass, Pass};

/// We use compiler to infer 64bit type layouts.
#[cfg(not(target_pointer_width = "64"))]
compile_error!("`oxc_ast_codegen::calc_layout` only supports 64 architectures.");
compile_error!("This module only supports 64bit architectures.");

type WellKnown = HashMap<&'static str, PlatformLayout>;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8e8fcd0

Please sign in to comment.