Skip to content

Commit

Permalink
refactor: fix all eslint breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fab1o0107 committed Jul 19, 2024
1 parent eb09e34 commit b1dee73
Show file tree
Hide file tree
Showing 20 changed files with 4,543 additions and 2,776 deletions.
36 changes: 0 additions & 36 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>stegripe/renovate-config"]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>stegripe/renovate-config"]
}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ on:

jobs:
test:
uses: stegripe/workflows/.github/workflows/pnpm-lint-and-test.yml@main
uses: stegripe/workflows/.github/workflows/pnpm-lint-and-test.yaml@main
secrets: inherit
13 changes: 0 additions & 13 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc.json

This file was deleted.

10 changes: 6 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
}
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Icelink
# Esbatu

> Icelink is an innovative project that surpasses Lavalink, offering a superior audio streaming experience. Built as a refined alternative, Icelink boasts enhanced stability, frequent updates, and a robust foundation that supports extendable structures. It introduces new handling mechanisms, ensures compatibility with ESM (ECMAScript Modules) and CommonJS, and integrates Redis caching for optimized performance. Icelink represents a cutting-edge solution for streaming music, elevating the user experience with its advanced features and forward-looking approach.
> Esbatu surpasses Lavalink with enhanced stability, frequent updates, and support for ESM and CommonJS, offering a superior audio streaming experience. It features new handling mechanisms and uses Redis to manage current song/session resources, preventing replay issues.
<div align="center">
<a href="https://www.npmjs.com/package/icelink"><img src="https://img.shields.io/npm/v/icelink.svg?maxAge=3600" alt="NPM version" ><a/>
<a href="https://www.npmjs.com/package/icelink"><img src="https://img.shields.io/npm/dt/icelink.svg?maxAge=3600" alt="NPM downloads" /></a>
<a href="https://github.com/stegripe/icelink/actions"><img src="https://github.com/stegripe/icelink/actions/workflows/test.yml/badge.svg" alt="Tests status" /></a>
<a href="https://www.npmjs.com/package/esbatu"><img src="https://img.shields.io/npm/v/esbatu.svg?maxAge=3600" alt="NPM version" ><a/>
<a href="https://www.npmjs.com/package/esbatu"><img src="https://img.shields.io/npm/dt/esbatu.svg?maxAge=3600" alt="NPM downloads" /></a>
<a href="https://github.com/stegripe/esbatu/actions"><img src="https://github.com/stegripe/esbatu/actions/workflows/test.yml/badge.svg" alt="Tests status" /></a>
</div>

## Installation

**Node.js 18 or newer is required.**

```sh
npm install icelink
yarn add icelink
pnpm add icelink
bun add icelink
npm install esbatu
yarn add esbatu
pnpm add esbatu
bun add esbatu
```

## Example usage

Create class extends Icelink for depending on your library implementation (like discord.js):
Create class extends Esbatu for depending on your library implementation (like discord.js):

```js
import { Icelink } from "icelink";
import { Esbatu } from "esbatu";

export class extends Icelink {
export class extends Esbatu {
constructor(client, options) {
super(options);

Expand All @@ -43,7 +43,7 @@ Afterwards we can create a quite simple example:
```js
import { Client } from "discord.js";
import { Icelink } from "./Icelink.js";
import { Esbatu } from "./Esbatu.js";

const client = new Client({
intents: [
Expand All @@ -54,7 +54,7 @@ const client = new Client({
]
});

client.icelink = new Icelink(client, {
client.esbatu = new Esbatu(client, {
nodes: [
{
name: "default",
Expand All @@ -64,15 +64,15 @@ client.icelink = new Icelink(client, {
]
});

client.icelink.on("error", (_, error) => console.error(error));
client.on("raw", packet => client.icelink.updateInstance(packet));
client.esbatu.on("error", (_, error) => console.error(error));
client.on("raw", packet => client.esbatu.updateInstance(packet));
client.on("ready" async () => {
client.icelink.id = client.user.id;
client.esbatu.id = client.user.id;

for (const node of client.icelink.options.nodes)
client.icelink.addNode(node).catch(error => client.icelink.emit("error", node.name, error));
for (const node of client.esbatu.options.nodes)
client.esbatu.addNode(node).catch(error => client.esbatu.emit("error", node.name, error));

const node = client.icelink.idealNode;
const node = client.esbatu.idealNode;
const player = await node.joinVoiceChannel({
guildId: "836189103103811192",
channelId: "721217201021217261",
Expand All @@ -84,7 +84,7 @@ client.on("ready" async () => {
await player.playTrack({ track: resultTrack.data.encoded });

setTimeout(async () => {
await client.icelink.leaveVoiceChannel(player.guildId);
await client.esbatu.leaveVoiceChannel(player.guildId);
}, 60_000);
});

Expand Down
27 changes: 27 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { common, modules, node, stylistic, typescript, extend } from "@stegripe/eslint-config";

export default [
...common,
...modules,
...node,
...stylistic,
...extend(typescript, [
{
rule: "typescript/naming-convention",
option: [
"error",
{
selector: "default",
format: ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"],
leadingUnderscore: "allow",
trailingUnderscore: "forbid"
},
{
selector: "variable",
modifiers: ["destructured"],
format: null
}
]
}
])
];
129 changes: 63 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,65 @@
{
"name": "icelink",
"version": "1.0.0-dev",
"description": "Icelink outshines Lavalink with its superior stability, frequent updates, and extended capabilities. Featuring new handling mechanisms, support for ESM and CommonJS, and efficient Redis caching, Icelink offers an enhanced and reliable music streaming experience.",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc --noEmit && tsup --config tsup-config.json",
"build:docs": "typedoc --theme default --readme README.md --out docs/ --entryPointStrategy expand src/.",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"prepack": "pnpm lint && pnpm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/stegripe/icelink.git"
},
"author": "Fab1o0107 <fabio@stegripe.org>",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/stegripe/icelink/issues"
},
"homepage": "https://github.com/stegripe/icelink#readme",
"engines": {
"node": ">=18.x"
},
"devDependencies": {
"@clytage/eslint-config": "^3.0.1",
"@types/node": "^20.14.10",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-pretty": "^5.0.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.2",
"tsup": "^8.1.0",
"typedoc": "^0.26.3",
"typescript": "^5.5.3"
},
"dependencies": {
"undici": "^6.19.2",
"ws": "^8.18.0"
},
"peerDependencies": {
"ioredis": ">=5.4.1"
},
"peerDependenciesMeta": {
"ioredis": {
"optional": true
}
},
"exports": {
".": {
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
}
"name": "esbatu",
"version": "1.0.0-dev",
"description": "Esbatu surpasses Lavalink with superior stability, frequent updates, extended capabilities, and efficient Redis caching, offering a reliable music streaming experience.",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc --noEmit && tsup --config tsup-config.json",
"build:docs": "typedoc --theme default --readme README.md --out docs/ --entryPointStrategy expand src/.",
"format": "cross-env TIMING=1 eslint --fix src",
"lint": "cross-env TIMING=1 eslint src",
"prepack": "pnpm lint && pnpm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/stegripe/icelink.git"
},
"author": "Fab1o0107 <fabio@stegripe.org>",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/stegripe/icelink/issues"
},
"homepage": "https://github.com/stegripe/icelink#readme",
"engines": {
"node": ">=18.x"
},
"devDependencies": {
"@stegripe/eslint-config": "^1.0.0",
"@types/node": "^20.14.11",
"@types/ws": "^8.5.11",
"cross-env": "^7.0.3",
"eslint": "^9.7.0",
"tsup": "^8.1.2",
"typedoc": "^0.26.4",
"typescript": "^5.5.3"
},
"dependencies": {
"undici": "^6.19.2",
"ws": "^8.18.0"
},
"peerDependencies": {
"ioredis": ">=5.4.1"
},
"peerDependenciesMeta": {
"ioredis": {
"optional": true
}
},
"exports": {
".": {
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"files": [
"dist"
]
}
Loading

0 comments on commit b1dee73

Please sign in to comment.