Skip to content

[Feature] Add subpath exports to package.json #414

Description

@pathosDev

Rationale

Only "." is exported today; the root barrel re-exports the entire framework (HTTP, brokers, persistence, …) into every consumer bundle, and granular imports are impossible. dist/ mirrors src/ 1:1 (tsc rootDir/outDir), so subpath maps are mechanical.

import { ActorSystem, Props } from 'actor-ts';
import { Cluster }            from 'actor-ts/cluster';
import { TestProbe }          from 'actor-ts/testkit';

Scope

  • Add ~20 subpaths, each { types, import, default }: ./cluster, ./persistence, ./crdt, ./http, ./io, ./cache, ./testkit, ./typed, ./metrics, ./tracing, ./config, ./discovery, ./coordination, ./management, ./delivery, ./fsm, ./worker, ./mailbox, ./serialization, ./pattern.
  • "." keeps re-exporting everything (purely additive).
  • Verify each subdirectory has an index barrel before mapping it.
  • Future modules (./agents, ./jobs, ./client) plug into this map.

Documentation

  • Install/usage docs (EN + DE) with subpath examples.
  • CHANGELOG note: deep actor-ts/dist/... imports are now blocked by the exports map (intended).

Acceptance

  • publint + arethetypeswrong clean.
  • Smoke test imports every subpath on Bun, Node, and Deno; "." surface unchanged.

Relates

Improvement program M3. sideEffects flag issue, package-health CI issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: mediumUseful, not urgentproduction-goalBlocks or defines the path to production readiness

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions