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

Use alphabetical order for default package managers #25

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/mighty-books-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'starlight-package-managers': minor
---

Changes the default order of default package managers to be alphabetical (`npm`, `pnpm`, and `yarn` instead of `npm`, `yarn`, and `pnpm`).

If you want to preserve the previous behaviour, you can check the [“Global Customization” guide](http://localhost:4321/guides/package-managers#global-customization) and manually specify the package managers order you want.
2 changes: 1 addition & 1 deletion packages/starlight-package-managers/pkg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const pkgManagers = ['npm', 'yarn', 'pnpm', 'bun', 'ni'] as const

const defaultPkgManagers: PackageManager[] = ['npm', 'yarn', 'pnpm']
const defaultPkgManagers: PackageManager[] = ['npm', 'pnpm', 'yarn']

const commands: Commands = {
npm: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('package managers', () => {
getSupportedPkgManagers('add', undefined).map((pkgManager) => {
return getCommand(pkgManager, 'add', 'astro', {})
}),
).toEqual(['npm i astro', 'yarn add astro', 'pnpm add astro'])
).toEqual(['npm i astro', 'pnpm add astro', 'yarn add astro'])
})

test('should support overriding the package managers', () => {
Expand Down
Loading