feat(create-project): add --format flag for MsgProject scaffolding - #28
Merged
Conversation
Wire Flags.option for MF1/MF2/NONE and a resolveCreateProjectFormat stub that always returns MF2; tests assert boilerplate emission and --extend inheritance so the implement phase has clear failing targets. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve format as flag > inherited base > MF2, and always write it into the MsgProject.create boilerplate for both ESM and CJS output. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Use MSG_DEFAULT_FORMAT for the create-project fallback, drop the MsgFormat cast on the typed option flag, and document format/extend usage in --help. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Add integration coverage that imports scaffolded files (default, -f MF1, and --extend from a real MsgProject base) and checks runtime format. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Update README and create-project command spec for -f/--format values, defaults, boilerplate emission, and --extend format inheritance. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Cover explicit -f/--format, --extend inheritance/override, and invalid format validation in the happy-path and error scenarios. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Keep extend validation consistent with useExtend so whitespace-only values do not attempt to import a project. Refs #27 Co-authored-by: Cursor <cursoragent@cursor.com>
|
🎉 This PR is included in version 0.5.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
--format/-f(MF1|MF2|NONE) tomsg create project, defaulting toMF2, and always emittingproject.formatin the generated boilerplate.--extendis used without--format, inherits the base project's format; an explicit--formatoverrides it.create-project-command.spec.md.Test plan
npm test— format helper and create-project command tests passnpx tsc --noEmitandnpm run buildcleanmsg create project myApp en fremitsformat: "MF2"msg create project myApp en fr -f MF1emitsformat: "MF1"format: "NONE"inherits unless--formatoverrides--format ICUis rejected by oclifCloses #27