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

Allow running bin/rails from Solidus engines #5164

Merged
merged 1 commit into from
Jun 20, 2023
Merged

Conversation

elia
Copy link
Member

@elia elia commented Jun 19, 2023

Summary

Generators and other tasks will behave differently if ran from an engine directory:

  • they'll use the engine namespaces
  • they'll write files to the engine dir

With this change it will be possible to bin/rails core g migration … and have migrations or other generators work from the core folder.

The sandbox app is still the default.

This has been extracted from work on SolidusAdmin in which the component generator must be ran from the admin/ folder in order to create components in the engine vs. the sandbox.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia self-assigned this Jun 19, 2023
@elia elia requested a review from a team as a code owner June 19, 2023 15:29
@github-actions github-actions bot added the changelog:repository Changes to the repository not within any gem label Jun 19, 2023
@elia elia marked this pull request as draft June 19, 2023 15:31
@elia elia force-pushed the elia/bin-rails-from-engines branch from 3b2514f to 1093c69 Compare June 19, 2023 15:37
@github-actions github-actions bot added changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Jun 19, 2023
@elia elia marked this pull request as ready for review June 19, 2023 15:40
Generators and other tasks will behave differently if ran from an
engine directory:
- they'll use the engine namespaces
- they'll write files to the engine dir

With this change it will be possible to `bin/rails core g migration …`
and have migrations or other generators work from the `core` folder.

The `sandbox` app will still be the default.
@elia elia force-pushed the elia/bin-rails-from-engines branch from 1093c69 to ea27756 Compare June 19, 2023 16:48
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #5164 (ea27756) into main (42ec3f1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #5164   +/-   ##
=======================================
  Coverage   88.66%   88.66%           
=======================================
  Files         563      563           
  Lines       13884    13884           
=======================================
  Hits        12310    12310           
  Misses       1574     1574           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

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

Thanks! Nice improvement in DX! ❤️

Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

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

😍

@elia elia merged commit 8f0dd95 into main Jun 20, 2023
@elia elia deleted the elia/bin-rails-from-engines branch June 20, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:repository Changes to the repository not within any gem changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants