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

nitro npm package 🥳 #1362

Closed
pi0 opened this issue Jun 30, 2023 · 6 comments
Closed

nitro npm package 🥳 #1362

pi0 opened this issue Jun 30, 2023 · 6 comments

Comments

@pi0
Copy link
Member

pi0 commented Jun 30, 2023

Update: nitro and nitropack will be mirrored. More info: #2497


Currently, we are using nitropack and nitropack-edge npm packages for nitro releases. It was because nitro package was used. And package name is mismatched with the project name a little bit. We also publish docs in nitropack.org and have access to @nitropack/ npm scope planned to be used for presets (#845)).

Thanks to @danielroe for following up about nitro npm package and @jgermade for donating it now we have a chance to use it 🥳 (credits to be added to readme!)

Quickly talking with @danielroe, There are two ideas for using this new package:

  1. Release nitro v3 as [email protected] and have a compatibility [email protected] with stubs and bundling CLI in same package of nitro with build deps
  2. Use the new nitro package name for zero-dependency nitro CLI and keep using nitropack or better scoped npm packages for actual core/preset packages

And there are cons and pros with each.

  • Using nitro as the new Library name, makes naming consistent and also easier for to people understand what is in devDependencies field and node_modules.
  • Using nitro as the new standalone CLI, makes sure we can always advise npx nitro command without version conflicts similar to (upcoming) npx nuxi. This CLI will be for initializing a project but also upcoming user-defined subcommands (👀)

Opening this discussion to collect more feedback and ideas until nitro v3 release.

@pi0 pi0 added the discussion label Jun 30, 2023
@pi0 pi0 changed the title nitro npm package nitro npm package 🥳 Jun 30, 2023
@Hebilicious
Copy link
Contributor

Hebilicious commented Jun 30, 2023

Personally, I feel like renaming to nitro and deprecating nitropack for v3 is perfect and makes the most sense, as we always refer to Nitro as Nitro (in the docs etc) and nitropack was chosen just because nitro was un-available. Maybe we could also get away without releasing nitropack@3 ?

For the CLI, I like how Astro is doing it, where they use astro for both the cli and the dependency, and create-astro for the scaffolding tool.

This would enable :

  • npm i nitro install nitro as a dependency in package.json
  • npx nitro use the nitro cli for nitro commands (ie: nitro dev, nitro build...)
  • npm create nitro@latest leverage create-nitro to scaffold a project

However, since this is a brand new thing, we could also use a brand new name for the CLI if we want it separated, such as nitro-cli or nitri ?

Copy link
Collaborator

atinux commented Sep 11, 2023

nitro-cli makes more sense for your last question.

This is awesome news for nitro package!

@pi0
Copy link
Member Author

pi0 commented Sep 11, 2023

I respect all opinions and feedback.

Still leaner towards using nitro for dedicated cli, considering we need a zero dependency and short nuxi-like CLI for nitro and also a npm namespace for upcoming presets refactor which cannot be @nitro (it is actively used). CLI accessibility and usability is more important than programmatic usage and manual boilerplates.

@nksaraf
Copy link
Contributor

nksaraf commented Sep 23, 2023

I think having one package nitro with both the CLI and the core programmtic package is probably the easiest for people to use and understand. Its quite atypical to have a separate package just for the cli in other places in the ecosystem.

@pi0
Copy link
Member Author

pi0 commented Sep 26, 2023

is probably the easiest for people to use and understand

I also expect people to directly interact with nitro to initialize and run tasks for their projects and in config/imports/naming essentially everywhere 👍🏼

Weather bundling both Nitro core (with ALL dependencies which cost install size and hundreds of node_module files today) from single npm package is a technicality that reduces the DX of CLI usage every time we use it. And at least for modern Nuxt 3, we expose CLI as a standalone nuxi command (nuxt/cli) and we used a second name for CLI because nuxt was made years ago, following what was typical by the day for making frameworks with a cli. For nitro (in npm), we have this one-time chance to make a potentially more futuristic decision!

I think regardless, I am still clearly not messaging that this is a final decision but that need to gather more ideas and progress to see how Nitro structure evolves (in regards of increasing modularity and splitting presets to @nitropack/ npm namespace -- we can't have @nitro/!) and also future of nuxi CLI which is based on same foundation i have in my mind for Nitro CLI.

@pi0
Copy link
Member Author

pi0 commented Sep 15, 2024

nitro and nitropack will be mirrored and we will use nitro as the main package starting v3. More info: #2497 (CLI will remain part of the main/dep, except for project init that is powered by giget

@pi0 pi0 closed this as completed Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants