starlight-package-managers 0.9.0 → 0.10.0

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # starlight-package-managers
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#32](https://github.com/HiDeoo/starlight-package-managers/pull/32) [`78ba376`](https://github.com/HiDeoo/starlight-package-managers/commit/78ba376398b5f91af2f5a1f882d54de4e660be9e) Thanks [@YonicDev](https://github.com/YonicDev)! - Adds the `install` command type to install all dependencies for a project.
8
+
9
+ ## 0.9.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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.
14
+
3
15
  ## 0.9.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -61,7 +61,7 @@ By this one:
61
61
  ## Features
62
62
 
63
63
  - Support for various package managers: [npm](https://www.npmjs.com), [yarn](https://yarnpkg.com), [pnpm](https://pnpm.io), [bun](https://bun.sh) & [ni](https://github.com/antfu/ni).
64
- - Support for various types of command: [`add`](https://starlight-package-managers.vercel.app/usage/#add), [`create`](https://starlight-package-managers.vercel.app/usage/#create), [`dlx`](https://starlight-package-managers.vercel.app/usage/#dlx), [`exec`](https://starlight-package-managers.vercel.app/usage/#exec), [`run`](https://starlight-package-managers.vercel.app/usage/#run) & [`remove`](https://starlight-package-managers.vercel.app/usage/#remove).
64
+ - Support for various types of command: [`add`](https://starlight-package-managers.vercel.app/usage/#add), [`create`](https://starlight-package-managers.vercel.app/usage/#create), [`dlx`](https://starlight-package-managers.vercel.app/usage/#dlx), [`exec`](https://starlight-package-managers.vercel.app/usage/#exec), [`install`](https://starlight-package-managers.vercel.app/usage/#install), [`remove`](https://starlight-package-managers.vercel.app/usage/#remove) & [`run`](https://starlight-package-managers.vercel.app/usage/#run).
65
65
  - Synced tabs between each instance on the same page.
66
66
  - Customizable output with [extra arguments](https://starlight-package-managers.vercel.app/usage/#extra-arguments), [comments](https://starlight-package-managers.vercel.app/usage/#comment) & [prefixes](https://starlight-package-managers.vercel.app/usage/#prefix).
67
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-package-managers",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
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
@@ -10,6 +10,7 @@ const commands: Commands = {
10
10
  devOption: '-D',
11
11
  dlx: 'npx',
12
12
  exec: 'npx',
13
+ install: 'npm install',
13
14
  run: 'npm run',
14
15
  remove: 'npm uninstall',
15
16
  },
@@ -19,6 +20,7 @@ const commands: Commands = {
19
20
  devOption: '-D',
20
21
  dlx: 'yarn dlx',
21
22
  exec: 'yarn',
23
+ install: 'yarn install',
22
24
  run: 'yarn run',
23
25
  remove: 'yarn remove',
24
26
  },
@@ -28,6 +30,7 @@ const commands: Commands = {
28
30
  devOption: '-D',
29
31
  dlx: 'pnpx',
30
32
  exec: 'pnpm',
33
+ install: 'pnpm install',
31
34
  run: 'pnpm run',
32
35
  remove: 'pnpm remove',
33
36
  },
@@ -36,6 +39,7 @@ const commands: Commands = {
36
39
  devOption: '-d',
37
40
  dlx: 'bunx',
38
41
  exec: 'bunx',
42
+ install: 'bun install',
39
43
  run: 'bun run',
40
44
  remove: 'bun remove',
41
45
  },
@@ -44,6 +48,7 @@ const commands: Commands = {
44
48
  devOption: '-D',
45
49
  dlx: 'nlx',
46
50
  exec: 'nlx',
51
+ install: 'ni',
47
52
  run: 'nr',
48
53
  remove: 'nun',
49
54
  },
@@ -90,7 +95,12 @@ export function getCommand(
90
95
  }
91
96
 
92
97
  if (pkg) {
93
- command += ` ${pkg}`
98
+ /**
99
+ * Strip `@version` from package name for yarn create commands.
100
+ * @see https://github.com/yarnpkg/yarn/issues/6587
101
+ */
102
+ const processedPkg = type === 'create' && pkgManager === 'yarn' ? pkg.replace(/@[^\s]+/, '') : pkg
103
+ command += ` ${processedPkg}`
94
104
  }
95
105
 
96
106
  if (options.args && options.args.length > 0) {
@@ -104,7 +114,7 @@ export function getCommand(
104
114
  return command
105
115
  }
106
116
 
107
- export type CommandType = 'add' | 'create' | 'dlx' | 'exec' | 'run' | 'remove'
117
+ export type CommandType = 'add' | 'create' | 'dlx' | 'exec' | 'install' | 'remove' | 'run'
108
118
 
109
119
  export interface CommandOptions {
110
120
  args?: string