- By submitting code as an individual you agree to the individual contributor license agreement.
- By submitting code as an entity you agree to the corporate contributor license agreement.
First off, thank you for being here. You dropped this: 👑
Here are some guidelines to help you get started contributing to NanoAPI.
- Follow our Code of Conduct.
- Check for open issues before creating a new one.
- We require an open issue for all pull requests.
- Help others by reviewing their pull requests.
- 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!
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.
- Don't panic.
- Ensure an issue exists for the changes you want to make.
- Fork the repository.
- Create a new branch.
- Make your changes.
- Test your changes.
- Push your changes to your fork.
- Make sure to rebase before pushing.
- Submit a pull request.
- Follow the template and fill in all the sections.
- Wait for feedback.
- Make changes if necessary.
- Celebrate your success after your PR gets merged. The Codex Astartes supports this action.
You will need the following tools to develop NanoAPI:
- Node.js version 22 or higher.
We use the fork-and-pull model for contributions. Here’s how you can set up your development environment:
- Fork the repository.
- Clone your fork locally:
$ git clone https://github.com/<your_username>/napi.git- Enter the folder:
$ cd napi- Add the original repository as a remote:
$ git remote add upstream https://github.com/nanoapi-io/napi.git- Install the dependencies:
$ npm installNote
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.
When running locally, the shared libraries and the UI must be built before the CLI can be run.
To build them:
$ npm run buildNext, we want to run the CLI and the UI with hot reload. You will need two terminal windows for this.
- In the first terminal, run the CLI. This command should be run in the
napidirectory with aworkdirpointing to the project you want to work on. For example, if you want to work on Apache Airflow, run:
$ npm run dev:cli -- audit view -- --workdir=/path/to/airflowRunning 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 the second terminal, run the UI. This command should be run in the
napidirectory as well:
$ npm run dev:appThis 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.
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:
- Clone or CD to the repo you want to work on/test with. For this example we'll use Apache Airflow.
git clone https://github.com/apache/airflow.git
cd airflow- From the
napirepo initialize the project using the CLI, which will create a.napircfile in the project root. This file contains the configuration for the project and is required for the CLI to work.:
cd /path/to/napi # or just use a different terminal
npm start -- init -- --workdir=/path/to/airflowNote
If you encounter any issues with the config file, you can check the reference for the file on our documentation.
$ npm test$ npm run lintWe 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 file.
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:
- CLI commands
- Configuration file
- Local development setup
- Release process
- Testing
- Linting
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! 🚀