Skip to content

Commit

Permalink
chore: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Mar 11, 2024
1 parent 5f2095b commit 0d4c26b
Show file tree
Hide file tree
Showing 32 changed files with 2,187 additions and 2,273 deletions.
18 changes: 9 additions & 9 deletions apps/guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"@vercel/edge-config": "^1.1.0",
"@vercel/og": "^0.6.2",
"ariakit": "2.0.0-next.44",
"cmdk": "^0.2.1",
"cmdk": "^1.0.0",
"contentlayer": "^0.3.4",
"next": "14.1.0",
"next": "14.1.3",
"next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand All @@ -65,13 +65,13 @@
"sharp": "^0.33.2"
},
"devDependencies": {
"@next/bundle-analyzer": "14.1.1",
"@next/bundle-analyzer": "14.1.3",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/html-escaper": "^3.0.2",
"@types/node": "18.18.8",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@unocss/eslint-plugin": "^0.58.5",
"@unocss/postcss": "^0.58.5",
"@unocss/reset": "^0.58.5",
Expand All @@ -81,16 +81,16 @@
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-formatter-pretty": "^6.0.1",
"happy-dom": "^13.6.2",
"happy-dom": "^13.7.3",
"hast-util-to-string": "^2.0.0",
"hastscript": "^8.0.0",
"html-escaper": "^3.0.3",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"turbo": "^1.12.4",
"typescript": "^5.3.3",
"turbo": "^1.12.5",
"typescript": "^5.4.2",
"unocss": "^0.58.5",
"vercel": "^33.5.3",
"vercel": "^33.5.5",
"vitest": "^1.3.1"
},
"engines": {
Expand Down
3 changes: 1 addition & 2 deletions apps/website/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export default withBundleAnalyzer({
},
webpack(config, { isServer }) {
if (!isServer) {
// Don't include any locale strings in the client JS bundle.
config.plugins.push(localesPlugin.webpack({ locales: [] }));
config.plugins.push(localesPlugin.webpack({ locales: ['en-US'] }));
}

return config;
Expand Down
28 changes: 14 additions & 14 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,33 @@
"@vercel/edge-config": "^1.1.0",
"@vercel/og": "^0.6.2",
"@vercel/postgres": "^0.7.2",
"cmdk": "^0.2.1",
"cmdk": "^1.0.0",
"geist": "^1.2.2",
"jotai": "^2.7.0",
"lucide-react": "^0.344.0",
"meilisearch": "^0.37.0",
"next": "14.1.2-canary.2",
"lucide-react": "^0.356.0",
"meilisearch": "^0.38.0",
"next": "14.2.0-canary.13",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"overlayscrollbars": "^2.5.0",
"overlayscrollbars": "^2.6.0",
"overlayscrollbars-react": "^0.5.4",
"react": "^18.2.0",
"react-aria-components": "^1.1.1",
"react-dom": "^18.2.0",
"sharp": "^0.33.2",
"usehooks-ts": "^2.15.1",
"usehooks-ts": "^3.0.1",
"vaul": "^0.9.0"
},
"devDependencies": {
"@next/bundle-analyzer": "14.1.2-canary.2",
"@next/bundle-analyzer": "14.2.0-canary.13",
"@react-aria/optimize-locales-plugin": "^1.0.2",
"@shikijs/rehype": "1.1.7",
"@tailwindcss/typography": "^0.5.10",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/node": "18.18.8",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.3.1",
"autoprefixer": "^10.4.18",
Expand All @@ -88,17 +88,17 @@
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-formatter-pretty": "^6.0.1",
"happy-dom": "^13.6.2",
"happy-dom": "^13.7.3",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"prettier-plugin-tailwindcss": "^0.5.12",
"remark-gfm": "^3.0.1",
"remark-rehype": "^11.1.0",
"shiki": "1.1.7",
"tailwindcss": "^3.4.1",
"turbo": "^1.12.4",
"typescript": "^5.3.3",
"vercel": "^33.5.3",
"turbo": "^1.12.5",
"typescript": "^5.4.2",
"vercel": "^33.5.5",
"vitest": "^1.3.1"
},
"engines": {
Expand Down
16 changes: 16 additions & 0 deletions apps/website/src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Link from 'next/link';

export default function NotFound() {
return (
<div className="mx-auto flex min-h-[calc(100vh_-_100px)] max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">404</h1>
<h2 className="text-[2rem] md:text-[3rem]">Not found.</h2>
<Link
className="inline-flex rounded-md border border-transparent bg-blurple px-6 py-2 font-medium text-white"
href="/docs"
>
Take me back
</Link>
</div>
);
}
8 changes: 6 additions & 2 deletions apps/website/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ async function fetchLatestVersion(packageName: string): Promise<string> {
return 'main';
}

const { rows } = await sql`select version from documentation where name = ${packageName} order by version desc`;
try {
const { rows } = await sql`select version from documentation where name = ${packageName} order by version desc`;

return rows.map((row) => row.version).at(1) ?? 'main';
return rows.map((row) => row.version).at(1) ?? 'main';
} catch {
return '';
}
}

export default async function middleware(request: NextRequest) {
Expand Down
41 changes: 27 additions & 14 deletions apps/website/src/util/fetchDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ export async function fetchDependencies({
readonly version: string;
}) {
if (ENV.IS_LOCAL_DEV) {
const fileContent = await readFile(
join(process.cwd(), `../../packages/${packageName}/docs/${packageName}/split/${version}.dependencies.api.json`),
'utf8',
);
try {
const fileContent = await readFile(
join(process.cwd(), `../../packages/${packageName}/docs/${packageName}/split/${version}.dependencies.api.json`),
'utf8',
);

const parsedDependencies = JSON.parse(fileContent);

return JSON.parse(fileContent);
return Object.entries<string>(parsedDependencies)
.filter(([key]) => key.startsWith('@discordjs/') && !key.includes('api-extractor'))
.map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${value.replaceAll('.', '-')}`);
} catch {
return [];
}
}

const isMainVersion = version === 'main';
const fileContent = await fetch(
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.dependencies.api.json`,
{ next: isMainVersion ? { revalidate: 0 } : { revalidate: 604_800 } },
);
const parsedDependencies = await fileContent.json();
return Object.entries<string>(parsedDependencies)
.filter(([key]) => key.startsWith('@discordjs/') && !key.includes('api-extractor'))
.map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${value.replaceAll('.', '-')}`);
try {
const isMainVersion = version === 'main';
const fileContent = await fetch(
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.dependencies.api.json`,
{ next: isMainVersion ? { revalidate: 0 } : { revalidate: 604_800 } },
);
const parsedDependencies = await fileContent.json();

return Object.entries<string>(parsedDependencies)
.filter(([key]) => key.startsWith('@discordjs/') && !key.includes('api-extractor'))
.map(([key, value]) => `${key.replace('@discordjs/', '').replaceAll('.', '-')}-${value.replaceAll('.', '-')}`);
} catch {
return [];
}
}
8 changes: 6 additions & 2 deletions apps/website/src/util/fetchLatestVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export async function fetchLatestVersion(packageName: string): Promise<string> {
return 'main';
}

const { rows } = await sql`select version from documentation where name = ${packageName} order by version desc`;
try {
const { rows } = await sql`select version from documentation where name = ${packageName} order by version desc`;

return rows.map((row) => row.version).at(1) ?? 'main';
return rows.map((row) => row.version).at(1) ?? 'main';
} catch {
return '';
}
}
33 changes: 22 additions & 11 deletions apps/website/src/util/fetchNode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { notFound } from 'next/navigation';
import { ENV } from './env';

export async function fetchNode({
Expand All @@ -14,17 +15,27 @@ export async function fetchNode({
const normalizeItem = item.split(encodeURIComponent(':')).join('.').toLowerCase();

if (ENV.IS_LOCAL_DEV) {
const fileContent = await readFile(
join(process.cwd(), `../../packages/${packageName}/docs/split/${version}.${normalizeItem}.api.json`),
'utf8',
);
return JSON.parse(fileContent);
try {
const fileContent = await readFile(
join(process.cwd(), `../../packages/${packageName}/docs/split/${version}.${normalizeItem}.api.json`),
'utf8',
);

return JSON.parse(fileContent);
} catch {
notFound();
}
}

const isMainVersion = version === 'main';
const fileContent = await fetch(
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.${normalizeItem}.api.json`,
{ next: isMainVersion ? { revalidate: 0 } : { revalidate: 604_800 } },
);
return fileContent.json();
try {
const isMainVersion = version === 'main';
const fileContent = await fetch(
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.${normalizeItem}.api.json`,
{ next: isMainVersion ? { revalidate: 0 } : { revalidate: 604_800 } },
);

return await fileContent.json();
} catch {
notFound();
}
}
33 changes: 22 additions & 11 deletions apps/website/src/util/fetchSitemap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { notFound } from 'next/navigation';
import { ENV } from './env';

export async function fetchSitemap({
Expand All @@ -10,17 +11,27 @@ export async function fetchSitemap({
readonly version: string;
}) {
if (ENV.IS_LOCAL_DEV) {
const fileContent = await readFile(
join(process.cwd(), `../../packages/${packageName}/docs/split/${version}.sitemap.api.json`),
'utf8',
);
return JSON.parse(fileContent);
try {
const fileContent = await readFile(
join(process.cwd(), `../../packages/${packageName}/docs/split/${version}.sitemap.api.json`),
'utf8',
);

return JSON.parse(fileContent);
} catch {
notFound();
}
}

const isMainVersion = version === 'main';
const fileContent = await fetch(
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.sitemap.api.json`,
{ next: isMainVersion ? { revalidate: 0 } : { revalidate: 604_800 } },
);
return fileContent.json();
try {
const isMainVersion = version === 'main';
const fileContent = await fetch(
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.sitemap.api.json`,
{ next: isMainVersion ? { revalidate: 0 } : { revalidate: 604_800 } },
);

return await fileContent.json();
} catch {
notFound();
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"devDependencies": {
"@commitlint/cli": "^19.0.3",
"@commitlint/config-angular": "^19.0.3",
"@favware/cliff-jumper": "^3.0.0",
"@favware/cliff-jumper": "^3.0.1",
"@favware/npm-deprecate": "^1.0.7",
"@types/lodash.merge": "^4.6.9",
"@unocss/eslint-plugin": "^0.58.5",
Expand All @@ -65,11 +65,11 @@
"lodash.merge": "^4.6.2",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"turbo": "^1.12.4",
"typescript": "^5.3.3",
"typescript-eslint": "^7.1.0",
"turbo": "^1.12.5",
"typescript": "^5.4.2",
"typescript-eslint": "^7.1.1",
"unocss": "^0.58.5",
"vercel": "^33.5.3",
"vercel": "^33.5.5",
"vitest": "^1.3.1"
},
"pnpm": {
Expand Down
8 changes: 4 additions & 4 deletions packages/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"@discordjs/scripts": "workspace:^",
"@vercel/blob": "^0.22.1",
"@vercel/postgres": "^0.7.2",
"meilisearch": "^0.37.0",
"meilisearch": "^0.38.0",
"p-limit": "^5.0.0",
"tslib": "^2.6.2",
"undici": "6.7.0"
"undici": "6.7.1"
},
"devDependencies": {
"@types/node": "18.18.8",
Expand All @@ -59,8 +59,8 @@
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"turbo": "^1.12.4",
"typescript": "^5.3.3",
"turbo": "^1.12.5",
"typescript": "^5.4.2",
"vitest": "^1.3.1"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/api-extractor-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^18.19.19",
"@types/node": "^18.19.22",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-formatter-pretty": "^6.0.1",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"turbo": "^1.12.4"
"turbo": "^1.12.5"
}
}
4 changes: 2 additions & 2 deletions packages/api-extractor-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"turbo": "^1.12.4",
"typescript": "^5.3.3"
"turbo": "^1.12.5",
"typescript": "^5.4.2"
},
"engines": {
"node": ">=18"
Expand Down
Loading

0 comments on commit 0d4c26b

Please sign in to comment.