@pnpm/bins.remover 1100.0.15 → 1100.0.16

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,17 @@
1
1
  # @pnpm/remove-bins
2
2
 
3
+ ## 1100.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Republished every package: the tarballs published by the v11.13.1 through v11.16.0 releases were missing most of their compiled files due to a packing bug [#13164](https://github.com/pnpm/pnpm/issues/13164).
8
+
9
+ - Updated dependencies:
10
+ - @pnpm/bins.resolver@1100.0.11
11
+ - @pnpm/core-loggers@1100.2.5
12
+ - @pnpm/pkg-manifest.reader@1100.0.12
13
+ - @pnpm/types@1101.6.0
14
+
3
15
  ## 1100.0.15
4
16
 
5
17
  ### Patch Changes
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { removeBin, removeBinsOfDependency } from './removeBins.js';
2
+ export { removeBin, removeBinsOfDependency, };
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,37 @@
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/bins.remover",
3
- "version": "1100.0.15",
3
+ "version": "1100.0.16",
4
4
  "description": "Remove bins from .bin",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,10 +27,10 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
- "@pnpm/bins.resolver": "1100.0.10",
31
- "@pnpm/core-loggers": "1100.2.4",
32
- "@pnpm/pkg-manifest.reader": "1100.0.11",
33
- "@pnpm/types": "1101.5.0",
30
+ "@pnpm/bins.resolver": "1100.0.11",
31
+ "@pnpm/core-loggers": "1100.2.5",
32
+ "@pnpm/pkg-manifest.reader": "1100.0.12",
33
+ "@pnpm/types": "1101.6.0",
34
34
  "@zkochan/rimraf": "^4.0.0",
35
35
  "cmd-extension": "^2.0.0",
36
36
  "is-windows": "^1.0.2"
@@ -39,7 +39,7 @@
39
39
  "@pnpm/logger": "^1100.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@pnpm/bins.remover": "1100.0.15",
42
+ "@pnpm/bins.remover": "1100.0.16",
43
43
  "@pnpm/logger": "1100.0.0",
44
44
  "@types/is-windows": "^1.0.2",
45
45
  "@types/ramda": "0.31.1"