WORK-457
ID:WORK-457Status:ready

JSON preset carrier: loader extension detection

SPEC-111 §6 — presets are pure data, so support a declarative .json carrier (the default for new packs) alongside JS/TS modules in the preset loader.

Priority:mediumComplexity:simpleMilestone:v0.25.0Source:SPEC-111
claude/v0.25.0-workitems View source

Criteria completion

Criteria completion: 0 of 5 (0%) checked; tracking started on Jun 23, no incremental history yet0%25%50%75%100%Jun 23Jul 11

Tracking started Jun 23 — check back for trends.

Branches 3
claude/v0.25.0-workitems current ready
main donechangeset-release/main doneclaude/v0.25.0-impl done
History 1
  1. a6bdcba
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • The preset loader (packages/transform/src/preset-loader.ts) detects a .json module by extension and reads it (readFile + JSON.parse) instead of import()-ing it
  • Both carriers yield the same ThemeTokensConfig and satisfy the loader's existing "resolved export is a plain object" guard
  • Lumina's .ts presets keep working unchanged
  • A JSON preset requires no build step — its module points at the .json directly
  • Tests cover JSON and JS/TS resolution plus a malformed-JSON error

Approach

Add an extension check at the top of the loader's resolve path; everything downstream (merge, scope filter) is unchanged.

Dependencies

  • WORK-456 — the pack format / module field

References

  • SPEC-111 §6; packages/transform/src/preset-loader.ts