Making a New Vapor Package Part 2

Wouldn’t it be nice to be able to test your new Vapor package, locally, before you publish it to GitHub?

For that to work, we need to make a new test Vapor project, and include oir new package locally

// 1.0.0 ..< 2.0.0
.package(url: "/SwiftyJSON", from: "1.0.0")

// 1.5.8 ..< 2.0.0
.package(url: "/SwiftyJSON", .upToNextMajor(from: "1.5.8")),

// 1.5.8
.package(url: "/SwiftyJSON", .exact("1.5.8")),

// Branch and revision.
.package(url: "/SwiftyJSON", .branch("develop")),
.package(url: "/SwiftyJSON", .revision("e74b07278b926c9ec6f9643455ea00d1ce04a021"))

Just a reminder, for this to work, your package must be tagged:

git tag 0.0.0
git push --tags

For example I have a package named VaporSpices in it’s own directory.

I also have a test project MakeVaporCountries in the same hierarchy lever. It is tagged as 0.0.1.

 .package(url: "../VaporSpices", from: "0.0.1")

Prev: Generic Migrations in Vapor Fluent

Next: Parent-Child relationships in Generic Fluent Models

Vapor 3 Tutorial Start

#pub #package #vapor #swift #spm #local