Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from sindresorhus:main #41

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
xcuserdata
project.xcworkspace
xcuserdata/
/gifski-api/tests/
17 changes: 16 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ only_rules:
- explicit_init
- fallthrough
- fatal_error_message
- final_test_case
- first_where
- flatmap_over_map_reduce
- for_where
Expand All @@ -72,6 +73,8 @@ only_rules:
- lower_acl_than_parent
- mark
- modifier_order
- multiline_arguments
- multiline_arguments_brackets
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
Expand All @@ -80,15 +83,16 @@ only_rules:
- no_extension_access_modifier
- no_fallthrough_only
- no_space_in_method_call
- non_optional_string_data_conversion
- non_overridable_class_declaration
- notification_center_detachment
- ns_number_init_as_function_reference
- nsobject_prefer_isequal
- number_separator
- opening_brace
- operator_usage_whitespace
- operator_whitespace
- overridden_super_call
- prefer_key_path
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
Expand Down Expand Up @@ -119,6 +123,7 @@ only_rules:
- sorted_first_last
- statement_position
- static_operator
- static_over_final_class
- strong_iboutlet
- superfluous_disable_command
- superfluous_else
Expand Down Expand Up @@ -184,6 +189,10 @@ identifier_name:
- 'y1'
- 'y2'
- 'z2'
redundant_type_annotation:
consider_default_literal_types_redundant: true
unneeded_override:
affect_initializers: true
deployment_target:
macOS_deployment_target: '14'
custom_rules:
Expand Down Expand Up @@ -212,6 +221,12 @@ custom_rules:
swiftui_environment_private:
regex: '@Environment\(\\\.\w+\)\s+var'
message: 'SwiftUI @Environment properties should be private'
swiftui_scaledtofit:
regex: 'aspectRatio\(contentMode: \.fit\)'
message: 'Prefer `scaledToFit()`'
swiftui_scaledtofill:
regex: 'aspectRatio\(contentMode: \.fill\)'
message: 'Prefer `scaledToFill()`'
final_class:
regex: '^class [a-zA-Z\d]+[^{]+\{'
message: 'Classes should be marked as final whenever possible. If you actually need it to be subclassable, just add `// swiftlint:disable:next final_class`.'
Expand Down
4 changes: 2 additions & 2 deletions Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MARKETING_VERSION = 2.23.0
CURRENT_PROJECT_VERSION = 72
MARKETING_VERSION = 2.23.1
CURRENT_PROJECT_VERSION = 73
57 changes: 43 additions & 14 deletions Gifski.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
archiveVersion = 1;
classes = {
};
objectVersion = 60;
objectVersion = 77;
objects = {

/* Begin PBXBuildFile section */
0E7925202329BDBE00058B94 /* ShareController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E79251F2329BDBE00058B94 /* ShareController.swift */; };
0E7925282329BDBE00058B94 /* Share Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 0E79251B2329BDBE00058B94 /* Share Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
5FF0DFFB278BA5DB00A80F09 /* libgifski_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F6ABD84278BA5A20040DDF0 /* libgifski_static.a */; };
8548806522B78E8300E97401 /* IntTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8548806422B78E8300E97401 /* IntTextField.swift */; };
858380EA22BFD38C0086BC98 /* ExtendedAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 858380E922BFD38B0086BC98 /* ExtendedAttributes.swift */; };
8588EB0D22A424B800030A59 /* ResizableDimensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8588EB0C22A424B800030A59 /* ResizableDimensions.swift */; };
85A5C44822CA41B500CAA94D /* VideoValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85A5C44722CA41B500CAA94D /* VideoValidator.swift */; };
85BF910922F3279300AD3FF6 /* TrimmingAVPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85BF910822F3279300AD3FF6 /* TrimmingAVPlayer.swift */; };
Expand All @@ -25,6 +24,7 @@
E33552F12ACAC3280023AAE9 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = E33552F02ACAC3280023AAE9 /* AppState.swift */; };
E33552F32ACAC5D80023AAE9 /* StartScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E33552F22ACAC5D80023AAE9 /* StartScreen.swift */; };
E339F011203820ED003B78FB /* GIFGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E339F010203820ED003B78FB /* GIFGenerator.swift */; };
E36BD7A52B9E2C2400B8D86C /* ExtendedAttributes in Frameworks */ = {isa = PBXBuildFile; productRef = E36BD7A42B9E2C2400B8D86C /* ExtendedAttributes */; };
E37F68E02ACAD9D1007F1A7F /* CompletedScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E37F68DF2ACAD9D1007F1A7F /* CompletedScreen.swift */; };
E37F68E22ACAD9F1007F1A7F /* ConversionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E37F68E12ACAD9F1007F1A7F /* ConversionScreen.swift */; };
E37F68E42ACADA40007F1A7F /* EditScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E37F68E32ACADA40007F1A7F /* EditScreen.swift */; };
Expand Down Expand Up @@ -86,7 +86,6 @@
0E7925252329BDBE00058B94 /* Share_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Share_Extension.entitlements; sourceTree = "<group>"; };
5F6ABD7D278BA5A20040DDF0 /* gifski.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = gifski.xcodeproj; path = "gifski-api/gifski.xcodeproj"; sourceTree = SOURCE_ROOT; };
8548806422B78E8300E97401 /* IntTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IntTextField.swift; sourceTree = "<group>"; usesTabs = 1; };
858380E922BFD38B0086BC98 /* ExtendedAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ExtendedAttributes.swift; sourceTree = "<group>"; usesTabs = 1; };
8588EB0C22A424B800030A59 /* ResizableDimensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ResizableDimensions.swift; sourceTree = "<group>"; usesTabs = 1; };
85A5C44722CA41B500CAA94D /* VideoValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = VideoValidator.swift; sourceTree = "<group>"; usesTabs = 1; };
85BF910822F3279300AD3FF6 /* TrimmingAVPlayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TrimmingAVPlayer.swift; sourceTree = "<group>"; usesTabs = 1; };
Expand Down Expand Up @@ -131,6 +130,7 @@
buildActionMask = 2147483647;
files = (
E3998CF22ACD7148009F8117 /* Sentry in Frameworks */,
E36BD7A52B9E2C2400B8D86C /* ExtendedAttributes in Frameworks */,
5FF0DFFB278BA5DB00A80F09 /* libgifski_static.a in Frameworks */,
E3339E932395766800303839 /* Defaults in Frameworks */,
E3339E9D2395789500303839 /* DockProgress in Frameworks */,
Expand Down Expand Up @@ -173,13 +173,31 @@
name = Other;
sourceTree = "<group>";
};
E36BD79A2B9D953900B8D86C /* Components */ = {
isa = PBXGroup;
children = (
8548806422B78E8300E97401 /* IntTextField.swift */,
85BF910822F3279300AD3FF6 /* TrimmingAVPlayer.swift */,
D957BCDD234941C200A9A9F9 /* CheckerboardView.swift */,
);
name = Components;
sourceTree = "<group>";
};
E36BD79F2B9E243800B8D86C /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
E3AE627A1E5CD2F300035A2F = {
isa = PBXGroup;
children = (
E3805F542466E68900489E6C /* Config.xcconfig */,
E3AE62851E5CD2F300035A2F /* Gifski */,
0E79251C2329BDBE00058B94 /* Share Extension */,
E3AE62841E5CD2F300035A2F /* Products */,
E36BD79F2B9E243800B8D86C /* Frameworks */,
);
sourceTree = "<group>";
usesTabs = 1;
Expand All @@ -197,8 +215,8 @@
isa = PBXGroup;
children = (
E3AE62861E5CD2F300035A2F /* App.swift */,
E33552F02ACAC3280023AAE9 /* AppState.swift */,
E3A6BD102245345C00F62256 /* Constants.swift */,
E33552F02ACAC3280023AAE9 /* AppState.swift */,
E3FC365B2377FA0000CF7C59 /* Shared.swift */,
E33552EE2ACAC3190023AAE9 /* MainScreen.swift */,
E33552F22ACAC5D80023AAE9 /* StartScreen.swift */,
Expand All @@ -209,12 +227,9 @@
E339F010203820ED003B78FB /* GIFGenerator.swift */,
E30C8EEE29387E7A002E053F /* Gifski.swift */,
C2040B8820435871004EE259 /* GifskiWrapper.swift */,
85BF910822F3279300AD3FF6 /* TrimmingAVPlayer.swift */,
D957BCDD234941C200A9A9F9 /* CheckerboardView.swift */,
8588EB0C22A424B800030A59 /* ResizableDimensions.swift */,
8548806422B78E8300E97401 /* IntTextField.swift */,
858380E922BFD38B0086BC98 /* ExtendedAttributes.swift */,
85A5C44722CA41B500CAA94D /* VideoValidator.swift */,
E36BD79A2B9D953900B8D86C /* Components */,
E3961F7F2AC9F2A700708EB7 /* Intents.swift */,
E3D08F6D1E5D7BFD00F465DF /* Utilities.swift */,
E3AE62881E5CD2F300035A2F /* Assets.xcassets */,
Expand Down Expand Up @@ -264,8 +279,9 @@
E3339E922395766800303839 /* Defaults */,
E3339E9C2395789500303839 /* DockProgress */,
E3998CF12ACD7148009F8117 /* Sentry */,
E36BD7A42B9E2C2400B8D86C /* ExtendedAttributes */,
);
productName = "HEIC Converter";
productName = Gifski;
productReference = E3AE62831E5CD2F300035A2F /* Gifski.app */;
productType = "com.apple.product-type.application";
};
Expand All @@ -277,7 +293,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1100;
LastUpgradeCheck = 1500;
LastUpgradeCheck = 1600;
ORGANIZATIONNAME = "Sindre Sorhus";
TargetAttributes = {
0E79251A2329BDBE00058B94 = {
Expand All @@ -298,7 +314,6 @@
};
};
buildConfigurationList = E3AE627E1E5CD2F300035A2F /* Build configuration list for PBXProject "Gifski" */;
compatibilityVersion = "Xcode 15.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand All @@ -310,7 +325,9 @@
E3339E912395766800303839 /* XCRemoteSwiftPackageReference "Defaults" */,
E3339E9B2395789500303839 /* XCRemoteSwiftPackageReference "DockProgress" */,
E3998CF02ACD7148009F8117 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
E36BD7A32B9E2C1600B8D86C /* XCRemoteSwiftPackageReference "ExtendedAttributes" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = E3AE62841E5CD2F300035A2F /* Products */;
projectDirPath = "";
projectReferences = (
Expand Down Expand Up @@ -399,7 +416,6 @@
8588EB0D22A424B800030A59 /* ResizableDimensions.swift in Sources */,
E3908B7426754568000723A7 /* EstimatedFileSize.swift in Sources */,
D957BCDE234941C200A9A9F9 /* CheckerboardView.swift in Sources */,
858380EA22BFD38C0086BC98 /* ExtendedAttributes.swift in Sources */,
E33552F32ACAC5D80023AAE9 /* StartScreen.swift in Sources */,
E37F68E42ACADA40007F1A7F /* EditScreen.swift in Sources */,
85BF910922F3279300AD3FF6 /* TrimmingAVPlayer.swift in Sources */,
Expand Down Expand Up @@ -551,7 +567,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.3;
MACOSX_DEPLOYMENT_TARGET = 14.4;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -610,7 +626,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.3;
MACOSX_DEPLOYMENT_TARGET = 14.4;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -737,6 +753,14 @@
minimumVersion = 4.3.0;
};
};
E36BD7A32B9E2C1600B8D86C /* XCRemoteSwiftPackageReference "ExtendedAttributes" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/ExtendedAttributes";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
};
};
E3998CF02ACD7148009F8117 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/getsentry/sentry-cocoa";
Expand All @@ -758,6 +782,11 @@
package = E3339E9B2395789500303839 /* XCRemoteSwiftPackageReference "DockProgress" */;
productName = DockProgress;
};
E36BD7A42B9E2C2400B8D86C /* ExtendedAttributes */ = {
isa = XCSwiftPackageProductDependency;
package = E36BD7A32B9E2C1600B8D86C /* XCRemoteSwiftPackageReference "ExtendedAttributes" */;
productName = ExtendedAttributes;
};
E3998CF12ACD7148009F8117 /* Sentry */ = {
isa = XCSwiftPackageProductDependency;
package = E3998CF02ACD7148009F8117 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
Expand Down
7 changes: 7 additions & 0 deletions Gifski.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"originHash" : "0c90c366404e200efeaefbb832e9ea0e7faea9e1f96c7c74f6e39e86d8f25618",
"pins" : [
{
"identity" : "defaults",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/Defaults",
"state" : {
"revision" : "38925e3cfacf3fb89a81a35b1cd44fd5a5b7e0fa",
"version" : "8.2.0"
}
},
{
"identity" : "dockprogress",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/DockProgress",
"state" : {
"revision" : "d4f23b5a8f5ca0fac393eb7ba78c2fe3e32e52da",
"version" : "4.3.1"
}
},
{
"identity" : "extendedattributes",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/ExtendedAttributes",
"state" : {
"revision" : "9698866bf8880abccca0b70b059e7c19386cdefa",
"version" : "1.0.0"
}
},
{
"identity" : "sentry-cocoa",
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa",
"state" : {
"revision" : "5575af93efb776414f243e93d6af9f6258dc539a",
"version" : "8.36.0"
}
}
],
"version" : 3
}
2 changes: 1 addition & 1 deletion Gifski.xcodeproj/xcshareddata/xcschemes/Gifski.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1600"
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions Gifski/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ struct AppMain: App {
])

SSApp.initSentry("https://[email protected]/4505991507738624")

SSApp.setUpExternalEventListeners()
}
}
4 changes: 2 additions & 2 deletions Gifski/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class AppState {
// We have to nil it out first and dispatch, otherwise it shows the old video. (macOS 14.3)
navigationPath = []

Task { @MainActor [self] in
Task { [self] in
do {
// TODO: Simplify the validator.
let (asset, metadata) = try await VideoValidator.validate(url)
Expand Down Expand Up @@ -135,7 +135,7 @@ extension AppState {
return
}

Task { @MainActor in
Task {
start(url)
}
}
Expand Down
7 changes: 4 additions & 3 deletions Gifski/CompletedScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import SwiftUI
import UserNotifications
import StoreKit

@MainActor
struct CompletedScreen: View {
@Environment(AppState.self) private var appState
@Environment(\.requestReview) private var requestReview
Expand All @@ -21,6 +20,7 @@ struct CompletedScreen: View {
ImageView(image: NSImage(data: data) ?? NSImage())
.clipShape(.rect(cornerRadius: 8))
.shadow(radius: 8)
// TODO: This is probably fixed in macOS 15. Test.
// TODO: `.draggable()` does not correctly add a file to the drag pasteboard. (macOS 14.0)
// .draggable(ExportableGIF(url: url))
.onDrag { .init(object: url as NSURL) }
Expand All @@ -47,7 +47,8 @@ struct CompletedScreen: View {
defaultFilename: url.filename
) {
do {
_ = try $0.get()
let url = try $0.get()
try? url.setAppAsItemCreator()
} catch {
appState.error = error
}
Expand Down Expand Up @@ -79,7 +80,7 @@ struct CompletedScreen: View {
Text("·")
Text(url.fileSizeFormatted)
}
.font(.system(size: 12, design: .rounded))
.font(.system(weight: .medium, design: .rounded))
.foregroundStyle(.secondary)
}
ToolbarItem {
Expand Down
Loading