Skip to content

Commit ffcc020

Browse files
authored
Merge pull request #10 from tikhop/develop
feat: Get ready for v1.0.0
2 parents 936b3ab + baf0271 commit ffcc020

Some content is hidden

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

47 files changed

+5419
-432
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
<!--- Provide a general summary of the issue in the Title above -->
11+
12+
## Expected Behavior
13+
<!--- Tell us what should happen -->
14+
15+
## Current Behavior
16+
<!--- Tell us what happens instead of the expected behavior -->
17+
18+
## Possible Solution
19+
<!--- Not obligatory, but suggest a fix/reason for the bug -->
20+
21+
## Steps to Reproduce (for bugs)
22+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
23+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
24+
1.
25+
2.
26+
3.
27+
4.
28+
29+
## Context
30+
<!--- How has this issue affected you? What are you trying to accomplish? -->
31+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
32+
33+
## Your Environment
34+
<!--- Include as many relevant details about the environment you experienced the bug in -->
35+
* Version used:
36+
* Environment name and version (device, simalator):
37+
* Operating System and version (iOS, osx):
38+
* Link to your project:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
<!--- Provide a general summary of the feature request in the Title above -->
11+
12+
## Expected Behavior
13+
<!--- A clear and concise description of what you want to happen -->
14+
15+
## Current Behavior
16+
<!--- Explain the difference from current behavior -->
17+
18+
## Possible Solution
19+
<!--- Suggest ideas of how to implement the addition or change -->
20+
21+
## Alternatives Considered
22+
<!--- A clear and concise description of any alternative solutions or features you've considered -->
23+
24+
## Additional Context
25+
<!--- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
<!--- Pull request titles must use the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format -->
3+
4+
## Issue being fixed or feature implemented
5+
<!--- Why is this change required? What problem does it solve? -->
6+
<!--- If it fixes an open issue, please link to the issue here. -->
7+
8+
9+
## What was done?
10+
<!--- Describe your changes in detail -->
11+
12+
13+
## How Has This Been Tested?
14+
<!--- Please describe in detail how you tested your changes. -->
15+
<!--- Include details of your testing environment, and the tests you ran to -->
16+
<!--- see how your change affects other areas of the code, etc. -->
17+
18+
19+
## Breaking Changes
20+
<!--- Please describe any breaking changes your code introduces and verify that -->
21+
<!--- the title includes "!" following the conventional commit type (e.g. "feat!: ..."-->
22+
23+
24+
## Checklist:
25+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
26+
- [ ] I have performed a self-review of my own code
27+
- [ ] I have commented my code, particularly in hard-to-understand areas
28+
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
29+
- [ ] I have made corresponding changes to the documentation
30+

.github/workflows/ios-tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: iOS build and test
2+
3+
on:
4+
pull_request:
5+
branches: [ "master" ]
6+
7+
jobs:
8+
build:
9+
name: Build and Test default scheme using any available iPhone simulator
10+
runs-on: macos-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Set Default Scheme
16+
run: |
17+
scheme_list=$(xcodebuild -list -json | tr -d "\n")
18+
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
19+
echo $default | cat >default
20+
echo Using default scheme: $default
21+
- name: Build
22+
env:
23+
scheme: ${{ 'default' }}
24+
platform: ${{ 'iOS Simulator' }}
25+
run: |
26+
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
27+
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
28+
if [ $scheme = default ]; then scheme=$(cat default); fi
29+
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
30+
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
31+
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
32+
- name: Test
33+
env:
34+
scheme: ${{ 'default' }}
35+
platform: ${{ 'iOS Simulator' }}
36+
run: |
37+
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
38+
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
39+
if [ $scheme = default ]; then scheme=$(cat default); fi
40+
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
41+
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
42+
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,14 @@ fastlane/test_output
9090
iOSInjectionProject/
9191

9292
.DS_Store
93+
.swiftpm
9394
/.build
9495
/Packages
9596
/*.xcodeproj
9697
xcuserdata/
9798
DerivedData/
9899
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
100+
.idea
99101
/TODO
102+
CLAUDE.md
103+
.claude

.swiftformat

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# options
2+
--swiftversion 6.0
3+
--self remove # redundantSelf
4+
--importgrouping testable-bottom # sortedImports
5+
--commas inline # trailingCommas
6+
--trimwhitespace always # trailingSpace
7+
--indent 4 #indent
8+
--ifdef no-indent #indent
9+
--indentstrings true #indent
10+
11+
--wraparguments before-first # wrapArguments
12+
--wrapparameters before-first # wrapArguments
13+
--wrapcollections before-first # wrapArguments
14+
--wrapconditions after-first # wrapArguments
15+
--wrapreturntype preserve #wrapArguments
16+
--closingparen balanced # wrapArguments
17+
--wraptypealiases before-first # wrapArguments
18+
--funcattributes prev-line # wrapAttributes
19+
--typeattributes prev-line # wrapAttributes
20+
--wrapternary before-operators # wraprations
21+
--extensionacl on-declarations # extensionAccessControl
22+
--patternlet inline # hoistPatternLet
23+
--redundanttype inferred # redundantType
24+
--typeblanklines preserve # blankLinesAtStartOfScope, blankLinesAtEndOfScope
25+
--emptybraces spaced # emptyBraces
26+
--someAny disabled # opaqueGenericParameters
27+
28+
# We recommend a max width of 100 but _strictly enforce_ a max width of 130
29+
--maxwidth 180 # wrap
30+
31+
--stripunusedargs closure-only #unusedArguments
32+
33+
# rules
34+
--rules anyObjectProtocol
35+
--rules blankLinesBetweenScopes
36+
--rules consecutiveSpaces
37+
--rules duplicateImports
38+
--rules extensionAccessControl
39+
--rules hoistPatternLet
40+
--rules indent
41+
--rules markTypes
42+
--rules redundantParens
43+
--rules redundantReturn
44+
--rules redundantSelf
45+
--rules redundantType
46+
--rules redundantPattern
47+
--rules redundantGet
48+
--rules redundantFileprivate
49+
--rules redundantRawValues
50+
--rules sortedImports
51+
--rules sortDeclarations
52+
--rules strongifiedSelf
53+
--rules trailingCommas
54+
--rules trailingSpace
55+
--rules typeSugar
56+
--rules wrap
57+
--rules wrapArguments
58+
--rules wrapAttributes
59+
--rules braces
60+
--rules redundantClosure
61+
--rules redundantInit
62+
--rules redundantVoidReturnType
63+
--rules redundantOptionalBinding
64+
--rules unusedArguments
65+
--rules spaceInsideBrackets
66+
--rules spaceInsideBraces
67+
--rules spaceAroundBraces
68+
--rules spaceInsideParens
69+
--rules spaceAroundParens
70+
--rules enumNamespaces
71+
--rules blockComments
72+
--rules spaceAroundComments
73+
--rules spaceInsideComments
74+
--rules blankLinesAtStartOfScope
75+
--rules blankLinesAtEndOfScope
76+
--rules emptyBraces
77+
--rules opaqueGenericParameters
78+
--rules genericExtensions
79+
--rules trailingClosures
80+
81+
82+
--rules anyObjectProtocol
83+
--rules assertionFailures
84+
--rules blankLineAfterImports
85+
--rules isEmpty
86+
--rules leadingDelimiters
87+
--rules wrapEnumCases

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
CHANGELOG
22
=========
33

4-
Mercato 0.0.1
4+
Mercato 1.0.0
5+
---------
6+
7+
### Added
8+
* Subscription state monitoring for billing retry and grace period (addresses [#6](https://github.com/tikhop/Mercato/issues/6))
9+
- `isInBillingRetry(for:)` - Check if subscription is in billing retry state
10+
- `isInGracePeriod(for:)` - Check if subscription is in grace period
11+
- `renewalState(for:)` - Get current renewal state for a subscription
12+
- `subscriptionStatusUpdates` - Direct access to StoreKit 2's subscription status update stream
13+
- `allSubscriptionStatuses` - Stream of all subscription group statuses (iOS 17+)
14+
* Comprehensive product extension methods for subscription details (localizedPrice, localizedPeriod, hasTrial, priceInDay)
15+
* PurchaseOptionsBuilder for fluent configuration of purchase options
16+
* PromotionalOffer model for handling subscription offers
17+
* ProductService with better caching for product fetching
18+
* PriceFormatter and PeriodFormatter utilities for localized formatting
19+
* CurrencySymbolsLibrary for comprehensive currency symbol support
20+
* Example iOS application demonstrating usage
21+
* Detailed usage documentation in Documentation/Usage.md
22+
* Support for visionOS platform
23+
24+
### Updated
25+
* Migrated to Swift 6.0 tools version while maintaining Swift 5.10 compatibility
26+
* Reorganized code structure
27+
* Enhanced error handling with more specific MercatoError cases
28+
* Simplified purchase API with automatic option building
29+
* Enhanced README with comprehensive usage examples
30+
31+
Mercato 0.0.1-0.0.3
532
---------
633

734
* Listen for transaction updates. If your app has unfinished transactions, you receive them immediately after the app launches

0 commit comments

Comments
 (0)