1
Fork 0

Add the beginnings of documentation.

This commit is contained in:
Bauke 2023-06-16 11:03:39 +02:00
parent df0433c0c7
commit 34309d4358
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
3 changed files with 129 additions and 0 deletions

101
DEVELOPMENT.md Normal file
View File

@ -0,0 +1,101 @@
# Development Guide
## Prerequisites
### Nix + Direnv
If you have [Nix](https://nixos.org/) with flakes enabled and [Direnv](https://direnv.net/) installed, all you need to do is `direnv allow` the directory and all the prerequisites will be automatically installed. This may take a moment on first load.
Firefox and git are excluded, which are assumed to already be present on your system.
### Manual
To build and develop Tildes Shepherd you will need:
* [git](https://git-scm.com)
* [NodeJS](https://nodejs.org) (recommended 18.16.0)
* [pnpm](https://pnpm.io) (recommended 8.6.0)
* [cargo-make](https://sagiegurari.github.io/cargo-make/)
* [Firefox](https://mozilla.org/firefox) (recommended at least 102.0)
## cargo-make
All the different tasks we'd want to do are setup in `Makefile.toml` to be used with `cargo-make` (or the `makers` alias).
In the Tasks section below you can find a list of all the tasks, or you can look at the Makefile itself, where all the tasks have a description of what they do.
### Environment
Two important environment variables are `BROWSER` and `NODE_ENV`.
`BROWSER` dictates what browser should be targeted, by default `BROWSER="firefox"`. To target Chromium set `BROWSER="chromium"`.
`NODE_ENV` dictates minifying and optimization found in `source/build.ts`, by default `NODE_ENV="development"` which does no minifying and includes sourcemaps in the build. Setting `NODE_ENV="production"` will minify and exclude sourcemaps.
### Tasks
<details>
<summary>Click to view all tasks</summary>
* The most common scenario will likely be that you want a live-reloading browser instance, this can be done using the `dev` task.
```sh
# If makers doesn't work, replace it with cargo-make.
makers dev
# To change the environment, prefix the command with the
# variables you want to set.
BROWSER="chromium" NODE_ENV="production" makers dev
```
* To watch for changes but without starting a live-reloading browser instance, use the `watch` task.
```sh
makers watch
# Which is a simple alias for the following.
WATCH="true" makers build
```
* To start a browser instance with an already built extension present in the `build/` directory, the `run` task is available. Note that this will fail if the extension hasn't been built before.
```sh
makers run
```
* To clean the build directory, a `clean` task is available. This uses `trash-cli` so if you accidentally remove something and want it back, check your trash bin where you can restore it.
```sh
makers clean
# Clean the Chromium directory.
BROWSER="chromium" makers clean
```
* To lint the code, `lint` is the task.
```sh
makers lint
# To only lint JS or SCSS.
makers lint-js
makers lint-scss
```
* To pack the WebExtension for publishing, `pack` is what you need.
```sh
# Make sure to set NODE_ENV, otherwise the extension size will be
# a lot bigger than it needs to be.
NODE_ENV="production" makers pack
# To pack Chromium.
BROWSER="chromium" NODE_ENV="production" makers pack
```
* Mozilla Addons requires the zipped source code too, since we're using minification, so `zip-source` is available. This uses Git's `archive` command.
```sh
makers zip-source
```
</details>

View File

@ -2,6 +2,11 @@
> **A WebExtension providing interactive guided tours of Tildes.**
## Documentation
* If you'd like to contribute to the tours, see [TOURS.md].
* To develop and run Tildes Shepherd yourself, see [DEVELOPMENT.md].
## License
Distributed under the [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) license, see [LICENSE](https://git.bauke.xyz/tildes-community/tildes-shepherd/src/branch/main/LICENSE) for more information.

23
TOURS.md Normal file
View File

@ -0,0 +1,23 @@
# Tours
## Contributing
If you'd like to create a new tour or add/edit any of the existing tours, but don't know how to set up a development environment, please feel free to describe it in whatever way works for you. Show what you think should be highlighted, how it should be explained, etc. in whatever way you want.
Draw it in GIMP, sketch it on paper and take a picture, as long as you can show it to us! Send all your ideas to [@Community](https://tildes.net/user/Community) and we'll take care of the beeps and boops to get it into the WebExtension. Thank you!
## Completion Status
Below is a rough list of the planned tours together with which version of the WebExtension the tour is available in. Names and organization will likely change and differ from what's shown in the options page.
If a tour is checked and has a version number it's available from Mozilla Addons right now. If it is checked and doesn't have a version number it's finished but hasn't yet been published. And if it's unchecked it hasn't been finished yet.
* [x] Introduction (0.1.0)
* [ ] Interface
* [x] Homepage (0.1.0)
* [ ] Account Settings
* [ ] Invites
* [ ] Groups
* [ ] Topics
* [ ] Comments
* [ ] Messages