Skip to content

fix: install @bettter-auth/cli as a dev dependency#950

Open
sacrosanctic wants to merge 8 commits intosveltejs:mainfrom
sacrosanctic:widespread-magpie
Open

fix: install @bettter-auth/cli as a dev dependency#950
sacrosanctic wants to merge 8 commits intosveltejs:mainfrom
sacrosanctic:widespread-magpie

Conversation

@sacrosanctic
Copy link
Contributor

@sacrosanctic sacrosanctic commented Feb 27, 2026

closes #937

in this pr:

  • remove reliance on a package manager by installing the cli as a dev dependency
  • update pnpm install instructions to use corepack (src / src)
  • use pnpm dlx (src)
  • lock create and add args to a specific version for reproducibility

@svelte-docs-bot
Copy link

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: 03fc947

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@950
npx https://pkg.pr.new/sv@950
npx https://pkg.pr.new/@sveltejs/sv-utils@950

commit: 84bb18f

@paoloricciuti
Copy link
Member

An even better way could be to add @better-auth/cli as a dev dependency and have the command be better-auth generate --config src/lib/server/auth.ts --output src/lib/server/db/auth.schema.ts --yes...just tested and it works (and I prefer that to always install)

@sacrosanctic sacrosanctic changed the title fix: use adaptive package manager in scripts fix: install @bettter-auth/cli as a dev dependency Feb 27, 2026
@sacrosanctic sacrosanctic marked this pull request as ready for review February 27, 2026 11:22
"sv": patch
---

fix: install `@bettter-auth/cli` as a dev dependency

Choose a reason for hiding this comment

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

Suggested change
fix: install `@bettter-auth/cli` as a dev dependency
fix: install `@better-auth/cli` as a dev dependency

;)


- **npm** : `npx sv create`
- **pnpm** : `pnpx sv create` or `pnpm dlx sv create`
- **pnpm** : `pnpm dlx sv create`

Choose a reason for hiding this comment

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

Even though as per your link in the PR description, pnpx is not always there by default, I'm pretty sure it exists and is both used and preferred by the vast majority of pnpm users, and probably won't go away anytime soon. I'd argue to leave it as it was, or at least invert the original commands ("pnpm dlx ... or pnpx ...")


```sh
npm i -g pnpm
npm i -g corepack@latest
Copy link

@WarningImHack3r WarningImHack3r Feb 27, 2026

Choose a reason for hiding this comment

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

Maybe add a line or two to explain why specifically use corepack over the user's install, if it even is mandatory to use the corepack version?
Your sources explain why corepack is still a viable install method, but don't mention any specific advantage over any other installation method. Maybe removing this block altogether and let the user install it however they want is simpler to manage?

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.

[Better-Auth] Use the selected package manager for the auth:schema script

3 participants