updated package.json; refactored code > imports/exports

This commit is contained in:
Lechner Julian - FrauJulian
2025-07-27 17:54:25 +02:00
parent 68cadaaaa3
commit ac201235a7
9 changed files with 111 additions and 74 deletions
+21 -14
View File
@@ -1,29 +1,36 @@
{ {
"name": "discord-audio-stream", "name": "discord-audio-stream",
"version": "0.6.8", "version": "0.6.10",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "discord-audio-stream", "name": "discord-audio-stream",
"version": "0.6.8", "version": "0.6.10",
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.10.0",
"@discordjs/voice": "^0.18.0", "@discordjs/voice": "^0.18.0",
"@noble/ciphers": "^1.3.0", "@noble/ciphers": "^1.3.0",
"@stablelib/xchacha20poly1305": "^2.0.1", "@stablelib/xchacha20poly1305": "^2.0.1",
"ffmpeg-static": "^5.2.0",
"libsodium-wrappers": "^0.7.15",
"opusscript": "^0.1.1",
"sodium-native": "^5.0.6" "sodium-native": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"@types/ejs": "^3.1.5", "@types/ejs": "^3.1.5",
"@types/node": "^24.0.10", "@types/node": "^24.1.0",
"del-cli": "^6.0.0", "del-cli": "^6.0.0",
"npm-check-updates": "^18.0.1", "npm-check-updates": "^18.0.2",
"tsup": "^8.5.0", "tsup": "^8.5.0",
"typescript": "^5.8.3" "typescript": "^5.8.3"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://ko-fi.com/FrauJulian"
},
"peerDependencies": {
"ffmpeg-static": "^5.2.0",
"libsodium-wrappers": "^0.7.15",
"opusscript": "^0.1.1"
} }
}, },
"node_modules/@derhuerst/http-basic": { "node_modules/@derhuerst/http-basic": {
@@ -1084,9 +1091,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.0.10", "version": "24.1.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.10.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
"integrity": "sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA==", "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~7.8.0" "undici-types": "~7.8.0"
@@ -2314,9 +2321,9 @@
} }
}, },
"node_modules/npm-check-updates": { "node_modules/npm-check-updates": {
"version": "18.0.1", "version": "18.0.2",
"resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-18.0.1.tgz", "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-18.0.2.tgz",
"integrity": "sha512-MO7mLp/8nm6kZNLLyPgz4gHmr9tLoU+pWPLdXuGAx+oZydBHkHWN0ibTonsrfwC2WEQNIQxuZagYwB67JQpAuw==", "integrity": "sha512-9uVFZUCg5oDOcbzdsrJ4BEvq2gikd23tXuF5mqpl4mxVl051lzB00Xmd7ZVjVWY3XNUF3BQKWlN/qmyD8/bwrA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
+45 -17
View File
@@ -1,10 +1,25 @@
{ {
"name": "discord-audio-stream", "name": "discord-audio-stream",
"version": "0.6.8", "version": "0.6.10",
"description": "NodeJS library to make stream any audio on discord easier.", "description": "NodeJS library to make stream any audio on discord easier.",
"exports": {
".": {
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.mjs", "module": "./dist/index.mjs",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": { "scripts": {
"updateDependencies": "npx npm-check-updates --upgrade && npm install && echo SUCCEED UPDATE", "updateDependencies": "npx npm-check-updates --upgrade && npm install && echo SUCCEED UPDATE",
"cleanSolution": "del-cli dist && echo SUCCEED CLEAN", "cleanSolution": "del-cli dist && echo SUCCEED CLEAN",
@@ -14,35 +29,48 @@
}, },
"repository": "https://github.com/FrauJulian/Discord-Audio-Stream", "repository": "https://github.com/FrauJulian/Discord-Audio-Stream",
"bugs": "https://github.com/FrauJulian/Discord-Audio-Stream/issues", "bugs": "https://github.com/FrauJulian/Discord-Audio-Stream/issues",
"funding": "https://ko-fi.com/FrauJulian",
"keywords": [ "keywords": [
"discordjs-v14", "discordjs",
"stream", "discord.js",
"discord",
"audio", "audio",
"music" "voice",
"stream"
],
"contributors": [
{
"name": "Lechner Julian",
"nickname": "FrauJulian",
"email": "office@lechner-systems.at",
"website": "https://lechner-systems.at/"
}
], ],
"author": {
"name": "Lechner Julian",
"nickname": "FrauJulian",
"email": "contact@fraujulian.xyz",
"website": "https://fraujulian.xyz/"
},
"private": false,
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.10.0",
"@discordjs/voice": "^0.18.0", "@discordjs/voice": "^0.18.0",
"@noble/ciphers": "^1.3.0", "@noble/ciphers": "^1.3.0",
"@stablelib/xchacha20poly1305": "^2.0.1", "@stablelib/xchacha20poly1305": "^2.0.1",
"ffmpeg-static": "^5.2.0",
"libsodium-wrappers": "^0.7.15",
"opusscript": "^0.1.1",
"sodium-native": "^5.0.6" "sodium-native": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"@types/ejs": "^3.1.5", "@types/ejs": "^3.1.5",
"@types/node": "^24.0.10", "@types/node": "^24.1.0",
"del-cli": "^6.0.0", "del-cli": "^6.0.0",
"npm-check-updates": "^18.0.1", "npm-check-updates": "^18.0.2",
"tsup": "^8.5.0", "tsup": "^8.5.0",
"typescript": "^5.8.3" "typescript": "^5.8.3"
},
"peerDependencies": {
"libsodium-wrappers": "^0.7.15",
"opusscript": "^0.1.1",
"ffmpeg-static": "^5.2.0"
},
"engines": {
"node": ">=18"
},
"private": false,
"publishConfig": {
"access": "public",
"provenance": true
} }
} }
+1 -1
View File
@@ -1,4 +1,4 @@
export interface VoiceAudioDataModel { export default interface VoiceAudioDataModel {
/** /**
* The unique identifier for the audio resource. * The unique identifier for the audio resource.
*/ */
+2 -2
View File
@@ -1,6 +1,6 @@
import {DiscordGatewayAdapterCreator} from "@discordjs/voice"; import type {DiscordGatewayAdapterCreator} from "@discordjs/voice";
export interface VoiceConnectionDataModel { export default interface VoiceConnectionDataModel {
/** /**
* The ID of the voice channel to connect to. * The ID of the voice channel to connect to.
*/ */
+4 -4
View File
@@ -6,12 +6,12 @@ import {
joinVoiceChannel, joinVoiceChannel,
VoiceConnection VoiceConnection
} from "@discordjs/voice"; } from "@discordjs/voice";
import {IAudioManager} from "./IAudioManager"; import type IAudioManager from "./IAudioManager";
import {VoiceConnectionDataModel} from "../Models/VoiceConnectionDataModel"; import type VoiceConnectionDataModel from "../Models/VoiceConnectionDataModel";
import {VoiceAudioDataModel} from "../Models/VoiceAudioDataModel"; import type VoiceAudioDataModel from "../Models/VoiceAudioDataModel";
import {join} from "node:path"; import {join} from "node:path";
export class AudioManager implements IAudioManager { export default class AudioManager implements IAudioManager {
public VoiceConnection: VoiceConnection | null = null; public VoiceConnection: VoiceConnection | null = null;
public AudioPlayer: AudioPlayer | null = null; public AudioPlayer: AudioPlayer | null = null;
public AudioResource: AudioResource | null = null; public AudioResource: AudioResource | null = null;
+3 -4
View File
@@ -1,8 +1,7 @@
import {AudioPlayer, AudioResource, VoiceConnection} from "@discordjs/voice"; import type VoiceConnectionDataModel from "../Models/VoiceConnectionDataModel";
import {VoiceAudioDataModel} from "../Models/VoiceAudioDataModel"; import type VoiceAudioDataModel from "../Models/VoiceAudioDataModel";
import {VoiceConnectionDataModel} from "../Models/VoiceConnectionDataModel";
export interface IAudioManager { export default interface IAudioManager {
OverrideOptions(connectionData?: VoiceConnectionDataModel | null, audioData?: VoiceAudioDataModel | null): void; OverrideOptions(connectionData?: VoiceConnectionDataModel | null, audioData?: VoiceAudioDataModel | null): void;
CreateConnection(isRenew: boolean): void; CreateConnection(isRenew: boolean): void;
+3 -3
View File
@@ -1,3 +1,3 @@
export {AudioManager} from "./Services/AudioManager"; export { default as AudioManager } from './Services/AudioManager';
export type {VoiceConnectionDataModel} from "./Models/VoiceConnectionDataModel"; export type { default as VoiceConnectionDataModel } from './Models/VoiceConnectionDataModel';
export type {VoiceAudioDataModel} from "./Models/VoiceAudioDataModel"; export type { default as VoiceAudioDataModel } from './Models/VoiceAudioDataModel';
+26 -23
View File
@@ -1,25 +1,28 @@
{ {
"compilerOptions": { "compilerOptions": {
"strict": true, "strict": true,
"allowJs": false, "allowJs": false,
"noImplicitAny": true, "noImplicitAny": true,
"esModuleInterop": true, "esModuleInterop": true,
"strictNullChecks": true, "strictNullChecks": true,
"target": "ES2022", "target": "ES2022",
"moduleResolution": "Node", "moduleResolution": "Node",
"module": "CommonJS", "module": "CommonJS",
"declaration": true, "declaration": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"outDir": "dist", "outDir": "dist",
"types": [ "types": [
"node" "node"
], ],
"typeRoots": [ "typeRoots": [
"node_modules/@types" "node_modules/@types"
] ]
}, },
"include": [
"include": ["src"], "src"
"exclude": ["node_modules"] ],
"exclude": [
"node_modules"
]
} }
+2 -2
View File
@@ -1,7 +1,7 @@
import { defineConfig } from "tsup"; import {defineConfig} from "tsup";
export default defineConfig({ export default defineConfig({
format: [ "cjs", "esm" ], format: ["cjs", "esm"],
entry: ["./src/index.ts"], entry: ["./src/index.ts"],
dts: true, dts: true,
shims: true, shims: true,