@yarnpkg/plugin-pnpm 2.0.0-rc.5 → 2.0.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.
@@ -5,6 +5,7 @@ export declare type PnpmCustomData = {
5
5
  locatorByPath: Map<PortablePath, string>;
6
6
  };
7
7
  export declare class PnpmLinker implements Linker {
8
+ getCustomDataKey(): string;
8
9
  supportsPackage(pkg: Package, opts: MinimalLinkOptions): boolean;
9
10
  findPackageLocation(locator: Locator, opts: LinkOptions): Promise<PortablePath>;
10
11
  findPackageLocator(location: PortablePath, opts: LinkOptions): Promise<Locator | null>;
@@ -15,7 +16,6 @@ declare class PnpmInstaller implements Installer {
15
16
  private opts;
16
17
  private readonly asyncActions;
17
18
  constructor(opts: LinkOptions);
18
- getCustomDataKey(): string;
19
19
  private customData;
20
20
  attachCustomData(customData: any): void;
21
21
  installPackage(pkg: Package, fetchResult: FetchResult, api: InstallPackageExtraApi): Promise<{
package/lib/PnpmLinker.js CHANGED
@@ -6,14 +6,20 @@ const fslib_1 = require("@yarnpkg/fslib");
6
6
  const plugin_pnp_1 = require("@yarnpkg/plugin-pnp");
7
7
  const clipanion_1 = require("clipanion");
8
8
  class PnpmLinker {
9
+ getCustomDataKey() {
10
+ return JSON.stringify({
11
+ name: `PnpmLinker`,
12
+ version: 2,
13
+ });
14
+ }
9
15
  supportsPackage(pkg, opts) {
10
16
  return this.isEnabled(opts);
11
17
  }
12
18
  async findPackageLocation(locator, opts) {
13
19
  if (!this.isEnabled(opts))
14
20
  throw new Error(`Assertion failed: Expected the pnpm linker to be enabled`);
15
- const customDataKey = getCustomDataKey();
16
- const customData = opts.project.installersCustomData.get(customDataKey);
21
+ const customDataKey = this.getCustomDataKey();
22
+ const customData = opts.project.linkersCustomData.get(customDataKey);
17
23
  if (!customData)
18
24
  throw new clipanion_1.UsageError(`The project in ${core_1.formatUtils.pretty(opts.project.configuration, `${opts.project.cwd}/package.json`, core_1.formatUtils.Type.PATH)} doesn't seem to have been installed - running an install there might help`);
19
25
  const packageLocation = customData.pathByLocator.get(locator.locatorHash);
@@ -24,8 +30,8 @@ class PnpmLinker {
24
30
  async findPackageLocator(location, opts) {
25
31
  if (!this.isEnabled(opts))
26
32
  return null;
27
- const customDataKey = getCustomDataKey();
28
- const customData = opts.project.installersCustomData.get(customDataKey);
33
+ const customDataKey = this.getCustomDataKey();
34
+ const customData = opts.project.linkersCustomData.get(customDataKey);
29
35
  if (!customData)
30
36
  throw new clipanion_1.UsageError(`The project in ${core_1.formatUtils.pretty(opts.project.configuration, `${opts.project.cwd}/package.json`, core_1.formatUtils.Type.PATH)} doesn't seem to have been installed - running an install there might help`);
31
37
  const nmRootLocation = location.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);
@@ -65,9 +71,6 @@ class PnpmInstaller {
65
71
  };
66
72
  // Nothing to do
67
73
  }
68
- getCustomDataKey() {
69
- return getCustomDataKey();
70
- }
71
74
  attachCustomData(customData) {
72
75
  // We don't want to attach the data because it's only used in the Linker and we'll recompute it anyways in the Installer,
73
76
  // it needs to be invalidated because otherwise we'll never prune the store or we might run into various issues.
@@ -232,12 +235,6 @@ class PnpmInstaller {
232
235
  };
233
236
  }
234
237
  }
235
- function getCustomDataKey() {
236
- return JSON.stringify({
237
- name: `PnpmInstaller`,
238
- version: 2,
239
- });
240
- }
241
238
  function getNodeModulesLocation(project) {
242
239
  return fslib_1.ppath.join(project.cwd, fslib_1.Filename.nodeModules);
243
240
  }
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@yarnpkg/plugin-pnpm",
3
- "version": "2.0.0-rc.5",
3
+ "version": "2.0.0-rc.8",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "dependencies": {
7
- "@yarnpkg/fslib": "^3.0.0-rc.5",
8
- "@yarnpkg/plugin-pnp": "^4.0.0-rc.5",
9
- "@yarnpkg/plugin-stage": "^4.0.0-rc.5",
7
+ "@yarnpkg/fslib": "^3.0.0-rc.8",
8
+ "@yarnpkg/plugin-pnp": "^4.0.0-rc.8",
9
+ "@yarnpkg/plugin-stage": "^4.0.0-rc.8",
10
10
  "clipanion": "^3.2.0-rc.10",
11
11
  "p-limit": "^2.2.0",
12
12
  "tslib": "^1.13.0"
13
13
  },
14
14
  "peerDependencies": {
15
- "@yarnpkg/cli": "^4.0.0-rc.5",
16
- "@yarnpkg/core": "^4.0.0-rc.5"
15
+ "@yarnpkg/cli": "^4.0.0-rc.8",
16
+ "@yarnpkg/core": "^4.0.0-rc.8"
17
17
  },
18
18
  "devDependencies": {
19
- "@yarnpkg/cli": "^4.0.0-rc.5",
20
- "@yarnpkg/core": "^4.0.0-rc.5"
19
+ "@yarnpkg/cli": "^4.0.0-rc.8",
20
+ "@yarnpkg/core": "^4.0.0-rc.8"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",