starlight-package-managers 0.5.0 → 0.7.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.
@@ -1,6 +1,8 @@
1
1
  ---
2
- import { Code, Tabs, TabItem } from '@astrojs/starlight/components'
2
+ import { Code as ECCode, Tabs, TabItem } from '@astrojs/starlight/components'
3
3
  import type { ComponentProps } from 'astro/types'
4
+ import { Code as AstroCode } from 'astro:components'
5
+ import config from 'virtual:starlight/user-config'
4
6
 
5
7
  import {
6
8
  type CommandOptions,
@@ -24,7 +26,9 @@ interface Props extends CommandOptions {
24
26
 
25
27
  const { frame = 'terminal', icons = true, pkg, pkgManagers, title = undefined, type = 'add', ...options } = Astro.props
26
28
  const singlePkgManager = pkgManagers?.length === 1 ? pkgManagers[0] : undefined
27
- const ecFrame = frame === 'terminal' ? 'terminal' : 'code'
29
+ const isUsingEC = config.expressiveCode !== false
30
+ const ecFrame = isUsingEC ? (frame === 'terminal' ? 'terminal' : 'code') : undefined
31
+ const Code = isUsingEC ? ECCode : AstroCode
28
32
 
29
33
  function getTabItemProps(pkgManager: PackageManager) {
30
34
  const props: ComponentProps<typeof TabItem> = { label: pkgManager }
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  ## Getting Started
22
22
 
23
- Want to get started immediately? Check out the [getting started guide](https://starlight-package-managers.vercel.app/getting-started/) or a [live demo](https://starlight-package-managers.vercel.app/demo/).
23
+ Want to get started immediately? Check out the [getting started guide](https://starlight-package-managers.vercel.app/getting-started/) or check out the [demo](https://starlight-package-managers.vercel.app/demo/) to see the plugin in action.
24
24
 
25
25
  ## Description
26
26
 
@@ -61,14 +61,10 @@ 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).
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).
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
 
68
- ## Documentation
69
-
70
- Check out the [Starlight Package Managers documentation](https://starlight-package-managers.vercel.app).
71
-
72
68
  ## Related Projects
73
69
 
74
70
  - [npm-package-manager-extension](https://github.com/HiDeoo/npm-package-manager-extension)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-package-managers",
3
- "version": "0.5.0",
3
+ "version": "0.7.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)",
@@ -10,9 +10,9 @@
10
10
  "./package.json": "./package.json"
11
11
  },
12
12
  "devDependencies": {
13
- "@astrojs/starlight": "0.22.0",
13
+ "@astrojs/starlight": "0.24.4",
14
14
  "@playwright/test": "1.36.2",
15
- "astro": "4.3.7",
15
+ "astro": "4.11.0",
16
16
  "vitest": "0.33.0"
17
17
  },
18
18
  "peerDependencies": {
package/pkg.ts CHANGED
@@ -9,6 +9,7 @@ const commands: Commands = {
9
9
  devOption: '-D',
10
10
  exec: 'npx',
11
11
  run: 'npm run',
12
+ remove: 'npm uninstall',
12
13
  },
13
14
  yarn: {
14
15
  add: 'yarn add',
@@ -16,6 +17,7 @@ const commands: Commands = {
16
17
  devOption: '-D',
17
18
  exec: 'yarn',
18
19
  run: 'yarn run',
20
+ remove: 'yarn remove',
19
21
  },
20
22
  pnpm: {
21
23
  add: 'pnpm add',
@@ -23,18 +25,21 @@ const commands: Commands = {
23
25
  devOption: '-D',
24
26
  exec: 'pnpm',
25
27
  run: 'pnpm run',
28
+ remove: 'pnpm remove',
26
29
  },
27
30
  bun: {
28
31
  add: 'bun add',
29
32
  devOption: '-d',
30
33
  exec: 'bunx',
31
34
  run: 'bun run',
35
+ remove: 'bun remove',
32
36
  },
33
37
  ni: {
34
38
  add: 'ni',
35
39
  devOption: '-D',
36
40
  exec: 'nlx',
37
41
  run: 'nr',
42
+ remove: 'nun',
38
43
  },
39
44
  }
40
45
 
@@ -93,7 +98,7 @@ export function getCommand(
93
98
  return command
94
99
  }
95
100
 
96
- export type CommandType = 'add' | 'create' | 'exec' | 'run'
101
+ export type CommandType = 'add' | 'create' | 'exec' | 'run' | 'remove'
97
102
 
98
103
  export interface CommandOptions {
99
104
  args?: string
package/starlight.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module 'virtual:starlight/user-config' {
2
+ const Config: import('@astrojs/starlight/types').StarlightConfig
3
+
4
+ export default Config
5
+ }