Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Report a problem with StompClientLib
title: "[Bug] "
labels: bug
assignees: ''
---

## Describe the bug

A clear and concise description of what the bug is.

## To reproduce

Steps (or a minimal code snippet) that triggers the issue.

```swift
// your setup
```

## Expected behaviour

What you expected to happen.

## Environment

- StompClientLib version:
- Installation: CocoaPods / Carthage
- iOS deployment target:
- Xcode / Swift version:
- STOMP broker (e.g. Spring Boot, ActiveMQ, RabbitMQ):
- `ws://` or `wss://`, and whether `certificateCheckEnabled` is on/off:

## Logs

Set `StompClientLib.isLoggingEnabled = true` and paste any relevant console output.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question / usage help
url: https://github.com/kuraydev/StompClientLib/discussions
about: Ask questions about using StompClientLib here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for StompClientLib
title: "[Feature] "
labels: enhancement
assignees: ''
---

## Is your feature request related to a problem?

A clear and concise description of the problem.

## Describe the solution you'd like

What you want to happen.

## Describe alternatives you've considered

Any alternative solutions or features you've considered.

## Additional context

Add any other context or references here.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Description

<!-- What does this PR change and why? -->

## Type of change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that changes the public API or default behaviour)
- [ ] Documentation / tooling

## Checklist

- [ ] Public API (type names, delegate signatures, public methods, default values) is unchanged, **or** the breaking change is documented and a major version bump is recommended.
- [ ] Objective-C run-time compatibility is preserved.
- [ ] Tests added/updated and passing (`xcodebuild test`).
- [ ] `swiftlint lint --strict` passes.
- [ ] `pod lib lint StompClientLib.podspec --allow-warnings` passes.
- [ ] `CHANGELOG.md` updated under `## [Unreleased]`.

## Related issues

<!-- e.g. Closes #128 -->
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
swiftlint:
name: SwiftLint
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install SwiftLint
run: brew install swiftlint
- name: Run SwiftLint
run: swiftlint lint --strict --reporter github-actions-logging

podspec-lint:
name: pod lib lint
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Lint podspec
run: pod lib lint StompClientLib.podspec --allow-warnings

test:
name: Build & Test (example)
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install pods
working-directory: StompClientLibExample
run: pod install --repo-update
- name: Select an available iOS simulator
id: sim
run: |
UDID=$(xcrun simctl list devices available | grep -m1 -E "iPhone" | grep -oE "[0-9A-Fa-f-]{36}")
if [ -z "$UDID" ]; then echo "No iOS simulator available"; xcrun simctl list devices; exit 1; fi
echo "Using simulator $UDID"
echo "udid=$UDID" >> "$GITHUB_OUTPUT"
- name: Build & test
working-directory: StompClientLibExample
run: |
set -o pipefail
xcodebuild test \
-workspace StompClientLibExample.xcworkspace \
-scheme StompClientLibExample \
-sdk iphonesimulator \
-destination "id=${{ steps.sim.outputs.udid }}" \
-configuration Debug \
CODE_SIGNING_ALLOWED=NO
49 changes: 49 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SwiftLint configuration for StompClientLib
# https://github.com/realm/SwiftLint

included:
- StompClientLib/Classes

excluded:
- StompClientLibExample/Pods
- StompClientLibExample/StompClientLib.swift # stray duplicate of the library source

# The public Obj-C-bridged API intentionally uses Cocoa-style names
# (e.g. AutoMode, ClientMode) that predate Swift naming guidelines and
# cannot be renamed without breaking the published contract.
disabled_rules:
- identifier_name
- type_name
- todo

opt_in_rules:
- empty_count
- closure_spacing
- redundant_nil_coalescing

line_length:
warning: 200
error: 300
ignores_comments: true

file_length:
warning: 600
error: 1000

function_body_length:
warning: 80
error: 150

type_body_length:
warning: 500
error: 700

# StompFrame.decode returns a labelled (command, headers, body) tuple.
large_tuple:
warning: 3
error: 4

# receiveFrame is a flat dispatch over STOMP frame commands.
cyclomatic_complexity:
warning: 15
error: 25
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Public `StompFrame` helpers (`encode`, `decode`, `ackHeaderValue`) — the pure,
transport-agnostic STOMP wire-format core that backs the client and is now unit
tested independently of a live WebSocket.
- `StompClientLib.isLoggingEnabled` toggle (default `false`) so the library no
longer prints diagnostics to consumer consoles unless opted in.
- Real XCTest suite covering frame encode/decode (including the `:`-in-header-value
case), ack-mode mapping, and client defaults.
- GitHub Actions CI (SwiftLint, `pod lib lint`, and `xcodebuild test` of the
example) replacing the dead Travis configuration.
- SwiftLint configuration (`.swiftlint.yml`).
- `CONTRIBUTING.md`, issue templates, and a pull-request template.

### Changed

- The pod now ships `PrivacyInfo.xcprivacy` via `resource_bundles` (previously the
manifest was committed but never packaged because it sat outside `source_files`).
- Podspec `homepage`/`source` repointed to `github.com/kuraydev/StompClientLib`;
Swift version pinned to 5.0; `SocketRocket` dependency pinned to `~> 0.5`.
- `protocol StompClientLibDelegate` now refines `AnyObject` instead of the
deprecated `class` keyword.
- Reconnect now honours the `exponentialBackoff` parameter (previously ignored):
with the default `true`, the interval grows geometrically (capped at 60s) and
resets on reconnect. Pass `exponentialBackoff: false` for the legacy fixed
interval.
- Console `print` diagnostics replaced by a gated logger (off by default).

### Fixed

- `serverDidSendError` now reports a real `detailedErrorMessage` on transport
failures; it previously always passed `nil` (`error as? String` never succeeds).
- `connection` is now reset to `false` when the socket fails or the server closes
it, so `isConnected()` is accurate and auto-reconnect actually fires
(issues #123, #125).

### Breaking (recommend a major version, e.g. 2.0.0)

- Minimum deployment target raised from iOS 9.0 to iOS 12.0.

---

## Historical releases

The entries below were auto-generated against the original `WrathChaos/StompClientLib`
repository and are retained for reference.

[Full Changelog](https://github.com/WrathChaos/StompClientLib/compare/1.3.8...HEAD)

**Implemented enhancements:**
Expand Down
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing to StompClientLib

Thanks for taking the time to contribute! This document explains how to set up
the project, the conventions we follow, and how to get a change merged.

## Getting started

```bash
git clone https://github.com/kuraydev/StompClientLib.git
cd StompClientLib/StompClientLibExample
pod install
open StompClientLibExample.xcworkspace
```

The library source lives in `StompClientLib/Classes/`. The wire-format core
(`StompFrame.swift`) is pure Foundation and is unit tested in
`StompClientLibExample/StompClientLibExampleTests/`.

## Running the checks locally

The same checks run in CI (`.github/workflows/ci.yml`):

```bash
# Lint
swiftlint lint --strict

# Validate the podspec
pod lib lint StompClientLib.podspec --allow-warnings

# Build & test the example app
cd StompClientLibExample
xcodebuild test \
-workspace StompClientLibExample.xcworkspace \
-scheme StompClientLibExample \
-destination 'platform=iOS Simulator,name=iPhone 16'
```

## Pull request guidelines

- Branch off `master` and open the PR against `master`.
- Keep the **public API stable.** Exported type names, the `StompClientLibDelegate`
method signatures, public method names, and their default values are a contract
for existing CocoaPods consumers. Any source-breaking change must be called out
explicitly and warrants a major version bump.
- Preserve **Objective-C run-time compatibility** (`@objc` / `@objcMembers`) — it
is an advertised feature.
- Use [Conventional Commits](https://www.conventionalcommits.org/) for commit
messages (e.g. `fix:`, `feat:`, `docs:`, `chore:`).
- Add or update tests for any behavioural change.
- Update `CHANGELOG.md` under `## [Unreleased]`.

## Reporting bugs

Open an issue using the bug-report template and include the STOMP broker you are
connecting to (e.g. Spring Boot), the deployment target, and a minimal repro.
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) 2017 wrathchaos <wrathchaos@hotmail.com>
MIT License

Copyright (c) 2017-2026 Kuray Ogun (FreakyCoder) <kurayogun@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading