mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-05 08:21:18 +12:00
build: ignores/swap/concurrency
This commit is contained in:
parent
6ea63d000b
commit
9811514deb
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
@ -34,7 +34,7 @@ When testing local changes, you may notice you need to manually recompile TypeSc
|
|||
|
||||
To avoid this you can use the `--watch` parameter in the package build script to automatically recompile the project when changes are detected.
|
||||
|
||||
For example, to automatically recompile the `@discordjs/rest` project when changes are detected, run `yarn turbo run build --filter=@discordjs/rest -- --watch` in the root folder of where you cloned the discord.js repo.
|
||||
For example, to automatically recompile the `@discordjs/rest` project when changes are detected, run `yarn turbo run build --filter=@discordjs/rest --concurrency=3 -- --watch` in the root folder of where you cloned the discord.js repo.
|
||||
|
||||
## Adding new packages
|
||||
|
||||
|
|
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
|
@ -29,35 +29,35 @@ jobs:
|
|||
|
||||
- name: Build dependencies (PR)
|
||||
if: ${{ github.event_name != 'push' }}
|
||||
run: yarn build --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
|
||||
run: yarn turbo build --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}] --concurrency=3"
|
||||
|
||||
- name: Build dependencies (Push)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: yarn build --filter="...[HEAD^1]"
|
||||
run: yarn turbo build --filter="...[HEAD^1] --concurrency=3"
|
||||
|
||||
- name: ESLint (PR)
|
||||
if: ${{ github.event_name != 'push' }}
|
||||
run: yarn lint --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" -- --format=compact
|
||||
run: yarn turbo lint --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=3 -- --format=compact
|
||||
|
||||
- name: ESLint (Push)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: yarn lint --filter="...[HEAD^1]" -- --format=compact
|
||||
run: yarn turbo lint --filter="...[HEAD^1]" --concurrency=3 -- --format=compact
|
||||
|
||||
- name: Tests (PR)
|
||||
if: ${{ github.event_name != 'push' }}
|
||||
run: yarn test --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
|
||||
run: yarn turbo test --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=3
|
||||
|
||||
- name: Tests (Push)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: yarn test --filter="...[HEAD^1]"
|
||||
run: yarn turbo test --filter="...[HEAD^1]" --concurrency=3
|
||||
|
||||
- name: Docs (PR)
|
||||
if: ${{ github.event_name != 'push' }}
|
||||
run: yarn docs --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
|
||||
run: yarn turbo docs --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=3
|
||||
|
||||
- name: Docs (Push)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: yarn docs --filter="...[HEAD^1]"
|
||||
run: yarn turbo docs --filter="...[HEAD^1]" --concurrency=3
|
||||
|
||||
- name: Upload Coverage
|
||||
if: github.repository_owner == 'discordjs'
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -30,6 +30,8 @@ tsconfig.tsbuildinfo
|
|||
coverage
|
||||
out
|
||||
package.tgz
|
||||
tsup.config.bundled*
|
||||
vitest.config.ts.timestamp*
|
||||
|
||||
# Deno
|
||||
deno.lock
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
CODEOWNERS
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
vitest.config.ts.timestamp*
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"dev:next": "next dev",
|
||||
"dev:css": "yarn generate:css --watch",
|
||||
"generate:css": "unocss 'src/**/*.tsx' 'contentlayer.config.ts' '../../packages/ui/src/lib/components/**/*.tsx' --out-file ./src/styles/unocss.css --config ../../unocss.config.ts",
|
||||
"generate:contentlayer": "contentlayer build",
|
||||
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
|
||||
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
|
||||
"fmt": "yarn format"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"build:next": "next build",
|
||||
"build:css": "yarn generate:css",
|
||||
"build:search_indices": "yarn node scripts/generateAllIndices.js",
|
||||
"build:analyze": "turbo run docs && cross-env ANALYZE=true NEXT_PUBLIC_LOCAL_DEV=true yarn build:prod",
|
||||
"build:analyze": "turbo run docs --concurrency=3 && cross-env ANALYZE=true NEXT_PUBLIC_LOCAL_DEV=true yarn build:prod",
|
||||
"preview": "next start",
|
||||
"dev": "concurrently 'yarn dev:css' 'yarn dev:next'",
|
||||
"dev:next": "next dev",
|
||||
|
|
28
package.json
28
package.json
|
@ -5,20 +5,20 @@
|
|||
"description": "A powerful library for interacting with the Discord API",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "turbo run build",
|
||||
"build:affected": "turbo run build --filter='...[origin/main]'",
|
||||
"build:apps": "turbo run build:local --filter='...{apps/*}'",
|
||||
"build:apps:affected": "turbo run build:local --filter='...{apps/*}[origin/main]'",
|
||||
"test": "turbo run test",
|
||||
"test:affected": "turbo run test --filter='...[origin/main]'",
|
||||
"lint": "turbo run lint",
|
||||
"lint:affected": "turbo run lint --filter='...[origin/main]'",
|
||||
"format": "turbo run format",
|
||||
"format:affected": "turbo run format --filter='...[origin/main]'",
|
||||
"fmt": "turbo run format",
|
||||
"fmt:affected": "turbo run format --filter='...[origin/main]'",
|
||||
"docs": "turbo run docs",
|
||||
"docs:affected": "turbo run docs --filter='...[origin/main]'",
|
||||
"build": "turbo run build --concurrency=3",
|
||||
"build:affected": "turbo run build --filter='...[origin/main]' --concurrency=3",
|
||||
"build:apps": "turbo run build:local --filter='...{apps/*}' --concurrency=3",
|
||||
"build:apps:affected": "turbo run build:local --filter='...{apps/*}[origin/main]' --concurrency=3",
|
||||
"test": "turbo run test --concurrency=3",
|
||||
"test:affected": "turbo run test --filter='...[origin/main]' --concurrency=3",
|
||||
"lint": "turbo run lint --concurrency=3",
|
||||
"lint:affected": "turbo run lint --filter='...[origin/main]' --concurrency=3",
|
||||
"format": "turbo run format --concurrency=3",
|
||||
"format:affected": "turbo run format --filter='...[origin/main]' --concurrency=3",
|
||||
"fmt": "turbo run format --concurrency=3",
|
||||
"fmt:affected": "turbo run format --filter='...[origin/main]' --concurrency=3",
|
||||
"docs": "turbo run docs --concurrency=3",
|
||||
"docs:affected": "turbo run docs --filter='...[origin/main]' --concurrency=3",
|
||||
"postinstall": "is-ci || husky install",
|
||||
"update": "yarn upgrade-interactive",
|
||||
"create-package": "turbo gen create-package"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
.turbo
|
||||
coverage
|
||||
dist
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -3,6 +3,12 @@ description: 'Run yarn install with node_modules linker and cache enabled'
|
|||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Set up swap space
|
||||
if: runner.os == 'Linux'
|
||||
uses: pierotofy/set-swap-space@v1.0
|
||||
with:
|
||||
swap-size-gb: 10
|
||||
|
||||
- name: Expose yarn config as "$GITHUB_OUTPUT"
|
||||
id: yarn-config
|
||||
shell: bash
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
.turbo
|
||||
coverage
|
||||
dist
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -6,3 +6,4 @@ docs/**/*
|
|||
!docs/index.yml
|
||||
!docs/README.md
|
||||
coverage/
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
.turbo
|
||||
dist
|
||||
coverage
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
.turbo
|
||||
dist
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,5 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
vitest.config.ts.timestamp*
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.turbo
|
||||
coverage
|
||||
dist
|
||||
turbo
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -1 +1 @@
|
|||
.turbo coverage dist dist-docs docs/docs.api.json CHANGELOG.md
|
||||
.turbo coverage dist dist-docs docs/docs.api.json CHANGELOG.md tsup.config.bundled*
|
||||
|
|
|
@ -2,3 +2,5 @@
|
|||
coverage
|
||||
dist
|
||||
storybook-static
|
||||
tsup.config.bundled*
|
||||
vite.config.ts.timestamp*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
|
@ -4,3 +4,4 @@ dist
|
|||
dist-docs
|
||||
docs/docs.api.json
|
||||
CHANGELOG.md
|
||||
tsup.config.bundled*
|
||||
|
|
93
turbo.json
93
turbo.json
|
@ -24,18 +24,11 @@
|
|||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
".cliff-jumperrc.json",
|
||||
".lintstagedrc.js",
|
||||
".prettierrc.js",
|
||||
"api-extractor-docs.json",
|
||||
"api-extractor.json",
|
||||
"cliff.toml",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
"src/**/*.mjs",
|
||||
"src/**/*.cjs",
|
||||
"LICENSE",
|
||||
"package.json",
|
||||
"tsconfig.docs.json",
|
||||
"tsconfig.eslint.json",
|
||||
|
@ -47,15 +40,12 @@
|
|||
"@discordjs/scripts#build": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
".lintstagedrc.js",
|
||||
".prettierrc.js",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
"src/**/*.mjs",
|
||||
"src/**/*.cjs",
|
||||
"src/template/**/*",
|
||||
"LICENSE",
|
||||
"package.json",
|
||||
"tsconfig.eslint.json",
|
||||
"tsconfig.json"
|
||||
|
@ -67,18 +57,11 @@
|
|||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
".storybook/**/*",
|
||||
".cliff-jumperrc.json",
|
||||
".lintstagedrc.js",
|
||||
".prettierrc.js",
|
||||
"api-extractor-docs.json",
|
||||
"api-extractor.json",
|
||||
"cliff.toml",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
"src/**/*.mjs",
|
||||
"src/**/*.cjs",
|
||||
"LICENSE",
|
||||
"package.json",
|
||||
"tsconfig.eslint.json",
|
||||
"tsconfig.json",
|
||||
|
@ -91,18 +74,11 @@
|
|||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
".storybook/**/*",
|
||||
".cliff-jumperrc.json",
|
||||
".lintstagedrc.js",
|
||||
".prettierrc.js",
|
||||
"api-extractor-docs.json",
|
||||
"api-extractor.json",
|
||||
"cliff.toml",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
"src/**/*.mjs",
|
||||
"src/**/*.cjs",
|
||||
"LICENSE",
|
||||
"package.json",
|
||||
"tsconfig.eslint.json",
|
||||
"tsconfig.json",
|
||||
|
@ -136,7 +112,6 @@
|
|||
"@discordjs/guide#build:prod": {
|
||||
"dependsOn": ["^build"],
|
||||
"env": ["METADATA_BASE_URL"],
|
||||
"dotEnv": [".env.development", ".env.development.local", ".env.local"],
|
||||
"inputs": [
|
||||
"public/**/*",
|
||||
"src/**/*.tsx",
|
||||
|
@ -183,7 +158,6 @@
|
|||
"@discordjs/website#build:prod": {
|
||||
"dependsOn": ["^build", "docs"],
|
||||
"env": ["NEXT_PUBLIC_LOCAL_DEV", "METADATA_BASE_URL", "DATABASE_URL", "EDGE_CONFIG"],
|
||||
"dotEnv": [".env.development", ".env.development.local", ".env.local"],
|
||||
"inputs": [
|
||||
"public/**/*",
|
||||
"src/**/*.tsx",
|
||||
|
@ -202,6 +176,11 @@
|
|||
"outputs": [".next/**/*"],
|
||||
"outputMode": "full"
|
||||
},
|
||||
"@discordjs/guide#generate:contentlayer": {
|
||||
"inputs": ["src/**/*.mdx"],
|
||||
"outputs": [".contentlayer/**/*"],
|
||||
"outputMode": "errors-only"
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
|
@ -260,8 +239,8 @@
|
|||
"../../.prettierignore",
|
||||
"../../.prettierrc.json",
|
||||
"../../tsconfig.eslint.json",
|
||||
"prettierignore",
|
||||
"prettierrc.js",
|
||||
".prettierignore",
|
||||
".prettierrc.js",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
|
@ -279,6 +258,33 @@
|
|||
"outputs": [],
|
||||
"outputMode": "errors-only"
|
||||
},
|
||||
"@discordjs/guide#lint": {
|
||||
"dependsOn": ["^build", "generate:contentlayer"],
|
||||
"env": ["METADATA_BASE_URL"],
|
||||
"inputs": [
|
||||
"../../eslint.config.js",
|
||||
"../../.prettierignore",
|
||||
"../../.prettierrc.json",
|
||||
"../../tsconfig.eslint.json",
|
||||
".prettierignore",
|
||||
".prettierrc.js",
|
||||
"public/**/*",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.css",
|
||||
"!src/styles/unocss.css",
|
||||
"src/**/*.json",
|
||||
"src/**/*.mdx",
|
||||
"src/assets/**/*",
|
||||
"contentlayer.config.ts",
|
||||
"next.config.js",
|
||||
"package.json",
|
||||
"tsconfig.eslint.json",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"outputs": [],
|
||||
"outputMode": "errors-only"
|
||||
},
|
||||
"format": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
|
@ -286,8 +292,8 @@
|
|||
"../../.prettierignore",
|
||||
"../../.prettierrc.json",
|
||||
"../../tsconfig.eslint.json",
|
||||
"prettierignore",
|
||||
"prettierrc.js",
|
||||
".prettierignore",
|
||||
".prettierrc.js",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.js",
|
||||
|
@ -305,6 +311,33 @@
|
|||
"outputs": [],
|
||||
"outputMode": "errors-only"
|
||||
},
|
||||
"@discordjs/guide#format": {
|
||||
"dependsOn": ["^build", "generate:contentlayer"],
|
||||
"env": ["METADATA_BASE_URL"],
|
||||
"inputs": [
|
||||
"../../eslint.config.js",
|
||||
"../../.prettierignore",
|
||||
"../../.prettierrc.json",
|
||||
"../../tsconfig.eslint.json",
|
||||
".prettierignore",
|
||||
".prettierrc.js",
|
||||
"public/**/*",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.css",
|
||||
"!src/styles/unocss.css",
|
||||
"src/**/*.json",
|
||||
"src/**/*.mdx",
|
||||
"src/assets/**/*",
|
||||
"contentlayer.config.ts",
|
||||
"next.config.js",
|
||||
"package.json",
|
||||
"tsconfig.eslint.json",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"outputs": [],
|
||||
"outputMode": "errors-only"
|
||||
},
|
||||
"docs": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": [
|
||||
|
|
Loading…
Reference in a new issue