|
| 1 | +<!-- Do not include the top level heading when generating the |
| 2 | + table of contents using the vscode markdown all in one extension --> |
| 3 | +<!-- prettier-ignore-start --> |
| 4 | +<!-- omit in toc --> |
1 | 5 | # nodecg-io-cli |
| 6 | +<!-- prettier-ignore-end --> |
2 | 7 |
|
| 8 | +This is the cli for [nodecg-io](https://github.com/codeoverflow-org/nodecg-io) that allows you to easily manage your nodecg-io installation and helps you with nodecg-io related development. |
| 9 | + |
| 10 | +## Table of contents |
| 11 | + |
| 12 | +- [Table of contents](#table-of-contents) |
| 13 | +- [Commands](#commands) |
| 14 | + - [`nodecg-io install`](#nodecg-io-install) |
| 15 | + - [`nodecg-io uninstall`](#nodecg-io-uninstall) |
| 16 | +- [A note about versioning](#a-note-about-versioning) |
| 17 | +- [Developer workflow](#developer-workflow) |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Commands |
| 22 | + |
| 23 | +Here's a brief overview of the available commands. More indepth usage guides of these commands will be available in the [nodecg-io docs](https://nodecg.io) at some point. |
| 24 | + |
| 25 | +### `nodecg-io install` |
| 26 | + |
| 27 | +Installs nodecg-io to your current nodecg installation into a sub-directory called `nodecg-io`. Allows you to select which released version you want or if you wish to get a development install. |
| 28 | + |
| 29 | +<!-- TODO: mention that it saves the state and allows for editing by rerunning. Mention updating --> |
| 30 | + |
| 31 | +A production install fetches tarballs of the needed packages from the official npm registry, unpacks them, creates a `package.json` with all packages in a npm v7 workspace configuration and installs dependencies that way. |
| 32 | + |
| 33 | +A development install clones the official git repository (`master`), installs dependencies, bootstraps all packages using lerna and builds all packages. |
| 34 | + |
| 35 | +Either way at the end of the installation it will automatically add the nodecg-io directory (and samples if dev install and selected) to the `bundles.paths` array of your nodecg configuration. If you don't have a nodecg configuration it will create one for you. |
| 36 | + |
| 37 | +If you later decide that you want to add or remove a service you can just re-run `nodecg-io install`. It saves your choices and makes them the default selected if you already have a installation so you can make changes to them. If you re-run the install command it will also pull the repo and rebuild if necessary in case of a development install and, in case of a production install, it will make any updates if some packages have a new patch version available. Updates of minor and major changes must be made explicitly by selecting the newer version when running the install command. |
| 38 | + |
| 39 | +### `nodecg-io uninstall` |
| 40 | + |
| 41 | +Undos everything that `nodecg-io install` did. It removes the `nodecg-io` directory with your installation and removes nodecg-io from your nodecg configuration. |
| 42 | + |
| 43 | +## A note about versioning |
| 44 | + |
| 45 | +This cli follows and is versioned independently from the rest of nodecg-io like `nodecg-io-core` or the services. |
| 46 | + |
| 47 | +The following table show which versions of the cli are compatible with which nodecg-io versions: |
| 48 | + |
| 49 | +| CLI versions | nodecg-io versions | |
| 50 | +| ------------ | ------------------ | |
| 51 | +| `0.1` | `0.1` | |
| 52 | + |
| 53 | +Currently they are the same but we will follow [semver2](https://semver.org/) using [semantic-release](https://semantic-release.gitbook.io/semantic-release/) and the versions will diverge at some point. |
| 54 | + |
| 55 | +## Developer workflow |
| 56 | + |
| 57 | +Clone this repo, install the required dependencies and build it: |
| 58 | + |
| 59 | +```console |
| 60 | +$ git clone https://github.com/codeoverflow-org/nodecg-io-cli.git |
| 61 | +$ cd nodecg-io-cli |
| 62 | +$ npm i |
| 63 | +$ npm run build |
| 64 | +``` |
| 65 | + |
| 66 | +Then link your current local install of the cli to your global `node_modules` directory (might require `sudo` on linux): |
| 67 | + |
| 68 | +```console |
| 69 | +$ npm link |
| 70 | +``` |
| 71 | + |
| 72 | +You can now use the `nodecg-io` command and it will use your local install. You DO NOT need to rerun the link command after you make changes to the cli, unless you move it another location. While developing you may want to start a TypeScript watcher by running `npm run watch` that will automatically update the JS files that are used while you make changes. |
0 commit comments