Skip to content

Commit 07497a7

Browse files
committed
Incorporate feedback from comments on a32c512
1 parent a32c512 commit 07497a7

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

proposals/0292-package-registry-service.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ Link: <https://github.com/mona/LinkedList>; rel="canonical",
220220
Swift Package Manager uses this information
221221
to reconcile the URL-based dependency declaration with
222222
the package identifier `@mona/LinkedList`.
223+
Link relation URLs may also be normalized to mitigate insignificant variations.
224+
For example,
225+
a package with an ["scp-style" URL][scp-url] like
226+
`[email protected]:mona/LinkedList.git`
227+
is determined to be equivalent to a URL with an explicit scheme like
228+
`ssh:///[email protected]/mona/LinkedList`.
223229

224230
A package identifier serves as the package name
225231
in target-based dependency declarations —
@@ -237,7 +243,7 @@ that is, the `package` parameter in `.product(name:package)` method calls.
237243
```
238244

239245
Any path-based dependency declaration
240-
or URL-based declaration without a associated package identifier
246+
or URL-based declaration without an associated package identifier
241247
will continue to synthesize its identity from
242248
the last path component of its location.
243249

@@ -441,7 +447,7 @@ OPTIONS:
441447
Running this subcommand in the root directory of a package
442448
creates or updates the `.swiftpm/config/registries.json` file
443449
with a new top-level `registries` key
444-
that's associated with an array containing the specified registry URLs.
450+
that's associated with an object containing the specified registry URLs.
445451

446452
For example,
447453
a build server that doesn't allow external network connections
@@ -906,20 +912,6 @@ of authenticity and non-repudiation beyond what's possible with checksums alone.
906912
Defining a standard interface for package registries
907913
lays the groundwork for several useful features.
908914

909-
### Package dependency URL normalization
910-
911-
As described in ["Module name collision resolution"](#module-name-collision-resolution)
912-
Swift Package Manager cannot build a project
913-
if two or more packages in the project
914-
are located by URLs with the same (case-insensitive) last path component.
915-
Swift Package Manager may improve support URL-based dependencies
916-
by normalizing package URLs to mitigate insignificant variations.
917-
For example,
918-
a package with an ["scp-style" URL][scp-url] like
919-
`[email protected]:mona/LinkedList.git`
920-
may be determined to be equivalent to a package with an HTTPS scheme like
921-
`https:///github.com/mona/LinkedList`.
922-
923915
### Local offline cache
924916

925917
Swift Package Manager could implement an [offline cache]
@@ -928,6 +920,21 @@ While this is technically possible today,
928920
a package registry makes for a simpler and more secure implementation
929921
than would otherwise be possible with Git repositories alone.
930922

923+
### Package manifest dependency migration
924+
925+
Swift Package Manager could add tooling
926+
to help package maintainers adopt registry-supported identifiers
927+
in their projects.
928+
929+
```terminal
930+
$ swift package-registry migrate
931+
```
932+
933+
```diff
934+
- .package(url: "https://github.com/mona/LinkedList", .exact("1.2.0"))
935+
+ .package(id: "@mona/LinkedList", .exact("1.2.0"))
936+
```
937+
931938
### Package publishing
932939

933940
A package registry is responsible for determining

0 commit comments

Comments
 (0)