-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ⬆️ Bump dependencies * 🏷️ Fix types due to discord.js update * Use flat ESLint configuration * Convert replacePaths script to an ES module * 👷 Add build step in CI script * 👷 Update dependabot configuration
- Loading branch information
Showing
11 changed files
with
939 additions
and
963 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,42 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "04:00" | ||
open-pull-requests-limit: 10 | ||
reviewers: | ||
- utarwyn | ||
ignore: | ||
- dependency-name: "@types/node" | ||
- package-ecosystem: npm | ||
directory: '/' | ||
schedule: | ||
interval: daily | ||
time: '04:00' | ||
open-pull-requests-limit: 10 | ||
reviewers: | ||
- utarwyn | ||
ignore: | ||
- dependency-name: '@types/node' | ||
versions: ['>=18'] # stick to node 16 | ||
groups: | ||
minor-all: | ||
patterns: | ||
- '*' | ||
exclude-patterns: | ||
- 'typescript' | ||
update-types: | ||
- 'minor' | ||
- 'patch' | ||
major-all: | ||
patterns: | ||
- '*' | ||
exclude-patterns: | ||
- 'typescript' | ||
update-types: | ||
- 'major' | ||
major-typescript: | ||
patterns: | ||
- 'typescript' | ||
update-types: | ||
- 'patch' | ||
- 'major' | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
reviewers: | ||
- utarwyn | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
reviewers: | ||
- utarwyn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import globals from 'globals'; | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, { | ||
languageOptions: { globals: globals.node }, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-require-imports': 'off', | ||
'@typescript-eslint/no-unused-expressions': 'warn', | ||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }] | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Inspired from https://github.com/markokajzer/discord-soundbot | ||
// MIT License - Copyright (c) 2020 Marko Kajzer | ||
import { readFileSync } from 'fs'; | ||
import { dirname, join, relative } from 'path'; | ||
import { replaceInFileSync } from 'replace-in-file'; | ||
|
||
const tsconfig = JSON.parse(readFileSync('./tsconfig.json', 'utf-8')); | ||
const pathAliases = tsconfig.compilerOptions.paths; | ||
|
||
const from = Object.keys(pathAliases).map(key => new RegExp(`${key.split('/*')[0]}/[^'"]*`, 'g')); | ||
|
||
const to = {}; | ||
Object.entries(pathAliases).forEach(([key, value]) => { | ||
const match = key.split('/*')[0]; | ||
to[match] = value[0].split('/*')[0]; | ||
}); | ||
|
||
const options = { | ||
files: ['dist/**/*.@(j|t)s'], | ||
from, | ||
to: (...args) => { | ||
const [match, , , filename] = args; | ||
const [replacePattern, ...file] = match.split('/'); | ||
|
||
const normalizedRelativePath = relative( | ||
join(process.cwd(), dirname(filename)), | ||
join(process.cwd(), 'dist', to[replacePattern], ...file) | ||
); | ||
|
||
const relativePath = normalizedRelativePath.startsWith('.') | ||
? normalizedRelativePath | ||
: `./${normalizedRelativePath}`; | ||
|
||
return relativePath.replace(/\\/g, '/'); | ||
} | ||
}; | ||
|
||
replaceInFileSync(options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.