From a0bd0e6bf6ad56bc3735e187e9346567fe448323 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:50:45 +0530 Subject: [PATCH] move mdit types to dev deps --- package.json | 7 ++++--- patches/markdown-it-anchor@9.2.0.patch | 17 +++++++++++++++++ pnpm-lock.yaml | 13 ++++++++----- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 patches/markdown-it-anchor@9.2.0.patch diff --git a/package.json b/package.json index d0d76d93..d43c1684 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,6 @@ "@shikijs/core": "^2.1.0", "@shikijs/transformers": "^2.1.0", "@shikijs/types": "^2.1.0", - "@types/markdown-it": "^14.1.2", "@vitejs/plugin-vue": "^5.2.1", "@vue/devtools-api": "^7.7.0", "@vue/shared": "^3.5.13", @@ -135,6 +134,7 @@ "@types/fs-extra": "^11.0.4", "@types/lodash.template": "^4.5.3", "@types/mark.js": "^8.11.12", + "@types/markdown-it": "^14.1.2", "@types/markdown-it-attrs": "^4.1.3", "@types/markdown-it-container": "^2.0.10", "@types/markdown-it-emoji": "^3.0.1", @@ -156,8 +156,8 @@ "lodash.template": "^4.5.0", "lru-cache": "^11.0.2", "markdown-it": "^14.1.0", - "markdown-it-async": "^2.0.0", "markdown-it-anchor": "^9.2.0", + "markdown-it-async": "^2.0.0", "markdown-it-attrs": "^4.3.1", "markdown-it-container": "^4.0.0", "markdown-it-emoji": "^3.0.0", @@ -215,7 +215,8 @@ "ora>string-width": "^5" }, "patchedDependencies": { - "@types/mdurl@2.0.0": "patches/@types__mdurl@2.0.0.patch" + "@types/mdurl@2.0.0": "patches/@types__mdurl@2.0.0.patch", + "markdown-it-anchor@9.2.0": "patches/markdown-it-anchor@9.2.0.patch" } } } diff --git a/patches/markdown-it-anchor@9.2.0.patch b/patches/markdown-it-anchor@9.2.0.patch new file mode 100644 index 00000000..ac4498e4 --- /dev/null +++ b/patches/markdown-it-anchor@9.2.0.patch @@ -0,0 +1,17 @@ +diff --git a/types/index.d.ts b/types/index.d.ts +index 40c25c0be1add8b0fc2c51489c25a423dbc49d2c..807bc1b0e434d660c6a298b1dee1c87935bfac86 100644 +--- a/types/index.d.ts ++++ b/types/index.d.ts +@@ -1,10 +1,8 @@ + import MarkdownIt from 'markdown-it'; +-import { default as MarkdownItToken } from 'markdown-it/lib/token.mjs'; +-import { default as MarkdownItState} from 'markdown-it/lib/rules_core/state_core.mjs'; ++import { default as Token } from 'markdown-it/lib/token.mjs'; ++import { default as State } from 'markdown-it/lib/rules_core/state_core.mjs'; + + declare namespace anchor { +- export type Token = MarkdownItToken +- export type State = MarkdownItState + export type RenderHref = (slug: string, state: State) => string; + export type RenderAttrs = (slug: string, state: State) => Record; + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 512e743c..d4bdaf17 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ patchedDependencies: '@types/mdurl@2.0.0': hash: ztuyknm7z4pyl4jot5hljjv5bm path: patches/@types__mdurl@2.0.0.patch + markdown-it-anchor@9.2.0: + hash: ivrlfano2jj27ilcyyknwlzzfu + path: patches/markdown-it-anchor@9.2.0.patch importers: @@ -34,9 +37,6 @@ importers: '@shikijs/types': specifier: ^2.1.0 version: 2.1.0 - '@types/markdown-it': - specifier: ^14.1.2 - version: 14.1.2 '@vitejs/plugin-vue': specifier: ^5.2.1 version: 5.2.1(vite@6.0.11(@types/node@22.10.9)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.7.3)) @@ -131,6 +131,9 @@ importers: '@types/mark.js': specifier: ^8.11.12 version: 8.11.12 + '@types/markdown-it': + specifier: ^14.1.2 + version: 14.1.2 '@types/markdown-it-attrs': specifier: ^4.1.3 version: 4.1.3 @@ -196,7 +199,7 @@ importers: version: 14.1.0 markdown-it-anchor: specifier: ^9.2.0 - version: 9.2.0(@types/markdown-it@14.1.2)(markdown-it@14.1.0) + version: 9.2.0(patch_hash=ivrlfano2jj27ilcyyknwlzzfu)(@types/markdown-it@14.1.2)(markdown-it@14.1.0) markdown-it-async: specifier: ^2.0.0 version: 2.0.0 @@ -4368,7 +4371,7 @@ snapshots: mark.js@8.11.1: {} - markdown-it-anchor@9.2.0(@types/markdown-it@14.1.2)(markdown-it@14.1.0): + markdown-it-anchor@9.2.0(patch_hash=ivrlfano2jj27ilcyyknwlzzfu)(@types/markdown-it@14.1.2)(markdown-it@14.1.0): dependencies: '@types/markdown-it': 14.1.2 markdown-it: 14.1.0