@nanoforge-dev/cli 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -35
- package/dist/command.loader.js +283 -99
- package/dist/command.loader.js.map +1 -1
- package/dist/nf.js +289 -101
- package/package.json +18 -14
package/README.md
CHANGED
|
@@ -50,61 +50,150 @@ nf [command] [options]
|
|
|
50
50
|
|
|
51
51
|
Used to build your nanoforge project.
|
|
52
52
|
|
|
53
|
-
- `-d, --directory
|
|
54
|
-
- `-c, --config
|
|
55
|
-
- `--client-
|
|
56
|
-
- `--server-
|
|
57
|
-
- `--
|
|
53
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
54
|
+
- `-c, --config <config>` path to the config file.
|
|
55
|
+
- `--client-entry <clientEntry>` specify the entry file of the client.
|
|
56
|
+
- `--server-entry <serverEntry>` specify the entry file of the server.
|
|
57
|
+
- `--client-static-dir <clientStaticDir>` specify the static directory of the client.
|
|
58
|
+
- `--server-static-dir <serverStaticDir>` specify the static directory of the server.
|
|
59
|
+
- `--client-out-dir <clientOutDir>` specify the output directory of the client.
|
|
60
|
+
- `--server-out-dir <serverOutDir>` specify the output directory of the server.
|
|
61
|
+
- `--editor` build with editor config.
|
|
62
|
+
- `--watch` build app in watching mode. (default: `false`)
|
|
63
|
+
|
|
64
|
+
### `create`
|
|
65
|
+
|
|
66
|
+
Used to create nanoforge components or systems.
|
|
67
|
+
|
|
68
|
+
- `<type>` the type to create (component or system).
|
|
69
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
70
|
+
- `-c, --config <config>` path to the config file.
|
|
71
|
+
- `-n, --name <name>` name of the component/system.
|
|
72
|
+
- `-s, --server` create on server instead of client. (default: `false`)
|
|
73
|
+
- `-p, --path <path>` path to the component/system folder.
|
|
58
74
|
|
|
59
75
|
### `dev`
|
|
60
76
|
|
|
61
77
|
Used to run your nanoforge project in dev mode.
|
|
62
78
|
|
|
63
|
-
- `-d, --directory
|
|
64
|
-
-
|
|
79
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
80
|
+
- `-c, --config <config>` path to the config file.
|
|
81
|
+
- `--generate` generate app files from config, like generate command in dev mode. (default: `false`)
|
|
82
|
+
|
|
83
|
+
### `editor`
|
|
84
|
+
|
|
85
|
+
Used to start the nanoforge editor.
|
|
86
|
+
|
|
87
|
+
- `[path]` path to the project to open in the editor.
|
|
88
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
89
|
+
- `--open` open the editor in the default web browser (default: `true` if path is specified, `false` otherwise).
|
|
90
|
+
- `--no-open` do not open the editor in the default web browser.
|
|
65
91
|
|
|
66
92
|
### `generate`
|
|
67
93
|
|
|
68
|
-
Used to generate nanoforge project files from config
|
|
94
|
+
Used to generate nanoforge project files from config.
|
|
69
95
|
|
|
70
|
-
- `-d, --directory
|
|
71
|
-
- `-c, --config
|
|
72
|
-
- `--
|
|
96
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
97
|
+
- `-c, --config <config>` path to the config file.
|
|
98
|
+
- `--editor` generate the editor main file.
|
|
99
|
+
- `--watch` generate app in watching mode. (default: `false`)
|
|
73
100
|
|
|
74
101
|
### `install` or `add`
|
|
75
102
|
|
|
76
|
-
Used to add
|
|
103
|
+
Used to add nanoforge components, systems or libraries to your project.
|
|
104
|
+
|
|
105
|
+
- `[names...]` names of the components/systems/libraries to install.
|
|
106
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
107
|
+
- `-l, --lib` install a library instead of a component/system. (default: `false`)
|
|
108
|
+
- `-s, --server` install on server instead of client. (default: `false`)
|
|
109
|
+
|
|
110
|
+
### `login`
|
|
77
111
|
|
|
78
|
-
|
|
112
|
+
Used to log in to the Nanoforge registry.
|
|
113
|
+
|
|
114
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
115
|
+
- `-l, --local` log in only for the current project. (default: `false`)
|
|
116
|
+
- `-k, --api-key <key>` API key for the Nanoforge registry.
|
|
117
|
+
|
|
118
|
+
### `logout`
|
|
119
|
+
|
|
120
|
+
Used to log out from the Nanoforge registry.
|
|
121
|
+
|
|
122
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
123
|
+
- `-l, --local` log out only for the current project.
|
|
79
124
|
|
|
80
125
|
### `new`
|
|
81
126
|
|
|
82
|
-
Used to create a new nanoforge project
|
|
83
|
-
|
|
84
|
-
- `-d, --directory
|
|
85
|
-
- `--name
|
|
86
|
-
- `--path
|
|
87
|
-
- `--package-manager
|
|
88
|
-
- `--language
|
|
89
|
-
- `--strict` use strict mode
|
|
90
|
-
- `--no-strict` do not use strict mode
|
|
91
|
-
- `--server` create a server
|
|
92
|
-
- `--no-server` do not create a server
|
|
93
|
-
- `--init-functions` initialize functions
|
|
94
|
-
- `--no-init-functions` do not initialize functions
|
|
95
|
-
- `--skip-install` skip installing dependencies
|
|
96
|
-
- `--no-skip-install` do not skip installing dependencies
|
|
127
|
+
Used to create a new nanoforge project.
|
|
128
|
+
|
|
129
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
130
|
+
- `--name <name>` specify the name of your project.
|
|
131
|
+
- `--path <path>` specify the relative path where your project will be created (default: name of the project).
|
|
132
|
+
- `--package-manager <packageManager>` specify the package manager of your project.
|
|
133
|
+
- `--language <language>` specify the language of your project.
|
|
134
|
+
- `--strict` use strict mode.
|
|
135
|
+
- `--no-strict` do not use strict mode.
|
|
136
|
+
- `--server` create a server.
|
|
137
|
+
- `--no-server` do not create a server.
|
|
138
|
+
- `--init-functions` initialize functions.
|
|
139
|
+
- `--no-init-functions` do not initialize functions.
|
|
140
|
+
- `--skip-install` skip installing dependencies.
|
|
141
|
+
- `--no-skip-install` do not skip installing dependencies.
|
|
142
|
+
- `--docker` generate docker files.
|
|
143
|
+
- `--no-docker` do not generate docker files.
|
|
144
|
+
- `--no-lint` do not generate lint files.
|
|
145
|
+
- `--editor` add editor dependencies.
|
|
146
|
+
- `--git` generate a git repository.
|
|
147
|
+
- `--no-git` do not generate a git repository.
|
|
148
|
+
- `--git-remote <gitRemote>` set up a git remote (required if `--git` is used).
|
|
149
|
+
- `--no-git-remote` do not set up a git remote.
|
|
150
|
+
|
|
151
|
+
### `publish`
|
|
152
|
+
|
|
153
|
+
Used to publish a package to the Nanoforge registry.
|
|
154
|
+
|
|
155
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
97
156
|
|
|
98
157
|
### `start`
|
|
99
158
|
|
|
100
|
-
Used to start your nanoforge project
|
|
159
|
+
Used to start your nanoforge project.
|
|
160
|
+
|
|
161
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
162
|
+
- `-c, --config <config>` path to the config file (default: "nanoforge.config.json").
|
|
163
|
+
- `-p, --port <port>` specify the port of the loader (the website to load the game).
|
|
164
|
+
- `--client-dir <clientDirectory>` specify the directory of the client.
|
|
165
|
+
- `--server-dir <serverDirectory>` specify the directory of the server.
|
|
166
|
+
- `--watch` run app in watching mode. (default: `false`)
|
|
167
|
+
- `--cert <cert>` path to the SSL certificate for HTTPS.
|
|
168
|
+
- `--key <key>` path to the SSL key for HTTPS.
|
|
169
|
+
|
|
170
|
+
### `unpublish`
|
|
171
|
+
|
|
172
|
+
Used to unpublish a package from the Nanoforge registry.
|
|
173
|
+
|
|
174
|
+
- `-d, --directory <directory>` specify the working directory of the command.
|
|
175
|
+
|
|
176
|
+
## Environment Variables
|
|
177
|
+
|
|
178
|
+
When running a NanoForge game with `nf start`, environment variables can be passed to the client and server applications via a `.env` file at the root of your project or directly in the environment.
|
|
179
|
+
|
|
180
|
+
```dotenv
|
|
181
|
+
NANOFORGE_CLIENT_SERVER_TCP_PORT=4445
|
|
182
|
+
NANOFORGE_CLIENT_SERVER_UDP_PORT=4444
|
|
183
|
+
NANOFORGE_CLIENT_SERVER_ADDRESS=127.0.0.1
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Variables are scoped by prefix:
|
|
187
|
+
|
|
188
|
+
| Prefix | Availability |
|
|
189
|
+
| :------------------ | :---------------------------------- |
|
|
190
|
+
| `NANOFORGE_CLIENT_` | Available in the client only |
|
|
191
|
+
| `NANOFORGE_SERVER_` | Available in the server only |
|
|
192
|
+
| `NANOFORGE_` | Available in both client and server |
|
|
193
|
+
|
|
194
|
+
> **Note:** Prefixes are stripped before the variable is exposed to libraries.
|
|
101
195
|
|
|
102
|
-
|
|
103
|
-
- `-c, --config [config]` path to the config file (default: "nanoforge.config.json")
|
|
104
|
-
- `-p, --client-port [clientPort]` specify the port of the loader (the website to load the game)
|
|
105
|
-
- `--game-exposure-port [gameExposurePort]` specify the port of the game exposure
|
|
106
|
-
- `--server-port [serverPort]` specify the port of the server
|
|
107
|
-
- `--watch` run app in watching mode. (default : `false`)
|
|
196
|
+
For full documentation on how libraries consume these variables, see [@nanoforge-dev/config](https://github.com/NanoForge-dev/Engine/tree/main/packages/config).
|
|
108
197
|
|
|
109
198
|
## Contributing
|
|
110
199
|
|