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
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to TOONEncoder
# Contributing to toon-swift

Thank you for your interest in contributing to the official Swift implementation of TOON!

Expand All @@ -9,7 +9,7 @@ This project uses Swift Package Manager for dependency management and build auto
```bash
# Clone the repository
git clone https://github.com/toon-format/toon-swift.git
cd TOONEncoder
cd toon-swift

# Build the project
swift build
Expand Down Expand Up @@ -63,6 +63,7 @@ This project requires Swift 6.0 and above.
- Maintain test coverage at **85%+ line coverage**
- Tests should cover edge cases and spec compliance
- Run the full test suite:

```bash
swift test

Expand Down
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import PackageDescription

let package = Package(
name: "TOONEncoder",
name: "ToonFormat",
platforms: [
.iOS("13.0"),
.macOS("10.15"),
Expand All @@ -15,19 +15,19 @@ let package = Package(
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "TOONEncoder",
targets: ["TOONEncoder"]
name: "ToonFormat",
targets: ["ToonFormat"]
)
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "TOONEncoder"
name: "ToonFormat"
),
.testTarget(
name: "TOONEncoderTests",
dependencies: ["TOONEncoder"]
name: "ToonFormatTests",
dependencies: ["ToonFormat"]
),
]
)
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TOONEncoder – TOON Format for Swift
# TOON Format for Swift

[![CI](https://github.com/toon-format/toon-swift/actions/workflows/ci.yml/badge.svg)](https://github.com/toon-format/toon-swift/actions)
[![Swift Version](https://img.shields.io/badge/swift-6.0+-orange.svg)](https://swift.org)
Expand All @@ -14,6 +14,7 @@ TOON saves tokens while remaining human-readable by
using indentation for structure and a tabular format for uniform data:

**JSON**:

```json
{
"users": [
Expand All @@ -24,6 +25,7 @@ using indentation for structure and a tabular format for uniform data:
```

**TOON**:

```
users[2]{id,name,role}:
1,Alice,admin
Expand Down Expand Up @@ -53,8 +55,8 @@ and implements the following features:

## Requirements

* Swift 6.0+ / Xcode 16+
* iOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / tvOS 13.0+ / visionOS 1.0+
- Swift 6.0+ / Xcode 16+
- iOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / tvOS 13.0+ / visionOS 1.0+

## Installation

Expand All @@ -73,7 +75,7 @@ dependencies: [
### Quick Start

```swift
import TOONEncoder
import ToonFormat

struct User: Codable {
let id: Int
Expand All @@ -95,6 +97,7 @@ print(String(data: data, encoding: .utf8)!)
```

Output:

```
id: 123
name: Ada
Expand Down Expand Up @@ -126,13 +129,15 @@ let data = try encoder.encode(["items": items])
```

Output with tab delimiter:

```
items[2 ]{sku name qty price}:
A1 Widget 2 9.99
B2 Gadget 1 14.5
```

Output with pipe delimiter:

```
items[2|]{sku|name|qty|price}:
A1|Widget|2|9.99
Expand All @@ -159,6 +164,7 @@ let output = try encoder.encode(data)
```

Output:

```
tags[#3]: reading,gaming,coding
items[#2]{sku,qty,price}:
Expand Down Expand Up @@ -187,6 +193,7 @@ let data = try encoder.encode(["items": items])
```

Output:

```
items[2]{sku,qty,price}:
A1,2,9.99
Expand All @@ -205,6 +212,7 @@ let data = try encoder.encode(["pairs": pairs])
```

Output:

```
pairs[2]:
- [2]: 1,2
Expand Down Expand Up @@ -238,6 +246,7 @@ let data = try encoder.encode(config)
```

Without key folding:

```
database:
connection:
Expand Down Expand Up @@ -320,6 +329,7 @@ print(TOONEncoder.specVersion) // "3.0"
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on how to get started, coding standards, and the process for submitting pull requests.

Before contributing, please review:

- [Code of Conduct](CODE_OF_CONDUCT.md)
- [TOON Specification](https://github.com/toon-format/spec/blob/main/SPEC.md)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Testing

@testable import TOONEncoder
@testable import ToonFormat

@Suite("TOONEncoder Tests")
struct TOONEncoderTests {
Expand Down