Closed e-001 closed 1 year ago
Hi @e-001, thanks for the idea.
The proposed configuration syntax doesn't cater for the many options of specifying a dependency in a Swift package. It seems rather limiting to only allow url
and from
but also a high maintenance cost of matching all the parameters that SPM allows. If this did end up being added to the configuration I'd rather have the user specify the entire line that should be included as a dependency, i.e.:
...
"output": {
"schemaTypes": {
"path": "./EnigmaGQL",
"moduleType": {
"swiftPackageManager": {
"dependencies": [
".package(url: \"https://github.com/mapbox/turf-swift.git\", from: \"2.6.0\")"
]
}
}
}
...
You may not have seen https://github.com/apollographql/apollo-ios/issues/2839 but we're considering the option of making the maintenance of the swift package manifest completely your responsibility; only creating it once when not found, once it exists you can edit it in any way you want and the changes will persist.
Hard agree on #2839, I hadn't seen it. Yes, makes perfect sense especially if the only expected updates to Package.swift in the current workflow are to bump Apollo versions. I'd take that over my request.
👋,
It would be beneficial to have the ability to include dependencies directly in the configuration file. We use them in our scalar parsing and are currently manually
sed
-ing it intoPackage.swift
after every generation, as it is written over.I propose adding a
dependencies
field toschemaTypes.moduleType.swiftPackageManager
, allowing users to specify additional dependencies that should be included in the generated package. The updated configuration syntax would look like this:Which would generate:
This would allow users to easily include additional dependencies in their projects without manually modifying the generated Package.swift file.