extension-install 3.9.3 → 3.9.5

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/README.md CHANGED
@@ -4,17 +4,20 @@ Managed browser installer/uninstaller runtime for Extension.js CLI.
4
4
 
5
5
  This package powers:
6
6
 
7
- - `extension install --browser <browser>`
7
+ - `extension install <browser>`
8
+ - `extension install --browser <browser[,browser2]|all>`
8
9
  - `extension install --where`
9
10
  - `extension uninstall <browser>`
10
11
  - `extension uninstall --all`
11
12
  - `extension uninstall --where`
12
13
 
13
- When `--where` is used together with `--browser` (or `--all` on uninstall), Extension.js prints the resolved managed install path(s) for those target browsers. Without a target, it prints the managed cache root.
14
+ For a single browser, the positional form is the canonical command. Use `--browser` when you want multiple targets, browser families, or `all`.
15
+
16
+ When `--where` is used together with a browser name, `--browser`, or `--all` on uninstall, Extension.js prints the resolved managed install path(s) for those target browsers. Without a target, it prints the managed cache root.
14
17
 
15
18
  Uninstall scope is limited to the Extension.js managed cache root (or `EXT_BROWSERS_CACHE_DIR` when set). It does not remove browser installations outside that managed location.
16
19
 
17
- Linux note for `edge`: Playwright channel installs may require a privileged interactive session (`sudo` prompt). If channel install cannot proceed but a system Edge binary is already present, Extension.js will use that existing binary. Otherwise, install Edge system-wide first and then run Extension.js with `--browser=edge` (or use `chromium`).
20
+ Linux note for `edge`: Playwright channel installs may require a privileged interactive session (`sudo` prompt). If channel install cannot proceed but a system Edge binary is already present, Extension.js will use that existing binary. Otherwise, install Edge system-wide first and then run `extension install edge` (or use `chromium`).
18
21
 
19
22
  Default managed cache locations are stable and human-readable:
20
23
  - macOS: `~/Library/Caches/extension.js/browsers`
package/dist/module.cjs CHANGED
@@ -107,19 +107,35 @@ function buildExecEnv(base) {
107
107
  Path: updated
108
108
  };
109
109
  }
110
+ function detectCurrentPackageManager() {
111
+ const userAgent = String(process.env.npm_config_user_agent || '').toLowerCase();
112
+ if (userAgent.includes('pnpm')) return 'pnpm';
113
+ if (userAgent.includes('bun')) return 'bun';
114
+ if (userAgent.includes('npm')) return 'npm';
115
+ return 'unknown';
116
+ }
110
117
  function browserInstallCommand(_target) {
118
+ const packageManager = detectCurrentPackageManager();
119
+ if ('pnpm' === packageManager) return 'win32' === process.platform ? 'pnpm.cmd' : 'pnpm';
120
+ if ('bun' === packageManager) return 'win32' === process.platform ? 'bunx.cmd' : 'bunx';
111
121
  return 'win32' === process.platform ? 'npx.cmd' : 'npx';
112
122
  }
113
123
  function browserInstallArgs(target, destination) {
124
+ const packageManager = detectCurrentPackageManager();
125
+ const packageRunnerPrefix = 'pnpm' === packageManager ? [
126
+ 'dlx'
127
+ ] : 'bun' === packageManager ? [] : [
128
+ '-y'
129
+ ];
114
130
  if ('edge' === target) return [
115
- '-y',
131
+ ...packageRunnerPrefix,
116
132
  'playwright@latest',
117
133
  'install',
118
134
  'msedge'
119
135
  ];
120
136
  const browserRef = 'chrome' === target ? 'chrome@stable' : target;
121
137
  return [
122
- '-y',
138
+ ...packageRunnerPrefix,
123
139
  '@puppeteer/browsers@latest',
124
140
  'install',
125
141
  browserRef,
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "name": "extension-install",
26
- "version": "3.9.3",
26
+ "version": "3.9.5",
27
27
  "description": "Managed browser installer/uninstaller for Extension.js",
28
28
  "author": {
29
29
  "name": "Cezar Augusto",