Skip to content

Commit

Permalink
Rename package to Spinify
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Aug 3, 2023
1 parent 92b6938 commit d6be690
Show file tree
Hide file tree
Showing 37 changed files with 404 additions and 383 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
- name: 🚃 Cache pub modules
uses: actions/cache@v2
env:
cache-name: cache-centrifuge-package
cache-name: cache-spinify-package
with:
path: |
$PWD/.pub_cache/
key: ${{ runner.os }}-centrifuge-${{ env.cache-name }}-${{ hashFiles('**/pubspec.yaml') }}
key: ${{ runner.os }}-spinify-${{ env.cache-name }}-${{ hashFiles('**/pubspec.yaml') }}

- name: 🗄️ Export pub cache directory
run: export PUB_CACHE=$PWD/.pub_cache/
Expand Down
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Spinify: contribution guide

## How to regenerate protobuf files

Windows:

```ps1
$ choco install protoc
$ dart pub global activate protoc_plugin
$ dart pub get
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart run build_runner build --delete-conflicting-outputs
$ dart format -l 80 lib/src/model/pubspec.yaml.g.dart lib/src/model/protobuf/
```

Linux:

```bash
$ sudo apt update
$ sudo apt install -y protobuf-compiler dart
$ export PATH="$PATH":"$HOME/.pub-cache/bin"
$ dart pub global activate protoc_plugin
$ dart pub get
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart run build_runner build --delete-conflicting-outputs
$ dart format -l 80 lib/src/model/pubspec.yaml.g.dart lib/src/model/protobuf/
```

macOS:

```zsh
$ brew update
$ brew install protobuf dart
$ export PATH="$PATH":"$HOME/.pub-cache/bin"
$ dart pub global activate protoc_plugin
$ dart pub get
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart run build_runner build --delete-conflicting-outputs
$ dart format -l 80 lib/src/model/pubspec.yaml.g.dart lib/src/model/protobuf/
```
88 changes: 29 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Centrifuge Dart
# Spinify

[![Pub](https://img.shields.io/pub/v/spinify.svg)](https://pub.dev/packages/spinify)
[![Actions Status](https://github.com/PlugFox/spinify/actions/workflows/checkout.yml/badge.svg)](https://github.com/PlugFox/spinify/actions)
[![Coverage](https://codecov.io/gh/PlugFox/spinify/branch/master/graph/badge.svg)](https://codecov.io/gh/PlugFox/spinify)
[![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://opensource.org/licenses/MIT)
[![Linter](https://img.shields.io/badge/style-linter-40c4ff.svg)](https://pub.dev/packages/linter)
[![GitHub stars](https://img.shields.io/github/stars/plugfox/spinify?style=social)](https://github.com/plugfox/spinify/)

Websocket client for [Centrifugo server](https://github.com/centrifugal/centrifugo) and [Centrifuge library](https://github.com/centrifugal/centrifuge) based on [ws library](https://pub.dev/packages/ws).

Expand All @@ -8,46 +15,7 @@ Add the following dependency to your `pubspec.yaml` file:

```yaml
dependencies:
centrifuge_dart: <version>
```
## How to regenerate protobuf files
Windows:
```ps1
$ choco install protoc
$ dart pub global activate protoc_plugin
$ dart pub get
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart run build_runner build --delete-conflicting-outputs
$ dart format -l 80 lib/src/model/pubspec.yaml.g.dart lib/src/model/protobuf/
```

Linux:

```bash
$ sudo apt update
$ sudo apt install -y protobuf-compiler dart
$ export PATH="$PATH":"$HOME/.pub-cache/bin"
$ dart pub global activate protoc_plugin
$ dart pub get
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart run build_runner build --delete-conflicting-outputs
$ dart format -l 80 lib/src/model/pubspec.yaml.g.dart lib/src/model/protobuf/
```

macOS:

```zsh
$ brew update
$ brew install protobuf dart
$ export PATH="$PATH":"$HOME/.pub-cache/bin"
$ dart pub global activate protoc_plugin
$ dart pub get
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart run build_runner build --delete-conflicting-outputs
$ dart format -l 80 lib/src/model/pubspec.yaml.g.dart lib/src/model/protobuf/
spinify: <version>
```
## Features and Roadmap
Expand All @@ -58,32 +26,34 @@ Connection related features
- ✅ Setting client options
- ✅ Automatic reconnect with backoff algorithm
- ✅ Client state changes
- ❌ Command-reply
- ❌ Command timeouts
- ❌ Async pushes
- ❌ Ping-pong
- ❌ Connection token refresh
- ✅ Command-reply
- ✅ Command timeouts
- ✅ Async pushes
- ✅ Ping-pong
- ✅ Connection token refresh
- ✅ Server-side subscriptions
- ❌ Handle disconnect advice from the server
- ❌ Server-side subscriptions
- ❌ Batching API
- ❌ Bidirectional WebSocket emulation
### Client-side features
- Subscribe to a channel
- Setting subscription options
- Automatic resubscribe with backoff algorithm
- Subscription state changes
- Subscription command-reply
- Subscription async pushes
- Subscription token refresh
- Handle unsubscribe advice from the server
- Manage subscription registry
- Subscribe to a channel
- Setting subscription options
- Automatic resubscribe with backoff algorithm
- Subscription state changes
- Subscription command-reply
- Subscription async pushes
- Subscription token refresh
- Handle unsubscribe advice from the server
- Manage subscription registry
- ❌ Optimistic subscriptions
## Example
## More resources
- [Library documentation](https://pub.dev/documentation/centrifuge_dart/latest/)
- [Library documentation](https://pub.dev/documentation/spinify/latest/)
- [RFC 6455: The WebSocket Protocol](https://tools.ietf.org/html/rfc6455)
- [WebSocket API on MDN](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
- [Dart HTML WebSocket library](https://api.dart.dev/stable/dart-html/WebSocket-class.html)
Expand All @@ -96,11 +66,11 @@ Connection related features
## Coverage
[![](https://codecov.io/gh/PlugFox/centrifuge-dart/branch/master/graphs/sunburst.svg)](https://codecov.io/gh/PlugFox/centrifuge-dart/branch/master)
[![](https://codecov.io/gh/PlugFox/spinify/branch/master/graphs/sunburst.svg)](https://codecov.io/gh/PlugFox/spinify/branch/master)
## Changelog
Refer to the [Changelog](https://github.com/PlugFox/centrifuge-dart/blob/master/CHANGELOG.md) to get all release notes.
Refer to the [Changelog](https://github.com/PlugFox/spinify/blob/master/CHANGELOG.md) to get all release notes.
## Maintainers
Expand Down
6 changes: 3 additions & 3 deletions examples/console/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:async';
import 'dart:io' as io show exit, Platform;

import 'package:args/args.dart' show ArgParser;
import 'package:centrifuge_dart/centrifuge.dart';
import 'package:spinify/spinify.dart';

const url = 'ws://localhost:8000/connection/websocket?format=protobuf';

Expand All @@ -13,8 +13,8 @@ void main([List<String>? args]) {
runZonedGuarded<void>(
() async {
// Create centrifuge client.
final client = Centrifuge(
CentrifugeConfig(
final client = Spinify(
SpinifyConfig(
client: (
name: 'Centrifuge Console Example',
version: '0.0.1',
Expand Down
10 changes: 5 additions & 5 deletions examples/console/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: centrifuge_dart_example_console
name: spinify_example_console

description: >
Dart client to communicate with Centrifuge and Centrifugo from Flutter and VM
Expand All @@ -10,21 +10,21 @@ publish_to: 'none'

homepage: https://centrifugal.dev

repository: https://github.com/PlugFox/centrifuge-client
repository: https://github.com/PlugFox/spinify

issue_tracker: https://github.com/PlugFox/centrifuge-client/issues
issue_tracker: https://github.com/PlugFox/spinify/issues

funding:
- https://www.buymeacoffee.com/plugfox
- https://www.patreon.com/plugfox
- https://boosty.to/plugfox

topics:
- spinify
- centrifugo
- centrifuge
- websocket
- cross-platform
- client

platforms:
android:
Expand All @@ -42,7 +42,7 @@ environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
centrifuge_dart:
spinify:
path: ../../

args: ^2.4.2
14 changes: 0 additions & 14 deletions lib/centrifuge.dart

This file was deleted.

24 changes: 12 additions & 12 deletions lib/interface.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
library interface;

export 'package:centrifuge_dart/src/client/centrifuge_interface.dart';
export 'package:centrifuge_dart/src/client/config.dart';
export 'package:centrifuge_dart/src/client/state.dart';
export 'package:centrifuge_dart/src/client/states_stream.dart';
export 'package:centrifuge_dart/src/model/client_info.dart';
export 'package:centrifuge_dart/src/model/exception.dart';
export 'package:centrifuge_dart/src/model/jwt.dart';
export 'package:centrifuge_dart/src/model/publication.dart';
export 'package:centrifuge_dart/src/subscription/subscription.dart'
export 'package:spinify/src/client/centrifuge_interface.dart';
export 'package:spinify/src/client/config.dart';
export 'package:spinify/src/client/state.dart';
export 'package:spinify/src/client/states_stream.dart';
export 'package:spinify/src/model/client_info.dart';
export 'package:spinify/src/model/exception.dart';
export 'package:spinify/src/model/jwt.dart';
export 'package:spinify/src/model/publication.dart';
export 'package:spinify/src/subscription/subscription.dart'
show
ICentrifugeSubscription,
ISpinifySubscription,
CentrifugeClientSubscription,
CentrifugeServerSubscription;
export 'package:centrifuge_dart/src/subscription/subscription_config.dart';
export 'package:centrifuge_dart/src/subscription/subscription_state.dart';
export 'package:spinify/src/subscription/subscription_config.dart';
export 'package:spinify/src/subscription/subscription_state.dart';
14 changes: 14 additions & 0 deletions lib/spinify.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
library spinify;

export 'package:spinify/src/client/centrifuge.dart' show Spinify;
export 'package:spinify/src/client/config.dart';
export 'package:spinify/src/client/state.dart';
export 'package:spinify/src/client/states_stream.dart';
export 'package:spinify/src/model/client_info.dart';
export 'package:spinify/src/model/exception.dart';
export 'package:spinify/src/model/jwt.dart';
export 'package:spinify/src/model/publication.dart';
export 'package:spinify/src/subscription/subscription.dart'
show CentrifugeClientSubscription, CentrifugeServerSubscription;
export 'package:spinify/src/subscription/subscription_config.dart';
export 'package:spinify/src/subscription/subscription_state.dart';
Loading

0 comments on commit d6be690

Please sign in to comment.