Skip to content

Commit

Permalink
Use alphabetical order for default package managers (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored Jan 4, 2025
1 parent b8ddf66 commit 05d78f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
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

0 comments on commit 05d78f0

Please sign in to comment.