@rimelight/ui 0.0.14 → 0.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimelight/ui",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "private": false,
5
5
  "description": "Rimelight Entertainment UI Library.",
6
6
  "homepage": "https://rimelight.com/docs",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import { Tabs, TabItem } from "@astrojs/starlight/components"
3
- import { Code as AstroCode } from "astro:components"
3
+ import { Code } from "astro:components"
4
4
 
5
5
  interface Props {
6
6
  pkg: string
@@ -17,6 +17,8 @@ const commands: Record<string, Record<string, string>> = {
17
17
  bun: { add: "bun add", create: "bun create", install: "bun install", remove: "bun remove", run: "bun run", devOption: "-d" },
18
18
  }
19
19
 
20
+ const managers = ["npm", "pnpm", "yarn", "bun"] as const
21
+
20
22
  function getCommand(manager: string, cmdType: string, pkgName: string, devFlag: boolean): string {
21
23
  const mgrCmds = commands[manager]
22
24
  if (!mgrCmds) return ""
@@ -26,20 +28,12 @@ function getCommand(manager: string, cmdType: string, pkgName: string, devFlag:
26
28
  if (pkgName && cmdType !== "install") cmd += " " + pkgName
27
29
  return cmd
28
30
  }
29
-
30
- const managers = ["npm", "pnpm", "yarn", "bun"] as const
31
- const singleManager = managers[0] as string
32
- const command = getCommand(singleManager, type, pkg, dev)
33
31
  ---
34
32
 
35
- {(managers.length as number) === 1 ? (
36
- <AstroCode code={command} lang="sh" />
37
- ) : (
38
- <Tabs syncKey="package-managers">
39
- {managers.map((manager) => (
33
+ <Tabs syncKey="package-managers">
34
+ {managers.map((manager) => (
40
35
  <TabItem label={manager}>
41
- <AstroCode code={getCommand(manager, type, pkg, dev)} lang="sh" />
36
+ <Code code={getCommand(manager, type, pkg, dev)} lang="sh" />
42
37
  </TabItem>
43
- ))}
44
- </Tabs>
45
- )}
38
+ ))}
39
+ </Tabs>