starlight-package-managers 0.7.0 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/pkg.ts +7 -2
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), [`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), [`run`](https://starlight-package-managers.vercel.app/usage/#run) & [`remove`](https://starlight-package-managers.vercel.app/usage/#remove).
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.7.0",
3
+ "version": "0.8.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
@@ -7,6 +7,7 @@ const commands: Commands = {
7
7
  add: 'npm i',
8
8
  create: 'npm create',
9
9
  devOption: '-D',
10
+ dlx: 'npx',
10
11
  exec: 'npx',
11
12
  run: 'npm run',
12
13
  remove: 'npm uninstall',
@@ -15,6 +16,7 @@ const commands: Commands = {
15
16
  add: 'yarn add',
16
17
  create: 'yarn create',
17
18
  devOption: '-D',
19
+ dlx: 'yarn dlx',
18
20
  exec: 'yarn',
19
21
  run: 'yarn run',
20
22
  remove: 'yarn remove',
@@ -23,6 +25,7 @@ const commands: Commands = {
23
25
  add: 'pnpm add',
24
26
  create: 'pnpm create',
25
27
  devOption: '-D',
28
+ dlx: 'pnpm dlx',
26
29
  exec: 'pnpm',
27
30
  run: 'pnpm run',
28
31
  remove: 'pnpm remove',
@@ -30,6 +33,7 @@ const commands: Commands = {
30
33
  bun: {
31
34
  add: 'bun add',
32
35
  devOption: '-d',
36
+ dlx: 'bunx',
33
37
  exec: 'bunx',
34
38
  run: 'bun run',
35
39
  remove: 'bun remove',
@@ -37,6 +41,7 @@ const commands: Commands = {
37
41
  ni: {
38
42
  add: 'ni',
39
43
  devOption: '-D',
44
+ dlx: 'nlx',
40
45
  exec: 'nlx',
41
46
  run: 'nr',
42
47
  remove: 'nun',
@@ -88,7 +93,7 @@ export function getCommand(
88
93
  }
89
94
 
90
95
  if (options.args && options.args.length > 0) {
91
- if (pkgManager === 'npm' && type !== 'exec' && type !== 'run') {
96
+ if (pkgManager === 'npm' && type !== 'dlx' && type !== 'exec' && type !== 'run') {
92
97
  command += ' --'
93
98
  }
94
99
 
@@ -98,7 +103,7 @@ export function getCommand(
98
103
  return command
99
104
  }
100
105
 
101
- export type CommandType = 'add' | 'create' | 'exec' | 'run' | 'remove'
106
+ export type CommandType = 'add' | 'create' | 'dlx' | 'exec' | 'run' | 'remove'
102
107
 
103
108
  export interface CommandOptions {
104
109
  args?: string