Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies, configs, and examples #5

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://json.schemastore.org/commitlintrc.json",
"extends": ["@commitlint/config-angular"],
"rules": {
"type-enum": [
2,
"always",
["chore", "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "types", "typings"]
["chore", "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "types"]
],
"scope-case": [0]
}
Expand Down
7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"root": true,
"extends": "marine/prettier/node",
"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier"],
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"ignorePatterns": ["**/dist/*"],
"env": {
"jest": true
}
"ignorePatterns": ["**/dist/*"]
}
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
2 changes: 1 addition & 1 deletion .github/COMMIT_CONVENTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Messages must be matched by the following regex:

```js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/;
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\(.+\))?: .{1,72}/;
```

#### Examples
Expand Down
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ is a great boon to your development process.
To get ready to work on the codebase, please do the following:

1. Fork & clone the repository, and make sure you're on the **main** branch
2. Run `npm clean-install` ([install](https://docs.npmjs.com/cli/v10/commands/npm-ci))
2. Run `pnpm install --frozen-lockfile` ([install](https://pnpm.io/installation))
3. Code your heart out!
4. Run `npm run format && npm run lint` to make sure your changes follow our coding style
4. Run `pnpm run format && pnpm run lint` to make sure your changes follow our coding style
5. [Submit a pull request](https://github.com/discordjs/voice-examples/compare) (Make sure you follow the [conventional commit format](https://github.com/discordjs/voice-examples/blob/main/.github/COMMIT_CONVENTION.md))
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/01-bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Bug report
description: Report incorrect or unexpected behavior of an example
labels: [bug, need repro]
body:
- type: markdown
attributes:
value: |
Thank you for filing an issue! If you are here to ask a question, use Discord instead: https://discord.gg/djs

This issue form is for @discordjs/voice examples
- type: dropdown
id: package
attributes:
label: Which example is this bug report for?
options:
- basic
- radio-bot
- recorder
validations:
required: true
- type: textarea
id: description
attributes:
label: Issue description
description: |
Describe the issue in as much detail as possible.

Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
placeholder: |
Steps to reproduce with below code sample:
1. Do thing
2. Do thing in Discord client
3. Observe behavior
4. See error logs below
validations:
required: true
- type: textarea
id: code_sample
attributes:
label: Code sample
description: |
Your code sample should be:
1. Minimal - Use as little code as possible that still produces the same problem (and is understandable)
2. Complete - Provide all parts someone else needs to reproduce your problem
3. Reproducible - Test the code you're about to provide to make sure it reproduces the problem

This will be automatically formatted into code, so no need for backticks.
render: typescript
- type: textarea
id: versions
attributes:
label: Versions
description: List necessary versions here. This includes your @discordjs/voice version, runtime version, operating system etc.
placeholder: |
- @discordjs/voice 0.17.0 (`npm ls @discordjs/voice`)
- Node.js 20.15.0 (`node --version`)
- TypeScript 5.4.5 (`npm ls typescript` if you use it)
- macOS Ventura 13.3.1
validations:
required: true
- type: input
id: dev-release
attributes:
label: I have tested this issue on a development release
placeholder: d23280c (commit hash)
description: |
The issue might already be fixed in a development release or main. This is not required, but helps us greatly.
To install the latest development release run `npm i @discordjs/voice@dev` in your project directory.
Run `npm list @discordjs/voice` and use the last part of the printed information (`d23280c` for `@discordjs/[email protected]`)
87 changes: 0 additions & 87 deletions .github/ISSUE_TEMPLATE/bug_report.yml

This file was deleted.

File renamed without changes.
16 changes: 9 additions & 7 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install node.js v16
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js v20
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
cache-dependency-path: package-lock.json
node-version: 20
cache: 'pnpm'

- name: Turbo cache
id: turbo-cache
Expand All @@ -25,10 +27,10 @@ jobs:
turbo-${{ github.job }}-${{ github.ref_name }}-

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: ESLint
run: npm run lint -- --cache-dir=".turbo"
run: pnpm run lint --concurrency=4 -- --format=compact

- name: Build
run: npm run build -- --cache-dir=".turbo"
run: pnpm run build --concurrency=4
27 changes: 18 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Packages
node_modules/
node_modules

# Log files
logs/
logs
*.log
npm-debug.log*

Expand All @@ -15,18 +15,29 @@ pids
.env

# Dist
dist/
dist
dist-docs

# Miscellaneous
.tmp/
.tmp
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea/
.idea
.DS_Store
.turbo
tsconfig.tsbuildinfo
coverage/
coverage
out
package.tgz
tsup.config.bundled*
vitest.config.ts.timestamp*

# Deno
deno.lock

# Bun
bun.lockb

# yarn
.pnp.*
Expand All @@ -40,6 +51,4 @@ coverage/
# Cache
.prettiercache
.eslintcache

# Possible config files
config.json
.vercel
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1
pnpm exec commitlint --edit $1
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run build:check && npm run lint
pnpm run build:check && pnpm run lint
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/prettierrc.json",
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A list of ready-to-run examples for `@discordjs/voice`.

## How to try them out

All you have to do is copy the example directory of your choosing, install the dependencies, fill in the `config.json` file, and run `npm run start`.
All you have to do is copy an example of your choosing from the [examples](./examples) directory, install the dependencies, fill in the `.env` file, and run `npm run start`.

## Links

Expand Down
11 changes: 0 additions & 11 deletions _base/.eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions _base/config.example.json

This file was deleted.

35 changes: 0 additions & 35 deletions _base/package.json

This file was deleted.

12 changes: 0 additions & 12 deletions _base/src/bot.ts

This file was deleted.

Loading
Loading