From 2da95f9616cd59b37fb04eef84f797f8b9f3b7b4 Mon Sep 17 00:00:00 2001 From: Mirone Date: Tue, 10 Sep 2024 22:24:29 +0800 Subject: [PATCH] fix: crepe codemirror wrong dependency (#1510) --- .changeset/wet-dolphins-sniff.md | 5 +++++ packages/crepe/package.json | 2 +- packages/crepe/src/feature/code-mirror/index.ts | 4 ++-- pnpm-lock.yaml | 6 +++--- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/wet-dolphins-sniff.md diff --git a/.changeset/wet-dolphins-sniff.md b/.changeset/wet-dolphins-sniff.md new file mode 100644 index 00000000000..bc30840bd44 --- /dev/null +++ b/.changeset/wet-dolphins-sniff.md @@ -0,0 +1,5 @@ +--- +"@milkdown/crepe": patch +--- + +The default nord theme has unacceptable dependency @babel/runtime diff --git a/packages/crepe/package.json b/packages/crepe/package.json index 342859f9a7b..372114b4dc9 100644 --- a/packages/crepe/package.json +++ b/packages/crepe/package.json @@ -66,7 +66,7 @@ "@codemirror/state": "^6.4.1", "@codemirror/view": "^6.16.0", "@milkdown/kit": "workspace:*", - "@uiw/codemirror-theme-nord": "^4.22.1", + "@codemirror/theme-one-dark": "^6.1.2", "atomico": "^1.75.1", "clsx": "^2.0.0", "codemirror": "^6.0.1", diff --git a/packages/crepe/src/feature/code-mirror/index.ts b/packages/crepe/src/feature/code-mirror/index.ts index 8aac33818d0..2b33e077eb5 100644 --- a/packages/crepe/src/feature/code-mirror/index.ts +++ b/packages/crepe/src/feature/code-mirror/index.ts @@ -36,8 +36,8 @@ export const defineFeature: DefineFeature = (editor, co languages = langList } if (!theme) { - const { nord } = await import('@uiw/codemirror-theme-nord') - theme = nord + const { oneDark } = await import('@codemirror/theme-one-dark') + theme = oneDark } ctx.update(codeBlockConfig.key, defaultConfig => ({ extensions: [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f855e60c0a8..5d751a2e10c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -373,15 +373,15 @@ importers: '@codemirror/state': specifier: ^6.4.1 version: 6.4.1 + '@codemirror/theme-one-dark': + specifier: ^6.1.2 + version: 6.1.2 '@codemirror/view': specifier: ^6.16.0 version: 6.26.0 '@milkdown/kit': specifier: workspace:* version: link:../kit - '@uiw/codemirror-theme-nord': - specifier: ^4.22.1 - version: 4.22.1(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.0) atomico: specifier: ^1.75.1 version: 1.75.1