Skip to content

Commit 855609b

Browse files
committed
style(prettier): update config and reformat codebase
1 parent b3ef14f commit 855609b

File tree

115 files changed

+3058
-2816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3058
-2816
lines changed
Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
name: Publish Dev Build
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
paths:
8-
- 'packages/commandkit/**'
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'packages/commandkit/**'
99

1010
jobs:
11-
release:
12-
name: 🚀 Publish Dev Build
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: pnpm/action-setup@v2
16-
with:
17-
version: 8
18-
19-
- name: 📚 Checkout
20-
uses: actions/checkout@v3
21-
22-
- name: 🟢 Node
23-
uses: actions/setup-node@v2
24-
with:
25-
node-version: 18
26-
registry-url: https://registry.npmjs.org
27-
28-
- name: 🍳 Prepare
29-
run: pnpm install
30-
31-
- name: 🔢 Update Version
32-
run: |
33-
cd packages/commandkit
34-
node -e "const pkg = require('./package.json'); \
35-
const newVersion = pkg.version + '-dev.' + new Date().toISOString().replace(/[:\-T]/g, '').substr(0,14); \
36-
pkg.version = newVersion; \
37-
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
38-
env:
39-
DEBIAN_FRONTEND: noninteractive
40-
41-
- name: 🚚 Publish
42-
run: pnpm run deploy:package-dev
43-
env:
44-
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
45-
46-
- name: 🚫 Deprecate Previous Dev Version
47-
run: |
48-
PACKAGE_NAME=$(node -e "console.log(require('./packages/commandkit/package.json').name);")
49-
ALL_VERSIONS=$(npm info $PACKAGE_NAME versions -json)
50-
VERSION_TO_DEPRECATE=$(echo $ALL_VERSIONS | node -e "
51-
const versions = JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8'));
52-
const devVersions = versions.filter(v => v.includes('-dev.'));
53-
const versionToDeprecate = devVersions[devVersions.length - 2];
54-
console.log(versionToDeprecate);
55-
")
56-
echo Deprecating version $VERSION_TO_DEPRECATE
57-
npm deprecate $PACKAGE_NAME@$VERSION_TO_DEPRECATE "Deprecated dev version."
58-
59-
env:
60-
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
11+
release:
12+
name: 🚀 Publish Dev Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 8
18+
19+
- name: 📚 Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: 🟢 Node
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: 18
26+
registry-url: https://registry.npmjs.org
27+
28+
- name: 🍳 Prepare
29+
run: pnpm install
30+
31+
- name: 🔢 Update Version
32+
run: |
33+
cd packages/commandkit
34+
node -e "const pkg = require('./package.json'); \
35+
const newVersion = pkg.version + '-dev.' + new Date().toISOString().replace(/[:\-T]/g, '').substr(0,14); \
36+
pkg.version = newVersion; \
37+
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
38+
env:
39+
DEBIAN_FRONTEND: noninteractive
40+
41+
- name: 🚚 Publish
42+
run: pnpm run deploy:package-dev
43+
env:
44+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
45+
46+
- name: 🚫 Deprecate Previous Dev Version
47+
run: |
48+
PACKAGE_NAME=$(node -e "console.log(require('./packages/commandkit/package.json').name);")
49+
ALL_VERSIONS=$(npm info $PACKAGE_NAME versions -json)
50+
VERSION_TO_DEPRECATE=$(echo $ALL_VERSIONS | node -e "
51+
const versions = JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8'));
52+
const devVersions = versions.filter(v => v.includes('-dev.'));
53+
const versionToDeprecate = devVersions[devVersions.length - 2];
54+
console.log(versionToDeprecate);
55+
")
56+
echo Deprecating version $VERSION_TO_DEPRECATE
57+
npm deprecate $PACKAGE_NAME@$VERSION_TO_DEPRECATE "Deprecated dev version."
58+
59+
env:
60+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

.github/workflows/lint.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
name: Lint
22

33
on:
4-
push:
5-
branches:
6-
- '**'
4+
push:
5+
branches:
6+
- '**'
77

88
jobs:
9-
build:
10-
name: 🔍 Lint
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: pnpm/action-setup@v2
14-
with:
15-
version: 8
9+
build:
10+
name: 🔍 Lint
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: pnpm/action-setup@v2
14+
with:
15+
version: 8
1616

17-
- name: 📚 Checkout
18-
uses: actions/checkout@v3
17+
- name: 📚 Checkout
18+
uses: actions/checkout@v3
1919

20-
- name: 🟢 Node
21-
uses: actions/setup-node@v2
22-
with:
23-
node-version: 16
24-
registry-url: https://registry.npmjs.org
20+
- name: 🟢 Node
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 16
24+
registry-url: https://registry.npmjs.org
2525

26-
- name: 🍳 Prepare
27-
run: pnpm install
26+
- name: 🍳 Prepare
27+
run: pnpm install
2828

29-
- name: ✨ Lint
30-
run: pnpm lint
29+
- name: ✨ Lint
30+
run: pnpm lint

.github/workflows/publish.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
name: Publish to NPM
22

33
on:
4-
release:
5-
types: [created]
4+
release:
5+
types: [created]
66

77
jobs:
8-
release:
9-
name: 🚀 Publish
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: pnpm/action-setup@v2
13-
with:
14-
version: 8
8+
release:
9+
name: 🚀 Publish
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: pnpm/action-setup@v2
13+
with:
14+
version: 8
1515

16-
- name: 📚 Checkout
17-
uses: actions/checkout@v3
16+
- name: 📚 Checkout
17+
uses: actions/checkout@v3
1818

19-
- name: 🟢 Node
20-
uses: actions/setup-node@v2
21-
with:
22-
node-version: 16
23-
registry-url: https://registry.npmjs.org
19+
- name: 🟢 Node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: 16
23+
registry-url: https://registry.npmjs.org
2424

25-
- name: 🍳 Prepare
26-
run: pnpm install
25+
- name: 🍳 Prepare
26+
run: pnpm install
2727

28-
- name: 🚚 Publish
29-
run: pnpm run deploy:package
30-
env:
31-
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
28+
- name: 🚚 Publish
29+
run: pnpm run deploy:package
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ pnpm-debug.log*
1818

1919
.env
2020
.env.production
21+
.env.*
22+
23+
.gitignore
24+
.npmignore
25+
26+
turbo-lint.log

.prettierrc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"printWidth": 100,
3-
"tabWidth": 4,
4-
"singleQuote": true,
5-
"arrowParens": "always"
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"arrowParens": "always"
66
}

CHANGELOG.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,45 @@ All notable changes to this project will be documented in this file.
66

77
### Fixed
88

9-
- CommonJS projects crash when using commandkit cli with watch mode.
9+
- CommonJS projects crash when using commandkit cli with watch mode.
1010

1111
### Added
1212

13-
- add `onEnd` to ButtonKit
13+
- add `onEnd` to ButtonKit
1414

1515
## [0.1.9] - 2023-12-12
1616

1717
### Changes (breaking)
1818

19-
- Update `ValidationFunctionProps` type name to `ValidationProps`.
20-
- Update `autocompleteRun` command function name to `autocomplete`.
21-
- Update `AutocompleteCommandProps` type name to `AutocompleteProps`.
19+
- Update `ValidationFunctionProps` type name to `ValidationProps`.
20+
- Update `autocompleteRun` command function name to `autocomplete`.
21+
- Update `AutocompleteCommandProps` type name to `AutocompleteProps`.
2222

2323
### Deprecated
2424

25-
- `guildOnly` in command options. CommandKit no longer handles the `guildOnly` condition. Use `dm_permission` in your command `data` object instead.
25+
- `guildOnly` in command options. CommandKit no longer handles the `guildOnly` condition. Use `dm_permission` in your command `data` object instead.
2626

2727
### Fixed
2828

29-
- Broken docs links.
29+
- Broken docs links.
3030

3131
### Added
3232

33-
- `ValidationProps` type definition.
33+
- `ValidationProps` type definition.
3434

3535
## [0.1.10 - dev] - 2023-12-29
3636

3737
### Fixed
3838

39-
- Typos during command load/reload in specific guild (REST).
39+
- Typos during command load/reload in specific guild (REST).
4040

4141
### Changed
4242

43-
- Use `process.emitWarning()` for warnings instead of regular console logs.
44-
- Throw an error if a global command registration/deletion fails instead of just logging (for legacy command registation).
43+
- Use `process.emitWarning()` for warnings instead of regular console logs.
44+
- Throw an error if a global command registration/deletion fails instead of just logging (for legacy command registation).
4545

4646
### Removed
4747

48-
- `guildOnly` from docs examples. Closes [#42](https://github.com/underctrl-io/commandkit/issues/42)
49-
- `guildOnly` deprecation warning.
50-
- Emojis from logs, warnings, and errors.
48+
- `guildOnly` from docs examples. Closes [#42](https://github.com/underctrl-io/commandkit/issues/42)
49+
- `guildOnly` deprecation warning.
50+
- Emojis from logs, warnings, and errors.

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Firstly, thank you for considering contributing to CommandKit! Whether you're lo
77
### Prerequisites
88

99
1. Ensure you have `Node.js` and `pnpm` installed.
10-
- Node.js: [Download here](https://nodejs.org/)
11-
- pnpm: Install via `npm install -g pnpm` if you haven't.
10+
- Node.js: [Download here](https://nodejs.org/)
11+
- pnpm: Install via `npm install -g pnpm` if you haven't.
1212

1313
### Fork & Clone
1414

@@ -40,8 +40,8 @@ git checkout -b your-feature-or-bugfix
4040

4141
3. Ensure that your changes don't break any existing functionality. You can test the functionality of your code depending on where you've made changes:
4242

43-
1. If you've made changes to the CommandKit package, you can use the "tests" folder in the "packages/commandkit" directory to test your own bot. Just make sure to create a new `.env` file with the template from the `.env.example` file provided. You can run the application using `pnpm test`.
44-
2. If you've made changes to the docs, you can run `pnpm dev` inside "apps/docs" to spin up a local development server.
43+
1. If you've made changes to the CommandKit package, you can use the "tests" folder in the "packages/commandkit" directory to test your own bot. Just make sure to create a new `.env` file with the template from the `.env.example` file provided. You can run the application using `pnpm test`.
44+
2. If you've made changes to the docs, you can run `pnpm dev` inside "apps/docs" to spin up a local development server.
4545

4646
4. Run `pnpm lint` from the root directory to ensure all lint scripts and formatting is valid.
4747

apps/docs/next.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const withNextra = require('nextra')({
2-
theme: 'nextra-theme-docs',
3-
themeConfig: './theme.config.tsx',
2+
theme: 'nextra-theme-docs',
3+
themeConfig: './theme.config.tsx',
44
});
55

66
module.exports = withNextra();

apps/docs/package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"name": "commandkit-docs",
3-
"version": "0.0.0",
4-
"private": true,
5-
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start"
9-
},
10-
"dependencies": {
11-
"@types/node": "^20.11.6",
12-
"@types/react": "^18.2.48",
13-
"@types/react-dom": "^18.2.18",
14-
"autoprefixer": "^10.4.17",
15-
"next": "^14.1.0",
16-
"nextra": "^2.13.2",
17-
"nextra-theme-docs": "^2.13.2",
18-
"postcss": "^8.4.33",
19-
"react": "18.2.0",
20-
"react-dom": "18.2.0",
21-
"tailwindcss": "^3.4.1",
22-
"typescript": "^5.3.3"
23-
}
2+
"name": "commandkit-docs",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"dependencies": {
11+
"@types/node": "^20.11.6",
12+
"@types/react": "^18.2.48",
13+
"@types/react-dom": "^18.2.18",
14+
"autoprefixer": "^10.4.17",
15+
"next": "^14.1.0",
16+
"nextra": "^2.13.2",
17+
"nextra-theme-docs": "^2.13.2",
18+
"postcss": "^8.4.33",
19+
"react": "18.2.0",
20+
"react-dom": "18.2.0",
21+
"tailwindcss": "^3.4.1",
22+
"typescript": "^5.3.3"
23+
}
2424
}

0 commit comments

Comments
 (0)