Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/general-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: General issue
about: Report a reproducible bug or issue
title: '[Bug] [Feature Request] Short description of the issue'
labels: ''
assignees: ''
---

## 🐞 Expected Behavior
<!-- Describe what should happen under normal conditions. -->

## ❌ Actual Behavior
<!-- Describe what is currently happening instead of the expected behavior. -->

## 🔄 Steps to Reproduce
1. <!-- Step 1: Provide clear instructions to reproduce the issue. -->
2. <!-- Step 2: Add any additional steps as needed. -->
3. <!-- Continue listing steps until the issue is fully reproducible. -->

## 📄 Logs / Error Messages
<!-- Paste any relevant logs, error messages, or stack traces. -->

## 📸 Screenshots
<!-- Attach screenshots or GIFs that help visualize the issue. -->

## 💻 Code Snippets
```swift
// Include relevant code snippets that help reproduce the issue.
```

## 🛠 System Information
- **Package Version**: <!-- e.g., 0.1.0 -->
- **Operating System**: <!-- e.g., macOS 14, iOS 18 -->
- **Device / Hardware**: <!-- e.g., iPhone 14 Pro, M1 MacBook -->
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## What
<!-- What was changed -->

## Why
<!-- Why this change was needed -->

## Changes
<!-- List affected files/modules -->
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tests

on:
pull_request:
branches: [ main ]

jobs:
test:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

- name: List available iOS runtimes
run: xcrun simctl list runtimes

- name: Create and boot iOS Simulator
run: |
# Get the latest iOS runtime available
RUNTIME=$(xcrun simctl list runtimes | grep "iOS" | tail -1 | grep -oE "com\.apple\.CoreSimulator\.SimRuntime\.iOS-[0-9-]+")
echo "Using runtime: $RUNTIME"

# Create simulator
SIMULATOR_ID=$(xcrun simctl create test-device com.apple.CoreSimulator.SimDeviceType.iPhone-15 "$RUNTIME" 2>&1 | tail -1)
echo "Created simulator: $SIMULATOR_ID"

# Boot it
xcrun simctl boot "$SIMULATOR_ID"

# Wait for it to boot
sleep 5

echo "SIMULATOR_ID=$SIMULATOR_ID" >> $GITHUB_ENV

- name: Run tests with iOS Simulator
run: |
xcodebuild test \
-scheme ZeplinKit \
-skipPackagePluginValidation \
-destination "id=${{ env.SIMULATOR_ID }}" \
-derivedDataPath .build \
-enableCodeCoverage YES \
-sdk iphonesimulator \
-verbose
5 changes: 5 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
builder:
configs:
- documentation_targets: [ZeplinKit]
platform: ios
70 changes: 70 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentConditionalCompilationBlocks" : true,
"indentSwitchCaseLabels" : false,
"indentation" : {
"spaces" : 4
},
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : false,
"lineBreakBeforeEachGenericRequirement" : false,
"lineLength" : 140,
"maximumBlankLines" : 1,
"multiElementCollectionTrailingCommas" : true,
"noAssignmentInExpressions" : {
"allowedFunctions" : [
"XCTAssertNoThrow"
]
},
"prioritizeKeepingFunctionOutputTogether" : false,
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoPlaygroundLiterals" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : false,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"TypeNamesShouldBeCapitalized" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : true,
"UseLetInEveryBoundCaseVariable" : true,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : true,
"UseSynthesizedInitializer" : true,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
},
"spacesAroundRangeFormationOperators" : true,
"tabWidth" : 4,
"version" : 1
}
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Change Log
All notable changes to this project will be documented in this file.

<!--
## [Unreleased] - yyyy-mm-dd

### Added
- [ISSUE-XXXX](http://tickets.projectname.com/browse/PROJECTNAME-XXXX)
Ticket title goes here.
- [ISSUE-YYYY](http://tickets.projectname.com/browse/PROJECTNAME-YYYY)
Ticket title goes here.

### Changed
- Describe changes here.

### Fixed
- Describe fixes here.

-->

## [0.1.0] - 2026-01-12

Initial public release of ZeplinKit.

### Added
- MIT License for the project
- Continuous Integration workflow
- Issue template for GitHub
- Pull request template for GitHub
- Swift Package Index configuration (.spi.yml)
- Shield badges to README
- Format plugin for code formatting

### Changed
- Restructured project folders for better organization
- Formatted entire codebase with consistent style
- Updated and polished documentation metadata
- Enhanced README with better documentation

### Fixed
- Logo image source reference in README.md
- Documentation references in README
- Various typos throughout the project

## [0.0.4]

- Updated models with Sendable conformance

## [0.0.3]

- Build against Fetcher v0.0.2

## [0.0.2]

- Conform ZeplinSection to Identifiable

## [0.0.1]

- Initial implementation
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Snapp-Mobile

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 12 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ZeplinKit",
platforms: [
.iOS(.v13),
.macOS(.v11)
.macOS(.v11),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "ZeplinKit",
targets: ["ZeplinKit"]
),
)
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Snapp-Mobile/Fetcher", from: "0.0.2"),
.package(url: "https://github.com/marmelroy/Zip", from: "2.0.0")
.package(url: "https://github.com/Snapp-Mobile/Fetcher.git", from: "0.0.2"),
.package(url: "https://github.com/marmelroy/Zip", from: "2.0.0"),
.package(url: "https://github.com/Snapp-Mobile/SwiftFormatLintPlugin.git", from: "1.0.4"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "ZeplinKit",
dependencies: ["Fetcher", "Zip"],
path: "Sources",
resources: [
.process("Mocks")
]
],
plugins: [.plugin(name: "Lint", package: "SwiftFormatLintPlugin")],
),
.testTarget(
name: "ZeplinKitTests",
dependencies: ["ZeplinKit", "Fetcher"]
)
dependencies: ["ZeplinKit", "Fetcher"],
path: "Tests",
plugins: [.plugin(name: "Lint", package: "SwiftFormatLintPlugin")],
),
]
)
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
<div align="center">
<img src="Sources/ZeplinKit.docc/Resources/ZeplinKit-logo.png" width="200" alt="ZeplinKit Logo">
</div>

# ZeplinKit

Swift client library for the public Zeplin API

[![Swift Package Index](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FSnapp-Mobile%2FZeplinKit%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/Snapp-Mobile/ZeplinKit)
[![iOS 13.0+](https://img.shields.io/badge/iOS-13.0+-007AFF?logo=apple&logoColor=white)](https://www.apple.com/ios/)
[![Latest Release](https://img.shields.io/github/v/release/Snapp-Mobile/ZeplinKit?color=8B5CF6&logo=github&logoColor=white)](https://github.com/Snapp-Mobile/ZeplinKit/releases)
[![Tests](https://github.com/Snapp-Mobile/ZeplinKit/actions/workflows/test.yml/badge.svg)](https://github.com/Snapp-Mobile/ZeplinKit/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-22C55E)](LICENSE)

## Overview

ZeplinKit provides data models and preconfigured API endpoints for the [Zeplin API](https://docs.zeplin.dev/docs/getting-started-with-zeplin-api). It offers a flexible client that integrates with any workflow, supporting both Combine publishers and Swift Concurrency (iOS 13+/macOS 11+).

The library includes `Fetcher`, a lightweight network client, and `ZeplinAPIURL`, an enumeration of API endpoints that encapsulates the required parameters for each call.

### Installation

```swift
// Swift Package Manager
.package(url: "https://github.com/Snapp-Mobile/ZeplinKit.git", from: "0.1.0")
```

### Authentication

To use ZeplinKit, you'll need a Zeplin access token. Learn how to generate one in the [Zeplin API documentation](https://blog.zeplin.io/collaboration/getting-started-with-zeplin-javascript-sdk/).

### Setup

```swift
import ZeplinKit

let fetcher = Fetcher(
environment: .production,
accessToken: "your_zeplin_access_token"
)
```

### Usage

To fetch the first 10 projects for your account:

```swift
func loadProjects() async {
let url = ZeplinAPIURL.getProjects(10, 0)

do {
let projects: [ZeplinProject] = try await fetcher.fetch(url)
// Handle projects
} catch {
print("Failed to fetch projects: \(error.localizedDescription)")
}
}
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ZeplinAPIConfiguration.swift
//
//
//
// Created by Ilian Konchev on 24.03.20.
// Copyright © 2020 Ilian Konchev. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//
// Date+beforize.swift
//
//
//
// Created by Ilian Konchev on 28.01.21.
// Copyright © 2021 Ilian Konchev. All rights reserved.
//

import Foundation

public extension Date {
extension Date {

/// Formate the date using ``ZeplinKit/SharedFormatters/relativeDateFormatter``
/// - Returns: A string containing the formatted date
func beforized() -> String {
public func beforized() -> String {
return SharedFormatters.relativeDateFormatter.localizedString(for: self, relativeTo: Date())
}
}
Loading