Skip to content

Crafting: Programmatically run generator from bin script#125

Merged
LEGIO-SEXTA-FERRATA merged 3 commits intomasterfrom
wtf/yeoman-npx
May 19, 2025
Merged

Crafting: Programmatically run generator from bin script#125
LEGIO-SEXTA-FERRATA merged 3 commits intomasterfrom
wtf/yeoman-npx

Conversation

@weirdwater
Copy link
Copy Markdown
Collaborator

Checklist

  • Contains unit tests ❌
  • Contains breaking changes ❌
  • Compatible with: MX 7️⃣, 8️⃣, 9️⃣
  • Did you update version and changelog? ✅
  • PR title properly formatted ([XX-000]: description)? ✅

This PR contains

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Other (describe)

What is the purpose of this PR?

There was a noticeable startup time when generating a widget using npx @mendix/generator-widget. This was due to the bin script installing yeoman and the generator globally each time.

Relevant changes

  • The generator is run using yeoman-environment (which the yo cli tool is a wrapper for).
  • Dependencies with vulnerabilities have been patched using npm audit

What should be covered while testing?

Generating a widget using the bin.js script.

Copy link
Copy Markdown
Contributor

@LEGIO-SEXTA-FERRATA LEGIO-SEXTA-FERRATA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished a review pass, added a single comment.

A question, though: I assume you didn't bump the version because your previous PR did?

Comment thread packages/generator-widget/bin.js
Copy link
Copy Markdown
Contributor

@LEGIO-SEXTA-FERRATA LEGIO-SEXTA-FERRATA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested: A few different combinations of generation configurations. ✅
Unintentionally tested 😄: When the directory is not empty. ✅
Approved. ☝🏻
Well done @weirdwater. 👏🏻

@LEGIO-SEXTA-FERRATA LEGIO-SEXTA-FERRATA merged commit 4ee1960 into master May 19, 2025
7 checks passed
@LEGIO-SEXTA-FERRATA LEGIO-SEXTA-FERRATA deleted the wtf/yeoman-npx branch May 19, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants