Skip to content

Commit e7f7178

Browse files
author
github-actions[bot]
committed
chore(cli): updating docs
1 parent 602ae85 commit e7f7178

8 files changed

Lines changed: 186 additions & 1 deletion

cli/.gh-include

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
config.schema.json
2+
server-config.schema.json
3+
client-config.schema.json
4+
build-config.schema.json
5+
run-config.schema.json

cli/build-config.schema.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://nanoforge-dev.github.io/docs/cli/build-config.schema.json",
4+
"title": "Nanoforge CLI build config",
5+
"type": "object",
6+
"properties": {
7+
"entryFile": {
8+
"type": "string",
9+
"description": "the entry file for the program"
10+
},
11+
"outDir": {
12+
"type": "string",
13+
"description": "the directory where to put the built files"
14+
},
15+
},
16+
"required": ["entryFile", "outDir"]
17+
}

cli/client-config.schema.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://nanoforge-dev.github.io/docs/cli/client-config.schema.json",
4+
"title": "Nanoforge CLI client config",
5+
"type": "object",
6+
"properties": {
7+
"port": {
8+
"type": "string",
9+
"description": "the port to use"
10+
},
11+
"gameExposurePort": {
12+
"type": "string"
13+
},
14+
"build": {
15+
"$ref": "https://nanoforge-dev.github.io/docs/cli/build-config.schema.json"
16+
},
17+
"runtime": {
18+
"$ref": "https://nanoforge-dev.github.io/docs/cli/run-config.schema.json"
19+
}
20+
},
21+
"required": ["port", "gameExposurePort", "build", "runtime"]
22+
}

cli/config.schema.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
},
1414
"initFunctions": {
1515
"type": "boolean"
16+
},
17+
"client": {
18+
"$ref": "https://nanoforge-dev.github.io/docs/cli/client-config.schema.json"
19+
},
20+
"server": {
21+
"$ref": "https://nanoforge-dev.github.io/docs/cli/server-config.schema.json"
1622
}
17-
}
23+
},
24+
"required": ["name", "language", "initFunctions", "client", "server"]
1825
}

cli/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
CLI
22
===
33

4+
.. toctree::
5+
:maxdepth: 2
6+
7+
usage.rst
8+
49
The nanoforge cli is the main tool to use when building or deploying a nanoforge application
10+
11+
To install the Nanoforge CLI use :
12+
13+
.. code-block:: bash
14+
15+
npm install -g @nanoforge-dev/cli
16+
17+
For usage information see :doc:`usage`

cli/run-config.schema.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://nanoforge-dev.github.io/docs/cli/run-config.schema.json",
4+
"title": "Nanoforge CLI run config",
5+
"type": "object",
6+
"properties": {
7+
"dir": {
8+
"type": "string",
9+
"description": "the directory to use"
10+
},
11+
},
12+
"required": ["dir"]
13+
}

cli/server-config.schema.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://nanoforge-dev.github.io/docs/cli/server-config.schema.json",
4+
"title": "Nanoforge CLI config",
5+
"type": "object",
6+
"properties": {
7+
"port": {
8+
"type": "string",
9+
"description": "the port to use"
10+
},
11+
"enable": {
12+
"type": "boolean"
13+
},
14+
"build": {
15+
"$ref": "https://nanoforge-dev.github.io/docs/cli/build-config.schema.json"
16+
},
17+
"runtime": {
18+
"$ref": "https://nanoforge-dev.github.io/docs/cli/run-config.schema.json"
19+
}
20+
},
21+
"required": ["port", "enable", "build", "runtime"]
22+
}

cli/usage.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Usage
2+
=====
3+
4+
Creating a new project
5+
----------------------
6+
7+
In order to create a new project you need to use:
8+
9+
.. code-block:: bash
10+
11+
nf new
12+
13+
Commands
14+
--------
15+
16+
Multiple commands exists to the cli:
17+
18+
* :ref:`build`
19+
* :ref:`generate`
20+
* :ref:`install_add`
21+
* :ref:`new`
22+
* :ref:`start`
23+
24+
.. _build:
25+
26+
build
27+
^^^^^
28+
29+
Used to build your nanoforge project.
30+
31+
* ``-d, --directory [directory]`` specify the directory of the nanoforge project to build.
32+
* ``-c, --config [config]`` path to the config file. (`Schema <https://nanoforge-dev.github.io/docs/cli/config.schema.json>`__)
33+
* ``--client-outDir [clientDirectory]`` specifies the client directory.
34+
* ``--server-outDir [serverDirectory]`` specifies the server directory.
35+
36+
.. _generate:
37+
38+
generate
39+
^^^^^^^^
40+
41+
Used to generate nanoforge project files from config
42+
43+
* ``-d, --directory [directory]`` specify the directory of the nanoforge project to build.
44+
* ``-c, --config [config]`` path to the config file. (`Schema <https://nanoforge-dev.github.io/docs/cli/config.schema.json>`__)
45+
46+
.. _install_add:
47+
48+
install/add
49+
^^^^^^^^^^^
50+
51+
Used to add a nanoforge library to your project
52+
53+
* ``-d, --directory [directory]`` specify the directory of the nanoforge project to build.
54+
55+
.. _new:
56+
57+
new
58+
^^^
59+
60+
Used to create a new nanoforge project
61+
62+
* ``-d, --directory [directory]`` specify the directory of your project
63+
* ``--name [name]`` specify the name of your project
64+
* ``--path [path]`` specify the path of your project
65+
* ``--package-manager [packageManager]`` specify the package manager of your project
66+
* ``--language [language]`` specify the language of your project
67+
* ``--strict`` use strict mode
68+
* ``--no-strict`` do not use strict mode
69+
* ``--server`` create a server
70+
* ``--no-server`` do not create a server
71+
* ``--init-functions`` initialize functions
72+
* ``--no-init-functions`` do not initialize functions
73+
* ``--skip-install`` skip installing dependencies
74+
* ``--no-skip-install`` do not skip installing dependencies
75+
76+
.. _start:
77+
78+
start
79+
^^^^^
80+
81+
Used to start your nanoforge project
82+
83+
* ``-d, --directory [directory]`` specify the directory of your project
84+
* ``-c, --config [config]`` path to the config file (default: "nanoforge.config.json") (`Schema <https://nanoforge-dev.github.io/docs/cli/config.schema.json>`__)
85+
* ``-p, --client-port [clientPort]`` specify the port of the loader (the website to load the game)
86+
* ``--game-exposure-port [gameExposurePort]`` specify the port of the game exposure
87+
* ``--server-port [serverPort]`` specify the port of the server

0 commit comments

Comments
 (0)