ts-backend-check
is a Python package used to check TypeScript types against their corresponding backend models to assure that all fields have been accounted for.
Usage ⇧
pip install ts-backend-check
backend-model-file
(bmf
): Path to the backend model file (e.g. Python class)typescript-file
(tsf
): Path to the TypeScript interface/type file
The CLI provides a simple interface to check TypeScript types against backend models:
# Show help and available commands:
ts-backend-check --help
# Check a TypeScript type against a backend model:
ts-backend-check -bmf <backend-model-file> -tsf <typescript-file>
# Example command:
ts-backend-check -bmf src/models/user.py -tsf src/types/user.ts
Contributing ⇧
activist uses Matrix for internal communication. You're more than welcome to join us in our public chat rooms to share ideas, ask questions or just say hi to the team :) We'd suggest that you use the Element client and Element X for a mobile app.
Please see the contribution guidelines if you are interested in contributing. Work that is in progress or could be implemented is tracked in the issues and projects.
Note
Just because an issue is assigned on GitHub doesn't mean the team isn't open to your contribution! Feel free to write in the issues and we can potentially reassign it to you.
Also check the -next release-
and -priority-
labels in the issues for those that are most important, as well as those marked good first issue
that are tailored for first-time contributors. For those new to coding or our tech stack, we've collected links to helpful documentation pages in the contribution guidelines.
We would be happy to discuss granting you further rights as a contributor after your first pull requests, with a maintainer role then being possible after continued interest in the project. activist seeks to be an inclusive, diverse and supportive organization. We'd love to have you on the team!
How you can help ⇧
- Reporting bugs as they're found 🐞
- Working with us on new features ✨
- Documentation for onboarding and project cohesion 📝
Environment setup ⇧
- First and foremost, please see the suggested IDE setup in the dropdown below to make sure that your editor is ready for development.
Important
Suggested IDE setup
VS Code
Install the following extensions:
- Fork the ts-backend-check repo, clone your fork, and configure the remotes:
Note
Consider using SSH
Alternatively to using HTTPS as in the instructions below, consider SSH to interact with GitHub from the terminal. SSH allows you to connect without a user-pass authentication flow.
To run git commands with SSH, remember then to substitute the HTTPS URL, https://github.com/...
, with the SSH one, [email protected]:...
.
- e.g. Cloning now becomes
git clone [email protected]:<your-username>/ts-backend-check.git
GitHub also has their documentation on how to Generate a new SSH key 🔑
# Clone your fork of the repo into the current directory.
git clone https://github.com/<your-username>/ts-backend-check.git
# Navigate to the newly cloned directory.
cd ts-backend-check
# Assign the original repo to a remote called "upstream".
git remote add upstream https://github.com/activist-org/ts-backend-check.git
- Now, if you run
git remote -v
you should see two remote repositories named:origin
(forked repository)upstream
(ts-backend-check repository)
-
Create a virtual environment, activate it and install dependencies:
# Unix or MacOS: python3 -m venv venv source venv/bin/activate # Windows: python -m venv venv venv\Scripts\activate.bat # After activating venv: pip install --upgrade pip pip install -r requirements-dev.txt # To install the CLI for local development: pip install -e .
You're now ready to work on ts-backend-check
!
Note
Feel free to contact the team in the Development room on Matrix if you're having problems getting your environment setup!
Contributors ⇧
Thanks to all our amazing contributors! ❤️