Skip to content

Commit dfb2ee4

Browse files
authored
Implement network-layer package (#1)
Implement `network-layer` package
2 parents 8198ce2 + f4d9370 commit dfb2ee4

File tree

83 files changed

+4046
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4046
-89
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: "🐛 Bug Report"
3+
about: Report a reproducible bug or regression.
4+
title: 'Bug: '
5+
labels: 'bug'
6+
7+
---
8+
9+
<!--
10+
Please provide a clear and concise description of what the bug is. Include
11+
screenshots if needed. Please test using the latest version of the relevant
12+
React packages to make sure your issue has not already been fixed.
13+
-->
14+
15+
Application version:
16+
17+
## Steps To Reproduce
18+
19+
1.
20+
2.
21+
22+
<!--
23+
Your bug will get fixed much faster if we can run your code and it doesn't
24+
have dependencies other than React. Issues without reproduction steps or
25+
code examples may be immediately closed as not actionable.
26+
-->
27+
28+
Link to code example:
29+
30+
<!--
31+
Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
32+
repository on GitHub, or provide a minimal code example that reproduces the
33+
problem. You may provide a screenshot of the application if you think it is
34+
relevant to your bug report. Here are some tips for providing a minimal
35+
example: https://stackoverflow.com/help/mcve.
36+
-->
37+
38+
## The current behavior
39+
40+
41+
## The expected behavior
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: 🛠 Feature request
3+
about: If you have a feature request for the network-layer, file it here.
4+
labels: 'type: enhancement'
5+
---
6+
7+
**Feature description**
8+
Clearly and concisely describe the feature.
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Bug description
2+
Clearly and concisely describe the problem.
3+
4+
## Solution description
5+
Describe your code changes in detail for reviewers. Explain the technical solution you have provided and how it fixes the issue case.
6+
7+
## Covered unit test cases
8+
- [x] yes
9+
- [x] no
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Feature description
2+
Clearly and concisely describe the feature.
3+
4+
## Solution description
5+
Describe your code changes in detail for reviewers.
6+
7+
## Areas affected and ensured
8+
List out the areas affected by your code changes.
9+
10+
## Covered unit test cases
11+
- [x] yes
12+
- [x] no

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: network-layer
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
paths:
10+
- '.swiftlint.yml'
11+
- ".github/workflows/**"
12+
- "Package.swift"
13+
- "Source/**"
14+
- "Tests/**"
15+
jobs:
16+
SwiftLint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: GitHub Action for SwiftLint
21+
uses: norio-nomura/action-swiftlint@3.2.1
22+
with:
23+
args: --strict
24+
env:
25+
DIFF_BASE: ${{ github.base_ref }}
26+
Latest:
27+
name: Test Latest (iOS, macOS, tvOS, watchOS)
28+
runs-on: macOS-12
29+
env:
30+
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
31+
timeout-minutes: 10
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- destination: "OS=16.1,name=iPhone 14 Pro"
37+
name: "iOS"
38+
scheme: "NetworkLayer"
39+
sdk: iphonesimulator
40+
- destination: "OS=16.1,name=Apple TV"
41+
name: "tvOS"
42+
scheme: "NetworkLayer"
43+
sdk: appletvsimulator
44+
- destination: "OS=9.1,name=Apple Watch Series 8 (45mm)"
45+
name: "watchOS"
46+
scheme: "NetworkLayer"
47+
sdk: watchsimulator
48+
- destination: "platform=macOS"
49+
name: "macOS"
50+
scheme: "NetworkLayer"
51+
sdk: macosx
52+
steps:
53+
- uses: actions/checkout@v3
54+
- name: ${{ matrix.name }}
55+
run: xcodebuild test -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "./${{ matrix.sdk }}.xcresult"
56+
- name: Upload coverage reports to Codecov
57+
uses: codecov/codecov-action@v3.1.0
58+
with:
59+
token: ${{ secrets.CODECOV_TOKEN }}
60+
xcode: true
61+
xcode_archive_path: "./${{ matrix.sdk }}.xcresult"
62+

.github/workflows/danger.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Danger
2+
3+
on:
4+
pull_request:
5+
types: [synchronize, opened, reopened, labeled, unlabeled, edited]
6+
7+
env:
8+
LC_CTYPE: en_US.UTF-8
9+
LANG: en_US.UTF-8
10+
11+
jobs:
12+
run-danger:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: ruby setup
16+
uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: 2.7
19+
bundler-cache: true
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
- name: Setup gems
23+
run: |
24+
gem install bundler
25+
bundle install --clean --path vendor/bundle
26+
- name: danger
27+
env:
28+
29+
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
30+
31+
run: bundle exec danger --verbose

.gitignore

Lines changed: 7 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,9 @@
1-
# Xcode
2-
#
3-
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4-
5-
## User settings
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
65
xcuserdata/
7-
8-
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9-
*.xcscmblueprint
10-
*.xccheckout
11-
12-
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13-
build/
146
DerivedData/
15-
*.moved-aside
16-
*.pbxuser
17-
!default.pbxuser
18-
*.mode1v3
19-
!default.mode1v3
20-
*.mode2v3
21-
!default.mode2v3
22-
*.perspectivev3
23-
!default.perspectivev3
24-
25-
## Obj-C/Swift specific
26-
*.hmap
27-
28-
## App packaging
29-
*.ipa
30-
*.dSYM.zip
31-
*.dSYM
32-
33-
## Playgrounds
34-
timeline.xctimeline
35-
playground.xcworkspace
36-
37-
# Swift Package Manager
38-
#
39-
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40-
# Packages/
41-
# Package.pins
42-
# Package.resolved
43-
# *.xcodeproj
44-
#
45-
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
46-
# hence it is not needed unless you have added a package configuration file to your project
47-
# .swiftpm
48-
49-
.build/
50-
51-
# CocoaPods
52-
#
53-
# We recommend against adding the Pods directory to your .gitignore. However
54-
# you should judge for yourself, the pros and cons are mentioned at:
55-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
56-
#
57-
# Pods/
58-
#
59-
# Add this line if you want to avoid checking in source code from the Xcode workspace
60-
# *.xcworkspace
61-
62-
# Carthage
63-
#
64-
# Add this line if you want to avoid checking in source code from Carthage dependencies.
65-
# Carthage/Checkouts
66-
67-
Carthage/Build/
68-
69-
# Accio dependency management
70-
Dependencies/
71-
.accio/
72-
73-
# fastlane
74-
#
75-
# It is recommended to not store the screenshots in the git repo.
76-
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
77-
# For more information about the recommended setup visit:
78-
# https://docs.fastlane.tools/best-practices/source-control/#source-control
79-
80-
fastlane/report.xml
81-
fastlane/Preview.html
82-
fastlane/screenshots/**/*.png
83-
fastlane/test_output
84-
85-
# Code Injection
86-
#
87-
# After new code Injection tools there's a generated folder /iOSInjectionProject
88-
# https://github.com/johnno1962/injectionforxcode
89-
90-
iOSInjectionProject/
7+
.swiftpm/config/registries.json
8+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
9+
.netrc

.swiftformat

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Stream rules
2+
3+
--swiftversion 5.3
4+
5+
# Use 'swiftformat --options' to list all of the possible options
6+
7+
--header "\nnetwork-layer\nCopyright © {created.year} Space Code. All rights reserved.\n//"
8+
9+
--enable blankLinesBetweenScopes
10+
--enable blankLinesAtStartOfScope
11+
--enable blankLinesAtEndOfScope
12+
--enable blankLinesAroundMark
13+
--enable anyObjectProtocol
14+
--enable consecutiveBlankLines
15+
--enable consecutiveSpaces
16+
--enable duplicateImports
17+
--enable elseOnSameLine
18+
--enable emptyBraces
19+
--enable initCoderUnavailable
20+
--enable leadingDelimiters
21+
--enable numberFormatting
22+
--enable preferKeyPath
23+
--enable redundantBreak
24+
--enable redundantExtensionACL
25+
--enable redundantFileprivate
26+
--enable redundantGet
27+
--enable redundantInit
28+
--enable redundantLet
29+
--enable redundantLetError
30+
--enable redundantNilInit
31+
--enable redundantObjc
32+
--enable redundantParens
33+
--enable redundantPattern
34+
--enable redundantRawValues
35+
--enable redundantReturn
36+
--enable redundantSelf
37+
--enable redundantVoidReturnType
38+
--enable semicolons
39+
--enable sortImports
40+
--enable sortSwitchCases
41+
--enable spaceAroundBraces
42+
--enable spaceAroundBrackets
43+
--enable spaceAroundComments
44+
--enable spaceAroundGenerics
45+
--enable spaceAroundOperators
46+
--enable spaceInsideBraces
47+
--enable spaceInsideBrackets
48+
--enable spaceInsideComments
49+
--enable spaceInsideGenerics
50+
--enable spaceInsideParens
51+
--enable strongOutlets
52+
--enable strongifiedSelf
53+
--enable todos
54+
--enable trailingClosures
55+
--enable unusedArguments
56+
--enable void
57+
--enable markTypes
58+
--enable isEmpty
59+
60+
# format options
61+
62+
--wraparguments before-first
63+
--wrapcollections before-first
64+
--maxwidth 140

0 commit comments

Comments
 (0)