Skip to content

fix(create-app): default manual setup to npm - #2703

Merged
antfu merged 3 commits into
slidevjs:mainfrom
NgoQuocViet2001:fix-create-app-manual-npm-fallback
Aug 19, 2026
Merged

fix(create-app): default manual setup to npm#2703
antfu merged 3 commits into
slidevjs:mainfrom
NgoQuocViet2001:fix-create-app-manual-npm-fallback

Conversation

@NgoQuocViet2001

@NgoQuocViet2001 NgoQuocViet2001 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

When create-slidev is run directly with Node, no package manager may be detected. Choosing to install later then produced null install and null run dev in both the generated README and terminal output.

  • replace the custom detection logic with package-manager-detector
  • fall back to npm only for the manual setup path
  • keep the generated README and printed commands aligned

Tests

  • pnpm --filter create-slidev build
  • pnpm exec eslint packages/create-app/index.mjs packages/create-app/package.json
  • pnpm test
  • manually ran create-slidev without a package-manager user agent and verified the terminal and generated README use npm

@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit cf6e64a
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6a854b103f594700085870c6
😎 Deploy Preview https://deploy-preview-2703--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/@slidev/client@2703

create-slidev

npm i https://pkg.pr.new/create-slidev@2703

create-slidev-theme

npm i https://pkg.pr.new/create-slidev-theme@2703

@slidev/parser

npm i https://pkg.pr.new/@slidev/parser@2703

@slidev/cli

npm i https://pkg.pr.new/@slidev/cli@2703

@slidev/types

npm i https://pkg.pr.new/@slidev/types@2703

commit: f45bb98

@antfu

antfu commented Aug 14, 2026

Copy link
Copy Markdown
Member

Let's use https://github.com/antfu-collective/package-manager-detector and fallback to npm. Would you like to update the PR? Thanks

@NgoQuocViet2001

Copy link
Copy Markdown
Contributor Author

@antfu Updated — package manager detection now uses package-manager-detector, with npm kept as the fallback for manual setup. Thanks!

Comment thread packages/create-app/utils.mjs Outdated
* @param {string | null} packageManager
*/
export function getManualPackageManager(packageManager) {
return packageManager ?? 'npm'

@antfu antfu Aug 14, 2026

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.

Please minimize the code changes. I don't think this file is necessary

@NgoQuocViet2001
NgoQuocViet2001 force-pushed the fix-create-app-manual-npm-fallback branch from 3bc39be to 6d7caaf Compare August 14, 2026 13:34
Comment thread packages/create-app/index.mjs Outdated
@NgoQuocViet2001
NgoQuocViet2001 force-pushed the fix-create-app-manual-npm-fallback branch from 6d7caaf to f45bb98 Compare August 15, 2026 08:37
@antfu
antfu merged commit 22b9600 into slidevjs:main Aug 19, 2026
11 of 12 checks passed
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