Skip to main content

Check TypeScript types against their corresponding backend models to assure that all fields have been accounted for.

Project description

TS Backend Check logo

rtd pr_ci python_package_ci issues python pypi pypistatus license coc matrix

Check TypeScript types against backend models

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.

Contents

Usage

Installation

pip install ts-backend-check

Command Options

  • backend-model-file (bmf): Path to the backend model file (e.g. Python class)
  • typescript-file (tsf): Path to the TypeScript interface/type file

Basic Usage

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

Public Matrix Chat

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

Environment setup

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

  1. 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, git@github.com:....

  • e.g. Cloning now becomes git clone git@github.com:<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)
  1. 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! ❤️

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ts_backend_check-1.2.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file ts_backend_check-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ts_backend_check-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f30f8757a26fd143b405151c000c46c53286f75aaaf6947a6a724eb9ceb1a0e7
MD5 49c4cc8412d05b4f891f5f4f6adf7830
BLAKE2b-256 32c44bbbf3b02ac20404b461d7d89f2c1cdbdd74ba157878e68bd9b0ad2a456d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page