Skip to content

Commit

Permalink
Refactor workspace move rstml to separate folder.
Browse files Browse the repository at this point in the history
Use workspace version of dependencies whenever is possible.
  • Loading branch information
vldm committed Jul 28, 2024
1 parent e5b7f3c commit 9f8ce5a
Show file tree
Hide file tree
Showing 25 changed files with 146 additions and 57 deletions.
60 changes: 58 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,63 @@

All notable changes to this project will be documented in this file.

## [0.11.2] - 2023-08-14
## [0.12.0] - 2024-07-28

### Chore

- Fix ci
- Fix clippy
- Add example of custom node to html-to-string-macro.
- Add eq and partial eq implementation.
- Move custom node implementation to separate crate.
- Refactor CustomNode trait
- Add readme to rstml-controll-flow
- Refine visitor api (remove clone/debug bounds)
- Add custom node visitor implementation
- Apply fmt/tests
- Refactor custom node visitor.
- Refactor code coverage script.

### Features

- Support for custom node
- Parsing utilities for custom nodes
- Add macro matcher
- Add visitor api.
- Implement extendable custom node

### Fix

- Fix imports in example
- Empty input parsing
- Make Recoverable field public.
- Fix spelling mistake "witespace" to "whitespace"
- Add unquoted text custom node integration
- Use config and diagnostc from invalid_block in attribute place.

### Other

- Use example from inline docs in readme
- Address review

- Allow multiple puncts in a row in NodeName
- Added test for consecutive punctuation in NodeName

Signed-off-by: max <gmx.sht@gmail.com>

- Update README.md
- Default impl for Parser ([#51](https://github.com/rs-tml/rstml/issues/51))

- Initial implementation of block attributes

- Implement braced key value attribute. See also: [#54](https://github.com/rs-tml/rstml/issues/54#issuecomment-2247924159)

- Remove scratch

- Rename KVAttributeValue::Braced -> KVAttributeValue::InvalidBraced


## [0.11.1] - 2023-08-14

### Chore

Expand Down Expand Up @@ -502,4 +558,4 @@ Use RecoverableContext instead.
- Pub not needed
- Parse blocks as NodeType::Block

<!-- generated by git-cliff -->
<!-- generated by git-cliff -->
45 changes: 15 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
[package]
name = "rstml"
[workspace.package]
description = "Rust templating for XML-based formats (HTML, SVG, MathML) implemented on top of proc-macro::TokenStreams"
version = "0.11.2"
authors = ["vldm <me@vldm.cc>", "stoically <stoically@protonmail.com>"]
keywords = ["syn", "jsx", "rsx", "html", "macro"]
edition = "2018"
edition = "2021"
repository = "https://github.com/rs-tml/rstml"
readme = "README.md"
license = "MIT"
resolver = "2"
license-file = "LICENSE"

include = ["/src", "LICENSE"]
readme = "README.md"

[lib]
bench = false
[workspace]
resolver = "2"
members = ["examples/html-to-string-macro", "rstml-control-flow"]

[dependencies]
[workspace.dependencies]
# Our packages
rstml = { version = "0.12.0", path = "rstml" }
rstml-control-flow = { version = "0.1.0", path = "rstml-control-flow" }
# external dependencies
proc-macro2 = { version = "1.0.47", features = ["span-locations"] }
quote = "1.0.21"
syn = { version = "2.0.15", features = [
Expand All @@ -27,26 +31,7 @@ thiserror = "1.0.37"
syn_derive = "0.1.6"
proc-macro2-diagnostics = { version = "0.10", default-features = false }
derive-where = "1.2.5"

[dev-dependencies]
proc-macro2 = { version = "1.0.47", features = ["span-locations"] }
# dev-dependencies
criterion = "0.5.1"
eyre = "0.6.8"

[[bench]]
name = "bench"
harness = false
path = "benches/bench.rs"

[workspace]
members = ["examples/html-to-string-macro", "rstml-control-flow"]

[features]
default = ["colors"]
# Hack that parse input two times, using `proc-macro2::fallback` to recover spaces, and persist original spans.
# It has no penalty in nightly, but in stable it parses input two times.
# In order to use this feature, one should also set `ParserConfig::macro_call_pattern`.
rawtext-stable-hack = ["rawtext-stable-hack-module"]
# Export inters of rawtext_stable_hack. It is usefull if you need support of `UnquotedText` on stable but your macro is called from other one.
rawtext-stable-hack-module = []
colors = ["proc-macro2-diagnostics/colors"]
trybuild = "1.0"
33 changes: 16 additions & 17 deletions examples/html-to-string-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
name = "rstml-to-string-macro"
description = "simple html to string macro powered by rstml"
version = "0.1.0"
authors = ["vldm <me@vldm.cc>", "stoically <stoically@protonmail.com>"]
keywords = ["html-to-string", "html", "macro"]
edition = "2021"
repository = "https://github.com/rs-tml/rstml/tree/main/examples/html-to-string-macro"
readme = "README.md"
license = "MIT"
authors.workspace = true
keywords.workspace = true
edition.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
include.workspace = true

[lib]
proc-macro = true

[dependencies]
proc-macro2 = "1.0.47"
quote = "1.0.21"
syn = "2.0.15"
syn_derive = "0.1"
rstml = { version = "0.11.0", path = "../../", features = [
"rawtext-stable-hack",
] }
proc-macro2-diagnostics = "0.10"
derive-where = "1.2.5"
rstml-control-flow = { version = "0.1.0", path = "../../rstml-control-flow" }
proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
syn_derive.workspace = true
rstml = { workspace = true, features = ["rawtext-stable-hack"] }
proc-macro2-diagnostics.workspace = true
derive-where.workspace = true
rstml-control-flow.workspace = true

[dev-dependencies]
trybuild = "1.0"
trybuild.workspace = true
22 changes: 14 additions & 8 deletions rstml-control-flow/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
[package]
name = "rstml-control-flow"
version = "0.1.0"
edition = "2021"
edition.workspace = true
authors.workspace = true
keywords.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
include.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
proc-macro2 = "1.0.47"
quote = "1.0.21"
syn = "2.0.15"
syn_derive = "0.1"
rstml = { version = "0.11.0", path = "../", features = ["rawtext-stable-hack"] }
proc-macro2-diagnostics = "0.10"
derive-where = "1.2.5"
proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
syn_derive.workspace = true
proc-macro2-diagnostics.workspace = true
derive-where.workspace = true
rstml = { workspace = true, features = ["rawtext-stable-hack"] }

[features]
default = []
Expand Down
43 changes: 43 additions & 0 deletions rstml/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[package]
name = "rstml"
description.workspace = true
version = "0.12.0"
authors.workspace = true
keywords.workspace = true
edition.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
include.workspace = true
[lib]
bench = false

[dependencies]
proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
thiserror.workspace = true
syn_derive.workspace = true
proc-macro2-diagnostics.workspace = true
derive-where.workspace = true

[dev-dependencies]
proc-macro2 = { workspace = true, features = ["span-locations"] }
criterion.workspace = true
eyre.workspace = true

[[bench]]
name = "bench"
harness = false
path = "benches/bench.rs"


[features]
default = ["colors"]
# Hack that parse input two times, using `proc-macro2::fallback` to recover spaces, and persist original spans.
# It has no penalty in nightly, but in stable it parses input two times.
# In order to use this feature, one should also set `ParserConfig::macro_call_pattern`.
rawtext-stable-hack = ["rawtext-stable-hack-module"]
# Export inters of rawtext_stable_hack. It is usefull if you need support of `UnquotedText` on stable but your macro is called from other one.
rawtext-stable-hack-module = []
colors = ["proc-macro2-diagnostics/colors"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9f8ce5a

Please sign in to comment.