Skip to content

Commit

Permalink
refactor(aria_metadata): generate ARIA metadata from specification
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos committed Sep 24, 2024
1 parent a3483e4 commit a3aeba5
Show file tree
Hide file tree
Showing 17 changed files with 19,202 additions and 236 deletions.
46 changes: 30 additions & 16 deletions Cargo.lock

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

Empty file added aria-data-1-3-draft.json
Empty file.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"benchmark/target/**"
],
"include": [
"packages/aria-data/*.js",
"packages/@biomejs/**",
"packages/tailwindcss-config-analyzer/**",
"benchmark/**"
Expand Down
14 changes: 0 additions & 14 deletions crates/biome_aria/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ pub fn is_aria_property_valid(property: &str) -> bool {
AriaPropertiesEnum::from_str(property).is_ok()
}

/// It checks if an ARIA property type is valid
///
/// ## Examples
///
/// ```
/// use biome_aria::is_aria_property_type_valid;
///
/// assert!(is_aria_property_type_valid("string"));
/// assert!(!is_aria_property_type_valid("bogus"));
/// ```
pub fn is_aria_property_type_valid(property_type: &str) -> bool {
AriaPropertyTypeEnum::from_str(property_type).is_ok()
}

#[cfg(test)]
mod test {
use crate::roles::AriaRoles;
Expand Down
5 changes: 5 additions & 0 deletions crates/biome_aria_metadata/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Biome ARIA metadata

The `build.rs` script uses `aria-data.json` to generate ARIA metadata.
`aria-data.json` is a symlink to `packages/aria-data/aria-data-<version>.json`.
See the documentation of `packages/aria-data` to generate this file.
4 changes: 4 additions & 0 deletions crates/biome_aria_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ version = "0.5.7"

[build-dependencies]
biome_string_case = { workspace = true }
prettyplease = "0.2.22"
proc-macro2 = { workspace = true, features = ["span-locations"] }
quote = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
syn = "2.0.76"

[lints]
workspace = true
1 change: 1 addition & 0 deletions crates/biome_aria_metadata/aria-data.json
Loading

0 comments on commit a3aeba5

Please sign in to comment.