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:
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neuracore_types-6.4.0.tar.gz.
File metadata
- Download URL: neuracore_types-6.4.0.tar.gz
- Upload date:
- Size: 59.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f00191e6dbea37d4c6d7cf22ac563693dffaa4c0ae521edf9584f63225eeb68
|
|
| MD5 |
95e1efe0f3fed8b919c00ce41178516f
|
|
| BLAKE2b-256 |
71235e96f86a975eabb4654521777c52503727034118b4cfb1c8dd7c9ef79a08
|
File details
Details for the file neuracore_types-6.4.0-py3-none-any.whl.
File metadata
- Download URL: neuracore_types-6.4.0-py3-none-any.whl
- Upload date:
- Size: 57.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf55b37fe3415a0365b12b393144d766d4ffc37bfbdd1f32e9f4c0822b8d5b8b
|
|
| MD5 |
158a4aadd451e14067fdd190e7e270d3
|
|
| BLAKE2b-256 |
6ded5db3ff44d8d9252f1055cad6fe62675930960c619bddf4b62fb3b6cd0a7f
|