Skip to content

1.2 Define the @tecode/api type surface #3

Description

@goofmint

Part of Phase 1 — Core skeleton (tasks.md Task 1.2).

Summary

Author the complete public type surface in @tecode/api — the only package extensions may import — and enforce the layering rule with ESLint.

Details

  • Types: Manifest, ExtensionContext, Disposable, Uri, Position / Range / TextEdit / Selection (0-based, LSP-compatible), the Document interface, event types, and the namespace interfaces for commands, workspace, window, editor, ui, config, context, languages, themes.
  • UiColorKey union (~40 VS Code color names) and CaptureName union (tree-sitter capture names incl. dotted refinements).
  • Export API_VERSION = "1.0" (major.minor).
  • @tecode/api has an empty dependencies field and contains no runtime code beyond constants.
  • Add ESLint no-restricted-imports forbidding @tecode/core imports outside packages/cli.

Completion requirements

  • All namespaces from Req 10.1 are typed in @tecode/api
  • @tecode/api has zero dependencies and no runtime logic (types + constants only)
  • API_VERSION exported and documented (compat rule: same major, host minor >= requested)
  • ESLint fails on a @tecode/core import from builtin (verified by a fixture or lint test)
  • bun test and lint pass workspace-wide

References

  • requirements.md: Req 1.3, 3.2, 3.3, 7.2, 10.1
  • design.md: §2, §12

Dependencies

Blocked by: 1.1 (#2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions