babel/.yarn-patches/@lerna/npm-publish.patch
Huáng Jùnliàng 3fad7eab9b
Use Yarn 2 (#11962)
* chore: use yarn 2

* chore: remove redundant yarn locks

* chore: remove publishEslintPkg

* chore: remove redundant make bootstrap

* Update .yarnrc.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* chore: use workspace protocol for eslint packages in the root

Co-Authored-By: merceyz <merceyz@users.noreply.github.com>

* chore: pin caniuse-lite versions

Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.

* chore: resolve yarn install warnings

* chore: update yarn cache path on circle/travis

* chore: add yarn deduplicate plugin

* chore: deduplicate lock files

* chore: move devDependencies to leaf packages

* chore: remove @yarnpkg/plugin-constraints

* chore: remove unused dedupe options

* test: fix unwanted self reference

* chore: remove output-file-sync dependency

* chore: update browserify to 16.5.2

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2020-08-25 14:37:30 -04:00

32 lines
1.1 KiB
Diff

diff --git a/npm-publish.js b/npm-publish.js
index ee6ad133e..6a31d1775 100644
--- a/npm-publish.js
+++ b/npm-publish.js
@@ -32,6 +32,15 @@ const PublishConfig = figgyPudding(
}
);
+function stripWorkspaceProtocolFromDeps(deps) {
+ if (!deps) return;
+ for (const [name, version] of Object.entries(deps)) {
+ if (version.startsWith("workspace:")) {
+ deps[name] = version.slice(10);
+ }
+ }
+}
+
function npmPublish(pkg, tarFilePath, _opts, otpCache) {
const { scope } = npa(pkg.name);
// pass only the package scope to libnpmpublish
@@ -67,6 +76,10 @@ function npmPublish(pkg, tarFilePath, _opts, otpCache) {
manifest.publishConfig.tag = opts.tag;
}
+ stripWorkspaceProtocolFromDeps(manifest.dependencies);
+ stripWorkspaceProtocolFromDeps(manifest.peerDependencies);
+ stripWorkspaceProtocolFromDeps(manifest.devDependencies);
+
return otplease(innerOpts => publish(manifest, tarData, innerOpts), opts, otpCache).catch(err => {
opts.log.silly("", err);
opts.log.error(err.code, (err.body && err.body.error) || err.message);