Smallweb 0.17

by Achille Lacoin

3 min read

This release is a smaller one, but I still managed to pack a few new features in it.

This release address one of the hardest problem I had to deal with in smallweb: how to handle secrets, and store them securely at rest.

I'm especially interested in feedbacks for this one, as it's a feature that I'm not sure I got right on the first try.

smallweb secrets: Encrypted secrets with sops

Smallweb will automatically decrypt sops-encoded secrets.enc.env files either stored in:

  • the app dir (for app-scoped secrets)
  • the $SMALLWEB_DIR/.smallweb dir (for global secrets)

These encrypted secrets can be pushed directly to a public git repository, or to smallweb cloud in the future.

This feature uses SOPS behind the scene. Compared to other solutions, it has the advantage of being able to encrypt secrets with multiple keys, so that you can share them with your team.

A guide on how to use this new command is available at https://www.smallweb.run/docs/guides/secrets.html.

Thanks to Taras Glek for suggesting the feature, and providing me feedbacks on early drafts.

smallweb doctor

In order to check that your smallweb install is working, just run smallweb doctor.

$ smallweb doctor
🔍 Checking smallweb directory...
✅ Smallweb directory found

🔍 Checking Deno version...
✅ Deno version is compatible (2.1.1)

🎉 smallweb is healthy

--template flag for list and log commands

You can now create your own template using the --template flag

$ smallweb log --template '{{ .Request.Method }} {{ .Requ
est.Url }} {{ .Response.Status }}'
GET https://www.localhost/ 200
GET https://www.localhost/assets/app.FvvarCLS.js 200
GET https://www.localhost/assets/chunks/theme.DAOtfCYV.js 200
GET https://www.localhost/assets/style.gMeAzLwq.css 200
GET https://www.localhost/assets/index.md.BM4AUtaZ.lean.js 200
GET https://www.localhost/assets/inter-roman-latin.Di8DUHzh.woff2 200
GET https://www.localhost/vp-icons.css 200
GET https://www.localhost/assets/chunks/framework.BQmytedh.js 200
GET https://www.localhost/icon-light.svg 200
GET https://www.localhost/icon-dark.svg 200
GET https://www.localhost/assets/examples.md.oLWm130a.js 200
GET https://www.localhost/assets/docs_getting-started.md.BgJJyCSu.js 200

Use smallweb log --template '{{ json . }}' to discover the available fields

Built-in support for Static Site Generators

If your app contains no main.[js,ts,jsx,tsx] file at the root, and a dist/index.html file, smallweb will statically serve the content of the dist folder.

This allows smallweb to play well with most Static Site Generators, such as Vite.

If your SSG uses another folder than dist, you can specify it in the smallweb.json file:

{
    // ex: lume use the "_site" folder by default
    "root": "_site",
}

Completions support for nushell, elvish, and others

Smallweb now has an hidden _carapace command that can be used to generate completions for your hipster shell.

It's based on the carapace library, checkout the docs for more information.

Alpha release of the vscode integration

You can help test out an alpha version of the vscode integration: https://jsr.io/@smallweb/vscode

import { VSCode } from "jsr:@smallweb/[email protected]"

const vscode = new VSCode()

export default vscode;

Paired with the admin apps API, it allows you to edit your whole smallweb dir from smallweb!

What's next

Youtube channel

I intend to start a youtube channel to provide more in-depth tutorials on how to use smallweb.

VSCode integration

There a still a lot of feature to add to the vscode integration, such as:

  • support for quick open
  • support for search
  • syncing extensions between devices

Smallweb Cloud

The secrets encryption was a necessary step for the upcoming Smallweb Cloud.

If you are interested in testing it out, please add your email to the waiting list.