Skip to content

Commit

Permalink
Create tool to regenerate the ABOUT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Feb 27, 2024
1 parent 5ce93b2 commit ce7826d
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 92 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,8 @@ updates:
directory: /ffi/wasm/
schedule:
interval: daily
# TOOLS
- package-ecosystem: cargo
directory: /tools/
schedule:
interval: daily
52 changes: 51 additions & 1 deletion Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ members = [
# OTHERS
"examples",
"cli",

# TOOLS
"tools/*",
]

exclude = [
Expand Down Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions cli/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion core/ast/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/engine/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/gc/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/icu_provider/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/icu_provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion core/interner/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/macros/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/parser/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/profiler/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 0 additions & 33 deletions ffi/wasm/ABOUT.md

This file was deleted.

7 changes: 1 addition & 6 deletions ffi/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
33 changes: 0 additions & 33 deletions tests/tester/ABOUT.md

This file was deleted.

5 changes: 0 additions & 5 deletions tests/tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions tools/scripts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions tools/scripts/src/bin/regenerate-about.rs
Original file line number Diff line number Diff line change
@@ -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<dyn Error>> {
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(())
}

0 comments on commit ce7826d

Please sign in to comment.