Skip to content

Commit

Permalink
fix(build): fix release-it using npm publish instead of yarn npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamr committed Feb 7, 2021
1 parent dcf5caa commit be8c006
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"react-test-renderer": "16.13.1",
"react-native-webview": "11.0.0",
"@release-it/conventional-changelog": "patch:@release-it/[email protected]#patches/@release-it-conventional-changelog.patch",
"release-it": "14.3.0"
"release-it": "patch:release-it@14.3.0#patches/release-it.patch"
},
"author": "Jules Sam. Randolph <[email protected]> (https://github.com/jsamr)",
"license": "MIT",
Expand Down
13 changes: 13 additions & 0 deletions patches/release-it.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/plugin/npm/npm.js b/lib/plugin/npm/npm.js
index 12a28d26db8d78fa7ce011d8d201668fb21b8f97..65be3f3bd7fb370cf95cee794c288ded15149558 100644
--- a/lib/plugin/npm/npm.js
+++ b/lib/plugin/npm/npm.js
@@ -229,7 +229,7 @@ class npm extends Plugin {
this.log.warn('Skip publish: package is private.');
return false;
}
- return this.exec(`npm publish ${publishPath} --tag ${tag} ${otpArg} ${dryRunArg}`, { options })
+ return (this.config.isDryRun ? this.exec(`npm publish ${publishPath} --tag ${tag} ${otpArg} ${dryRunArg}`, { options }) : this.exec(`yarn npm publish --tag ${tag}`, { options }))
.then(() => {
this.setContext({ isReleased: true });
})
40 changes: 39 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15286,7 +15286,7 @@ fsevents@^1.2.7:
languageName: unknown
linkType: soft

"release-it@npm:14.3.0":
[email protected]:
version: 14.3.0
resolution: "release-it@npm:14.3.0"
dependencies:
Expand Down Expand Up @@ -15324,6 +15324,44 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"release-it@patch:[email protected]#patches/release-it.patch::locator=plugins-project%40workspace%3A.":
version: 14.3.0
resolution: "release-it@patch:release-it@npm%3A14.3.0#patches/release-it.patch::version=14.3.0&hash=915f03&locator=plugins-project%40workspace%3A."
dependencies:
"@iarna/toml": 2.2.5
"@octokit/rest": 18.0.14
async-retry: 1.3.1
chalk: 4.1.0
cosmiconfig: 7.0.0
debug: 4.3.1
deprecated-obj: 2.0.0
execa: 5.0.0
find-up: 5.0.0
form-data: 3.0.0
git-url-parse: 11.4.3
globby: 11.0.2
got: 11.8.1
import-cwd: 3.0.0
inquirer: 7.3.3
is-ci: 2.0.0
lodash: 4.17.20
mime-types: 2.1.28
ora: 5.3.0
os-name: 4.0.0
parse-json: 5.2.0
semver: 7.3.4
shelljs: 0.8.4
update-notifier: 5.0.1
url-join: 4.0.1
uuid: 8.3.2
yaml: 1.10.0
yargs-parser: 20.2.4
bin:
release-it: bin/release-it.js
checksum: 42a5d8423c58cc1b129d058dbf21c307f8c22babe29c42b65150da1adfcdade5c8ea778ee3c830b49ec8033c06006e296557690b169ae7c66af09a0591fdf090
languageName: node
linkType: hard

"remove-trailing-separator@npm:^1.0.1":
version: 1.1.0
resolution: "remove-trailing-separator@npm:1.1.0"
Expand Down

0 comments on commit be8c006

Please sign in to comment.