From f42de14ed6c614e7c136c674f43f98b9b9bb4693 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:22:57 -0700 Subject: [PATCH 1/4] chore: replace tinyglobby with Node.js built-in glob APIs --- modules/blog.ts | 5 ++--- modules/standard-site-sync.ts | 7 +++++-- package.json | 1 - pnpm-lock.yaml | 3 --- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/blog.ts b/modules/blog.ts index 3ece7abae8..50b7e57bf6 100644 --- a/modules/blog.ts +++ b/modules/blog.ts @@ -13,11 +13,10 @@ 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 { existsSync } from 'node:fs' +import { existsSync, globSync } 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 = globSync('*.md', { cwd: blogDir }).map(file => join(blogDir, file)) // 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..41d44f0aa8 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,9 @@ 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('**/*.md', { cwd: contentDir }))).map(file => + join(contentDir, file), + ) // 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 From 09a553b08e4980ab88d470da04f344404531dc4c Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sat, 4 Apr 2026 08:27:19 -0700 Subject: [PATCH 2/4] chore: use async glob from fs.promises in blog.ts --- modules/blog.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/blog.ts b/modules/blog.ts index 50b7e57bf6..4f77210a9d 100644 --- a/modules/blog.ts +++ b/modules/blog.ts @@ -15,8 +15,8 @@ import { } from '../shared/schemas/blog' import { isProduction } from '../config/env' import { BLUESKY_API } from '../shared/utils/constants' -import { mkdir, writeFile } from 'node:fs/promises' -import { existsSync, globSync } from 'node:fs' +import { glob, mkdir, writeFile } from 'node:fs/promises' +import { existsSync } from 'node:fs' import crypto from 'node:crypto' /** @@ -88,7 +88,9 @@ function resolveAuthors(authors: Author[], avatarMap: Map): Reso * Resolves Bluesky avatars at build time. */ async function loadBlogPosts(blogDir: string, imagesDir: string): Promise { - const files = globSync('*.md', { cwd: blogDir }).map(file => join(blogDir, file)) + const files = (await Array.fromAsync(glob('*.md', { cwd: blogDir }))).map(file => + join(blogDir, file), + ) // First pass: extract raw frontmatter and collect all Bluesky handles const rawPosts: Array<{ frontmatter: Record }> = [] From 71ec5ce5e6e533887a3cf652d193ef18b393c292 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sat, 4 Apr 2026 08:31:50 -0700 Subject: [PATCH 3/4] chore: pass full path in async glob --- modules/blog.ts | 4 +--- modules/standard-site-sync.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/blog.ts b/modules/blog.ts index 4f77210a9d..59e1e3d9ca 100644 --- a/modules/blog.ts +++ b/modules/blog.ts @@ -88,9 +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 = (await Array.fromAsync(glob('*.md', { cwd: blogDir }))).map(file => - join(blogDir, file), - ) + const files = await Array.fromAsync(glob(join(blogDir, '*.md'))) // 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 41d44f0aa8..db9c98691e 100644 --- a/modules/standard-site-sync.ts +++ b/modules/standard-site-sync.ts @@ -53,9 +53,7 @@ export default defineNuxtModule({ const possiblePublication = await checkPublication(handle, pdsPublicClient) nuxt.hook('build:before', async () => { - const files = (await Array.fromAsync(glob('**/*.md', { cwd: contentDir }))).map(file => - join(contentDir, file), - ) + const files = await Array.fromAsync(glob(join(contentDir, '**/*.md'))) // INFO: Arbitrarily chosen concurrency limit, can be changed if needed const concurrencyLimit = 5 From 959ec764121dd9721bd567b921cc38b018a1527d Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sat, 4 Apr 2026 08:33:48 -0700 Subject: [PATCH 4/4] fix: re-add string replace --- modules/blog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/blog.ts b/modules/blog.ts index 59e1e3d9ca..26af619377 100644 --- a/modules/blog.ts +++ b/modules/blog.ts @@ -88,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 = await Array.fromAsync(glob(join(blogDir, '*.md'))) + 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 }> = []