Architecture decision record · ADR-0018
Codegen writes standard or legacy decorators
The config takes decorators: 'standard' | 'legacy'.
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'writesdeclarefields for shapes, values and enum@is()accessors.'legacy'writes the mocks as decorator-freehttp.get(path, responder)handlers. The export name staysharnesses, becauseapi.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. Useapi.get(path).reply(...)in a test for one route.
Confirmation
Evidence
packages/codegen/tests/decorators.test.ts,packages/codegen/tests/legacy-mocks.test.tsexamples/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.
| Question | Answer | Source |
|---|---|---|
| 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
| Date | Author | Change |
|---|---|---|
| 2026-12-03 | Joe Gaudet | Status in the Markdown file: Accepted (codegen C5). |
| 2026-12-03 | Joe Gaudet | Commit 7b66d71: Add codegen: one contract gives WarpDrive, Millwork, real-enums, Formwright and harnessed code (#7) |
| 2026-12-04 | Joe 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.