diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 9f5cab1f9..b7ce4f173 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -6,7 +6,7 @@ git lfs post-checkout "$@" export PATH="$PATH:/opt/homebrew/bin" # ignores updates of 'Secrets.swift' to avoid pushing sensitive data by mistake -git update-index --assume-unchanged Secrets/Secrets.swift +git update-index --assume-unchanged Components/Secrets/Secrets.swift LOCAL_SCRIPT_PATH="$HOME/.local/elementx_local_dev/post-checkout" if [ -x "$LOCAL_SCRIPT_PATH" ]; then diff --git a/.gitignore b/.gitignore index 5e6bcebb7..17fa81700 100644 --- a/.gitignore +++ b/.gitignore @@ -47,5 +47,5 @@ build test_output # Only commit Pkl packages (there may be other caches in here). -Secrets/vendor/* -!Secrets/vendor/package-2 +Components/Secrets/vendor/* +!Components/Secrets/vendor/package-2 diff --git a/.swiftformat b/.swiftformat index b4fd81628..6d094d1fe 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,6 +1,6 @@ --swiftversion 5.6 ---exclude **/Sources/**/Generated,vendor,**/Package.swift,Secrets/** +--exclude **/Sources/**/Generated,vendor,**/Package.swift,Components/Secrets/** --disable wrapMultiLineStatementBraces --disable hoistPatternLet diff --git a/.swiftlint.yml b/.swiftlint.yml index a29e80569..805a6bbe3 100755 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -18,7 +18,7 @@ included: excluded: - "*/Sources/Generated/*" - Tools/Sources # Our command-line tools use a lot of print commands. - - Secrets + - Components/Secrets - compound-ios/Inspector line_length: diff --git a/Secrets/Secrets.pkl b/Components/Secrets/Secrets.pkl similarity index 100% rename from Secrets/Secrets.pkl rename to Components/Secrets/Secrets.pkl diff --git a/Secrets/Secrets.swift b/Components/Secrets/Secrets.swift similarity index 100% rename from Secrets/Secrets.swift rename to Components/Secrets/Secrets.swift diff --git a/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json b/Components/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json similarity index 100% rename from Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json rename to Components/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json diff --git a/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip b/Components/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip similarity index 100% rename from Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip rename to Components/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 41ace6059..d8464957b 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -221,7 +221,6 @@ 21F29351EDD7B2A5534EE862 /* SecureBackupKeyBackupScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD558A898847C179E4B7A237 /* SecureBackupKeyBackupScreen.swift */; }; 221A7F92116722322AE150AE /* StartChatTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0367E0AF1163F42292D788BD /* StartChatTests.swift */; }; 22882C710BC99EC34A5024A0 /* UITestsScreenIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CEBE5EA91E8691EDF364EC2 /* UITestsScreenIdentifier.swift */; }; - 22B380C579C148BA0BFB5952 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3557ACB95D0F666EF5AF0CE /* Secrets.swift */; }; 22BA593A5E19D8D3DE2FAA6F /* TimelineEventContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F926D08EB3D622A480BCA71 /* TimelineEventContent.swift */; }; 22C5483D01EEB290B8339817 /* HomeScreenInviteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FC33C3F6BF597E095CE9FA /* HomeScreenInviteCell.swift */; }; 2335D1AB954C151FD8779F45 /* RoomPermissionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0096BC5DA86AF6B6E5742AC /* RoomPermissionsTests.swift */; }; @@ -318,6 +317,7 @@ 3118D9ABFD4BE5A3492FF88A /* ElementCallConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC437C491EA6996513B1CEAB /* ElementCallConfiguration.swift */; }; 31CCF3159E5CE1C05AE5781B /* HTMLFixtures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A5FBB74981BF8EFFDAE90D /* HTMLFixtures.swift */; }; 31DE6B7FD15E1C6E43885717 /* RoomRole.swift in Sources */ = {isa = PBXBuildFile; fileRef = 578AF9CE60816069536C0953 /* RoomRole.swift */; }; + 329D65DD7CC0E42CAD282EF7 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C6AE2DB4FE7FAEA6402663 /* Secrets.swift */; }; 32B7891D937377A59606EDFC /* UserFlowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21DD8599815136EFF5B73F38 /* UserFlowTests.swift */; }; 32BFB9B4D2EC46196537B72F /* ContentScannerProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E6EB3C22BACF0A17FEDA4C4 /* ContentScannerProxyProtocol.swift */; }; 32F47002A331817F0E6BD7EB /* RoomMembershipDetailsProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1434D5169F0EE319E226DA7F /* RoomMembershipDetailsProxyProtocol.swift */; }; @@ -876,6 +876,7 @@ 8AA84EF202F2EFC8453A97BD /* SecureBackupRecoveryKeyScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645E027C112740573D27765C /* SecureBackupRecoveryKeyScreenModels.swift */; }; 8AAE2EB68802E837F568163C /* SignallingTimelineItemProviderMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE61568A225F7AA068583AA7 /* SignallingTimelineItemProviderMock.swift */; }; 8AB8ED1051216546CB35FA0E /* UserSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E5E9C044BEB7C70B1378E91 /* UserSession.swift */; }; + 8AC8FDECC74D710CA97A2991 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C6AE2DB4FE7FAEA6402663 /* Secrets.swift */; }; 8AEE47A14223423806A7653A /* LiveLocationSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2FEFA393FC7D2870263012 /* LiveLocationSession.swift */; }; 8B1D5CE017EEC734CF5FE130 /* Encodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 260004737C573A56FA01E86E /* Encodable.swift */; }; 8B408C574E35E1C9B43A50CE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */; }; @@ -907,6 +908,7 @@ 8F3AD08F2E706AA60F1A1D4D /* portrait_test_image.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BC51BF90469412ABDE658CDD /* portrait_test_image.jpg */; }; 904F06C9C1AEF884C2077542 /* RoomDirectorySearchScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2E4EF80DFB8FE7C4469B15D /* RoomDirectorySearchScreen.swift */; }; 90733645AE76FB33DAD28C2B /* URLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE40D4A5DD857AC16EED945A /* URLSession.swift */; }; + 9097C3B61181B731CACEE28B /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2C6AE2DB4FE7FAEA6402663 /* Secrets.swift */; }; 90C683C87BF6D39419402E5B /* AuthenticationClassicAppBackupInstructionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B0E0A2F16603E7C827C295 /* AuthenticationClassicAppBackupInstructionsView.swift */; }; 90DF83A6A347F7EE7EDE89EE /* AttributedStringBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF25E364AE85090A70AE4644 /* AttributedStringBuilderTests.swift */; }; 90EB25D13AE6EEF034BDE9D2 /* Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71D52BAA5BADB06E5E8C295D /* Assets.swift */; }; @@ -983,7 +985,6 @@ 9B3589276CA008E38FAAAE91 /* SpacesScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 358528B29FA72ACFD0D9644B /* SpacesScreenCoordinator.swift */; }; 9B84F55288AB98783C11CC49 /* SpaceRoomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E7B059E84E7E374D3322A2 /* SpaceRoomCell.swift */; }; 9B872FF37DBE6BE054903831 /* MediaUploadPreviewScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54E12B98252F6C527E31FEE /* MediaUploadPreviewScreenViewModelProtocol.swift */; }; - 9C11138F7D8C291494BB0B20 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3557ACB95D0F666EF5AF0CE /* Secrets.swift */; }; 9C4EC28A921486B1775D7F8C /* IdentityConfirmedScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307702DD66E7DDCDD9214784 /* IdentityConfirmedScreen.swift */; }; 9C63171267E22FEB288EC860 /* RoomHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1627F2D56477BD331F6D732C /* RoomHeaderView.swift */; }; 9CBB04365408F9D6F46BA3A7 /* PinnedEventsTimelineFlowCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54AAF72E821B4084B7E4298 /* PinnedEventsTimelineFlowCoordinator.swift */; }; @@ -1533,7 +1534,6 @@ F6D07D834279BE17D18A33E9 /* LocationSharingScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EED6D8956E554CEDFD4FE00D /* LocationSharingScreenViewModelTests.swift */; }; F6DFA23885980118AD7359C5 /* NotificationSettingsScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2389732B0E115A999A069083 /* NotificationSettingsScreenCoordinator.swift */; }; F6F49E37272AD7397CD29A01 /* HomeScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505208F28007C0FEC14E1FF0 /* HomeScreenViewModelTests.swift */; }; - F71C2B24AFB566119ACCDDA1 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3557ACB95D0F666EF5AF0CE /* Secrets.swift */; }; F7567DD6635434E8C563BF85 /* AnalyticsClientProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3B97591B2D3D4D67553506D /* AnalyticsClientProtocol.swift */; }; F777C6FEE7D106136E2ED2B2 /* MessageForwardingScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F6E6EDC4BBF962B2ED595A4 /* MessageForwardingScreenViewModelTests.swift */; }; F78BAD28482A467287A9A5A3 /* EventBasedMessageTimelineItemProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0900BBF0A5D5D775E917C70 /* EventBasedMessageTimelineItemProtocol.swift */; }; @@ -2771,6 +2771,7 @@ B2AF1828A5B76B7C371240FE /* StateRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateRoomTimelineView.swift; sourceTree = ""; }; B2B1DC3B3FB40A7F4AE9B7BF /* RoomRolesAndPermissionsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomRolesAndPermissionsScreen.swift; sourceTree = ""; }; B2B5EDCD05D50BA9B815C66C /* ImageRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageRoomTimelineItemContent.swift; sourceTree = ""; }; + B2C6AE2DB4FE7FAEA6402663 /* Secrets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secrets.swift; sourceTree = ""; }; B2E7C987AE5DC9087BB19F7D /* MediaUploadPreviewScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaUploadPreviewScreenModels.swift; sourceTree = ""; }; B2EAFFD44F81F86012D6EC27 /* AudioRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioRoomTimelineView.swift; sourceTree = ""; }; B3005886F00029F058DB62BE /* StartChatScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartChatScreenCoordinator.swift; sourceTree = ""; }; @@ -2952,7 +2953,6 @@ D2C513A6CD99E6C3C163DA1E /* RowDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RowDivider.swift; sourceTree = ""; }; D316BB02636AF2174F2580E6 /* SoftLogoutScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoftLogoutScreenViewModelProtocol.swift; sourceTree = ""; }; D33116993D54FADC0C721C1F /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = ""; }; - D3557ACB95D0F666EF5AF0CE /* Secrets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secrets.swift; sourceTree = ""; }; D38391154120264910D19528 /* PollMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollMock.swift; sourceTree = ""; }; D39D7F513A36C9C1951DB44C /* AnalyticsSettingsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreen.swift; sourceTree = ""; }; D3F219838588C62198E726E3 /* LABiometryType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LABiometryType.swift; sourceTree = ""; }; @@ -3683,14 +3683,6 @@ path = View; sourceTree = ""; }; - 2197234282B4BC0CE79AAC74 /* Secrets */ = { - isa = PBXGroup; - children = ( - D3557ACB95D0F666EF5AF0CE /* Secrets.swift */, - ); - path = Secrets; - sourceTree = ""; - }; 21E5BB69FC9058BED96B9EFD /* Sources */ = { isa = PBXGroup; children = ( @@ -4183,6 +4175,14 @@ path = View; sourceTree = ""; }; + 35EF630F12E2F5BB4A5F3972 /* Secrets */ = { + isa = PBXGroup; + children = ( + B2C6AE2DB4FE7FAEA6402663 /* Secrets.swift */, + ); + path = Secrets; + sourceTree = ""; + }; 36F3E6E629B4FCCA1CEE0956 /* View */ = { isa = PBXGroup; children = ( @@ -4357,7 +4357,6 @@ 8A9C09B6A392465E03B8D1B1 /* IntegrationTests */, A8002CB4F20B6282850A614C /* DevelopmentAssets */, B72D140D3102EA113F2D77C8 /* Components */, - 2197234282B4BC0CE79AAC74 /* Secrets */, 823ED0EC3F1B6CF47D284011 /* Tools */, 9413F680ECDFB2B0DDB0DEF2 /* Packages */, DE77D5FC2A361306E4440687 /* Frameworks */, @@ -6412,6 +6411,7 @@ isa = PBXGroup; children = ( 2971193D56994881809FD4FA /* SDKMocks */, + 35EF630F12E2F5BB4A5F3972 /* Secrets */, ); path = Components; sourceTree = ""; @@ -8172,7 +8172,7 @@ 5E73893669BB56307A44AAAD /* RoomListActivityVisibility.swift in Sources */, 17BC15DA08A52587466698C5 /* RoomMessageEventStringBuilder.swift in Sources */, 06D17F7813AA931FF18FD5D0 /* SDKListener.swift in Sources */, - F71C2B24AFB566119ACCDDA1 /* Secrets.swift in Sources */, + 329D65DD7CC0E42CAD282EF7 /* Secrets.swift in Sources */, 7573D682F089205F7F1D96CF /* SessionDirectories.swift in Sources */, 422E8D182CA688D4565CD1E1 /* String.swift in Sources */, 6EC7A40A537CFB3D526A111C /* Strings.swift in Sources */, @@ -8413,7 +8413,7 @@ 6F76F34F4CAD400F5015EC5C /* RemoteSettingsHook.swift in Sources */, 1C4CB9009E50E6535883D5B2 /* RestorationToken.swift in Sources */, 6885C3D26FC1026E07408D3C /* RoomListActivityVisibility.swift in Sources */, - 9C11138F7D8C291494BB0B20 /* Secrets.swift in Sources */, + 9097C3B61181B731CACEE28B /* Secrets.swift in Sources */, B6B62437B92B6CA4083AA899 /* SessionDirectories.swift in Sources */, DAF63A9CF9932CA8F6830F11 /* ShareExtensionModels.swift in Sources */, 5AA81A4E2D40A32A9E7F71F2 /* ShareExtensionView.swift in Sources */, @@ -9253,7 +9253,7 @@ 54804A7D8298F7E8ACAFDD76 /* SearchScreenViewModelProtocol.swift in Sources */, 51A075328D68FB4AE65C43B5 /* SearchServiceProxy.swift in Sources */, BEB3D97EA51B25C87A37997E /* SearchServiceProxyProtocol.swift in Sources */, - 22B380C579C148BA0BFB5952 /* Secrets.swift in Sources */, + 8AC8FDECC74D710CA97A2991 /* Secrets.swift in Sources */, 339BC18777912E1989F2F17D /* Section.swift in Sources */, F833D5B5BE6707F961FA88DB /* SecureBackupController.swift in Sources */, 2D0E3983288E2D35613AD681 /* SecureBackupControllerMock.swift in Sources */, diff --git a/ElementX/SupportingFiles/target.yml b/ElementX/SupportingFiles/target.yml index c3c04d063..8b70dd501 100644 --- a/ElementX/SupportingFiles/target.yml +++ b/ElementX/SupportingFiles/target.yml @@ -282,7 +282,7 @@ targets: excludes: - Other/Extensions/XCTestCase.swift - Other/Extensions/XCUIElement.swift - - path: ../../Secrets/Secrets.swift + - path: ../../Components/Secrets/Secrets.swift - path: ../Resources - path: ../SupportingFiles - path: ../../Tools/Scripts/Templates/SimpleScreenExample/ElementX diff --git a/NSE/SupportingFiles/target.yml b/NSE/SupportingFiles/target.yml index 5053b1fc9..f48458c13 100644 --- a/NSE/SupportingFiles/target.yml +++ b/NSE/SupportingFiles/target.yml @@ -89,7 +89,7 @@ targets: - path: ../../ElementX/Sources/AppHooks/Hooks/TracingHook.swift - path: ../../ElementX/Sources/AppHooks/Hooks/ClientBuilderHook.swift - path: ../../ElementX/Sources/AppHooks/Hooks/RemoteSettingsHook.swift - - path: ../../Secrets/Secrets.swift + - path: ../../Components/Secrets/Secrets.swift - path: ../../ElementX/Sources/Application/Settings - path: ../../ElementX/Sources/Application/TargetConfiguration.swift - path: ../../ElementX/Sources/Generated/Strings.swift diff --git a/ShareExtension/SupportingFiles/target.yml b/ShareExtension/SupportingFiles/target.yml index db2e63d46..fa6c8cbe0 100644 --- a/ShareExtension/SupportingFiles/target.yml +++ b/ShareExtension/SupportingFiles/target.yml @@ -89,7 +89,7 @@ targets: - path: ../../ElementX/Sources/AppHooks/Hooks/TracingHook.swift - path: ../../ElementX/Sources/AppHooks/Hooks/ClientBuilderHook.swift - path: ../../ElementX/Sources/AppHooks/Hooks/RemoteSettingsHook.swift - - path: ../../Secrets/Secrets.swift + - path: ../../Components/Secrets/Secrets.swift - path: ../../ElementX/Sources/Application/Settings - path: ../../ElementX/Sources/Application/TargetConfiguration.swift - path: ../../ElementX/Sources/Services/AlertTones/NotificationTone.swift diff --git a/docs/FORKING.md b/docs/FORKING.md index 843a84e1c..6baa0874a 100644 --- a/docs/FORKING.md +++ b/docs/FORKING.md @@ -38,7 +38,7 @@ An option would be to export it to your environment and use the existing `Secret One way to avoid pushing the API key by mistake is running on your machine the command: ``` -git update-index assume-unchanged Secrets/Secrets.swift +git update-index assume-unchanged Components/Secrets/Secrets.swift ``` this will prevent pushing any update of the file `Secrets.swift`. diff --git a/project.yml b/project.yml index 0c4c7870b..1b5b63be1 100644 --- a/project.yml +++ b/project.yml @@ -26,7 +26,6 @@ options: - IntegrationTests - DevelopmentAssets - Components - - Secrets - Tools - pattern: ElementX order: