Socket
Socket
Sign inDemoInstall

@yarnpkg/esbuild-plugin-pnp

Package Overview
Dependencies
Maintainers
6
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarnpkg/esbuild-plugin-pnp - npm Package Compare versions

Comparing version 1.0.1-rc.8 to 2.0.0-rc.1

1

lib/index.d.ts
import type { OnLoadArgs, OnLoadResult, OnResolveArgs, OnResolveResult, Plugin } from 'esbuild';
declare type OnResolveParams = {
resolvedPath: string | null;
watchFiles: Array<string>;
error?: Error;

@@ -5,0 +6,0 @@ };

19

lib/index.js

@@ -42,3 +42,3 @@ "use strict";

}
async function defaultOnResolve(args, { resolvedPath, error }) {
async function defaultOnResolve(args, { resolvedPath, error, watchFiles }) {
const problems = error ? [{ text: error.message }] : [];

@@ -65,6 +65,6 @@ // Sometimes dynamic resolve calls might be wrapped in a try / catch,

if (resolvedPath !== null) {
return { namespace: `pnp`, path: resolvedPath };
return { namespace: `pnp`, path: resolvedPath, watchFiles };
}
else {
return { external: true, ...mergeWith };
return { external: true, ...mergeWith, watchFiles };
}

@@ -82,2 +82,3 @@ }

build.onResolve({ filter }, args => {
var _a, _b;
if (isExternal(args.path, externals))

@@ -104,3 +105,13 @@ return { external: true };

}
return onResolve(args, { resolvedPath: path, error });
const watchFiles = [pnpApi.resolveRequest(`pnpapi`, null)];
if (path) {
const locator = pnpApi.findPackageLocator(path);
if (locator) {
const info = pnpApi.getPackageInformation(locator);
if ((info === null || info === void 0 ? void 0 : info.linkType) === `SOFT`) {
watchFiles.push((_b = (_a = pnpApi.resolveVirtual) === null || _a === void 0 ? void 0 : _a.call(pnpApi, path)) !== null && _b !== void 0 ? _b : path);
}
}
}
return onResolve(args, { resolvedPath: path, error, watchFiles });
});

@@ -107,0 +118,0 @@ // We register on the build to prevent ESBuild from reading the files

{
"name": "@yarnpkg/esbuild-plugin-pnp",
"version": "1.0.1-rc.8",
"version": "2.0.0-rc.1",
"license": "BSD-2-Clause",

@@ -10,6 +10,6 @@ "main": "./lib/index.js",

"peerDependencies": {
"esbuild": ">=0.8.36"
"esbuild": ">=0.10.0"
},
"devDependencies": {
"@yarnpkg/pnp": "^3.1.0-rc.4",
"@yarnpkg/pnp": "^3.1.0-rc.5",
"esbuild": "npm:esbuild-wasm@^0.11.20"

@@ -16,0 +16,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc