Skip to content

Commit 8ebaf83

Browse files
committed
feat: move micromatch to picomatch
1 parent 224b119 commit 8ebaf83

File tree

4 files changed

+112
-115
lines changed

4 files changed

+112
-115
lines changed

packages/slidev/node/options.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'node:path'
33
import { objectMap, uniq } from '@antfu/utils'
44
import Debug from 'debug'
55
import fg from 'fast-glob'
6-
import mm from 'micromatch'
6+
import pm from 'picomatch'
77
import { resolveAddons } from './integrations/addons'
88
import { getThemeMeta, resolveTheme } from './integrations/themes'
99
import { parser } from './parser'
@@ -76,7 +76,7 @@ export async function resolveOptions(
7676

7777
export async function createDataUtils(resolved: Omit<ResolvedSlidevOptions, 'utils'>): Promise<ResolvedSlidevUtils> {
7878
const monacoTypesIgnorePackagesMatches = (resolved.data.config.monacoTypesIgnorePackages || [])
79-
.map(i => mm.matcher(i))
79+
.map(i => pm.makeRe(i))
8080

8181
let _layouts_cache_time = 0
8282
let _layouts_cache: Record<string, string> = {}
@@ -87,7 +87,7 @@ export async function createDataUtils(resolved: Omit<ResolvedSlidevOptions, 'uti
8787
indexHtml: setupIndexHtml(resolved),
8888
define: getDefine(resolved),
8989
iconsResolvePath: [resolved.clientRoot, ...resolved.roots].reverse(),
90-
isMonacoTypesIgnored: pkg => monacoTypesIgnorePackagesMatches.some(i => i(pkg)),
90+
isMonacoTypesIgnored: pkg => monacoTypesIgnorePackagesMatches.some(i => i.test(pkg)),
9191
getLayouts: () => {
9292
const now = Date.now()
9393
if (now - _layouts_cache_time < 2000)

packages/slidev/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
"markdown-it": "catalog:",
8686
"markdown-it-footnote": "catalog:",
8787
"markdown-it-mdc": "catalog:",
88-
"micromatch": "catalog:",
8988
"mlly": "catalog:",
9089
"monaco-editor": "catalog:",
9190
"open": "catalog:",
9291
"pdf-lib": "catalog:",
92+
"picomatch": "catalog:",
9393
"plantuml-encoder": "catalog:",
9494
"postcss-nested": "catalog:",
9595
"pptxgenjs": "catalog:",
@@ -121,7 +121,7 @@
121121
},
122122
"devDependencies": {
123123
"@hedgedoc/markdown-it-plugins": "catalog:",
124-
"@types/micromatch": "catalog:",
124+
"@types/picomatch": "catalog:",
125125
"@types/plantuml-encoder": "catalog:"
126126
}
127127
}

0 commit comments

Comments
 (0)