Commit graph

1322 commits

Author SHA1 Message Date
Ross Goldberg
bc961cf0d9
Add trash to Brewfile.
Partial #576

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-15 08:13:54 -04:00
Ross Goldberg
de13ad12f5
Merge pull request #575 from rgoldberg/574-app-id-value
`appIDValue` to encapsulate `uint64Value`.
2024-10-15 08:11:19 -04:00
Ross Goldberg
b0d0f4aacd
appIDValue to encapsulate uint64Value.
Resolve #574

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-15 08:06:14 -04:00
Ross Goldberg
8c5890f46d
Merge pull request #573 from rgoldberg/559-readme
Update `README.md`.
2024-10-15 07:59:47 -04:00
Ross Goldberg
20c08eb855
Update README.md.
Resolve #559

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-15 07:49:15 -04:00
Ross Goldberg
bf627ccd79
Merge pull request #572 from rgoldberg/561-itunes-search
Fix iTunes Search API issues
2024-10-14 16:55:07 -04:00
Ross Goldberg
a44655ac31
Refactor StoreSearch.lookup(…) & StoreSearch.search(…) to share implementation, which allows lookup to accept an Entity argument instead of being hardcoded to desktopSoftware.
Resolve #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:46:13 -04:00
Ross Goldberg
280b38dfe8
Add media=software query item to lookup URL to improve results.
Reorder query items for both lookup URLs & search URLs.

Partial #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:29:47 -04:00
Ross Goldberg
6c5a277ad9
Add & use Entity.desktopSoftware instead of macSoftware.
`desktopSoftware` returns info (including version & description) that aligns with what is displayed earlier in the App Store, while `macSoftware` is at least sometimes out of alignment.

Partial #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:24:39 -04:00
Ross Goldberg
6489daa0e3
Update iTunes Search API documentation URL.
Partial #561

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 16:12:39 -04:00
Ross Goldberg
ac3599d050
Merge pull request #571 from rgoldberg/555-testing
Improve tests
2024-10-14 05:14:51 -04:00
Ross Goldberg
265326dede
Add captureStream(…) to observe stdout & stderr in tests.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 05:05:45 -04:00
Ross Goldberg
dccac33abb
Improve tests.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 04:40:01 -04:00
Ross Goldberg
f8d7a36a4c
Upgrade test dependencies.
Quick upgrade necessary if we ever switch from PromiseKit to Swift concurrency.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 04:39:51 -04:00
Ross Goldberg
751e47bd26
Merge pull request #570 from rgoldberg/478-app-id
Fix app IDs
2024-10-14 04:16:33 -04:00
Ross Goldberg
006273bb81
Standardize names of variables & parameters relating to AppIDs.
Resolve #478

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 04:10:39 -04:00
Ross Goldberg
39f77c01a9
Create typealias AppID = UInt64.
Use `AppID` everywhere appropriate.

Associated appID cleanup.

Partial #478

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 04:10:38 -04:00
Ross Goldberg
43505db37f
Merge pull request #554 from rgoldberg/542-swift-argument-parser
Use Swift Argument Parser instead of Commandant.
2024-10-14 04:06:33 -04:00
Ross Goldberg
0efd73a5ee
Simplify Outdated.run(…).
Resolve #542

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:12 -04:00
Ross Goldberg
cd42176859
Rename apps property of Upgrade as appIds.
Resolve #542

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:12 -04:00
Ross Goldberg
388d963cd1
Do not return Result (or anything else) from command run(…) functions.
Throw when failure. Normal Void return when success.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:12 -04:00
Ross Goldberg
3b86deb63e
Rename 2 test files that weren't renamed in previous commit to preserve history.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:11 -04:00
Ross Goldberg
2535e3da42
Use Swift Argument Parser instead of Commandant.
Command structs are nested types of Mas.

Renamed structs.

Limit code visibility as much as possible.

Standardize variable names.

Standardize spacing.

Fix a few tests.

Disable a useless test.

Remove unnecessary test stdout output.

Get swift-format from Brewfile instead of from Package.swift
since swift-format depends on an old version of swift-argument-parser.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:11 -04:00
Ross Goldberg
6793a91e03
Remove unnecessary explicit inits.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:10 -04:00
Ross Goldberg
d413d8cfa1
Move MasKit module to mas.
Move MasKitTests module to masTests.

Rename MasKit enum as Mas.

Upgrade swift-tools-version from 5.3 to 5.6.1.

swift-tools-version 5.5+ is necessary to allow test code to import executable target code,
to allow MasKit library code to be moved into the mas executable.

Upgrade to swift-tools-version to 5.6.1 instead of to 5.5 because they support all the same macOS versions.

Standardize comments.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-14 03:44:03 -04:00
Ross Goldberg
611d4a7fb7
Merge pull request #563 from rgoldberg/562-apple-id
Improve `Account`, `SignIn`, `SignOut` & `ISStoreAccount` extension & associated code:
2024-10-13 22:26:44 -04:00
Ross Goldberg
a24bcdd1e9
Merge branch 'main' into 562-apple-id 2024-10-13 22:23:37 -04:00
Ross Goldberg
1bebde9e4a
Merge pull request #550 from rgoldberg/536-output-responses-unparsable-as-json
Output to stderr responses from Apple endpoints that are unparsable as JSON
2024-10-13 22:20:51 -04:00
Ross Goldberg
fe7b688f3b
Merge pull request #549 from rgoldberg/538-fix-typos
Fix typos in comments & in documentation.
2024-10-13 22:18:28 -04:00
Ross Goldberg
7c81b4803c
Merge pull request #551 from rgoldberg/540-outdated-multi-platform-minimum-macos
`outdated` checks if new app version requires newer macOS for all kinds of apps, not just mac-software
2024-10-13 22:17:14 -04:00
Ross Goldberg
f37e4fca85
Merge pull request #556 from rgoldberg/289-re-enable-purchase
Re-enable `purchase`.
2024-10-13 22:16:29 -04:00
Ross Goldberg
953613bd04
Merge pull request #552 from rgoldberg/544-gitignore
Git ignore JetBrains IntelliJ IDEA config directory.
2024-10-13 22:06:34 -04:00
Ross Goldberg
a6f03afa67
Merge pull request #553 from rgoldberg/545-scripts
Improve scripts: bootstrap, build, format, lint, test & version.
2024-10-13 22:05:42 -04:00
Ross Goldberg
fe749fc2eb
Handle CKPurchaseController.shared().perform(…) callback within SSPurchase.perform(adamId:purchase:) to encapsulate CKPurchaseController & its callback.
Chain `Promise`s instead of calling `Promise.wait()`.

Improve comments.

Resolve #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 02:15:07 -04:00
Ross Goldberg
a45308f2f2
Configure SSPurchase in `perform(…) instead of in a convenience init.
Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 02:01:26 -04:00
Ross Goldberg
c01f7c541e
Migrate ISStoreAccount from Grand Central Dispatch to PromiseKit.
Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 02:01:25 -04:00
Ross Goldberg
aceb4c3ddb
Remove unnecessary output when nothing downloaded by download(…).
Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 01:59:18 -04:00
Ross Goldberg
943638fef4
Improve ISStoreAccount.signIn(…).
Output error for non-`nil` `ISStoreAccount.primaryAccount` only if `ISStoreAccount.primaryAccount.isSignedIn` is `true`.

Output error when no password provided to password prompt for `mas signin`.

Remove unnecessary blank lines in `MASError.swift`.

Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 01:59:18 -04:00
Ross Goldberg
a5c8957fc9
Refactor Downloader & SSPurchase to no longer need StoreAccount.
Move towards better purchase encapsulation: all purchase logic will eventually be in the `perform(…)` function, not in convenience constructor, to ensure the correct values are used when `perform(…)` is called, instead of values that were correct sometime before the call.

Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 01:59:14 -04:00
Ross Goldberg
d2f2d3edff
ISStoreAccount static functions return ISStoreAccount instead of StoreAccount.
Add `var dsID` to `StoreAccount` so functions can use `StoreAccount` without casting to `ISStoreAccount`.

Simplify code.

Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 01:57:45 -04:00
Ross Goldberg
8e671f2624
Improve Account, SignIn, SignOut & ISStoreAccount extension & associated code.
Prevent `ISAccountService.signIn(with:)` deprecation warning.

Improve macOS version handling encapsulation.

Output error if `StoreAccount.signin(…)` provides a `nil` `ISStoreAccount`.

Improve `signin` `"Already Signed In" error output.

Remove unnecessary output.

Simplify code.

Partial #562

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-11 01:56:50 -04:00
Ross Goldberg
d6087ce288
Update README.md.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-08 23:34:14 -04:00
Ross Goldberg
5676dcb797
Re-enable purchase.
`purchase` seems to work on macOS 12+.

Resolve #289

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-06 03:13:10 -04:00
Ross Goldberg
466ea67194
Improve scripts: bootstrap, build, format, lint, test & version.
Allow them to be run from any directory.

Call version from lint & test to create Package.swift with version info.

Fail when accessing unset variables.

Improve variable names.

Fix lint issues.

Improve lint & format scripts.

Don't require user input to continue linting.

Much cleaner lint output.

Reorder lint output.

Get swift-format from Brewfile instead of from Package.swift:

 - Speeds up linting.
 - Properly models dependency (not a code dependency).
 - swift-format depends on an old version of swift-argument-parser. Will refactor to use SAP soon.

Include some improvements from 1.8.7 PR.

Other scripts need improvement, too.

Resolve #545

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 20:33:45 -04:00
Ross Goldberg
b400422f4a
outdated checks if new app version requires newer macOS for all kinds of apps, not just mac-software.
Resolve #540

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 20:28:49 -04:00
Ross Goldberg
7e9e3ba168
Output to stderr responses from Apple endpoints that are unparsable as JSON
Resolves #536

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 19:50:52 -04:00
Ross Goldberg
d9780b8768
Fix incorrect function comment
Resolves #538

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 19:43:15 -04:00
Ross Goldberg
47f4b5c0da
Fix typos in comments
Resolves #538

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 19:43:15 -04:00
Ross Goldberg
7132e7eed9
Fix typos in documentation
Partial #538

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 19:43:15 -04:00
Ross Goldberg
5c11f9afb7
Git ignore JetBrains IntelliJ IDEA config directory.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-10-05 19:36:45 -04:00