Browse Source

Switch to workspace inherited properties (#2297)

This Pull Request switches our codebase to the brand new [workspace inherited keys](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table), which allows us to define common package options that are usable within each crate's Cargo.toml file.

It also allows to share dependency versions between crates, but I defined only shared versions for our workspace members. It would be a good follow-up to lift all the shared dependencies between crates into the global Cargo.toml.
pull/2305/head
José Julián Espina 2 years ago
parent
commit
e9e85f5a49
  1. 16
      Cargo.toml
  2. 18
      boa_cli/Cargo.toml
  3. 22
      boa_engine/Cargo.toml
  4. 4
      boa_engine/src/object/mod.rs
  5. 16
      boa_examples/Cargo.toml
  6. 14
      boa_gc/Cargo.toml
  7. 14
      boa_interner/Cargo.toml
  8. 14
      boa_profiler/Cargo.toml
  9. 20
      boa_tester/Cargo.toml
  10. 12
      boa_unicode/Cargo.toml
  11. 16
      boa_wasm/Cargo.toml

16
Cargo.toml

@ -11,6 +11,22 @@ members = [
"boa_examples", "boa_examples",
] ]
[workspace.package]
edition = "2021"
version = "0.16.0"
rust-version = "1.64"
authors = ["boa-dev"]
repository = "https://github.com/boa-dev/boa"
license = "Unlicense/MIT"
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language."
[workspace.dependencies]
boa_engine = { version = "0.16.0", path = "boa_engine" }
boa_interner = { version = "0.16.0", path = "boa_interner" }
boa_gc = { version = "0.16.0", path = "boa_gc" }
boa_profiler = { version = "0.16.0", path = "boa_profiler" }
boa_unicode = { version = "0.16.0", path = "boa_unicode" }
[workspace.metadata.workspaces] [workspace.metadata.workspaces]
allow_branch = "main" allow_branch = "main"

18
boa_cli/Cargo.toml

@ -1,19 +1,19 @@
[package] [package]
name = "boa_cli" name = "boa_cli"
version = "0.16.0"
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "compiler", "js", "cli"] keywords = ["javascript", "compiler", "js", "cli"]
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
license = "Unlicense/MIT"
default-run = "boa" default-run = "boa"
description.workspace = true
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
boa_engine = { path = "../boa_engine", features = ["deser", "console"], version = "0.16.0" } boa_engine = { workspace = true, features = ["deser", "console"] }
boa_interner = { path = "../boa_interner", version = "0.16.0" } boa_interner.workspace = true
rustyline = "10.0.0" rustyline = "10.0.0"
rustyline-derive = "0.7.0" rustyline-derive = "0.7.0"
clap = { version = "3.2.22", features = ["derive"] } clap = { version = "3.2.22", features = ["derive"] }

22
boa_engine/Cargo.toml

@ -1,15 +1,15 @@
[package] [package]
name = "boa_engine" name = "boa_engine"
version = "0.16.0"
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "js", "compiler", "lexer", "parser"] keywords = ["javascript", "js", "compiler", "lexer", "parser"]
categories = ["parser-implementations", "compilers"] categories = ["parser-implementations", "compilers"]
license = "Unlicense/MIT"
readme = "../README.md" readme = "../README.md"
description.workspace = true
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[features] [features]
profiler = ["boa_profiler/profiler"] profiler = ["boa_profiler/profiler"]
@ -28,11 +28,11 @@ intl = [
console = [] console = []
[dependencies] [dependencies]
boa_unicode = { path = "../boa_unicode", version = "0.16.0" } boa_unicode.workspace = true
boa_interner = { path = "../boa_interner", version = "0.16.0" } boa_interner.workspace = true
boa_gc = { path = "../boa_gc", version = "0.16.0" } boa_gc.workspace = true
boa_profiler.workspace = true
gc = "0.4.1" gc = "0.4.1"
boa_profiler = { path = "../boa_profiler", version = "0.16.0" }
serde = { version = "1.0.145", features = ["derive", "rc"] } serde = { version = "1.0.145", features = ["derive", "rc"] }
serde_json = "1.0.85" serde_json = "1.0.85"
rand = "0.8.5" rand = "0.8.5"

4
boa_engine/src/object/mod.rs

@ -1735,7 +1735,7 @@ impl<'context> FunctionBuilder<'context> {
ref mut constructor, ref mut constructor,
.. ..
} => { } => {
*constructor = yes.then(|| ConstructorKind::Base); *constructor = yes.then_some(ConstructorKind::Base);
} }
Function::Ordinary { .. } Function::Ordinary { .. }
| Function::Generator { .. } | Function::Generator { .. }
@ -2146,7 +2146,7 @@ impl<'context> ConstructorBuilder<'context> {
/// Default is `true` /// Default is `true`
#[inline] #[inline]
pub fn constructor(&mut self, constructor: bool) -> &mut Self { pub fn constructor(&mut self, constructor: bool) -> &mut Self {
self.constructor = constructor.then(|| ConstructorKind::Base); self.constructor = constructor.then_some(ConstructorKind::Base);
self self
} }

16
boa_examples/Cargo.toml

@ -1,15 +1,17 @@
[package] [package]
name = "boa_examples" name = "boa_examples"
version = "0.16.0" description = "Usage examples of the Boa JavaScript engine."
authors = ["boa-dev"]
repository = "https://github.com/boa-dev/boa"
license = "Unlicense/MIT"
edition = "2021"
publish = false publish = false
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
boa_engine = { path = "../boa_engine", features = ["console"], version = "0.16.0" } boa_engine = { workspace = true, features = ["console"] }
boa_gc = { path = "../boa_gc", version = "0.16.0" } boa_gc.workspace = true
gc = "0.4.1" gc = "0.4.1"

14
boa_gc/Cargo.toml

@ -1,14 +1,14 @@
[package] [package]
name = "boa_gc" name = "boa_gc"
version = "0.16.0" description = "Garbage collector for the Boa JavaScript engine."
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Garbage collector used in Boa."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "js", "garbage", "memory"] keywords = ["javascript", "js", "garbage", "memory"]
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
license = "Unlicense/MIT" version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
gc = { version = "0.4.1", features = ["derive"] } gc = { version = "0.4.1", features = ["derive"] }

14
boa_interner/Cargo.toml

@ -1,14 +1,14 @@
[package] [package]
name = "boa_interner" name = "boa_interner"
version = "0.16.0" description = "String interner for the Boa JavaScript engine."
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "String interner used in Boa."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "js", "string", "interner"] keywords = ["javascript", "js", "string", "interner"]
categories = ["data-structures"] categories = ["data-structures"]
license = "Unlicense/MIT" version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
serde = { version = "1.0.145", features = ["derive"], optional = true } serde = { version = "1.0.145", features = ["derive"], optional = true }

14
boa_profiler/Cargo.toml

@ -1,14 +1,14 @@
[package] [package]
name = "boa_profiler" name = "boa_profiler"
version = "0.16.0" description = "Profiler for the Boa JavaScript engine."
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Profiler used in Boa."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "js", "compiler", "profiler"] keywords = ["javascript", "js", "compiler", "profiler"]
categories = ["development-tools::profiling"] categories = ["development-tools::profiling"]
license = "Unlicense/MIT" version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[features] [features]
profiler = ["measureme", "once_cell"] profiler = ["measureme", "once_cell"]

20
boa_tester/Cargo.toml

@ -1,20 +1,20 @@
[package] [package]
name = "boa_tester" name = "boa_tester"
version = "0.16.0" description = "ECMA-262 tests runner for the Boa JavaScript engine."
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Test runner for the Boa JavaScript engine."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "ECMASCript", "compiler", "test262", "tester"] keywords = ["javascript", "ECMASCript", "compiler", "test262", "tester"]
categories = ["command-line-utilites"] categories = ["command-line-utilites"]
license = "Unlicense/MIT"
publish = false publish = false
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
boa_engine = { path = "../boa_engine", features = ["intl"], version = "0.16.0" } boa_engine = { workspace = true, features = ["intl"] }
boa_interner = { path = "../boa_interner", version = "0.16.0" } boa_interner.workspace = true
boa_gc = { path = "../boa_gc", version = "0.16.0" } boa_gc.workspace = true
clap = { version = "3.2.22", features = ["derive"] } clap = { version = "3.2.22", features = ["derive"] }
serde = { version = "1.0.145", features = ["derive"] } serde = { version = "1.0.145", features = ["derive"] }
serde_yaml = "0.9.13" serde_yaml = "0.9.13"

12
boa_unicode/Cargo.toml

@ -1,14 +1,14 @@
[package] [package]
name = "boa_unicode" name = "boa_unicode"
version = "0.16.0"
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Unicode support for the Boa JavaScript engine." description = "Unicode support for the Boa JavaScript engine."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "compiler", "lexer", "parser", "unicode"] keywords = ["javascript", "compiler", "lexer", "parser", "unicode"]
categories = ["parsing"] categories = ["parsing"]
license = "Unlicense/MIT" version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
unicode-general-category = "0.6.0" unicode-general-category = "0.6.0"

16
boa_wasm/Cargo.toml

@ -1,18 +1,18 @@
[package] [package]
name = "boa_wasm" name = "boa_wasm"
version = "0.16.0" description = "WASM compatibility layer for the Boa JavaScript engine."
edition = "2021"
rust-version = "1.60"
authors = ["boa-dev"]
description = "WASM package for the Boa JavaScript engine."
repository = "https://github.com/boa-dev/boa"
keywords = ["javascript", "compiler", "lexer", "parser", "js"] keywords = ["javascript", "compiler", "lexer", "parser", "js"]
categories = ["parser-implementations", "wasm", "compilers"] categories = ["parser-implementations", "wasm", "compilers"]
license = "Unlicense/MIT"
publish = false publish = false
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
boa_engine = { path = "../boa_engine", features = ["console"], version = "0.16.0" } boa_engine = { workspace = true, features = ["console"] }
wasm-bindgen = "0.2.83" wasm-bindgen = "0.2.83"
getrandom = { version = "0.2.7", features = ["js"] } getrandom = { version = "0.2.7", features = ["js"] }

Loading…
Cancel
Save