Skip to content

fix(init): properly check installed modules - #1043

Merged
danielroe merged 4 commits into
mainfrom
fix/init
Sep 17, 2025
Merged

fix(init): properly check installed modules#1043
danielroe merged 4 commits into
mainfrom
fix/init

Conversation

@atinux

Copy link
Copy Markdown
Member
  • The detection of the installed modules was not working, using await import() was wrong, fixed it by using readPackageJSON
  • I also detected ahead of time if nuxt is installed as dependency to avoid asking to install Nuxt modules
  • This gives the possibility to install the Nuxt UI templates with Vite while keeping our nice Nuxt branding and CLI

@github-actions

github-actionsBot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Bundle Stats — create-nuxt size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files countTotal bundle size% Changed
505.9 MB → 5.9 MB (+9 B)+0.00%
Changeset
FileΔSize
home/runner/work/cli/cli/packages/nuxi/src/commands/init.ts📈 +9 B (+0.07%)11.82 kB → 11.83 kB
View detailed bundle breakdown

Added

AssetFile Size% Changed
shared/create-nuxt.DVsaFU7d.mjs0 B → 2.02 MB (+2.02 MB)-
shared/create-nuxt.D6QL_2us.mjs0 B → 1.17 MB (+1.17 MB)-
shared/create-nuxt.CL7C3h8q.mjs0 B → 961.89 kB (+961.89 kB)-
shared/create-nuxt.CdjDEmnn.mjs0 B → 108.11 kB (+108.11 kB)-
shared/create-nuxt.CU-IHC6-.mjs0 B → 18.91 kB (+18.91 kB)-
shared/create-nuxt.YyXVH23T.mjs0 B → 18.11 kB (+18.11 kB)-
shared/create-nuxt.BtwhSDQN.mjs0 B → 4.07 kB (+4.07 kB)-
shared/create-nuxt.BNK9DlAn.mjs0 B → 3.9 kB (+3.9 kB)-
shared/create-nuxt.CV8uSwfQ.mjs0 B → 3.72 kB (+3.72 kB)-
shared/create-nuxt.BB0Dqlvt.mjs0 B → 945 B (+945 B)-
shared/create-nuxt.DBb0wpgL.mjs0 B → 836 B (+836 B)-
shared/create-nuxt.DS5NkK3a.mjs0 B → 792 B (+792 B)-
shared/create-nuxt.DP9Qg57V.mjs0 B → 365 B (+365 B)-
shared/create-nuxt.C2O0oyaz.mjs0 B → 294 B (+294 B)-

Removed

AssetFile Size% Changed
shared/create-nuxt.D_tTg8Xn.mjs2.02 MB → 0 B (-2.02 MB)-100%
shared/create-nuxt.BdtjLNEK.mjs1.17 MB → 0 B (-1.17 MB)-100%
shared/create-nuxt.B2BRkwMc.mjs961.88 kB → 0 B (-961.88 kB)-100%
shared/create-nuxt.CqR_5oMD.mjs108.11 kB → 0 B (-108.11 kB)-100%
shared/create-nuxt.CxlsXaIT.mjs18.91 kB → 0 B (-18.91 kB)-100%
shared/create-nuxt.C2mGmnQ5.mjs18.11 kB → 0 B (-18.11 kB)-100%
shared/create-nuxt.CCoc7z7N.mjs4.07 kB → 0 B (-4.07 kB)-100%
shared/create-nuxt.Bc463RC0.mjs3.9 kB → 0 B (-3.9 kB)-100%
shared/create-nuxt.Diu_-UiC.mjs3.72 kB → 0 B (-3.72 kB)-100%
shared/create-nuxt.DJQYn574.mjs945 B → 0 B (-945 B)-100%
shared/create-nuxt.sn142zqc.mjs836 B → 0 B (-836 B)-100%
shared/create-nuxt.BrMKgTX-.mjs792 B → 0 B (-792 B)-100%
shared/create-nuxt.Df9dPN_9.mjs365 B → 0 B (-365 B)-100%
shared/create-nuxt.CsygZy0P.mjs294 B → 0 B (-294 B)-100%

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

AssetFile Size% Changed
index.mjs1.07 kB0%
chunks/multipart-parser.mjs5.11 kB0%
chunks/multipart-parser2.mjs4.58 kB0%
chunks/add.mjs6.89 kB0%
chunks/analyze.mjs3.35 kB0%
chunks/build.mjs2.04 kB0%
chunks/cleanup.mjs471 B0%
chunks/dev-child.mjs811 B0%
chunks/dev.mjs28.45 kB0%
chunks/devtools.mjs764 B0%
chunks/generate.mjs492 B0%
chunks/info.mjs4.43 kB0%
chunks/index.mjs274 B0%
chunks/prepare.mjs1.04 kB0%
chunks/preview.mjs3.58 kB0%
chunks/test.mjs1.16 kB0%
chunks/typecheck.mjs2.06 kB0%
chunks/upgrade.mjs6.65 kB0%
chunks/prompt.mjs42.91 kB0%
chunks/satisfies.mjs116 B0%
chunks/index2.mjs199.51 kB0%
chunks/jiti.mjs305 B0%
chunks/index3.mjs71.97 kB0%
chunks/add2.mjs12.08 kB0%
chunks/search.mjs45.85 kB0%
chunks/xdg-open.mjs25.32 kB0%
chunks/node.mjs145.67 kB0%
chunks/index4.mjs1.23 kB0%
chunks/index5.mjs5.85 kB0%
chunks/index6.mjs6.24 kB0%
chunks/index7.mjs50.51 kB0%
chunks/index8.mjs904.13 kB0%
shared/create-nuxt.BSm0_9Hr.mjs107 B0%
shared/create-nuxt.BjhZEm2-.mjs1.75 kB0%
shared/create-nuxt.Vk1IrVtB.mjs26.96 kB0%
shared/create-nuxt.4t9faemh.mjs43.64 kB0%

@github-actions

github-actionsBot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Bundle Stats — nuxt-cli size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files countTotal bundle size% Changed
3397.89 kB → 97.9 kB (+9 B)+0.01%
Changeset
FileΔSize
home/runner/work/cli/cli/packages/nuxi/src/commands/init.ts📈 +9 B (+0.07%)11.78 kB → 11.79 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

AssetFile Size% Changed
chunks/init.mjs12.15 kB → 12.16 kB (+9 B)+0.07%

Smaller

No assets were smaller

Unchanged

AssetFile Size% Changed
dev/index.mjs0 B0%
index.mjs236 B0%
chunks/index.mjs14.44 kB0%
chunks/analyze.mjs3.35 kB0%
chunks/cleanup.mjs471 B0%
chunks/dev-child.mjs815 B0%
chunks/dev.mjs11.31 kB0%
chunks/devtools.mjs763 B0%
chunks/generate.mjs492 B0%
chunks/build.mjs2.04 kB0%
chunks/info.mjs4.44 kB0%
chunks/index2.mjs273 B0%
chunks/add.mjs10.17 kB0%
chunks/search.mjs2.96 kB0%
chunks/prepare.mjs1.04 kB0%
chunks/preview.mjs3.58 kB0%
chunks/test.mjs1.16 kB0%
chunks/typecheck.mjs2.06 kB0%
chunks/upgrade.mjs6.65 kB0%
chunks/add2.mjs6.89 kB0%
shared/cli.B9AmABr3.mjs39 B0%
shared/cli.Dz2be-Ai.mjs792 B0%
shared/cli.BEUGgaW4.mjs294 B0%
shared/cli.BSm0_9Hr.mjs107 B0%
shared/cli.At9IMXtr.mjs1.23 kB0%
shared/cli.pLQ0oPGc.mjs836 B0%
shared/cli.qKvs7FJ2.mjs945 B0%
shared/cli.DhJ3cH8w.mjs78 B0%
shared/cli.Cr-OCgdO.mjs727 B0%
shared/cli.DHenkA1C.mjs351 B0%
shared/cli.vXg4eLNu.mjs1.8 kB0%
shared/cli.CTXRG5Cu.mjs5.57 kB0%

@github-actions

github-actionsBot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Bundle Stats — nuxi size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files countTotal bundle size% Changed
595.47 MB → 5.47 MB (+9 B)+0.00%
Changeset
FileΔSize
src/commands/init.ts📈 +9 B (+0.07%)11.82 kB → 11.82 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

AssetFile Size% Changed
chunks/init.mjs675.77 kB → 675.78 kB (+9 B)+0.00%

Smaller

No assets were smaller

Unchanged

AssetFile Size% Changed
index.mjs247 B0%
dev/index.mjs925 B0%
chunks/add.mjs6.89 kB0%
chunks/analyze.mjs3.35 kB0%
chunks/build.mjs2.04 kB0%
chunks/cleanup.mjs471 B0%
chunks/dev-child.mjs780 B0%
chunks/dev.mjs28.45 kB0%
chunks/devtools.mjs764 B0%
chunks/generate.mjs492 B0%
chunks/info.mjs4.43 kB0%
chunks/index.mjs274 B0%
chunks/prepare.mjs1.04 kB0%
chunks/preview.mjs3.58 kB0%
chunks/test.mjs1.16 kB0%
chunks/typecheck.mjs2.06 kB0%
chunks/upgrade.mjs6.65 kB0%
chunks/satisfies.mjs116 B0%
chunks/main.mjs15.3 kB0%
chunks/prompt.mjs42.91 kB0%
chunks/index2.mjs199.51 kB0%
chunks/jiti.mjs305 B0%
chunks/index3.mjs71.97 kB0%
chunks/multipart-parser.mjs5.11 kB0%
chunks/add2.mjs12.08 kB0%
chunks/search.mjs45.85 kB0%
chunks/xdg-open.mjs25.32 kB0%
chunks/node.mjs145.67 kB0%
chunks/index4.mjs1.23 kB0%
chunks/index5.mjs5.85 kB0%
chunks/multipart-parser2.mjs4.58 kB0%
chunks/index6.mjs904.13 kB0%
shared/nuxi.GLC40kEn.mjs19.33 kB0%
shared/nuxi.DQjfoGl0.mjs57.22 kB0%
shared/nuxi.CTyTlDmo.mjs18.91 kB0%
shared/nuxi.BXGZ9qFF.mjs792 B0%
shared/nuxi.C_u-rG9b.mjs294 B0%
shared/nuxi.DUZ_WukQ.mjs2.57 kB0%
shared/nuxi.8mhVoXwa.mjs916.43 kB0%
shared/nuxi.D2_bzAv0.mjs1.54 kB0%
shared/nuxi.DQbQuzNE.mjs4.07 kB0%
shared/nuxi.BSm0_9Hr.mjs107 B0%
shared/nuxi.CrvQqJcE.mjs836 B0%
shared/nuxi.BiWTNJI4.mjs945 B0%
shared/nuxi.Zu_ZTV_8.mjs18.11 kB0%
shared/nuxi.CJSnaadO.mjs10.64 kB0%
shared/nuxi.BAGoDD49.mjs1.05 kB0%
shared/nuxi.BEiAYiRs.mjs2.02 MB0%
shared/nuxi.BjhZEm2-.mjs1.75 kB0%
shared/nuxi.DQsdVvIb.mjs3.72 kB0%
shared/nuxi.DcfbSbTx.mjs124.55 kB0%
shared/nuxi.QWnQy_ku.mjs5.75 kB0%
shared/nuxi.BcK1uW4h.mjs365 B0%
shared/nuxi.DU9QXUOf.mjs26.96 kB0%
shared/nuxi.D3mADRf9.mjs14.73 kB0%
shared/nuxi.BLb4POFS.mjs42.47 kB0%
shared/nuxi.Do0aYBCO.mjs5.46 kB0%
shared/nuxi.4t9faemh.mjs43.64 kB0%

@pkg-pr-new

pkg-pr-newBot commented Sep 17, 2025

Copy link
Copy Markdown

nuxt-cli-playground

npm i https://pkg.pr.new/create-nuxt@1043
npm i https://pkg.pr.new/nuxi@1043
npm i https://pkg.pr.new/@nuxt/cli@1043

commit: 0758dc3

@codspeed-hq

codspeed-hqBot commented Sep 17, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #1043 will not alter performance

Comparing fix/init (0758dc3) with main (9d390df)

Summary

✅ 2 untouched

@danielroedanielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think for non-nuxt projects we should directly use the giget CLI.

needing to support them in nuxt/cli itself will add a bit too much complexity to maintaining it, I think.

@atinux

atinux commented Sep 17, 2025

Copy link
Copy Markdown
MemberAuthor

This is what I thought but wanted to confirm with you.

It's just that the DX of nuxt init is sexy (confirm to overwrite if dir exists, ask to install deps, etc)

Will revert some changes

@pi0

pi0 commented Sep 17, 2025

Copy link
Copy Markdown
Member

It's just that the DX of nuxt init is sexy (confirm to overwrite if dir exists, ask to install deps, etc)

We could add this features to giget CLI too btw.

@atinux

Copy link
Copy Markdown
MemberAuthor

We could add this features to giget CLI too btw.

Sounds good, I guess we will need to support passing the package manager here

Comment threadpackages/nuxi/src/commands/init.ts Outdated
@danielroe
danielroe merged commit 26b6770 into mainSep 17, 2025
15 checks passed
@danielroe
danielroe deleted the fix/init branch September 17, 2025 18:49
@github-actionsgithub-actionsBot mentioned this pull request Sep 16, 2025
Sign up for freeto 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.

3 participants

@atinux@pi0@danielroe