Skip to content

Commit 978a79d

Browse files
joeldevelopsjoeldevelops
authored andcommitted
Fixes for control extensions, improvements for readme and contributing guide
1 parent 190bb24 commit 978a79d

File tree

4 files changed

+65
-64
lines changed

4 files changed

+65
-64
lines changed

.github/CONTRIBUTING.md

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Make use of the issue templates, and label your issues appropriately. If you’r
4141

4242
You will need the following tools to develop NanoAPI:
4343

44-
- [Node.js](https://nodejs.org/en/) version 18 or higher.
44+
- [Node.js](https://nodejs.org/en/) version 22 or higher.
4545

4646
### Environment Set Up
4747

@@ -72,25 +72,42 @@ $ git remote add upstream https://github.com/nanoapi-io/napi.git
7272
$ npm install
7373
```
7474

75+
> [!NOTE]
76+
> You may encounter issues on a second or third install of dependencies. If this happens, install with `npm i --no-cache --force` to fix these issues.
77+
7578
### Running the Project
7679

77-
When running locally, the UI must be built before the CLI can be run.
80+
When running locally, the shared libraries and the UI must be built before the CLI can be run.
7881

79-
To build the UI:
82+
To build them:
8083

8184
```bash
8285
$ npm run build
8386
```
8487

85-
To run the CLI:
88+
Next, we want to run the CLI and the UI with hot reload. You will need two terminal windows for this.
89+
90+
1. In the first terminal, run the CLI. This command should be run in the `napi` directory with a `workdir` pointing to the project you want to work on. For example, if you want to work on Apache Airflow, run:
8691

8792
```bash
88-
$ npm start
93+
$ npm run dev:cli -- audit view -- --workdir=/path/to/airflow
8994
```
9095

9196
Running the `audit view` command from the CLI will spin up a web server on your localhost. You can access the UI by navigating to `http://localhost:3000`.
9297

93-
> **Note:** In case of port collisions, the UI will automatically switch to the next available port.
98+
> [!NOTE]
99+
> In case of port collisions, the UI will automatically switch to the next available port.
100+
101+
2. In the second terminal, run the UI. This command should be run in the `napi` directory as well:
102+
103+
```bash
104+
$ npm run dev:app
105+
```
106+
107+
This controls the hot reload functionality for the UI. You can now make changes to the UI and see them reflected in real-time.
108+
109+
> [!IMPORTANT]
110+
> The react UI elements (sidebar, header, etc.) will automatically reload when you make changes. However any Cytoscape elements will not. You will need to refresh the page to see those changes.
94111
95112
### Project Setup
96113

@@ -102,34 +119,14 @@ git clone https://github.com/apache/airflow.git
102119
cd airflow
103120
```
104121

105-
2. From the `napi` repo initialize the project using the CLI:
122+
2. From the `napi` repo initialize the project using the CLI, which will create a `.napirc` file in the project root. This file contains the configuration for the project and is required for the CLI to work.:
106123
```bash
107124
cd /path/to/napi # or just use a different terminal
108125
npm start -- init -- --workdir=/path/to/airflow
109126
```
110127

111-
3. This will create a `.napirc` file in root of the project. The file should look like the following. You can copy this content into the file and overwrite it if you are having issues.
112-
```json
113-
{
114-
"entrypoint": "app.py",
115-
"out": "napi_dist",
116-
"audit": {
117-
"language": "python",
118-
"include": ["airflow-core/src/airflow/**/*"],
119-
"exclude": [],
120-
"targetMaxCharInFile": 5000,
121-
"targetMaxLineInFile": 500,
122-
"targetMaxDepPerFile": 4
123-
}
124-
}
125-
```
126-
127-
4. Now the audit view can be run.
128-
```bash
129-
npm start -- audit view -- --workdir=/path/to/airflow
130-
```
131-
132-
5. The audit view will be available at `http://localhost:3000` and should automatically open in your default browser.
128+
> [!NOTE]
129+
> If you encounter any issues with the config file, you can [check the reference for the file on our documentation](https://docs.nanoapi.io/default-guide/reference/napirc).
133130
134131
### Testing
135132

@@ -153,6 +150,14 @@ To ensure releases run smoothly, put the content of your changes in our [CHANGEL
153150

154151
We are also building on the documentation process. For now, include any documentation changes in your PRs and we will add them into the main documentation.
155152

153+
The critical documentation to maintain is for any changes that impact the following:
154+
- CLI commands
155+
- Configuration file
156+
- Local development setup
157+
- Release process
158+
- Testing
159+
- Linting
160+
156161
### Discussions vs Issues
157162

158163
We use GitHub Discussions for general questions, ideas, and feedback. If you have a question, please use the Discussions tab. If you have a bug report or feature request, please use the Issues tab.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ For the latest updates, visit our [project board](/projects).
4646

4747
## Installation
4848

49+
> [!IMPORTANT]
50+
> `napi` works out of the box on both mac and linux systems. To use this tool on Windows, you will need to install [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install) and run the CLI commands from there.
51+
4952
Ensure you have Node.js (>=22) and npm installed.
5053

5154
https://nodejs.org/en

packages/app/src/components/Cytoscape/ControlExtensions/FiltersExtension.tsx

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -168,26 +168,24 @@ export default function FiltersExtension(props: {
168168
return (
169169
<DropdownMenu.Root>
170170
<DropdownMenu.Trigger>
171-
<Tooltip content="Filter visible elements" side="top">
172-
<Button
173-
size="1"
174-
variant="ghost"
175-
color="violet"
176-
highContrast
177-
className={`${checkFiltersSet() ? "bg-primary-light/20 dark:bg-primary-dark/20" : ""}`}
178-
disabled={props.busy}
179-
onClick={() => props.onLayout()}
180-
>
181-
<MdFilterAlt
182-
className={`text-xl h-5 w-5 ${
183-
checkFiltersSet()
184-
? "text-primary-light dark:text-primary-dark"
185-
: "text-gray-light dark:text-gray-dark"
186-
}`}
187-
/>
188-
<LuChevronUp />
189-
</Button>
190-
</Tooltip>
171+
<Button
172+
size="1"
173+
variant="ghost"
174+
color="violet"
175+
highContrast
176+
className={`${checkFiltersSet() ? "bg-primary-light/20 dark:bg-primary-dark/20" : ""}`}
177+
disabled={props.busy}
178+
onClick={() => props.onLayout()}
179+
>
180+
<MdFilterAlt
181+
className={`text-xl h-5 w-5 ${
182+
checkFiltersSet()
183+
? "text-primary-light dark:text-primary-dark"
184+
: "text-gray-light dark:text-gray-dark"
185+
}`}
186+
/>
187+
<LuChevronUp />
188+
</Button>
191189
</DropdownMenu.Trigger>
192190
<DropdownMenu.Content color="violet" variant="soft">
193191
{/* Add filter options here */}

packages/app/src/components/Cytoscape/ControlExtensions/MetricsExtension.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,17 @@ export default function MetricsExtension(props: {
5050
return (
5151
<DropdownMenu.Root>
5252
<DropdownMenu.Trigger>
53-
<Tooltip
54-
content="Select metric to highlight failing nodes for that metric"
55-
side="top"
53+
<Button
54+
size="1"
55+
variant="ghost"
56+
color="violet"
57+
highContrast
58+
disabled={props.busy}
59+
className="py-1.5"
5660
>
57-
<Button
58-
size="1"
59-
variant="ghost"
60-
color="violet"
61-
highContrast
62-
disabled={props.busy}
63-
className="py-1.5"
64-
>
65-
{getMetricLabel(metric)}
66-
<LuChevronUp />
67-
</Button>
68-
</Tooltip>
61+
{getMetricLabel(metric)}
62+
<LuChevronUp />
63+
</Button>
6964
</DropdownMenu.Trigger>
7065
<DropdownMenu.Content color="violet" variant="soft">
7166
<DropdownMenu.Item

0 commit comments

Comments
 (0)