diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 125eeee9740..e40c9e7ee80 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -76,3 +76,8 @@ updates: directory: /ffi/wasm/ schedule: interval: daily + # TOOLS + - package-ecosystem: cargo + directory: /tools/ + schedule: + interval: daily diff --git a/Cargo.lock b/Cargo.lock index 13162a8f513..70ddf2ff13b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -688,6 +688,38 @@ dependencies = [ "displaydoc", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.22", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cast" version = "0.3.0" @@ -3104,7 +3136,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver", + "semver 0.9.0", ] [[package]] @@ -3227,6 +3259,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scripts" +version = "0.0.0" +dependencies = [ + "cargo_metadata", + "log", + "simple_logger", +] + [[package]] name = "seahash" version = "4.1.0" @@ -3242,6 +3283,15 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] + [[package]] name = "semver-parser" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index 000000c0c24..3bfafe3b884 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,9 @@ members = [ # OTHERS "examples", "cli", + + # TOOLS + "tools/*", ] exclude = [ @@ -67,6 +70,8 @@ textwrap = "0.16.0" thin-vec = "0.2.13" time = {version = "0.3.34", no-default-features = true, features = ["local-offset", "large-dates", "wasm-bindgen", "parsing", "formatting", "macros"]} tinystr = "0.7.5" +log = "0.4.20" +simple_logger = "4.3.3" # ICU4X diff --git a/cli/ABOUT.md b/cli/ABOUT.md index 0deb7c9a49d..f58fa7bc1fc 100644 --- a/cli/ABOUT.md +++ b/cli/ABOUT.md @@ -8,11 +8,10 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. -- [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and - execution. +- [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and execution. - [**`boa_gc`**][gc] - Boa's garbage collector. - [**`boa_interner`**][interner] - Boa's string interner. - [**`boa_parser`**][parser] - Boa's lexer and parser. diff --git a/core/ast/ABOUT.md b/core/ast/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/ast/ABOUT.md +++ b/core/ast/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/engine/ABOUT.md b/core/engine/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/engine/ABOUT.md +++ b/core/engine/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/gc/ABOUT.md b/core/gc/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/gc/ABOUT.md +++ b/core/gc/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/icu_provider/ABOUT.md b/core/icu_provider/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/icu_provider/ABOUT.md +++ b/core/icu_provider/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/icu_provider/Cargo.toml b/core/icu_provider/Cargo.toml index d5b904d87ad..4182bb9b03c 100644 --- a/core/icu_provider/Cargo.toml +++ b/core/icu_provider/Cargo.toml @@ -20,8 +20,8 @@ once_cell = { workspace = true, default-features = false, features = ["critical- icu_datagen = { workspace = true, optional = true, features = ["networking", "use_wasm"] } icu_plurals = { workspace = true, optional = true, features = ["datagen", "experimental"] } -log = { version = "0.4.20", optional = true } -simple_logger = { version = "4.3.3", optional = true } +log = { workspace = true, optional = true } +simple_logger = { workspace = true, optional = true } [features] default = ["std"] diff --git a/core/interner/ABOUT.md b/core/interner/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/interner/ABOUT.md +++ b/core/interner/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/macros/ABOUT.md b/core/macros/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/macros/ABOUT.md +++ b/core/macros/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/parser/ABOUT.md b/core/parser/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/parser/ABOUT.md +++ b/core/parser/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/profiler/ABOUT.md b/core/profiler/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/profiler/ABOUT.md +++ b/core/profiler/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/core/runtime/ABOUT.md b/core/runtime/ABOUT.md index 0deb7c9a49d..3cde6cc6036 100644 --- a/core/runtime/ABOUT.md +++ b/core/runtime/ABOUT.md @@ -8,7 +8,7 @@ website][boa-web]. Try out the most recent release with Boa's live demo [playground][boa-playground]. -# Boa Crates +## Boa Crates - [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. - [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and diff --git a/ffi/wasm/ABOUT.md b/ffi/wasm/ABOUT.md deleted file mode 100644 index 0deb7c9a49d..00000000000 --- a/ffi/wasm/ABOUT.md +++ /dev/null @@ -1,33 +0,0 @@ -# About Boa - -Boa is an open-source, experimental ECMAScript Engine written in Rust for -lexing, parsing and executing ECMAScript/JavaScript. Currently, Boa supports some -of the [language][boa-conformance]. More information can be viewed at [Boa's -website][boa-web]. - -Try out the most recent release with Boa's live demo -[playground][boa-playground]. - -# Boa Crates - -- [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. -- [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and - execution. -- [**`boa_gc`**][gc] - Boa's garbage collector. -- [**`boa_interner`**][interner] - Boa's string interner. -- [**`boa_parser`**][parser] - Boa's lexer and parser. -- [**`boa_profiler`**][profiler] - Boa's code profiler. -- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider. -- [**`boa_runtime`**][runtime] - Boa's WebAPI features. - -[boa-conformance]: https://boajs.dev/boa/test262/ -[boa-web]: https://boajs.dev/ -[boa-playground]: https://boajs.dev/boa/playground/ -[ast]: https://boajs.dev/boa/doc/boa_ast/index.html -[engine]: https://boajs.dev/boa/doc/boa_engine/index.html -[gc]: https://boajs.dev/boa/doc/boa_gc/index.html -[interner]: https://boajs.dev/boa/doc/boa_interner/index.html -[parser]: https://boajs.dev/boa/doc/boa_parser/index.html -[profiler]: https://boajs.dev/boa/doc/boa_profiler/index.html -[icu]: https://boajs.dev/boa/doc/boa_icu_provider/index.html -[runtime]: https://boajs.dev/boa/doc/boa_runtime/index.html diff --git a/ffi/wasm/src/lib.rs b/ffi/wasm/src/lib.rs index 5f95bc7f748..d6bdc5d0bbc 100644 --- a/ffi/wasm/src/lib.rs +++ b/ffi/wasm/src/lib.rs @@ -1,9 +1,4 @@ -//! An ECMAScript WASM implementation based on boa_engine. -#![doc = include_str!("../ABOUT.md")] -#![doc( - html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", - html_favicon_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg" -)] +//! An ECMAScript WASM implementation based on `boa_engine`. #![cfg_attr(not(test), forbid(clippy::unwrap_used))] use boa_engine::{Context, Source}; diff --git a/tests/tester/ABOUT.md b/tests/tester/ABOUT.md deleted file mode 100644 index 0deb7c9a49d..00000000000 --- a/tests/tester/ABOUT.md +++ /dev/null @@ -1,33 +0,0 @@ -# About Boa - -Boa is an open-source, experimental ECMAScript Engine written in Rust for -lexing, parsing and executing ECMAScript/JavaScript. Currently, Boa supports some -of the [language][boa-conformance]. More information can be viewed at [Boa's -website][boa-web]. - -Try out the most recent release with Boa's live demo -[playground][boa-playground]. - -# Boa Crates - -- [**`boa_ast`**][ast] - Boa's ECMAScript Abstract Syntax Tree. -- [**`boa_engine`**][engine] - Boa's implementation of ECMAScript builtin objects and - execution. -- [**`boa_gc`**][gc] - Boa's garbage collector. -- [**`boa_interner`**][interner] - Boa's string interner. -- [**`boa_parser`**][parser] - Boa's lexer and parser. -- [**`boa_profiler`**][profiler] - Boa's code profiler. -- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider. -- [**`boa_runtime`**][runtime] - Boa's WebAPI features. - -[boa-conformance]: https://boajs.dev/boa/test262/ -[boa-web]: https://boajs.dev/ -[boa-playground]: https://boajs.dev/boa/playground/ -[ast]: https://boajs.dev/boa/doc/boa_ast/index.html -[engine]: https://boajs.dev/boa/doc/boa_engine/index.html -[gc]: https://boajs.dev/boa/doc/boa_gc/index.html -[interner]: https://boajs.dev/boa/doc/boa_interner/index.html -[parser]: https://boajs.dev/boa/doc/boa_parser/index.html -[profiler]: https://boajs.dev/boa/doc/boa_profiler/index.html -[icu]: https://boajs.dev/boa/doc/boa_icu_provider/index.html -[runtime]: https://boajs.dev/boa/doc/boa_runtime/index.html diff --git a/tests/tester/src/main.rs b/tests/tester/src/main.rs index 8c703f176f8..649f47837f5 100644 --- a/tests/tester/src/main.rs +++ b/tests/tester/src/main.rs @@ -2,11 +2,6 @@ //! //! This crate will run the full ECMAScript test suite (Test262) and report compliance of the //! `boa` engine. -#![doc = include_str!("../ABOUT.md")] -#![doc( - html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", - html_favicon_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg" -)] #![cfg_attr(not(test), deny(clippy::unwrap_used))] #![allow( clippy::too_many_lines, diff --git a/tools/scripts/Cargo.toml b/tools/scripts/Cargo.toml new file mode 100644 index 00000000000..6233ce0dad6 --- /dev/null +++ b/tools/scripts/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "scripts" +publish = false +version = "0.0.0" +edition.workspace = true +rust-version.workspace = true + +[dependencies] +cargo_metadata = "0.18.1" +log.workspace = true +simple_logger.workspace = true + +[lints] +workspace = true diff --git a/tools/scripts/src/bin/regenerate-about.rs b/tools/scripts/src/bin/regenerate-about.rs new file mode 100644 index 00000000000..73283009e79 --- /dev/null +++ b/tools/scripts/src/bin/regenerate-about.rs @@ -0,0 +1,32 @@ +//! Regenerates the `ABOUT.md` document for all publishable crates. + +use std::{error::Error, path::Path}; + +use log::{info, warn}; + +fn main() -> Result<(), Box> { + simple_logger::SimpleLogger::new().env().init()?; + + let metadata = cargo_metadata::MetadataCommand::new() + .manifest_path("./Cargo.toml") + .exec()?; + + for member_id in &metadata.workspace_members { + let member = &metadata[member_id]; + + info!("Checking member `{}`", member.manifest_path); + + if member.publish.as_ref().is_some_and(Vec::is_empty) { + warn!("Skipping unpublishable member..."); + continue; + } + + let clone_path = member.manifest_path.with_file_name("ABOUT.md"); + + info!("Cloning ABOUT.md into path `{clone_path}`"); + + std::fs::copy(Path::new("./ABOUT.md"), clone_path)?; + } + + Ok(()) +}