Repository navigation
fix(swift): parse Package.swift ranges, name-first calls, and registry ids - #594
Merged
Merged
Conversation
vibgrate-team
force-pushed
the
cursor/swift-package-manifest-forms-def5
branch
from
November 4, 2026 14:04
d2c2d57 to
ea6636f
Compare
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.
Summary
parsePackageSwiftonly matched.package(url: "...", from|exact|upToNextMajor|revision|branch: "..."). Valid SwiftPM dependencies that use a..<or...range, putname:beforeurl:, or declare a registryid:produced no dependency row, so they never showed up in a scan or invg sbom export.The parser now finds each
.package(call and reads its argument text, skipping strings and comments so a)inside a URL cannot end the call early...<and...ranges record the lower bound ascurrentSpec. An explicitname:is used when present, and registryid:dependencies are included (the id is the package name). Local.package(path:)dependencies stay excluded. Existingfrom:,exact:,branch:,revision:, and.upToNextMajor(from:)forms still record the same spec.Related issues
Closes #589
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleangraph.json/ report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)git commit -s, DCO)Notes for reviewers
No README, DOCS, or ARCHITECTURE change: those docs do not describe Package.swift syntax.
test/swift-package-manifest.test.tscovers half-open and closed ranges (including a spaced, multiline range),name:-first calls, an explicit name that differs from the URL basename, registryid:dependencies, the existing labelled forms, and the omission of.package(path:).pnpm lintexits 0. It still reports five pre-existing unused-variable warnings in unrelated files.pnpm test(5638) andpnpm typecheckpassed.