You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/architecture.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ Notes:
61
61
62
62
How does Headlamp get real-time updates from Kubernetes clusters?
63
63
64
-
- WebSockets are used for real-time updates from Kubernetes.
64
+
- WebSockets are used for real-time updates from Kubernetes.
65
65
- Browsers support a limited number of connections: six usually.
66
66
- 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.
67
67
@@ -135,16 +135,16 @@ The headlamp/ repo [Makefile](https://github.com/kubernetes-sigs/headlamp/blob/m
135
135
Here are some examples:
136
136
137
137
```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 runbackend:start
142
+
npm run frontend:build
143
+
npm run frontend:lint
144
+
npm run frontend:test
145
+
npm runfrontend:start
146
+
npm run app:test
147
+
npm run start:app
148
148
```
149
149
150
150
### Frontend
@@ -222,7 +222,7 @@ As mentioned above, Headlamp can be deployed as a container inside a Kubernetes
222
222
223
223
## Future Work
224
224
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.
226
226
227
227
Note: Since Headlamp is open source, people contribute things that aren’t listed there. You can also explore:
228
228
-[Open issues](https://github.com/kubernetes-sigs/headlamp/issues) — for bugs, feature requests, and discussions.
Copy file name to clipboardExpand all lines: docs/development/frontend.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,27 +15,27 @@ The frontend is written in Typescript and React, as well as a few other importan
15
15
The frontend can be quickly built using:
16
16
17
17
```bash
18
-
make frontend
18
+
npm run frontend:build
19
19
```
20
20
21
21
Once built, it can be run in development mode (auto-refresh) using:
22
22
23
23
```bash
24
-
make run-frontend
24
+
npm runfrontend:start
25
25
```
26
26
27
27
This command leverages the `create-react-app`'s start script that launches
28
28
a development server for the frontend (by default at `localhost:3000`).
29
29
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)
31
31
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.
32
32
33
33
## API documentation
34
34
35
35
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
36
36
37
37
```bash
38
-
make docs
38
+
npm run docs
39
39
```
40
40
41
41
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'.
49
49
From within the [Headlamp](https://github.com/kubernetes-sigs/headlamp/) repo run:
50
50
51
51
```bash
52
-
make storybook
52
+
npm run frontend:storybook
53
53
```
54
54
55
55
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.
75
75
To enable the alert message during development, use the following:
76
76
77
77
```bash
78
-
REACT_APP_SKIP_A11Y=false make run-frontend
78
+
REACT_APP_SKIP_A11Y=false npm runfrontend:start
79
79
```
80
80
81
81
This shows an alert when an a11y issue is detected.
Copy file name to clipboardExpand all lines: docs/development/index.md
+32-13Lines changed: 32 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,29 +16,32 @@ These are the required dependencies to get started. Other dependencies are pulle
16
16
17
17
-[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.
18
18
-[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.
20
19
-[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).
21
20
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
+
22
25
## Build the code
23
26
24
27
Headlamp is composed of a `backend` and a `frontend`.
25
28
26
29
You can build both the `backend` and `frontend` by running.
27
30
28
31
```bash
29
-
make
32
+
npm run build
30
33
```
31
34
32
35
Or individually:
33
36
34
37
```bash
35
-
make backend
38
+
npm run backend:build
36
39
```
37
40
38
41
and
39
42
40
43
```bash
41
-
make frontend
44
+
npm run frontend:build
42
45
```
43
46
44
47
## Run the code
@@ -47,15 +50,31 @@ The quickest way to get the `backend` and `frontend` running for development is
47
50
the following (respectively):
48
51
49
52
```bash
50
-
make run-backend
53
+
npm runbackend:start
51
54
```
52
55
53
56
and in a different terminal instance:
54
57
55
58
```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
57
66
```
58
67
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
+
59
78
## Build the app
60
79
61
80
You can build the app for Linux, Windows, or Mac.
@@ -66,15 +85,15 @@ and the linux app on a linux box.
66
85
Choose the relevant command:
67
86
68
87
```bash
69
-
make app-linux
88
+
npm run app:package:linux
70
89
```
71
90
72
91
```bash
73
-
make app-mac
92
+
npm run app:package:mac
74
93
```
75
94
76
95
```bash
77
-
make app-win
96
+
npm run app:package:win
78
97
```
79
98
80
99
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
90
109
Then run the following command to generate the `.msi` installer:
91
110
92
111
```bash
93
-
make app-win-msi
112
+
npm run app:package:win:msi
94
113
```
95
114
96
115
See the generated app files in app/dist/ .
97
116
98
117
### Running the app
99
118
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
101
120
get the `app` running for development is the following:
102
121
103
122
```bash
104
-
make run-only-app
123
+
npm runapp:start:client
105
124
```
106
125
107
126
or else you can simply do
108
127
109
128
```bash
110
-
make run-app
129
+
npm run start:app
111
130
```
112
131
113
132
which runs everything including the `backend`, `frontend` and `app` in parallel.
0 commit comments