Skip to main content

Shared type definitions for Neuracore.

Project description

Neuracore Types

Shared type definitions for the Neuracore platform. This package maintains a single source of truth for data types in Python (Pydantic models) and automatically generates TypeScript types.

Overview

  • Python Package: neuracore-types - Pydantic models for Python backend
  • NPM Package: @neuracore/types - TypeScript types for frontend

Installation

Python

pip install neuracore-types

TypeScript/JavaScript

npm install @neuracore/types
# or
yarn add @neuracore/types
# or
pnpm add @neuracore/types

Development

Setup

# Clone the repository
git clone https://github.com/neuracoreai/neuracore_types.git
cd neuracore_types

# Install Python dependencies
pip install -e ".[dev]"

# Install Node dependencies
npm install

Generate TypeScript Types

The TypeScript types are automatically generated from the Python Pydantic models:

npm install json-schema-to-typescript
python scripts/generate_types.py

This will:

  1. Read the Pydantic models from neuracore_types/neuracore_types.py
  2. Generate TypeScript definitions in typescript/neuracore_types.ts
  3. Create an index file at typescript/index.ts

Build TypeScript Package

npm run build

This compiles the TypeScript files to JavaScript and generates type declarations in the dist/ directory.

Release Process

Creating PRs

All PRs must follow these conventions:

  1. Version Label: Add exactly one version label to your PR:

    • version:major - Breaking changes
    • version:minor - New features
    • version:patch - Bug fixes
    • version:none - No release (docs, chores, etc.)
  2. Commit Format: PR title and all commits must use conventional commit format:

    <prefix>: <description>
    

    Valid prefixes: feat, fix, chore, docs, ci, test, refactor, style, perf

    Examples:

    • feat: add new data type for robot state
    • fix: resolve serialization issue in TypeScript types
    • chore: update dependencies

Pending Changelog

For significant changes (version:major or version:minor), update changelogs/pending-changelog.md:

## Summary

This release adds support for new sensor data types and improves TypeScript type generation.

Simply append your summary to the existing content. This will appear at the top of the release notes.

Triggering a Release

Releases are manual and triggered via GitHub Actions:

  1. Go to ActionsReleaseRun workflow
  2. Optional: Check dry_run to preview without publishing
  3. The workflow will:
    • Analyze all PRs since last release
    • Determine version bump (highest priority across all PRs)
    • Generate changelog with all PRs grouped by type
    • Bump version in pyproject.toml, package.json, and __init__.py
    • Generate TypeScript types from Python models
    • Publish Python package to PyPI
    • Build and publish npm package to npm registry
    • Create GitHub release

Dry run shows what would happen without making any changes - useful for testing before a real release.

CI/CD

The repository includes GitHub Actions workflows:

  1. PR Checks:

    • Validates version labels
    • Enforces conventional commit format
    • Runs pre-commit hooks
    • Suggests changelog updates for major/minor changes
  2. Release (manual trigger):

    • Generates TypeScript types from Python models
    • Builds and validates both packages
    • Publishes to PyPI and npm registry
    • Creates GitHub release with changelog

Project details


Download files

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

Source Distribution

neuracore_types-7.4.0.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

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

neuracore_types-7.4.0-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file neuracore_types-7.4.0.tar.gz.

File metadata

  • Download URL: neuracore_types-7.4.0.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for neuracore_types-7.4.0.tar.gz
Algorithm Hash digest
SHA256 f1e54dd8da34e26cfe43a0901eba9d932691be1178b6bbabff6ab45ffec74a9e
MD5 75421898c4bb80ded1f8de3cdbe0c647
BLAKE2b-256 ab748b0cc9801d585e7195cd1228566737ff178c0804b14a704fa1b3b16cdb1d

See more details on using hashes here.

File details

Details for the file neuracore_types-7.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for neuracore_types-7.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 091a143835e5a1799aa3179bc8c755693f21cfa9c2a1c19a9ff84540231e5e9f
MD5 e0b10af8fc9ab8392feb8ca7c60c3327
BLAKE2b-256 e8e0711e4ef7a0bcf9644ea6ae78781249097c5bc9f8f4d2723fac452c0c5ff0

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