Pull Request: Implementation of Sharding, Middleware, and Development Enhancements - #7
Open
ramkrishna-js wants to merge 1 commit into
Open
Pull Request: Implementation of Sharding, Middleware, and Development Enhancements#7ramkrishna-js wants to merge 1 commit into
ramkrishna-js wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces several architectural improvements to the create-discobase framework, focusing on scalability, extensibility, and developer productivity. Additionally, it addresses critical stability issues identified in the project initialization process and event handling logic.
Feature Implementations
Middleware System
src/middleware/.interactionCreate.jshandler.Sharding Support
setup.mjs) has been updated to include a configuration prompt for sharding.sharding.jsentry point designed for high-concurrency environments.TypeScript and IDE Integration
jsconfig.jsonfile utilizingNodeNextmodule resolution.Documentation Updates
README.mdto document the new Middleware and Sharding systems.Bug Fixes
Project Initialization Stability
ERR_FS_CP_EINVALerror insetup.mjs. The script now correctly identifies and excludes the destination directory during recursive copy operations, preventing infinite recursion when creating a project within a tracked directory.Handler Optimization
functionHandler.jsthat caused handler files to be loaded multiple times, which previously resulted in duplicate file watchers and increased resource consumption.Event Handler Refactoring
handelEvents.jsto utilizeclient.removeListenerinstead ofremoveAllListeners. This change ensures that during hot-reloads, only the specific file-associated listener is replaced, preserving unrelated event listeners.Testing Procedures
Project Generation
node setup.mjsand verify the sharding configuration prompt.Execution Logic
src/middleware/index.jsexecute correctly and can successfully halt command execution when returningfalse.node sharding.js(if enabled) to confirm proper shard spawning.Development Environment
src/commands/by inspecting the properties of theinteractionandclientobjects.Checklist