From 6296b4ce390b0b344ca244d12fe5f889aad73265 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Wed, 11 May 2022 15:09:03 -0400 Subject: [PATCH 01/11] Test on commits target main and diesel-2 (#22) --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 340a35d..606fcd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,9 @@ name: Rust on: push: - branches: [master] + branches: [main, diesel-2] pull_request: - branches: [master] + branches: [main, diesel-2] env: CARGO_TERM_COLOR: always jobs: From 35eb4fa048933617cf894c738cf005e5d2e76817 Mon Sep 17 00:00:00 2001 From: adwhit Date: Wed, 11 May 2022 20:13:11 +0100 Subject: [PATCH 02/11] remove unused diesel dependency (#17) --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c6245f3..3cb84c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ travis-ci = { repository = "quodlibetor/diesel-derive-newtype", branch = "master proc-macro2 = "0.4" syn = "0.14" quote = "0.6" -diesel = "1" [dev-dependencies] diesel = { version = "1", features = ["sqlite"] } From 2f01b96b5e43d5cc73b12cd256311826391fc6ab Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Wed, 11 May 2022 15:21:27 -0400 Subject: [PATCH 03/11] Release as 1.0 --- Cargo.toml | 4 ++-- README.md | 7 ++++--- README.tpl | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3cb84c5..6f5444b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel-derive-newtype" -version = "0.2.0" +version = "1.0.0" authors = ["Brandon W Maister "] license = "Apache-2.0/MIT" readme = "README.md" @@ -10,7 +10,7 @@ description = "Automatically connect newtypes to Diesel using their wrapped type repository = "https://github.com/quodlibetor/diesel-derive-newtype" [badges] -travis-ci = { repository = "quodlibetor/diesel-derive-newtype", branch = "master" } +maintenance = { status = "passively-maintained" } [dependencies] proc-macro2 = "0.4" diff --git a/README.md b/README.md index 39ba7c0..1f85034 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Easy-peasy support of newtypes inside of Diesel. -[![Build Status](https://travis-ci.org/quodlibetor/diesel-derive-newtype.svg?branch=master)](https://travis-ci.org/quodlibetor/diesel-derive-newtype) [![Crates.io Version](https://img.shields.io/crates/v/diesel-derive-newtype.svg)](https://crates.io/crates/diesel-derive-newtype) +[![Rust](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml/badge.svg)](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml) [![Crates.io Version](https://img.shields.io/crates/v/diesel-derive-newtype.svg)](https://crates.io/crates/diesel-derive-newtype) ## `#[derive(DieselNewType)]` @@ -115,11 +115,12 @@ the underlying SQL type. ## Installation -diesel-derive-newtype supports Diesel 0.16 - 0.99. +diesel-derive-newtype supports Diesel according to its major version -- 0.x +through 1.x support the corresponding diesel versions, 2.x supports diesel 2.x. ```toml [dependencies] -diesel-derive-newtype = "0.1" +diesel-derive-newtype = "1.0" ``` ## License diff --git a/README.tpl b/README.tpl index ab1488a..3cfb0d7 100644 --- a/README.tpl +++ b/README.tpl @@ -2,17 +2,18 @@ Easy-peasy support of newtypes inside of Diesel. -[![Build Status](https://travis-ci.org/quodlibetor/diesel-derive-newtype.svg?branch=master)](https://travis-ci.org/quodlibetor/diesel-derive-newtype) [![Crates.io Version](https://img.shields.io/crates/v/diesel-derive-newtype.svg)](https://crates.io/crates/diesel-derive-newtype) +[![Rust](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml/badge.svg)](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml) [![Crates.io Version](https://img.shields.io/crates/v/diesel-derive-newtype.svg)](https://crates.io/crates/diesel-derive-newtype) {{readme}} ## Installation -diesel-derive-newtype supports Diesel 0.16 - 0.99. +diesel-derive-newtype supports Diesel according to its major version -- 0.x +through 1.x support the corresponding diesel versions, 2.x supports diesel 2.x. ```toml [dependencies] -diesel-derive-newtype = "0.1" +diesel-derive-newtype = "1.0" ``` ## License From 33fc2b08d909d989d4d374fe79928df3a057c670 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Thu, 12 May 2022 13:50:22 -0400 Subject: [PATCH 04/11] Make README a bit clearer about how to use with Diesel 2.0 --- README.md | 29 +++++++++++++++++++---------- README.tpl | 13 +++++++++++-- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1f85034..b4b0457 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,25 @@ Easy-peasy support of newtypes inside of Diesel. [![Rust](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml/badge.svg)](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml) [![Crates.io Version](https://img.shields.io/crates/v/diesel-derive-newtype.svg)](https://crates.io/crates/diesel-derive-newtype) +## Installation + +diesel-derive-newtype supports Diesel according to its major version -- 0.x +through 1.x support the corresponding diesel versions, 2.x supports diesel 2.x. + +So for Diesel 1.x: + +```toml +[dependencies] +diesel-derive-newtype = "1.0" +``` + +And for Diesel 2.x: + +```toml +[dependencies] +diesel-derive-newtype = "2.0.0-rc.0" +``` + ## `#[derive(DieselNewType)]` This crate exposes a single custom-derive macro `DieselNewType` which @@ -113,16 +132,6 @@ I hope to find a solution that doesn't involve implementing every keep in mind that the Diesel methods basically auto-transmute your data into the underlying SQL type. -## Installation - -diesel-derive-newtype supports Diesel according to its major version -- 0.x -through 1.x support the corresponding diesel versions, 2.x supports diesel 2.x. - -```toml -[dependencies] -diesel-derive-newtype = "1.0" -``` - ## License diesel-derive-newtype is licensed under either of diff --git a/README.tpl b/README.tpl index 3cfb0d7..a90b4a9 100644 --- a/README.tpl +++ b/README.tpl @@ -4,18 +4,27 @@ Easy-peasy support of newtypes inside of Diesel. [![Rust](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml/badge.svg)](https://github.com/quodlibetor/diesel-derive-newtype/actions/workflows/test.yml) [![Crates.io Version](https://img.shields.io/crates/v/diesel-derive-newtype.svg)](https://crates.io/crates/diesel-derive-newtype) -{{readme}} - ## Installation diesel-derive-newtype supports Diesel according to its major version -- 0.x through 1.x support the corresponding diesel versions, 2.x supports diesel 2.x. +So for Diesel 1.x: + ```toml [dependencies] diesel-derive-newtype = "1.0" ``` +And for Diesel 2.x: + +```toml +[dependencies] +diesel-derive-newtype = "2.0.0-rc.0" +``` + +{{readme}} + ## License diesel-derive-newtype is licensed under either of From fbac15b2f2d039c148dd31ad66e3e4066489e5a5 Mon Sep 17 00:00:00 2001 From: Ben Sully Date: Sun, 26 Feb 2023 16:36:05 +0000 Subject: [PATCH 05/11] Bump syn/quote/proc-macro2 dependencies to v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The versions of those crates used by this crate are quite old, and cargo nightly is warning that syn 0.14.9 will be rejected by a future version of Rust: ☸ prod-us-central-3 (hosted-grafana) in diesel-derive-newtype on  main is 📦 v1.0.0 via 🦀 v1.67.1 ❯ cargo +nightly c --future-incompat-report Finished dev [unoptimized + debuginfo] target(s) in 0.05s warning: the following packages contain code that will be rejected by a future version of Rust: syn v0.14.9 note: To solve this problem, you can try the following approaches: - Some affected dependencies have newer versions available. You may want to consider updating them to a newer version to see if the issue has been fixed. syn v0.14.9 has the following newer versions available: 0.15.0, 0.15.1, 0.15.3, 0.15.4, 0.15.5, 0.15.6, 0.15.7, 0.15.8, 0.15.9, 0.15.10, 0.15.11, 0.15.12, 0.15.13, 0.15.14, 0.15.15, 0.15.16, 0.15.17, 0.15.18, 0.15.19, 0.15.20, 0.15.21, 0.15.22, 0.15.23, 0.15.24, 0.15.25, 0.15.26, 0.15.27, 0.15.28, 0.15.29, 0.15.30, 0.15.31, 0.15.32, 0.15.33, 0.15.34, 0.15.35, 0.15.36, 0.15.37, 0.15.38, 0.15.39, 0.15.40, 0.15.41, 0.15.42, 0.15.43, 0.15.44, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.15, 1.0.16, 1.0.17, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.22, 1.0.23, 1.0.24, 1.0.25, 1.0.26, 1.0.27, 1.0.28, 1.0.29, 1.0.30, 1.0.31, 1.0.32, 1.0.33, 1.0.34, 1.0.35, 1.0.36, 1.0.37, 1.0.38, 1.0.39, 1.0.40, 1.0.41, 1.0.42, 1.0.43, 1.0.44, 1.0.45, 1.0.46, 1.0.47, 1.0.48, 1.0.50, 1.0.51, 1.0.52, 1.0.53, 1.0.54, 1.0.55, 1.0.56, 1.0.57, 1.0.58, 1.0.59, 1.0.60, 1.0.61, 1.0.62, 1.0.63, 1.0.64, 1.0.65, 1.0.66, 1.0.67, 1.0.68, 1.0.69, 1.0.70, 1.0.71, 1.0.72, 1.0.73, 1.0.74, 1.0.75, 1.0.76, 1.0.77, 1.0.78, 1.0.79, 1.0.80, 1.0.81, 1.0.82, 1.0.83, 1.0.84, 1.0.85, 1.0.86, 1.0.87, 1.0.88, 1.0.89, 1.0.90, 1.0.91, 1.0.92, 1.0.93, 1.0.94, 1.0.95, 1.0.96, 1.0.97, 1.0.98, 1.0.99, 1.0.100, 1.0.101, 1.0.102, 1.0.103, 1.0.104, 1.0.105, 1.0.106, 1.0.107, 1.0.108, 1.0.109 - If the issue is not solved by updating the dependencies, a fix has to be implemented by those dependencies. You can help with that by notifying the maintainers of this problem (e.g. by creating a bug report) or by proposing a fix to the maintainers (e.g. by creating a pull request): - syn@0.14.9 - Repository: https://github.com/dtolnay/syn - Detailed warning command: `cargo report future-incompatibilities --id 2 --package syn@0.14.9` - If waiting for an upstream fix is not an option, you can use the `[patch]` section in `Cargo.toml` to use your own version of the dependency. For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section note: this report can be shown with `cargo report future-incompatibilities --id 1` This just bumps the dependencies to stable v1 ones, which should also help compile times since other projects tend to use v1 of those dependencies now. --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6f5444b..d1fadf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,9 @@ repository = "https://github.com/quodlibetor/diesel-derive-newtype" maintenance = { status = "passively-maintained" } [dependencies] -proc-macro2 = "0.4" -syn = "0.14" -quote = "0.6" +proc-macro2 = "1.0.51" +syn = "1.0.109" +quote = "1.0.23" [dev-dependencies] diesel = { version = "1", features = ["sqlite"] } From 0d566cc5908ff497ab40f32a50c1d6c4d064531d Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sat, 25 Mar 2023 13:18:07 -0400 Subject: [PATCH 06/11] Update changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 103384d..d30a63e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 1.0.1 + +* Update syn/quote/proc-macro2 dependencies to 1.x + +# 1.0.0 + +* Remove non-dev dependency on `diesel` -- `diesel-derive-newtype` generates generic diesel code. + If a future release of Diesel breaks compatibility with `diesel-derive-newtype` an explicit + dependency on the correct version span will be added and a new release will be made. +* CI improvements. + # 0.1.1 Bugs Fixed: From a11bea6919a17340017404ee65c7449372a15bae Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sat, 25 Mar 2023 13:21:09 -0400 Subject: [PATCH 07/11] chore: Release diesel-derive-newtype version 1.0.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d1fadf8..2568d0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel-derive-newtype" -version = "1.0.0" +version = "1.0.1" authors = ["Brandon W Maister "] license = "Apache-2.0/MIT" readme = "README.md" From 04d9328ec7372352702b4a9b96b44244ded14cef Mon Sep 17 00:00:00 2001 From: Ben Sully Date: Sun, 26 Mar 2023 20:53:23 +0100 Subject: [PATCH 08/11] Bump syn to 2.0 Followup to https://github.com/quodlibetor/diesel-derive-newtype/pull/23#issuecomment-1483872801. --- Cargo.toml | 4 +++- README.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2568d0e..4456924 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,13 +8,15 @@ categories = ["database", "rust-patterns"] keywords = ["newtype", "derive"] description = "Automatically connect newtypes to Diesel using their wrapped type" repository = "https://github.com/quodlibetor/diesel-derive-newtype" +# Inherited MSRV of `syn`. +rust-version = "1.56" [badges] maintenance = { status = "passively-maintained" } [dependencies] proc-macro2 = "1.0.51" -syn = "1.0.109" +syn = "2.0.10" quote = "1.0.23" [dev-dependencies] diff --git a/README.md b/README.md index b4b0457..37a1d67 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ And for Diesel 2.x: diesel-derive-newtype = "2.0.0-rc.0" ``` +Note: this crate requires Rust 1.56 due to the dependency on syn 2.x. + ## `#[derive(DieselNewType)]` This crate exposes a single custom-derive macro `DieselNewType` which From 871a3d8352fee26a138d2a05744fe7faf859966f Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sun, 26 Mar 2023 17:21:18 -0400 Subject: [PATCH 09/11] Bump tested rust version for syn's dependencies --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 606fcd9..c4e0e34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - rust_version: [1.52.1, stable, beta] + rust_version: [1.56.0, stable, beta] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 02d82bc9ace1e408bd2ad9e9781e94f4138d4495 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sun, 26 Mar 2023 18:02:51 -0400 Subject: [PATCH 10/11] chore: Release diesel-derive-newtype version 1.0.2 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4456924..486e4a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diesel-derive-newtype" -version = "1.0.1" +version = "1.0.2" authors = ["Brandon W Maister "] license = "Apache-2.0/MIT" readme = "README.md" From ecf1d25ecd490fc65f3ab4be2e4e3dd38da7decd Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sun, 26 Mar 2023 18:04:06 -0400 Subject: [PATCH 11/11] update changelog for 1.0.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d30a63e..9de5410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Unreleased + +# 1.0.2 + +* Update syn to 2.0, bump MSRV to 1.56 + # 1.0.1 * Update syn/quote/proc-macro2 dependencies to 1.x