This pull request introduces several updates to improve the discord-audio-stream package, including enhancements to package metadata, restructuring of TypeScript imports, and changes to the export structure. The most important changes are summarized below.
Package Metadata Enhancements:
Added an exports field in package.json to specify module resolution paths for require and import. This improves compatibility with different module systems.
Introduced peerDependencies for libsodium-wrappers, opusscript, and ffmpeg-static, ensuring better dependency management for consumers of the library.
Added funding information in package.json to support the project's development and updated contributor details.
TypeScript Import Restructuring:
Changed imports in src/Services/AudioManager.ts and src/Services/IAudioManager.ts to use type imports for better type safety and clarity. [1][2]
Export Structure Updates:
Modified src/index.ts to use default exports for AudioManager, VoiceConnectionDataModel, and VoiceAudioDataModel, aligning with the updated import structure.
This pull request introduces several updates to improve the `discord-audio-stream` package, including enhancements to package metadata, restructuring of TypeScript imports, and changes to the export structure. The most important changes are summarized below.
### Package Metadata Enhancements:
- Added an `exports` field in `package.json` to specify module resolution paths for `require` and `import`. This improves compatibility with different module systems.
- Introduced `peerDependencies` for `libsodium-wrappers`, `opusscript`, and `ffmpeg-static`, ensuring better dependency management for consumers of the library.
- Added `funding` information in `package.json` to support the project's development and updated contributor details.
### TypeScript Import Restructuring:
- Changed imports in `src/Services/AudioManager.ts` and `src/Services/IAudioManager.ts` to use `type` imports for better type safety and clarity. [[1]](diffhunk://#diff-b36c542d0d1a85e78f0f3e683629b83aab6270b560ca4256030289c3eb5ef7f3L9-R14) [[2]](diffhunk://#diff-ab907611c4fea3d33a657878c3d8b36be6ff20451632ccc72099e204cdaae053L1-R4)
### Export Structure Updates:
- Modified `src/index.ts` to use `default` exports for `AudioManager`, `VoiceConnectionDataModel`, and `VoiceAudioDataModel`, aligning with the updated import structure.
copilot-pull-request-reviewer[bot]
(Migrated from github.com)
left a comment
Copy Link
Copy Source
Pull Request Overview
This pull request modernizes the discord-audio-stream package by refactoring TypeScript imports/exports to use default exports and updating package.json with better module resolution and dependency management.
Refactored TypeScript code to use default exports and type-only imports for better module structure
Added module resolution paths, peer dependencies, and updated package metadata
Enhanced package.json with funding information and improved dependency management
Reviewed Changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated 6 comments.
File
Description
src/index.ts
Changed to export default imports from services and models
src/Services/IAudioManager.ts
Updated to use type-only imports and default export for interface
src/Services/AudioManager.ts
Converted to use type-only imports and default export for class
package.json
Added exports field, peer dependencies, funding info, and updated metadata
## Pull Request Overview
This pull request modernizes the `discord-audio-stream` package by refactoring TypeScript imports/exports to use default exports and updating package.json with better module resolution and dependency management.
- Refactored TypeScript code to use default exports and type-only imports for better module structure
- Added module resolution paths, peer dependencies, and updated package metadata
- Enhanced package.json with funding information and improved dependency management
### Reviewed Changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated 6 comments.
| File | Description |
| ---- | ----------- |
| src/index.ts | Changed to export default imports from services and models |
| src/Services/IAudioManager.ts | Updated to use type-only imports and default export for interface |
| src/Services/AudioManager.ts | Converted to use type-only imports and default export for class |
| package.json | Added exports field, peer dependencies, funding info, and updated metadata |
The import assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
import type { VoiceConnectionDataModel } from "../Models/VoiceConnectionDataModel";
The import assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
```suggestion
import type { VoiceConnectionDataModel } from "../Models/VoiceConnectionDataModel";
```
The import assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
import type { VoiceAudioDataModel } from "../Models/VoiceAudioDataModel";
The import assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
```suggestion
import type { VoiceAudioDataModel } from "../Models/VoiceAudioDataModel";
```
The import assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
import type { VoiceConnectionDataModel } from "../Models/VoiceConnectionDataModel";
The import assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
```suggestion
import type { VoiceConnectionDataModel } from "../Models/VoiceConnectionDataModel";
```
The import assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
import type { VoiceAudioDataModel } from "../Models/VoiceAudioDataModel";
The import assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
```suggestion
import type { VoiceAudioDataModel } from "../Models/VoiceAudioDataModel";
```
This export assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
export type { VoiceConnectionDataModel } from './Models/VoiceConnectionDataModel';
This export assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
```suggestion
export type { VoiceConnectionDataModel } from './Models/VoiceConnectionDataModel';
```
This export assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
export type { VoiceAudioDataModel } from './Models/VoiceAudioDataModel';
This export assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
```suggestion
export type { VoiceAudioDataModel } from './Models/VoiceAudioDataModel';
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This pull request introduces several updates to improve the
discord-audio-streampackage, including enhancements to package metadata, restructuring of TypeScript imports, and changes to the export structure. The most important changes are summarized below.Package Metadata Enhancements:
exportsfield inpackage.jsonto specify module resolution paths forrequireandimport. This improves compatibility with different module systems.peerDependenciesforlibsodium-wrappers,opusscript, andffmpeg-static, ensuring better dependency management for consumers of the library.fundinginformation inpackage.jsonto support the project's development and updated contributor details.TypeScript Import Restructuring:
src/Services/AudioManager.tsandsrc/Services/IAudioManager.tsto usetypeimports for better type safety and clarity. [1] [2]Export Structure Updates:
src/index.tsto usedefaultexports forAudioManager,VoiceConnectionDataModel, andVoiceAudioDataModel, aligning with the updated import structure.Pull Request Overview
This pull request modernizes the
discord-audio-streampackage by refactoring TypeScript imports/exports to use default exports and updating package.json with better module resolution and dependency management.Reviewed Changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated 6 comments.
@@ -12,2 +10,4 @@import type VoiceConnectionDataModel from "../Models/VoiceConnectionDataModel";import type VoiceAudioDataModel from "../Models/VoiceAudioDataModel";import {join} from "node:path";The import assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
@@ -12,3 +12,3 @@import {join} from "node:path";export class AudioManager implements IAudioManager {export default class AudioManager implements IAudioManager {The import assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
@@ -4,2 +2,3 @@import type VoiceAudioDataModel from "../Models/VoiceAudioDataModel";export interface IAudioManager {export default interface IAudioManager {The import assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
@@ -4,3 +3,3 @@export interface IAudioManager {export default interface IAudioManager {OverrideOptions(connectionData?: VoiceConnectionDataModel | null, audioData?: VoiceAudioDataModel | null): void;The import assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
This export assumes VoiceConnectionDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.
This export assumes VoiceAudioDataModel has a default export, but the original code shows it was a named export. This will cause a runtime error if the model file doesn't export a default.