-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
The generated TypeScript code exports Python implementation details that aren't useful to TypeScript consumers:
// Generated code includes:
export async function dataclass(...): Promise<unknown>The dataclass decorator is a Python-specific construct that shouldn't be exposed in the TypeScript API.
Current Behavior
All functions/classes found in a module are exported, including:
dataclassdecorator- Other decorators (
property,staticmethod, etc.) - Internal functions starting with
_ - Module-level helpers
Proposed Solution
-
Built-in filter list - Automatically exclude known Python built-ins/decorators:
dataclass,dataclasses.dataclassproperty,staticmethod,classmethodabstractmethod,abc.abstractmethod- Functions starting with
_
-
Config option to exclude - Allow users to specify additional exclusions:
export default defineConfig({ pythonModules: { 'my_module': { exclude: ['internal_helper', 'dataclass'], // or excludePatterns: ['^_', 'dataclass'] } } });
-
Smarter detection - Detect decorator usage patterns and don't export decorators as functions
Labels
enhancement, code-generation, breaking-change
Metadata
Metadata
Assignees
Labels
No labels