starlight-package-managers 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/pkg.ts +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# starlight-package-managers
|
|
2
2
|
|
|
3
|
+
## 0.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#30](https://github.com/HiDeoo/starlight-package-managers/pull/30) [`b88d821`](https://github.com/HiDeoo/starlight-package-managers/commit/b88d8210391e0730b9cce79bd4923b03e752a99b) Thanks [@deloreyj](https://github.com/deloreyj)! - Strips version from package names for the [`create`](https://starlight-package-managers.vercel.app/usage/#create) command type for the `yarn` package manager which [does not support](https://github.com/yarnpkg/yarn/issues/6587) versioned package names for this command type.
|
|
8
|
+
|
|
9
|
+
## 0.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#25](https://github.com/HiDeoo/starlight-package-managers/pull/25) [`05d78f0`](https://github.com/HiDeoo/starlight-package-managers/commit/05d78f06318357821f5dff0ea159261ed9294611) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Changes the default order of default package managers to be alphabetical (`npm`, `pnpm`, and `yarn` instead of `npm`, `yarn`, and `pnpm`).
|
|
14
|
+
|
|
15
|
+
If you want to preserve the previous behaviour, you can check the [“Global Customization” guide](https://starlight-package-managers.vercel.app/guides/package-managers#global-customization) and manually specify the package managers order you want.
|
|
16
|
+
|
|
17
|
+
- [#27](https://github.com/HiDeoo/starlight-package-managers/pull/27) [`de20d7e`](https://github.com/HiDeoo/starlight-package-managers/commit/de20d7ec1988573ae0501b2537b32ed380d4b550) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Uses the `pnpx` command instead of `pnpm dlx` for the [`dlx` command type](https://starlight-package-managers.vercel.app/usage/#dlx) which is a [shorter alias](https://pnpm.io/cli/dlx) available since [`pnpm@7.0.0`](https://github.com/pnpm/pnpm/releases/tag/v7.0.0).
|
|
18
|
+
|
|
3
19
|
## 0.8.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-package-managers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Quickly display npm related commands for multiple package managers in your Starlight documentation site.",
|
|
6
6
|
"author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
|
package/pkg.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
2
|
const pkgManagers = ['npm', 'yarn', 'pnpm', 'bun', 'ni'] as const
|
|
3
3
|
|
|
4
|
-
const defaultPkgManagers: PackageManager[] = ['npm', '
|
|
4
|
+
const defaultPkgManagers: PackageManager[] = ['npm', 'pnpm', 'yarn']
|
|
5
5
|
|
|
6
6
|
const commands: Commands = {
|
|
7
7
|
npm: {
|
|
@@ -26,7 +26,7 @@ const commands: Commands = {
|
|
|
26
26
|
add: 'pnpm add',
|
|
27
27
|
create: 'pnpm create',
|
|
28
28
|
devOption: '-D',
|
|
29
|
-
dlx: '
|
|
29
|
+
dlx: 'pnpx',
|
|
30
30
|
exec: 'pnpm',
|
|
31
31
|
run: 'pnpm run',
|
|
32
32
|
remove: 'pnpm remove',
|
|
@@ -90,7 +90,12 @@ export function getCommand(
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
if (pkg) {
|
|
93
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Strip `@version` from package name for yarn create commands.
|
|
95
|
+
* @see https://github.com/yarnpkg/yarn/issues/6587
|
|
96
|
+
*/
|
|
97
|
+
const processedPkg = type === 'create' && pkgManager === 'yarn' ? pkg.replace(/@[^\s]+/, '') : pkg
|
|
98
|
+
command += ` ${processedPkg}`
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
if (options.args && options.args.length > 0) {
|