Skip to content

feat(create-resource): pre-translate boilerplate and msg 0.10 - #25

Merged
jsahleen merged 8 commits into
mainfrom
msg-cli-24
Aug 9, 2026
Merged

feat(create-resource): pre-translate boilerplate and msg 0.10#25
jsahleen merged 8 commits into
mainfrom
msg-cli-24

Conversation

@jsahleen

@jsahleen jsahleen commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Bumps @worldware/msg to ^0.10.0 for getLang / language utilities.
  • Updates create resource generated boilerplate (ESM + CJS) so resources export named resource plus async getMessages() that calls getTranslation(getLang()), with sample chainable .add() messages and #i18n/projects/<name> imports.
  • Always writes <title>.msg.js (including TypeScript projects).
  • Fixes msg export import resolution for CJS module.exports = { resource } (default-interop short-circuit).

Closes #24

Test plan

  • npm test — create-resource helper/command and export-helpers named-export tests pass
  • npx tsc --noEmit and npm run build clean
  • npm run coverage — lines/statements > 90%
  • Manually: msg create resource Main Messages in ESM and CJS fixtures; confirm file shape and getMessages
  • Confirm msg export finds the named resource export from generated CJS/ESM files

jsahleen and others added 8 commits August 8, 2026 18:14
Need getLang/setLang and current note APIs for the updated
create resource boilerplate. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
Expect #i18n imports, getLang, named resource export, and
get<Title>() loader; stub resourceLoaderName for TDD. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
Emit ESM/CJS files with getLang, #i18n project imports, chainable
.add() samples, named resource export, and get<Title>() loader. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
Loader name is fixed, not derived from the resource title. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
Also drop leftover getMyMessages negative assertions. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
CJS module.exports = { resource } was misread via default interop;
resolve MsgResource-like candidates so create resource output
works with msg export. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
Reflect named resource/getMessages exports, #i18n imports,
always-.js output, and export named-export support. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify named/default/CJS interop resolution used by export. Refs #24

Co-authored-by: Cursor <cursoragent@cursor.com>
@jsahleen
jsahleen marked this pull request as ready for review August 9, 2026 00:23
@jsahleen
jsahleen merged commit b75410d into main Aug 9, 2026
1 check passed
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jsahleen
jsahleen deleted the msg-cli-24 branch August 9, 2026 13:35
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.

Update boilerplate for create resource command

1 participant