Skip to content

Commit

Permalink
Update devcontainer usage with docusarus and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Oct 8, 2024
1 parent 6780d72 commit f2f550d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
12 changes: 10 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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.
Expand Down
13 changes: 10 additions & 3 deletions docsite/docs/development/dev-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docsite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f2f550d

Please sign in to comment.