Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enhance TypeScript configuration and build process #284

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

amriksingh0786
Copy link

  • Update tsconfig.json with stricter type checking and module resolution
  • Modify package.json scripts to include type checking and declaration generation
  • Update Vite configuration for better module and library bundling
  • Improve type definitions and utility functions
  • Add type-related scripts and configuration for better developer experience

- Update tsconfig.json with stricter type checking and module resolution
- Modify package.json scripts to include type checking and declaration generation
- Update Vite configuration for better module and library bundling
- Improve type definitions and utility functions
- Add type-related scripts and configuration for better developer experience
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importing type definitions for the ImageTool module, would be eaiser. I mean user can just import it and he will have all types defined for ImageModule. If they are importing ImageTool in a ts project then it would be seamless. They dont need to worry about defining types.

Comment on lines 179 to 184
byFile: string;

/**
* Endpoints for URL upload.
*/
byUrl?: string;
byUrl: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these fields are optional. At least one should be optional.

- Update default image data initialization in index.ts
- Add type documentation for index.d.ts to improve type clarity
- Remove redundant JSDoc comments from type interfaces
- Improve inline documentation for type interfaces
- Simplify type definitions while preserving their core structure
- Update ImageConfig interface to make byFile property optional
- Improve type flexibility for image configuration
- Return upload promise directly instead of resolving immediately
- Ensure proper error and success handling for upload methods
- Remove redundant Promise.resolve() calls in upload methods
- Improve JSON formatting and readability
- Remove redundant library declaration for 'dom'
- Maintain existing TypeScript compiler options
- Remove unnecessary rollupOptions configuration for external dependencies
- Simplify Vite build configuration
- Maintain existing sourcemap and build format settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type definitions are generated during compilation, we don't need to maintain them manually

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks. removed it.

- Convert string quotes from double to single quotes in vite.config.js
- Update import statements and string literals in index.ts and ui.ts
- Maintain consistent code style and formatting
- Improve code readability and consistency
- Add null coalescing for byFile endpoint URL
- Improve type casting for additional request data
- Ensure type safety when appending form data
- Delete src/types/index.d.ts type declaration file
- Remove unnecessary type definitions for ImageTool
@@ -141,7 +140,7 @@ export interface ImageConfig {
/**
* Endpoints for URL upload.
*/
byUrl?: string;
byUrl: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this field is optional

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

byFile and byUrl both are optional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants