Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove duplicate typedefs in index.d.ts from macro re-evaluation #2088

Merged
merged 1 commit into from
May 6, 2024

Conversation

OmarTawfik
Copy link

@OmarTawfik OmarTawfik commented May 6, 2024

Type definitions are generated during cargo build, and written to a temporary typedefs file. Usually, they are only evaluated once, but they can also be evaluated more times, when modules are loaded through conditional compilation, by using #[path] attributes, or various other code patterns required to get around existing cargo limitations.

This causes the temp file to have duplicate entries, which results in an invalid index.d.ts generated, with twice the number of types, causing tsc to fail with many TS2300 errors. The issue happens with the latest released @napi-rs/cli version 2.18.2.

This localized fix here deduplicates any entries found in the file, and has no effect when there are none.

@OmarTawfik
Copy link
Author

cc @ Brooooooklyn

@Brooooooklyn Brooooooklyn merged commit 7638c12 into napi-rs:v2 May 6, 2024
24 of 36 checks passed
kodiakhq bot pushed a commit to X-oss-byte/Nextjs that referenced this pull request May 6, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@napi-rs/cli](https://togithub.com/napi-rs/napi-rs) | [`2.18.2` -> `2.18.3`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/2.18.2/2.18.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fcli/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fcli/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fcli/2.18.2/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fcli/2.18.2/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>napi-rs/napi-rs (@&#8203;napi-rs/cli)</summary>

### [`v2.18.3`](https://togithub.com/napi-rs/napi-rs/releases/tag/%40napi-rs/cli%402.18.3)

[Compare Source](https://togithub.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.18.2...@napi-rs/cli@2.18.3)

#### What's Changed

-   remove duplicate typedefs in `index.d.ts` from macro re-evaluation by [@&#8203;OmarTawfik](https://togithub.com/OmarTawfik) in [napi-rs/napi-rs#2088

#### New Contributors

-   [@&#8203;OmarTawfik](https://togithub.com/OmarTawfik) made their first contribution in [napi-rs/napi-rs#2088

**Full Changelog**: https://github.com/napi-rs/napi-rs/compare/[@&#8203;napi-rs/cli](https://togithub.com/napi-rs/cli)[@&#8203;2](https://togithub.com/2).18.2...[@&#8203;napi-rs/cli](https://togithub.com/napi-rs/cli)[@&#8203;2](https://togithub.com/2).18.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
kodiakhq bot pushed a commit to X-oss-byte/Canary-nextjs that referenced this pull request May 6, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@napi-rs/cli](https://togithub.com/napi-rs/napi-rs) | [`2.18.2` -> `2.18.3`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/2.18.2/2.18.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fcli/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fcli/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fcli/2.18.2/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fcli/2.18.2/2.18.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>napi-rs/napi-rs (@&#8203;napi-rs/cli)</summary>

### [`v2.18.3`](https://togithub.com/napi-rs/napi-rs/releases/tag/%40napi-rs/cli%402.18.3)

[Compare Source](https://togithub.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.18.2...@napi-rs/cli@2.18.3)

#### What's Changed

-   remove duplicate typedefs in `index.d.ts` from macro re-evaluation by [@&#8203;OmarTawfik](https://togithub.com/OmarTawfik) in [napi-rs/napi-rs#2088

#### New Contributors

-   [@&#8203;OmarTawfik](https://togithub.com/OmarTawfik) made their first contribution in [napi-rs/napi-rs#2088

**Full Changelog**: https://github.com/napi-rs/napi-rs/compare/[@&#8203;napi-rs/cli](https://togithub.com/napi-rs/cli)[@&#8203;2](https://togithub.com/2).18.2...[@&#8203;napi-rs/cli](https://togithub.com/napi-rs/cli)[@&#8203;2](https://togithub.com/2).18.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Canary-nextjs).
@OmarTawfik OmarTawfik deleted the deduplicate-type-defs branch May 7, 2024 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants