Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,35 @@ members = [
"near-plugins",
"near-plugins-derive"
]
exclude = ["target"]

[workspace.metadata.workspaces]
version = "0.15.0"

[workspace.package]
version = "0.1.0"
edition = "2021"
authors = ["Aurora Labs <hello@aurora.dev>"]
rust-version = "1.64.0"
description = "Ergonomic plugin system to extend NEAR contracts."
license = "CC0-1.0"
readme = "README.md"
repository = "https://github.com/aurora-is-near/near-plugins"
homepage = "https://github.com/aurora-is-near/near-plugins"
keywords = ["near", "smart contract", "plugin"]

[workspace.dependencies]
near-sdk = "4.0.0"
near-plugins-derive = { path = "near-plugins-derive" }
serde = "1"
anyhow = "1.0"
borsh = "0.9"
tokio = { version = "1", features = ["full"] }
# Feature `unstable` is required for compiling contracts during tests.
workspaces = { version = "0.6", features = ["unstable"] }
Comment on lines +29 to +31
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does specifying them in workspace.dependencies make them regular dependencies? Previously these (and some others) were only dev-dependencies. At least tokio probably shouldn't become a regular dependency.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I expect. Notice they are under dev-dependencies on the specific project: [dev-dependencies]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find anything on it in cargo docs. Building a contract that uses plugins can be done by:

cd near-plugins/tests/contracts/access_controllable
cargo clean && rm Cargo.lock
make build

Afterwards tokio and other dev-dependencies are not in Cargo.lock. I think that confirms the expected behavior (they're not becoming regular dependencies).

toml = "0.5"
darling = "0.13.1"
proc-macro2 = "1.0"
quote = "1.0.9"
syn = { version = "1.0.69", features = ["full"] }
proc-macro-crate = "0.1.5"
17 changes: 9 additions & 8 deletions near-plugins-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "near-plugins-derive"
version = "0.1.0"
authors = ["Marcelo Fornet <marcelo@aurora.dev>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
version.workspace = true

[lib]
proc-macro = true

[dependencies]
darling = "0.13.1"
proc-macro2 = "1.0"
quote = "1.0.9"
syn = { version = "1.0.69", features = ["full"] }
proc-macro-crate = "0.1.5"
darling.workspace = true
proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
proc-macro-crate.workspace = true
33 changes: 12 additions & 21 deletions near-plugins/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
[package]
name = "near-plugins"
version = "0.1.0"
authors = ["Marcelo Fornet <marcelo@aurora.dev>"]
edition = "2021"
license = "CC0-1.0"
readme = "README.md"
repository = "https://github.com/aurora-is-near/near-plugins"
homepage = "https://github.com/aurora-is-near/near-plugins"
description = """
Plugin system to extend NEAR contracts easily.
"""
keywords = ["near", "smart contract", "plugin"]
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
version.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]
# proc-macro = true

[dependencies]
near-sdk = "4.0.0-pre.5"
near-plugins-derive = { path = "../near-plugins-derive" }
serde = "1"
near-sdk.workspace = true
near-plugins-derive.workspace = true
serde.workspace = true

[dev-dependencies]
anyhow = "1.0"
borsh = "0.9"
tokio = { version = "1", features = ["full"] }
# Feature `unstable` is required for compiling contracts during tests.
workspaces = { version = "0.6", features = ["unstable"] }
toml = "0.5"
anyhow.workspace = true
borsh.workspace = true
tokio.workspace = true
workspaces.workspace = true
toml.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
bitflags = "1.3"
near-plugins = { path = "../../../../near-plugins" }
near-sdk = "4.0.0-pre.5"
near-sdk = "4.0.0"

[profile.release]
codegen-units = 1
Expand Down