diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 04a0edf..40b5bb5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,10 +9,10 @@ // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [9078], + "forwardPorts": [9078,3000], // Use 'postCreateCommand' to run commands after the container is created. - //"postCreateCommand": "./.devcontainer/postCreateCommand.sh" + "postCreateCommand": "npm install", // Configure tool-specific properties. "customizations": { @@ -22,6 +22,14 @@ "dbaeumer.vscode-eslint" ] } + }, + "portsAttributes": { + "3000": { + "label": "Docusaurus" + }, + "9078": { + "label": "App" + } } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. diff --git a/docsite/docs/development/dev-common.md b/docsite/docs/development/dev-common.md index 2dbdca3..68d2519 100644 --- a/docsite/docs/development/dev-common.md +++ b/docsite/docs/development/dev-common.md @@ -14,14 +14,20 @@ Multi-scrobbler is written entirely in [Typescript](https://www.typescriptlang.o ## Project Setup -Development requires [Node v18.19.1](https://nodejs.org/en) or higher is installed on your system. It is recommended to use [nvm](https://github.com/nvm-sh/nvm) to manage the installed node version. +Development requires [Node v18.19.1](https://nodejs.org/en) or higher is installed on your system. + +:::tip + +When running locally (not with a devcontainer) you can use [nvm](https://github.com/nvm-sh/nvm) to manage the installed node version. + +::: Clone this repository somewhere and then install from the working directory ```shell git clone https://github.com/FoxxMD/multi-scrobbler.git . cd multi-scrobbler -nvm use # optional, to set correct Node version +nvm use # optional, sets correct node version when running without devcontainer npm install npm run start ``` @@ -32,8 +38,9 @@ This repository contains [workspace settings](https://github.com/FoxxMD/multi-sc * Run/Debug [Launch configurations](https://code.visualstudio.com/Docs/editor/debugging#_launch-configurations) for the application and tests * [Devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) for development with all dependencies already installed +* Useful extensions for linting and running tests -To use the Devcontainer simple open the repository in VSCode and "Use Devcontainer" when the notification is presented. You will still need to run `nvm use` and `npm install` the first time it is used. +To use the Devcontainer simple open the repository in VSCode and "Use Devcontainer" when the notification is presented. `npm install` will be run when a new container is created. ## Common Development diff --git a/docsite/package.json b/docsite/package.json index ef4958f..cd5216f 100644 --- a/docsite/package.json +++ b/docsite/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { - "start": "npx docusaurus start", + "start": "npx docusaurus start --host 0.0.0.0", "build": "npx docusaurus build", "swizzle": "npx docusaurus swizzle", "deploy": "npx docusaurus deploy",