Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual identity
and orientation.

### Our Standards

Expand All @@ -30,19 +30,20 @@ Examples of unacceptable behavior by participants include:
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
- Other conduct which falls outside of [NanoAPI's Open-Source Manifesto](https://github.com/Nano-API/oss-manifesto/blob/main/README.md)
- Other conduct which falls outside of
[NanoAPI's Open-Source Manifesto](https://github.com/Nano-API/oss-manifesto/blob/main/README.md)

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

### Scope

Expand All @@ -56,20 +57,23 @@ further defined and clarified by project maintainers.
### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [info@nanoapi.io](mailto:info@nanoapi.io). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
reported by contacting the project team at
[info@nanoapi.io](mailto:info@nanoapi.io). All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details of
specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [ncc CoC](https://github.com/vercel/ncc/blob/main/CODE_OF_CONDUCT.md) which is itself adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the
[ncc CoC](https://github.com/vercel/ncc/blob/main/CODE_OF_CONDUCT.md) which is
itself adapted from the [Contributor Covenant][homepage], version 1.4, available
at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[version]: http://contributor-covenant.org/version/1/4/
98 changes: 67 additions & 31 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# How to Contribute to NanoAPI

## Contributor License Agreement

<!-- This section always comes first -->
- By submitting code as an individual you agree to the [individual contributor license agreement](/CLA/INDIVIDUAL_CONTRIBUTOR_LICENSE_AGREEMENT.md).
- By submitting code as an entity you agree to the [corporate contributor license agreement](/CLA/CORPORATE_CONTRIBUTOR_LICENSE_AGREEMENT.md).

- By submitting code as an individual you agree to the
[individual contributor license agreement](/CLA/INDIVIDUAL_CONTRIBUTOR_LICENSE_AGREEMENT.md).
- By submitting code as an entity you agree to the
[corporate contributor license agreement](/CLA/CORPORATE_CONTRIBUTOR_LICENSE_AGREEMENT.md).

## Housekeeping

Expand All @@ -15,11 +19,16 @@ Here are some guidelines to help you get started contributing to NanoAPI.
2. Check for open issues before creating a new one.
3. We require an open issue for all pull requests.
4. Help others by reviewing their pull requests.
5. All donations we receive go directly back to our contributors. We’re here to support you when you successfully submit a PR to us. Your efforts help the community grow, and we want to give back to those who help make that possible!
5. All donations we receive go directly back to our contributors. We’re here to
support you when you successfully submit a PR to us. Your efforts help the
community grow, and we want to give back to those who help make that
possible!

## How to File Issues

Make use of the issue templates, and label your issues appropriately. If you’re unsure about which label to use, don’t worry! We will help you choose the right one.
Make use of the issue templates, and label your issues appropriately. If you’re
unsure about which label to use, don’t worry! We will help you choose the right
one.

## How to Submit a Pull Request

Expand All @@ -35,98 +44,118 @@ Make use of the issue templates, and label your issues appropriately. If you’r
9. Follow the template and fill in all the sections.
10. Wait for feedback.
11. Make changes if necessary.
12. Celebrate your success after your PR gets merged. The Codex Astartes supports this action.
12. Celebrate your success after your PR gets merged. The Codex Astartes
supports this action.

## Development Environment
## Development Environment

You will need the following tools to develop NanoAPI:

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

### Environment Set Up

We use the fork-and-pull model for contributions. Here’s how you can set up your development environment:
We use the fork-and-pull model for contributions. Here’s how you can set up your
development environment:

1. Fork the repository.
2. Clone your fork locally:

```bash
$ git clone https://github.com/<your_username>/napi.git
```

3. Enter the folder:

```bash
$ cd napi
```

4. Add the original repository as a remote:

```bash
$ git remote add upstream https://github.com/nanoapi-io/napi.git
```

5. Install the dependencies:

```bash
$ npm install
```

> [!NOTE]
> 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.
> 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.

### Running the Project

When running locally, the shared libraries and the UI must be built before the CLI can be run.
When running locally, the shared libraries and the UI must be built before the
CLI can be run.

To build them:

```bash
$ npm run build
```

Next, we want to run the CLI and the UI with hot reload. You will need two terminal windows for this.
Next, we want to run the CLI and the UI with hot reload. You will need two
terminal windows for this.

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:
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:

```bash
$ npm run dev:cli -- audit view -- --workdir=/path/to/airflow
```

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`.
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`.

> [!NOTE]
> In case of port collisions, the UI will automatically switch to the next available port.
> In case of port collisions, the UI will automatically switch to the next
> available port.

2. In the second terminal, run the UI. This command should be run in the `napi` directory as well:
2. In the second terminal, run the UI. This command should be run in the `napi`
directory as well:

```bash
$ npm run dev:app
```

This controls the hot reload functionality for the UI. You can now make changes to the UI and see them reflected in real-time.
This controls the hot reload functionality for the UI. You can now make changes
to the UI and see them reflected in real-time.

> [!IMPORTANT]
> 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.
> 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.

### Project Setup

You can use any project (in a supported language) to test the CLI. There are some steps that must be taken to set up the project:
You can use any project (in a supported language) to test the CLI. There are
some steps that must be taken to set up the project:

1. Clone or CD to the repo you want to work on/test with. For this example we'll
use Apache Airflow.

1. Clone or CD to the repo you want to work on/test with. For this example we'll use Apache Airflow.
```bash
git clone https://github.com/apache/airflow.git
cd airflow
```

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.:
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.:

```bash
cd /path/to/napi # or just use a different terminal
npm start -- init -- --workdir=/path/to/airflow
```

> [!NOTE]
> 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).
> 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).

### Testing

Expand All @@ -142,15 +171,21 @@ $ npm run lint

### Release Process

We are currently formalizing the release process. For now, the NanoAPI team will handle making regular releases.
We are currently formalizing the release process. For now, the NanoAPI team will
handle making regular releases.

To ensure releases run smoothly, put the content of your changes in our [CHANGELOG](/packages/cli/CHANGELOG.md) file.
To ensure releases run smoothly, put the content of your changes in our
[CHANGELOG](/packages/cli/CHANGELOG.md) file.

### Documentation

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.
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.

The critical documentation to maintain is for any changes that impact the
following:

The critical documentation to maintain is for any changes that impact the following:
- CLI commands
- Configuration file
- Local development setup
Expand All @@ -160,9 +195,10 @@ The critical documentation to maintain is for any changes that impact the follow

### Discussions vs Issues

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.
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.

------
---

That's it for this guide for now. So long, and thanks for all the fish! 🚀

22 changes: 16 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,50 @@ assignees: ''
<!--- Provide a general summary of the issue in the Title above -->

## Description

<!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug -->

## Expected Behavior

<!--- Tell us what should happen -->

## Actual Behavior

<!--- Tell us what happens instead -->

## Possible Fix

<!--- Not obligatory, but suggest a fix or reason for the bug -->

## Steps to Reproduce

<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->

1.
2.
3.
4.

## Context

<!--- How has this bug affected you? What were you trying to accomplish? -->

## Your Environment

<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Environment name and version (e.g. Chrome 39, node.js 5.4):
* Operating System and version (desktop or mobile):
* Link to your project:


- Version used:
- Environment name and version (e.g. Chrome 39, node.js 5.4):
- Operating System and version (desktop or mobile):
- Link to your project:

### Config File

Paste your `.napirc` below

```json
{
"your": "config"
}
```
```
16 changes: 11 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,33 @@ assignees: ''
<!--- Provide a general summary of the issue in the Title above -->

## Detailed Description

<!--- Provide a detailed description of the change or addition you are proposing -->

## Context

<!--- Why is this change important to you? How would you use it? -->
<!--- How can it benefit other users? -->

## Possible Implementation

<!--- Not obligatory, but suggest an idea for implementing addition or change -->

## Your Environment

<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Environment name and version (e.g. Chrome 39, node.js 5.4):
* Operating System and version (desktop or mobile):
* Link to your project:

- Version used:
- Environment name and version (e.g. Chrome 39, node.js 5.4):
- Operating System and version (desktop or mobile):
- Link to your project:

### Config File

Paste your `.napirc` below

```json
{
"your": "config"
}
```
```
Loading