@yarnpkg/plugin-pnpm 1.1.0-rc.1 → 1.1.0-rc.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.
@@ -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 {
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@yarnpkg/plugin-pnpm",
3
- "version": "1.1.0-rc.1",
3
+ "version": "1.1.0-rc.5",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "dependencies": {
7
- "@yarnpkg/fslib": "^2.6.0",
8
- "@yarnpkg/plugin-pnp": "^3.1.2-rc.3",
7
+ "@yarnpkg/fslib": "^2.6.1-rc.2",
8
+ "@yarnpkg/plugin-pnp": "^3.1.2-rc.7",
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.3",
16
- "@yarnpkg/core": "^3.2.0-rc.3"
15
+ "@yarnpkg/cli": "^3.2.0-rc.7",
16
+ "@yarnpkg/core": "^3.2.0-rc.7"
17
17
  },
18
18
  "devDependencies": {
19
- "@yarnpkg/cli": "^3.2.0-rc.3",
20
- "@yarnpkg/core": "^3.2.0-rc.3"
19
+ "@yarnpkg/cli": "^3.2.0-rc.7",
20
+ "@yarnpkg/core": "^3.2.0-rc.7"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",