Debian Codegraph @

.yarn-patches/@lerna/npm-publish.patch

raw
1 diff --git a/npm-publish.js b/npm-publish.js
2 index ee6ad133e..6a31d1775 100644
3 --- a/npm-publish.js
4 +++ b/npm-publish.js
5 @@ -32,6 +32,15 @@ const PublishConfig = figgyPudding(
6 }
7 );
8
9 +function stripWorkspaceProtocolFromDeps(deps) {
10 + if (!deps) return;
11 + for (const [name, version] of Object.entries(deps)) {
12 + if (version.startsWith("workspace:")) {
13 + deps[name] = version.slice(10);
14 + }
15 + }
16 +}
17 +
18 function npmPublish(pkg, tarFilePath, _opts, otpCache) {
19 const { scope } = npa(pkg.name);
20 // pass only the package scope to libnpmpublish
21 @@ -67,6 +76,10 @@ function npmPublish(pkg, tarFilePath, _opts, otpCache) {
22 manifest.publishConfig.tag = opts.tag;
23 }
24
25 + stripWorkspaceProtocolFromDeps(manifest.dependencies);
26 + stripWorkspaceProtocolFromDeps(manifest.peerDependencies);
27 + stripWorkspaceProtocolFromDeps(manifest.devDependencies);
28 +
29 return otplease(innerOpts => publish(manifest, tarData, innerOpts), opts, otpCache).catch(err => {
30 opts.log.silly("", err);
31 opts.log.error(err.code, (err.body && err.body.error) || err.message);