From 6e86a57e6f99705b209fe7d2530fd7bd320e27cc Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 29 Mar 2022 17:34:31 +0800 Subject: [PATCH] chore: add bug report template and contributing document --- .github/ISSUE_TEMPLATE/bug.yaml | 62 ++++++++++++++ .github/ISSUE_TEMPLATE/issue.md | 32 ------- Documentation/CONTRIBUTING.md | 30 +++++++ Documentation/Setup.md | 83 +++++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 18 ++++ Podfile.lock | 2 +- 6 files changed, 194 insertions(+), 33 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yaml delete mode 100644 .github/ISSUE_TEMPLATE/issue.md create mode 100644 Documentation/CONTRIBUTING.md create mode 100644 Documentation/Setup.md diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml new file mode 100644 index 00000000..c4a1f491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -0,0 +1,62 @@ +name: 🐞 Bug +description: File a bug/issue +title: "[BUG] " +labels: [Bug, Needs Triage] +body: +- type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true +- type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: false +- type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: false +- type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Tap '...' + 4. See error... + validations: + required: false +- type: textarea + attributes: + label: Environment + description: | + You can check the version and build number in the bottom of in-app settings. + examples: + - **Device**: iPhone X + - **OS**: iOS 15.3 + - **Version**: v1.3.0 + - **Build**: 103 + value: | + - Device: + - OS: + - Version: + - Build: + render: markdown + validations: + required: false +- type: textarea + attributes: + label: Anything else? + description: | + The server domain? Post links? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or video or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/ISSUE_TEMPLATE/issue.md deleted file mode 100644 index cc2855ed..00000000 --- a/.github/ISSUE_TEMPLATE/issue.md +++ /dev/null @@ -1,32 +0,0 @@ -## Description -<!--Brief description for bug--> - - -## App version -> You can check the version and build number in app setting footer. - -<!--Version Code here--> -- Version: v0.0.0 -- Build: 0 - -## Detail - -### Steps to reproduce - -<!--How to reproduce this bug?--> - -1. Tap … -2. … - -### Actual Behavior - -<!--What happened?--> - -The app … - -### Expected behavior - -<!--What is the expected behavior--> - -The app … - diff --git a/Documentation/CONTRIBUTING.md b/Documentation/CONTRIBUTING.md new file mode 100644 index 00000000..cc018445 --- /dev/null +++ b/Documentation/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing + +- File the issue for bug report and feature request +- Translate the project in our [Crowdin](https://crowdin.com/project/mastodon-for-ios) project +- Make the Pull Request to contribute + +## Bug Report +File the issue about the bug. Make sure you are installing the latest version app from TestFlight or App Store. + +## Translation +[![Crowdin](https://badges.crowdin.net/mastodon-for-ios/localized.svg)](https://crowdin.com/project/mastodon-for-ios) + +The translation will update regularly. Please request language if not listed via issue. + +## Pull Request + +You can make a pull request directly with small block code changes for bugfix or feature implementations. Before making a pull request with hundred lines of changes to this repository, please first discuss the change you wish to make via issue. + +Also, there are lots of existing feature request issues that could be a good-first-issue discussing place. + +Follow the git-flow pattern to make your pull request. + +1. Ensure you are checkout on the `develop` branch. +2. Write your codes and test them on **iPad and iPhone**. +3. Merge the `develop` into your branch then make a Pull Request. Please merge the branch and resolve any conflicts when the `develop` updates. **Do not force push your codes.** +4. Make sure the permission for your folk is open to the reviewer. Code style fix, conflict resolution, and other changes may be committed by the reviewer directly. +5. Request a code review and wait for approval. The PR will be merged when it is approved. + +## Documentation +The documents for this app is list under the [Documentation](../Documentation/) folder. We are also welcome contributions for documentation. \ No newline at end of file diff --git a/Documentation/Setup.md b/Documentation/Setup.md new file mode 100644 index 00000000..ede9d486 --- /dev/null +++ b/Documentation/Setup.md @@ -0,0 +1,83 @@ +# Setup + +## Requirements + +- Xcode 13+ +- Swift 5.5+ +- iOS 14.0+ + + +Intell the latest version of Xcode from the App Store or Apple Developer Download website. Also, we assert you have the [Homebrew](https://brew.sh) package manager. + +This guide may not suit your machine and actually setup procedure may change in the future. Please file the issue or Pull Request if there are any problems. + +## CocoaPods +The app use [CocoaPods]() and [CocoaPods-Keys](https://github.com/orta/cocoapods-keys). The M1 Mac needs virtual ruby env to workaround compatibility issues. + +#### Intel Mac + +```zsh +sudo gem install cocoapods cocoapods-keys +``` + +#### M1 Mac + +```zsh +# install the rbenv +brew install rbenv +which ruby +# > /usr/bin/ruby +echo 'eval "$(rbenv init -)"' >> ~/.zprofile +source ~/.zprofile +which ruby +# > /Users/mainasuk/.rbenv/shims/ruby + +# select ruby +rbenv install --list +# here we use the latest 3.0.x version +rbenv install 3.0.3 +rbenv global 3.0.3 +ruby --version +# > ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [arm64-darwin21] + +sudo gem install cocoapods cocoapods-keys +``` + +## Bootstrap + +```zsh +# make a clean build +sudo gem install cocoapods-clean +pod clean + +# make install +pod install --repo-update + +# open workspace +open Mastodon.xcworkspace +``` + +The CocoaPods-Key plugin will request the push notification endpoint. You can fufill the empty string and set it later. To setup the push notification. Please check section `Push Notification` below. + +The app requires the `App Group` capability. To make sure it works for your developer membership. Please check [AppSecret.swift](../AppShared/AppSecret.swift) file and set another unique `groupID` and update `App Group` settings. + +#### Push Notification (Optional) +The app is compatible with [toot-relay](https://github.com/DagAgren/toot-relay) APNs. You can set your push notification endpoint via Cocoapod-Keys. There are two endpoints: +- notification_endpoint: for `RELEASE` usage +- notification_endpoint_debug: for `DEBUG` usage + +Please check the [Establishing a Certificate-Based Connection to APNs +](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns) document to generate the certificate and exports the p12 file. + +Note: +Please check and set the `notification.Topic` to the app BundleID in [toot-relay.go](https://github.com/DagAgren/toot-relay/blob/f9d6894040509881fee845972cd38ec6cd8f5a11/toot-relay.go#L112). The server needs use a reverse proxy to port this relay on 443 port with valid domain and HTTPS certificate. + +## Start +1. Open `Mastodon.xcworkspace` +2. Wait for the Swift Package Dependencies resolved. +2. Check the signing settings make sure to choose a team. [More info…](https://help.apple.com/xcode/mac/current/#/dev23aab79b4) +3. Select `Mastodon` scheme and device then run it. (Command + R) + +## What's next + +We welcome contributions! And if you have an interest to contribute codes. Here is a document that describes the app architecture and what's tech stack it uses. \ No newline at end of file diff --git a/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved index a1034488..11d45388 100644 --- a/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -55,6 +55,15 @@ "version": "1.2.0" } }, + { + "package": "FLAnimatedImage", + "repositoryURL": "https://github.com/Flipboard/FLAnimatedImage.git", + "state": { + "branch": null, + "revision": "e7f9fd4681ae41bf6f3056db08af4f401d61da52", + "version": "1.0.16" + } + }, { "package": "FPSIndicator", "repositoryURL": "https://github.com/MainasuK/FPSIndicator.git", @@ -207,6 +216,15 @@ "revision": "d0470491f56e734731bbf77991944c0dfdee3e0e", "version": "2.6.1" } + }, + { + "package": "UITextView+Placeholder", + "repositoryURL": "https://github.com/MainasuK/UITextView-Placeholder.git", + "state": { + "branch": null, + "revision": "20f513ded04a040cdf5467f0891849b1763ede3b", + "version": "1.4.1" + } } ] }, diff --git a/Podfile.lock b/Podfile.lock index 336caf88..f8dde693 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -42,4 +42,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: c471d1f9c923dc63bf8684415c79b85adb2ac36b -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3