Skip to content

Commit 315f563

Browse files
authored
Move setup commands into package.json (#808)
* Update npm script * Rename server to start * Remove manual steps * Remove Hugo codespace * Switch to exec-bin * Update documentation * Update dependencies * Replace hugo * Simplify npm install command * Update vscode launch setup * Fix typo
1 parent 0196619 commit 315f563

File tree

8 files changed

+2457
-178
lines changed

8 files changed

+2457
-178
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ghcr.io/devcontainers/features/git:1": {},
66
"ghcr.io/devcontainers/features/go:1": {},
77
"ghcr.io/devcontainers/features/hugo:1": {
8-
"version": "0.102.3",
8+
"version": "0.117.0",
99
"extended": true
1010
},
1111
"ghcr.io/devcontainers/features/node:1": {}

.devcontainer/on-create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ else
1616
fi
1717

1818
## Download Bicep extension
19-
curl https://get.radapp.dev/tools/vscode-extensibility/$RADIUS_VERSION/rad-vscode-bicep.vsix --output /tmp/rad-vscode-bicep.vsix
19+
curl https://get.radapp.dev/tools/vscode-extensibility/$RADIUS_VERSION/rad-vscode-bicep.vsix --output /tmp/rad-vscode-bicep.vsix

.devcontainer/post-create.sh

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
#!/bin/bash
22

3-
# Initialize submodules
4-
git submodule update --init --recursive
5-
6-
# Clone radius repo
7-
git clone https://github.com/radius-project/radius.git
8-
9-
# Install dependencies
10-
pushd ./docs
11-
sudo npm install -D --save autoprefixer
12-
sudo npm install -D --save postcss-cli
13-
cd themes/docsy
3+
# Initialize docs package
4+
pushd docs
145
npm install
156
popd
16-
17-
# Generate CLI docs
18-
pushd ./radius
19-
go run ./cmd/docgen/main.go ../docs/content/reference/cli
20-
popd
21-
22-
# Generate Swagger docs
23-
mkdir -p ./docs/static/swagger
24-
cp -r ./radius/swagger ./docs/static/

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run docs server",
6+
"type": "node",
7+
"request": "launch",
8+
"cwd": "${workspaceFolder}/docs",
9+
"runtimeExecutable": "npm",
10+
"runtimeArgs": [
11+
"run",
12+
"start"
13+
],
14+
"preLaunchTask": "npm install"
15+
},
16+
{
17+
"name": "Build docs",
18+
"type": "node",
19+
"request": "launch",
20+
"cwd": "${workspaceFolder}/docs",
21+
"runtimeExecutable": "npm",
22+
"runtimeArgs": [
23+
"run",
24+
"build"
25+
],
26+
"preLaunchTask": "npm ci"
27+
}
28+
]
29+
}

.vscode/tasks.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "npm install",
6+
"type": "shell",
7+
"command": "npm install",
8+
"options": {
9+
"cwd": "${workspaceFolder}/docs"
10+
},
11+
"group": {
12+
"kind": "build",
13+
"isDefault": true
14+
}
15+
},
16+
{
17+
"label": "npm ci",
18+
"type": "shell",
19+
"command": "npm install",
20+
"options": {
21+
"cwd": "${workspaceFolder}/docs"
22+
},
23+
"group": {
24+
"kind": "build",
25+
"isDefault": true
26+
}
27+
}
28+
]
29+
}

docs/README.md

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,52 @@
11
# Radius documentation
22

3-
This directory contains the files to generate the https://radapp.dev site. Please go there to consume Radius docs. This document will describe how to build Radius docs locally.
3+
This directory contains the files to generate the https://docs.radapp.dev site. Please go there to consume Radius docs. This document will describe how to build Radius docs locally.
44

55
## Codespace
66

7-
The easiest way to get up and runnning with a docs environment is a GitHub codespace. Visit [this link]() to get up and running in minutes.
7+
The easiest way to get up and runnning with a docs environment is a GitHub codespace.
88

99
1. Open codespace
10-
2. Ensure postCreate script has completed (takes ~2 minutes to build CLI docs)
11-
3. `cd docs` to change into the docs directory
12-
4. `hugo server` to run a docs server
10+
2. Ensure postCreate script has completed (takes ~2 minutes)
11+
3. Run `cd docs` to change into the docs directory
12+
4. Run `npm run start` to run a docs server
1313
5. Click the `localhost:1313` link in your terminal to open the Codespace tunnel to the page
1414

15-
## Pre-requisites
15+
## Local machine
16+
17+
### Pre-requisites
1618

17-
- [Hugo extended version](https://gohugo.io/getting-started/installing)
1819
- [Node.js](https://nodejs.org/en/)
1920

20-
## Environment setup
21+
### Environment setup
2122

22-
1. Ensure pre-requisites are installed
23-
2. Clone this repository and the radius repository
23+
1. Clone this repository:
2424
```sh
25-
git clone https://github.com/radius-project/radius.git
2625
git clone https://github.com/radius-project/docs.git
2726
```
28-
3. Generate CLI docs:
29-
```sh
30-
pushd radius
31-
go run ./cmd/docgen/main.go ../docs/docs/content/reference/cli
32-
popd
33-
```
34-
4. Change to docs directory:
27+
1. Change to docs directory:
3528
```sh
3629
cd docs/docs
3730
```
38-
5. Update submodules:
39-
```sh
40-
git submodule update --init --recursive
41-
```
42-
6. Install npm packages:
31+
1. Install npm packages:
4332
```sh
4433
npm install
4534
```
46-
7. Install Docsy dependencies
35+
36+
### Run local server
37+
38+
1. Make sure you're still in the `docs/docs` directory
39+
1. Run:
4740
```sh
48-
pushd ./themes/docsy
49-
sudo npm install
50-
popd
41+
npm run start
5142
```
43+
1. Navigate to `http://localhost:1313/`
5244

53-
## Run local server
45+
### Build website
5446

5547
1. Make sure you're still in the `docs/docs` directory
56-
2. Run
48+
1. Run:
5749
```sh
58-
hugo server
50+
npm run build
5951
```
60-
3. Navigate to `http://localhost:1313/`
52+
1. Docs website will be generated under `docs/public`

0 commit comments

Comments
 (0)