Skip to content

Commit

Permalink
Merge pull request #58 from underctrl-io/master
Browse files Browse the repository at this point in the history
style(prettier): update config and reformat codebase
  • Loading branch information
notunderctrl authored Feb 2, 2024
2 parents b3ef14f + 855609b commit af9a25c
Show file tree
Hide file tree
Showing 115 changed files with 3,058 additions and 2,816 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/deploy-dev-build.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: Publish Dev Build

on:
push:
branches:
- master
paths:
- 'packages/commandkit/**'
push:
branches:
- master
paths:
- 'packages/commandkit/**'

jobs:
release:
name: 🚀 Publish Dev Build
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8

- name: 📚 Checkout
uses: actions/checkout@v3

- name: 🟢 Node
uses: actions/setup-node@v2
with:
node-version: 18
registry-url: https://registry.npmjs.org

- name: 🍳 Prepare
run: pnpm install

- name: 🔢 Update Version
run: |
cd packages/commandkit
node -e "const pkg = require('./package.json'); \
const newVersion = pkg.version + '-dev.' + new Date().toISOString().replace(/[:\-T]/g, '').substr(0,14); \
pkg.version = newVersion; \
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
env:
DEBIAN_FRONTEND: noninteractive

- name: 🚚 Publish
run: pnpm run deploy:package-dev
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

- name: 🚫 Deprecate Previous Dev Version
run: |
PACKAGE_NAME=$(node -e "console.log(require('./packages/commandkit/package.json').name);")
ALL_VERSIONS=$(npm info $PACKAGE_NAME versions -json)
VERSION_TO_DEPRECATE=$(echo $ALL_VERSIONS | node -e "
const versions = JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8'));
const devVersions = versions.filter(v => v.includes('-dev.'));
const versionToDeprecate = devVersions[devVersions.length - 2];
console.log(versionToDeprecate);
")
echo Deprecating version $VERSION_TO_DEPRECATE
npm deprecate $PACKAGE_NAME@$VERSION_TO_DEPRECATE "Deprecated dev version."
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
release:
name: 🚀 Publish Dev Build
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8

- name: 📚 Checkout
uses: actions/checkout@v3

- name: 🟢 Node
uses: actions/setup-node@v2
with:
node-version: 18
registry-url: https://registry.npmjs.org

- name: 🍳 Prepare
run: pnpm install

- name: 🔢 Update Version
run: |
cd packages/commandkit
node -e "const pkg = require('./package.json'); \
const newVersion = pkg.version + '-dev.' + new Date().toISOString().replace(/[:\-T]/g, '').substr(0,14); \
pkg.version = newVersion; \
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
env:
DEBIAN_FRONTEND: noninteractive

- name: 🚚 Publish
run: pnpm run deploy:package-dev
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

- name: 🚫 Deprecate Previous Dev Version
run: |
PACKAGE_NAME=$(node -e "console.log(require('./packages/commandkit/package.json').name);")
ALL_VERSIONS=$(npm info $PACKAGE_NAME versions -json)
VERSION_TO_DEPRECATE=$(echo $ALL_VERSIONS | node -e "
const versions = JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8'));
const devVersions = versions.filter(v => v.includes('-dev.'));
const versionToDeprecate = devVersions[devVersions.length - 2];
console.log(versionToDeprecate);
")
echo Deprecating version $VERSION_TO_DEPRECATE
npm deprecate $PACKAGE_NAME@$VERSION_TO_DEPRECATE "Deprecated dev version."
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
42 changes: 21 additions & 21 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Lint

on:
push:
branches:
- '**'
push:
branches:
- '**'

jobs:
build:
name: 🔍 Lint
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8
build:
name: 🔍 Lint
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8

- name: 📚 Checkout
uses: actions/checkout@v3
- name: 📚 Checkout
uses: actions/checkout@v3

- name: 🟢 Node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org
- name: 🟢 Node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org

- name: 🍳 Prepare
run: pnpm install
- name: 🍳 Prepare
run: pnpm install

- name: ✨ Lint
run: pnpm lint
- name: ✨ Lint
run: pnpm lint
44 changes: 22 additions & 22 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Publish to NPM

on:
release:
types: [created]
release:
types: [created]

jobs:
release:
name: 🚀 Publish
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8
release:
name: 🚀 Publish
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
with:
version: 8

- name: 📚 Checkout
uses: actions/checkout@v3
- name: 📚 Checkout
uses: actions/checkout@v3

- name: 🟢 Node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org
- name: 🟢 Node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org

- name: 🍳 Prepare
run: pnpm install
- name: 🍳 Prepare
run: pnpm install

- name: 🚚 Publish
run: pnpm run deploy:package
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
- name: 🚚 Publish
run: pnpm run deploy:package
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ pnpm-debug.log*

.env
.env.production
.env.*

.gitignore
.npmignore

turbo-lint.log
8 changes: 4 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"tabWidth": 4,
"singleQuote": true,
"arrowParens": "always"
"printWidth": 80,
"tabWidth": 2,
"singleQuote": true,
"arrowParens": "always"
}
28 changes: 14 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,45 @@ All notable changes to this project will be documented in this file.

### Fixed

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

### Added

- add `onEnd` to ButtonKit
- add `onEnd` to ButtonKit

## [0.1.9] - 2023-12-12

### Changes (breaking)

- Update `ValidationFunctionProps` type name to `ValidationProps`.
- Update `autocompleteRun` command function name to `autocomplete`.
- Update `AutocompleteCommandProps` type name to `AutocompleteProps`.
- Update `ValidationFunctionProps` type name to `ValidationProps`.
- Update `autocompleteRun` command function name to `autocomplete`.
- Update `AutocompleteCommandProps` type name to `AutocompleteProps`.

### Deprecated

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

### Fixed

- Broken docs links.
- Broken docs links.

### Added

- `ValidationProps` type definition.
- `ValidationProps` type definition.

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

### Fixed

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

### Changed

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

### Removed

- `guildOnly` from docs examples. Closes [#42](https://github.com/underctrl-io/commandkit/issues/42)
- `guildOnly` deprecation warning.
- Emojis from logs, warnings, and errors.
- `guildOnly` from docs examples. Closes [#42](https://github.com/underctrl-io/commandkit/issues/42)
- `guildOnly` deprecation warning.
- Emojis from logs, warnings, and errors.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Firstly, thank you for considering contributing to CommandKit! Whether you're lo
### Prerequisites

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

### Fork & Clone

Expand Down Expand Up @@ -40,8 +40,8 @@ git checkout -b your-feature-or-bugfix

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:

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`.
2. If you've made changes to the docs, you can run `pnpm dev` inside "apps/docs" to spin up a local development server.
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`.
2. If you've made changes to the docs, you can run `pnpm dev` inside "apps/docs" to spin up a local development server.

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

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
});

module.exports = withNextra();
44 changes: 22 additions & 22 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "commandkit-docs",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@types/node": "^20.11.6",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"autoprefixer": "^10.4.17",
"next": "^14.1.0",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.13.2",
"postcss": "^8.4.33",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}
"name": "commandkit-docs",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@types/node": "^20.11.6",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"autoprefixer": "^10.4.17",
"next": "^14.1.0",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.13.2",
"postcss": "^8.4.33",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}
}
Loading

0 comments on commit af9a25c

Please sign in to comment.