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: pkg/ui/react-app/README.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -13,24 +13,24 @@ Instead of plain JavaScript, we use [TypeScript](https://www.typescriptlang.org/
13
13
To work with the React UI code, you will need to have the following tools installed:
14
14
15
15
* The [Node.js](https://nodejs.org/) JavaScript runtime.
16
-
* The [Yarn](https://yarnpkg.com/) package manager.
16
+
* The [npm](https://www.npmjs.com/) package manager. Once you installed Node, npm should already be available.
17
17
**Recommended:* An editor with TypeScript, React, and [ESLint](https://eslint.org/) linting support. See e.g. [Create React App's editor setup instructions](https://create-react-app.dev/docs/setting-up-your-editor/). If you are not sure which editor to use, we recommend using [Visual Studio Code](https://code.visualstudio.com/docs/languages/typescript). Make sure that [the editor uses the project's TypeScript version rather than its own](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-the-workspace-version-of-typescript).
18
18
19
19
**NOTE**: When using Visual Studio Code, be sure to open the `pkg/ui/react-app` directory in the editor instead of the root of the repository. This way, the right ESLint and TypeScript configuration will be picked up from the React workspace.
20
20
21
21
## Installing npm dependencies
22
22
23
-
The React UI depends on a large number of [npm](https://www.npmjs.com/) packages. These are not checked in, so you will need to download and install them locally via the Yarn package manager:
23
+
The React UI depends on a large number of [npm](https://www.npmjs.com/) packages. These are not checked in, so you will need to download and install them locally via the npm package manager:
24
24
25
-
yarn
25
+
npm install
26
26
27
-
Yarn consults the `package.json` and `yarn.lock` files for dependencies to install. It creates a `node_modules` directory with all installed dependencies.
27
+
npm consults the `package.json` and `package-lock.json` files for dependencies to install. It creates a `node_modules` directory with all installed dependencies.
28
28
29
29
## Running a local development server
30
30
31
31
You can start a development server for the React UI outside of a running Thanos server by running:
32
32
33
-
yarn start
33
+
npm start
34
34
35
35
This will open a browser window with the React app running on http://localhost:3000/. The page will reload if you make edits to the source code. You will also see any lint errors in the console.
36
36
@@ -42,11 +42,11 @@ Due to a `"proxy": "http://localhost:10902"` setting in the `package.json` file,
42
42
43
43
Create React App uses the [Jest](https://jestjs.io/) framework for running tests. To run tests in interactive watch mode:
44
44
45
-
yarn test
45
+
npm test
46
46
47
47
To generate an HTML-based test coverage report, run:
48
48
49
-
CI=true yarn test --coverage
49
+
CI=true npm test --coverage
50
50
51
51
This creates a `coverage` subdirectory with the generated report. Open `coverage/lcov-report/index.html` in the browser to view it.
52
52
@@ -60,15 +60,15 @@ We define linting rules for the [ESLint](https://eslint.org/) linter. We recomme
60
60
61
61
To detect and automatically fix lint errors, run:
62
62
63
-
yarn lint
63
+
npm run lint
64
64
65
65
This is also available via the `react-app-lint-fix` target in the main Thanos `Makefile`.
66
66
67
67
## Building the app for production
68
68
69
69
To build a production-optimized version of the React app to a `build` subdirectory, run:
70
70
71
-
yarn build
71
+
npm run build
72
72
73
73
**NOTE:** You will likely not need to do this directly. Instead, this is taken care of by the `assets` target in the main Thanos `Makefile` when building the full binary.
0 commit comments