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

Add next_rails --init to replace next --init #139

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

JuanVqz
Copy link
Member

@JuanVqz JuanVqz commented Feb 17, 2025

Description

  1. I added a message to deprecate the current next --init command
    (eventually, we should remove it).
  2. Moved the next --init functionality into the NextRails::Init class
  3. Still need to move the bundle exec next functionallity. (next step? depends on the acceptance of this PR).

Motivation and Context

If the user has the next command installed from npm install -g next, the next --init command will not work.
This is a problem because the user will not know how to call the next command.

It is reported here:
Closes #113

How Has This Been Tested?

  • I have tested this by running the next --init command and checking that the message is displayed.
  • I have added automated tests to check the functionality of the NextRails::Init class.

Screenshots:

Added a deprecation warning when running next --init
Screenshot 2025-02-17 at 17 10 57

When the command creates the Gemfile.next and Gemfile.next.lock it shows the same message as next --init has been showing:

Screenshot 2025-02-17 at 17 12 50

If the next_rails --init gem was run previously and the Gemfile.next and Gemfile.next.lock already exist it does not run the command and shows a message instead.
Screenshot 2025-02-17 at 17 14 03

Now the --init command is part of the --help output

Screenshot 2025-02-17 at 17 26 36

I will abide by the code of conduct

@JuanVqz JuanVqz force-pushed the add-next_rails--init-command branch from 27de792 to 2896b55 Compare February 17, 2025 23:11
@JuanVqz JuanVqz requested review from etagwerker and arielj February 17, 2025 23:16
1. I added a message to deprecate the current `next --init` command
   (eventually, we should remove it).
2. Moved the `next --init` functionality into the `NextRails::Init` class
3. Still need to move the `bundle exec next` functionallity. (next step? depends on the acceptance of this PR).

Closes #113
@JuanVqz JuanVqz force-pushed the add-next_rails--init-command branch from 2896b55 to d678853 Compare February 18, 2025 15:26
Copy link
Member

@etagwerker etagwerker left a comment

Choose a reason for hiding this comment

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

@JuanVqz This looks good to me, but I'd like you to use fakefs in the tests. Could you please look into that?

https://github.com/fakefs/fakefs

@JuanVqz
Copy link
Member Author

JuanVqz commented Feb 20, 2025

@JuanVqz This looks good to me, but I'd like you to use fakefs in the tests. Could you please look into that?

https://github.com/fakefs/fakefs

@etagwerker I like the idea of using the fakefs gem; however, if we are planning on supporting older Ruby versions (2.0, 2.3, etc...), it would be complicated, the early fakefs v0.14.0 was already requiring Ruby >= 2.3.0 as for the latest fakefs v3.0.0 it requires at least Ruby 3.0.

So, do you think we should still wanting to include that gem?

@etagwerker
Copy link
Member

Oh good point. Then I think it's okay to skip it

@etagwerker etagwerker merged commit 9e470b8 into main Feb 20, 2025
7 checks passed
@etagwerker etagwerker deleted the add-next_rails--init-command branch February 20, 2025 20:33
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.

[BUG] next command clashes with next from Next.js library
2 participants