Skip to content

Version 1.0.0 #1

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Version 1.0.0 #1

wants to merge 19 commits into from

Conversation

ahnv
Copy link
Member

@ahnv ahnv commented May 18, 2025

This pull request introduces several foundational updates to the project, including configuration files for development standards, documentation updates, and new components for the admin interface. These changes aim to enhance project maintainability, improve developer experience, and provide a better user interface for the plugin.

Development Environment and Configuration Updates

  • .editorconfig: Added a configuration file to standardize code formatting across editors, including settings for indentation, line endings, and character encoding.
  • .eslintignore and .prettierignore: Ignored dist and coverage directories for linting and formatting. [1] [2]
  • .nvmrc: Specified Node.js version v20.13.0 for consistent development environments.
  • .prettierrc: Configured Prettier with rules for line endings, tab width, and trailing commas.
  • .vscode/settings.json: Added workspace settings for consistent formatting and TypeScript preferences.
  • .yarnrc.yml: Configured Yarn to use the node-modules linker for dependency management.

Documentation Enhancements

  • CONTRIBUTING.md: Added contribution guidelines, including setup instructions, code style requirements, and pull request best practices.
  • LICENSE: Added an MIT license to define the terms of use for the project.
  • README.md: Overhauled the documentation with installation instructions, configuration details, and usage examples for the ImageKit Strapi plugin.

Admin Interface Components

Error Handling and Utilities

ahnv added 12 commits May 12, 2025 20:44
- Add webhook endpoint to handle ImageKit file creation events
- Create webhook service to process and import files into Strapi
- Add frontend functionality to trigger imports from media library
- Support importing both main files and their format versions (thumbnails, small, medium, large)
- Add comprehensive error handling and user notifications
- Use direct database queries for better compatibility with Strapi 5
- Include metadata and format associations during import
- Add new media library read permission
- Update permissions system to support media library access
- Add translations for the new permission
- Register permission in the bootstrap process
- Update menu item to require the new permission
- Organize settings permissions under a subcategory
Renamed the `isPrivate` setting to `useSignedUrls` across the codebase to better reflect its purpose of enabling signed URLs. This change affects settings forms, schemas, types, and service implementations, making the functionality more intuitive.
- Added `isPrivateFile` toggle in upload options to mark files as private in ImageKit
- Enhanced URL generation to respect expiry settings for signed URLs
- Fixed upload service to properly handle private file settings
- Improved error handling in the upload provider
- Updated translations for the new private file option
- Ensured consistent behavior between upload and URL generation
@ahnv ahnv requested a review from Copilot May 18, 2025 20:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces version 1.0.0 of the Strapi ImageKit Provider by enhancing the admin panel integration, adding configuration and documentation files, and providing new hooks and error handling modules. Key updates include new admin UI components (like ImageKitLogo, Initializer, and Field), refined HTTP error handling through a custom HttpError class and useHTTP hook, and comprehensive documentation and configuration improvements.

Reviewed Changes

Copilot reviewed 69 out of 69 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
admin/src/index.ts Sets up menu links, settings sections, and plugin registration.
admin/src/hooks/useHttp.ts Introduces a custom HTTP hook for API calls with error handling.
admin/src/errors/HttpError.ts Implements a custom error class for HTTP errors.
admin/src/components/* Provides new reusable admin UI components with styling and icons.
README.md Updates documentation to reflect plugin usage and setup details.
Various config files (.editorconfig, .prettierrc, etc.) Introduces various configuration setups for code consistency.

Comment on lines +9 to +10
super();
this.message = message;
Copy link
Preview

Copilot AI May 18, 2025

Choose a reason for hiding this comment

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

Consider calling super(message) instead of super() in the HttpError constructor so that the built-in Error object properly captures and displays the error message.

Suggested change
super();
this.message = message;
super(message);

Copilot uses AI. Check for mistakes.

xmlns="http://www.w3.org/2000/svg"
{...props}
ref={ref}
fill={'#c0c0cf'}
Copy link
Preview

Copilot AI May 18, 2025

Choose a reason for hiding this comment

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

The hardcoded fill color overrides the fill prop provided by the component. Consider using the fill variable to allow customization via the component's props.

Suggested change
fill={'#c0c0cf'}
fill={fill}

Copilot uses AI. Check for mistakes.

ahnv added 3 commits May 21, 2025 02:25
- Moved URL transformation logic from bootstrap to register.ts
- Implemented using Strapi's built-in sanitizer system
- Added proper type safety with Model and Data types
- Improved client caching with clearImageKitClient function
- Removed response decorator in favor of sanitizer approach
- Enhanced transformation handling for image formats
- Removed unused clearImageKitClient function
- Added uploadOptions to toUploadParams for more flexible file uploads
@ahnv ahnv changed the title Version 1.0.0 of Strapi ImageKit Provider Version 1.0.0 May 21, 2025
@ahnv ahnv requested a review from Copilot May 21, 2025 16:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces foundational improvements including new configuration, documentation updates, and new admin interface components for the ImageKit plugin.

  • Added standardized configuration files such as .editorconfig and .prettierrc
  • Updated documentation with a comprehensive README, CONTRIBUTING guidelines, and LICENSE
  • Implemented new admin interface components and hooks to enhance plugin functionality

Reviewed Changes

Copilot reviewed 69 out of 69 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
admin/src/index.ts Plugin registration with menu link, settings section and translation registration
admin/src/hooks/useHttp.ts New HTTP hook implementation for API interactions using error handling
admin/src/errors/HttpError.ts Custom HttpError class for enhanced HTTP error details
admin/src/components/** New and styled React components including Initializer, ImageKitLogo, Field, etc.
Various configuration and documentation files Added config files and updated project documentation for improved consistency and clarity

Comment on lines +9 to +10
super();
this.message = message;
Copy link
Preview

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Consider calling super(message) instead of super() so that the Error object is properly initialized with the provided error message.

Suggested change
super();
this.message = message;
super(message);

Copilot uses AI. Check for mistakes.

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.

1 participant