Skip to content

1.13 Assemble the tecode API object #14

Description

@goofmint

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

Summary

Build the concrete tecode namespace object handed to every extension, and the contract-test suite that gates API versioning.

Details

  • core/api/create.ts wires every namespace from Req 10.1 to the services from Tasks 1.3–1.12 (commands, workspace incl. fs wrapper over node:fs/promises + fs.watch, window stubs where UI lands later, editor, ui, config, context, languages, themes).
  • Shallow Object.freeze per namespace to prevent cross-extension monkey-patching.
  • Register a Bun module alias so import { commands } from "tecode" resolves to this object in dev and compiled mode.
  • tecode.editor calls with no active editor no-op with a status-sink notice.
  • Contract tests: a fixture extension activated against the real core exercises every namespace — register/dispose symmetry, event firing order, frozenness. This suite is the compatibility gate for future API_VERSION bumps.

Completion requirements

  • Every namespace in Req 10.1 is reachable from a fixture extension via both ctx.api and import ... from "tecode"
  • Namespaces are frozen (mutation attempts throw in tests)
  • No-active-editor editor calls no-op with a surfaced notice
  • Contract suite passes and is wired into CI as a named job/step
  • bun test and lint pass

References

  • requirements.md: Req 10.1, 10.2
  • design.md: §12, §16

Dependencies

Blocked by: 1.12 (#13) and all of 1.3–1.10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions