Bump ts-rs from 10.1.0 to 11.1.0 in /sync-server #163

Open
dependabot[bot] wants to merge 1 commit from dependabot/cargo/sync-server/ts-rs-11.1.0 into main
dependabot[bot] commented 2025-11-03 05:41:37 +00:00 (Migrated from github.com)

Bumps ts-rs from 10.1.0 to 11.1.0.

Release notes

Sourced from ts-rs's releases.

v11.1.0

Today, we're happy to publish a small follow-up to v11.0.1!

This release fixes a nasty build failure when using the format feature. Note: For those that use the format feature, this release bumps the MSRV to 1.88. We'd have preferred to do this in a major release, but felt this was acceptable since the build was broken by one of the dependencies anyway.

New features

TypeScript enums with #[ts(repr(enum))

#[ts(repr(enum)) instructs ts-rs to generate an enum, instead of a type for your rust enum.

#[derive(TS)]
#[ts(repr(enum))]
enum Role {
    User,
    Admin,
}
// will generate `export enum Role { "User", "Admin" }`

Discriminants are preserved, and you can use the variant's name as discriminant instead using #[ts(repr(enum = name))]

#[ts(optional_fields)] in enums

The #[ts(optional_fields)] attribute can now be applied directly to enums, or even to individual enum variants.

Control over file extensions in imports

Normally, we generate import { Type } from "file" statements. In some scenarios though, it might be necessary to use a .ts or even .js extension instead.
This is now possible by setting the TS_RS_IMPORT_EXTENSION environment variable.

Note: With the introduction of this feature, we deprecate the import-esm cargo feature. It will be removed in a future major release.

Full changelog

New Contributors

v11.0.0

We are excited to announce v11.0.0!

Upgrading from v10.x.x

  • With the serde-compat feature enabled (default), fields annotated with both #[serde(skip_serializing(_if))] and #[serde(default)] are now turned into optional properties.
    See "Improved serde compatibility" under "New features" below
  • The API of the ts_rs::TS trait has slightly changed.
    Some trivial adjustments to your code might be necessary, though only if you interact with ts_rs::TS directly.
    Most users should not be affected by this.

... (truncated)

Changelog

Sourced from ts-rs's changelog.

11.1.0

Features

  • Add #[ts(repr(enum))] attribute (#425)
  • Add support for #[ts(optional_fields)] in enums and enum variants (#432)
  • Deprecate import-esm cargo feature in favour of RS_RS_IMPORT_EXTENSION (#423)

Fixes

  • Fix bindings for chrono::Duration (#434)

11.0.1

Fixes

  • Fix usage of #[ts(optional)] together with #[ts(type)]. (#416)

11.0.0

Breaking

  • #[serde(skip_serializing)] and #[serde(skip_serializing_if = ..)] are no longer ignored when used together with #[serde(default)]. (#393)
  • Changed return type of TS::output_path() from Option<&'static Path> to Option<PathBuf>. This will only break your code if you manually implement TS or directly interact with the TS trait.
  • Replaced TS::DOCS with TS::docs(). This will only break your code if you manually implement TS or directly interact with the TS trait.
  • Added OptionInnerType associated type to the TS trait. If you manually implement TS, you must set this associated type to Self in all of your implementations.
  • Raised MSRV to 1.78.0 due to use of #[diagnostic::on_unimplemented] and let ... else { ... }

Features

  • Add support for #[serde(skip_serializing)] and #[serde(skip_serializing_if = ..)] when used together with #[serde(default)]. Since these fields might be absent(#393)
  • Add support for arbitrary expressions in doc attributes, e.g #[doc = concat!("defined in ", file!())]. This would result both in a rustdoc and JSDoc comment.
  • The #[ts(rename)] attribute on structs, enums and variants now accepts any expression. This makes it possible to, for example, rename a struct to the name of a module it is contained in using #[ts(rename = module_path!().rsplit_once("::").unwrap().1)]
  • The #[ts(export_to)] attribute on structs and enums now accepts any expression.
  • Added #[ts(optional_fields)] and #[ts(optional_fields = nullable)] attribute to structs, this attribute is equivalent to using the corresponding #[ts(optional)] or #[ts(optional = nullable)] on every field of the struct. (#366)

Fixes

  • Fix #[ts(optional)] error when using a type alias for Option or fully qualifying it as core::option::Option (#366)
  • Fix missing import statements when using #[ts(as = "...")] at the top level of a struct/enum (#385)
  • Fix missing inline_flattened implementation for HashMap
Commits

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note

Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Bumps [ts-rs](https://github.com/Aleph-Alpha/ts-rs) from 10.1.0 to 11.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/Aleph-Alpha/ts-rs/releases">ts-rs's releases</a>.</em></p> <blockquote> <h2>v11.1.0</h2> <p>Today, we're happy to publish a small follow-up to v11.0.1!</p> <p>This release fixes a nasty build failure when using the <code>format</code> feature. <strong>Note:</strong> For those that use the <code>format</code> feature, this release bumps the MSRV to 1.88. We'd have preferred to do this in a major release, but felt this was acceptable since the build was broken by one of the dependencies anyway.</p> <h1>New features</h1> <h2>TypeScript enums with <code>#[ts(repr(enum))</code></h2> <p><code>#[ts(repr(enum))</code> instructs ts-rs to generate an <code>enum</code>, instead of a <code>type</code> for your rust enum.</p> <pre lang="rust"><code>#[derive(TS)] #[ts(repr(enum))] enum Role { User, Admin, } // will generate `export enum Role { &quot;User&quot;, &quot;Admin&quot; }` </code></pre> <p>Discriminants are preserved, and you can use the variant's name as discriminant instead using <code>#[ts(repr(enum = name))]</code></p> <h2><code>#[ts(optional_fields)]</code> in enums</h2> <p>The <code>#[ts(optional_fields)]</code> attribute can now be applied directly to enums, or even to individual enum variants.</p> <h2>Control over file extensions in imports</h2> <p>Normally, we generate <code>import { Type } from &quot;file&quot;</code> statements. In some scenarios though, it might be necessary to use a <code>.ts</code> or even <code>.js</code> extension instead.<br /> This is now possible by setting the <code>TS_RS_IMPORT_EXTENSION</code> environment variable.</p> <blockquote> <p>Note: With the introduction of this feature, we deprecate the <code>import-esm</code> cargo feature. It will be removed in a future major release.</p> </blockquote> <h2>Full changelog</h2> <ul> <li>Regression: <code>#[ts(optional)]</code> with <code>#[ts(type)]</code> by <a href="https://github.com/NyxCode"><code>@​NyxCode</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/416">Aleph-Alpha/ts-rs#416</a></li> <li>release v11.0.1 by <a href="https://github.com/NyxCode"><code>@​NyxCode</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/417">Aleph-Alpha/ts-rs#417</a></li> <li>Make <code>rename_all</code> compatible with tuple and unit structs as a no-op attribute by <a href="https://github.com/gustavo-shigueo"><code>@​gustavo-shigueo</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/422">Aleph-Alpha/ts-rs#422</a></li> <li>Replace <code>import-esm</code> with <code>TS_RS_IMPORT_EXTENSION</code> by <a href="https://github.com/gustavo-shigueo"><code>@​gustavo-shigueo</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/423">Aleph-Alpha/ts-rs#423</a></li> <li>Updated chrono Duration emitted type by <a href="https://github.com/fxf8"><code>@​fxf8</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/434">Aleph-Alpha/ts-rs#434</a></li> <li>Add optional_fields to enum by <a href="https://github.com/gustavo-shigueo"><code>@​gustavo-shigueo</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/432">Aleph-Alpha/ts-rs#432</a></li> <li>Add <code>#[ts(repr(enum)]</code> attribute by <a href="https://github.com/gustavo-shigueo"><code>@​gustavo-shigueo</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/425">Aleph-Alpha/ts-rs#425</a></li> <li>Fix build with <code>format</code> feature by <a href="https://github.com/gustavo-shigueo"><code>@​gustavo-shigueo</code></a> in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/438">Aleph-Alpha/ts-rs#438</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/fxf8"><code>@​fxf8</code></a> made their first contribution in <a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/434">Aleph-Alpha/ts-rs#434</a></li> </ul> <h2>v11.0.0</h2> <p>We are excited to announce v11.0.0!</p> <h1>Upgrading from <code>v10.x.x</code></h1> <ul> <li>With the <code>serde-compat</code> feature enabled (default), fields annotated with both <code>#[serde(skip_serializing(_if))]</code> and <code>#[serde(default)]</code> are now turned into optional properties.<br /> See &quot;Improved serde compatibility&quot; under &quot;New features&quot; below</li> <li>The API of the <code>ts_rs::TS</code> trait has slightly changed.<br /> Some trivial adjustments to your code might be necessary, though only if you interact with <code>ts_rs::TS</code> directly.<br /> Most users should not be affected by this.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/Aleph-Alpha/ts-rs/blob/main/CHANGELOG.md">ts-rs's changelog</a>.</em></p> <blockquote> <h1>11.1.0</h1> <h3>Features</h3> <ul> <li>Add <code>#[ts(repr(enum))]</code> attribute (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/425">#425</a>)</li> <li>Add support for <code>#[ts(optional_fields)]</code> in enums and enum variants (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/432">#432</a>)</li> <li>Deprecate <code>import-esm</code> cargo feature in favour of <code>RS_RS_IMPORT_EXTENSION</code> (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/423">#423</a>)</li> </ul> <h3>Fixes</h3> <ul> <li>Fix bindings for <code>chrono::Duration</code> (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/434">#434</a>)</li> </ul> <h1>11.0.1</h1> <h3>Fixes</h3> <ul> <li>Fix usage of <code>#[ts(optional)]</code> together with <code>#[ts(type)]</code>. (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/416">#416</a>)</li> </ul> <h1>11.0.0</h1> <h3>Breaking</h3> <ul> <li><code>#[serde(skip_serializing)]</code> and <code>#[serde(skip_serializing_if = ..)]</code> are no longer ignored when used together with <code>#[serde(default)]</code>. (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/393">#393</a>)</li> <li>Changed return type of <code>TS::output_path()</code> from <code>Option&lt;&amp;'static Path&gt;</code> to <code>Option&lt;PathBuf&gt;</code>. This will only break your code if you manually implement <code>TS</code> or directly interact with the <code>TS</code> trait.</li> <li>Replaced <code>TS::DOCS</code> with <code>TS::docs()</code>. This will only break your code if you manually implement <code>TS</code> or directly interact with the <code>TS</code> trait.</li> <li>Added <code>OptionInnerType</code> associated type to the <code>TS</code> trait. If you manually implement <code>TS</code>, you must set this associated type to <code>Self</code> in all of your implementations.</li> <li>Raised MSRV to <code>1.78.0</code> due to use of <code>#[diagnostic::on_unimplemented]</code> and <code>let ... else { ... }</code></li> </ul> <h3>Features</h3> <ul> <li>Add support for <code>#[serde(skip_serializing)]</code> and <code>#[serde(skip_serializing_if = ..)]</code> when used together with <code>#[serde(default)]</code>. Since these fields might be absent(<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/393">#393</a>)</li> <li>Add support for arbitrary expressions in doc attributes, e.g <code>#[doc = concat!(&quot;defined in &quot;, file!())]</code>. This would result both in a rustdoc and JSDoc comment.</li> <li>The <code>#[ts(rename)]</code> attribute on structs, enums and variants now accepts any expression. This makes it possible to, for example, rename a struct to the name of a module it is contained in using <code>#[ts(rename = module_path!().rsplit_once(&quot;::&quot;).unwrap().1)]</code></li> <li>The <code>#[ts(export_to)]</code> attribute on structs and enums now accepts any expression.</li> <li>Added <code>#[ts(optional_fields)]</code> and <code>#[ts(optional_fields = nullable)]</code> attribute to structs, this attribute is equivalent to using the corresponding <code>#[ts(optional)]</code> or <code>#[ts(optional = nullable)]</code> on every field of the struct. (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/366">#366</a>)</li> </ul> <h3>Fixes</h3> <ul> <li>Fix <code>#[ts(optional)]</code> error when using a type alias for <code>Option</code> or fully qualifying it as <code>core::option::Option</code> (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/366">#366</a>)</li> <li>Fix missing import statements when using <code>#[ts(as = &quot;...&quot;)]</code> at the top level of a struct/enum (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/pull/385">#385</a>)</li> <li>Fix missing <code>inline_flattened</code> implementation for <code>HashMap</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/1dce5297090804082e9639d2b7d851ba815aa359"><code>1dce529</code></a> bump version, add changelog (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/445">#445</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/9e6d9b2ea99c721bddfc9000b439e9dffe117bf5"><code>9e6d9b2</code></a> Fix build with <code>format</code> feature (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/438">#438</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/b7d8cae2a408677fd7d2079566371db156ebd867"><code>b7d8cae</code></a> Add <code>#[ts(repr(enum)]</code> attribute (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/425">#425</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/e63739daa55e3abe8376fae063f6ebc6b55620d4"><code>e63739d</code></a> Add optional_fields to enum (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/432">#432</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/754878dd633093cc35c081388d41e26e398f6e06"><code>754878d</code></a> Updated chrono Duration emitted type (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/434">#434</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/8251c3cf7c3f59caf3a215b05ca8a0a5a5807ba7"><code>8251c3c</code></a> Replace <code>import-esm</code> with <code>TS_RS_IMPORT_EXTENSION</code> (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/423">#423</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/f63dd5fbc402a5d29ded86266f47d8e8fa585472"><code>f63dd5f</code></a> Make rename_all compatible with tuple and unit structs as a no-op attribute (...</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/3bd4124bd1ed621fe8174c92bb63063cc362eaa4"><code>3bd4124</code></a> release v11.0.1 (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/417">#417</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/dc2892f4415d3a8fe46bfddde004692bd46ab33d"><code>dc2892f</code></a> fix regression: <code>#[ts(optional)]</code> incompatible with <code>#[ts(type = ...)]</code> (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/416">#416</a>)</li> <li><a href="https://github.com/Aleph-Alpha/ts-rs/commit/a7b73a50f8ed5039560ffc1cd66f3a876f41d645"><code>a7b73a5</code></a> release v11.0.0 (<a href="https://redirect.github.com/Aleph-Alpha/ts-rs/issues/413">#413</a>)</li> <li>Additional commits viewable in <a href="https://github.com/Aleph-Alpha/ts-rs/compare/v10.1.0...v11.1.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ts-rs&package-manager=cargo&previous-version=10.1.0&new-version=11.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
This pull request has changes conflicting with the target branch.
  • sync-server/Cargo.lock
  • sync-server/Cargo.toml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin dependabot/cargo/sync-server/ts-rs-11.1.0:dependabot/cargo/sync-server/ts-rs-11.1.0
git checkout dependabot/cargo/sync-server/ts-rs-11.1.0

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout main
git merge --no-ff dependabot/cargo/sync-server/ts-rs-11.1.0
git checkout dependabot/cargo/sync-server/ts-rs-11.1.0
git rebase main
git checkout main
git merge --ff-only dependabot/cargo/sync-server/ts-rs-11.1.0
git checkout dependabot/cargo/sync-server/ts-rs-11.1.0
git rebase main
git checkout main
git merge --no-ff dependabot/cargo/sync-server/ts-rs-11.1.0
git checkout main
git merge --squash dependabot/cargo/sync-server/ts-rs-11.1.0
git checkout main
git merge --ff-only dependabot/cargo/sync-server/ts-rs-11.1.0
git checkout main
git merge dependabot/cargo/sync-server/ts-rs-11.1.0
git push origin main
Sign in to join this conversation.
No description provided.