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

Improve composing of new generators and tests. #15618

Merged
merged 3 commits into from
Jul 12, 2021

Conversation

mshima
Copy link
Member

@mshima mshima commented Jul 9, 2021

Many methods must be switched from sync to async in other to support ESM blueprints.

  • Deprecate methods that should be removed for jhipster 8
  • Implement async composeWithBlueprints to replace sync instantiateBlueprints.
  • Fixes new generators with sbs blueprints.
  • Implement dependsOnJHipster alternative to composeWithJHipster.
    The first queues the composed generator before current one, the later queues after current one.
  • Add common --reproducible option, in order to make non-reproducible options easier to test.
  • Add common --add option. Should be used to compose with a generator at current project.
    jhipster add command shortcut is planned.
  • Implement common tests to test options, prompts and blueprint support.

Related to #15490


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@@ -29,4 +35,4 @@ const defaultConfig = {
...requiredConfig,
};

module.exports = { requiredConfig, defaultConfig };
module.exports = { requiredConfig, defaultConfig, reproducibleConfig };
Copy link
Contributor

Choose a reason for hiding this comment

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

idempotentConfig? defaultConfig? subGeneratorConfig?

Copy link
Member Author

Choose a reason for hiding this comment

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

  • requiredConfig needs to be written to .yo-rc.json.
  • defaultConfig is not written to .yo-rc.json to keep it clean.
  • reproducibleConfig is for testing purpose.

Copy link
Member Author

@mshima mshima Jul 10, 2021

Choose a reason for hiding this comment

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

Should requiredConfig be merged into defaultConfig and save everything?
What names?

Copy link
Member

Choose a reason for hiding this comment

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

Guys, instead of naming them this way, we should be naming them by their actual function, not just their properties: how should each variable be used? For example, is it for tests? "testConfig" can be used, or "configForTests".

Copy link
Member Author

Choose a reason for hiding this comment

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

Not every test should use it.
reproducibleConfigForTests would be better.

Copy link
Member

Choose a reason for hiding this comment

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

That'd be a better name indeed!

@mshima mshima merged commit 493ab22 into jhipster:main Jul 12, 2021
@mshima mshima deleted the skip_ci-refactor_new_generators branch July 12, 2021 23:17
@pascalgrimaud pascalgrimaud added this to the 7.2.0 milestone Sep 11, 2021
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.

None yet

4 participants