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 registration of yo sub-generators in setup-workspace and build.js #266

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

oltionchampari
Copy link
Contributor

@oltionchampari oltionchampari commented Dec 4, 2019

Closes #263

Developer Checklist (Definition of Done)

  • Descriptive title for this pull request provided (will be used for release notes later)
  • All acceptance criteria from the issue are met
  • Branch is up-to-date with the branch to be merged with, i.e., develop
  • Code is cleaned up and formatted
  • Code documentation written
  • Unit tests written
  • Build is successful
  • Summary of changes written
  • Wiki documentation written
  • Assign at least one reviewer
  • Assign at least one assignee
  • Add type label (e.g., bug, enhancement) to this pull request
  • Add next version label (e.g., release: minor) to this PR following semver

Summary of changes

  • The problem was that we were using env.register() to register a subgenerator

  • That doesn't work when other subgenerators are called within it .

  • Replaced env.register(require.resolve('../' + generator), 'phovea:' + generator);

    with

     env.lookup(() => {
           env.run(`phovea:${generator} ${_args}`, options || {}, () => {
             // wait a second after running yo to commit the files correctly
             setTimeout(() => resolve(), 500);
           });
          });
    

env.lookup scans for all installed generator/subgenerators.

As stated here: https://stackoverflow.com/questions/48680805/run-a-yeoman-sub-generator-using-yeoman-environment

  • I tested the command setup-workspace in generator-phovea v 1.1.1 and v 2.0.1 and they create
    they create the same files .
  • Further testing though is needed though.

@oltionchampari oltionchampari added type: bug Something isn't working release: patch PR merge results in a new patch version labels Dec 4, 2019
thinkh pushed a commit to Caleydo/vega_clue_product that referenced this pull request Dec 5, 2019
Copy link
Contributor

@thinkh thinkh left a comment

Choose a reason for hiding this comment

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

Works well! 👍

@thinkh thinkh changed the title setup-workspace subgenerator bug fix Fix registring yo sub-generators in setup-workspace and build.js Dec 5, 2019
@thinkh thinkh changed the title Fix registring yo sub-generators in setup-workspace and build.js Fix registration of yo sub-generators in setup-workspace and build.js Dec 5, 2019
@thinkh thinkh changed the title Fix registration of yo sub-generators in setup-workspace and build.js Fix registration of yo sub-generators in setup-workspace and bui… Dec 5, 2019
@thinkh thinkh merged commit bb70e4b into develop Dec 5, 2019
@thinkh thinkh deleted the ochampari/263_setup-workspace-bug branch December 5, 2019 09:38
@thinkh thinkh changed the title Fix registration of yo sub-generators in setup-workspace and bui… Fix registration of yo sub-generators in setup-workspace and build.js Dec 10, 2019
@thinkh thinkh mentioned this pull request Dec 10, 2019
21 tasks
thinkh added a commit to Caleydo/gapminder_product that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: patch PR merge results in a new patch version type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants