Skip to content

Commit 168652a

Browse files
authored
v0.8 (#4)
1 parent 61d839d commit 168652a

File tree

13 files changed

+340
-259
lines changed

13 files changed

+340
-259
lines changed

.jaaENV

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs=18

README.md

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,50 @@ Your working directory should contain `bs` directory with building
3131
scrips/executables. You can use [`bs`](#bs) utility with auto-find
3232
feature.
3333

34+
### Executing scripts
3435
Now you can run and lists your build options like:
3536
- raw:
3637
- Run command: `bs/build.js some-argument`
37-
- Lists commands: `find bs -type f -executable`
38-
(list help texts `grep -H help bs/.*.toml bs/*/.*.toml`, see below)
38+
- Lists commands: `find bs/** -executable`, `ls bs`, `find bs -type f -executable`, …
39+
- create folder: `mkdir bs`, `mkdir -p bs`, `touch README.md`, …
40+
- (optional, [see below](#configinfo-files-using-readmemd)) list commands with commnets: `cat bs/README.md`, `bat bs/README.md`, …
3941
- using `bs`:
4042
- Run command: `bs build some-argument`
4143
- Lists commands: `bs .ls`
44+
- create folder: `bs .mkdir`
45+
- Cat README: `bs .cat`
46+
47+
### Organizing scripts
48+
There are no rules, *it is all up to you*. But definitely
49+
we can put together some *suggestions* to work with bs more
50+
**happily**.
51+
52+
1. prefers **short names** without unnecessary
53+
special characters (spaces, brackets, …)
54+
1. *provide* `--help` options for your scripts
55+
1. *use subdirectories* for subtasks
56+
1. *use dots* in names for non-scripts (like `.config.js`,
57+
`.common.js`, `.utils.js`, …)
58+
1. provide `README.md` to comment your build scripts
4259

60+
```
61+
bs/
62+
├───build.js
63+
├───build/
64+
│ ├───html.js
65+
│ └───sass.js
66+
├───run.js
67+
├───publish.js
68+
├───.config.js
69+
└───README.md
70+
```
71+
72+
PS: You can create alias for task with:
73+
```bash
74+
ln -rfs bs/target bs/alias
75+
```
76+
77+
### Build flows
4378
Now focus on creating building flows. For parallel tasts, you can
4479
use this pattern:
4580
```bash
@@ -68,13 +103,6 @@ set -eou pipefail
68103
cat src/*.js | manipulate > index.js
69104
```
70105

71-
You can create alias for task with:
72-
```bash
73-
ln -rfs bs/target bs/alias
74-
# optionaly
75-
ln -rfs bs/.target.toml bs/.alias.toml
76-
```
77-
78106
## `bs`
79107
This is just a simple helper providing nice outputs
80108
and make some operations easier.
@@ -86,31 +114,15 @@ You can find binaries on [Release](https://github.com/jaandrle/bs/releases/lates
86114

87115
Or use: `npm install https://github.com/jaandrle/bs --location=global`
88116

89-
### Config/Info files
90-
You can create `.command.toml` file to describe `command`
91-
and add additional configuration. Example:
92-
```
93-
buld.sh
94-
.build.toml
95-
```
96-
```toml
97-
#.build.toml
98-
info= "Description of command"
99-
default= true
100-
101-
[completions]
102-
__all= [ "--help", "--version" ]
103-
cmd= []
104-
```
105-
…all is optional. But:
106-
- `info`: this text is listed aside of command name (e.g. `bs .ls`)
107-
- `default`: this changes behavior of plain `bs`. By default it runs `.ls`, now it runs marked command
108-
- `completions`: provide options for completions `bs .run build …`/`bs build …`
109-
- `__all`: these options are listed for all sub-commands
110-
- `cmd`: registers sub-command and its possible arguments (`bs .run build cmd …`)
117+
### ~Config/Info files~ Using README.md
118+
[This feature](https://github.com/jaandrle/bs/blob/adfbe3dc419b3189a1f9661d308c293b1e3b0514/README.md#configinfo-files) has been removed in version 0.8.
119+
It seems to be better to use `bs/README.md` for comment your build scripts.
120+
See example for current project [`bs/README.md`](./bs/README.md).
121+
122+
You can than use `cat bs/README.md` to get quick overview of available commands.
111123

112124
### `bs` synopsis
113-
See [bs.js (line ≥24)](./bs.js#L24).
125+
See [bs.js (line ≥31)](./bs.js#L31).
114126

115127
### `bs` completions
116128
To allow completions just add `eval "$(bs .completion bash)"` to your `.bashrc`.
@@ -119,12 +131,8 @@ To allow completions just add `eval "$(bs .completion bash)"` to your `.bashrc`.
119131
You can use [Git - Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to share your build scrips across your projects.
120132

121133
## WIP
122-
- [x] provide `bs` binary
123-
- [ ] some missing? commands in `bs` (maybe `.init`)
124-
- [x] docs for `.command.toml` (`bs` completion)
125-
- [x] docs for git submodules to share build scripts
134+
- [ ] provide `bs` via npm
126135
- [ ] docs for coexistence with others (such as `npm run`)
127-
- [x] examples how to use bash for parallel/serial execution
128136

129137
## Acknowledgments
130138
- [labaneilers/bs: The simplest possible build system using bash](https://github.com/labaneilers/bs)

0 commit comments

Comments
 (0)