feat(create-resource): pre-translate boilerplate and msg 0.10 - #25
Merged
Conversation
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
marked this pull request as ready for review
August 9, 2026 00:23
|
🎉 This PR is included in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@worldware/msgto^0.10.0forgetLang/ language utilities.create resourcegenerated boilerplate (ESM + CJS) so resources export namedresourceplus asyncgetMessages()that callsgetTranslation(getLang()), with sample chainable.add()messages and#i18n/projects/<name>imports.<title>.msg.js(including TypeScript projects).msg exportimport resolution for CJSmodule.exports = { resource }(default-interop short-circuit).Closes #24
Test plan
npm test— create-resource helper/command and export-helpers named-export tests passnpx tsc --noEmitandnpm run buildcleannpm run coverage— lines/statements > 90%msg create resource Main Messagesin ESM and CJS fixtures; confirm file shape andgetMessagesmsg exportfinds the namedresourceexport from generated CJS/ESM files