diff --git a/modules/blog.ts b/modules/blog.ts index 3ece7abae8..26af619377 100644 --- a/modules/blog.ts +++ b/modules/blog.ts @@ -13,10 +13,9 @@ import { type BlogPostFrontmatter, type ResolvedAuthor, } from '../shared/schemas/blog' -import { globSync } from 'tinyglobby' import { isProduction } from '../config/env' import { BLUESKY_API } from '../shared/utils/constants' -import { mkdir, writeFile } from 'node:fs/promises' +import { glob, mkdir, writeFile } from 'node:fs/promises' import { existsSync } from 'node:fs' import crypto from 'node:crypto' @@ -89,7 +88,7 @@ function resolveAuthors(authors: Author[], avatarMap: Map): Reso * Resolves Bluesky avatars at build time. */ async function loadBlogPosts(blogDir: string, imagesDir: string): Promise { - const files: string[] = globSync(join(blogDir, '*.md').replace(/\\/g, '/')) + const files = await Array.fromAsync(glob(join(blogDir, '*.md').replace(/\\/g, '/'))) // First pass: extract raw frontmatter and collect all Bluesky handles const rawPosts: Array<{ frontmatter: Record }> = [] diff --git a/modules/standard-site-sync.ts b/modules/standard-site-sync.ts index 121ca13123..db9c98691e 100644 --- a/modules/standard-site-sync.ts +++ b/modules/standard-site-sync.ts @@ -1,5 +1,7 @@ import process from 'node:process' import { createHash } from 'node:crypto' +import { glob } from 'node:fs/promises' +import { join } from 'node:path' import { defineNuxtModule, useNuxt, createResolver } from 'nuxt/kit' import { safeParse } from 'valibot' import { BlogPostSchema, type BlogPostFrontmatter } from '#shared/schemas/blog' @@ -51,8 +53,7 @@ export default defineNuxtModule({ const possiblePublication = await checkPublication(handle, pdsPublicClient) nuxt.hook('build:before', async () => { - const { glob } = await import('tinyglobby') - const files: string[] = await glob(`${contentDir}/**/*.md`) + const files = await Array.fromAsync(glob(join(contentDir, '**/*.md'))) // INFO: Arbitrarily chosen concurrency limit, can be changed if needed const concurrencyLimit = 5 diff --git a/package.json b/package.json index e70bf14bda..6b8a0bcff7 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,6 @@ "simple-git": "3.33.0", "spdx-license-list": "6.11.0", "std-env": "4.0.0", - "tinyglobby": "0.2.15", "ufo": "1.6.3", "unocss": "66.6.7", "unplugin-vue-router": "0.19.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0413588f5d..22198914ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,9 +204,6 @@ importers: std-env: specifier: 4.0.0 version: 4.0.0 - tinyglobby: - specifier: 0.2.15 - version: 0.2.15 ufo: specifier: 1.6.3 version: 1.6.3