Skip to content

Commit

Permalink
fix: handle newer npm publish directories
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Aug 19, 2022
1 parent 35ac9d2 commit 961b8ac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/rollout/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ async function npmPublish(pkgJson, options) {
const args = ['publish'];

if (publishDir) {
// npm@7 and above require an unambigious path otherwise
// it will assume things like 'lib' or 'dist/esm' are github repos
if (!publishDir.startsWith('.') && !path.isAbsolute(publishDir)) {
publishDir = `./${publishDir}`
}

args.push(publishDir, '--ignore-scripts');

// We run the lifecycle scripts manually to ensure they run in
Expand Down Expand Up @@ -249,10 +255,6 @@ const handlerImpl = async (argv) => {
// older rollout
if (!publishDir && packageJson.release) {
publishDir = packageJson.release.publishDir;
if (publishDir)
ConsoleUtilities.warn(
'publishDir in package.json `release` field is deprecated. Use the `publishConfig.directory` field instead.',
);
}

await runTasks([
Expand Down

0 comments on commit 961b8ac

Please sign in to comment.