Skip to Content
08 DevelopmentPackage Exports

Package Exports

This document lists all public exports from AlignTrue packages. All exports must be documented here before being added to package.json.

Purpose

  • Ensures all exports are intentional and documented
  • Prevents accidental exposure of internal APIs
  • Provides clear guidance for package consumers
  • Enables CI validation of exports

@aligntrue/exporters

Export PathPurposeExample
.Main entry point with exporter registryimport { ExporterRegistry } from '@aligntrue/exporters'
./cursorCursor exporter pluginimport { CursorExporter } from '@aligntrue/exporters/cursor'
./agents-mdAGENTS.md exporter pluginimport { AgentsMdExporter } from '@aligntrue/exporters/agents-md'
./vscode-mcpVS Code MCP exporter pluginimport { VsCodeMcpExporter } from '@aligntrue/exporters/vscode-mcp'
./utils/section-parserSection parsing utilities for agent filesimport { parseAgentsMd, parseCursorMdc } from '@aligntrue/exporters/utils/section-parser'

@aligntrue/core

Export PathPurposeExample
.Main entry point with core functionalityimport { loadConfig, SyncEngine } from '@aligntrue/core'
./telemetry/collector.jsTelemetry collection utilitiesimport { recordEvent } from '@aligntrue/core/telemetry/collector.js'
./team/allow.jsTeam mode allow list managementimport { parseAllowList } from '@aligntrue/core/team/allow.js'
./team/drift.jsDrift detection for team modeimport { detectDriftForConfig } from '@aligntrue/core/team/drift.js'
./lockfileLockfile generation and validationimport { generateLockfile, validateLockfile } from '@aligntrue/core/lockfile'
./parsing/natural-markdownNatural markdown parsingimport { parseNaturalMarkdown } from '@aligntrue/core/parsing/natural-markdown'

@aligntrue/schema

Export PathPurposeExample
.Schema types and validationimport type { AlignPack, AlignSection } from '@aligntrue/schema'

@aligntrue/plugin-contracts

Export PathPurposeExample
.Plugin interface contractsimport type { ExporterPlugin } from '@aligntrue/plugin-contracts'

@aligntrue/file-utils

Export PathPurposeExample
.File operation utilitiesimport { AtomicFileWriter } from '@aligntrue/file-utils'

@aligntrue/sources

Export PathPurposeExample
.Source resolution and fetchingimport { GitSourceProvider } from '@aligntrue/sources'

@aligntrue/cli

Export PathPurposeExample
.CLI entry point (not typically imported)N/A - used via aligntrue command

@aligntrue/testkit

Export PathPurposeExample
.Testing utilities and fixturesimport { createTestPack } from '@aligntrue/testkit'

@aligntrue/ui

Export PathPurposeExample
.UI components for docs siteimport { AlignTrueLogo } from '@aligntrue/ui'

Adding New Exports

When adding a new export:

  1. Document it here first - Add entry to the appropriate package table
  2. Add to package.json - Update the exports field in the package’s package.json
  3. Build and test - Verify the export works: pnpm build && pnpm test
  4. Update CHANGELOG - Add entry describing the new export

Export Format

{ "exports": { "./your-export": { "types": "./dist/your-export.d.ts", "default": "./dist/your-export.js" } } }

Validation

CI will validate that:

  • All exports in package.json are documented here
  • All documented exports exist in package.json
  • All export files exist in the dist/ directory after build

Internal vs Public Exports

Public exports (documented here):

  • Stable APIs for external consumption
  • Semantic versioning applies
  • Breaking changes require major version bump

Internal imports (not exported):

  • Use direct file imports within the monorepo
  • Example: import { foo } from '../internal/foo.js'
  • Not subject to semver guarantees
  • Can change between minor versions

Notes

  • All export paths use .js extensions (not .ts) to reference compiled output
  • Type definitions (.d.ts) are automatically generated during build
  • Exports must use ES modules format (type: "module" in package.json)
Last updated on