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: remove nuxi dependency and prompt to install when needed #907

Merged
merged 7 commits into from
Sep 14, 2023

Conversation

wattanx
Copy link
Collaborator

@wattanx wattanx commented Sep 12, 2023

πŸ”— Linked issue

Fixes: #900

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

In nuxt/cli, nuxt is set for bin field.
This may conflict with the nuxt command in nuxt 2.
https://github.com/nuxt/cli/blob/master/package.json#L13-L17

So, I'll change to install nuxi when you want to use nitro.

The following code was used as a reference.
https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/features.ts

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@wattanx wattanx changed the title fix: auto install nuxi when needed fix: install nuxi when needed Sep 13, 2023
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

This looks good to me ❀️

@danielroe danielroe requested a review from pi0 September 13, 2023 21:47
return false
}

const { confirm } = await prompts({
Copy link
Member

@pi0 pi0 Sep 13, 2023

Choose a reason for hiding this comment

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

You can directly use consola.prompt (or logger.prompt -- not tested) to avoid new dependency

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

This looks another good idea but i believe safer approach might be supporting nuxt2 binary directly from nuxt@2 dist as a non conflicting feature. This looks more like a workaround to me.

Also, do we want to keep supporting nuxi for bridge? (we might potentially drop it in next nuxi major version).

Copy link
Member

@pi0 Do you mean that users of Bridge would have to change the cli command in their package.json scripts to nuxt2, if they are not using nitro?

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

I am suggesting adding an additional (nonconflicting) nuxt2 command so that the bridge can more safely enable nuxi by default.

@danielroe
Copy link
Member

Sounds good to me. @wattanx are you happy (keeping all that this PR does) to also add a nuxt2 legacy command?

@wattanx
Copy link
Collaborator Author

wattanx commented Sep 14, 2023

Yes, I'll add it!

@danielroe
Copy link
Member

We should probably also update the docs too for the bridge migration.

@danielroe danielroe changed the title fix: install nuxi when needed fix: remove nuxi dependency and prompt to install when needed Sep 14, 2023
@danielroe danielroe merged commit 131ac01 into main Sep 14, 2023
9 checks passed
@danielroe danielroe deleted the fix/change-to-nuxi-optional branch September 14, 2023 08:59
@danielroe danielroe mentioned this pull request Oct 2, 2023
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.

bridge: false results in "Cannot start nuxt: Cannot read properties of undefined (reading 'hook')"
3 participants