Skip to content

Commit b5531dd

Browse files
committed
Update reference to replace make commands by npm
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
1 parent ae5d4a2 commit b5531dd

File tree

9 files changed

+74
-53
lines changed

9 files changed

+74
-53
lines changed

.github/workflows/frontend.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,13 @@ jobs:
152152
with:
153153
node-version: ${{ matrix.node-version }}
154154
cache: "npm"
155-
cache-dependency-path: frontend/package-lock.json
155+
cache-dependency-path: |
156+
package-lock.json
157+
frontend/package-lock.json
156158
157159
- name: Build docs
158160
run: |
159-
make docs
161+
npm run docs
160162
161163
buildstorybook:
162164
name: build storybook

app/e2e-tests/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ To run the tests for the web mode, you will need to have the backend running. Fo
4141
`cd headlamp`
4242

4343
- run the following command
44-
`make backend` followed by `make run-backend`
44+
`npm run backend:build` followed by `npm run backend:start`
4545

4646
### Frontend
4747

4848
To run the tests for the web mode, you will need to have the frontend running. Follow the steps below to run the frontend:
4949

5050
- cd into the headlamp directory in a separate terminal
51-
`cd headlamp/frontend`
51+
`cd headlamp`
5252

5353
- run the following command
54-
`make frontend` followed by `make run-frontend`
54+
`npm run frontend:build` followed by `npm run frontend:start`
5555

5656
### Running the tests
5757

backend/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Quickstart
22

33
```bash
4-
make backend
5-
make run-backend
4+
npm run backend:build
5+
npm run backend:start
66
```
77

88
See more detailed [Headlamp backend documentation on the web](

docs/contributing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Follow these steps when submitting a PR to ensure it meets the project’s stand
5555

5656
Run the following commands from your project directory:
5757

58-
- `make frontend-test` - Run the test suite
59-
- `make frontend-lint` - Format your code to match the project
58+
- `npm run frontend:test` - Run the test suite
59+
- `npm run frontend:lint` - Format your code to match the project
6060

6161
These steps ensure your code is functional, well-typed, and formatted consistently.
6262

@@ -156,11 +156,11 @@ For linting the `backend` and `frontend`, use the following commands
156156
(respectively):
157157

158158
```bash
159-
make backend-lint
159+
npm run backend:lint
160160
```
161161

162162
```bash
163-
make frontend-lint
163+
npm run frontend:lint
164164
```
165165

166166
The linters are also run in the CI system, so any PRs you create will be
@@ -194,13 +194,13 @@ an associated story when possible.
194194
For running the frontend tests, use the following command:
195195

196196
```bash
197-
make frontend-test
197+
npm run frontend:test
198198
```
199199

200200
The backend uses go's testing and can be run by using the following command:
201201

202202
```bash
203-
make backend-test
203+
npm run backend:test
204204
```
205205

206206
Tests will run as part of the CI after a Pull Request is open.

docs/development/architecture.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Notes:
6161

6262
How does Headlamp get real-time updates from Kubernetes clusters?
6363

64-
- WebSockets are used for real-time updates from Kubernetes.
64+
- WebSockets are used for real-time updates from Kubernetes.
6565
- Browsers support a limited number of connections: six usually.
6666
- How is the browser's WebSocket limit overcome? Headlamp uses one WebSocket from the browser to the `headlamp-server`. That server then opens many WebSockets to different Kubernetes API servers.
6767

@@ -135,16 +135,16 @@ The headlamp/ repo [Makefile](https://github.com/kubernetes-sigs/headlamp/blob/m
135135
Here are some examples:
136136

137137
```shell
138-
make backend
139-
make backend-lint
140-
make backend-test
141-
make run-backend
142-
make frontend
143-
make frontend-lint
144-
make frontend-test
145-
make run-frontend
146-
make app-test
147-
make run-app
138+
npm run backend:build
139+
npm run backend:lint
140+
npm run backend:test
141+
npm run backend:start
142+
npm run frontend:build
143+
npm run frontend:lint
144+
npm run frontend:test
145+
npm run frontend:start
146+
npm run app:test
147+
npm run start:app
148148
```
149149

150150
### Frontend
@@ -222,7 +222,7 @@ As mentioned above, Headlamp can be deployed as a container inside a Kubernetes
222222

223223
## Future Work
224224

225-
To see planned or in progress features, check the [Release Plan / Roadmap](https://github.com/orgs/headlamp-k8s/projects/1/views/1). It’s regularly updated, but it's a tentative plan.
225+
To see planned or in progress features, check the [Release Plan / Roadmap](https://github.com/orgs/headlamp-k8s/projects/1/views/1). It’s regularly updated, but it's a tentative plan.
226226

227227
Note: Since Headlamp is open source, people contribute things that aren’t listed there. You can also explore:
228228
- [Open issues](https://github.com/kubernetes-sigs/headlamp/issues) — for bugs, feature requests, and discussions.

docs/development/backend.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,51 +18,51 @@ redirects the requests to the defined proxies.
1818
The backend (Headlamp's server) can be quickly built using:
1919

2020
```bash
21-
make backend
21+
npm run backend:build
2222
```
2323

2424
Once built, it can be run in development mode (insecure / don't use in production) using:
2525

2626
```bash
27-
make run-backend
27+
npm run backend:start
2828
```
2929

3030
## Lint
3131

3232
To lint the backend/ code.
3333

3434
```bash
35-
make backend-lint
35+
npm run backend:lint
3636
```
3737

3838
This command can fix some lint issues.
3939

4040
```bash
41-
make backend-lint-fix
41+
npm run backend:lint:fix
4242
```
4343

4444
## Format
4545

4646
To format the backend code.
4747

4848
```bash
49-
make backend-format
49+
npm run backend:format
5050
```
5151

5252
## Test
5353

5454
```bash
55-
make backend-test
55+
npm run backend:test
5656
```
5757

5858
Test coverage with a html report in the browser.
5959

6060
```bash
61-
make backend-coverage-html
61+
npm run backend:coverage:html
6262
```
6363

6464
To just print a simpler coverage report to the console.
6565
```bash
66-
make backend-coverage
66+
npm run backend:coverage
6767
```
6868

docs/development/frontend.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ The frontend is written in Typescript and React, as well as a few other importan
1515
The frontend can be quickly built using:
1616

1717
```bash
18-
make frontend
18+
npm run frontend:build
1919
```
2020

2121
Once built, it can be run in development mode (auto-refresh) using:
2222

2323
```bash
24-
make run-frontend
24+
npm run frontend:start
2525
```
2626

2727
This command leverages the `create-react-app`'s start script that launches
2828
a development server for the frontend (by default at `localhost:3000`).
2929

30-
We use [react-query](https://tanstack.com/query/latest/docs/framework/react/overview)
30+
We use [react-query](https://tanstack.com/query/latest/docs/framework/react/overview)
3131
for network request, if you need the devtools for react-query, you can simply set `REACT_APP_ENABLE_REACT_QUERY_DEVTOOLS=true` in the `.env` file.
3232

3333
## API documentation
3434

3535
API documentation for TypeScript is done with [typedoc](https://typedoc.org/) and [typedoc-plugin-markdown](https://github.com/tgreyuk/typedoc-plugin-markdown), and is configured in tsconfig.json
3636

3737
```bash
38-
make docs
38+
npm run docs
3939
```
4040

4141
The API output markdown is generated in docs/development/api and is not
@@ -49,7 +49,7 @@ Components can be discovered, developed, and tested inside the 'storybook'.
4949
From within the [Headlamp](https://github.com/kubernetes-sigs/headlamp/) repo run:
5050

5151
```bash
52-
make storybook
52+
npm run frontend:storybook
5353
```
5454

5555
If you are adding new stories, please wrap your story components with the `TestContext` helper
@@ -75,7 +75,7 @@ Any issues found are reported in the developer console.
7575
To enable the alert message during development, use the following:
7676

7777
```bash
78-
REACT_APP_SKIP_A11Y=false make run-frontend
78+
REACT_APP_SKIP_A11Y=false npm run frontend:start
7979
```
8080

8181
This shows an alert when an a11y issue is detected.

docs/development/i18n/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Here's an example of using date formatting:
9191
Create a folder using the locale code in:
9292
`frontend/src/i18n/locales/`
9393

94-
Then run `make i18n`. This command parses the translatable strings in
94+
Then run `npm run i18n`. This command parses the translatable strings in
9595
the project and creates the corresponding catalog files.
9696

9797
Integrated components may need to be adjusted (MaterialUI/Monaco etc).

docs/development/index.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,32 @@ These are the required dependencies to get started. Other dependencies are pulle
1616

1717
- [Node.js](https://nodejs.org/en/download/) Latest LTS (20.11.1 at time of writing). Many of us use [nvm](https://github.com/nvm-sh/nvm) for installing multiple versions of Node.
1818
- [Go](https://go.dev/doc/install), (1.24 at time of writing)
19-
- [Make](https://www.gnu.org/software/make/) (GNU). Often installed by default. On Windows this can be installed with the "chocolatey" package manager that is installed with node.
2019
- [Kubernetes](https://kubernetes.io/), we suggest [minikube](https://minikube.sigs.k8s.io/docs/) as one good K8s installation for testing locally. Other k8s installations are supported (see [platforms](../platforms.md).
2120

21+
## NPM Workspace Commands
22+
23+
Headlamp uses npm workspaces for managing dependencies across the frontend, app, and other components. The top-level `package.json` provides convenient scripts to work with all components from the root directory.
24+
2225
## Build the code
2326

2427
Headlamp is composed of a `backend` and a `frontend`.
2528

2629
You can build both the `backend` and `frontend` by running.
2730

2831
```bash
29-
make
32+
npm run build
3033
```
3134

3235
Or individually:
3336

3437
```bash
35-
make backend
38+
npm run backend:build
3639
```
3740

3841
and
3942

4043
```bash
41-
make frontend
44+
npm run frontend:build
4245
```
4346

4447
## Run the code
@@ -47,15 +50,31 @@ The quickest way to get the `backend` and `frontend` running for development is
4750
the following (respectively):
4851

4952
```bash
50-
make run-backend
53+
npm run backend:start
5154
```
5255

5356
and in a different terminal instance:
5457

5558
```bash
56-
make run-frontend
59+
npm run frontend:start
60+
```
61+
62+
Or you can run both together with:
63+
64+
```bash
65+
npm run start
5766
```
5867

68+
## Generate API documentation
69+
70+
To generate the TypeScript API documentation:
71+
72+
```bash
73+
npm run docs
74+
```
75+
76+
This generates API documentation in `docs/development/api/` using TypeDoc.
77+
5978
## Build the app
6079

6180
You can build the app for Linux, Windows, or Mac.
@@ -66,15 +85,15 @@ and the linux app on a linux box.
6685
Choose the relevant command:
6786

6887
```bash
69-
make app-linux
88+
npm run app:package:linux
7089
```
7190

7291
```bash
73-
make app-mac
92+
npm run app:package:mac
7493
```
7594

7695
```bash
77-
make app-win
96+
npm run app:package:win
7897
```
7998

8099
For Windows, by default it will produce an installer using [NSIS (Nullsoft Scriptable Install System)](https://sourceforge.net/projects/nsis/).
@@ -90,24 +109,24 @@ set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin
90109
Then run the following command to generate the `.msi` installer:
91110

92111
```bash
93-
make app-win-msi
112+
npm run app:package:win:msi
94113
```
95114

96115
See the generated app files in app/dist/ .
97116

98117
### Running the app
99118

100-
If you already have **BOTH** the `backend` and `frontend` up and running, the quickest way to
119+
If you already have **BOTH** the `backend` and `frontend` up and running, the quickest way to
101120
get the `app` running for development is the following:
102121

103122
```bash
104-
make run-only-app
123+
npm run app:start:client
105124
```
106125

107126
or else you can simply do
108127

109128
```bash
110-
make run-app
129+
npm run start:app
111130
```
112131

113132
which runs everything including the `backend`, `frontend` and `app` in parallel.

0 commit comments

Comments
 (0)