Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ignore-files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs/dependencies.md
docs/services.md
8 changes: 6 additions & 2 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"default": true,
"MD003": { "style": "atx" },
"MD007": { "indent": 4 },
"ul-indent": { "indent": 4 },
"list-marker-space": {
"ul_single": 3,
"ul_multi": 3
},
"MD012": false,
"MD013": false,
"MD026": false,
Expand All @@ -11,7 +15,7 @@
"MD040": false,
"MD041": false,
"MD046": false,
"MD047": false,
"MD047": true,
"no-hard-tabs": true,
"whitespace": false
}
2 changes: 1 addition & 1 deletion docs/contribute/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cd path/to/nodecg-io
npm run watch
```

_Note:_ Watching all packages requires a lot of RAM.
_Note:_ Watching all packages requires a lot of RAM.
Instead, you can watch just the packages you are actively working on e.g., `npm run watch -- --scope nodecg-io-twitch-chat --scope twitch-chat`.
This will just spawn a watch process for the twitch-chat sample and service and require way less memory.

Expand Down
9 changes: 2 additions & 7 deletions docs/contribute/create_sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,14 @@ import { TheServicesExportedClient } from "nodecg-io-<the services name>";
module.exports = function (nodecg: NodeCG) {
nodecg.log.info("Sample bundle for <the-service-name> started");

const service = requireService<TheServicesExportedClient>(
nodecg,
"<the-service-name>"
);
const service = requireService<TheServicesExportedClient>(nodecg, "<the-service-name>");
service?.onAvailable((client) => {
nodecg.log.info("<the-service-name> client has been updated.");

// TODO do something with the client to demonstrate the functionality.
});

service?.onUnavailable(() =>
nodecg.log.info("<the-service-name> client has been unset.")
);
service?.onUnavailable(() => nodecg.log.info("<the-service-name> client has been unset."));
};
```

Expand Down
4 changes: 2 additions & 2 deletions docs/contribute/create_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Create a file called `index.ts` in a folder called `extension` inside your servi
// TODO: Rename all occurrences of "your-service-name" with only lowercase and hyphens ( - )

import { NodeCG } from "nodecg-types/types/server";
import { Result,emptySuccess,success,ServiceBundle } from "nodecg-io-core";
import { Result, emptySuccess, success, ServiceBundle } from "nodecg-io-core";
// TODO: Replace the "fake" service class with that found on npm etc.
import { ServiceClass } from "./";

Expand All @@ -108,7 +108,7 @@ module.exports = (nodecg: NodeCG) => {
new YourServiceNameService(nodecg, "your-service-name", __dirname, "../your-service-name-schema.json").register();
};

class YourServiceNameService extends ServiceBundle<YourServiceNameServiceConfig,YourServiceNameServiceClient> {
class YourServiceNameService extends ServiceBundle<YourServiceNameServiceConfig, YourServiceNameServiceClient> {
async validateConfig(config: YourServiceNameServiceConfig): Promise<Result<void>> {
// TODO You can validate your config here. If this gets called, the schema is correct.
// You should for example check whether oauth keys are valid and servers are online here
Expand Down
14 changes: 7 additions & 7 deletions docs/getting_started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ Any program that can read disk contents can access your credentials of any servi

Options of automatic login:

- `enabled` (boolean)
- `enabled` (boolean)

Automatic login will be only enabled if this `enabled` option is set to `true`.
This option can be used to temporarily disable automatic login without needing to delete the whole automatic login configuration
and allows for easy re-enabling without needing to enter the password in the config again.
Automatic login will be only enabled if this `enabled` option is set to `true`.
This option can be used to temporarily disable automatic login without needing to delete the whole automatic login configuration
and allows for easy re-enabling without needing to enter the password in the config again.

- `password` (string)
- `password` (string)

This is the password that will be used to log in. It should be the password you use to log in to nodecg-io.
If this password is wrong an error will be logged after startup.
This is the password that will be used to log in. It should be the password you use to log in to nodecg-io.
If this password is wrong an error will be logged after startup.

Example config:

Expand Down
8 changes: 4 additions & 4 deletions docs/getting_started/create_new_bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ _Note:_ If you need to access another service inside the callback of a `onAvaila

A couple of steps you may want to do after generating a bundle:

- Create a git repository for you bundle (a `.gitignore` is automatically generated for you) and push it to a git platform of your choice
- Add an [open source licence](https://choosealicense.com), don't forget it to also add it to the `package.json` file
- Add code formatters and linting tools like [prettier](https://prettier.io/) and [ESLint](https://eslint.org/)
- Add a README that explains what your bundle does and how it can be used
- Create a git repository for you bundle (a `.gitignore` is automatically generated for you) and push it to a git platform of your choice
- Add an [open source licence](https://choosealicense.com), don't forget it to also add it to the `package.json` file
- Add code formatters and linting tools like [prettier](https://prettier.io/) and [ESLint](https://eslint.org/)
- Add a README that explains what your bundle does and how it can be used

## Share it!

Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/existing_bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Handlers added with `onAvailable` will get called if there was a change and you
```typescript
// This is the variable with the return value of requireService().
// You may want to change the variable name for the service you are using.
twitchChat.onAvailable(client => {
twitchChat.onAvailable((client) => {
nodecg.log.info("Client was set");
// You can use the passed client in here to e.g. setup handlers on the client
});
Expand Down
11 changes: 5 additions & 6 deletions docs/getting_started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Here's how to install the native build tools on the most popular operating syste
#### Windows

For Windows, you'll need the Visual Studio Build Tools, if you have Visual Studio installed you should already have them.
If you don't have Visual Studio just install the Visual Studio Build Tools by running the following command as an __Administrator__:
If you don't have Visual Studio just install the Visual Studio Build Tools by running the following command as an **Administrator**:

```shell
npm install -g windows-build-tools
Expand Down Expand Up @@ -58,7 +58,6 @@ npm install -g nodecg-io-cli

_Note:_ If you are running on Linux, you may need to use `sudo` if your npm installation uses a non-writeable path (default on Ubuntu apt packages, usually does not apply to packages installed using [nvm](https://github.com/nvm-sh/nvm))


## Install nodecg-io using the nodecg-io CLI

With the nodecg-io CLI installed you can run this command inside a nodecg installation to install nodecg-io:
Expand All @@ -67,11 +66,11 @@ With the nodecg-io CLI installed you can run this command inside a nodecg instal
nodecg-io install
```

You will get a prompt which asks you which version you want to install.
You will get a prompt which asks you which version you want to install.

- By selecting an actual version (e.g., `0.1`) you create a production install that downloads the required packages from npm and setups a npm workspace to install all dependencies. Here you can choose which services you want to install.
- By selecting an actual version (e.g., `0.1`) you create a production install that downloads the required packages from npm and setups a npm workspace to install all dependencies. Here you can choose which services you want to install.

- By selecting `development` you create a development install that clones the nodecg-io git repo and builds everything from scratch. We only recommend a dev install if you are sure that you want to contribute to nodecg-io. Here you always must install all services.
- By selecting `development` you create a development install that clones the nodecg-io git repo and builds everything from scratch. We only recommend a dev install if you are sure that you want to contribute to nodecg-io. Here you always must install all services.

For starters, we recommend using the latest non-development version.

Expand All @@ -93,4 +92,4 @@ If you want to uninstall nodecg-io you can run the following command:
nodecg-io uninstall
```

This will remove the `nodecg-io` directory inside your nodecg installation and also will remove it from the loaded bundle paths in your nodecg configuration.
This will remove the `nodecg-io` directory inside your nodecg installation and also will remove it from the loaded bundle paths in your nodecg configuration.
80 changes: 41 additions & 39 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
[![Feature Requests](https://img.shields.io/github/issues/codeoverflow-org/nodecg-io/enhancement?label=Feature%20Requests&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/labels/enhancement)
[![Bugs](https://img.shields.io/github/issues/codeoverflow-org/nodecg-io/bug?label=Bugs&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/labels/bug)
[![Pull Requests](https://img.shields.io/github/issues-pr/codeoverflow-org/nodecg-io?label=Pull%20Requests&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/pulls)

<!-- Do not set the 'Services implemented' value manually. It's inserted automatically. -->

[![Services](https://img.shields.io/static/v1?label=Services%20implemented&message=41&color=blue&style=flat-square)](services.md)
[![License](https://img.shields.io/github/license/codeoverflow-org/nodecg-io?label=License&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/blob/master/LICENSE)
[![Discord](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&style=flat-square)](https://discord.gg/sX2Gjbs/)
Expand All @@ -24,45 +26,45 @@ If that's no problem you can head over to the [installation guide](./getting_sta

## Implemented Services and Interfaces

- AutoHotkey
- Android (using adb)
- Art-Net
- CurseForge
- DBus
- Discord
- Discord RPC
- Elgato lights
- GitHub
- Google APIs
- IntelliJ IDEs
- IRC (Internet Relay Chat)
- MIDI Input
- MIDI Output
- MQTT
- Nanoleafs
- OBS
- Philips Hue
- RCON
- Reddit
- sACN Receiver
- sACN Sender
- Serial Port (Arduino)
- [Shlink](https://shlink.io/)
- Slack Web API
- Spotify
- SQL (using [knex](https://knexjs.org/))
- Elgato Stream Deck
- StreamElements
- Telegram
- TIANE
- Twitch Add-ons
- Twitch API
- Twitch Chat
- Twitch PubSub
- Twitter
- WebSocket Client
- WebSocket Server
- Xdotool
- AutoHotkey
- Android (using adb)
- Art-Net
- CurseForge
- DBus
- Discord
- Discord RPC
- Elgato lights
- GitHub
- Google APIs
- IntelliJ IDEs
- IRC (Internet Relay Chat)
- MIDI Input
- MIDI Output
- MQTT
- Nanoleafs
- OBS
- Philips Hue
- RCON
- Reddit
- sACN Receiver
- sACN Sender
- Serial Port (Arduino)
- [Shlink](https://shlink.io/)
- Slack Web API
- Spotify
- SQL (using [knex](https://knexjs.org/))
- Elgato Stream Deck
- StreamElements
- Telegram
- TIANE
- Twitch Add-ons
- Twitch API
- Twitch Chat
- Twitch PubSub
- Twitter
- WebSocket Client
- WebSocket Server
- Xdotool

## How to contribute

Expand Down
10 changes: 5 additions & 5 deletions docs/samples/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ The Android example bundle in `samples/android` shows how to connect to an andro

9. Run `adb device -l`. The output might look like this:

```
######## device usb:2-1.7 product:######## model:######## device:######## transport_id:2
```
The hexadecimal number in the first column is your device ID. You'll need this later.
```
######## device usb:2-1.7 product:######## model:######## device:######## transport_id:2
```

The hexadecimal number in the first column is your device ID. You'll need this later.

10. Start nodecg with nodecg-io installed. The bundle is currently part of it, so it should also be loaded.

Expand Down
3 changes: 2 additions & 1 deletion docs/samples/artnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ declare class ArtDmx {
// send new data every 0,8 seconds.
// This is the official timing for re-transmiting data in the artnet specifciation.
setInterval(() => {
client.send(universe,
client.send(
universe,
values // number[] of values for each of the 512 channels
);
}, 800);
Expand Down
8 changes: 4 additions & 4 deletions docs/samples/curseforge.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ The CurseForge example bundle in `samples/curseforge` demonstrates the ability t

### Prerequisites

- Working NodeCG & nodecg-io installation
- Working NodeCG & nodecg-io installation

### Configure the CurseForge bundle

1. Start NodeCG with nodecg-io installed. The CurseForge bundle is currently part of it, so it should also be loaded.
2. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials.
3. Create a new CurseForge service instance using the left upper menu.
4. Set the CurseForge service instance to the service dependency of the CurseForge bundle.
Select the CurseForge bundle and the CurseForge service in the left bottom menu and then select the service instance that should be used by the CurseForge bundle (in this case the name of the previously created CurseForge instance).
5. Check the NodeCG logs. You should see two lists of add-ons.
4. Set the CurseForge service instance to the service dependency of the CurseForge bundle.
Select the CurseForge bundle and the CurseForge service in the left bottom menu and then select the service instance that should be used by the CurseForge bundle (in this case the name of the previously created CurseForge instance).
5. Check the NodeCG logs. You should see two lists of add-ons.
10 changes: 5 additions & 5 deletions docs/samples/dbus-ratbagd.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ The dbus-ratbagd example bundle in `samples/dbus-ratbagd` demonstrates how to ac

5. Configure the dbus service

There should not be any additional configuration needed for the dbus service. Just enter an empty json object like this:
There should not be any additional configuration needed for the dbus service. Just enter an empty json object like this:

```json
{}
```

After entering it, click save.
After entering it, click save.

_Note:_ If you don't see monaco on the right, try reloading the page.
_Note:_ If you don't see monaco on the right, try reloading the page.

6. Set the created dbus service instance to the service dependency of the dbus-ratbagd bundle.

Select the dbus-ratbagd bundle and the dbus service in the left bottom menu and then select the service instance that should be used by the dbus-ratbagd sample bundle (in this case the name of the previously created dbus instance).
Select the dbus-ratbagd bundle and the dbus service in the left bottom menu and then select the service instance that should be used by the dbus-ratbagd sample bundle (in this case the name of the previously created dbus instance).

7. Check the nodecg logs

You should see an error or a success message and a list of connected device names
You should see an error or a success message and a list of connected device names
8 changes: 4 additions & 4 deletions docs/samples/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ The Debug Helper example bundle in `samples/debug` demonstrates the ability to u

### Prerequisites

- Working NodeCG & nodecg-io installation
- Working NodeCG & nodecg-io installation

### Configure the Debug sample bundle

1. Start NodeCG with nodecg-io installed. The Debug sample bundle is currently part of it, so it should also be loaded.
2. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials.
3. Create a new Debug service instance using the left upper menu.
4. Set the Debug service instance to the service dependency of the Debug sample bundle.
Select the Debug sample bundle and the Debug service in the left bottom menu and then select the service instance that should be used by the Debug sample bundle (in this case the name of the previously created Debug instance).
4. Set the Debug service instance to the service dependency of the Debug sample bundle.
Select the Debug sample bundle and the Debug service in the left bottom menu and then select the service instance that should be used by the Debug sample bundle (in this case the name of the previously created Debug instance).
5. Go to the nodecg-io-debug dashboard and use some buttons or other inputs.
6. Check the nodecg log. It should contain a message for each action you did and the passed values.
6. Check the nodecg log. It should contain a message for each action you did and the passed values.
10 changes: 5 additions & 5 deletions docs/samples/discord-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _Note:_ If you don't have an application yet, you can create one [here](https://

5. Enter required information.

The created instance should be automatically selected, if not select it in the upper left menu. Enter your information in monaco (the text-editor on the right) in this format:
The created instance should be automatically selected, if not select it in the upper left menu. Enter your information in monaco (the text-editor on the right) in this format:

```json
{
Expand All @@ -30,14 +30,14 @@ _Note:_ If you don't have an application yet, you can create one [here](https://
}
```

After entering it, click save.
After entering it, click save.

_Note:_ If you don't see monaco on the right, try reloading the page.
_Note:_ If you don't see monaco on the right, try reloading the page.

6. Set the created discord-rpc service instance to the service dependency of the discord-rpc bundle.

Select the discord-rpc bundle and the discord-rpc service in the left bottom menu and then select the service instance that should be used by the discord-rpc sample bundle (in this case the name of the previously created discord-rpc instance).
Select the discord-rpc bundle and the discord-rpc service in the left bottom menu and then select the service instance that should be used by the discord-rpc sample bundle (in this case the name of the previously created discord-rpc instance).

7. Check the nodecg logs

You should see an error or a success message displaying your discord username.
You should see an error or a success message displaying your discord username.
Loading