Deps: Reducing deps (#1873)

* Deps: Reducing deps

* Changeset

* Reverting the changes for `generate-docs` script as it shuold work as expected without any additional workarounds

* Returning `isbot` dep

* clean code

---------

Co-authored-by: Fuma Nama <[email protected]>
This commit is contained in:
gene
2025-05-19 20:32:47 +08:00
committed by GitHub
co-authored by Fuma Nama
parent 98bc69e27b
commit a6c909b618
23 changed files with 81 additions and 102 deletions
+9
View File
@@ -0,0 +1,9 @@
---
'create-fumadocs-app': patch
'@fumadocs/mdx-remote': patch
'fumadocs-typescript': patch
'fumadocs-openapi': patch
'fumadocs-mdx': patch
---
Removed unused devDependencies and migrated from `fast-glob` to `tinyglobby`
+1 -4
View File
@@ -18,8 +18,6 @@
"@oramacloud/client": "^2.1.4",
"@radix-ui/react-dialog": "^1.1.13",
"@radix-ui/react-hover-card": "^1.1.13",
"@radix-ui/react-popover": "^1.1.13",
"@radix-ui/react-slot": "^1.2.2",
"@radix-ui/react-tooltip": "^1.2.6",
"@shikijs/rehype": "^3.4.2",
"@shikijs/transformers": "^3.4.2",
@@ -40,7 +38,6 @@
"next-themes": "^0.4.6",
"octokit": "^4.1.3",
"oxc-transform": "^0.70.0",
"phenomenon": "^1.6.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rehype-katex": "^7.0.1",
@@ -68,12 +65,12 @@
"@types/react-dom": "^19.1.5",
"algoliasearch": "4.24.0",
"eslint-config-custom": "workspace:*",
"fast-glob": "^3.3.3",
"gray-matter": "^4.0.3",
"next-validate-link": "^1.5.2",
"postcss": "^8.5.3",
"tailwindcss": "^4.1.7",
"tailwindcss-animate": "^1.0.7",
"tinyglobby": "^0.2.13",
"ts-morph": "^25.0.1",
"tsconfig": "workspace:*",
"tsx": "^4.19.4",
+7 -3
View File
@@ -1,4 +1,4 @@
import fg from 'fast-glob';
import { glob } from 'tinyglobby';
import { printErrors, scanURLs, validateFiles } from 'next-validate-link';
import { createGetUrl, getSlugs, parseFilePath } from 'fumadocs-core/source';
import { getTableOfContents } from 'fumadocs-core/server';
@@ -23,11 +23,15 @@ async function readFromPath(file: string) {
async function checkLinks() {
const docsFiles = await Promise.all(
await fg('content/docs/**/*.mdx').then((files) => files.map(readFromPath)),
await glob('content/docs/**/*.mdx').then((files) =>
files.map(readFromPath),
),
);
const blogFiles = await Promise.all(
await fg('content/blog/**/*.mdx').then((files) => files.map(readFromPath)),
await glob('content/blog/**/*.mdx').then((files) =>
files.map(readFromPath),
),
);
const docs = docsFiles.map(async (file) => {
-1
View File
@@ -8,7 +8,6 @@
"start": "next start"
},
"dependencies": {
"@orama/stopwords": "^3.1.6",
"@orama/tokenizers": "^3.1.6",
"fumadocs-core": "workspace:*",
"fumadocs-mdx": "workspace:*",
+1 -4
View File
@@ -10,16 +10,13 @@
"types:check": "fumadocs-mdx && tsc --noEmit"
},
"dependencies": {
"@scalar/api-client-react": "^1.2.34",
"fumadocs-core": "workspace:*",
"fumadocs-mdx": "workspace:*",
"fumadocs-openapi": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "15.3.2",
"react": "19.1.0",
"react-dom": "19.1.0",
"shiki": "^3.4.2",
"zod": "^3.24.4"
"react-dom": "19.1.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.7",
+1 -2
View File
@@ -16,8 +16,7 @@
"fumadocs-ui": "workspace:*",
"next": "15.3.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"shiki": "^3.4.2"
"react-dom": "^19.1.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.7",
+13 -4
View File
@@ -1,6 +1,6 @@
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import FastGlob from 'fast-glob';
import { glob } from 'tinyglobby';
export interface Frontmatter {
title: string;
@@ -43,13 +43,22 @@ interface Page {
}
export async function getPages(): Promise<Page[]> {
const files = await FastGlob('content/docs/**/*.mdx');
const files = await glob('content/docs/**/*.mdx');
return files.map((file) => {
const slugs = file.split(path.sep).filter(Boolean).slice(2);
const last = slugs[slugs.length - 1];
slugs[slugs.length - 1] = last.slice(0, -path.extname(last).length);
if (slugs.length === 0) {
return {
path: file,
slug: [],
};
}
slugs[slugs.length - 1] = slugs[slugs.length - 1].slice(
0,
-path.extname(slugs[slugs.length - 1]).length,
);
if (slugs[slugs.length - 1] === 'index') slugs.pop();
return {
+1 -1
View File
@@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"tinyglobby": "^0.2.13",
"@fumadocs/mdx-remote": "workspace:*",
"fast-glob": "^3.3.3",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "15.3.2",
+2 -2
View File
@@ -7,7 +7,7 @@ import {
} from 'fumadocs-core/source';
import matter from 'gray-matter';
import * as path from 'node:path';
import FastGlob from 'fast-glob';
import { globSync } from 'tinyglobby';
import * as fs from 'node:fs';
let files: [string, string][];
@@ -21,7 +21,7 @@ if (typeof import.meta.glob === 'function') {
}),
);
} else {
files = FastGlob.sync('content/docs/**/*').map((file) => {
files = globSync('content/docs/**/*').map((file) => {
return [file, fs.readFileSync(file).toString()];
});
}
+1 -1
View File
@@ -12,12 +12,12 @@
"@fumadocs/mdx-remote": "workspace:*",
"@tanstack/react-router": "^1.120.3",
"@tanstack/react-start": "^1.120.3",
"fast-glob": "^3.3.3",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"gray-matter": "^4.0.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tinyglobby": "^0.2.13",
"vinxi": "^0.5.6"
},
"devDependencies": {
+1 -1
View File
@@ -20,7 +20,7 @@
"@types/react": "^19.1.4",
"@types/react-dom": "^19.1.5",
"@vitejs/plugin-react": "^4.4.1",
"fast-glob": "^3.3.3",
"tinyglobby": "^0.2.13",
"gray-matter": "^4.0.3",
"isbot": "^5.1.28",
"next": "15.3.2",
+1 -1
View File
@@ -37,7 +37,7 @@
"@types/cross-spawn": "^6.0.6",
"@types/node": "22.15.18",
"eslint-config-custom": "workspace:*",
"fast-glob": "^3.3.3",
"tinyglobby": "^0.2.13",
"tsconfig": "workspace:*"
},
"engines": {
+1 -1
View File
@@ -238,7 +238,7 @@ function createPackageJson(projectName: string, options: Options): object {
...pick(versionPkg.dependencies, [
'@tanstack/react-router',
'@tanstack/react-start',
'fast-glob',
'tinyglobby',
'gray-matter',
'react',
'react-dom',
@@ -7,7 +7,7 @@ import {
} from 'fumadocs-core/source';
import matter from 'gray-matter';
import * as path from 'node:path';
import FastGlob from 'fast-glob';
import { globSync } from 'tinyglobby';
import * as fs from 'node:fs';
let files: [string, string][];
@@ -21,7 +21,7 @@ if (typeof import.meta.glob === 'function') {
}),
);
} else {
files = FastGlob.sync('content/docs/**/*').map((file) => {
files = globSync('content/docs/**/*').map((file) => {
return [file, fs.readFileSync(file).toString()];
});
}
+1 -1
View File
@@ -45,8 +45,8 @@
"@types/node": "22.15.18",
"@types/react": "^19.1.4",
"eslint-config-custom": "workspace:*",
"fast-glob": "^3.3.3",
"fumadocs-core": "workspace:*",
"tinyglobby": "^0.2.13",
"tsconfig": "workspace:*",
"unified": "^11.0.5",
"vfile": "^6.0.3"
+2 -2
View File
@@ -1,12 +1,12 @@
import { expect, test } from 'vitest';
import { createCompiler } from '@/compile';
import Glob from 'fast-glob';
import { glob } from 'tinyglobby';
import fs from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
const dir = path.dirname(fileURLToPath(import.meta.url));
const files = await Glob('./fixtures/*.mdx', {
const files = await glob('./fixtures/*.mdx', {
cwd: dir,
});
+1 -1
View File
@@ -55,11 +55,11 @@
"cross-spawn": "^7.0.6",
"esbuild": "^0.25.4",
"estree-util-value-to-estree": "^3.4.0",
"fast-glob": "^3.3.3",
"gray-matter": "^4.0.3",
"js-yaml": "^4.1.0",
"lru-cache": "^11.1.0",
"picocolors": "^1.1.1",
"tinyglobby": "^0.2.13",
"unist-util-visit": "^5.0.0",
"zod": "^3.24.4"
},
+2 -2
View File
@@ -1,6 +1,6 @@
import * as path from 'node:path';
import * as fs from 'node:fs/promises';
import fg from 'fast-glob';
import { glob } from 'tinyglobby';
import { getTypeFromPath } from '@/utils/get-type-from-path';
import type { FileInfo } from '@/config/types';
import type { LoadedConfig } from '@/utils/config';
@@ -173,7 +173,7 @@ async function getCollectionFiles(
await Promise.all(
dirs.map(async (dir) => {
const result = await fg(collection.files ?? '**/*', {
const result = await glob(collection.files ?? '**/*', {
cwd: path.resolve(dir),
absolute: true,
});
+1 -1
View File
@@ -59,7 +59,6 @@
"@scalar/openapi-parser": "0.10.17",
"ajv": "^8.17.1",
"class-variance-authority": "^0.7.1",
"fast-glob": "^3.3.3",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"github-slugger": "^2.0.0",
@@ -71,6 +70,7 @@
"remark": "^15.0.1",
"remark-rehype": "^11.1.2",
"shiki": "^3.4.2",
"tinyglobby": "^0.2.13",
"xml-js": "^1.6.11"
},
"devDependencies": {
+2 -2
View File
@@ -1,6 +1,6 @@
import { mkdir, writeFile } from 'node:fs/promises';
import * as path from 'node:path';
import fg from 'fast-glob';
import { glob } from 'tinyglobby';
import {
generateAll,
type GenerateOptions,
@@ -71,7 +71,7 @@ export async function generateFiles(options: Config): Promise<void> {
}
const resolvedInputs = [
...(await fg.glob(fileInputs, { cwd, absolute: false })),
...(await glob(fileInputs, { cwd, absolute: false })),
...urlInputs,
];
+1 -1
View File
@@ -36,12 +36,12 @@
},
"dependencies": {
"estree-util-value-to-estree": "^3.4.0",
"fast-glob": "^3.3.3",
"hast-util-to-estree": "^3.1.3",
"hast-util-to-jsx-runtime": "^2.3.6",
"remark": "^15.0.1",
"remark-rehype": "^11.1.2",
"shiki": "^3.4.2",
"tinyglobby": "^0.2.13",
"ts-morph": "^25.0.1",
"unist-util-visit": "^5.0.0"
},
+3 -3
View File
@@ -1,6 +1,6 @@
import * as path from 'node:path';
import { mkdir, writeFile, readFile } from 'node:fs/promises';
import fg from 'fast-glob';
import { glob, type GlobOptions } from 'tinyglobby';
import { generateMDX, type GenerateMDXOptions } from './mdx';
import type { Generator } from '@/lib/base';
@@ -10,7 +10,7 @@ export interface GenerateFilesOptions {
* Output directory, or a function that returns the output path
*/
output: string | ((inputPath: string) => string);
globOptions?: fg.Options;
globOptions?: GlobOptions;
options?: GenerateMDXOptions;
/**
@@ -23,7 +23,7 @@ export async function generateFiles(
generator: Generator,
options: GenerateFilesOptions,
): Promise<void> {
const files = await fg(options.input, options.globOptions);
const files = await glob(options.input, options.globOptions);
const produce = files.map(async (file) => {
const absolutePath = path.resolve(file);
+27 -62
View File
@@ -74,12 +74,6 @@ importers:
'@radix-ui/react-hover-card':
specifier: ^1.1.13
version: 1.1.13(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-popover':
specifier: ^1.1.13
version: 1.1.13(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-slot':
specifier: ^1.2.2
version: 1.2.2(@types/[email protected])([email protected])
'@radix-ui/react-tooltip':
specifier: ^1.2.6
version: 1.2.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
@@ -140,9 +134,6 @@ importers:
oxc-transform:
specifier: ^0.70.0
version: 0.70.0
phenomenon:
specifier: ^1.6.0
version: 1.6.0
react:
specifier: ^19.1.0
version: 19.1.0
@@ -219,9 +210,6 @@ importers:
eslint-config-custom:
specifier: workspace:*
version: link:../../packages/eslint-config-custom
fast-glob:
specifier: ^3.3.3
version: 3.3.3
gray-matter:
specifier: ^4.0.3
version: 4.0.3
@@ -237,6 +225,9 @@ importers:
tailwindcss-animate:
specifier: ^1.0.7
version: 1.0.7([email protected])
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
ts-morph:
specifier: ^25.0.1
version: 25.0.1
@@ -295,9 +286,6 @@ importers:
examples/i18n:
dependencies:
'@orama/stopwords':
specifier: ^3.1.6
version: 3.1.7
'@orama/tokenizers':
specifier: ^3.1.6
version: 3.1.7
@@ -372,9 +360,6 @@ importers:
examples/openapi:
dependencies:
'@scalar/api-client-react':
specifier: ^1.2.34
version: 1.2.34([email protected])([email protected])([email protected])([email protected])
fumadocs-core:
specifier: workspace:*
version: link:../../packages/core
@@ -396,12 +381,6 @@ importers:
react-dom:
specifier: 19.1.0
version: 19.1.0([email protected])
shiki:
specifier: ^3.4.2
version: 3.4.2
zod:
specifier: ^3.24.4
version: 3.24.4
devDependencies:
'@tailwindcss/postcss':
specifier: ^4.1.7
@@ -451,9 +430,6 @@ importers:
react-dom:
specifier: ^19.1.0
version: 19.1.0([email protected])
shiki:
specifier: ^3.4.2
version: 3.4.2
devDependencies:
'@tailwindcss/postcss':
specifier: ^4.1.7
@@ -552,9 +528,6 @@ importers:
'@fumadocs/mdx-remote':
specifier: workspace:*
version: link:../../packages/mdx-remote
fast-glob:
specifier: ^3.3.3
version: 3.3.3
fumadocs-core:
specifier: workspace:*
version: link:../../packages/core
@@ -570,6 +543,9 @@ importers:
react-dom:
specifier: 19.1.0
version: 19.1.0([email protected])
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
devDependencies:
'@types/mdx':
specifier: ^2.0.13
@@ -595,9 +571,6 @@ importers:
'@tanstack/react-start':
specifier: ^1.120.3
version: 1.120.5(@tanstack/[email protected]([email protected]([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])
fast-glob:
specifier: ^3.3.3
version: 3.3.3
fumadocs-core:
specifier: workspace:*
version: link:../../packages/core
@@ -613,6 +586,9 @@ importers:
react-dom:
specifier: ^19.1.0
version: 19.1.0([email protected])
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
vinxi:
specifier: ^0.5.6
version: 0.5.6(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])
@@ -851,9 +827,9 @@ importers:
eslint-config-custom:
specifier: workspace:*
version: link:../eslint-config-custom
fast-glob:
specifier: ^3.3.3
version: 3.3.3
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
tsconfig:
specifier: workspace:*
version: link:../tsconfig
@@ -905,9 +881,6 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.4.1
version: 4.4.1([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))
fast-glob:
specifier: ^3.3.3
version: 3.3.3
gray-matter:
specifier: ^4.0.3
version: 4.0.3
@@ -938,6 +911,9 @@ importers:
tailwindcss:
specifier: ^4.1.7
version: 4.1.7
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
typescript:
specifier: ^5.8.3
version: 5.8.3
@@ -1031,9 +1007,6 @@ importers:
estree-util-value-to-estree:
specifier: ^3.4.0
version: 3.4.0
fast-glob:
specifier: ^3.3.3
version: 3.3.3
gray-matter:
specifier: ^4.0.3
version: 4.0.3
@@ -1046,6 +1019,9 @@ importers:
picocolors:
specifier: ^1.1.1
version: 1.1.1
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
unist-util-visit:
specifier: ^5.0.0
version: 5.0.0
@@ -1123,12 +1099,12 @@ importers:
eslint-config-custom:
specifier: workspace:*
version: link:../eslint-config-custom
fast-glob:
specifier: ^3.3.3
version: 3.3.3
fumadocs-core:
specifier: workspace:*
version: link:../core
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
tsconfig:
specifier: workspace:*
version: link:../tsconfig
@@ -1162,9 +1138,6 @@ importers:
class-variance-authority:
specifier: ^0.7.1
version: 0.7.1
fast-glob:
specifier: ^3.3.3
version: 3.3.3
fumadocs-core:
specifier: workspace:*
version: link:../core
@@ -1204,6 +1177,9 @@ importers:
shiki:
specifier: ^3.4.2
version: 3.4.2
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
xml-js:
specifier: ^1.6.11
version: 1.6.11
@@ -1338,9 +1314,6 @@ importers:
estree-util-value-to-estree:
specifier: ^3.4.0
version: 3.4.0
fast-glob:
specifier: ^3.3.3
version: 3.3.3
hast-util-to-estree:
specifier: ^3.1.3
version: 3.1.3
@@ -1356,6 +1329,9 @@ importers:
shiki:
specifier: ^3.4.2
version: 3.4.2
tinyglobby:
specifier: ^0.2.13
version: 0.2.13
ts-morph:
specifier: ^25.0.1
version: 25.0.1
@@ -3001,10 +2977,6 @@ packages:
resolution: {integrity: sha512-6yB0117ZjsgNevZw3LP+bkrZa9mU/POPVaXgzMPOBbBc35w2P3R+1vMMhEfC06kYCpd5bf0jodBaTkYQW5TVeQ==}
engines: {node: '>= 20.0.0'}
'@orama/[email protected]':
resolution: {integrity: sha512-i96UPZIS7s9WIIFSyUJLML3/+Y43f1iYLbGGu352mLwKZHX1qcXV47VrNCqjB6ePz3uHS1/sqV0dxaxN79ahYw==}
engines: {node: '>= 20.0.0'}
'@orama/[email protected]':
resolution: {integrity: sha512-JtUI20XX1/wnXlsnAyb+ddw7yVNRYcZ/J9ft0RLzbZoIYz+UqWp7N1Xxwb5n5i3K2i3g2mVIpQaKBiSqjmx8LQ==}
engines: {node: '>= 20.0.0'}
@@ -8151,9 +8123,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}
[email protected]:
resolution: {integrity: sha512-7h9/fjPD3qNlgggzm88cY58l9sudZ6Ey+UmZsizfhtawO6E3srZQXywaNm2lBwT72TbpHYRPy7ytIHeBUD/G0A==}
[email protected]:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -11791,8 +11760,6 @@ snapshots:
'@orama/[email protected]': {}
'@orama/[email protected]': {}
'@orama/[email protected]':
dependencies:
'@orama/orama': 3.1.7
@@ -18384,8 +18351,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}