@@ -7,7 +7,12 @@ import {checkReleaseOutput} from './check-release-output';
7
7
import { extractReleaseNotes } from './extract-release-notes' ;
8
8
import { GitClient } from './git/git-client' ;
9
9
import { getGithubNewReleaseUrl } from './git/github-urls' ;
10
- import { isNpmAuthenticated , runInteractiveNpmLogin , runNpmPublish } from './npm/npm-client' ;
10
+ import {
11
+ isNpmAuthenticated ,
12
+ npmLogout ,
13
+ npmLoginInteractive ,
14
+ npmPublish ,
15
+ } from './npm/npm-client' ;
11
16
import { promptForNpmDistTag } from './prompt/npm-dist-tag-prompt' ;
12
17
import { promptForUpstreamRemote } from './prompt/upstream-remote-prompt' ;
13
18
import { releasePackages } from './release-output/release-packages' ;
@@ -125,6 +130,12 @@ class PublishReleaseTask extends BaseReleaseTask {
125
130
126
131
console . log ( ) ;
127
132
console . info ( green ( bold ( ` ✓ Published all packages successfully` ) ) ) ;
133
+
134
+ // Always log out of npm after releasing to prevent unintentional changes to
135
+ // any packages.
136
+ npmLogout ( ) ;
137
+ console . info ( green ( bold ( ` ✓ Logged out of npm` ) ) ) ;
138
+
128
139
console . info ( yellow ( ` ⚠ Please draft a new release of the version on Github.` ) ) ;
129
140
console . info ( yellow ( ` ${ newReleaseUrl } ` ) ) ;
130
141
}
@@ -194,7 +205,7 @@ class PublishReleaseTask extends BaseReleaseTask {
194
205
console . log ( yellow ( ` ⚠ NPM is currently not authenticated. Running "npm login"..` ) ) ;
195
206
196
207
for ( let i = 0 ; i < MAX_NPM_LOGIN_TRIES ; i ++ ) {
197
- if ( runInteractiveNpmLogin ( ) ) {
208
+ if ( npmLoginInteractive ( ) ) {
198
209
// In case the user was able to login properly, we want to exit the loop as we
199
210
// don't need to ask for authentication again.
200
211
break ;
@@ -217,7 +228,7 @@ class PublishReleaseTask extends BaseReleaseTask {
217
228
private publishPackageToNpm ( packageName : string , npmDistTag : string ) {
218
229
console . info ( green ( ` ⭮ Publishing "${ packageName } "..` ) ) ;
219
230
220
- const errorOutput = runNpmPublish ( join ( this . releaseOutputPath , packageName ) , npmDistTag ) ;
231
+ const errorOutput = npmPublish ( join ( this . releaseOutputPath , packageName ) , npmDistTag ) ;
221
232
222
233
if ( errorOutput ) {
223
234
console . error ( red ( ` ✘ An error occurred while publishing "${ packageName } ".` ) ) ;
0 commit comments