refactor(core): enhance class implementations and documentation#162
Merged
refactor(core): enhance class implementations and documentation#162
Conversation
…erfaces - Updated .oxlintrc.json to enable @typescript-eslint/no-unsafe-declaration-merging rule - Updated Api, Field, Operation, and Resource classes to implement their respective options interfaces. - Declare all the fields in the classes instead of relying on interface declaration merging - Update openapi3 test to take new fields order Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
- Removed assignSealed utility function. - Updated constructors in Api, Field, Operation, and Resource classes to use Object.assign for property assignment. Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
- Edit .oxlintrc.json to enable jsdoc plugin - Added parameter and return type annotations in buildEnumObject, getType, fetchJsonLd, parseHydraDocumentation, and handleJson functions. Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
…ntation Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
…ormat - Changed lint:fix command to include --fix-suggestions - Updated runtime version format to include a space Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
Signed-off-by: J3m5 <5523410+J3m5@users.noreply.github.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull Request Overview
This PR refactors core classes to implement their options interfaces directly, removes a custom utility function in favor of native JavaScript, and improves JSDoc documentation consistency. The changes focus on making the codebase more maintainable while enhancing type safety and documentation quality.
- Refactored Api, Field, Operation, and Resource classes to implement their options interfaces with explicit property declarations
- Replaced the custom
assignSealedutility with nativeObject.assignfor property assignment - Standardized JSDoc comments to use proper type annotations and parameter descriptions
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/core/Api.ts | Implements ApiOptions interface with explicit property declarations and Object.assign |
| src/core/Field.ts | Implements FieldOptions interface with explicit property declarations and Object.assign |
| src/core/Operation.ts | Implements OperationOptions interface with explicit property declarations and Object.assign |
| src/core/Resource.ts | Implements ResourceOptions interface with explicit property declarations and Object.assign |
| src/core/utils/assignSealed.ts | Removes the custom assignSealed utility function |
| src/core/utils/index.ts | Removes export of assignSealed function |
| src/core/index.ts | Adds export for types module |
| package.json | Adds core module exports and updates linting command |
| .oxlintrc.json | Updates linting rules configuration |
| src/core/utils/getType.ts | Standardizes JSDoc parameter and return type annotations |
| src/core/utils/buildEnumObject.ts | Standardizes JSDoc parameter and return type annotations |
| src/hydra/fetchJsonLd.ts | Adds JSDoc parameter and return type annotations |
| src/hydra/parseHydraDocumentation.ts | Adds comprehensive JSDoc documentation with type annotations |
| src/openapi3/handleJson.ts | Adds return type annotation and standardizes JSDoc |
| src/openapi3/handleJson.test.ts | Reorders test data structure (parameters moved after operations) |
soyuka
approved these changes
Oct 24, 2025
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.
🔄 Refactored core classes (Api, Field, Operation, Resource) to implement their respective options interfaces.
🧹 Removed the
assignSealedutility function and replaced it withObject.assignfor property assignment.📜 Improved JSDoc comments for better clarity and type annotations.
📦 Updated package.json to include exports for core module types and adjusted linting commands.
🗑️ Cleaned up unused Oxlint and Unicorn rules in the configuration.