From 4c5c5aab1b3de1a754b080071bfeb656b24ae5a8 Mon Sep 17 00:00:00 2001 From: gentle-giraffe-apps Date: Mon, 9 Feb 2026 15:36:30 -0800 Subject: [PATCH 1/2] doc: add es, br, jp translations --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d10797f..d1c3335 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ A smarter, faster `AsyncImage` for SwiftUI (iOS) with built-in in-memory and dis ![Last commit](https://img.shields.io/github/last-commit/gentle-giraffe-apps/SmartAsyncImage) [![DeepSource](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage.svg/?label=active+issues&show_trend=true)](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage/) +> 🌍 **Language** · English · [Español](Docs/README.es.md) · [Português (Brasil)](Docs/README.pt-BR.md) · [日本語](Docs/README.ja.md) + ## Features - SwiftUI-friendly API with an observable view model - Smart phase handling: `empty`, `loading`, `success(Image)`, `failure(Error)` From fe8e55e99da9e000d3fd867ee27d1b76887fa7e9 Mon Sep 17 00:00:00 2001 From: gentle-giraffe-apps Date: Mon, 9 Feb 2026 15:37:07 -0800 Subject: [PATCH 2/2] add files --- Docs/README.es.md | 165 +++++++++++++++++++++++++++++++++++++++++++ Docs/README.ja.md | 165 +++++++++++++++++++++++++++++++++++++++++++ Docs/README.pt-BR.md | 165 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 495 insertions(+) create mode 100644 Docs/README.es.md create mode 100644 Docs/README.ja.md create mode 100644 Docs/README.pt-BR.md diff --git a/Docs/README.es.md b/Docs/README.es.md new file mode 100644 index 0000000..5debe64 --- /dev/null +++ b/Docs/README.es.md @@ -0,0 +1,165 @@ +# SmartAsyncImage + +Un `AsyncImage` para SwiftUI (iOS) mas inteligente y rapido, con cache en memoria y en disco, cancelacion y concurrencia de Swift 6. + +[![CI](https://github.com/gentle-giraffe-apps/SmartAsyncImage/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/gentle-giraffe-apps/SmartAsyncImage/actions/workflows/ci.yml) +[![Coverage](https://codecov.io/gh/gentle-giraffe-apps/SmartAsyncImage/branch/main/graph/badge.svg)](https://codecov.io/gh/gentle-giraffe-apps/SmartAsyncImage) +[![Swift](https://img.shields.io/badge/Swift-6.1+-orange.svg)](https://swift.org) +![Bazel](https://img.shields.io/badge/Bazel-enabled-555?logo=bazel) +[![SPM Compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg)](https://swift.org/package-manager/) +[![Platforms](https://img.shields.io/badge/platforms-iOS%2017%2B-blue)](https://developer.apple.com/ios/) +![Commit activity](https://img.shields.io/github/commit-activity/y/gentle-giraffe-apps/SmartAsyncImage) +![Last commit](https://img.shields.io/github/last-commit/gentle-giraffe-apps/SmartAsyncImage) +[![DeepSource](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage.svg/?label=active+issues&show_trend=true)](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage/) + +> **Idioma** · [English](../README.md) · Español · [Português (Brasil)](README.pt-BR.md) · [日本語](README.ja.md) + +## Caracteristicas +- API compatible con SwiftUI con un view model observable +- Manejo inteligente de fases: `empty`, `loading`, `success(Image)`, `failure(Error)` +- Protocolo de cache en memoria con implementaciones intercambiables +- Cache en disco para persistencia entre ejecuciones +- Concurrencia de Swift (`async/await`) con cancelacion cooperativa +- Actualizaciones de estado seguras en MainActor + +💬 **[Participa en la discusion. Comentarios y preguntas son bienvenidos](https://github.com/gentle-giraffe-apps/SmartAsyncImage/discussions)** + +## Requisitos +- iOS 17+ +- Swift 6.1+ +- Swift Package Manager + +## 📦 Instalacion (Swift Package Manager) + +### Via Xcode + +1. Abre tu proyecto en Xcode +2. Ve a **File → Add Packages...** +3. Ingresa la URL del repositorio: `https://github.com/gentle-giraffe-apps/SmartAsyncImage.git` +4. Elige una regla de version (o `main` durante el desarrollo) +5. Agrega el producto **SmartAsyncImage** a tu target de la app + +### Via `Package.swift` + +```swift +dependencies: [ + .package(url: "https://github.com/gentle-giraffe-apps/SmartAsyncImage.git", from: "1.0.0") +] +``` + +Luego agrega `"SmartAsyncImage"` a las `dependencies` de tu target. + +## App de Demostracion + +Se incluye una app de demostracion en SwiftUI en este repositorio usando una referencia local al paquete. + +**Ruta:** +``` +Demo/SmartAsyncImageDemo/SmartAsyncImageDemo.xcodeproj +``` + +### Como Ejecutar +1. Clona el repositorio: + ```bash + git clone https://github.com/gentle-giraffe-apps/SmartAsyncImage.git + ``` +2. Abre el proyecto de demostracion: + ``` + Demo/SmartAsyncImageDemo/SmartAsyncImageDemo.xcodeproj + ``` +3. Selecciona un simulador con iOS 17+. +4. Compila y ejecuta (⌘R). + +El proyecto esta preconfigurado con una referencia local de Swift Package a `SmartAsyncImage` y deberia ejecutarse sin configuracion adicional. + +## Uso + +### Ejemplo Rapido (SwiftUI) +```swift +import SwiftUI +import SmartAsyncImage + +struct MinimalRemoteImageView: View { + let imageURL = URL(string: "https://picsum.photos/300") + + var body: some View { + + // reemplaza: AsyncImage(url: imageURL) { phase in + // ------------------------------------------------ + // con: + + SmartAsyncImage(url: imageURL) { phase in + + // ------------------------------------------------ + + switch phase { + case .empty, .loading: + ProgressView() + case .success(let image): + image.resizable().scaledToFit() + case .failure: + Image(systemName: "photo") + } + } + .frame(width: 150, height: 150) + } +} +``` + +## Calidad y Herramientas + +Este proyecto aplica controles de calidad mediante CI y analisis estatico: + +- **CI:** Todos los commits a `main` deben pasar las verificaciones de GitHub Actions +- **Analisis estatico:** DeepSource se ejecuta en cada commit a `main`. + La insignia indica el numero actual de problemas pendientes de analisis estatico. +- **Cobertura de tests:** Codecov reporta la cobertura de lineas para la rama `main` + +Captura de Codecov
+ + Captura de cobertura de codigo por archivo y modulo (grafico de arbol de Codecov) + + +Estas verificaciones tienen como objetivo mantener el sistema de diseno seguro para evolucionar con el tiempo. + +--- + +## Arquitectura + +```mermaid +flowchart TD + SAI["SmartAsyncImage
(SwiftUI View)"] --> VM["SmartAsyncImage
ViewModel"] + VM --> Phase["SmartAsyncImage
Phase"] + VM --> MemProto["SmartAsyncImageMemory
CacheProtocol"] + MemProto --> Mem["SmartAsyncImage
MemoryCache
(actor)"] + Mem --> Disk["SmartAsyncImage
DiskCache"] + Disk --> Encoder["SmartAsyncImage
Encoder"] + Mem --> URLSession[["URLSession"]] +``` + +--- + +## 🤖 Nota sobre Herramientas + +Partes de la redaccion y el refinamiento editorial en este repositorio fueron aceleradas utilizando modelos de lenguaje grandes (incluyendo ChatGPT, Claude y Gemini) bajo diseno, validacion y aprobacion final humana directa. Todas las decisiones tecnicas, el codigo y las conclusiones arquitectonicas son de autoria y verificacion del mantenedor del repositorio. + +--- + +## 🔐 Licencia + +Licencia MIT +Libre para uso personal y comercial. + +--- + +## 👤 Autor + +Creado por **Jonathan Ritchey** +Gentle Giraffe Apps +Ingeniero Senior de iOS --- Swift | SwiftUI | Concurrency + +![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fgentle-giraffe-apps%2FSmartAsyncImage) diff --git a/Docs/README.ja.md b/Docs/README.ja.md new file mode 100644 index 0000000..a5f1fe8 --- /dev/null +++ b/Docs/README.ja.md @@ -0,0 +1,165 @@ +# SmartAsyncImage + +SwiftUI (iOS) 向けの、より高速でスマートな `AsyncImage`。メモリ・ディスクキャッシュ、キャンセル、Swift 6 の並行処理を内蔵しています。 + +[![CI](https://github.com/gentle-giraffe-apps/SmartAsyncImage/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/gentle-giraffe-apps/SmartAsyncImage/actions/workflows/ci.yml) +[![Coverage](https://codecov.io/gh/gentle-giraffe-apps/SmartAsyncImage/branch/main/graph/badge.svg)](https://codecov.io/gh/gentle-giraffe-apps/SmartAsyncImage) +[![Swift](https://img.shields.io/badge/Swift-6.1+-orange.svg)](https://swift.org) +![Bazel](https://img.shields.io/badge/Bazel-enabled-555?logo=bazel) +[![SPM Compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg)](https://swift.org/package-manager/) +[![Platforms](https://img.shields.io/badge/platforms-iOS%2017%2B-blue)](https://developer.apple.com/ios/) +![Commit activity](https://img.shields.io/github/commit-activity/y/gentle-giraffe-apps/SmartAsyncImage) +![Last commit](https://img.shields.io/github/last-commit/gentle-giraffe-apps/SmartAsyncImage) +[![DeepSource](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage.svg/?label=active+issues&show_trend=true)](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage/) + +> **言語** · [English](../README.md) · [Español](README.es.md) · [Português (Brasil)](README.pt-BR.md) · 日本語 + +## 特徴 +- Observable なビューモデルを備えた SwiftUI 対応 API +- スマートなフェーズ管理: `empty`、`loading`、`success(Image)`、`failure(Error)` +- プラグイン可能な実装を持つメモリキャッシュプロトコル +- アプリの再起動をまたぐディスクキャッシュ +- Swift Concurrency (`async/await`) による協調的キャンセル +- MainActor で安全な状態更新 + +💬 **[ディスカッションに参加しましょう。フィードバックや質問を歓迎します](https://github.com/gentle-giraffe-apps/SmartAsyncImage/discussions)** + +## 要件 +- iOS 17+ +- Swift 6.1+ +- Swift Package Manager + +## 📦 インストール (Swift Package Manager) + +### Xcode 経由 + +1. Xcode でプロジェクトを開く +2. **File → Add Packages...** に移動 +3. リポジトリ URL を入力: `https://github.com/gentle-giraffe-apps/SmartAsyncImage.git` +4. バージョンルールを選択(開発中は `main` でも可) +5. **SmartAsyncImage** プロダクトをアプリターゲットに追加 + +### `Package.swift` 経由 + +```swift +dependencies: [ + .package(url: "https://github.com/gentle-giraffe-apps/SmartAsyncImage.git", from: "1.0.0") +] +``` + +次に、ターゲットの `dependencies` に `"SmartAsyncImage"` を追加します。 + +## デモアプリ + +ローカルパッケージ参照を使用した SwiftUI デモアプリがこのリポジトリに含まれています。 + +**パス:** +``` +Demo/SmartAsyncImageDemo/SmartAsyncImageDemo.xcodeproj +``` + +### 実行方法 +1. リポジトリをクローン: + ```bash + git clone https://github.com/gentle-giraffe-apps/SmartAsyncImage.git + ``` +2. デモプロジェクトを開く: + ``` + Demo/SmartAsyncImageDemo/SmartAsyncImageDemo.xcodeproj + ``` +3. iOS 17+ のシミュレーターを選択 +4. ビルドして実行 (⌘R) + +プロジェクトは `SmartAsyncImage` へのローカル Swift Package 参照で事前設定されており、追加の設定なしで実行できます。 + +## 使い方 + +### クイックサンプル (SwiftUI) +```swift +import SwiftUI +import SmartAsyncImage + +struct MinimalRemoteImageView: View { + let imageURL = URL(string: "https://picsum.photos/300") + + var body: some View { + + // 置き換え前: AsyncImage(url: imageURL) { phase in + // ------------------------------------------------ + // 置き換え後: + + SmartAsyncImage(url: imageURL) { phase in + + // ------------------------------------------------ + + switch phase { + case .empty, .loading: + ProgressView() + case .success(let image): + image.resizable().scaledToFit() + case .failure: + Image(systemName: "photo") + } + } + .frame(width: 150, height: 150) + } +} +``` + +## 品質とツール + +このプロジェクトは CI と静的解析によって品質ゲートを適用しています: + +- **CI:** `main` へのすべてのコミットは GitHub Actions のチェックを通過する必要があります +- **静的解析:** DeepSource が `main` へのすべてのコミットで実行されます。 + バッジは現在の未解決の静的解析問題の数を示しています。 +- **テストカバレッジ:** Codecov が `main` ブランチのラインカバレッジをレポートします + +Codecov スナップショット
+ + ファイルおよびモジュール別のコードカバレッジスナップショット (Codecov ツリーグラフ) + + +これらのチェックは、設計システムが安全に進化し続けられるようにすることを目的としています。 + +--- + +## アーキテクチャ + +```mermaid +flowchart TD + SAI["SmartAsyncImage
(SwiftUI View)"] --> VM["SmartAsyncImage
ViewModel"] + VM --> Phase["SmartAsyncImage
Phase"] + VM --> MemProto["SmartAsyncImageMemory
CacheProtocol"] + MemProto --> Mem["SmartAsyncImage
MemoryCache
(actor)"] + Mem --> Disk["SmartAsyncImage
DiskCache"] + Disk --> Encoder["SmartAsyncImage
Encoder"] + Mem --> URLSession[["URLSession"]] +``` + +--- + +## 🤖 ツールに関する注記 + +このリポジトリの草稿作成および編集の一部は、大規模言語モデル (ChatGPT、Claude、Gemini を含む) を使用して加速されましたが、人間による直接的な設計、検証、最終承認のもとで行われています。すべての技術的決定、コード、アーキテクチャ上の結論は、リポジトリメンテナーによって作成・検証されています。 + +--- + +## 🔐 ライセンス + +MIT ライセンス +個人利用・商用利用ともに自由です。 + +--- + +## 👤 作者 + +**Jonathan Ritchey** により構築 +Gentle Giraffe Apps +シニア iOS エンジニア --- Swift | SwiftUI | Concurrency + +![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fgentle-giraffe-apps%2FSmartAsyncImage) diff --git a/Docs/README.pt-BR.md b/Docs/README.pt-BR.md new file mode 100644 index 0000000..9fafd54 --- /dev/null +++ b/Docs/README.pt-BR.md @@ -0,0 +1,165 @@ +# SmartAsyncImage + +Um `AsyncImage` para SwiftUI (iOS) mais inteligente e rapido, com cache em memoria e em disco, cancelamento e concorrencia do Swift 6. + +[![CI](https://github.com/gentle-giraffe-apps/SmartAsyncImage/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/gentle-giraffe-apps/SmartAsyncImage/actions/workflows/ci.yml) +[![Coverage](https://codecov.io/gh/gentle-giraffe-apps/SmartAsyncImage/branch/main/graph/badge.svg)](https://codecov.io/gh/gentle-giraffe-apps/SmartAsyncImage) +[![Swift](https://img.shields.io/badge/Swift-6.1+-orange.svg)](https://swift.org) +![Bazel](https://img.shields.io/badge/Bazel-enabled-555?logo=bazel) +[![SPM Compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg)](https://swift.org/package-manager/) +[![Platforms](https://img.shields.io/badge/platforms-iOS%2017%2B-blue)](https://developer.apple.com/ios/) +![Commit activity](https://img.shields.io/github/commit-activity/y/gentle-giraffe-apps/SmartAsyncImage) +![Last commit](https://img.shields.io/github/last-commit/gentle-giraffe-apps/SmartAsyncImage) +[![DeepSource](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage.svg/?label=active+issues&show_trend=true)](https://app.deepsource.com/gh/gentle-giraffe-apps/SmartAsyncImage/) + +> **Idioma** · [English](../README.md) · [Español](README.es.md) · Português (Brasil) · [日本語](README.ja.md) + +## Funcionalidades +- API compativel com SwiftUI com um view model observavel +- Gerenciamento inteligente de fases: `empty`, `loading`, `success(Image)`, `failure(Error)` +- Protocolo de cache em memoria com implementacoes intercambiaveis +- Cache em disco para persistencia entre execucoes +- Concorrencia do Swift (`async/await`) com cancelamento cooperativo +- Atualizacoes de estado seguras no MainActor + +💬 **[Participe da discussao. Feedback e perguntas sao bem-vindos](https://github.com/gentle-giraffe-apps/SmartAsyncImage/discussions)** + +## Requisitos +- iOS 17+ +- Swift 6.1+ +- Swift Package Manager + +## 📦 Instalacao (Swift Package Manager) + +### Via Xcode + +1. Abra seu projeto no Xcode +2. Va em **File → Add Packages...** +3. Insira a URL do repositorio: `https://github.com/gentle-giraffe-apps/SmartAsyncImage.git` +4. Escolha uma regra de versao (ou `main` durante o desenvolvimento) +5. Adicione o produto **SmartAsyncImage** ao target do seu app + +### Via `Package.swift` + +```swift +dependencies: [ + .package(url: "https://github.com/gentle-giraffe-apps/SmartAsyncImage.git", from: "1.0.0") +] +``` + +Em seguida, adicione `"SmartAsyncImage"` as `dependencies` do seu target. + +## App de Demonstracao + +Um app de demonstracao em SwiftUI esta incluido neste repositorio usando uma referencia local ao pacote. + +**Caminho:** +``` +Demo/SmartAsyncImageDemo/SmartAsyncImageDemo.xcodeproj +``` + +### Como Executar +1. Clone o repositorio: + ```bash + git clone https://github.com/gentle-giraffe-apps/SmartAsyncImage.git + ``` +2. Abra o projeto de demonstracao: + ``` + Demo/SmartAsyncImageDemo/SmartAsyncImageDemo.xcodeproj + ``` +3. Selecione um simulador com iOS 17+. +4. Compile e execute (⌘R). + +O projeto ja esta configurado com uma referencia local de Swift Package para `SmartAsyncImage` e deve executar sem configuracao adicional. + +## Uso + +### Exemplo Rapido (SwiftUI) +```swift +import SwiftUI +import SmartAsyncImage + +struct MinimalRemoteImageView: View { + let imageURL = URL(string: "https://picsum.photos/300") + + var body: some View { + + // substitua: AsyncImage(url: imageURL) { phase in + // ------------------------------------------------ + // por: + + SmartAsyncImage(url: imageURL) { phase in + + // ------------------------------------------------ + + switch phase { + case .empty, .loading: + ProgressView() + case .success(let image): + image.resizable().scaledToFit() + case .failure: + Image(systemName: "photo") + } + } + .frame(width: 150, height: 150) + } +} +``` + +## Qualidade e Ferramentas + +Este projeto aplica controles de qualidade via CI e analise estatica: + +- **CI:** Todos os commits em `main` devem passar nas verificacoes do GitHub Actions +- **Analise estatica:** O DeepSource e executado em cada commit em `main`. + O badge indica o numero atual de problemas pendentes de analise estatica. +- **Cobertura de testes:** O Codecov reporta a cobertura de linhas para a branch `main` + +Captura do Codecov
+ + Captura de cobertura de codigo por arquivo e modulo (grafico de arvore do Codecov) + + +Essas verificacoes tem como objetivo manter o sistema de design seguro para evoluir ao longo do tempo. + +--- + +## Arquitetura + +```mermaid +flowchart TD + SAI["SmartAsyncImage
(SwiftUI View)"] --> VM["SmartAsyncImage
ViewModel"] + VM --> Phase["SmartAsyncImage
Phase"] + VM --> MemProto["SmartAsyncImageMemory
CacheProtocol"] + MemProto --> Mem["SmartAsyncImage
MemoryCache
(actor)"] + Mem --> Disk["SmartAsyncImage
DiskCache"] + Disk --> Encoder["SmartAsyncImage
Encoder"] + Mem --> URLSession[["URLSession"]] +``` + +--- + +## 🤖 Nota sobre Ferramentas + +Partes da redacao e do refinamento editorial neste repositorio foram aceleradas utilizando modelos de linguagem grandes (incluindo ChatGPT, Claude e Gemini) sob design, validacao e aprovacao final humana direta. Todas as decisoes tecnicas, codigo e conclusoes arquiteturais sao de autoria e verificacao do mantenedor do repositorio. + +--- + +## 🔐 Licenca + +Licenca MIT +Livre para uso pessoal e comercial. + +--- + +## 👤 Autor + +Criado por **Jonathan Ritchey** +Gentle Giraffe Apps +Engenheiro Senior de iOS --- Swift | SwiftUI | Concurrency + +![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fgentle-giraffe-apps%2FSmartAsyncImage)