Skip to content

Commit f201b41

Browse files
authored
Merge pull request #262 from cocoatype/204-barcodes-appear-twice-in-app-shortcuts
Refactor Shortcuts frameworks to fix duplicate entity issue
2 parents 8e2ce31 + 51e6a78 commit f201b41

File tree

65 files changed

+313
-117
lines changed

Some content is hidden

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

65 files changed

+313
-117
lines changed

.tool-versions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
ruby 3.3.4
1+
ruby 3.3.4
2+
tuist 4.40.0

App/Mobile/Sources/AppShortcutsPackage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Copyright © 2024 Cocoatype, LLC. All rights reserved.
33

44
import AppIntents
5-
import Shortcuts
5+
import AppShortcuts
66

77
struct AppShortcutsPackage: AppIntentsPackage {
88
static var includedPackages: [any AppIntentsPackage.Type] {

App/Mobile/Sources/BarcMobileApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// Copyright © 2023 Cocoatype, LLC. All rights reserved.
33

44
import AppIntents
5+
import AppShortcuts
56
import Defaults
67
import ErrorHandling
78
import Navigation
89
import Persistence
910
import Purchasing
1011
import Releases
1112
import Root
12-
import Shortcuts
1313
import SwiftUI
1414
import SwiftUIIntrospect
1515

Barc.xctestplan

Lines changed: 71 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,21 @@
195195
"containerPath" : "container:Barc.xcodeproj",
196196
"identifier" : "CE9864575F03B5FB76556691",
197197
"name" : "Defaults"
198+
},
199+
{
200+
"containerPath" : "container:Barc.xcodeproj",
201+
"identifier" : "26B1E989BD57CDED72F30258",
202+
"name" : "AppShortcuts"
203+
},
204+
{
205+
"containerPath" : "container:Barc.xcodeproj",
206+
"identifier" : "B6F55CDCF56D1D8CBEC3DE69",
207+
"name" : "ShortcutsModels"
208+
},
209+
{
210+
"containerPath" : "container:Barc.xcodeproj",
211+
"identifier" : "C338599CA987646DFB871BAA",
212+
"name" : "WidgetShortcuts"
198213
}
199214
]
200215
},
@@ -204,50 +219,50 @@
204219
{
205220
"target" : {
206221
"containerPath" : "container:Barc.xcodeproj",
207-
"identifier" : "E403E187A570C80A0EC519A8",
208-
"name" : "PurchasingTests"
222+
"identifier" : "F0FB100227DE1CCAA30DC238",
223+
"name" : "WidgetContentsTests"
209224
}
210225
},
211226
{
212227
"target" : {
213228
"containerPath" : "container:Barc.xcodeproj",
214-
"identifier" : "4AE089AF9F5FBD1A9DDAAD19",
215-
"name" : "BarcodeGeneratorTests"
229+
"identifier" : "1A65C8AF15A5FD9E4FD4DB1E",
230+
"name" : "ImageReaderTests"
216231
}
217232
},
218233
{
219234
"target" : {
220235
"containerPath" : "container:Barc.xcodeproj",
221-
"identifier" : "F0FB100227DE1CCAA30DC238",
222-
"name" : "WidgetContentsTests"
236+
"identifier" : "C40297B2DF43FFE378F3FE45",
237+
"name" : "DefaultsTests"
223238
}
224239
},
225240
{
226241
"target" : {
227242
"containerPath" : "container:Barc.xcodeproj",
228-
"identifier" : "239401D13100FBF059BB54E9",
229-
"name" : "TriggersTests"
243+
"identifier" : "DB52DCD5F0C469D41EF74B49",
244+
"name" : "PaywallTests"
230245
}
231246
},
232247
{
233248
"target" : {
234249
"containerPath" : "container:Barc.xcodeproj",
235-
"identifier" : "47C740CD4AC5D72412964143",
236-
"name" : "OnboardingTests"
250+
"identifier" : "F56E9E3AED05F39FC765BB55",
251+
"name" : "UnpurchasedTests"
237252
}
238253
},
239254
{
240255
"target" : {
241256
"containerPath" : "container:Barc.xcodeproj",
242-
"identifier" : "645C93D97EAAFC4220C464DC",
243-
"name" : "PermissionTests"
257+
"identifier" : "5B3483F6C527D5A92A3EA940",
258+
"name" : "ShortcutsModelsTests"
244259
}
245260
},
246261
{
247262
"target" : {
248263
"containerPath" : "container:Barc.xcodeproj",
249-
"identifier" : "DB52DCD5F0C469D41EF74B49",
250-
"name" : "PaywallTests"
264+
"identifier" : "DE3175A6F25839D8B453EED7",
265+
"name" : "LibraryTests"
251266
}
252267
},
253268
{
@@ -257,6 +272,13 @@
257272
"name" : "BarcodesTests"
258273
}
259274
},
275+
{
276+
"target" : {
277+
"containerPath" : "container:Barc.xcodeproj",
278+
"identifier" : "F5AC73F5264F7778BB4CE9DA",
279+
"name" : "ReleasesTests"
280+
}
281+
},
260282
{
261283
"target" : {
262284
"containerPath" : "container:Barc.xcodeproj",
@@ -267,99 +289,106 @@
267289
{
268290
"target" : {
269291
"containerPath" : "container:Barc.xcodeproj",
270-
"identifier" : "3DF32F98DD9D80B0F33E8C0A",
271-
"name" : "ShortcutsTests"
292+
"identifier" : "4E48451F6DB57DB7B8356803",
293+
"name" : "MenuTests"
272294
}
273295
},
274296
{
275297
"target" : {
276298
"containerPath" : "container:Barc.xcodeproj",
277-
"identifier" : "A7D60DFC0C398C33DC1A4B84",
278-
"name" : "ReviewRequestTests"
299+
"identifier" : "5C19261E96ACB9937FB80EA6",
300+
"name" : "ShareContentsTests"
279301
}
280302
},
281303
{
282304
"target" : {
283305
"containerPath" : "container:Barc.xcodeproj",
284-
"identifier" : "9EFEFCABDA65A3DF2E59E2C6",
285-
"name" : "NavigationTests"
306+
"identifier" : "47C740CD4AC5D72412964143",
307+
"name" : "OnboardingTests"
286308
}
287309
},
288310
{
289311
"target" : {
290312
"containerPath" : "container:Barc.xcodeproj",
291-
"identifier" : "B7801BD51E4383FE13838986",
292-
"name" : "LoggingTests"
313+
"identifier" : "645C93D97EAAFC4220C464DC",
314+
"name" : "PermissionTests"
293315
}
294316
},
295317
{
296318
"target" : {
297319
"containerPath" : "container:Barc.xcodeproj",
298-
"identifier" : "F5AC73F5264F7778BB4CE9DA",
299-
"name" : "ReleasesTests"
320+
"identifier" : "3C5D35113DA903F97D4B6553",
321+
"name" : "RootTests"
300322
}
301323
},
302324
{
303325
"target" : {
304326
"containerPath" : "container:Barc.xcodeproj",
305-
"identifier" : "4E48451F6DB57DB7B8356803",
306-
"name" : "MenuTests"
327+
"identifier" : "8C42486706BAE5542944E694",
328+
"name" : "WidgetShortcutsTests"
307329
}
308330
},
309331
{
310332
"target" : {
311333
"containerPath" : "container:Barc.xcodeproj",
312-
"identifier" : "3C5D35113DA903F97D4B6553",
313-
"name" : "RootTests"
334+
"identifier" : "BD73C85D2F2394F427BF6F64",
335+
"name" : "WalletExportTests"
314336
}
315337
},
316338
{
317339
"target" : {
318340
"containerPath" : "container:Barc.xcodeproj",
319-
"identifier" : "C40297B2DF43FFE378F3FE45",
320-
"name" : "DefaultsTests"
341+
"identifier" : "239401D13100FBF059BB54E9",
342+
"name" : "TriggersTests"
321343
}
322344
},
323345
{
324346
"target" : {
325347
"containerPath" : "container:Barc.xcodeproj",
326-
"identifier" : "E57DB4010BF5291B8973BCE2",
327-
"name" : "ErrorHandlingTests"
348+
"identifier" : "CD35C3200C6C27E7AA0F64E9",
349+
"name" : "AppShortcutsTests"
328350
}
329351
},
330352
{
331353
"target" : {
332354
"containerPath" : "container:Barc.xcodeproj",
333-
"identifier" : "F56E9E3AED05F39FC765BB55",
334-
"name" : "UnpurchasedTests"
355+
"identifier" : "B7801BD51E4383FE13838986",
356+
"name" : "LoggingTests"
335357
}
336358
},
337359
{
338360
"target" : {
339361
"containerPath" : "container:Barc.xcodeproj",
340-
"identifier" : "DE3175A6F25839D8B453EED7",
341-
"name" : "LibraryTests"
362+
"identifier" : "9EFEFCABDA65A3DF2E59E2C6",
363+
"name" : "NavigationTests"
342364
}
343365
},
344366
{
345367
"target" : {
346368
"containerPath" : "container:Barc.xcodeproj",
347-
"identifier" : "1A65C8AF15A5FD9E4FD4DB1E",
348-
"name" : "ImageReaderTests"
369+
"identifier" : "4AE089AF9F5FBD1A9DDAAD19",
370+
"name" : "BarcodeGeneratorTests"
349371
}
350372
},
351373
{
352374
"target" : {
353375
"containerPath" : "container:Barc.xcodeproj",
354-
"identifier" : "5C19261E96ACB9937FB80EA6",
355-
"name" : "ShareContentsTests"
376+
"identifier" : "E57DB4010BF5291B8973BCE2",
377+
"name" : "ErrorHandlingTests"
356378
}
357379
},
358380
{
359381
"target" : {
360382
"containerPath" : "container:Barc.xcodeproj",
361-
"identifier" : "BD73C85D2F2394F427BF6F64",
362-
"name" : "WalletExportTests"
383+
"identifier" : "E403E187A570C80A0EC519A8",
384+
"name" : "PurchasingTests"
385+
}
386+
},
387+
{
388+
"target" : {
389+
"containerPath" : "container:Barc.xcodeproj",
390+
"identifier" : "A7D60DFC0C398C33DC1A4B84",
391+
"name" : "ReviewRequestTests"
363392
}
364393
}
365394
],

Modules/Shortcuts/Resources/en.lproj/Localizable.strings renamed to Modules/AppShortcuts/Resources/en.lproj/Localizable.strings

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
// Display name of the barcode entity type
2-
"BarcodeEntity.typeDisplayRepresentation" = "Barcode";
3-
4-
// Display name of the barcode format entity type
5-
"BarcodeFormatEntity.typeDisplayRepresentation" = "Barcode Format";
6-
7-
// Name of the Codabar format
8-
"BarcodeFormatEntity.codabar" = "Codabar";
9-
10-
// Name of the Code 39 format
11-
"BarcodeFormatEntity.code39" = "Code 39";
12-
13-
// Name of the Code 128 format
14-
"BarcodeFormatEntity.code128" = "Code 128";
15-
16-
// Name of the EAN-13 format
17-
"BarcodeFormatEntity.ean13" = "UPC/EAN-13";
18-
19-
// Name of the PDF417 format
20-
"BarcodeFormatEntity.pdf417" = "PDF417";
21-
22-
// Name of the QR format
23-
"BarcodeFormatEntity.qr" = "QR";
24-
251
// Description for the "create code" intent
262
"CreateBarcodeIntent.description" = "Creates a barcode with a given value.";
273

File renamed without changes.

Modules/Shortcuts/Sources/ImageError.swift renamed to Modules/AppShortcuts/Sources/ImageError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
enum ImageError: Error, CustomLocalizedStringResourceConvertible {
77
case cannotCreateImageFromData
88

9-
typealias StringResources = ShortcutsStringResources.ImageError
9+
typealias StringResources = AppShortcutsStringResources.ImageError
1010
var localizedStringResource: LocalizedStringResource {
1111
switch self {
1212
case .cannotCreateImageFromData: StringResources.cannotCreateImageFromData

Modules/Shortcuts/Sources/Intents/CreateBarcodeIntent.swift renamed to Modules/AppShortcuts/Sources/Intents/CreateBarcodeIntent.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Barcodes
66
import ErrorHandling
77
import PDF417
88
import Persistence
9+
import ShortcutsModels
910

1011
struct CreateBarcodeIntent: AppIntent {
1112
static let title: LocalizedStringResource = "CreateBarcodeIntent.title"
@@ -34,9 +35,9 @@ struct CreateBarcodeIntent: AppIntent {
3435
var name: String?
3536

3637
private var codeName: String {
37-
guard let name else { return ShortcutsStrings.CreateBarcodeIntent.defaultName }
38+
guard let name else { return AppShortcutsStrings.CreateBarcodeIntent.defaultName }
3839

39-
if name.isEmpty { return ShortcutsStrings.CreateBarcodeIntent.defaultName }
40+
if name.isEmpty { return AppShortcutsStrings.CreateBarcodeIntent.defaultName }
4041
else { return name }
4142
}
4243

Modules/Shortcuts/Sources/Intents/DisplayBarcodeIntent.swift renamed to Modules/AppShortcuts/Sources/Intents/DisplayBarcodeIntent.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import AppIntents
55
import BarcodeGenerator
66
import ErrorHandling
7+
import ShortcutsModels
78
import SwiftUI
89
import UniformTypeIdentifiers
910

Modules/Shortcuts/Sources/Intents/GetBarcodeValueIntent.swift renamed to Modules/AppShortcuts/Sources/Intents/GetBarcodeValueIntent.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright © 2024 Cocoatype, LLC. All rights reserved.
33

44
import AppIntents
5+
import ShortcutsModels
56

67
struct GetBarcodeValueIntent: AppIntent {
78
static let title: LocalizedStringResource = "GetBarcodeValueIntent.title"

0 commit comments

Comments
 (0)