Skip to content

Commit

Permalink
docs: re-order command types
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo committed Feb 4, 2025
1 parent e4f86af commit 2342fee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PackageManagers from '../../components/PackageManagers.astro'
## Features

- 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).
- Support for various types of command: [`add`](/usage/#add), [`create`](/usage/#create), [`dlx`](/usage/#dlx), [`exec`](/usage/#exec), [`run`](/usage/#run) & [`remove`](/usage/#remove).
- Support for various types of command: [`add`](/usage/#add), [`create`](/usage/#create), [`dlx`](/usage/#dlx), [`exec`](/usage/#exec), [`install`](/usage/#install), [`remove`](/usage/#remove) & [`run`](/usage/#run).
- Synced tabs between each instance on the same page.
- Customizable output with [extra arguments](/usage/#extra-arguments), [comments](/usage/#comment) & [prefixes](/usage/#prefix).

Expand Down
20 changes: 10 additions & 10 deletions docs/src/content/docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,33 +106,33 @@ The code above generates the following commands:

<PackageManagers type="install" />

### `run`
### `remove`

To run a script defined in the package's manifest file, you can use the `run` type and specify the name of the name of the script using the `args` prop.
The `pkg` prop is used to specify the name of the package to remove.

```mdx title="src/content/docs/example.mdx" 'type="run"' 'args="dev"'
```mdx title="src/content/docs/example.mdx" 'type="remove"'
import { PackageManagers } from 'starlight-package-managers'

<PackageManagers type="run" args="dev" />
<PackageManagers type="remove" pkg="@astrojs/starlight" />
```

The code above generates the following commands:

<PackageManagers type="run" args="dev" />
<PackageManagers type="remove" pkg="@astrojs/starlight" />

### `remove`
### `run`

The `pkg` prop is used to specify the name of the package to remove.
To run a script defined in the package's manifest file, you can use the `run` type and specify the name of the name of the script using the `args` prop.

```mdx title="src/content/docs/example.mdx" 'type="remove"'
```mdx title="src/content/docs/example.mdx" 'type="run"' 'args="dev"'
import { PackageManagers } from 'starlight-package-managers'

<PackageManagers type="remove" pkg="@astrojs/starlight" />
<PackageManagers type="run" args="dev" />
```

The code above generates the following commands:

<PackageManagers type="remove" pkg="@astrojs/starlight" />
<PackageManagers type="run" args="dev" />

## Extra arguments

Expand Down
2 changes: 1 addition & 1 deletion packages/starlight-package-managers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ By this one:
## Features

- 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).
- 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), [`run`](https://starlight-package-managers.vercel.app/usage/#run) & [`remove`](https://starlight-package-managers.vercel.app/usage/#remove).
- 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).
- Synced tabs between each instance on the same page.
- 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).

Expand Down
2 changes: 1 addition & 1 deletion packages/starlight-package-managers/pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function getCommand(
return command
}

export type CommandType = 'add' | 'create' | 'dlx' | 'exec' | 'install' | 'run' | 'remove'
export type CommandType = 'add' | 'create' | 'dlx' | 'exec' | 'install' | 'remove' | 'run'

export interface CommandOptions {
args?: string
Expand Down

0 comments on commit 2342fee

Please sign in to comment.