Add first fuller pass of README.

pull/9/head
Joshua Potter 2023-11-25 12:43:41 -07:00
parent cb8b16a767
commit ef2bb9cc1f
1 changed files with 67 additions and 21 deletions

View File

@ -1,40 +1,86 @@
# bootstrap # bootstrap
CLI utility for defining custom project initialization scripts.
TODO: TODO:
- [ ] Add documentation throughout (ownership, docstrings, etc.).
- [ ] Add evaluator tests. - [ ] Add evaluator tests.
- [ ] Color output to console. - [ ] Color output to console.
CLI utility for initializing projects in reproducible ways.
## Overview ## Overview
Within the `specs` directory exists so-called *specs*. A spec is a directory `bootstrap` is a tool for quickly defining your own init-like scripts. If you
containing an optional `spec.json` file and a `run.sh` file. The former is are familiar with tools like
configured like so:
```spec.json * `npm init`
* `nix flake init`
* `django-admin startproject`
* `mix phx.new`
* etc.
this project will feel at home. Ultimately the goal is to create (optionally)
interactive scripts like those mentioned in the above list to quickly scaffold
your new projects in a consistent way.
We start with an example. Consider the following *spec*, which we'll name
`example`:
```json
{ {
versions: [...] "filename": {
"type": "STRING",
"prompt": "What file should I create for you?"
}
} }
``` ```
and its associated *builder*:
```bash
#!/usr/bin/env bash
The keys of this top-level JSON object correspond to the parameters that are echo "Creating $FILENAME"
prompted by the `bootstrap init` curses interface. The value is used to touch "$OUT/$FILENAME"
determine what kind of prompt `bootstrap` provides for the given question. ```
Possible value types include:
* `[...]` (list) Running `bootstrap` with these two files configured will invoke the following
* This indicates a select option prompt. The user chooses amongst the values interactive script:
specified in the JSON list. ```bash
> bootstrap example
What file should I create for you? hello-world.txt
Creating hello-world.txt
Once all prompts are evaluated, the keys of the object are converted into >
uppercase environment variables and passed to the `run.sh` file relative to the ```
current directory. You should now see a new `hello-world.txt` file in the current directory.
## Usage
TODO
### Installation
TODO
### Specs and Builders
TODO
### Other Environment Variables
TODO
### Supplied Specs
TODO
### Using With Nix
TODO
## Development ## Development
This template includes an `.envrc` file for use with [direnv](https://direnv.net/). TODO
### Documentation
TODO
### Formatting ### Formatting
@ -45,5 +91,5 @@ Run the following to configure `git` to use it:
git config --local core.hooksPath .githooks/ git config --local core.hooksPath .githooks/
``` ```
If running [direnv](https://direnv.net/), this is done automatically provided If running [direnv](https://direnv.net/), this is done automatically if `git` is
`git` is installed and a repository is initialized. installed.