starlight-package-managers 0.2.0 → 0.3.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,30 +1,32 @@
1
1
  ---
2
- import { Tabs, TabItem } from '@astrojs/starlight/components'
3
- import { Code } from 'astro/components'
2
+ import { Code, Tabs, TabItem } from '@astrojs/starlight/components'
4
3
 
5
4
  import { type CommandType, getCommand, type CommandOptions, getSupportedPkgManagers, type PackageManager } from './pkg'
6
5
 
7
6
  export type PackageManagersProps = Props
8
7
 
9
8
  interface Props extends CommandOptions {
9
+ frame?: 'none' | 'terminal'
10
10
  pkg?: string | undefined
11
11
  pkgManagers?: PackageManager[]
12
+ title?: string | undefined
12
13
  type?: CommandType
13
14
  }
14
15
 
15
- const { pkg, pkgManagers, type = 'add', ...options } = Astro.props
16
+ const { frame = 'terminal', pkg, pkgManagers, title = undefined, type = 'add', ...options } = Astro.props
16
17
  const singlePkgManager = pkgManagers?.length === 1 ? pkgManagers[0] : undefined
18
+ const ecFrame = frame === 'terminal' ? 'terminal' : 'code'
17
19
  ---
18
20
 
19
21
  {
20
22
  singlePkgManager ? (
21
- <Code code={getCommand(singlePkgManager, type, pkg, options)} lang="sh" theme="css-variables" />
23
+ <Code code={getCommand(singlePkgManager, type, pkg, options)} lang="sh" {title} frame={ecFrame} />
22
24
  ) : (
23
25
  <starlight-package-managers>
24
26
  <Tabs>
25
27
  {getSupportedPkgManagers(type, pkgManagers).map((pkgManager) => (
26
28
  <TabItem label={pkgManager}>
27
- <Code code={getCommand(pkgManager, type, pkg, options)} lang="sh" theme="css-variables" />
29
+ <Code code={getCommand(pkgManager, type, pkg, options)} lang="sh" {title} frame={ecFrame} />
28
30
  </TabItem>
29
31
  ))}
30
32
  </Tabs>
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
  <h1>starlight-package-managers 🗃</h1>
3
3
  <p>Quickly display npm related commands for multiple package managers in your Starlight documentation site.</p>
4
4
  <p>
5
- <a href="https://github.com/HiDeoo/vercel-env-push/assets/494699/a5ac0d80-984c-418f-8ecd-41a034b2e25a" title="Demo of starlight-package-managers">
6
- <img alt="Demo of starlight-package-managers" src="https://github.com/HiDeoo/vercel-env-push/assets/494699/a5ac0d80-984c-418f-8ecd-41a034b2e25a" width="520" />
5
+ <a href="https://github.com/HiDeoo/vercel-env-push/assets/494699/12a27480-f3ff-470f-a108-e1bf73cd9146" title="Demo of starlight-package-managers">
6
+ <img alt="Demo of starlight-package-managers" src="https://github.com/HiDeoo/vercel-env-push/assets/494699/12a27480-f3ff-470f-a108-e1bf73cd9146" width="520" />
7
7
  </a>
8
8
  </p>
9
9
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-package-managers",
3
- "version": "0.2.0",
3
+ "version": "0.3.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,14 +10,14 @@
10
10
  "./package.json": "./package.json"
11
11
  },
12
12
  "devDependencies": {
13
- "@astrojs/starlight": "0.10.1",
13
+ "@astrojs/starlight": "0.17.0",
14
14
  "@playwright/test": "1.36.2",
15
- "astro": "3.1.1",
15
+ "astro": "4.2.6",
16
16
  "vitest": "0.33.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "@astrojs/starlight": ">=0.9.0",
20
- "astro": ">=3.0.0"
19
+ "@astrojs/starlight": ">=0.17.0",
20
+ "astro": ">=4.0.0"
21
21
  },
22
22
  "engines": {
23
23
  "node": ">=18.14.1"