From 98654e4deb119a102b7b3e42b0a40537cf5e4e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Wed, 12 Jun 2024 22:25:46 +0200 Subject: [PATCH] add docs for watch & clean cli command --- src/content/docs/reference/cli.md | 40 ++++++++++++++++++++++++++++--- src/content/docs/roadmap.mdx | 4 +--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/content/docs/reference/cli.md b/src/content/docs/reference/cli.md index 989dbbd..644cdb0 100644 --- a/src/content/docs/reference/cli.md +++ b/src/content/docs/reference/cli.md @@ -26,12 +26,46 @@ Options: ## build Build the project at the specified path to the `dist` folder. ```bash -shulkerscript build [PATH] +shulkerscript build [OPTIONS] [PATH] ``` - `PATH`: The path to the directory where the project is located. Defaults to the current directory. +Options: +- `--output ` The output directory, overrides the `DATAPACK_DIR` environment variable + +Environment variables: +- `DATAPACK_DIR` The output directory [default: `./dist`] + ## package Build and package the project at the specified path to a `.zip` file. ```bash -shulkerscript package [PATH] -``` \ No newline at end of file +shulkerscript package [OPTIONS] [PATH] +``` + +- `PATH`: The path to the directory where the project is located. Defaults to the current directory. + +Options & Environment: +- Same as `build` + +## watch +```bash +shulkerscript watch [OPTIONS] [SUBCOMMAND] +``` +- `SUBCOMMAND`: The command to run when changes have been detected, has to be either `build` or `package` [default: `build`] + +Options: +- `--no-initial` Do not run the command initially +- `--debounce-time ` The time to wait in ms after the last change before running the command [default: `2000`] + +## clean +Clean the output directory of the project at the specified path. +```bash +shulkerscript clean [OPTIONS] [PATH] +``` +- `PATH`: The path of the project folder to clean [default: `.`] + +Options: +- `--output ` The output directory, overrides the `DATAPACK_DIR` environment variable + +Environment variables: +- `DATAPACK_DIR` The output directory [default: `./dist`] \ No newline at end of file diff --git a/src/content/docs/roadmap.mdx b/src/content/docs/roadmap.mdx index dc21f21..123207b 100644 --- a/src/content/docs/roadmap.mdx +++ b/src/content/docs/roadmap.mdx @@ -25,9 +25,7 @@ import { Steps } from '@astrojs/starlight/components'; 3. **Tag support**\ Add a way to define tags in the project and use them in the code. This will eliminate the need for providing tags in the asset directory. -4. **CLI watch subcommand**\ - Add a watch subcommand to the CLI that will watch the project directory for changes and automatically compile the project. -5. **Variables & Constants**\ +4. **Variables & Constants**\ Add support for variables and constants. Constants can be any type (string, number, etc.) and can be passed from function to function. They will be processed by the compiler. Variables will be mutable and can be changed at any time, and are stored as entries in minecraft scoreboards.