Skip to content

Commit

Permalink
fix(publish-npm): Avoid fake changes
Browse files Browse the repository at this point in the history
This normalization is required because NPM formats package.json so it's different on retrieval
  • Loading branch information
klarstrup committed Mar 22, 2024
1 parent 3e13b01 commit 5c591e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions publish-npm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ async function diff(oldPath, newPath) {
/ {2}"version": "(.+)",\n/gi,
''
);
if (key === 'package.json') {
oldFile.contents = oldFile.contents.trim() + '\n';
newFile.contents = newFile.contents.trim() + '\n';
}

// Files are straight up equal.
if (oldFile.contents === newFile.contents) return [key, null];
Expand Down

0 comments on commit 5c591e7

Please sign in to comment.