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
To track unreleased types from main (used by staging deploys and tests), install
the main dist-tag instead. It is republished on every push to main that changes
the generated types:
npm install @neuracore/types@main
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:
- Read the Pydantic models from
neuracore_types/neuracore_types.py - Generate TypeScript definitions in
typescript/neuracore_types.ts - 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:
-
Version Label: Add exactly one version label to your PR:
version:major- Breaking changesversion:minor- New featuresversion:patch- Bug fixesversion:none- No release (docs, chores, etc.)
-
Commit Format: PR title and all commits must use conventional commit format:
<prefix>: <description>Valid prefixes:
feat,fix,chore,docs,ci,test,refactor,style,perfExamples:
feat: add new data type for robot statefix: resolve serialization issue in TypeScript typeschore: 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:
- Go to Actions → Release → Run workflow
- Optional: Check dry_run to preview without publishing
- 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:
-
PR Checks:
- Validates version labels
- Enforces conventional commit format
- Runs pre-commit hooks
- Suggests changelog updates for major/minor changes
-
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
Release files for neuracore-types 11.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| neuracore_types-11.13.0.tar.gz | 87.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neuracore_types-11.13.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 165.3 kB
Release files / neuracore_types-11.13.0.tar.gz
| Download URL | neuracore_types-11.13.0.tar.gz |
|---|---|
| Size | 87.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39a963ed9f072d6d0f1535c0913f1b0e934ac21ae2882edf08ab93710cc0e1f5
|
|
BLAKE2b-256 checksum How to use checksums |
5f42729f18b990128bfb03c450cf2ee684e2af905c68b25c1e87cd450a4d2b2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / neuracore_types-11.13.0-py3-none-any.whl
| Download URL | neuracore_types-11.13.0-py3-none-any.whl |
|---|---|
| Size | 77.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
608d61a5afe34809f91183bc0123b3a60388457c9d1be317af5cdce4a4fda5c9
|
|
BLAKE2b-256 checksum How to use checksums |
77737e894db0f97aca1abef9d2184aca8ced28dc838885252c38e370d39ce740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|