Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: destructure property error #63

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

MichaelGoberling
Copy link
Contributor

Description

Installing templates with latest cli produces the following:

Running template @adobe/generator-app-excshell
 ›   Error: Cannot destructure property 'namespace' of 'generator.options' as it is undefined.

Looks like this is because env.instantiate() changed to be an async function with yeoman-environment v4, so after the upgrade with 2.0.2, the plugin started passing a promise to env.runGenerator() instead of a yeoman generator. This PR adds an await when instantiating so we pass the generator

Related Issue

Motivation and Context

How Has This Been Tested?

Locally linked plugin, npm run test

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ecffdcd) 100.00% compared to head (933ab36) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          508       508           
  Branches        92        92           
=========================================
  Hits           508       508           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@pru55e11 pru55e11 left a comment

Choose a reason for hiding this comment

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

🥰 small changes

Copy link
Member

@purplecabbage purplecabbage left a comment

Choose a reason for hiding this comment

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

This is great!
In the future when we find a bug that is not caught by our tests it would be nice to follow test-driven development.

ie.

  1. write a test that fails with the newly discovered condition
  2. commit the failing test
  3. fix the condition
  4. commit the resolution

@purplecabbage purplecabbage merged commit 743f96e into main Jan 27, 2024
7 checks passed
@purplecabbage purplecabbage deleted the fix-destructure-property-error branch January 27, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants