diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 187d8b35..00000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,69 +0,0 @@ -# Contributing to Vapor - -👋 Welcome to the Vapor team! We're happy to have you. Check out our -[Code of Conduct](https://github.com/vapor/vapor/blob/main/Docs/code_of_conduct.md) if you haven't already, and -join us on [discord](https://vapor.team) if you run into trouble. - -## Getting Started - -To get started, you will need to open a Terminal and: - -1. Fork this repo and clone it onto your machine. -``` -$ git clone https://github.com//routing-kit -``` -2. Make some changes. A good place to start if you're looking for ideas are the open -[issues](https://github.com/vapor/routing-kit/issues). If nothing looks good to you, but you still want -to help, ask around in the [Discord](https://vapor.team) - -2.5. Some macOS folks find it easier to do development with Xcode. Xcode projects aren't checked into -github, but if you'd like to generate one, run `vapor xcode` in the project directory and answer the -prompts. - -3. Ensure your tests pass by either running `vapor test` on the command line, or pressing `CMD+U` -within Xcode. - -4. If everything passes, congrats! You've made a successful change 🎉Now you get to open a pull request -(PR) on Github. - - -## Pull Requests - -To open a pull request, go to your fork on Github and select the "New pull request" button. You'll be -directed to a new page where you can compare your changes with the current state of the project. Make -sure you have `vapor/routing-kit` and `base: master` selected on the left and `/routing` -and `compare: master` selected on the right. Below that you'll see the changes you've made. Make sure -you're seeing the changes you expect. - -If everything looks right, select the big green "Create pull request" button. - -You'll be presented with a pull request template with some sections for you to fill in. Once you've -filled out each section and written a title that describes your changes, open your pull request and a -maintainer should be by soon to review it. - -## Reporting Issues - -Go ahead and [open a new issue](https://github.com/vapor/routing-kit/issues/new). The team will be notified -and we should get back to you shortly. - -We give you a few sections to fill out to help us hunt down the issue more effectively. Be sure to fill -everything out to help us get everything fixed up as fast as possible. - -## Maintainers - -- [@twof](https://github.com/twof) - -See the [Vapor maintainers doc](https://github.com/vapor/vapor/blob/main/Docs/maintainers.md) for more information. - -## SemVer - -Vapor follows [SemVer](https://semver.org). This means that any changes to the source code that can cause -existing code to stop compiling _must_ wait until the next major version to be included. - -Code that is only additive and will not break any existing code can be included in the next minor release. - -## Testing - -Once in Xcode, select the `routing-kit-Package` scheme and use `CMD+U` to run the tests. - -— Thanks! 🙌 diff --git a/.github/workflows/projectboard.yml b/.github/workflows/projectboard.yml deleted file mode 100644 index 8c8f4bd9..00000000 --- a/.github/workflows/projectboard.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: issue-to-project-board-workflow -on: - # Trigger when an issue gets labeled or deleted - issues: - types: [reopened, closed, labeled, unlabeled, assigned, unassigned] - -jobs: - update_project_boards: - name: Update project boards - uses: vapor/ci/.github/workflows/update-project-boards-for-issue.yml@main - secrets: inherit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 647e6eac..02c52fc2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,14 +16,14 @@ jobs: upstream-check: runs-on: ubuntu-latest - container: swift:5.8-jammy + container: swift:5.9-jammy steps: - name: Check out self - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: routing-kit - name: Check out Vapor - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: vapor/vapor path: vapor diff --git a/Package.swift b/Package.swift index f17e4b45..4653f721 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.6 +// swift-tools-version:5.7 import PackageDescription let package = Package( diff --git a/README.md b/README.md index 6bc92899..dc6463f6 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,11 @@

-Documentation -Team Chat -MIT License +Documentation +Team Chat +MIT License Continuous Integration -Swift 5.6 + +Swift 5.7 - 5.9


diff --git a/Sources/RoutingKit/TrieRouter.swift b/Sources/RoutingKit/TrieRouter.swift index fa2c30b7..db11056a 100644 --- a/Sources/RoutingKit/TrieRouter.swift +++ b/Sources/RoutingKit/TrieRouter.swift @@ -49,6 +49,8 @@ public final class TrieRouter: Router, CustomStringConvertible { /// - parameters: /// - route: `Route` to register to this router. public func register(_ output: Output, at path: [PathComponent]) { + assert(!path.isEmpty, "Cannot register a route with an empty path.") + // start at the root of the trie branch var current = self.root @@ -66,7 +68,7 @@ public final class TrieRouter: Router, CustomStringConvertible { // if this node already has output, we are overriding a route if current.output != nil { - self.logger.info("[Routing] Overriding route output at: \(path.string)") + self.logger.info("[Routing] Overriding duplicate route for \(path[0]) \(path.dropFirst().string)") } // after iterating over all path components, we can set the output