SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
522 stars 36 forks source link

Redirect Apple documentation urls? #3172

Open finestructure opened 1 week ago

finestructure commented 1 week ago

There are doc links out there beyond the control of the repositories themselves that likely won't be updated. It would be helpful if we could redirect from */apple/{repo}/documentation/* to */swiftlang/{repo}/documentation/*.

EDIT: we could just redirect from /apple/{repo}/* to /swiftlang/{repo}/*. No need to make this documentation specific.

We'd have to do that per repository and coordinate with the move.

We're currently indexing the following Apple/Swiftlang packages that opt into documentation hosting:

https://github.com/apple/swift-algorithms.git https://github.com/apple/swift-argument-parser.git https://github.com/apple/swift-asn1.git https://github.com/apple/swift-async-algorithms.git https://github.com/apple/swift-async-dns-resolver.git https://github.com/apple/swift-atomics.git https://github.com/apple/swift-cassandra-client.git https://github.com/apple/swift-certificates.git https://github.com/apple/swift-cluster-membership.git https://github.com/apple/swift-collections.git https://github.com/apple/swift-distributed-actors.git https://github.com/apple/swift-distributed-tracing-baggage-core.git https://github.com/apple/swift-distributed-tracing.git https://github.com/apple/swift-docc.git https://github.com/apple/swift-docc-plugin.git https://github.com/apple/swift-http-structured-headers.git https://github.com/apple/swift-http-types.git https://github.com/apple/swift-log.git https://github.com/apple/swift-markdown.git https://github.com/apple/swift-metrics-extras.git https://github.com/apple/swift-metrics.git https://github.com/apple/swift-mmio.git https://github.com/apple/swift-nio-extras.git https://github.com/apple/swift-nio.git https://github.com/apple/swift-nio-http2.git https://github.com/apple/swift-nio-ssh.git https://github.com/apple/swift-nio-ssl.git https://github.com/apple/swift-nio-transport-services.git https://github.com/apple/swift-numerics.git https://github.com/apple/swift-openapi-generator.git https://github.com/apple/swift-openapi-runtime.git https://github.com/apple/swift-openapi-urlsession.git https://github.com/apple/swift-playdate-examples.git https://github.com/apple/swift-protobuf.git https://github.com/apple/swift-service-context.git https://github.com/apple/swift-service-discovery.git https://github.com/apple/swift-statsd-client.git https://github.com/apple/swift-system.git https://github.com/apple/swift-testing.git https://github.com/swiftlang/indexstore-db.git https://github.com/swiftlang/sourcekit-lsp.git https://github.com/swiftlang/swift-format.git https://github.com/swiftlang/swiftly.git https://github.com/swiftlang/swift-package-collection-generator.git https://github.com/swiftlang/swift-package-manager.git https://github.com/swiftlang/swift-sdk-generator.git https://github.com/swiftlang/swift-syntax.git https://github.com/swiftlang/swift-tools-support-core.git

finestructure commented 1 week ago

Unless there's an easier way to do this via Cloudflare, we'd need a bigger plan to support this:

CleanShot 2024-06-27 at 09 35 18@2x

(I cut off the bottom part of the form, the rewrite logic was regex_replace(http.request.uri.path, "^/apple/swift-syntax/", "/swiftlang/swift-syntax/").)