From 7533c5499c95d7907727ad47dcaf95babb7bd48c Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 31 Dec 2024 17:55:22 +0100 Subject: [PATCH] feat: add exports-pnpmfile package --- package.json | 2 +- packages/exports-pnpmfile/package.json | 4 ++++ packages/exports-pnpmfile/pnpmfile.cjs | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 packages/exports-pnpmfile/package.json create mode 100644 packages/exports-pnpmfile/pnpmfile.cjs diff --git a/package.json b/package.json index 8c38b70..24ba619 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pnpm/registry-mock", - "version": "3.46.0", + "version": "3.47.0", "description": "Mock the npm registry", "main": "dist/index.js", "bin": "dist/bin/pnpm-registry-mock.js", diff --git a/packages/exports-pnpmfile/package.json b/packages/exports-pnpmfile/package.json new file mode 100644 index 0000000..ba09716 --- /dev/null +++ b/packages/exports-pnpmfile/package.json @@ -0,0 +1,4 @@ +{ + "name": "@pnpm.e2e/exports-pnpmfile", + "version": "1.0.0" +} diff --git a/packages/exports-pnpmfile/pnpmfile.cjs b/packages/exports-pnpmfile/pnpmfile.cjs new file mode 100644 index 0000000..47aa033 --- /dev/null +++ b/packages/exports-pnpmfile/pnpmfile.cjs @@ -0,0 +1,13 @@ +module.exports = { + hooks: { + readPackage (pkg) { + if (pkg.name === '@pnpm/x') { + if (!pkg.dependencies) { + pkg.dependencies = {} + } + pkg.dependencies['@pnpm/y'] = '1.0.0' + } + return pkg + } + } +}