@pnpm/bins.remover 1100.0.13 → 1100.0.14

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @pnpm/remove-bins
2
2
 
3
+ ## 1100.0.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @pnpm/core-loggers@1100.2.3
9
+
3
10
  ## 1100.0.13
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/bins.remover",
3
- "version": "1100.0.13",
3
+ "version": "1100.0.14",
4
4
  "description": "Remove bins from .bin",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "@pnpm/bins.resolver": "1100.0.9",
31
- "@pnpm/core-loggers": "1100.2.2",
31
+ "@pnpm/core-loggers": "1100.2.3",
32
32
  "@pnpm/pkg-manifest.reader": "1100.0.10",
33
33
  "@pnpm/types": "1101.4.0",
34
34
  "@zkochan/rimraf": "^4.0.0",
@@ -39,7 +39,7 @@
39
39
  "@pnpm/logger": "^1100.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@pnpm/bins.remover": "1100.0.13",
42
+ "@pnpm/bins.remover": "1100.0.14",
43
43
  "@pnpm/logger": "1100.0.0",
44
44
  "@types/is-windows": "^1.0.2",
45
45
  "@types/ramda": "0.31.1"
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { removeBin, removeBinsOfDependency } from './removeBins.js';
2
- export { removeBin, removeBinsOfDependency, };
@@ -1,6 +0,0 @@
1
- import type { DependencyManifest } from '@pnpm/types';
2
- export declare const removeBin: (cmd: string) => Promise<void>;
3
- export declare function removeBinsOfDependency(dependencyDir: string, opts: {
4
- dryRun?: boolean;
5
- binsDir: string;
6
- }): Promise<DependencyManifest | undefined>;
package/lib/removeBins.js DELETED
@@ -1,37 +0,0 @@
1
- import path from 'node:path';
2
- import { getBinsFromPackageManifest } from '@pnpm/bins.resolver';
3
- import { removalLogger, } from '@pnpm/core-loggers';
4
- import { safeReadPackageJsonFromDir } from '@pnpm/pkg-manifest.reader';
5
- import { rimraf } from '@zkochan/rimraf';
6
- import { cmdExtension as CMD_EXTENSION } from 'cmd-extension';
7
- import isWindows from 'is-windows';
8
- async function removeOnWin(cmd) {
9
- removalLogger.debug(cmd);
10
- await Promise.all([
11
- rimraf(cmd),
12
- rimraf(`${cmd}.ps1`),
13
- rimraf(`${cmd}${CMD_EXTENSION}`),
14
- // The `node` bin is linked as a real `<cmd>.exe` (see the node
15
- // special-case in `@pnpm/bins.linker`), so it must be removed too —
16
- // otherwise a stale `node.exe` survives on PATH after uninstall.
17
- rimraf(`${cmd}.exe`),
18
- ]);
19
- }
20
- async function removeOnNonWin(p) {
21
- removalLogger.debug(p);
22
- return rimraf(p);
23
- }
24
- export const removeBin = isWindows() ? removeOnWin : removeOnNonWin;
25
- export async function removeBinsOfDependency(dependencyDir, opts) {
26
- const uninstalledPkgJson = await safeReadPackageJsonFromDir(dependencyDir);
27
- if (!uninstalledPkgJson)
28
- return;
29
- const cmds = await getBinsFromPackageManifest(uninstalledPkgJson, dependencyDir);
30
- if (!opts.dryRun) {
31
- await Promise.all(cmds
32
- .map((cmd) => path.join(opts.binsDir, cmd.name))
33
- .map(removeBin));
34
- }
35
- return uninstalledPkgJson;
36
- }
37
- //# sourceMappingURL=removeBins.js.map