Skip to content

Latest commit

 

History

History
86 lines (57 loc) · 2.98 KB

File metadata and controls

86 lines (57 loc) · 2.98 KB
sidebar_position 1
id contributing-a-xircuits-component-library
title Contributing a Xircuits Component Library
tags
component dev
tutorials

Contributing your Own Xircuits Component Library

This section will focus on how to create a component library pull request so you can showcase your library in our Xircuits Component Library list! Users can interact with the component libraries featured in this list using the Xircuits component library command.

Before proceeding, ensure that you have already have your component library repository. We've provided a guide for that.

1. Fork the xai-components-manifest Repository

Navigate to the xai-components-manifest repository and fork it to your account. This gives you a personal copy to work on.

2. Clone Your Fork and Create a Branch

Clone your fork locally and create a feature branch:

git clone https://github.com/your_username/xai-components-manifest.git
cd xai-components-manifest
git checkout -b add-your-lib
sample-user@machine ~/xai-components-manifest
$ git clone https://github.com/sample-user/xai-components-manifest.git
Cloning into 'xai-components-manifest'...
...
$ cd xai-components-manifest
$ git checkout -b sample-user/add-xai-sample-library
Switched to branch 'sample-user/add-xai-sample-library'

3. Update the Manifest File

Add your component library details to xai_components_manifest.jsonl. You can do this via the command line or a text editor.

Command Line Example

echo '{"path": "xai_components/xai-yourlib", "url": "https://github.com/your_username/xai-yourlib", "library_id": "YOURLIB", "git_ref": "main"}' \
  >> xai_components_manifest.jsonl

:::info

Don't forget that you should prepend xai_ to the directory name in order for your component library to be parsed by the Xircuits component tray. So if your repository name is xai-sample-library, please convert the hyphen ( - ) to underscore ( _ ).

:::

Once added, commit your change:

git add xai_components_manifest.jsonl
git commit -m "Add xai-yourlib to components manifest"

4. (Optional) Regenerate Metadata Locally

To preview the metadata output, run:

python create_metadata.py

This will generate:

  • index.json
  • metadata/<library_id>.json

5. Create a Pull Request

Push your branch to your fork and open a pull request against XpressAI/xai-components-manifest. Include a description of your component library and link to its repository.

Once merged, your library will be available to all Xircuits users via the xircuits component library CLI command.


And you're done! We'll give a look at your PR as soon as possible, so keep track the review tab now and then. You can also join our Discord if you would like to discuss anything.