# Code maintenance DREAM-822 - Define a supported frontend API surface

Project: Stream Design System
Status: new
URL: https://community.openproject.org/work_packages/DREAM-822

## OPEN POINTS

_No work packages_

## Subtasks

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Designer |  |
| Developers |  |
| Requires doc change | Yes |
| Date |  |
| Priority | Medium |
| Target versions |  |
| Sprint |  |
| Backlog bucket |  |
| Module | Frontend components and Primer design system |
| Accessibility | No |
| List |  |
| Labels |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |
| Remaining work |  |

## Description

## Context

Follows https://community.openproject.org/wp/OP-18657, which established the generated frontend API reference: TypeDoc scoped to `frontend/src/stimulus`, rendered with a GitHub theme, source links pinned to a commit, a repo-local TypeDoc plugin, and a Node-side test harness for that plugin.

Two problems remain with what that reference currently claims.

**Directory membership is being used as an API boundary.** All 167 Stimulus controllers are published as "reusable frontend APIs", including 24 administration screens, 21 work-package internals, and Jira import. Nothing distinguishes a supported controller from an application internal, and no `@api` or `@internal` markers exist anywhere in the frontend today.

**The pages omit the contract consumers actually need.** A Stimulus consumer writes HTML, not TypeScript. The reference lists class members but not the `data-controller` identifier or the attribute names. Identifiers are not derivable from class or file names — `setup.ts` registers `menus--main` for `MainMenuController` and `work-packages--date-picker--preview` for `PreviewController`.

## Goal

Publish a reference that is honest about what it supports and useful to someone writing markup.

## Scope

**A supported-API boundary, opt-in.** A symbol appears only if tagged. `@api public` and `@api private` are the membership vocabulary, matching YARD so Ruby and TypeScript share one convention; `@controller <identifier>` supplies the Stimulus identifier and carries no membership meaning, so a supported controller carries both. Tags are declared in `frontend/tsdoc.json`, which overrides `typedoc.json` for tag definitions and is shared with the TSDoc lint. TypeDoc's own `@public` is unsuitable — it is a visibility modifier that overrides `private` and `protected`, and its documentation advises against using it.

**The Stimulus contract on each supported controller page**: identifier, target/value/outlet attribute names, value types and defaults, intended actions, and a minimal markup example or Lookbook link. Note that defaults barely exist in the codebase today (two files use the `{ type, default }` form), and `data-action` descriptors live in ERB rather than TypeScript, so part of this is authored prose rather than generated output.

**Member categorisation from `static` declarations**, not name suffixes. A suffix rule misfiles at least 30 ordinary methods, among them `applyValue()`, `updateRevTargets()`, `hideElement()` and `readInitialValues()`. Categories must correlate with each controller's `static values`, `targets`, `outlets` and `elements`, and apply only to property reflections. Fixture tests are required for these false positives.

**Widen scope** to `frontend/src/common` and `frontend/src/turbo`, both equally reusable and currently undocumented.

**Coverage gating** over the tagged set only, so the number measures the API we claim to support rather than implementation volume. `typedoc-plugin-coverage` writes output but enforces nothing, so CI must read `coverage.json` and fail below a threshold.

**CI drift checks**: a `@controller` identifier that matches no registration fails, as does a controller admitted with `@api public` but carrying no `@controller` tag.

## Notes

Widening the entry points moves the base path TypeDoc infers, so `sourceLinkTemplate` must change in the same commit or every source link silently 404s. The workflow's scope guard also rejects `turbo_*` modules today and will need to stop doing so once `src/turbo` is in scope.

The `stage` channel cannot build a tagged reference until a release branch carries the tags; skip it rather than falling back to publishing everything untagged.

Publishing to GitHub Pages remains blocked on deployment permissions, independently of this work.
