You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of this move, knocking some stuff out, like:
- Moving to ESM
- Adding file extensions to all local imports
- Emitting TypeScript types
- Dropping some dependencies
- Upgrading all dependencies to latest
- Better build step that tests node, os, and arch matrix
- Upgrading minimum supported node version
- Running typescript, ts, esm, and es6 blocks with bun
- Adding more tests
- Running tests on both node and bun runtimes
- Checking if CLI runs across node, tsx, bun, and native
- Adding standardized output for file and command names
- Pass-through exit code for a failed command
- Fixing bug with repeated arg names
- Adding support for passing the FORCE_INTERACTIVE env var
- Using single log file with timestamps instead of timestamped file name
- Using inspect instead of JSON stringify when logging
- Logging trimmed command script content when running
- Using minimist directly instead of yargs
- Suggesting commands that have any word that matches user input
- Allowing run logs to be silenced
- Adding proper file extensions for all supported languages
- Removing the need for chmod
- Adding a custom-built inquirer plugin for searchable lists
- Changes to log output, including suggestions
Copy file name to clipboardExpand all lines: DEVELOPERS.md
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,32 @@ This document is for developers working on the runbook application *itself*. If
8
8
>
9
9
> [](https://codespaces.new/khalidx/runbook?quickstart=1)
10
10
11
-
To run without building first, use:
11
+
First, install dependencies:
12
12
13
-
```bash "runbook ls"
14
-
npx ts-node src/cli.ts ls # or any other runbook command
13
+
```bash "install dependencies"
14
+
npm install
15
+
```
16
+
17
+
To run without building first, you can use `bun`:
18
+
19
+
```bash "install bun globally"
20
+
npm install -g bun
21
+
```
22
+
23
+
```bash "runbook ls with bun"
24
+
bun run src/cli.ts -- ls # or any other runbook command
25
+
```
26
+
27
+
Or, you can use `tsx`:
28
+
29
+
```bash "runbook ls with tsx"
30
+
npx tsx src/cli.ts ls # or any other runbook command
15
31
```
16
32
17
33
To quickly test while developing this package, run:
18
34
19
35
```bash "runbook run hello"
20
-
npx ts-node src/cli.ts run hello --greeting Hey --name Batman
36
+
bun run src/cli.ts -- run hello --greeting Hey --name Batman
21
37
```
22
38
23
39
Alternatively, the package can be linked and run with the `DEV=true` environment variable to pick up the latest TypeScript source changes without the need to re-link the package.
@@ -27,6 +43,14 @@ npm link
27
43
DEV=true runbook run hello --greeting Hey --name Batman
28
44
```
29
45
46
+
When linked, you can use `runbook` and the shorter `r` commands right in the CLI, just like if you had installed the command globally via `npm`.
47
+
48
+
To build:
49
+
50
+
```bash "build"
51
+
npm run build
52
+
```
53
+
30
54
Here's some fun - using runbook to run runbook to run the raw TypeScript version of runbook to run the "hello" command.
31
55
32
56
```bash "runbook inception"
@@ -42,5 +66,9 @@ npm run test
42
66
Here is a command that always fails (useful for seeing how runbook handles errors):
43
67
44
68
```bash "this will fail"
45
-
exit 1
69
+
runbook run this will fail --exitCode 1
70
+
```
71
+
72
+
```bash hbs "this will fail"
73
+
echo'Failing with {{exitCode}}'&&exit {{exitCode}}
0 commit comments