@yarnpkg/plugin-pnpm 1.1.0-rc.4 → 1.1.0-rc.8

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.
@@ -9,6 +9,7 @@ export declare class PnpmLinker implements Linker {
9
9
  findPackageLocation(locator: Locator, opts: LinkOptions): Promise<PortablePath>;
10
10
  findPackageLocator(location: PortablePath, opts: LinkOptions): Promise<Locator | null>;
11
11
  makeInstaller(opts: LinkOptions): PnpmInstaller;
12
+ private isEnabled;
12
13
  }
13
14
  declare class PnpmInstaller implements Installer {
14
15
  private opts;
package/lib/PnpmLinker.js CHANGED
@@ -9,9 +9,11 @@ const clipanion_1 = require("clipanion");
9
9
  const p_limit_1 = (0, tslib_1.__importDefault)(require("p-limit"));
10
10
  class PnpmLinker {
11
11
  supportsPackage(pkg, opts) {
12
- return opts.project.configuration.get(`nodeLinker`) === `pnpm`;
12
+ return this.isEnabled(opts);
13
13
  }
14
14
  async findPackageLocation(locator, opts) {
15
+ if (!this.isEnabled(opts))
16
+ throw new Error(`Assertion failed: Expected the pnpm linker to be enabled`);
15
17
  const customDataKey = getCustomDataKey();
16
18
  const customData = opts.project.installersCustomData.get(customDataKey);
17
19
  if (!customData)
@@ -22,6 +24,8 @@ class PnpmLinker {
22
24
  return packageLocation;
23
25
  }
24
26
  async findPackageLocator(location, opts) {
27
+ if (!this.isEnabled(opts))
28
+ return null;
25
29
  const customDataKey = getCustomDataKey();
26
30
  const customData = opts.project.installersCustomData.get(customDataKey);
27
31
  if (!customData)
@@ -48,6 +52,9 @@ class PnpmLinker {
48
52
  makeInstaller(opts) {
49
53
  return new PnpmInstaller(opts);
50
54
  }
55
+ isEnabled(opts) {
56
+ return opts.project.configuration.get(`nodeLinker`) === `pnpm`;
57
+ }
51
58
  }
52
59
  exports.PnpmLinker = PnpmLinker;
53
60
  class PnpmInstaller {
@@ -216,11 +223,11 @@ class PnpmInstaller {
216
223
  if (!expectedEntries.has(record))
217
224
  removals.push(fslib_1.xfs.removePromise(fslib_1.ppath.join(storeLocation, record)));
218
225
  await Promise.all(removals);
219
- await removeIfEmpty(storeLocation);
220
226
  }
221
227
  // Wait for the package installs to catch up
222
228
  await this.asyncActions.wait(),
223
- await removeIfEmpty(getNodeModulesLocation(this.opts.project));
229
+ await removeIfEmpty(storeLocation);
230
+ await removeIfEmpty(getNodeModulesLocation(this.opts.project));
224
231
  return {
225
232
  customData: this.customData,
226
233
  };
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@yarnpkg/plugin-pnpm",
3
- "version": "1.1.0-rc.4",
3
+ "version": "1.1.0-rc.8",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "dependencies": {
7
- "@yarnpkg/fslib": "^2.6.1-rc.1",
8
- "@yarnpkg/plugin-pnp": "^3.1.2-rc.6",
7
+ "@yarnpkg/fslib": "^2.6.1-rc.5",
8
+ "@yarnpkg/plugin-pnp": "^3.1.2-rc.10",
9
9
  "@yarnpkg/plugin-stage": "^3.1.1",
10
- "clipanion": "^3.0.1",
10
+ "clipanion": "^3.2.0-rc.4",
11
11
  "p-limit": "^2.2.0",
12
12
  "tslib": "^1.13.0"
13
13
  },
14
14
  "peerDependencies": {
15
- "@yarnpkg/cli": "^3.2.0-rc.6",
16
- "@yarnpkg/core": "^3.2.0-rc.6"
15
+ "@yarnpkg/cli": "^3.2.0-rc.10",
16
+ "@yarnpkg/core": "^3.2.0-rc.10"
17
17
  },
18
18
  "devDependencies": {
19
- "@yarnpkg/cli": "^3.2.0-rc.6",
20
- "@yarnpkg/core": "^3.2.0-rc.6"
19
+ "@yarnpkg/cli": "^3.2.0-rc.10",
20
+ "@yarnpkg/core": "^3.2.0-rc.10"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",