From 9fe52b4d861403ad07ebc7dd50b53031d5fd66a9 Mon Sep 17 00:00:00 2001 From: Sadegh Barati Date: Wed, 20 Dec 2023 23:04:50 +0330 Subject: [PATCH] fix: normalize `components:example` path to process `crawlExample` function correctly --- apps/www/src/lib/registry/registry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/src/lib/registry/registry.ts b/apps/www/src/lib/registry/registry.ts index bfcb2fc5..3e394880 100644 --- a/apps/www/src/lib/registry/registry.ts +++ b/apps/www/src/lib/registry/registry.ts @@ -1,5 +1,5 @@ import { readFile, readdir } from 'node:fs/promises' -import { join, resolve } from 'pathe' +import { join, normalize, resolve } from 'pathe' import { compileScript, parse } from 'vue/compiler-sfc' import type { Registry } from '../../lib/registry' @@ -66,7 +66,7 @@ async function crawlExample(rootPath: string) { if (dirent.isFile()) { const [name] = dirent.name.split('.vue') - const file_path = join('example', dirent.path.split('/example')[1], dirent.name) + const file_path = join('example', normalize(dirent.path).split('/example')[1], dirent.name) const { dependencies, registryDependencies } = await getDependencies(join(dirent.path, dirent.name))