chore: update deps & search indice action refactor (#11339)

* chore: update deps & search indice action refactor

- Updated pnpm, dependencies and regenerated the lockfile
- Removed immer and some eslint plugins that weren't being used
- Updated the version of `@types/node` to v24 on internal packages as
  that's the version that is being used on github actions
- Refactored the uploadSearchIndices action slightly and upgraded the
  meilisearch dependency

* chore: remove more deps
This commit is contained in:
Almeida
2025-12-09 12:47:46 +00:00
committed by GitHub
parent 2c3bf5c817
commit 06c8da23d1
14 changed files with 544 additions and 1155 deletions

View File

@@ -49,50 +49,33 @@
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@opennextjs/cloudflare": "^1.14.4",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.6.1",
"cmdk": "^1.1.1",
"cva": "1.0.0-beta.3",
"fumadocs-core": "^16.2.3",
"fumadocs-mdx": "^14.1.0",
"fumadocs-twoslash": "^3.1.10",
"fumadocs-ui": "^16.2.3",
"geist": "^1.5.1",
"immer": "^10.2.0",
"jotai": "^2.15.2",
"jotai-immer": "^0.4.1",
"lucide-react": "^0.548.0",
"lucide-react": "^0.556.0",
"mermaid": "^11.12.2",
"motion": "^12.23.25",
"next": "^16.0.7",
"next-mdx-remote-client": "^2.1.7",
"next-themes": "^0.4.6",
"nuqs": "^2.8.3",
"p-retry": "^7.1.0",
"react": "^19.2.1",
"react-aria": "^3.44.0",
"react-aria-components": "^1.13.0",
"react-dom": "^19.2.1",
"react-error-boundary": "^6.0.0",
"safe-mdx": "^1.3.9",
"sharp": "^0.34.5",
"tailwind-merge": "^3.4.0",
"tw-animate-css": "^1.4.0",
"twoslash": "^0.3.4",
"usehooks-ts": "^3.1.1"
"twoslash": "^0.3.4"
},
"devDependencies": {
"@next/env": "^16.0.7",
"@shikijs/rehype": "^3.19.0",
"@tailwindcss/postcss": "^4.1.17",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.1.17",
"@types/mdx": "^2.0.13",
"@types/node": "^24.10.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"autoprefixer": "^10.4.22",
"babel-plugin-react-compiler": "19.1.0-rc.3",
"babel-plugin-react-compiler": "^1.0.0",
"cpy-cli": "^6.0.0",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
@@ -106,10 +89,9 @@
"remark-rehype": "^11.1.2",
"shiki": "^3.19.0",
"tailwindcss": "^4.1.17",
"tailwindcss-react-aria-components": "^2.0.1",
"turbo": "^2.6.3",
"typescript": "^5.9.3",
"vercel": "^48.12.1",
"typescript": "~5.9.3",
"vercel": "^49.1.2",
"wrangler": "^4.53.0"
},
"engines": {

View File

@@ -56,20 +56,15 @@
"@react-icons/all-files": "^4.1.0",
"@tanstack/react-query": "^5.90.12",
"@vercel/analytics": "^1.6.1",
"@vercel/edge-config": "^1.4.3",
"@vercel/postgres": "^0.10.0",
"cloudflare": "^5.2.0",
"cmdk": "^1.1.1",
"cva": "1.0.0-beta.3",
"geist": "^1.5.1",
"immer": "^10.2.0",
"jotai": "^2.15.2",
"jotai-immer": "^0.4.1",
"lucide-react": "^0.548.0",
"meilisearch": "^0.53.0",
"motion": "^12.23.25",
"lucide-react": "^0.556.0",
"meilisearch": "^0.54.0",
"next": "^16.0.7",
"next-mdx-remote-client": "^2.1.7",
"next-themes": "^0.4.6",
"nuqs": "^2.8.3",
"overlayscrollbars": "^2.13.0",
@@ -78,7 +73,6 @@
"react-aria": "^3.44.0",
"react-aria-components": "^1.13.0",
"react-dom": "^19.2.1",
"react-error-boundary": "^6.0.0",
"safe-mdx": "^1.3.9",
"sharp": "^0.34.5",
"tailwind-merge": "^3.4.0",
@@ -86,16 +80,14 @@
"usehooks-ts": "^3.1.1"
},
"devDependencies": {
"@next/env": "^16.0.7",
"@shikijs/rehype": "^3.19.0",
"@tailwindcss/postcss": "^4.1.17",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.1.17",
"@types/node": "^24.10.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"autoprefixer": "^10.4.22",
"babel-plugin-react-compiler": "19.1.0-rc.3",
"babel-plugin-react-compiler": "^1.0.0",
"cpy-cli": "^6.0.0",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
@@ -111,8 +103,8 @@
"tailwindcss": "^4.1.17",
"tailwindcss-react-aria-components": "^2.0.1",
"turbo": "^2.6.3",
"typescript": "^5.9.3",
"vercel": "^48.12.1",
"typescript": "~5.9.3",
"vercel": "^49.1.2",
"wrangler": "^4.53.0"
},
"engines": {

View File

@@ -71,13 +71,13 @@
"tsup": "^8.5.1",
"turbo": "^2.6.3",
"typescript": "~5.9.3",
"typescript-eslint": "^8.48.1",
"typescript-eslint": "^8.49.0",
"unocss": "^66.5.10",
"vercel": "^48.12.1",
"vercel": "^49.1.2",
"vitest": "^4.0.15"
},
"engines": {
"node": ">=22.12.0"
},
"packageManager": "pnpm@10.24.0"
"packageManager": "pnpm@10.25.0"
}

View File

@@ -48,7 +48,7 @@
"@discordjs/scripts": "workspace:^",
"cloudflare": "^5.2.0",
"commander": "^14.0.2",
"meilisearch": "^0.38.0",
"meilisearch": "^0.54.0",
"p-limit": "^7.2.0",
"p-queue": "^9.0.1",
"tslib": "^2.8.1",
@@ -56,8 +56,8 @@
},
"devDependencies": {
"@npm/types": "^2.1.0",
"@types/bun": "^1.3.3",
"@types/node": "^22.19.1",
"@types/bun": "^1.3.4",
"@types/node": "^24.10.1",
"@vitest/coverage-v8": "^4.0.15",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",

View File

@@ -2,33 +2,35 @@ import process from 'node:process';
import { setFailed } from '@actions/core';
import { generateAllIndices } from '@discordjs/scripts';
import Cloudflare from 'cloudflare';
import { MeiliSearch } from 'meilisearch';
import { type EnqueuedTask, MeiliSearch } from 'meilisearch';
import pLimit from 'p-limit';
import { fetch } from 'undici';
if (!(process.env.CF_D1_DOCS_API_KEY && process.env.CF_D1_DOCS_ID && process.env.CF_ACCOUNT_ID)) {
if (!process.env.CF_D1_DOCS_API_KEY || !process.env.CF_D1_DOCS_ID || !process.env.CF_ACCOUNT_ID) {
setFailed('Missing Cloudflare D1 environment variables.');
process.exit(1);
}
if (!process.env.SEARCH_API_URL) {
setFailed('SEARCH_API_URL is not set');
process.exit(1);
}
if (!process.env.SEARCH_API_KEY) {
setFailed('SEARCH_API_KEY is not set');
process.exit(1);
}
const cf = new Cloudflare({
apiToken: process.env.CF_D1_DOCS_API_KEY!,
apiToken: process.env.CF_D1_DOCS_API_KEY,
});
const client = new MeiliSearch({
host: process.env.SEARCH_API_URL!,
apiKey: process.env.SEARCH_API_KEY!,
host: process.env.SEARCH_API_URL,
apiKey: process.env.SEARCH_API_KEY,
});
const limit = pLimit(10);
let promises: Promise<any>[] = [];
try {
console.log('Generating all indices...');
@@ -62,17 +64,16 @@ try {
console.log('Uploading indices...');
try {
promises = indices.map(async (index) =>
const promises = indices.map(async (index) =>
limit(async () => {
console.log(`Uploading ${index.index}...`);
let task;
let task: EnqueuedTask | undefined;
try {
task = await client.createIndex(index.index);
} catch {}
if (task) {
await client.waitForTask(task.taskUid);
await client.tasks.waitForTask(task);
}
const searchIndex = client.index(index.index);
@@ -81,16 +82,13 @@ try {
await searchIndex.addDocuments(index.data);
}),
);
} catch {}
await Promise.all(promises);
console.log('Uploaded all indices.');
} catch (error) {
const err = error as Error;
console.error(err);
setFailed(err.message);
}
try {
await Promise.all(promises);
} catch (error) {
console.log(error);
process.exit(1);
}

View File

@@ -36,7 +36,7 @@
"@rushstack/node-core-library": "5.13.1"
},
"devDependencies": {
"@types/node": "^22.19.1",
"@types/node": "^24.10.1",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
"eslint-config-neon": "^0.2.9",

View File

@@ -50,7 +50,7 @@
"@microsoft/tsdoc": "~0.15.1"
},
"devDependencies": {
"@types/node": "^22.19.1",
"@types/node": "^24.10.1",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
"eslint-config-neon": "^0.2.9",

View File

@@ -64,7 +64,7 @@
},
"devDependencies": {
"@types/lodash": "^4.17.21",
"@types/node": "^22.19.1",
"@types/node": "^24.10.1",
"@types/resolve": "^1.20.6",
"@types/semver": "^7.7.1",
"cpy-cli": "^6.0.0",

View File

@@ -92,8 +92,6 @@
"eslint-config-neon": "^0.2.9",
"eslint-formatter-compact": "^9.0.1",
"eslint-formatter-pretty": "^7.0.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsdoc": "^54.7.0",
"prettier": "^3.7.4",
"tsd": "^0.33.0",
"turbo": "^2.6.3",

View File

@@ -67,7 +67,7 @@
},
"devDependencies": {
"@types/jsdoc-to-markdown": "^7.0.6",
"@types/node": "^22.19.1",
"@types/node": "^24.10.1",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
"eslint-config-neon": "^0.2.9",

View File

@@ -74,7 +74,7 @@
},
"devDependencies": {
"@turbo/gen": "^2.6.3",
"@types/node": "^22.19.1",
"@types/node": "^24.10.1",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
"eslint-config-neon": "^0.2.9",

View File

@@ -167,7 +167,10 @@ export async function generateAllIndices({
fetchPackageVersionDocs = fetchVersionDocs,
writeToFile = true,
} = {}) {
const indices: Record<any, any>[] = [];
const indices: {
data: ReturnType<typeof visitNodes>;
index: string;
}[] = [];
for (const pkg of PACKAGES) {
const versions = await fetchPackageVersions(pkg);

View File

@@ -71,7 +71,7 @@
"@types/react-dom": "^19.2.3",
"@unocss/eslint-plugin": "^66.5.10",
"@unocss/reset": "^66.5.10",
"@vitejs/plugin-react": "^5.1.1",
"@vitejs/plugin-react": "^5.1.2",
"chromatic": "^13.3.4",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
@@ -84,7 +84,7 @@
"turbo": "^2.6.3",
"typescript": "~5.9.3",
"unocss": "^66.5.10",
"vite": "^7.2.6",
"vite": "^7.2.7",
"vite-plugin-dts": "^4.5.4"
},
"engines": {

1564
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff