starlight-package-managers 0.7.0 → 0.8.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # starlight-package-managers
2
+
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#18](https://github.com/HiDeoo/starlight-package-managers/pull/18) [`777e8ff`](https://github.com/HiDeoo/starlight-package-managers/commit/777e8ff307cfa876a5f84ef2c05018e5c5e93a4a) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v5.
package/README.md CHANGED
@@ -61,7 +61,7 @@ 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) & [`remove`](https://starlight-package-managers.vercel.app/usage/#remove).
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), [`dlx`](https://starlight-package-managers.vercel.app/usage/#dlx), [`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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-package-managers",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
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,21 +10,19 @@
10
10
  "./package.json": "./package.json"
11
11
  },
12
12
  "devDependencies": {
13
- "@astrojs/starlight": "0.24.4",
14
- "@playwright/test": "1.36.2",
15
- "astro": "4.11.0",
16
- "vitest": "0.33.0"
13
+ "@playwright/test": "^1.49.1",
14
+ "vitest": "2.1.6"
17
15
  },
18
16
  "peerDependencies": {
19
- "@astrojs/starlight": ">=0.22.0",
20
- "astro": ">=4.2.7"
17
+ "@astrojs/starlight": ">=0.22.0"
21
18
  },
22
19
  "engines": {
23
- "node": ">=18.14.1"
20
+ "node": ">=18.17.1"
24
21
  },
25
22
  "packageManager": "pnpm@8.6.10",
26
23
  "publishConfig": {
27
- "access": "public"
24
+ "access": "public",
25
+ "provenance": true
28
26
  },
29
27
  "sideEffects": false,
30
28
  "keywords": [
@@ -38,13 +36,14 @@
38
36
  "homepage": "https://github.com/HiDeoo/starlight-package-managers",
39
37
  "repository": {
40
38
  "type": "git",
41
- "url": "https://github.com/HiDeoo/starlight-package-managers.git"
39
+ "url": "https://github.com/HiDeoo/starlight-package-managers.git",
40
+ "directory": "packages/starlight-package-managers"
42
41
  },
43
42
  "bugs": "https://github.com/HiDeoo/starlight-package-managers/issues",
44
43
  "scripts": {
45
44
  "test": "pnpm test:unit && pnpm test:e2e",
46
45
  "test:unit": "vitest",
47
46
  "test:e2e": "playwright install --with-deps chromium && playwright test",
48
- "lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
47
+ "lint": "eslint . --cache --max-warnings=0"
49
48
  }
50
49
  }
package/pkg.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1
2
  const pkgManagers = ['npm', 'yarn', 'pnpm', 'bun', 'ni'] as const
2
3
 
3
4
  const defaultPkgManagers: PackageManager[] = ['npm', 'yarn', 'pnpm']
@@ -7,6 +8,7 @@ const commands: Commands = {
7
8
  add: 'npm i',
8
9
  create: 'npm create',
9
10
  devOption: '-D',
11
+ dlx: 'npx',
10
12
  exec: 'npx',
11
13
  run: 'npm run',
12
14
  remove: 'npm uninstall',
@@ -15,6 +17,7 @@ const commands: Commands = {
15
17
  add: 'yarn add',
16
18
  create: 'yarn create',
17
19
  devOption: '-D',
20
+ dlx: 'yarn dlx',
18
21
  exec: 'yarn',
19
22
  run: 'yarn run',
20
23
  remove: 'yarn remove',
@@ -23,6 +26,7 @@ const commands: Commands = {
23
26
  add: 'pnpm add',
24
27
  create: 'pnpm create',
25
28
  devOption: '-D',
29
+ dlx: 'pnpm dlx',
26
30
  exec: 'pnpm',
27
31
  run: 'pnpm run',
28
32
  remove: 'pnpm remove',
@@ -30,6 +34,7 @@ const commands: Commands = {
30
34
  bun: {
31
35
  add: 'bun add',
32
36
  devOption: '-d',
37
+ dlx: 'bunx',
33
38
  exec: 'bunx',
34
39
  run: 'bun run',
35
40
  remove: 'bun remove',
@@ -37,6 +42,7 @@ const commands: Commands = {
37
42
  ni: {
38
43
  add: 'ni',
39
44
  devOption: '-D',
45
+ dlx: 'nlx',
40
46
  exec: 'nlx',
41
47
  run: 'nr',
42
48
  remove: 'nun',
@@ -88,7 +94,7 @@ export function getCommand(
88
94
  }
89
95
 
90
96
  if (options.args && options.args.length > 0) {
91
- if (pkgManager === 'npm' && type !== 'exec' && type !== 'run') {
97
+ if (pkgManager === 'npm' && type !== 'dlx' && type !== 'exec' && type !== 'run') {
92
98
  command += ' --'
93
99
  }
94
100
 
@@ -98,7 +104,7 @@ export function getCommand(
98
104
  return command
99
105
  }
100
106
 
101
- export type CommandType = 'add' | 'create' | 'exec' | 'run' | 'remove'
107
+ export type CommandType = 'add' | 'create' | 'dlx' | 'exec' | 'run' | 'remove'
102
108
 
103
109
  export interface CommandOptions {
104
110
  args?: string