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

Major update (v5) #177

Merged
merged 16 commits into from
Mar 8, 2025
Merged

Major update (v5) #177

merged 16 commits into from
Mar 8, 2025

Conversation

tarampampam
Copy link
Owner

@tarampampam tarampampam commented Mar 1, 2025

🚀 Features

  • A configuration file is now supported, allowing you to store all your API keys in one place and forget about them
  • New flags --retry-attempts and --delay-between-retries are now available for fine-tuning retry attempts in case of errors
  • The new --skip-if-diff-less feature allows skipping file replacements with compressed content if the difference between the compressed and original versions is less than the percentage defined by this flag
  • The new --preserve-time feature improves the preservation of file creation timestamps, which can be especially useful when compressing photos from your smartphone and wanting to maintain their original order by creation date/time

Other Changes

  • No external dependencies are required anymore - everything needed to compile the app is included in the repository source code
  • Subcommands are no longer needed (instead of tinifier compress, simply use tinifier)
  • File extension searches are now case-insensitive
  • API keys can now be set using a single flag value instead of multiple --api-key usages—just use --api-key "key1,key2,..."
  • Added Debian/RedHat/Alpine/AUR repositories support

Removed deprecated code and improved the YAML parser for better error handling and performance. This includes restructuring the parsing logic and enhancing the error reporting mechanism to provide clearer feedback on parsing issues.

- Consolidated error handling for various parsing scenarios
- Improved token management and state transitions in the parser
- Enhanced support for YAML directives and comments handling
Introduced a Dockerfile to facilitate the building and running of the tinifier application in a containerized environment. The Dockerfile includes multi-stage builds for compiling the Go application and preparing a minimal runtime image. Additionally, a .dockerignore file was created to exclude unnecessary files from the Docker context, optimizing the build process.
@tarampampam tarampampam self-assigned this Mar 1, 2025
Added a new options struct to allow configuration of pipeline behavior, including maximum parallel processing, retry attempts, and error thresholds for cancellation. This enhances flexibility and control over pipeline execution, improving error handling and concurrency management.

- Implemented Apply method for options struct
- Added functions to set options: WithMaxParallel, WithRetryAttempts, WithMaxErrorsToStop
- Updated ThreeSteps function to utilize new options for better configurability
Introduced a new options structure to manage configuration for the CLI application. This includes flags for API keys, file extensions, thread count, error handling, and more. The changes enhance user flexibility and allow for better customization of the file processing behavior.

- Added command-line flags for configuration
- Implemented validation for user inputs
- Integrated configuration file loading for default settings
Added a new package for file filtering that allows users to filter files by their extensions, supporting both case-sensitive and case-insensitive options. Implemented functionality to retrieve files from specified directories, with support for recursive searching. This enhances the application's ability to process files based on user-defined criteria.

- Introduced `FilterByExt` function for filtering files
- Added `Files` function for directory traversal
- Included tests to ensure correct functionality of file filtering and retrieval
…lity

Updated the ThreeSteps function to accept iter.Seq instead of a slice for input values, enhancing flexibility in input handling. Adjusted related test cases to utilize slices.Values for compatibility with the new input type. This change aims to improve the pipeline's adaptability to different input structures.
Enhanced comments in the pipeline code to clarify the purpose and functionality of key components. This includes detailed descriptions for error handling, configuration options, and the execution flow of the ThreeSteps function. Improved documentation aims to facilitate better understanding and maintainability of the code.
Modified the `run` method in the CLI application to accept file paths as arguments, enhancing its functionality for file processing. Updated related comments for clarity and removed unused code to streamline the implementation.
Updated the run method to process files concurrently using a pool of TinyPNG clients. Implemented error handling to stop processing based on a configurable maximum error threshold. Added retry logic for file uploads and downloads, improving robustness and user experience. Enhanced file filtering capabilities to support additional formats.
Implemented new features for file size comparison during compression, allowing users to skip files based on size differences. Enhanced logging to provide detailed progress updates and error messages, improving user experience and debugging capabilities.
Introduced new command-line options for configuring retry attempts and delay between retries during file uploads and downloads. This enhances the robustness of the file processing by allowing users to customize error handling and improve success rates in unstable network conditions.

- Added flags for retry attempts and delay between retries
- Updated README with new options and their defaults
- Enhanced logging to provide better feedback during compression processes
Updated the README to include a comprehensive features list, installation instructions, configuration options, and usage examples for the `tinifier` CLI tool. This improves user understanding and accessibility of the tool's capabilities. Added a demo GIF and a section on how to record a demo for better visual guidance.
Changed the linter prefix in the golangci configuration from 'describe-commit' to 'tinifier' to align with the project's current naming conventions. This update ensures consistency in linting across the codebase.

- Updated linter prefix for clarity
- Maintained existing linter settings and configurations
Implemented build steps for the application and Docker image in the GitHub Actions workflow. This enhances the CI pipeline by automating the build process for multiple OS and architecture combinations, ensuring consistent builds and easier deployment.
Created new workflows for documentation updates and automated release processes. The documentation workflow triggers on changes to the README.md file, while the release workflow handles versioning, building, and packaging for multiple platforms. This enhances CI/CD efficiency and ensures consistent deployment practices.
Added detailed installation instructions for Debian/Ubuntu, RedHat, Alpine Linux, AUR, and binary installations in the README. This enhances user experience by providing clear guidance on how to set up the CLI tool across different environments.
@tarampampam tarampampam marked this pull request as ready for review March 8, 2025 20:31
@tarampampam tarampampam merged commit 975fea8 into master Mar 8, 2025
17 of 20 checks passed
@tarampampam tarampampam deleted the v5 branch March 8, 2025 20:31
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