WORK-254
ID:WORK-254Status:ready

Shared lang-map module in @refrakt-md/runes

Add a small extension-to-language map at packages/runes/src/lang-map.ts, exported from @refrakt-md/runes. Consumers (the snippet rune from WORK-255, the inspect tool in packages/cli/, the contracts generator, future runes wanting extension inference) import from there.

Living in @refrakt-md/runes rather than a plugin or the transform package is deliberate: every consumer already depends on runes; plugins can import from runes but not the reverse; and it's rune-shaped knowledge, sitting alongside the existing rune-utility surface.

Priority:mediumComplexity:simpleMilestone:v0.15.0Source:SPEC-062
claude/modal-drawer-pattern-a1Wgb View source

Criteria completion

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

Tracking started May 23 — check back for trends.

Branches 3
claude/modal-drawer-pattern-a1Wgb current ready
main doneclaude/v0.15.0-phase-2 doneclaude/v0.15.0 done
History 1
  1. c15804e
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • packages/runes/src/lang-map.ts exists and is exported from the package's index
  • Map covers the extensions documented in SPEC-062 Language Inference: .ts, .tsx, .js, .jsx, .mjs, .cjs, .svelte, .vue, .md, .markdoc, .json, .jsonc, .html, .css, .yml, .yaml, .toml, .sh, .bash (extensible)
  • Unknown extensions fall back to "text" (no highlighting)
  • Exported as both the raw map and a helper function (e.g., inferLanguage(path: string): string) for ergonomic use
  • Unit tests cover the documented mappings and the fallback case
  • Type definitions exported

Approach

Tiny module: a Record<string, string> plus a helper. Both exported from @refrakt-md/runes. The helper takes a file path or extension and returns the language string (defaulting to "text"). No external dependencies.

Dependencies

  • None within v0.15.0. Independent.

References

  • SPEC-062 — snippet-rune spec (language inference section)
  • packages/runes/src/ — package home