diff --git a/README.md b/README.md index b14aa99..21a6559 100644 --- a/README.md +++ b/README.md @@ -47,55 +47,54 @@ nf [command] [options] Used to build your nanoforge project. -`-d, --directory [directory]` specify the directory of the nanoforge project to build. -`-c, --config [config]` path to the config file. -`--client-outDir [clientDirectory]` specifies the client directory. -`--server-outDir [serverDirectory]` specifies the server directory. +- `-d, --directory [directory]` specify the directory of the nanoforge project to build. +- `-c, --config [config]` path to the config file. +- `--client-outDir [clientDirectory]` specifies the client directory. +- `--server-outDir [serverDirectory]` specifies the server directory. ### `generate` Used to generate nanoforge project files from config -`-d, --directory [directory]` specify the directory of the nanoforge project to build. -`-c, --config [config]` path to the config file. +- `-d, --directory [directory]` specify the directory of the nanoforge project to build. +- `-c, --config [config]` path to the config file. ### `install` or `add` Used to add a nanoforge library to your project -`-d, --directory [directory]` specify the directory of the nanoforge project to build. +- `-d, --directory [directory]` specify the directory of the nanoforge project to build. ### `new` Used to create a new nanoforge project -`-d, --directory [directory]` specify the directory of your project -`--name [name]` specify the name of your project -`--path [path]` specify the path of your project -`--package-manager [packageManager]` specify the package manager of your project -`--language [language]` specify the language of your project -`--strict` use strict mode -`--no-strict` do not use strict mode -`--server` create a server -`--no-server` do not create a server -`--init-functions` initialize functions -`--no-init-functions` do not initialize functions -`--skip-install` skip installing dependencies -`--no-skip-install` do not skip installing dependencies +- `-d, --directory [directory]` specify the directory of your project +- `--name [name]` specify the name of your project +- `--path [path]` specify the path of your project +- `--package-manager [packageManager]` specify the package manager of your project +- `--language [language]` specify the language of your project +- `--strict` use strict mode +- `--no-strict` do not use strict mode +- `--server` create a server +- `--no-server` do not create a server +- `--init-functions` initialize functions +- `--no-init-functions` do not initialize functions +- `--skip-install` skip installing dependencies +- `--no-skip-install` do not skip installing dependencies ### `start` Used to start your nanoforge project -`-d, --directory [directory]` specify the directory of your project -`-c, --config [config]` path to the config file (default: "nanoforge.config.json") -`-p, --client-port [clientPort]` specify the port of the loader (the website to load the game) -`--game-exposure-port [gameExposurePort]` specify the port of the game exposure -`--server-port [serverPort]` specify the port of the server +- `-d, --directory [directory]` specify the directory of your project +- `-c, --config [config]` path to the config file (default: "nanoforge.config.json") +- `-p, --client-port [clientPort]` specify the port of the loader (the website to load the game) +- `--game-exposure-port [gameExposurePort]` specify the port of the game exposure +- `--server-port [serverPort]` specify the port of the server ## Contributing -<<<<<<< HEAD Please read through our [contribution guidelines][contributing] before starting a pull request. We welcome contributions of all kinds, not just code! If you're stuck for ideas, look for the [good first issue][good-first-issue] label on issues in the repository. If you have any questions about the project, feel free to ask them on [Discussions][discussions]. Before creating your own issue or pull request, always check to see if one already exists! Don't rush contributions, take your time and ensure you're doing it correctly. ## Help @@ -107,6 +106,5 @@ If you don't understand something in the documentation, you are experiencing pro [cli-source]: https://github.com/NanoForge-dev/CLI [github-releases]: https://github.com/NanoForge-dev/CLI/releases [good-first-issue]: https://github.com/NanoForge-dev/CLI/contribute -======= + The config file schema can be found at : [https://nanoforge-dev.github.io/docs/cli/config-schema.json](https://nanoforge-dev.github.io/docs/cli/config-schema.json) ->>>>>>> 210277f (docs: finish setup auto docs) diff --git a/docs/.gh-include b/docs/.gh-include index 8f2c7ff..ea5e330 100644 --- a/docs/.gh-include +++ b/docs/.gh-include @@ -1 +1,5 @@ config.schema.json +server-config.schema.json +client-config.schema.json +build-config.schema.json +run-config.schema.json diff --git a/docs/build-config.schema.json b/docs/build-config.schema.json new file mode 100644 index 0000000..1e78b43 --- /dev/null +++ b/docs/build-config.schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://nanoforge-dev.github.io/docs/cli/build-config.schema.json", + "title": "Nanoforge CLI build config", + "type": "object", + "properties": { + "entryFile": { + "type": "string", + "description": "the entry file for the program" + }, + "outDir": { + "type": "string", + "description": "the directory where to put the built files" + }, + }, + "required": ["entryFile", "outDir"] +} diff --git a/docs/client-config.schema.json b/docs/client-config.schema.json new file mode 100644 index 0000000..c3dd9b7 --- /dev/null +++ b/docs/client-config.schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://nanoforge-dev.github.io/docs/cli/client-config.schema.json", + "title": "Nanoforge CLI client config", + "type": "object", + "properties": { + "port": { + "type": "string", + "description": "the port to use" + }, + "gameExposurePort": { + "type": "string" + }, + "build": { + "$ref": "https://nanoforge-dev.github.io/docs/cli/build-config.schema.json" + }, + "runtime": { + "$ref": "https://nanoforge-dev.github.io/docs/cli/run-config.schema.json" + } + }, + "required": ["port", "gameExposurePort", "build", "runtime"] +} diff --git a/docs/config.schema.json b/docs/config.schema.json index 1669fde..6c8914f 100644 --- a/docs/config.schema.json +++ b/docs/config.schema.json @@ -13,6 +13,13 @@ }, "initFunctions": { "type": "boolean" + }, + "client": { + "$ref": "https://nanoforge-dev.github.io/docs/cli/client-config.schema.json" + }, + "server": { + "$ref": "https://nanoforge-dev.github.io/docs/cli/server-config.schema.json" } - } + }, + "required": ["name", "language", "initFunctions", "client", "server"] } diff --git a/docs/index.rst b/docs/index.rst index 135e447..b7a85c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,17 @@ CLI === +.. toctree:: + :maxdepth: 2 + + usage.rst + The nanoforge cli is the main tool to use when building or deploying a nanoforge application + +To install the Nanoforge CLI use : + +.. code-block:: bash + + npm install -g @nanoforge-dev/cli + +For usage information see :doc:`usage` diff --git a/docs/run-config.schema.json b/docs/run-config.schema.json new file mode 100644 index 0000000..f5f306d --- /dev/null +++ b/docs/run-config.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://nanoforge-dev.github.io/docs/cli/run-config.schema.json", + "title": "Nanoforge CLI run config", + "type": "object", + "properties": { + "dir": { + "type": "string", + "description": "the directory to use" + }, + }, + "required": ["dir"] +} diff --git a/docs/server-config.schema.json b/docs/server-config.schema.json new file mode 100644 index 0000000..73bf88f --- /dev/null +++ b/docs/server-config.schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://nanoforge-dev.github.io/docs/cli/server-config.schema.json", + "title": "Nanoforge CLI config", + "type": "object", + "properties": { + "port": { + "type": "string", + "description": "the port to use" + }, + "enable": { + "type": "boolean" + }, + "build": { + "$ref": "https://nanoforge-dev.github.io/docs/cli/build-config.schema.json" + }, + "runtime": { + "$ref": "https://nanoforge-dev.github.io/docs/cli/run-config.schema.json" + } + }, + "required": ["port", "enable", "build", "runtime"] +} diff --git a/docs/usage.rst b/docs/usage.rst new file mode 100644 index 0000000..e78304c --- /dev/null +++ b/docs/usage.rst @@ -0,0 +1,87 @@ +Usage +===== + +Creating a new project +---------------------- + +In order to create a new project you need to use: + +.. code-block:: bash + + nf new + +Commands +-------- + +Multiple commands exists to the cli: + +* :ref:`build` +* :ref:`generate` +* :ref:`install_add` +* :ref:`new` +* :ref:`start` + +.. _build: + +build +^^^^^ + +Used to build your nanoforge project. + +* ``-d, --directory [directory]`` specify the directory of the nanoforge project to build. +* ``-c, --config [config]`` path to the config file. (`Schema `__) +* ``--client-outDir [clientDirectory]`` specifies the client directory. +* ``--server-outDir [serverDirectory]`` specifies the server directory. + +.. _generate: + +generate +^^^^^^^^ + +Used to generate nanoforge project files from config + +* ``-d, --directory [directory]`` specify the directory of the nanoforge project to build. +* ``-c, --config [config]`` path to the config file. (`Schema `__) + +.. _install_add: + +install/add +^^^^^^^^^^^ + +Used to add a nanoforge library to your project + +* ``-d, --directory [directory]`` specify the directory of the nanoforge project to build. + +.. _new: + +new +^^^ + +Used to create a new nanoforge project + +* ``-d, --directory [directory]`` specify the directory of your project +* ``--name [name]`` specify the name of your project +* ``--path [path]`` specify the path of your project +* ``--package-manager [packageManager]`` specify the package manager of your project +* ``--language [language]`` specify the language of your project +* ``--strict`` use strict mode +* ``--no-strict`` do not use strict mode +* ``--server`` create a server +* ``--no-server`` do not create a server +* ``--init-functions`` initialize functions +* ``--no-init-functions`` do not initialize functions +* ``--skip-install`` skip installing dependencies +* ``--no-skip-install`` do not skip installing dependencies + +.. _start: + +start +^^^^^ + +Used to start your nanoforge project + +* ``-d, --directory [directory]`` specify the directory of your project +* ``-c, --config [config]`` path to the config file (default: "nanoforge.config.json") (`Schema `__) +* ``-p, --client-port [clientPort]`` specify the port of the loader (the website to load the game) +* ``--game-exposure-port [gameExposurePort]`` specify the port of the game exposure +* ``--server-port [serverPort]`` specify the port of the server