Add the repository url to the generated License - #48
Open
yutailang0119 wants to merge 1 commit into
Open
Conversation
yutailang0119
force-pushed
the
feature/license-repository-url
branch
from
August 18, 2026 15:27
48cdaf2 to
8f61fe2
Compare
yutailang0119
marked this pull request as ready for review
August 18, 2026 15:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
License.urlso consumers can link to a dependency's repository without maintaining their own name-to-url map.PackagePlugin.Package.originalready carries the url for every dependency resolved from source control, but the generator discarded it. It is now filled fromPackageOrigin.repository(url:_:_:), and leftnilfor.root,.localand.registry.Typed
URL?so it can be handed straight toLinkoropenURL.PackageOriginreports aString, so the generated code wraps it inURL(string:)— that returnsURL?, which matches the property and needs no force unwrap. This addsimport Foundationto the generated file.This is source-breaking for code that constructs a
License. The generated file is compiled into the consuming target, so its memberwise initializer is reachable from user code, and adding a property makes existing calls fail withmissing argument for parameter 'url' in call. The only such call site in this repository is theLicenseDetailScreenpreview, updated here. If you would rather keep it non-breaking, I can emit an explicit initializer withurldefaulted tonilinstead — say the word.One thing worth knowing: urls are emitted exactly as declared, so the
.gitsuffix is inconsistent across a real graph (firebase-ios-sdkwithout it,leveldb.gitwith it). I left them verbatim rather than normalizing.Also folded in a one-word README fix — the snippet was missing
Sendable, which the generator has been emitting for a while.