From 75ade33dbf278b2406deb526e8c51df946f85712 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:28:15 -0700 Subject: [PATCH] Fixed Dependency Hook --- .pnpmfile.cjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 949aace3b65..b3bb24ef3b5 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -105,7 +105,7 @@ function isLinkedPackage( packagePath, lockVersion ) { // We can parse the version that PNPM stores in order to get the relative path to the package. // file: dependencies use a relative path with dependencies listed in parentheses after it. // workspace: dependencies just store the relative path from the package itself. - const match = lockVersion.match( /^(?:file:|link:)([^<>:"|?*()]+)/i ); + const match = lockVersion.match( /^(?:file:|link:)((?:\.?\/|\.\.\/)[^\^<>:"|?*()]+)/i ); if ( ! match ) { return false; } @@ -141,12 +141,14 @@ function getLinkedPackages( packagePath, lockPackage ) { for ( const packageName in possiblePackages ) { const linkedPackagePath = isLinkedPackage( packagePath, - possiblePackages[ packageName ] + possiblePackages[ packageName ], ); if ( ! linkedPackagePath ) { continue; } + + // Load the linked package file and mark it as a dependency. linkedPackages[ linkedPackagePath ] = loadPackageFile( linkedPackagePath ); @@ -184,7 +186,7 @@ function updateWireitDependencies( lockPackages, context ) { // changed then the lock file will be updated and the fingerprint will change too. const linkedPackages = getLinkedPackages( packagePath, - lockPackages[ packagePath ] + lockPackages[ packagePath ], ); // In order to make maintaining the list easy we use a wireit-only script named "dependencies" to keep the list up to date. @@ -194,7 +196,7 @@ function updateWireitDependencies( lockPackages, context ) { allowUsuallyExcludedPaths: true, // The files list will include globs for dependency files that we should fingerprint. - files: [], + files: [ "package.json" ], }; // We're going to spin through all of the dependencies for the package and add