Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxi): manage modules via cli #4001

Closed
wants to merge 0 commits into from
Closed

feat(nuxi): manage modules via cli #4001

wants to merge 0 commits into from

Conversation

Intevel
Copy link
Contributor

@Intevel Intevel commented Mar 31, 2022

πŸ”— Linked issue

nuxt/rfcs#31
https://github.com/nuxt/framework/discussions/569
#3915

❓ 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

With the new commands you can now add different Nuxt 3 modules (& bridge) to the project via Nuxi. The given module name is matched with a list that is currently still done manually (maybe in the future an API?), the name is matched to prevent that not Nuxt modules are installed. The module is added to the .nuxtrc file which is merged with the normal nuxt config.

carbon

πŸ“ Checklist

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

@netlify
Copy link

netlify bot commented Mar 31, 2022

❌ Deploy Preview for nuxt3-docs failed.

Name Link
πŸ”¨ Latest commit 0836c86
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63445478cbc3a500089b552a

@Intevel Intevel marked this pull request as draft March 31, 2022 16:40
@Intevel Intevel marked this pull request as ready for review March 31, 2022 16:40
@Intevel
Copy link
Contributor Author

Intevel commented Mar 31, 2022

@Baroshem

@pi0
Copy link
Member

pi0 commented Mar 31, 2022

Thanks for the PR @Intevel. Some notes:

  • Please disable local linter (prettier) and run yarn lint --fix
  • We can start with nuxi module add <npm name> syntax (later integrate with nuxt modules DB but is not straight forward)
  • lmify is deprecated. Working on a new package. It is not safe to rely on.

@pi0 pi0 marked this pull request as draft March 31, 2022 16:45
@pi0 pi0 added the pending label Mar 31, 2022
@Intevel
Copy link
Contributor Author

Intevel commented Mar 31, 2022

Thank you @pi0.
I had already talked with @Atinux that we draft this PR for now. I fixed the linting & disabled prettier. Currently have some kind of manual DB inserted with names, similar to slugs. That would be just an idea.

packages/nuxi/src/commands/module.ts Outdated Show resolved Hide resolved
packages/nuxi/src/utils/modules.ts Outdated Show resolved Hide resolved
packages/nuxi/src/utils/modules.ts Outdated Show resolved Hide resolved
@Atinux
Copy link
Member

Atinux commented Apr 1, 2022

Thank you for the PR :)

Agree to start with nuxi module add <npm name> since it allow anyone to use new packages that are not officially listed.

@Intevel
Copy link
Contributor Author

Intevel commented Apr 3, 2022

Thanks for the PR @Intevel. Some notes:

  • Please disable local linter (prettier) and run yarn lint --fix

  • We can start with nuxi module add <npm name> syntax (later integrate with nuxt modules DB but is not straight forward)

  • lmify is deprecated. Working on a new package. It is not safe to rely on.

@pi0 https://github.com/Intevel/qpind Maybe this instead of lmify for this?

@pi0
Copy link
Member

pi0 commented Apr 4, 2022

Nice work on qpind @Intevel πŸ’š However we already have antfu/install-pkg and other solutions, I would still wait for new unjs package designed for nuxi and nuxt universal integration.

@pi0 pi0 force-pushed the main branch 2 times, most recently from 247e18b to c98e5c7 Compare September 14, 2022 10:41
@Baroshem
Copy link
Contributor

Baroshem commented Oct 9, 2022

Folks, can we start working on this feature again? I think this would be an awesome DX improvement to the Nuxi tool. I can help with implementing this as well :)

@Intevel
Copy link
Contributor Author

Intevel commented Oct 9, 2022

Surely, so the package installing can we do with install-pkg but where do we get the data from to check if this is a nuxt module or not?

@Baroshem
Copy link
Contributor

Baroshem commented Oct 9, 2022

Can't we just parse the user input against a regexp and if it includes the nuxt keywoard assume that it is a module? @nuxt/@nuxtjs/nuxt-something should all work with that. I think even right now, you will only handle properly the modules that are in the modules array so we can always log to the user (Module not found in the supported modules DB/array, please configure the module by yourself)

@Intevel
Copy link
Contributor Author

Intevel commented Oct 9, 2022

@pi0 What do you think? Is a regex in this case the best way?

@Intevel
Copy link
Contributor Author

Intevel commented Oct 10, 2022

@Baroshem pushed some new stuff, what are you're thoughts about it? (btw i know its not an regex, wrong commit message)

@Baroshem
Copy link
Contributor

@Intevel

Yes, this is what I meant in my proposition in the Discord channel. Nice work! Now, let's wait for Pio, Daniel, or Sebastien to give their opinion and recommend next steps :)

@Intevel Intevel closed this Nov 16, 2022
@manniL
Copy link
Member

manniL commented Nov 16, 2022

@Intevel Did you close this intentionally?

@Intevel
Copy link
Contributor Author

Intevel commented Nov 16, 2022

@Intevel Did you close this intentionally?

This PR is now 8 months old. i doubt we'll get this feature in yet, if so i'll redevelop it. For PR #9055 I have synced my fork and so the old changes are lost. All good

@pi0
Copy link
Member

pi0 commented Nov 16, 2022

Supporting module management from CLI is definitely one thing we always dreamt of having but has been tricky so far because we lacked the CLI infra and AST modification tool to make it happen.

Would be happy to have you on board in next weeks on this feature @Intevel and sorry was delayed in the roadmap.

@Intevel
Copy link
Contributor Author

Intevel commented Nov 16, 2022

Supporting module management from CLI is definitely one thing we always dreamt of having but has been tricky so far because we lacked the CLI infra and AST modification tool to make it happen.

Would be happy to have you on board in next weeks on this feature @Intevel and sorry was delayed in the roadmap.

All right, I'm happy to be there. We can talk about it again as soon as it goes to the feature. I find the module management via the CLI quite good, maybe I open this PR again with a new PoC.

@Baroshem
Copy link
Contributor

I can help with this as well. Just let me know :)

@Intevel
Copy link
Contributor Author

Intevel commented Nov 16, 2022

Nice to hear, thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants