Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .yarn/versions/c071c1e5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-pnp": patch
"@yarnpkg/pnp": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/nm"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
2 changes: 1 addition & 1 deletion packages/yarnpkg-pnp/sources/hook.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/yarnpkg-pnp/sources/loader/makeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,10 @@ export function makeApi(runtimeState: RuntimeState, opts: MakeApiOptions): PnpAp
const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, {extensions});

if (qualifiedPath) {
nodeUtils.reportRequiredFilesToWatchMode([qualifiedPath]);
return ppath.normalize(qualifiedPath);
} else {
nodeUtils.reportRequiredFilesToWatchMode(candidates.map(candidate => npath.fromPortablePath(candidate)));
nodeUtils.reportRequiredFilesToWatchMode(candidates);

const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath);

Expand Down
7 changes: 4 additions & 3 deletions packages/yarnpkg-pnp/sources/loader/nodeUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {NativePath, npath, VirtualFS} from '@yarnpkg/fslib';
import type {NativePath, PortablePath} from '@yarnpkg/fslib';
import {npath, VirtualFS} from '@yarnpkg/fslib';
import fs from 'fs';
import path from 'path';

Expand Down Expand Up @@ -54,9 +55,9 @@ Instead change the require of ${basename} in ${parentPath} to a dynamic import()

// https://github.com/nodejs/node/pull/44366
// https://github.com/nodejs/node/pull/45348
export function reportRequiredFilesToWatchMode(files: Array<NativePath>) {
export function reportRequiredFilesToWatchMode(paths: Array<PortablePath>) {
if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) {
files = files.map(filename => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))));
const files = paths.map(filename => npath.fromPortablePath(VirtualFS.resolveVirtual(filename)));
if (WATCH_MODE_MESSAGE_USES_ARRAYS) {
process.send({'watch:require': files});
} else {
Expand Down
Loading