Skip to content

Commit

Permalink
Merge branch 'main' into refactor/zod-builders
Browse files Browse the repository at this point in the history
  • Loading branch information
Qjuh committed Mar 23, 2024
2 parents 3e48d32 + 6cc5fa2 commit 15460ea
Show file tree
Hide file tree
Showing 205 changed files with 9,825 additions and 7,994 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text=auto eol=lf
pnpm-lock.yaml linguist-generated=true text=auto eol=lf
50 changes: 43 additions & 7 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ jobs:
pnpm run build
cd ..
- name: Extract package and semver from tag
if: ${{ env.REF_TYPE == 'tag' }}
id: extract-tag
uses: ./packages/actions/src/formatTag
with:
tag: ${{ inputs.ref || github.ref_name }}

- name: Apply tag to api-extractor config
if: ${{ env.REF_TYPE == 'tag' && !inputs.ref }}
run: sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ steps.extract-tag.outputs.semver }}!' "packages/${{ steps.extract-tag.outputs.package}}/"

- name: Build docs
run: pnpm run docs

Expand All @@ -75,7 +86,9 @@ jobs:
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "util" "voice" "ws")
for PACKAGE in "${PACKAGES[@]}"; do
cd "packages/${PACKAGE}"
sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ inputs.ref }}!' api-extractor.json
../../main/packages/api-extractor/bin/api-extractor run --local --minify
../../main/packages/scripts/bin/generateSplitDocumentation
cd ../..
done
Expand All @@ -86,13 +99,6 @@ jobs:
token: ${{ secrets.DJS_DOCS }}
path: 'out'

- name: Extract package and semver from tag
if: ${{ env.REF_TYPE == 'tag' }}
id: extract-tag
uses: ./packages/actions/src/formatTag
with:
tag: ${{ inputs.ref || github.ref_name }}

- name: Upload documentation to database
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
env:
Expand All @@ -113,6 +119,24 @@ jobs:
package: ${{ steps.extract-tag.outputs.package }}
version: ${{ steps.extract-tag.outputs.semver }}

- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
env:
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
uses: ./packages/actions/src/uploadSplitDocumentation
with:
package: ${{ steps.extract-tag.outputs.package }}
version: ${{ steps.extract-tag.outputs.semver }}

- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
env:
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
uses: ./main/packages/actions/src/uploadSplitDocumentation
with:
package: ${{ steps.extract-tag.outputs.package }}
version: ${{ steps.extract-tag.outputs.semver }}

- name: Move docs to correct directory
if: ${{ env.REF_TYPE == 'tag' }}
env:
Expand Down Expand Up @@ -141,6 +165,18 @@ jobs:
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
uses: ./main/packages/actions/src/uploadDocumentation

- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
env:
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
uses: ./packages/actions/src/uploadSplitDocumentation

- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
env:
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
uses: ./main/packages/actions/src/uploadSplitDocumentation

- name: Move docs to correct directory
if: ${{ env.REF_TYPE == 'branch' }}
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- package: '@discordjs/ws'
folder: 'ws'
runs-on: ubuntu-latest
permissions:
id-token: write
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Expand Down Expand Up @@ -71,7 +73,7 @@ jobs:
if: steps.release-check.outputs.release == '1'
run: |
pnpm --filter=${{ matrix.package }} run release --preid "dev.$(date +%s)-$(git rev-parse --short HEAD)"
pnpm --filter=${{ matrix.package }} publish --no-git-checks --tag dev || true
pnpm --filter=${{ matrix.package }} publish --provenance --no-git-checks --tag dev || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
npm-publish:
name: npm publish
runs-on: ubuntu-latest
permissions:
id-token: write
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Expand Down Expand Up @@ -34,6 +36,6 @@ jobs:

- name: Publish package
run: |
pnpm --filter=${{ steps.extract-tag.outputs.subpackage == 'true' && '@discordjs/' || '' }}${{ steps.extract-tag.outputs.package }} publish --no-git-checks
pnpm --filter=${{ steps.extract-tag.outputs.subpackage == 'true' && '@discordjs/' || '' }}${{ steps.extract-tag.outputs.package }} publish --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"eamodio.gitlens",
"christian-kohler.npm-intellisense",
"christian-kohler.path-intellisense",
"antfu.unocss",
"unifiedjs.vscode-mdx"
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"npm.packageManager": "pnpm",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"unocss.disable": true,
"deno.enable": false,
"deno.enablePaths": ["./packages/create-discord-bot/template/Deno"],
"deno.lint": false,
Expand Down
32 changes: 16 additions & 16 deletions apps/guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
"@code-hike/mdx": "^0.9.0",
"@discordjs/ui": "workspace:^",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.1.3",
"@vercel/edge-config": "^0.4.1",
"@vercel/analytics": "^1.2.2",
"@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,33 +65,33 @@
"sharp": "^0.33.2"
},
"devDependencies": {
"@next/bundle-analyzer": "14.1.0",
"@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.54",
"@types/react-dom": "^18.2.18",
"@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",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.2.2",
"@vitest/coverage-v8": "^1.3.1",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-neon": "^0.1.58",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-formatter-pretty": "^6.0.1",
"happy-dom": "^13.3.8",
"happy-dom": "^13.7.3",
"hast-util-to-string": "^2.0.0",
"hastscript": "^8.0.0",
"html-escaper": "^3.0.3",
"postcss": "^8.4.34",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"turbo": "^1.12.2",
"typescript": "^5.3.3",
"turbo": "^1.12.5",
"typescript": "^5.4.2",
"unocss": "^0.58.5",
"vercel": "^33.4.1",
"vitest": "^1.2.2"
"vercel": "^33.5.5",
"vitest": "^1.3.1"
},
"engines": {
"node": ">=18"
Expand Down
1 change: 0 additions & 1 deletion apps/website/.env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
NEXT_PUBLIC_LOCAL_DEV=true
METADATA_BASE_URL=http://localhost:3000
2 changes: 2 additions & 0 deletions apps/website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ src/styles/unocss.css
lighthouse-results

.vercel

old_src
5 changes: 4 additions & 1 deletion apps/website/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
module.exports = {
...require('../../.prettierrc.json'),
plugins: ['prettier-plugin-tailwindcss'],
};
22 changes: 15 additions & 7 deletions apps/website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
import bundleAnalyzer from '@next/bundle-analyzer';
import localesPlugin from '@react-aria/optimize-locales-plugin';

const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});

export default withBundleAnalyzer({
reactStrictMode: true,
experimental: {
typedRoutes: true,
serverComponentsExternalPackages: ['@rushstack/node-core-library', '@discordjs/api-extractor-model', 'jju'],
},
images: {
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;",
},
poweredByHeader: false,
env: {
MAX_FETCH_SIZE: '5',
logging: {
fetches: {
fullUrl: true,
},
},
experimental: {
ppr: false,
},
webpack(config, { isServer }) {
if (!isServer) {
config.plugins.push(localesPlugin.webpack({ locales: ['en-US'] }));
}

return config;
},
async redirects() {
return [
Expand Down
70 changes: 36 additions & 34 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,58 +46,60 @@
},
"homepage": "https://discord.js.org",
"dependencies": {
"@discordjs/api-extractor-model": "workspace:^",
"@discordjs/api-extractor-utils": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@discordjs/ui": "workspace:^",
"@microsoft/tsdoc": "^0.14.2",
"@microsoft/tsdoc-config": "0.16.2",
"@radix-ui/react-collapsible": "^1.0.3",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.1.3",
"@vercel/edge-config": "^0.4.1",
"@vercel/analytics": "^1.2.2",
"@vercel/blob": "^0.22.1",
"@vercel/edge-config": "^1.1.0",
"@vercel/og": "^0.6.2",
"@vercel/postgres": "^0.7.2",
"ariakit": "2.0.0-next.44",
"bright": "^0.8.4",
"class-variance-authority": "^0.7.0",
"cmdk": "^0.2.1",
"meilisearch": "^0.37.0",
"next": "14.1.0",
"cmdk": "^1.0.0",
"geist": "^1.2.2",
"jotai": "^2.7.0",
"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.6.0",
"overlayscrollbars-react": "^0.5.4",
"react": "^18.2.0",
"react-custom-scrollbars-2": "^4.5.0",
"react-aria-components": "^1.1.1",
"react-dom": "^18.2.0",
"react-use": "^17.5.0",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
"sharp": "^0.33.2",
"swr": "^2.2.4"
"usehooks-ts": "^3.0.1",
"vaul": "^0.9.0"
},
"devDependencies": {
"@next/bundle-analyzer": "14.1.0",
"@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.54",
"@types/react-dom": "^18.2.18",
"@unocss/eslint-plugin": "^0.58.5",
"@unocss/postcss": "^0.58.5",
"@unocss/reset": "^0.58.5",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.2.2",
"@vitest/coverage-v8": "^1.3.1",
"autoprefixer": "^10.4.18",
"cpy-cli": "^5.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-neon": "^0.1.58",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-formatter-pretty": "^6.0.1",
"happy-dom": "^13.3.8",
"postcss": "^8.4.34",
"happy-dom": "^13.7.3",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"turbo": "^1.12.2",
"typescript": "^5.3.3",
"vercel": "^33.4.1",
"vitest": "^1.2.2"
"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.5",
"typescript": "^5.4.2",
"vercel": "^33.5.5",
"vitest": "^1.3.1"
},
"engines": {
"node": ">=18"
Expand Down
3 changes: 2 additions & 1 deletion apps/website/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
plugins: {
'@unocss/postcss': {},
tailwindcss: {},
autoprefixer: {},
},
};
28 changes: 0 additions & 28 deletions apps/website/src/app/_global-error.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions apps/website/src/app/api/[package]/versions/route.ts

This file was deleted.

Loading

0 comments on commit 15460ea

Please sign in to comment.