This is an example of using SwiftData in an executable Swift Package. SwiftData uses Bundle.main.bundleIdentifier and when it can't find it, like in an executable Swift Package, it throws this error:
SwiftData/DataStoreCoreData.swift:32: Fatal error: Unable to determine Bundle Name
The solution is to create an Info.plist with at least a Bundle Identifier and then link that into the executable. This example also changes the default storage location which is the same for all macOS SwiftData applications.