starlight-package-managers 0.1.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.
- package/PackageManagers.astro +7 -5
- package/README.md +3 -3
- package/package.json +7 -7
package/PackageManagers.astro
CHANGED
|
@@ -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"
|
|
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"
|
|
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/
|
|
6
|
-
<img alt="Demo of starlight-package-managers" src="https://github.com/HiDeoo/vercel-env-push/assets/494699/
|
|
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>
|
|
@@ -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/guides/getting-started/).
|
|
23
|
+
Want to get started immediately? Check out the [getting started guide](https://starlight-package-managers.vercel.app/guides/getting-started/) or a [live demo](https://starlight-package-managers.vercel.app/demo/).
|
|
24
24
|
|
|
25
25
|
## Description
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-package-managers",
|
|
3
|
-
"version": "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,17 +10,17 @@
|
|
|
10
10
|
"./package.json": "./package.json"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@astrojs/starlight": "0.
|
|
13
|
+
"@astrojs/starlight": "0.17.0",
|
|
14
14
|
"@playwright/test": "1.36.2",
|
|
15
|
-
"astro": "2.
|
|
15
|
+
"astro": "4.2.6",
|
|
16
16
|
"vitest": "0.33.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@astrojs/starlight": ">=0.
|
|
20
|
-
"astro": ">=
|
|
19
|
+
"@astrojs/starlight": ">=0.17.0",
|
|
20
|
+
"astro": ">=4.0.0"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=18"
|
|
23
|
+
"node": ">=18.14.1"
|
|
24
24
|
},
|
|
25
25
|
"packageManager": "pnpm@8.6.10",
|
|
26
26
|
"publishConfig": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"test": "pnpm test:unit && pnpm test:e2e",
|
|
46
46
|
"test:unit": "vitest",
|
|
47
|
-
"test:e2e": "playwright test",
|
|
47
|
+
"test:e2e": "playwright install --with-deps chromium && playwright test",
|
|
48
48
|
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
|
|
49
49
|
}
|
|
50
50
|
}
|