From 48ca76c523d9b979a678d52447f5ce324799e47f Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:46:46 +0530 Subject: [PATCH] fix(types): wrong types generated for markdown-it > mdurl it's likely an issue with rollup-plugin-dts as both `class Foo {}; export type { Foo }` and `class _Foo {}; type Foo = _Foo; export { Foo }` should work the same closes #3935 --- package.json | 3 +++ patches/@types__mdurl@2.0.0.patch | 19 +++++++++++++++++++ pnpm-lock.yaml | 9 +++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 patches/@types__mdurl@2.0.0.patch diff --git a/package.json b/package.json index 3129a116..b593073d 100644 --- a/package.json +++ b/package.json @@ -216,6 +216,9 @@ }, "overrides": { "ora>string-width": "^5" + }, + "patchedDependencies": { + "@types/mdurl@2.0.0": "patches/@types__mdurl@2.0.0.patch" } } } diff --git a/patches/@types__mdurl@2.0.0.patch b/patches/@types__mdurl@2.0.0.patch new file mode 100644 index 00000000..d128d01c --- /dev/null +++ b/patches/@types__mdurl@2.0.0.patch @@ -0,0 +1,19 @@ +diff --git a/lib/parse.d.mts b/lib/parse.d.mts +index 2e0d8f2ea00a06c0971a68d34946e797b7f8152d..f61d4dd05c1b181bc6d2d8683153abcd10fe9ab9 100644 +--- a/lib/parse.d.mts ++++ b/lib/parse.d.mts +@@ -1,4 +1,4 @@ +-declare class Url { ++declare class _Url { + protocol: string; + slashes: string; + auth: string; +@@ -14,5 +14,7 @@ declare class Url { + parseHost(host: string): void; + } + ++type Url = _Url; ++ + export default function parse(url: string | Url, slashesDenoteHost?: boolean): Url; +-export type { Url }; ++export { Url }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f936fe8..690300d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,11 @@ settings: overrides: ora>string-width: ^5 +patchedDependencies: + '@types/mdurl@2.0.0': + hash: ztuyknm7z4pyl4jot5hljjv5bm + path: patches/@types__mdurl@2.0.0.patch + importers: .: @@ -3709,9 +3714,9 @@ snapshots: '@types/markdown-it@14.1.1': dependencies: '@types/linkify-it': 5.0.0 - '@types/mdurl': 2.0.0 + '@types/mdurl': 2.0.0(patch_hash=ztuyknm7z4pyl4jot5hljjv5bm) - '@types/mdurl@2.0.0': {} + '@types/mdurl@2.0.0(patch_hash=ztuyknm7z4pyl4jot5hljjv5bm)': {} '@types/micromatch@4.0.7': dependencies: