Skip to content

Commit 2277cfa

Browse files
committed
chore: simplify local run commands
1 parent a2634be commit 2277cfa

File tree

4 files changed

+19
-46
lines changed

4 files changed

+19
-46
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,42 +120,29 @@ You might find useful to run both the documentation website and the API referenc
120120
1. Build the Docker image (only needed the first time):
121121

122122
```bash
123-
npm run docs-buildDockerImage
123+
npm run docs:docker:build
124124
```
125125

126126
2. Run the documentation website:
127127

128128
```bash
129-
npm run docs-runLocalDocker
129+
npm run docs:docker:run
130130
```
131131

132132
#### Using Python directly
133133

134-
If you have Python installed, you can run the documentation website and API reference locally without Docker:
134+
If you have Python 3.x installed, you can run the documentation website and API reference locally without Docker:
135135

136-
1. Create a virtual environment:
136+
1. Create a virtual environment and install dependencies:
137137

138138
```bash
139-
python3 -m venv .venv
139+
npm run docs:local:setup
140140
```
141141

142-
2. Activate the virtual environment:
143-
144-
```bash
145-
source .venv/bin/activate # Linux/Mac
146-
.venv\Scripts\activate # Windows
147-
```
148-
149-
3. Install the required dependencies:
150-
151-
```bash
152-
pip install -r docs/requirements.txt
153-
```
154-
155-
4. Run the documentation website:
142+
2. Run the documentation website:
156143

157144
```bash
158-
mkdocs serve
145+
npm run docs:local:run
159146
```
160147

161148
## Conventions

docs/contributing/setup.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,40 +74,27 @@ You might find useful to run both the documentation website and the API referenc
7474
1. Build the Docker image (only needed the first time):
7575

7676
```bash
77-
npm run docs-buildDockerImage
77+
npm run docs:docker:build
7878
```
7979

8080
2. Run the documentation website:
8181

8282
```bash
83-
npm run docs-runLocalDocker
83+
npm run docs:docker:run
8484
```
8585

8686
#### Using Python directly
8787

8888
If you have Python installed, you can run the documentation website and API reference locally without Docker:
8989

90-
1. Create a virtual environment:
90+
1. Create a virtual environment and install dependencies:
9191

9292
```bash
93-
python3 -m venv .venv
93+
npm run docs:local:setup
9494
```
9595

96-
2. Activate the virtual environment:
97-
98-
```bash
99-
source .venv/bin/activate # Linux/Mac
100-
.venv\Scripts\activate # Windows
101-
```
102-
103-
3. Install the required dependencies:
104-
105-
```bash
106-
pip install -r docs/requirements.txt
107-
```
108-
109-
4. Run the documentation website:
96+
2. Run the documentation website:
11097

11198
```bash
112-
mkdocs serve
99+
npm run docs:local:run
113100
```

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ plugins:
141141
output_dir: 'api'
142142
tsconfig: 'tsconfig.json'
143143
options: 'typedoc.json'
144-
name: 'API Docs'
144+
name: 'API Reference'
145145

146146
extra_css:
147147
- stylesheets/extra.css

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
"commit": "commit",
2828
"setup-local": "npm ci && npm run build && husky",
2929
"build": "npm run build -ws",
30-
"docs-website-build-run": "npm run docs-buildDockerImage && npm run docs-runLocalDocker",
31-
"docs-buildDockerImage": "docker build -t powertools-typescript/docs ./docs/",
32-
"docs-runLocalDocker": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs powertools-typescript/docs",
33-
"docs-api-build-run": "npm run docs-generateApiDoc && npx live-server api",
34-
"docs-generateApiDoc": "typedoc .",
35-
"docs-runLocalApiDoc": "npx live-server api",
30+
"docs:docker:build": "docker build -t powertools-typescript/docs ./docs/",
31+
"docs:docker:run": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs powertools-typescript/docs",
32+
"docs:local:setup": "python3 -m venv .venv && .venv/bin/pip install -r docs/requirements.txt",
33+
"docs:local:run": ".venv/bin/mkdocs serve",
34+
"docs:local:api": "typedoc .",
3635
"postpublish": "git restore .",
3736
"lint:markdown": "markdownlint-cli2 '**/*.md' '#node_modules' '#**/*/node_modules' '#docs/changelog.md' '#LICENSE.md' '#.github' '#**/*/CHANGELOG.md' '#examples/app/README.md'"
3837
},

0 commit comments

Comments
 (0)