Skip to content

Commit 5c6d637

Browse files
Merge pull request #48 from yassinebenaid/dev
Improve documentation
2 parents 807f2d2 + a530e43 commit 5c6d637

File tree

7 files changed

+111
-181
lines changed

7 files changed

+111
-181
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img width="200" src="./docs/public/logo.png"/>
33

44
# Bunster
5-
5+
66
</div>
77

88
<div align="center">
@@ -15,32 +15,32 @@
1515

1616
Have you ever wished your shell scripts could be faster, more portable, and secure ? **Bunster** brings this to life by transforming your shell scripts into efficient, standalone binaries that are easy to distribute and deploy across platforms _(only unix is supported at the moment)_.
1717

18-
Unlike other tools, **Bunster** doesn’t just wrap your scripts in a binary—it compiles them down to efficient native machine code, leveraging the powerful Go toolchain. This ensures performance, portability, and robustness, making **Bunster** a unique solution for modern developers.
18+
Unlike other tools, **Bunster** doesn’t just wrap your scripts in a binary—it compiles them down to efficient native machine code, leveraging the powerful Go toolchain. This ensures performance, portability, and robustness.
1919

2020
Technically speaking, **Bunster** is not a complete compiler, But rather a **Transplier** that generates **GO** code out of your scripts. Then, opionally uses the **Go Toolchain** to compile the code to an executable program.
2121

22-
**Bunster** targets `bash` scripts in particular. The current syntax and features are all inherited from `bash`. other shells support will be added soon.
22+
**Bunster** targets `bash` scripts in particular. The current syntax and features are all inherited from `bash`. other shells support will be added soon.
2323

2424
### Motivation
2525
- **Different Shells support**: Bunster currently aims to be compatible `Bash` as a starting move. then other popular shells in future.
2626
- **Security**: as you may guess, humans cannot read machine code, so why not to compile your scripts to such format.
2727
- **Modules**: something shell scripts lack is a module system, people want to share their code to be used by others, but the infrastructure doesn't allow them. Well, **Bunster** introduces a module system that allow you to publish your scripts as a modules consumed by other users.
28-
- **Performance**: the shell (including bash, zsh ...etc) rely on forking to run your scripts, this means, if you have a script of 3 commands, the shell will have to fork it self 3 times to run each command. This allows the shell to play with file descriptors and other resouces freely. But adds a lot of performance overhead. **Bunster** runs your entire scripts in a single process. and uses [goroutines](https://go.dev/tour/concurrency/1) for background commands. **Bunster** even has its own file descripor system managed by it's runtime. this means less syscalls, thus, better performance.
28+
- **Performance**: the shell (including bash, zsh ...etc) rely on forking to run your scripts, this means, if you have a script of 3 commands, the shell will have to fork it self 3 times to run each command. This allows the shell to play with file descriptors and other resouces freely. But adds a lot of performance overhead. **Bunster** runs your entire scripts in a single process. and uses [goroutines](https://go.dev/tour/concurrency/1) for background commands. **Bunster** even has its own file descripor system managed by it's runtime. this means less syscalls, thus, better performance.
2929

30-
> [!WARNING]
30+
> [!WARNING]
3131
> This project is in its early phase of development and is not yet ready for production. Not all features are implemented yet. But, plenty of them are already working. such as simple command invokation, redirections, environment variables and more.
3232
3333
### Versionning
34-
**Bunster** follows [SemVer](https://semver.org/) system for release versionning. On each `v0.x.0` release, You would expect adding support for new features (can be new shell feature, improvement in the build process, some custom features ...etc.) . On each `v0.N.x` release, you would expect bug fixes and documentation enhancments.
34+
**Bunster** follows [SemVer](https://semver.org/) system for release versionning. On each `v0.x.0` release, You would expect adding support for new features (can be new shell feature, improvement in the build process, some custom features ...etc.) . On each `v0.N.x` release, you would expect bug fixes and documentation enhancments.
3535

36-
Once we reach the `v1.0.0`, you must expect a +90% of compatibility with `bash`. A module system, a [static assets embedding capabilities](https://pkg.go.dev/embed) and a plenty of other features to make `shell` scripts feel like any other modern programming language.
36+
Once we reach the `v1.0.0`, you must expect a +90% of compatibility with `bash`. A module system, a [static assets embedding capabilities](https://pkg.go.dev/embed) and a plenty of other features to make `shell` scripts feel like any other modern programming language.
3737

3838
Adding support for additional shells is not planned until our first stable release `v1`. All regarding contributions will remain open until then.
3939

4040
### Installation
41-
Checkout the [documentation](https://bunster.netlify.app) for different ways of installation.
41+
Checkout the [documentation](https://bunster.netlify.app) for different ways of installation.
4242

43-
### Contributing
43+
### Contributing
4444
Thank you for considering contributing to the **Bunster** project! The contribution guide can be found in the [documentation](https://bunster.netlify.app).
4545

4646
### Code Of Conduct
@@ -53,4 +53,3 @@ Plase check out our [Security Policy](https://github.com/yassinebenaid/bunster/t
5353

5454
### Licence
5555
The Bunster project is open-sourced software licensed under the [GPL3.0 license](https://www.gnu.org/licenses/gpl-3.0.en.html).
56-

docs/.vitepress/config.mts

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,36 @@ import { defineConfig } from "vitepress";
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
5-
title: "Bunster",
6-
description:
7-
"Compile shell scripts to native self-contained executable programs",
8-
themeConfig: {
9-
// https://vitepress.dev/reference/default-theme-config
10-
nav: [
11-
{ text: "Home", link: "/" },
12-
{ text: "Examples", link: "/markdown-examples" },
13-
],
5+
title: "Bunster",
6+
description:
7+
"Compile shell scripts to native self-contained executable programs",
8+
themeConfig: {
9+
// https://vitepress.dev/reference/default-theme-config
10+
nav: [
11+
{ text: "Documentation", link: "/quick-start" },
12+
{ text: "Installation", link: "/installation" },
13+
],
1414

15-
sidebar: [
16-
{
17-
text: "Examples",
18-
items: [
19-
{ text: "Markdown Examples", link: "/markdown-examples" },
20-
{ text: "Runtime API Examples", link: "/api-examples" },
21-
],
22-
},
23-
],
15+
sidebar: [
16+
{
17+
items: [
18+
{ text: "Quick Start", link: "/quick-start" },
19+
{ text: "Installation", link: "/installation" },
20+
],
21+
},
22+
],
2423

25-
socialLinks: [
26-
{ icon: "github", link: "https://github.com/yassinebenaid/bunster" },
27-
],
28-
},
29-
head: [
30-
["link", { rel: "manifest", href: "/site.webmanifest" }],
31-
["link", { rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
32-
],
24+
socialLinks: [
25+
{ icon: "github", link: "https://github.com/yassinebenaid/bunster" },
26+
],
27+
28+
footer: {
29+
message: "Released under the GPLv3 License.",
30+
copyright: "Copyright © 2024-present Yassine Benaid",
31+
},
32+
},
33+
head: [
34+
["link", { rel: "manifest", href: "/site.webmanifest" }],
35+
["link", { rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
36+
],
3337
});

docs/api-examples.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ hero:
1111
alt: Bunster
1212
actions:
1313
- theme: brand
14-
text: Markdown Examples
15-
link: /markdown-examples
14+
text: Installation
15+
link: /installation
1616
- theme: alt
17-
text: API Examples
18-
link: /api-examples
19-
17+
text: Documentation
18+
link: /quick-start
2019
features:
21-
- title: Feature A
22-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
23-
- title: Feature B
24-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
25-
- title: Feature C
26-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20+
- title: Native Program Generation
21+
details: |
22+
Scripts compiled with Bunster are not just wrappers around your script, nor do they rely on any external shell on your system.
23+
- title: Wite Once, Run Everywhere
24+
details: Bunster offers static linking. Your scripts are compiled to a statically linked binary that runs on every machine.
25+
- title: Module System
26+
details: Bunsters's module system makes it easy to shares your scripts as a versioned modules to be used by others.
2727
---

docs/installation.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Installation
2+
3+
By default, **Bunster** is an independent utility that you can install and start using right away. However,
4+
**Bunster** does assume that you have [the Go toolchain](https://go.dev/dl) installed and accessbile in `PATH`.
5+
6+
We rely on [gofmt](https://pkg.go.dev/cmd/gofmt) provided by the [the Go toolchain](https://go.dev/dl) to format the generated
7+
code. This makes it easy to debug and/or to learn from. Additionally, We use [the Go compiler](https://go.dev/dl) to compile
8+
the code and generate the executable for you.
9+
10+
::: info
11+
The absence of [the Go toolchain](https://go.dev/dl) does not affect the working of **Bunster**. It's still going to work just fine.
12+
If you only care about the generated Go code, and don't want **Bunster** to automatically compile the exectuable for you.
13+
That is totally fine and you can go for it.
14+
:::
15+
16+
17+
## Docker Image
18+
The easiest way to get **Bunster** is through our official [Docker Image](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-an-image/).
19+
It comes with everything needed. Including the **Bunster** compiler and [the Go toolchain](https://go.dev/dl).
20+
21+
```shell
22+
docker pull ghcr.io/yassinebenaid/bunster:latest
23+
```
24+
25+
Or, if you want a specific version (v.0.3.0 for example):
26+
27+
```shell
28+
docker pull ghcr.io/yassinebenaid/bunster:v0.3.0
29+
```
30+
31+
## Using Go
32+
If you already have [the Go toolchain](https://go.dev/dl) installed. You can use the `go install` command to get **Bunster** on your machine.
33+
34+
```shell
35+
go install github.com/yassinebenaid/bunster@latest
36+
```
37+
38+
Or, if you want a specific version (v.0.3.0 for example):
39+
40+
```shell
41+
go install github.com/yassinebenaid/[email protected]
42+
```
43+
44+
::: info
45+
If you choose to install using `go install`. make sure that `$HOME/go/bin` is added to your `PATH`. If not yet, Please add
46+
`export PATH=$PATH:$HOME/go/bin` to one of your profile files. eg. *`~/.bashrc` if you're using `bash`, or `~/.zshrc` if you're using `zsh`*.
47+
:::

docs/markdown-examples.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

docs/quick-start.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Quick Start
2+
3+
Have you ever wished your shell scripts could be faster, more portable, and secure ?
4+
**Bunster** brings this to life by transforming your shell scripts into efficient,
5+
standalone binaries that are easy to distribute and deploy across platforms _(only unix is supported at the moment)_.
6+
7+
Unlike other tools, **Bunster** doesn’t just wrap your scripts in a binary—it compiles them down to efficient native machine code,
8+
leveraging the powerful Go toolchain. This ensures performance, portability, and robustness.
9+
10+
Technically speaking, **Bunster** is not a complete compiler, But rather a **Transplier** that generates **GO** code out of your scripts.
11+
Then, opionally uses the **Go Toolchain** to compile the code to an executable program.
12+
13+
**Bunster** targets `bash` scripts in particular. The current syntax and features are all inherited from `bash`.
14+
other shells support will be added soon.

0 commit comments

Comments
 (0)