Skip to content

Commit cee4fd1

Browse files
committed
chore(plugin-pnpm): use NodeLinker enum
1 parent ad8e7b5 commit cee4fd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/plugin-pnpm/sources/PnpmLinker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Descriptor, FetchResult, formatUtils, Installer, InstallPackageExtraApi, Linker, LinkOptions, LinkType, Locator, LocatorHash, Manifest, MessageName, MinimalLinkOptions, Package, Project, miscUtils, structUtils, WindowsLinkType} from '@yarnpkg/core';
22
import {Filename, PortablePath, setupCopyIndex, ppath, xfs, DirentNoPath} from '@yarnpkg/fslib';
3-
import {jsInstallUtils} from '@yarnpkg/plugin-pnp';
3+
import {NodeLinker, jsInstallUtils} from '@yarnpkg/plugin-pnp';
44
import {UsageError} from 'clipanion';
55

66
export type PnpmCustomData = {
@@ -76,7 +76,7 @@ export class PnpmLinker implements Linker {
7676
}
7777

7878
private isEnabled(opts: MinimalLinkOptions) {
79-
return opts.project.configuration.get(`nodeLinker`) === `pnpm`;
79+
return opts.project.configuration.get(`nodeLinker`) === NodeLinker.PNPM;
8080
}
8181
}
8282

@@ -170,7 +170,7 @@ class PnpmInstaller implements Installer {
170170
}
171171

172172
async attachInternalDependencies(locator: Locator, dependencies: Array<[Descriptor, Locator]>) {
173-
if (this.opts.project.configuration.get(`nodeLinker`) !== `pnpm`)
173+
if (this.opts.project.configuration.get(`nodeLinker`) !== NodeLinker.PNPM)
174174
return;
175175

176176
// We don't install those packages at all, because they can't be used anyway
@@ -264,7 +264,7 @@ class PnpmInstaller implements Installer {
264264
async finalizeInstall() {
265265
const storeLocation = getStoreLocation(this.opts.project);
266266

267-
if (this.opts.project.configuration.get(`nodeLinker`) !== `pnpm`) {
267+
if (this.opts.project.configuration.get(`nodeLinker`) !== NodeLinker.PNPM) {
268268
await xfs.removePromise(storeLocation);
269269
} else {
270270
let extraneous: Set<Filename>;
@@ -295,7 +295,7 @@ class PnpmInstaller implements Installer {
295295
await this.asyncActions.wait();
296296

297297
await removeIfEmpty(storeLocation);
298-
if (this.opts.project.configuration.get(`nodeLinker`) !== `node-modules`)
298+
if (this.opts.project.configuration.get(`nodeLinker`) !== NodeLinker.NODE_MODULES)
299299
await removeIfEmpty(getNodeModulesLocation(this.opts.project));
300300

301301
return {

0 commit comments

Comments
 (0)