We're excited about your interest in contributing to Lexio!
- Node.js (v20 or higher)
- Python 3.9+
- npm
- Git
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/lexio.git cd lexio
- Install dependencies:
# install the React UI dependencies cd lexio npm install
The python package is located in the lexio directory. The Python package is auto-generated from the frontend library. It contains API types for the lexio frontend library as pydantic models.
Follow these steps to create the package:
- Update the frontend library with the latest changes.
- If you want to add new types to the python package, update the types-to-include.json file.
- Run
npm run build-python-package
to (1) generate the python package, (2) run tests and (3) build the package in thepython/lexio
folder.- How? The pydantic classes are generated with
datamodel-codegen
from a json schema file. The schema file is generated from the types in the frontend library. - The tests are run with
pytest
to ensure the package is working as expected. - The version of the package is set automatically from the frontend library's
package.json
file.
- How? The pydantic classes are generated with
- Commit the changes to the python package.
Note: We use the version from the frontend library's
package.json
file as the version for the Python package.
To publish the package to PyPI:
# cd to the python/lexio directory from the root of the project
cd python/lexio
# activate the virtual environment
source .venv/bin/activate
# build the package
hatch build
# check the package
twine check dist/*
# upload the package
twine upload dist/*
Since we are creating the lexio
python package automatically we run several test with 'pytest' to ensure the package is working as expected. The tests are located in the teststests folder.
If you add new types which are exported to the python package, you should also add tests for them.
- Follow the existing ESLint configuration
- Use TypeScript strict mode
- Use TSDoc notation for documenting code
- Use functional components and hooks
- Follow React best practices
- Include docstrings/TSDoc comments for new functions and components
- Update type definitions where necessary
- Add examples to the documentation where necessary
- Add stories to the Storybook for new components under components
- Open an issue for bugs or feature requests
- Check the existing documentation and issues before opening new ones
By contributing, you agree that your contributions will be licensed under the project's license.
Thank you for contributing to Lexio!