Architecture decision record · ADR-0018

Codegen writes standard or legacy decorators

The config takes decorators: 'standard' | 'legacy'.

Status
Accepted
Deciders
Joe Gaudet
Created
Updated
PRD
PRD
Related
None

Context

Ember apps compile decorators with legacy semantics (decorator-transforms). There, a Millwork field is @field declare city: string, and @field accessor city!: string does not work. Real Enums has the same two forms. The Harnessed ApiHarness route decorators (@Get) are standard decorators only.

Decision drivers

Not recorded in the original ADR.

Options considered

Not recorded in the original ADR.

Decision

  • The config takes decorators: 'standard' | 'legacy'. The default is 'standard'.
  • 'legacy' writes declare fields for shapes, values and enum @is() accessors.
  • 'legacy' writes the mocks as decorator-free http.get(path, responder) handlers. The export name stays harnesses, because api.use(...harnesses) takes both forms.
  • The codegen guide tells Ember apps to set 'legacy'.

Consequences

  • With 'legacy', the mocks have no per-route overrides by method name. Use api.get(path).reply(...) in a test for one route.

Confirmation

Evidence

  • packages/codegen/tests/decorators.test.ts, packages/codegen/tests/legacy-mocks.test.ts
  • examples/ember-app (decorators: 'legacy', three Formwright tests in Chrome)

Interview record

Each question of the interview with its answer and its source. A fact from the code or a document, a question that the author did not ask, and an assumption are rows too.

QuestionAnswerSource
Where does the text of this page come from?From the Markdown file docs/adr/0018-codegen-decorators.md at commit c8154b0. The text of each section is the text of the Markdown file. A section that the Markdown file does not have says so.Document: docs/adr/0018-codegen-decorators.md

Changelog

DateAuthorChange
2026-12-03Joe GaudetStatus in the Markdown file: Accepted (codegen C5).
2026-12-03Joe GaudetCommit 7b66d71: Add codegen: one contract gives WarpDrive, Millwork, real-enums, Formwright and harnessed code (#7)
2026-12-04Joe Gaudet (agent)Converted from docs/adr/0018-codegen-decorators.md to this page. The text is the text of the Markdown file.

The adr skill of skillsaw wrote this page. The HTML in this file is the source of truth. The diagrams are the Mermaid sources in it.