DEV Community

Cover image for Creating Command Line Tool using swift package manager
Japneet Singh
Japneet Singh

Posted on

1

Creating Command Line Tool using swift package manager

Introduction to SPM

The release tool used in swift programming is a swift package manager Package Manager
The Swift Package Manager is a tool for controlling Swift code distribution. It works with the Swift build system to automate the download, compilation, and linking of dependencies.
-The Package Manager is included in Swift 3.0 and above.-

$ swift package init --type executable
Enter fullscreen mode Exit fullscreen mode

Release version to command-line-Tool

You'll want to install your command-line utility after you've finished developing it. This can be accomplished by using the release configuration while building. Within the.build/release folder, an executable will be created. We need to copy it into the /usr/local/bin folder before we can utilise it.

$ swift build --configuration release
$ cp -f .build/release/banner /usr/local/bin/banner
Enter fullscreen mode Exit fullscreen mode

Image description

Using Git Tags

Image description

git tag  -a v1.1 -m "ModernSSG version"
Enter fullscreen mode Exit fullscreen mode

User Testing

Well, I partenered with ritik bheda, he made his project in node.js. Testing with node.js is simpler and easier task. I tested the project and we didn't run into any error. It was very well communicated with other members to test project build in their language.

How to use and run my swift project

$ swift build
$ swift run
Enter fullscreen mode Exit fullscreen mode

or
Double click the ModernSSG executable file to run the project.

Image description

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay