Skip to content

fix(init,module,upgrade): validate response from consola.prompt#687

Merged
danielroe merged 1 commit intomainfrom
fix/handle-prompt-cancel
Jan 17, 2025
Merged

fix(init,module,upgrade): validate response from consola.prompt#687
danielroe merged 1 commit intomainfrom
fix/handle-prompt-cancel

Conversation

@danielroe
Copy link
Member

🔗 Linked issue

❓ 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)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

consola.prompt returns a Symbol when Ctrl-C is called - we can't trust the types on this one.

@github-actions
Copy link
Contributor

Bundle Stats — create-nuxt-app 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 count Total bundle size % Changed
6 1.03 MB → 1.03 MB (+164 B) +0.02%
Changeset
File Δ Size
home/runner/work/cli/cli/packages/nuxi/src/commands/init.ts 📈 +164 B (+3.16%) 5.06 kB → 5.22 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
shared/create-nuxt-app.D06YzshY.mjs 0 B → 896.2 kB (+896.2 kB) -

Removed

Asset File Size % Changed
shared/create-nuxt-app.CVpZ5gnK.mjs 896.04 kB → 0 B (-896.04 kB) -100%

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 1.01 kB 0%
chunks/index.mjs 70.29 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/prompt.mjs 42.92 kB 0%
chunks/satisfies.mjs 43 kB 0%

@github-actions
Copy link
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 count Total bundle size % Changed
55 5.76 MB → 5.76 MB (+264 B) +0.00%
Changeset
File Δ Size
src/commands/init.ts 📈 +164 B (+3.16%) 5.07 kB → 5.23 kB
src/commands/module/add.ts 📈 +91 B (+0.88%) 10.05 kB → 10.14 kB
src/commands/upgrade.ts 📈 +9 B (+0.15%) 5.69 kB → 5.7 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/init.mjs 805.33 kB → 805.49 kB (+164 B) +0.02%
chunks/add2.mjs 11.89 kB → 11.98 kB (+91 B) +0.75%
chunks/upgrade.mjs 5.69 kB → 5.7 kB (+9 B) +0.15%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 188 B 0%
chunks/prompt.mjs 46.07 kB 0%
chunks/add.mjs 6.83 kB 0%
chunks/analyze.mjs 3.18 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 1.75 kB 0%
chunks/dev.mjs 9.58 kB 0%
chunks/devtools.mjs 764 B 0%
chunks/generate.mjs 388 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/preview.mjs 2.84 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 1.74 kB 0%
chunks/prompt2.mjs 42.92 kB 0%
chunks/satisfies.mjs 116 B 0%
chunks/main.mjs 15.34 kB 0%
chunks/index2.mjs 909.09 kB 0%
chunks/dev2.mjs 69.1 kB 0%
chunks/index3.mjs 17.08 kB 0%
chunks/xdg-open.mjs 25.32 kB 0%
chunks/node.mjs 134.34 kB 0%
chunks/index4.mjs 1.24 kB 0%
chunks/index5.mjs 6.55 kB 0%
chunks/index6.mjs 70.29 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/search.mjs 42.99 kB 0%
chunks/index7.mjs 5.87 kB 0%
chunks/index8.mjs 882.9 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
shared/nuxi.BBzqwRm3.mjs 130.65 kB 0%
shared/nuxi.AKza-snH.mjs 804 B 0%
shared/nuxi.DhZr7-yO.mjs 294 B 0%
shared/nuxi.DdI-vRyV.mjs 1.54 kB 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.jHNMu6i2.mjs 1.34 kB 0%
shared/nuxi.CeDCJTol.mjs 18.95 kB 0%
shared/nuxi.BxUBQFte.mjs 17.68 kB 0%
shared/nuxi.CG0IAtJF.mjs 1.12 kB 0%
shared/nuxi.D0__QBAb.mjs 14.64 kB 0%
shared/nuxi.DmrxZHCA.mjs 8.04 kB 0%
shared/nuxi.Cb8SV1Ml.mjs 6.13 kB 0%
shared/nuxi.SEuYCQjN.mjs 2.02 MB 0%
shared/nuxi.E-ZsRS8r.mjs 943 B 0%
shared/nuxi.BgENdoyd.mjs 1.76 kB 0%
shared/nuxi.0ipB_0_w.mjs 152.13 kB 0%
shared/nuxi.BCPAKoPr.mjs 285.08 kB 0%
shared/nuxi.ChFrgAY-.mjs 5.71 kB 0%
shared/nuxi.5bNOxngo.mjs 5.09 kB 0%
shared/nuxi.BPuj-7ta.mjs 42.89 kB 0%

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 17, 2025

Open in Stackblitz

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

commit: 378757a

@github-actions
Copy link
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 count Total bundle size % Changed
29 77.34 kB → 77.6 kB (+262 B) +0.33%
Changeset
File Δ Size
home/runner/work/cli/cli/packages/nuxi/src/commands/init.ts 📈 +162 B (+3.13%) 5.05 kB → 5.21 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/module/add.ts 📈 +91 B (+0.89%) 10.04 kB → 10.13 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/upgrade.ts 📈 +9 B (+0.15%) 5.69 kB → 5.7 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/init.mjs 5.05 kB → 5.21 kB (+162 B) +3.13%
chunks/add2.mjs 11.7 kB → 11.79 kB (+91 B) +0.76%
chunks/upgrade.mjs 5.69 kB → 5.7 kB (+9 B) +0.15%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 200 B 0%
chunks/add.mjs 6.83 kB 0%
chunks/analyze.mjs 3.18 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 1.76 kB 0%
chunks/dev.mjs 7 kB 0%
chunks/devtools.mjs 763 B 0%
chunks/generate.mjs 388 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/preview.mjs 2.84 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 1.74 kB 0%
chunks/dev2.mjs 7.26 kB 0%
chunks/search.mjs 2.94 kB 0%
shared/cli.ZjQ19XGU.mjs 5.48 kB 0%
shared/cli.mEn9q49T.mjs 804 B 0%
shared/cli.BnJuNnzK.mjs 294 B 0%
shared/cli.BSm0_9Hr.mjs 107 B 0%
shared/cli.DlcAx0De.mjs 1.04 kB 0%
shared/cli.oZROxEeE.mjs 1.23 kB 0%
shared/cli.BXJN2WjZ.mjs 1.12 kB 0%
shared/cli.Bzv_ksqZ.mjs 107 B 0%
shared/cli.C935N1ss.mjs 687 B 0%

@danielroe danielroe merged commit fd918e3 into main Jan 17, 2025
11 checks passed
@danielroe danielroe deleted the fix/handle-prompt-cancel branch January 17, 2025 21:45
@pi0
Copy link
Member

pi0 commented Jan 19, 2025

Not sure if aware of this: unjs/consola#325

@danielroe
Copy link
Member Author

oh, nice! thank you ❤️

This was referenced Jan 29, 2025
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.

2 participants