Skip to content

Commit 40c9e6c

Browse files
private packages dont need npm token
1 parent 5316561 commit 40c9e6c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

plugins/npm/src/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,12 @@ export default class NPMPlugin implements IPlugin {
527527
return;
528528
}
529529

530+
const { private: isPrivate } = await loadPackageJson();
531+
532+
if (isPrivate) {
533+
return;
534+
}
535+
530536
auto.checkEnv(this.name, "NPM_TOKEN");
531537
});
532538

@@ -814,8 +820,8 @@ export default class NPMPlugin implements IPlugin {
814820

815821
if (isPrivate) {
816822
return {
817-
error: 'Package private, cannot make canary release to npm.'
818-
}
823+
error: "Package private, cannot make canary release to npm.",
824+
};
819825
}
820826

821827
let canaryVersion = determineNextVersion(
@@ -957,7 +963,9 @@ export default class NPMPlugin implements IPlugin {
957963
]);
958964

959965
if (isPrivate) {
960-
auto.logger.log.info(`Package private, skipping prerelease publish to npm.`);
966+
auto.logger.log.info(
967+
`Package private, skipping prerelease publish to npm.`
968+
);
961969
} else {
962970
await execPromise("npm", [
963971
"publish",

0 commit comments

Comments
 (0)