Skip to content

Commit 63db911

Browse files
Initial commit
0 parents  commit 63db911

File tree

9 files changed

+202
-0
lines changed

9 files changed

+202
-0
lines changed

.github/workflows/api.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: API Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
API-Check:
10+
name: Diagnose API Breaking Changes
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
steps:
14+
- name: Checkout Source
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- name: Mark Workspace As Safe
19+
# https://github.com/actions/checkout/issues/766
20+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
21+
- name: Diagnose API Breaking Changes
22+
run: |
23+
swift package diagnose-api-breaking-changes origin/main --products WebPush

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test WebPush
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
Test-Release:
10+
name: "Test Release"
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
steps:
14+
- name: Checkout Source
15+
uses: actions/checkout@v3
16+
- name: Build
17+
run: |
18+
swift build --build-tests --configuration release -Xswiftc -enable-testing -Xswiftc -warnings-as-errors -Xcc -Werror
19+
- name: Run Tests
20+
run: |
21+
swift test --skip-build --configuration release
22+
23+
Test-Debug:
24+
name: "Test Debug"
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 10
27+
steps:
28+
- name: Checkout Source
29+
uses: actions/checkout@v3
30+
- name: Build
31+
run: |
32+
swift build --build-tests --configuration debug -Xswiftc -enable-testing -Xswiftc -warnings-as-errors -Xcc -Werror
33+
- name: Run Tests
34+
run: |
35+
swift test --skip-build --configuration debug

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc
9+
Package.resolved

.spi.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- documentation_targets: [WebPush]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Mochi Development, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Package.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// swift-tools-version: 6.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "swift-webpush",
8+
platforms: [
9+
.macOS(.v13),
10+
.iOS(.v15),
11+
.tvOS(.v15),
12+
.watchOS(.v8),
13+
],
14+
products: [
15+
.library(name: "WebPush", targets: ["WebPush"]),
16+
],
17+
dependencies: [
18+
],
19+
targets: [
20+
.target(
21+
name: "WebPush",
22+
dependencies: [
23+
]
24+
),
25+
.testTarget(name: "WebPushTests", dependencies: ["WebPush"]),
26+
]
27+
)

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# WebPush
2+
3+
<p align="center">
4+
<a href="https://swiftpackageindex.com/mochidev/WebPush">
5+
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FWebPush%2Fbadge%3Ftype%3Dswift-versions" />
6+
</a>
7+
<a href="https://swiftpackageindex.com/mochidev/WebPush">
8+
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FWebPush%2Fbadge%3Ftype%3Dplatforms" />
9+
</a>
10+
<a href="https://github.com/mochidev/WebPush/actions?query=workflow%3A%22Test+WebPush%22">
11+
<img src="https://github.com/mochidev/WebPush/workflows/Test%20WebPush/badge.svg" alt="Test Status" />
12+
</a>
13+
</p>
14+
15+
A server-side Swift implementation of the WebPush standard.
16+
17+
## Quick Links
18+
19+
- [Documentation](https://swiftpackageindex.com/mochidev/WebPush/documentation)
20+
- [Updates on Mastodon](https://mastodon.social/tags/SwiftWebPush)
21+
22+
## Installation
23+
24+
Add `WebPush` as a dependency in your `Package.swift` file to start using it. Then, add `import WebPush` to any file you wish to use the library in.
25+
26+
Please check the [releases](https://github.com/mochidev/WebPush/releases) for recommended versions.
27+
28+
```swift
29+
dependencies: [
30+
.package(
31+
url: "https://github.com/mochidev/WebPush.git",
32+
.upToNextMinor(from: "0.0.1")
33+
),
34+
],
35+
...
36+
targets: [
37+
.target(
38+
name: "MyPackage",
39+
dependencies: [
40+
"WebPush",
41+
]
42+
)
43+
]
44+
```
45+
46+
## Usage
47+
48+
TBD
49+
50+
## Contributing
51+
52+
Contribution is welcome! Please take a look at the issues already available, or start a new discussion to propose a new feature. Although guarantees can't be made regarding feature requests, PRs that fit within the goals of the project and that have been discussed beforehand are more than welcome!
53+
54+
Please make sure that all submissions have clean commit histories, are well documented, and thoroughly tested. **Please rebase your PR** before submission rather than merge in `main`. Linear histories are required, so merge commits in PRs will not be accepted.
55+
56+
## Support
57+
58+
To support this project, consider following [@dimitribouniol](https://mastodon.social/@dimitribouniol) on Mastodon, listening to Spencer and Dimitri on [Code Completion](https://mastodon.social/@codecompletion), or downloading Linh and Dimitri's apps:
59+
- [Not Phở](https://notpho.app/)
60+
- [Jiiiii](https://jiiiii.moe/)

Sources/WebPush/WebPushManager.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// WebPushManager.swift
3+
// swift-webpush
4+
//
5+
// Created by Dimitri Bouniol on 2024-12-03.
6+
// Copyright © 2024 Mochi Development, Inc. All rights reserved.
7+
//
8+

Tests/WebPushTests/WebPushTests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// WebPushTests.swift
3+
// swift-webpush
4+
//
5+
// Created by Dimitri Bouniol on 2024-12-03.
6+
// Copyright © 2024 Mochi Development, Inc. All rights reserved.
7+
//
8+
9+
10+
import Testing
11+
@testable import WebPush
12+
13+
@Test func example() async throws {
14+
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
15+
}

0 commit comments

Comments
 (0)