sveltin

command module
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README ΒΆ

sveltin logo

The Smartest Way to Create SvelteKit powered static websites.

Homepage | Release Notes | Quick Start | Documentation | Contributing

license Β  go report card Β  go reference Β  sveltin cli version Β  CI Β  made with svelte shield

Sveltin

Sveltin is a CLI (Command Line Interface) created to boost the developers productivity working on SvelteKit v1.x.x powered static websites.

β„Ή SvelteKit versions

Latest tested SvelteKit version is 1.8.3. SvelteKit reached v1.x.x then no more breakings are expected until a new major release. Although we decided to stay sticked to the tested version, you should be able to upgrade SvelteKit to the upcoming minor versions without disruptions

πŸ“£ Overview

Sveltin is a simple, quick and powerful CLI to:

  • Scaffold SvelteKit powered websites
  • Generate resources, libs and endpoints
  • Add content to the resources
  • Generate menu structure, sitemap and rss
  • Make your site SEO Ready (Metadata, Json-LD, OpenGraph) in a easy way

Sveltin provides:

  • Out-of-the-box support for vanilla CSS, Sass/SCSS, Tailwind CSS, Bulma and Bootstrap
  • Ready to use Svelte components

πŸš€ Quick Start

With few commands Sveltin flex the muscles πŸ’ͺ

NOTE: each command can be executed in interactive way so do not need to pass arguments and flags to it.

# Create a project with TailwindCSS support
sveltin init myBlog --css tailwindcss

# Move to the project folder
cd myBlog

# Install all the dependencies
sveltin install

# Create a public page and compose it with Svelte
# (http://localhost:5173/contact)
sveltin new page contact --svelte

# Create a public page and compose it with Markdown
# (http://localhost:5173/about)
sveltin new page about --markdown

# Create a 'posts' resource
sveltin new resource posts

# Add new content to the posts resource
# (http://localhost:5173/posts/getting-started)
sveltin add content getting-started --to posts

# Add a 'category' metadata
# (http://localhost:5173/posts/category)
sveltin add metadata category --to posts --as single

# Run the server
sveltin server

πŸ“– Documentation

Please see the documentation for more information about Sveltin.

πŸ’» Installation

πŸ”§ Prerequisites
  • Git
  • Node (v16.9.0 or higher is required)
OSX and Linux via Homebrew

Homebrew will also install Git and Node.

# Tap a new formula:
brew tap sveltinio/sveltin

# Install:
brew install sveltin
Windows via Scoop
# Tap a new bucket:
scoop bucket add sveltinio https://github.com/sveltinio/scoop-sveltin.git

# Install:
scoop install sveltinio/sveltin
Go Install

Installation is done by using the go install command. In this case, ensure to have Go (v1.17 or higher) installed on your machine:

go install github.com/sveltinio/sveltin@latest
Manually

You can download the pre-compiled binary for you specific OS from the releases page. You will need to copy the and extract the binary, then move it to your local bin folder. Please, refer to the example below:

curl https://github.com/sveltinio/sveltin/releases/download/${VERSION}/${PACKAGE_NAME} -o ${PACKAGE_NAME}
sudo tar -xvf ${PACKAGE_NAME} -C /usr/local/bin/
sudo chmod +x /usr/local/bin/sveltin

βš™ CLI Commands & Options

sveltin comes with a set of commands and subcommands to help dealing with your SvelteKit project.

Each command can be executed with inline arguments or interactivly.

$ sveltin -h

sveltin is the main command to work with SvelteKit powered static website.

Usage:
  sveltin [command]

Available Commands:
  add         Add content and metadata to a resource
  build       Builds a production version of your static website
  completion  Generate the autocompletion script for the specified shell
  deploy      Deploy the website over FTP
  generate    Generate static files (sitemap, rss, menu)
  help        Help about any command
  init        Initialize a new sveltin project
  install     Install the project dependencies
  migrate     Migrate existing sveltin project files to the latest sveltin version ones
  new         Create nee resources, pages and themes
  preview     Preview the production version locally
  server      Run the development server
  update      Update your project dependencies

Flags:
  -h, --help      help for sveltin
  -v, --version   version for sveltin

Use "sveltin [command] --help" for more information about a command.
sveltin init

sveltin init is the main command to scaffold a project.

Alias: create

Read more here.

sveltin new

sveltin new is the main command to generate pages, resources (routes) and themes for your project.

Alias: n

(Click to expand the list of available subcommands)
Subcommand Aliases Description
new-page p Command to create a new public page.
new-resource r Command to create a new resource.

Read more here.

sveltin add

sveltin add is the main command to add content and metadata to existing resources.

Alias: a

(Click to expand the list of available subcommands)
Subcommand Aliases Description
add-content c Command to create a new content for existing resource.
add-metadata m Command to add a new metadata to your content as a Sveltekit resource.

Read more here.

sveltin generate

sveltin generate is used to generate static files like sitemap, menu structure or rss feed file.

Alias: g

(Click to expand the list of avilable subcommands)
Subcommand Description
generate-menu Generate the menu config file.
generate-sitemap Generate a sitemap.xml.
generate-rss Generate a rss.xml file.

Read more here.

sveltin install

sveltin install is used to initialize the Sveltin project getting all depencencies from the package.json file.

Alias: i

Read more here.

sveltin update

sveltin update is used to update all depencencies from the package.json file.

Read more here.

sveltin migrate

sveltin migrate is used to migrate existing sveltin project files to the latest Sveltin version ones.

Read more here.

sveltin server

sveltin server is used to run the VITE server. It wraps svelte-kit defined commands to run the server.

Alias: s, serve, run, dev

Read more here.

sveltin build

sveltin build is used to build a production version of your static website. It wraps sveltekit-build command.

Alias: b

Read more here.

sveltin preview

sveltin preview is used to run a preview for the production version locally.

Read more here.

sveltin deploy

sveltin deploy is used to deploy your website over FTP on your hosting platform.

Read more here.

sveltin completion

sveltin completion generates the autocompletion script for the specified shell (bash|zsh|fish|powershell).

Read more here.

πŸ’‘ Contributing

Contribution of any kind including documentation, themes, tutorials, blog posts, bug reports, issues, feature requests, feature implementations, pull requests are more than welcome.

Read more here.

Dependencies

Sveltin leverages many great open source libraries:

Name Version License
bubble 0.15.0 MIT
bubbletea 0.23.2 MIT
lipgloss 0.6.0 MIT
validator 10.11.2 MIT
slug 1.13.1 MPL-2.0
ftp 0.1.0 ISC
is 1.4.0 MIT
afero 1.9.3 Apache-2.0
cobra 1.6.1 Apache-2.0
viper 1.15.0 MIT
prompti 0.1.2 MIT
gjson 1.14.4 MIT
sjson 1.2.5 MIT
text 0.7.0 BSD-3-Clause

πŸ†“ License

Sveltin is free and open-source software licensed under the Apache 2.0 License.

Documentation ΒΆ

Overview ΒΆ

Copyright Β© 2021 Mirco Veltri <github@mircoveltri.me>

Use of this source code is governed by Apache 2.0 license that can be found in the LICENSE file.

Directories ΒΆ

Path Synopsis
Package cmd contains all the commands and subcommands for sveltin.
Package cmd contains all the commands and subcommands for sveltin.
Package common contains utility functions for collections, maps and filesystem.
Package common contains utility functions for collections, maps and filesystem.
Package config contains structs and interfaces used to map sveltin artifact to configurations.
Package config contains structs and interfaces used to map sveltin artifact to configurations.
Package helpers contains helper functions used across commands.
Package helpers contains helper functions used across commands.
factory
Package factory ...
Package factory ...
internal
builder
Package builder implements the Builder design pattern used to generate all sveltin's artifacts (project, page, metadata, etc.)
Package builder implements the Builder design pattern used to generate all sveltin's artifacts (project, page, metadata, etc.)
composer
Package composer implements the Composite design pattern used to manage files and folder structure for sveltin projects and artifacts.
Package composer implements the Composite design pattern used to manage files and folder structure for sveltin projects and artifacts.
css
Package css implements the Template Method design pattern to allow the project setup based on the selected CSSLib.
Package css implements the Template Method design pattern to allow the project setup based on the selected CSSLib.
errors
Package sveltinerr contains all the utility functions to map errors in Sveltin.
Package sveltinerr contains all the utility functions to map errors in Sveltin.
fsm
Package fsm ...
Package fsm ...
ftpfs
Package ftpfs handle connections and operations to deal with an FTP server.
Package ftpfs handle connections and operations to deal with an FTP server.
markup
Package markup defines styles and colors used to print messages on the shell as if they were HTML tags.
Package markup defines styles and colors used to print messages on the shell as if they were HTML tags.
migrations
Package migrations implements the Mediator design pattern used to manage migrations over sveltin versions.
Package migrations implements the Mediator design pattern used to manage migrations over sveltin versions.
npmc
Package npmc defines the parser, the writer and utility functions for the package.json file.
Package npmc defines the parser, the writer and utility functions for the package.json file.
pathmaker
Package pathmaker defines utility functions used to navigate through the project structure.
Package pathmaker defines utility functions used to navigate through the project structure.
shell
Package shell defines OS level ways to interact with node package managers and git command.
Package shell defines OS level ways to interact with node package managers and git command.
tpltypes
Package tpltypes defines structs used to define data shared with template files.
Package tpltypes defines structs used to define data shared with template files.
Package resources provides access to files embedded in the running Sveltin program.
Package resources provides access to files embedded in the running Sveltin program.
tui
Package utils contains utility function for errors, node package manager, text, progressbar, github.
Package utils contains utility function for errors, node package manager, text, progressbar, github.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL