From 8eba4b6e48f7540f22d76629f7ce07e0eda88114 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 15 May 2021 11:33:22 +0100 Subject: [PATCH 1/5] Helper to build changelog (#1845) --- CHANGELOG.md | 35 +++- Cargo.toml | 3 + packages/changelog/Cargo.toml | 16 ++ packages/changelog/src/main.rs | 208 ++++++++++++++++++++++ packages/yew-macro/src/props/component.rs | 20 +-- packages/yewtil/src/store.rs | 2 +- 6 files changed, 270 insertions(+), 14 deletions(-) create mode 100644 packages/changelog/Cargo.toml create mode 100644 packages/changelog/src/main.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index b8630cfb4b5..a308286f908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## ✨ **0.18.0** *(2021-05-15)* + +#### Changelog + +- #### 🛠 Fixes + + - Fix missing redirects (#1640). [[@siku2] [#1640]](https://github.com/yewstack/yew/pull/1640) + +- #### ⚡️ Features + + - Implicit optional attributes (#1637). [[@siku2] [#1637]](https://github.com/yewstack/yew/pull/1637) + - Added callback_future_once in yewtil (#1696) (#1712). [[@fraillt] [#1696]](https://github.com/yewstack/yew/pull/1696) + - Added relevant examples section to the docs (#1695). [[@oOBoomberOo] [#1695]](https://github.com/yewstack/yew/pull/1695) + - Enable std feature for indexmap (#1709). [[@jstarry] [#1709]](https://github.com/yewstack/yew/pull/1709) + - Added missing KeyboardService re-export (#1694). [[@SOF3] [#1694]](https://github.com/yewstack/yew/pull/1694) + - Clean up component lifecycle state (#1700). [[@jstarry] [#1700]](https://github.com/yewstack/yew/pull/1700) + - Move top-level crates to packages/ (#1680). [[@philip-peterson] [#1680]](https://github.com/yewstack/yew/pull/1680) + - Refactor component lifecycle event handling (#1692). [[@jstarry] [#1692]](https://github.com/yewstack/yew/pull/1692) + - Prune stdweb examples to reduce maintenance burden (#1690). [[@jstarry] [#1690]](https://github.com/yewstack/yew/pull/1690) + - Refactor html module into new component submodule (#1689). [[@jstarry] [#1689]](https://github.com/yewstack/yew/pull/1689) + - Rename internal Agent structs to match Component (#1688). [[@jstarry] [#1688]](https://github.com/yewstack/yew/pull/1688) + - Revert "Update rand requirement from 0.7 to 0.8 (#1682)" (#1684). [[@siku2] [#1682]](https://github.com/yewstack/yew/pull/1682) + - Add discussion link to issue selector (#1674). [[@jstarry] [#1674]](https://github.com/yewstack/yew/pull/1674) + - Update link to Material Design Components (#1662). [[@TapioT] [#1662]](https://github.com/yewstack/yew/pull/1662) + - Extract Classes to a separate macro (#1601). [[@cecton] [#1601]](https://github.com/yewstack/yew/pull/1601) + - Improve the "keyed_list" example (#1650). [[@titaneric] [#1650]](https://github.com/yewstack/yew/pull/1650) + - Apply new Clippy lints, examples deployment, and stdweb integration tests (#1651). [[@siku2] [#1651]](https://github.com/yewstack/yew/pull/1651) + - Add documentation for component children (#1616). [[@K4rakara] [#1616]](https://github.com/yewstack/yew/pull/1616) + - More ergonomic use state 1505 (#1630). [[@mattferrin] [#1630]](https://github.com/yewstack/yew/pull/1630) + - Remove Drop bound from Task trait (#1627). [[@siku2] [#1627]](https://github.com/yewstack/yew/pull/1627) + - Document dynamic tag names (#1628). [[@siku2] [#1628]](https://github.com/yewstack/yew/pull/1628) + - Add a macro for building properties outside of html! (#1599). [[@siku2] [#1599]](https://github.com/yewstack/yew/pull/1599) + ## ✨ **0.17.4** *(2020-10-18)* #### Changelog @@ -301,7 +334,7 @@ Lastly, take note that API docs on https://docs.rs/yew will be using the `"web_s - Implemented `PartialEq` for `ChildrenRenderer` to allow `children` comparison. [[@jstarry], [#916](https://github.com/yewstack/yew/pull/916)] - Reduced restrictions on `ComponentLink` methods to improve `Future` support. [[@jplatte], [#931](https://github.com/yewstack/yew/pull/931)] - Added `referrer`, `referrer_policy` and `integrity` to `FetchOptions`. [[@leo-lb], [#931](https://github.com/yewstack/yew/pull/931)] - + - #### 🛠 Fixes - Fixed touch event listeners. [[@AlephAlpha], [#872](https://github.com/yewstack/yew/pull/872)] diff --git a/Cargo.toml b/Cargo.toml index 227bc064108..036c5fec83b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,4 +44,7 @@ members = [ "examples/todomvc", "examples/two_apps", "examples/webgl", + + # Release tools + "packages/changelog", ] diff --git a/packages/changelog/Cargo.toml b/packages/changelog/Cargo.toml new file mode 100644 index 00000000000..103d92d9d51 --- /dev/null +++ b/packages/changelog/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "changelog" +version = "0.1.0" +authors = ["Cecile Tonglet "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1" +chrono = "0.4" +git2 = "0.13" +regex = "1" +reqwest = { version = "0.11", features = ["blocking", "json"] } +serde = { version = "1", features = ["derive"] } +structopt = "0.3" diff --git a/packages/changelog/src/main.rs b/packages/changelog/src/main.rs new file mode 100644 index 00000000000..a3c5a2281cc --- /dev/null +++ b/packages/changelog/src/main.rs @@ -0,0 +1,208 @@ +use anyhow::{bail, Context, Result}; +use serde::Deserialize; +use std::collections::HashMap; +use std::fs; +use std::io; +use std::io::Write; +use structopt::StructOpt; + +fn main() -> Result<()> { + Cli::from_args().run() +} + +#[derive(StructOpt)] +pub struct Cli { + /// From commit. + from: String, + + /// To commit. + #[structopt(default_value = "HEAD")] + to: String, + + #[structopt(skip = Self::open_repository())] + repo: git2::Repository, + + #[structopt(skip)] + github_users: GitHubUsers, + + #[structopt(skip = regex::Regex::new(r"\(#(\d+)\)").unwrap())] + re_issue: regex::Regex, +} + +impl Cli { + fn open_repository() -> git2::Repository { + match git2::Repository::open(".") { + Err(err) => { + eprintln!("Error: could not open repository: {}", err); + std::process::exit(1); + } + Ok(repo) => repo, + } + } + + fn run(&mut self) -> Result<()> { + let mut old_changelog = + fs::File::open("CHANGELOG.md").context("could not open CHANGELOG.md for reading")?; + let mut f = fs::OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open("CHANGELOG.md.new") + .context("could not open CHANGELOG.md.new for writing")?; + + let mut revwalk = self.repo.revwalk()?; + revwalk.set_sorting(git2::Sort::TOPOLOGICAL)?; + + let from_object = self + .repo + .revparse_single(&self.from) + .context("Could not find `from` revision")?; + let to_object = self + .repo + .revparse_single(&self.to) + .context("Could not find `to` revision")?; + revwalk.hide(from_object.id())?; + revwalk.push(to_object.id())?; + + let mut logs = Vec::new(); + for oid in revwalk { + let oid = oid?; + let commit = self.repo.find_commit(oid)?; + let first_line = commit + .message() + .context("Invalid UTF-8 in commit message")? + .lines() + .next() + .context("Missing commit message")?; + let author = commit.author(); + let email = author.email().context("Missing author's email")?; + + if email.contains("dependabot") { + continue; + } + + let issue = + if let Some(issue) = self.re_issue.captures(first_line).map(|x| x[1].to_string()) { + issue + } else { + eprintln!("Missing issue for commit: {}", oid); + continue; + }; + + let user = self + .github_users + .find_user_by_commit_author(email, oid.to_string()) + .with_context(|| format!("Could not find GitHub user for commit: {}", oid))?; + + logs.push((first_line.to_owned(), user.to_owned(), issue.to_owned())); + } + + let (features, fixes): (Vec<_>, Vec<_>) = logs + .into_iter() + .partition(|(msg, _, _)| msg.to_lowercase().contains("fix")); + + writeln!( + f, + "## ✨ **x.y.z** *({})*", + chrono::Utc::now().format("%Y-%m-%d") + )?; + writeln!(f)?; + writeln!(f, "#### Changelog")?; + writeln!(f)?; + + writeln!(f, "- #### 🛠 Fixes")?; + writeln!(f)?; + for (msg, user, issue) in fixes { + writeln!( + f, + " - {msg}. [[@{user}] [#{issue}]](https://github.com/yewstack/yew/pull/{issue})", + msg = msg, + user = user, + issue = issue + )?; + } + + writeln!(f, "- #### ⚡️ Features")?; + writeln!(f)?; + for (msg, user, issue) in features { + writeln!( + f, + " - {msg}. [[@{user}] [#{issue}]](https://github.com/yewstack/yew/pull/{issue})", + msg = msg, + user = user, + issue = issue + )?; + } + + writeln!(f)?; + io::copy(&mut old_changelog, &mut f)?; + + drop(old_changelog); + drop(f); + + fs::remove_file("CHANGELOG.md").context("Could not delete CHANGELOG.md")?; + fs::rename("CHANGELOG.md.new", "CHANGELOG.md") + .context("Could not replace CHANGELOG.md with CHANGELOG.md.new")?; + + Ok(()) + } +} + +#[derive(Debug, Default)] +pub struct GitHubUsers { + cache: HashMap>, +} + +impl GitHubUsers { + pub fn find_user_by_commit_author( + &mut self, + key: impl Into, + commit: impl AsRef, + ) -> Option<&str> { + self.cache + .entry(key.into()) + .or_insert_with(|| match Self::query_commit(commit) { + Ok(value) => value, + Err(err) => { + eprintln!("Error: {}", err); + None + } + }) + .as_deref() + } + + fn query_commit(q: impl AsRef) -> Result> { + std::thread::sleep(std::time::Duration::from_secs(1)); + let client = reqwest::blocking::Client::new(); + let resp = client + .get(format!( + "https://api.github.com/repos/yewstack/yew/commits/{}", + q.as_ref(), + )) + .header("user-agent", "reqwest") + .header("accept", "application/vnd.github.v3+json") + .send()?; + let status = resp.status(); + if !status.is_success() { + if let Some(remaining) = resp.headers().get("x-ratelimit-remaining") { + if remaining == "0" { + bail!("GitHub API limit reached."); + } + } + bail!("GitHub API request error: {}", status); + } + let body = resp.json::()?; + + Ok(Some(body.author.login)) + } +} + +#[derive(Deserialize, Debug)] +pub struct GitHubCommitApi { + author: GitHubCommitAuthorApi, +} + +#[derive(Deserialize, Debug)] +pub struct GitHubCommitAuthorApi { + login: String, +} diff --git a/packages/yew-macro/src/props/component.rs b/packages/yew-macro/src/props/component.rs index b735e95d0f0..e9b9085b335 100644 --- a/packages/yew-macro/src/props/component.rs +++ b/packages/yew-macro/src/props/component.rs @@ -146,13 +146,11 @@ impl ComponentProps { )} }); - let set_children = if let Some(children) = children_renderer { - Some(quote_spanned! {props_ty.span()=> + let set_children = children_renderer.map(|children| { + quote_spanned! {props_ty.span()=> .children(#children) - }) - } else { - None - }; + } + }); quote_spanned! {props_ty.span()=> <#props_ty as ::yew::html::Properties>::builder() @@ -163,13 +161,11 @@ impl ComponentProps { } Self::With(with_props) => { let ident = Ident::new("__yew_props", props_ty.span()); - let set_children = if let Some(children) = children_renderer { - Some(quote_spanned! {props_ty.span()=> + let set_children = children_renderer.map(|children| { + quote_spanned! {props_ty.span()=> #ident.children = #children; - }) - } else { - None - }; + } + }); let expr = &with_props.expr; quote! { diff --git a/packages/yewtil/src/store.rs b/packages/yewtil/src/store.rs index 06a079b6360..05f4e813b25 100644 --- a/packages/yewtil/src/store.rs +++ b/packages/yewtil/src/store.rs @@ -90,8 +90,8 @@ impl Agent for StoreWrapper { StoreWrapper { handlers, - state, link, + state, self_dispatcher, } } From 65888ef4143f0731e823c12243ba8bbd9bc7e8f3 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 15 May 2021 12:08:16 +0100 Subject: [PATCH 2/5] Fix invalid README paths --- packages/yew/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index 560d12a0f18..1156e4a2d61 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -11,6 +11,7 @@ homepage = "https://github.com/yewstack/yew" documentation = "https://docs.rs/yew/" license = "MIT OR Apache-2.0" readme = "../README.md" +readme = "../../README.md" keywords = ["web", "webasm", "javascript"] categories = ["gui", "wasm", "web-programming"] description = "A framework for making client-side single-page apps" From fbab1ec260a6b7424549757a247276a65d8de1f5 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sun, 16 May 2021 08:17:11 +0100 Subject: [PATCH 3/5] Fix CHANGELOG issues --- CHANGELOG.md | 44 +++++++++++++++++----------------- packages/changelog/src/main.rs | 4 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a308286f908..4d6a91d36e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,28 +10,28 @@ - #### ⚡️ Features - - Implicit optional attributes (#1637). [[@siku2] [#1637]](https://github.com/yewstack/yew/pull/1637) - - Added callback_future_once in yewtil (#1696) (#1712). [[@fraillt] [#1696]](https://github.com/yewstack/yew/pull/1696) - - Added relevant examples section to the docs (#1695). [[@oOBoomberOo] [#1695]](https://github.com/yewstack/yew/pull/1695) - - Enable std feature for indexmap (#1709). [[@jstarry] [#1709]](https://github.com/yewstack/yew/pull/1709) - - Added missing KeyboardService re-export (#1694). [[@SOF3] [#1694]](https://github.com/yewstack/yew/pull/1694) - - Clean up component lifecycle state (#1700). [[@jstarry] [#1700]](https://github.com/yewstack/yew/pull/1700) - - Move top-level crates to packages/ (#1680). [[@philip-peterson] [#1680]](https://github.com/yewstack/yew/pull/1680) - - Refactor component lifecycle event handling (#1692). [[@jstarry] [#1692]](https://github.com/yewstack/yew/pull/1692) - - Prune stdweb examples to reduce maintenance burden (#1690). [[@jstarry] [#1690]](https://github.com/yewstack/yew/pull/1690) - - Refactor html module into new component submodule (#1689). [[@jstarry] [#1689]](https://github.com/yewstack/yew/pull/1689) - - Rename internal Agent structs to match Component (#1688). [[@jstarry] [#1688]](https://github.com/yewstack/yew/pull/1688) - - Revert "Update rand requirement from 0.7 to 0.8 (#1682)" (#1684). [[@siku2] [#1682]](https://github.com/yewstack/yew/pull/1682) - - Add discussion link to issue selector (#1674). [[@jstarry] [#1674]](https://github.com/yewstack/yew/pull/1674) - - Update link to Material Design Components (#1662). [[@TapioT] [#1662]](https://github.com/yewstack/yew/pull/1662) - - Extract Classes to a separate macro (#1601). [[@cecton] [#1601]](https://github.com/yewstack/yew/pull/1601) - - Improve the "keyed_list" example (#1650). [[@titaneric] [#1650]](https://github.com/yewstack/yew/pull/1650) - - Apply new Clippy lints, examples deployment, and stdweb integration tests (#1651). [[@siku2] [#1651]](https://github.com/yewstack/yew/pull/1651) - - Add documentation for component children (#1616). [[@K4rakara] [#1616]](https://github.com/yewstack/yew/pull/1616) - - More ergonomic use state 1505 (#1630). [[@mattferrin] [#1630]](https://github.com/yewstack/yew/pull/1630) - - Remove Drop bound from Task trait (#1627). [[@siku2] [#1627]](https://github.com/yewstack/yew/pull/1627) - - Document dynamic tag names (#1628). [[@siku2] [#1628]](https://github.com/yewstack/yew/pull/1628) - - Add a macro for building properties outside of html! (#1599). [[@siku2] [#1599]](https://github.com/yewstack/yew/pull/1599) + - Implicit optional attributes (#1637). [[@siku2], [#1637](https://github.com/yewstack/yew/pull/1637)] + - Added callback_future_once in yewtil (#1696) (#1712). [[@fraillt], [#1696](https://github.com/yewstack/yew/pull/1696)] + - Added relevant examples section to the docs (#1695). [[@oOBoomberOo], [#1695](https://github.com/yewstack/yew/pull/1695)] + - Enable std feature for indexmap (#1709). [[@jstarry], [#1709](https://github.com/yewstack/yew/pull/1709)] + - Added missing KeyboardService re-export (#1694). [[@SOF3], [#1694](https://github.com/yewstack/yew/pull/1694)] + - Clean up component lifecycle state (#1700). [[@jstarry], [#1700](https://github.com/yewstack/yew/pull/1700)] + - Move top-level crates to packages/ (#1680). [[@philip-peterson], [#1680](https://github.com/yewstack/yew/pull/1680)] + - Refactor component lifecycle event handling (#1692). [[@jstarry], [#1692](https://github.com/yewstack/yew/pull/1692)] + - Prune stdweb examples to reduce maintenance burden (#1690). [[@jstarry], [#1690](https://github.com/yewstack/yew/pull/1690)] + - Refactor html module into new component submodule (#1689). [[@jstarry], [#1689](https://github.com/yewstack/yew/pull/1689)] + - Rename internal Agent structs to match Component (#1688). [[@jstarry], [#1688](https://github.com/yewstack/yew/pull/1688)] + - Revert "Update rand requirement from 0.7 to 0.8 (#1682)" (#1684). [[@siku2], [#1682](https://github.com/yewstack/yew/pull/1682)] + - Add discussion link to issue selector (#1674). [[@jstarry], [#1674](https://github.com/yewstack/yew/pull/1674)] + - Update link to Material Design Components (#1662). [[@TapioT], [#1662](https://github.com/yewstack/yew/pull/1662)] + - Extract Classes to a separate macro (#1601). [[@cecton], [#1601](https://github.com/yewstack/yew/pull/1601)] + - Improve the "keyed_list" example (#1650). [[@titaneric], [#1650](https://github.com/yewstack/yew/pull/1650)] + - Apply new Clippy lints, examples deployment, and stdweb integration tests (#1651). [[@siku2], [#1651](https://github.com/yewstack/yew/pull/1651)] + - Add documentation for component children (#1616). [[@K4rakara], [#1616](https://github.com/yewstack/yew/pull/1616)] + - More ergonomic use state 1505 (#1630). [[@mattferrin], [#1630](https://github.com/yewstack/yew/pull/1630)] + - Remove Drop bound from Task trait (#1627). [[@siku2], [#1627](https://github.com/yewstack/yew/pull/1627)] + - Document dynamic tag names (#1628). [[@siku2], [#1628](https://github.com/yewstack/yew/pull/1628)] + - Add a macro for building properties outside of html! (#1599). [[@siku2], [#1599](https://github.com/yewstack/yew/pull/1599)] ## ✨ **0.17.4** *(2020-10-18)* diff --git a/packages/changelog/src/main.rs b/packages/changelog/src/main.rs index a3c5a2281cc..04cd2074103 100644 --- a/packages/changelog/src/main.rs +++ b/packages/changelog/src/main.rs @@ -115,7 +115,7 @@ impl Cli { for (msg, user, issue) in fixes { writeln!( f, - " - {msg}. [[@{user}] [#{issue}]](https://github.com/yewstack/yew/pull/{issue})", + " - {msg}. [[@{user}], [#{issue}](https://github.com/yewstack/yew/pull/{issue})]", msg = msg, user = user, issue = issue @@ -127,7 +127,7 @@ impl Cli { for (msg, user, issue) in features { writeln!( f, - " - {msg}. [[@{user}] [#{issue}]](https://github.com/yewstack/yew/pull/{issue})", + " - {msg}. [[@{user}], [#{issue}](https://github.com/yewstack/yew/pull/{issue})]", msg = msg, user = user, issue = issue From dee96af635ef4bad1e87e496576b84f651f83e7f Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sun, 16 May 2021 14:08:46 +0100 Subject: [PATCH 4/5] Oops --- packages/yew/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index 1156e4a2d61..8c7d097dbd5 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -10,7 +10,6 @@ repository = "https://github.com/yewstack/yew" homepage = "https://github.com/yewstack/yew" documentation = "https://docs.rs/yew/" license = "MIT OR Apache-2.0" -readme = "../README.md" readme = "../../README.md" keywords = ["web", "webasm", "javascript"] categories = ["gui", "wasm", "web-programming"] From 19b022adadc4619b3397dda1f5ccc99e05ff522d Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sun, 16 May 2021 13:57:42 +0100 Subject: [PATCH 5/5] Changelog fixes (#1849) --- CHANGELOG.md | 37 +++++++++++----------------- README.md | 2 +- packages/changelog/src/main.rs | 19 ++++++++------ packages/yew-router-macro/Cargo.toml | 2 +- 4 files changed, 28 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d6a91d36e2..e3aeead8766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,32 +6,23 @@ - #### 🛠 Fixes - - Fix missing redirects (#1640). [[@siku2] [#1640]](https://github.com/yewstack/yew/pull/1640) + - Fix missing redirects. [[@siku2](https://github.com/siku2), [#1640](https://github.com/yewstack/yew/pull/1640)] + - Remove Drop bound from Task trait. [[@siku2](https://github.com/siku2), [#1627](https://github.com/yewstack/yew/pull/1627)] + - Enable std feature for indexmap. [[@jstarry](https://github.com/jstarry), [#1709](https://github.com/yewstack/yew/pull/1709)] - #### ⚡️ Features - - Implicit optional attributes (#1637). [[@siku2], [#1637](https://github.com/yewstack/yew/pull/1637)] - - Added callback_future_once in yewtil (#1696) (#1712). [[@fraillt], [#1696](https://github.com/yewstack/yew/pull/1696)] - - Added relevant examples section to the docs (#1695). [[@oOBoomberOo], [#1695](https://github.com/yewstack/yew/pull/1695)] - - Enable std feature for indexmap (#1709). [[@jstarry], [#1709](https://github.com/yewstack/yew/pull/1709)] - - Added missing KeyboardService re-export (#1694). [[@SOF3], [#1694](https://github.com/yewstack/yew/pull/1694)] - - Clean up component lifecycle state (#1700). [[@jstarry], [#1700](https://github.com/yewstack/yew/pull/1700)] - - Move top-level crates to packages/ (#1680). [[@philip-peterson], [#1680](https://github.com/yewstack/yew/pull/1680)] - - Refactor component lifecycle event handling (#1692). [[@jstarry], [#1692](https://github.com/yewstack/yew/pull/1692)] - - Prune stdweb examples to reduce maintenance burden (#1690). [[@jstarry], [#1690](https://github.com/yewstack/yew/pull/1690)] - - Refactor html module into new component submodule (#1689). [[@jstarry], [#1689](https://github.com/yewstack/yew/pull/1689)] - - Rename internal Agent structs to match Component (#1688). [[@jstarry], [#1688](https://github.com/yewstack/yew/pull/1688)] - - Revert "Update rand requirement from 0.7 to 0.8 (#1682)" (#1684). [[@siku2], [#1682](https://github.com/yewstack/yew/pull/1682)] - - Add discussion link to issue selector (#1674). [[@jstarry], [#1674](https://github.com/yewstack/yew/pull/1674)] - - Update link to Material Design Components (#1662). [[@TapioT], [#1662](https://github.com/yewstack/yew/pull/1662)] - - Extract Classes to a separate macro (#1601). [[@cecton], [#1601](https://github.com/yewstack/yew/pull/1601)] - - Improve the "keyed_list" example (#1650). [[@titaneric], [#1650](https://github.com/yewstack/yew/pull/1650)] - - Apply new Clippy lints, examples deployment, and stdweb integration tests (#1651). [[@siku2], [#1651](https://github.com/yewstack/yew/pull/1651)] - - Add documentation for component children (#1616). [[@K4rakara], [#1616](https://github.com/yewstack/yew/pull/1616)] - - More ergonomic use state 1505 (#1630). [[@mattferrin], [#1630](https://github.com/yewstack/yew/pull/1630)] - - Remove Drop bound from Task trait (#1627). [[@siku2], [#1627](https://github.com/yewstack/yew/pull/1627)] - - Document dynamic tag names (#1628). [[@siku2], [#1628](https://github.com/yewstack/yew/pull/1628)] - - Add a macro for building properties outside of html! (#1599). [[@siku2], [#1599](https://github.com/yewstack/yew/pull/1599)] + - Implicit optional attributes. [[@siku2](https://github.com/siku2), [#1637](https://github.com/yewstack/yew/pull/1637)] + - Added callback_future_once in yewtil.(#1712). [[@fraillt](https://github.com/fraillt), [#1696](https://github.com/yewstack/yew/pull/1696)] + - Added relevant examples section to the docs. [[@oOBoomberOo](https://github.com/oOBoomberOo), [#1695](https://github.com/yewstack/yew/pull/1695)] + - Added missing KeyboardService re-export. [[@SOF3](https://github.com/SOF3), [#1694](https://github.com/yewstack/yew/pull/1694)] + - Rename internal Agent structs to match Component. [[@jstarry](https://github.com/jstarry), [#1688](https://github.com/yewstack/yew/pull/1688)] + - Add discussion link to issue selector. [[@jstarry](https://github.com/jstarry), [#1674](https://github.com/yewstack/yew/pull/1674)] + - Update link to Material Design Components. [[@TapioT](https://github.com/TapioT), [#1662](https://github.com/yewstack/yew/pull/1662)] + - Extract Classes to a separate macro. [[@cecton](https://github.com/cecton), [#1601](https://github.com/yewstack/yew/pull/1601)] + - Improve the "keyed_list" example. [[@titaneric](https://github.com/titaneric), [#1650](https://github.com/yewstack/yew/pull/1650)] + - Add documentation for component children. [[@K4rakara](https://github.com/K4rakara), [#1616](https://github.com/yewstack/yew/pull/1616)] + - Add a macro for building properties outside of html!. [[@siku2](https://github.com/siku2), [#1599](https://github.com/yewstack/yew/pull/1599)] ## ✨ **0.17.4** *(2020-10-18)* diff --git a/README.md b/README.md index 52703ce06fe..11d6aef5c46 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ | Documentation (latest) | - Examples + Examples | Changelog | diff --git a/packages/changelog/src/main.rs b/packages/changelog/src/main.rs index 04cd2074103..52a33145dd6 100644 --- a/packages/changelog/src/main.rs +++ b/packages/changelog/src/main.rs @@ -25,7 +25,7 @@ pub struct Cli { #[structopt(skip)] github_users: GitHubUsers, - #[structopt(skip = regex::Regex::new(r"\(#(\d+)\)").unwrap())] + #[structopt(skip = regex::Regex::new(r"\s*\(#(\d+)\)").unwrap())] re_issue: regex::Regex, } @@ -81,9 +81,14 @@ impl Cli { continue; } - let issue = - if let Some(issue) = self.re_issue.captures(first_line).map(|x| x[1].to_string()) { - issue + let (issue, first_line) = + if let Some(caps) = self.re_issue.captures_iter(first_line).last() { + let first_line_stripped = vec![ + &first_line[..caps.get(0).unwrap().start()], + &first_line[caps.get(0).unwrap().end()..], + ] + .join(""); + (caps[1].to_string(), first_line_stripped) } else { eprintln!("Missing issue for commit: {}", oid); continue; @@ -94,7 +99,7 @@ impl Cli { .find_user_by_commit_author(email, oid.to_string()) .with_context(|| format!("Could not find GitHub user for commit: {}", oid))?; - logs.push((first_line.to_owned(), user.to_owned(), issue.to_owned())); + logs.push((first_line.to_string(), user.to_owned(), issue.to_owned())); } let (features, fixes): (Vec<_>, Vec<_>) = logs @@ -115,7 +120,7 @@ impl Cli { for (msg, user, issue) in fixes { writeln!( f, - " - {msg}. [[@{user}], [#{issue}](https://github.com/yewstack/yew/pull/{issue})]", + " - {msg}. [[@{user}](https://github.com/{user}), [#{issue}](https://github.com/yewstack/yew/pull/{issue})]", msg = msg, user = user, issue = issue @@ -127,7 +132,7 @@ impl Cli { for (msg, user, issue) in features { writeln!( f, - " - {msg}. [[@{user}], [#{issue}](https://github.com/yewstack/yew/pull/{issue})]", + " - {msg}. [[@{user}](https://github.com/{user}), [#{issue}](https://github.com/yewstack/yew/pull/{issue})]", msg = msg, user = user, issue = issue diff --git a/packages/yew-router-macro/Cargo.toml b/packages/yew-router-macro/Cargo.toml index d28da0f2337..b8e486f1c11 100644 --- a/packages/yew-router-macro/Cargo.toml +++ b/packages/yew-router-macro/Cargo.toml @@ -17,4 +17,4 @@ yew-router-route-parser = { version = "0.14.0", path = "../yew-router-route-pars proc-macro2 = "1.0.1" [dev-dependencies] -yew-router = { version = "0.14.0", path = "../yew-router" } # This should probably be removed, it makes the deploy process much more annoying. +yew-router = { version = "0.15.0", path = "../yew-router" } # This should probably be removed, it makes the deploy process much more annoying.