Skip to content

fix(attributes): default empty dir to auto - #65

Merged
jsahleen merged 3 commits into
mainfrom
msg-63
Aug 16, 2026
Merged

fix(attributes): default empty dir to auto#65
jsahleen merged 3 commits into
mainfrom
msg-63

Conversation

@jsahleen

Copy link
Copy Markdown
Collaborator

Summary

  • Normalize omitted or empty-string dir to "auto" on MsgResource and MsgMessage so it matches DEFAULT_ATTRIBUTES instead of winning via spread-merge.
  • Apply library defaults even when a message is created with no attributes object.
  • Update the README loader fallback and MsgAttributes docs so copy-paste samples use dir: 'auto'.

Closes #63.

Companion CLI work remains in worldware-studios/msg-cli#33 (loader fallback, import trgDir ?? "auto", export Option B: omit srcDir when dir is "auto").

Test plan

  • Unit tests for omitted dir, dir: '', and explicit ltr/rtl/auto on resources and messages
  • Resource attributes setter and add({ dir: '' }) normalize to "auto"
  • npm test, npx tsc --noEmit, npm run build, npm run coverage (> 90%)

Made with Cursor

jsahleen and others added 3 commits August 15, 2026 19:35
Empty-string dir currently overrides DEFAULT_ATTRIBUTES.dir, and
standalone messages skip defaults entirely. Capture the intended
auto default before implementation. Refs #63

Co-authored-by: Cursor <cursoragent@cursor.com>
Spread-merging let dir: '' win over DEFAULT_ATTRIBUTES. Centralize
attribute defaults so omitted or empty dir always becomes auto. Refs #63

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep copy-paste samples aligned with the library default so empty
string dir does not reappear in new projects. Refs #63

Co-authored-by: Cursor <cursoragent@cursor.com>
@jsahleen
jsahleen marked this pull request as ready for review August 16, 2026 01:37
@jsahleen
jsahleen merged commit 5acd709 into main Aug 16, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jsahleen
jsahleen deleted the msg-63 branch August 19, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default dir to "auto" instead of empty string

1 participant